]> SALOME platform Git repositories - plugins/blsurfplugin.git/commitdiff
Salome HOME
22015: [CEA 734] "Relative value" disappear at hypothesis edition
authoreap <eap@opencascade.com>
Tue, 18 Dec 2012 11:31:22 +0000 (11:31 +0000)
committereap <eap@opencascade.com>
Tue, 18 Dec 2012 11:31:22 +0000 (11:31 +0000)
src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx
src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx

index ca776fa7a662fccb1b0a33d368381a3df3f49de0..b96cd4b2029df5df2227964772f418d810a5ffc8 100644 (file)
@@ -179,7 +179,7 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsPhySizeRel() {
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetMinSize(CORBA::Double theMinSize) {
   ASSERT(myBaseImpl);
-  if (GetMinSize() != theMinSize) {
+  if (IsMinSizeRel() || GetMinSize() != theMinSize ) {
     this->GetImpl()->SetMinSize(theMinSize, false);
     SMESH::TPythonDump() << _this() << ".SetMinSize( " << theMinSize << " )";
   }
@@ -188,7 +188,7 @@ void BLSURFPlugin_Hypothesis_i::SetMinSize(CORBA::Double theMinSize) {
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetMinSizeRel(CORBA::Double theMinSize) {
   ASSERT(myBaseImpl);
-  if ( IsMinSizeRel() && (GetMinSize() != theMinSize) ) {
+  if ( !IsMinSizeRel() && (GetMinSize() != theMinSize) ) {
     this->GetImpl()->SetMinSize(theMinSize, true);
     SMESH::TPythonDump() << _this() << ".SetMinSize( " << theMinSize << ", isRelative = True )";
   }
@@ -210,7 +210,7 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsMinSizeRel() {
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetMaxSize(CORBA::Double theMaxSize) {
   ASSERT(myBaseImpl);
-  if (GetMaxSize() != theMaxSize) {
+  if (IsMaxSizeRel() || GetMaxSize() != theMaxSize) {
     this->GetImpl()->SetMaxSize(theMaxSize, false);
     SMESH::TPythonDump() << _this() << ".SetMaxSize( " << theMaxSize << " )";
   }
@@ -219,7 +219,7 @@ void BLSURFPlugin_Hypothesis_i::SetMaxSize(CORBA::Double theMaxSize) {
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetMaxSizeRel(CORBA::Double theMaxSize) {
   ASSERT(myBaseImpl);
-  if ( IsMaxSizeRel() && (GetMaxSize() != theMaxSize) ) {
+  if ( !IsMaxSizeRel() && (GetMaxSize() != theMaxSize) ) {
     this->GetImpl()->SetMaxSize(theMaxSize, true);
     SMESH::TPythonDump() << _this() << ".SetMaxSize( " << theMaxSize << ", isRelative = True )";
   }
index 8ab1ca50397ed929169e95d582e1c4f81dc5fc94..a4db08bb516b2b576f39a30b6488bca5f69ee4fd 100644 (file)
@@ -1680,20 +1680,23 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi
       h->SetGeometricMesh( (int) h_data.myGeometricMesh );
 
     if ( ((int) h_data.myPhysicalMesh == PhysicalGlobalSize)||((int) h_data.myPhysicalMesh == PhysicalLocalSize) ) {
-      if ( h->GetPhySize() != h_data.myPhySize ) {
+      if ( h->GetPhySize()   != h_data.myPhySize ||
+           h->IsPhySizeRel() != h_data.myPhySizeRel ) {
         if ( h_data.myPhySizeRel )
           h->SetPhySizeRel( h_data.myPhySize );
         else
           h->SetPhySize( h_data.myPhySize );
       }
     }
-    if (h->GetMinSize() != h_data.myMinSize) {
+    if (h->GetMinSize()   != h_data.myMinSize ||
+        h->IsMinSizeRel() != h_data.myMinSizeRel ) {
       if ( h_data.myMinSizeRel )
         h->SetMinSizeRel( h_data.myMinSize <= 0 ? -1 : h_data.myMinSize );
       else
         h->SetMinSize( h_data.myMinSize <= 0 ? -1 : h_data.myMinSize );
     }
-    if (h->GetMaxSize() != h_data.myMaxSize) {
+    if (h->GetMaxSize()   != h_data.myMaxSize ||
+        h->IsMaxSizeRel() != h_data.myMaxSizeRel ) {
       if ( h_data.myMaxSizeRel )
         h->SetMaxSizeRel( h_data.myMaxSize <= 0 ? -1 : h_data.myMaxSize );
       else