From cbfc2bbf6aff988b7cac5fa1aef1095cf9101a15 Mon Sep 17 00:00:00 2001 From: cconopoima Date: Wed, 29 Mar 2023 10:55:03 -0300 Subject: [PATCH] Solving more issues. Carefull var init in constructor to avoid compilation warnings. Diasable EnforcedVertice and EnforceMesh widget when MGTetraHPC is selected. Avoid ref to non initialized class member on call to CommandToRun static method. --- src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx | 3 ++- src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx | 9 +++++---- src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx | 9 ++++++--- src/GUI/GHS3DPluginGUI_HypothesisCreator.h | 6 +++--- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx index 2f3b55e..4322fad 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx @@ -1824,8 +1824,9 @@ std::string GHS3DPlugin_Hypothesis::CommandToRun(const GHS3DPlugin_Hypothesis* h const bool hasShapeToMesh, const bool forExecutable) { - GHS3DPlugin_Hypothesis::ImplementedAlgorithms algoId = (ImplementedAlgorithms) hyp->myAlgorithm; + GHS3DPlugin_Hypothesis::ImplementedAlgorithms algoId = hyp ? (ImplementedAlgorithms) hyp->myAlgorithm : MGTetra; std::string cmd = GetExeName( algoId ); + // check if any option is overridden by hyp->myTextOption bool max_memory = hyp ? !hyp->HasOptionDefined("max_memory") : true; bool auto_memory = hyp ? !hyp->HasOptionDefined("automatic_memory") : true; diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx index 1b52bb6..1c0e864 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx @@ -414,14 +414,15 @@ protected: double myGradation; bool myUseVolumeProximity; int myNbVolumeProximityLayers; - double myMinSize, myMinSizeDefault; - double myMaxSize, myMaxSizeDefault; - //std::string myTextOption; short myAlgorithm; //member used to pivot between MG-Tetra and MG-Tetra - bool myUseNumOfThreads; short myNumOfThreads; + bool myUseNumOfThreads; short myPthreadModeMG; short myPthreadModeMGHPC; + double myMinSize, myMinSizeDefault; + double myMaxSize, myMaxSizeDefault; + //std::string myTextOption; + TOptionValues _option2value, _customOption2value; // user defined values TOptionValues _defaultOptionValues; // default values diff --git a/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx b/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx index 2589be3..05e1e7f 100644 --- a/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx @@ -304,12 +304,12 @@ GHS3DPluginGUI_HypothesisCreator::GHS3DPluginGUI_HypothesisCreator( const QStrin myOptimizationLevelCombo(0), myMinSizeCheck(0), myMaxSizeCheck(0), - myNumOfThreadsCheck(0), myMinSizeSpin(0), myMaxSizeSpin(0), + myNumOfThreadsCheck(0), + myNumOfThreadsSpin(0), myGradationCheck(0), myGradationSpin(0), - myNumOfThreadsSpin(0), myUseProximityGroup(0), myNbProximityLayers(0), myToMakeGroupsOfDomains(0), @@ -380,7 +380,8 @@ void GHS3DPluginGUI_HypothesisCreator::onRadioButtomSelect() myAdvWidget->initialMemoryCheck ->setEnabled( true ); myAdvWidget->EnableAdvancedOptions( true ); - + myEnfGroup->setEnabled( true ); + myEnfMeshGroup->setEnabled( true ); } else if ( myRadioBottomGroup->checkedId() == GHS3DPlugin_Hypothesis::MGTetraHPC ) { @@ -392,6 +393,8 @@ void GHS3DPluginGUI_HypothesisCreator::onRadioButtomSelect() myAdvWidget->maxMemoryCheck ->setEnabled( false ); myAdvWidget->initialMemoryCheck ->setEnabled( false ); myAdvWidget->EnableAdvancedOptions( false ); + myEnfGroup->setEnabled( false ); + myEnfMeshGroup->setEnabled( false ); } } diff --git a/src/GUI/GHS3DPluginGUI_HypothesisCreator.h b/src/GUI/GHS3DPluginGUI_HypothesisCreator.h index b7cb887..3201e03 100644 --- a/src/GUI/GHS3DPluginGUI_HypothesisCreator.h +++ b/src/GUI/GHS3DPluginGUI_HypothesisCreator.h @@ -235,9 +235,6 @@ private: QCheckBox* myMaxSizeCheck; SMESHGUI_SpinBox* myMinSizeSpin; SMESHGUI_SpinBox* myMaxSizeSpin; - QButtonGroup* myRadioBottomGroup; - QComboBox* myPthreadMode; - QComboBox* myParallelMode; QCheckBox* myNumOfThreadsCheck; SalomeApp_IntSpinBox* myNumOfThreadsSpin; mutable double myMinSizeDefault, myMaxSizeDefault; @@ -256,6 +253,9 @@ private: SalomeApp_IntSpinBox* myNumberOfThreadsSpin; QCheckBox* mySmoothOffSliversCheck; QCheckBox* myCreateNewNodesCheck; + QComboBox* myPthreadMode; + QComboBox* myParallelMode; + QButtonGroup* myRadioBottomGroup; QWidget* myAdvGroup; GHS3DPluginGUI_AdvWidget* myAdvWidget; -- 2.39.2