]> SALOME platform Git repositories - plugins/blsurfplugin.git/commitdiff
Salome HOME
protect from "hphy_flag = hgeo_flag = 0" error V4_1_2rc2
authoreap <eap@opencascade.com>
Wed, 23 Apr 2008 07:06:43 +0000 (07:06 +0000)
committereap <eap@opencascade.com>
Wed, 23 Apr 2008 07:06:43 +0000 (07:06 +0000)
src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx
src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx

index 9eb0c3824a2b82d8177ba021b64210b0bc840624..8899a5bc045e6439b16423871686762f38df5729 100644 (file)
@@ -133,7 +133,12 @@ bool BLSURFPlugin_BLSURF::CheckHypothesis
   {
     _hypothesis = static_cast<const BLSURFPlugin_Hypothesis*> (theHyp);
     ASSERT(_hypothesis);
-    aStatus = SMESH_Hypothesis::HYP_OK;
+    if ( _hypothesis->GetPhysicalMesh() == BLSURFPlugin_Hypothesis::DefaultSize &&
+         _hypothesis->GetGeometricMesh() == BLSURFPlugin_Hypothesis::DefaultGeom )
+      //  hphy_flag = 0 and hgeo_flag = 0 is not allowed (spec)
+      aStatus = SMESH_Hypothesis::HYP_BAD_PARAMETER;
+    else
+      aStatus = SMESH_Hypothesis::HYP_OK;
   }
   else
     aStatus = SMESH_Hypothesis::HYP_INCOMPATIBLE;
index 46dff329f9f4ad0f93ad45b2cfac2a3df6f72f89..6f727c53e2ceee2cb217c15eb0f7b70354527f26 100644 (file)
@@ -57,13 +57,13 @@ enum Topology {
 
 enum PhysicalMesh
   {
-    DefaultSize,
+    DefaultSize = 0,
     PhysicalUserDefined
   };
 
 enum GeometricMesh
   {
-    DefaultGeom,
+    DefaultGeom = 0,
     UserDefined
   };
 
@@ -308,6 +308,11 @@ void BLSURFPluginGUI_HypothesisCreator::onPhysicalMeshChanged() {
         break;
       }
     myPhySize->setValue( aPhySize );
+    //  hphy_flag = 0 and hgeo_flag = 0 is not allowed (spec)
+    if ( myGeometricMesh->currentItem() == DefaultGeom ) {
+      myGeometricMesh->setCurrentItem( UserDefined );
+      onGeometricMeshChanged();
+    }
   }
 }
 
@@ -327,6 +332,11 @@ void BLSURFPluginGUI_HypothesisCreator::onGeometricMeshChanged() {
       }
     myAngleMeshS->setValue( aAngleMeshS );
     myGradation->setValue( aGradation );
+    //  hphy_flag = 0 and hgeo_flag = 0 is not allowed (spec)
+    if ( myPhysicalMesh->currentItem() == DefaultSize ) {
+      myPhysicalMesh->setCurrentItem( PhysicalUserDefined );
+      onPhysicalMeshChanged();
+    }
   }
 }