Salome HOME
0020978: EDF 1475 SMESH: Convert linear to quadratic on a submesh
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_Hypotheses.cxx
index 30aeaa3c850fb04428379d077bc0430939c7b0dc..c97ed19b1963c95919e3a78015c2ea8e0acb4c02 100644 (file)
@@ -94,7 +94,7 @@ void SMESHGUI_GenericHypothesisCreator::create( bool isAlgo,
       SMESH::CreateHypothesis( hypType(), theHypName, isAlgo );
 #ifdef WITHGENERICOBJ
     if (!CORBA::is_nil(anAlgo))
-      anAlgo->Destroy();
+      anAlgo->UnRegister();
 #endif
   }
   else {
@@ -103,7 +103,7 @@ void SMESHGUI_GenericHypothesisCreator::create( bool isAlgo,
     editHypothesis( aHypothesis.in(), theHypName, theParent, obj, slot );
 #ifdef WITHGENERICOBJ
     if (!CORBA::is_nil(aHypothesis))
-      aHypothesis->Destroy();
+      aHypothesis->UnRegister();
 #endif
   }
 }
@@ -302,7 +302,7 @@ void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int result )
   }
   SMESHGUI::GetSMESHGUI()->updateObjBrowser( true, 0 );
 #ifdef WITHGENERICOBJ
-  myHypo->Destroy();
+  myHypo->UnRegister();
 #endif
   myHypo = SMESH::SMESH_Hypothesis::_nil();
   myInitParamsHypo = SMESH::SMESH_Hypothesis::_nil();
@@ -557,20 +557,19 @@ QString SMESHGUI_GenericHypothesisCreator::helpPage() const
     aHelpFileName = "segments_around_vertex_algo_page.html";
   else if ( aHypType == "QuadrangleParams")
     aHelpFileName = "a2d_meshing_hypo_page.html#hypo_quad_params_anchor";
+  else if ( aHypType == "ViscousLayers")
+    aHelpFileName = "additional_hypo_page.html#viscous_layers_anchor";
   else if ( aHypType == "ImportSource1D" || aHypType == "ImportSource2D")
     aHelpFileName = "import_algos_page.html";
   return aHelpFileName;
 }
 
-
-
-
 SMESHGUI_HypothesisDlg::SMESHGUI_HypothesisDlg( SMESHGUI_GenericHypothesisCreator* creator, QWidget* parent )
 : QtxDialog( parent, false, true ),
   myCreator( creator )
 {
   setAttribute(Qt::WA_DeleteOnClose, true);
-  setMinimumSize( 300, height() );
// setMinimumSize( 300, height() );
 //  setFixedSize( 300, height() );
   QVBoxLayout* topLayout = new QVBoxLayout( mainFrame() );
   topLayout->setMargin( 0 );
@@ -698,7 +697,8 @@ HypothesisData::HypothesisData( const QString& theTypeName,
 
 HypothesesSet::HypothesesSet( const QString& theSetName )
   : myHypoSetName( theSetName ),
-    myIsAlgo( false )
+    myIsAlgo( false ),
+    myIsCustom( false )
 {
 }
 
@@ -708,7 +708,8 @@ HypothesesSet::HypothesesSet( const QString&     theSetName,
   : myHypoSetName( theSetName ),
     myHypoList( theHypoList ),
     myAlgoList( theAlgoList ),
-    myIsAlgo( false )
+    myIsAlgo( false ),
+    myIsCustom( false )
 {
 }
 
@@ -762,3 +763,28 @@ QString HypothesesSet::current() const
 {
   return list()->at(myIndex);
 }
+
+void HypothesesSet::setIsCustom( bool isCustom )
+{
+  myIsCustom = isCustom;
+}
+
+bool HypothesesSet::getIsCustom() const
+{
+  return myIsCustom;
+}
+
+int HypothesesSet::maxDim() const
+{
+  HypothesesSet * thisSet = (HypothesesSet*) this;
+  int dim = -1;
+  for ( int isAlgo = 0; isAlgo < 2; ++isAlgo )
+  {
+    thisSet->init( isAlgo );
+    while ( thisSet->next(), thisSet->more() )
+      if ( HypothesisData* hypData = SMESH::GetHypothesisData( thisSet->current() ))
+        for ( int i = 0; i < hypData->Dim.count(); ++i )
+          dim = qMax( dim, hypData->Dim[i] );
+  }
+  return dim;
+}