Skip to content
Snippets Groups Projects
Commit e27eb657 authored by Joseph Boudreau's avatar Joseph Boudreau
Browse files

1. Switch all Qt-based components (FSL and gmex) to QT6.

2. Do not query SoQt for line width limits but use fixed values.  The
   query function is not documented and no longer works.  This also
   results in a simplification of the gmex code.
parent f2d618b2
Branches
No related tags found
1 merge request!458Switch all Qt-based components (FSL and gmex) to QT6.
Pipeline #12151910 failed
......@@ -63,7 +63,7 @@ option(GEOMODEL_BUILD_FULLSIMLIGHT "Enable the build of FullSimLight" OFF)
option(GEOMODEL_BUILD_FULLSIMLIGHT_PROFILING "Enable FullSimLight profiling targets" OFF)
option(GEOMODEL_BUILD_FSL "Enable the build of FSL and FullSimLight" OFF)
option(GEOMODEL_BUILD_ATLASEXTENSIONS "Build the Custom ATLAS Extensions" OFF)
option(GEOMODEL_USE_QT6 "Use QT6 for Visualization and FSL" OFF)
option(GEOMODEL_USE_QT6 "Use QT6 for Visualization and FSL" ON)
if(GEOMODEL_BUILD_FSL AND GEOMODEL_BUILD_FULLSIMLIGHT)
message(STATUS "==> NOTE: You enabled both BUILD_FSL and BUILD_FULLSIMLIGHT. Since BUILD_FSL triggers the build of the FullSimLight package as well, I set BUILD_FULLSIMLIGHT to FALSE to avoid errors of 'double inclusion'")
......
......@@ -16,7 +16,7 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
project( "fsl" VERSION ${GeoModel_VERSION} LANGUAGES CXX )
#Choose QT version here:
option (GEOMODEL_USE_QT6 "Use Qt6 for Visualization" OFF)
option (GEOMODEL_USE_QT6 "Use Qt6 for Visualization" ON)
if (GEOMODEL_USE_QT6)
set (QT_VERSION 6)
......
......@@ -26,7 +26,7 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
project( "GeoModelVisualization" VERSION ${GeoModel_VERSION} LANGUAGES CXX )
#Choose QT version here:
option (GEOMODEL_USE_QT6 "Use Qt6 for Visualization" OFF)
option (GEOMODEL_USE_QT6 "Use Qt6 for Visualization" ON)
if (GEOMODEL_USE_QT6)
set (QT_VERSION 6)
......
......@@ -147,9 +147,6 @@ public:
static double getValueLineWidthSlider(const QSlider *);
static double getValuePointSizeSlider(const QSlider *);
//Call whenever making a renderarea (so we don't need to create extra instances just for this info):
static void ensureInitLineWidthAndPointSize(SoQtRenderArea*);
private:
VP1QtInventorUtils();
......
......@@ -100,7 +100,6 @@ void IVP13DChannelWidget::registerRenderArea(VP1ExaminerViewer* ra)
message("Error - tried to register NULL render area!");
return;
}
VP1QtInventorUtils::ensureInitLineWidthAndPointSize(ra);
m_d->renderareas.push_back(ra);
m_d->itE = m_d->renderareas.end();
......
......@@ -366,7 +366,6 @@ public:
static QString buffer_writeaction(SoNode * root);
static void buffer_vrmlwriteaction(SoNode * root, const QString& filename);
static bool lineWidthAndPointSizeNeedsInit;
static double allowedLineWidthMin;
static double allowedLineWidthMax;
static double allowedLineWidthGranularity;
......@@ -379,13 +378,12 @@ public:
};
bool VP1QtInventorUtils::Imp::lineWidthAndPointSizeNeedsInit = true;
double VP1QtInventorUtils::Imp::allowedLineWidthMin = -1.0;
double VP1QtInventorUtils::Imp::allowedLineWidthMax = -1.0;
double VP1QtInventorUtils::Imp::allowedLineWidthGranularity = -1.0;
double VP1QtInventorUtils::Imp::allowedPointSizeMin = -1.0;
double VP1QtInventorUtils::Imp::allowedPointSizeMax = -1.0;
double VP1QtInventorUtils::Imp::allowedPointSizeGranularity = -1.0;
double VP1QtInventorUtils::Imp::allowedLineWidthMin = 1;
double VP1QtInventorUtils::Imp::allowedLineWidthMax = 7.0;
double VP1QtInventorUtils::Imp::allowedLineWidthGranularity = 0.5;
double VP1QtInventorUtils::Imp::allowedPointSizeMin = 1;
double VP1QtInventorUtils::Imp::allowedPointSizeMax = 12;
double VP1QtInventorUtils::Imp::allowedPointSizeGranularity = 0.5;
//____________________________________________________________________
VP1QtInventorUtils::VP1QtInventorUtils()
......@@ -1495,8 +1493,6 @@ void VP1QtInventorUtils::setMatColor( SoMaterial * m, const QColor& col,
//_____________________________________________________________________________________
void VP1QtInventorUtils::getLineWidthRanges(double& min, double& max, double& granularity)
{
if (Imp::lineWidthAndPointSizeNeedsInit)
ensureInitLineWidthAndPointSize(0);
min = Imp::allowedLineWidthMin;
max = Imp::allowedLineWidthMax;
granularity = Imp::allowedLineWidthGranularity;
......@@ -1505,8 +1501,6 @@ void VP1QtInventorUtils::getLineWidthRanges(double& min, double& max, double& gr
//_____________________________________________________________________________________
void VP1QtInventorUtils::getPointSizeRanges(double& min, double& max, double& granularity)
{
if (Imp::lineWidthAndPointSizeNeedsInit)
ensureInitLineWidthAndPointSize(0);
min = Imp::allowedPointSizeMin;
max = Imp::allowedPointSizeMax;
granularity = Imp::allowedPointSizeGranularity;
......@@ -1514,58 +1508,11 @@ void VP1QtInventorUtils::getPointSizeRanges(double& min, double& max, double& gr
#include "VP1Base/VP1ExaminerViewer.h"
//_____________________________________________________________________________________
void VP1QtInventorUtils::ensureInitLineWidthAndPointSize( SoQtRenderArea * ra )
{
if (!Imp::lineWidthAndPointSizeNeedsInit)
return;
Imp::lineWidthAndPointSizeNeedsInit = false;
QWidget * w(0);
if (!ra) {
VP1Msg::messageVerbose("VP1QtInventorUtils WARNING: Have to create temporary renderarea for the sole "
"purpose of getting supported line widths and point sizes!");
w = new QWidget(0);
ra = new VP1ExaminerViewer(w);
}
SbVec2f range; float granularity;
ra->getLineWidthLimits(range, granularity);
float a,b;
range.getValue(a,b);
Imp::allowedLineWidthMin = a;
Imp::allowedLineWidthMax = b;
Imp::allowedLineWidthGranularity = granularity;
VP1Msg::messageVerbose("VP1QtInventorUtils Determined line widths supported by hardware (min,max,granularity) = ("
+VP1Msg::str(a)+", "+VP1Msg::str(b)+", "+VP1Msg::str(granularity)+")");
ra->getPointSizeLimits(range, granularity);
range.getValue(a,b);
Imp::allowedPointSizeMin = a;
Imp::allowedPointSizeMax = b;
Imp::allowedPointSizeGranularity = granularity;
VP1Msg::messageVerbose("VP1QtInventorUtils Determined point sizes supported by hardware (min,max,granularity) = ("
+VP1Msg::str(a)+", "+VP1Msg::str(b)+", "+VP1Msg::str(granularity)+")");
if (w) {
delete ra;
delete w;
}
//We clip to get a more consistent behaviour across hardware (and to limit ourselves to reasonable values:
if (Imp::allowedLineWidthMin<0.5)
Imp::allowedLineWidthMin = 0.5;
if (Imp::allowedLineWidthMax>7.0)
Imp::allowedLineWidthMax = 7.0;
if (Imp::allowedPointSizeMin<0.5)
Imp::allowedPointSizeMin = 0.5;
if (Imp::allowedPointSizeMax>12.0)
Imp::allowedPointSizeMax = 12.0;
}
//_____________________________________________________________________________________
void VP1QtInventorUtils::setLimitsLineWidthSlider(QSlider * slider)
{
if (!slider)
return;
if (Imp::lineWidthAndPointSizeNeedsInit)
ensureInitLineWidthAndPointSize(0);
int nsteps = std::min(1000,std::max<int>(0,static_cast<int>((Imp::allowedLineWidthMax-Imp::allowedLineWidthMin)/Imp::allowedLineWidthGranularity)));
int stepsPerUnit = std::min(nsteps,std::max<int>(1,static_cast<int>(1.0/Imp::allowedLineWidthGranularity)));
slider->setRange(0,nsteps);
......@@ -1578,8 +1525,6 @@ void VP1QtInventorUtils::setLimitsPointSizeSlider(QSlider * slider)
{
if (!slider)
return;
if (Imp::lineWidthAndPointSizeNeedsInit)
ensureInitLineWidthAndPointSize(0);
int nsteps = std::min(1000,std::max<int>(0,
static_cast<int>(0.5+(Imp::allowedPointSizeMax-Imp::allowedPointSizeMin)/Imp::allowedPointSizeGranularity)));
int stepsPerUnit = std::min(nsteps,std::max<int>(1,
......@@ -1594,8 +1539,6 @@ void VP1QtInventorUtils::setValueLineWidthSlider(QSlider * slider, const double&
{
if (!slider)
return;
if (Imp::lineWidthAndPointSizeNeedsInit)
ensureInitLineWidthAndPointSize(0);
int itarget = std::min(slider->maximum(),std::max<int>(slider->minimum(),
static_cast<int>(0.5+(value-Imp::allowedLineWidthMin)/Imp::allowedLineWidthGranularity)));
if (slider->value()!=itarget)
......@@ -1607,8 +1550,6 @@ void VP1QtInventorUtils::setValuePointSizeSlider(QSlider * slider, const double&
{
if (!slider)
return;
if (Imp::lineWidthAndPointSizeNeedsInit)
ensureInitLineWidthAndPointSize(0);
int itarget = std::min(slider->maximum(),std::max<int>(slider->minimum(),
static_cast<int>(0.5+(value-Imp::allowedPointSizeMin)/Imp::allowedPointSizeGranularity)));
if (slider->value()!=itarget)
......@@ -1620,8 +1561,6 @@ double VP1QtInventorUtils::getValueLineWidthSlider(const QSlider * slider)
{
if (!slider)
return 1.0;
if (Imp::lineWidthAndPointSizeNeedsInit)
ensureInitLineWidthAndPointSize(0);
return std::max(Imp::allowedLineWidthMin,std::min(Imp::allowedLineWidthMax,
Imp::allowedLineWidthMin+Imp::allowedLineWidthGranularity * slider->value()));
}
......@@ -1631,8 +1570,6 @@ double VP1QtInventorUtils::getValuePointSizeSlider(const QSlider * slider)
{
if (!slider)
return 1.0;
if (Imp::lineWidthAndPointSizeNeedsInit)
ensureInitLineWidthAndPointSize(0);
return std::max(Imp::allowedPointSizeMin,std::min(Imp::allowedPointSizeMax,
Imp::allowedPointSizeMin+Imp::allowedPointSizeGranularity * slider->value()));
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment