Salome HOME
Automatic switch to physicalMesh=SIZEMAP when a sizemap or an enforced vertex is set
authorgdd <gdd>
Tue, 26 Jul 2011 08:50:25 +0000 (08:50 +0000)
committergdd <gdd>
Tue, 26 Jul 2011 08:50:25 +0000 (08:50 +0000)
src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx

index 4ee7e438dce60debe2409fc5c627669201432295..41d3d058ddd82f620da26b69fb1125e29bf55ccc 100644 (file)
@@ -154,13 +154,6 @@ void BLSURFPlugin_Hypothesis::SetTopology(Topology theTopology) {
 void BLSURFPlugin_Hypothesis::SetPhysicalMesh(PhysicalMesh thePhysicalMesh) {
   if (thePhysicalMesh != _physicalMesh) {
     _physicalMesh = thePhysicalMesh;
-    switch (_physicalMesh) {
-      case DefaultSize:
-      default:
-        _phySize = GetDefaultPhySize();
-        _gradation = GetDefaultGradation();
-        break;
-    }
     NotifySubMeshesHypothesisModification();
   }
 }
@@ -335,6 +328,7 @@ void BLSURFPlugin_Hypothesis::ClearOption(const std::string& optionName) {
 //=======================================================================
 void BLSURFPlugin_Hypothesis::SetSizeMapEntry(const std::string& entry, const std::string& sizeMap) {
   if (_sizeMap[entry].compare(sizeMap) != 0) {
+    SetPhysicalMesh(SizeMap);
     _sizeMap[entry] = sizeMap;
     NotifySubMeshesHypothesisModification();
   }
@@ -363,6 +357,7 @@ BLSURFPlugin_Hypothesis::TSizeMap BLSURFPlugin_Hypothesis::GetSizeMapEntries(con
 //=======================================================================
 void BLSURFPlugin_Hypothesis::SetAttractorEntry(const std::string& entry, const std::string& attractor) {
   if (_attractors[entry].compare(attractor) != 0) {
+    SetPhysicalMesh(SizeMap);
     _attractors[entry] = attractor;
     NotifySubMeshesHypothesisModification();
   }
@@ -391,6 +386,8 @@ BLSURFPlugin_Hypothesis::TSizeMap BLSURFPlugin_Hypothesis::GetAttractorEntries(c
 //=======================================================================
 void BLSURFPlugin_Hypothesis::SetClassAttractorEntry(const std::string& entry, const std::string& attEntry, double StartSize, double EndSize, double ActionRadius, double ConstantRadius)
 {
+  SetPhysicalMesh(SizeMap);
+
   // The new attractor can't be defined on the same face as another sizemap
   TSizeMap::iterator it  = _sizeMap.find( entry );
   if ( it != _sizeMap.end() ) {
@@ -514,6 +511,8 @@ bool BLSURFPlugin_Hypothesis::SetEnforcedVertex(TEntry theFaceEntry, TEnfName th
   MESSAGE("BLSURFPlugin_Hypothesis::SetEnforcedVertex("<< theFaceEntry << ", "
       << x << ", " << y << ", " << z << ", " << theVertexName << ", " << theVertexEntry << ", " << theGroupName << ")");
 
+  SetPhysicalMesh(SizeMap);
+
   //  TEnfVertexList::iterator it;
   bool toNotify = false;
   bool toCreate = true;
index 33dc789f31639bb479c290eb9729bbb90c3b80a5..f136089f2cc2501714749dbeeea7d465e35ed747 100644 (file)
@@ -53,7 +53,8 @@ public:
 
   enum PhysicalMesh {
     DefaultSize,
-    PhysicalUserDefined
+    PhysicalUserDefined,
+    SizeMap
   };
 
   enum GeometricMesh {
index 2b104823c9d66ea069dacc961cd4d29065402bb3..78898fe69c34ac2b8fc567e56d5c291b67f8ba33 100644 (file)
@@ -126,7 +126,7 @@ CORBA::Long BLSURFPlugin_Hypothesis_i::GetPhysicalMesh() {
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetPhySize(CORBA::Double theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhySize");
+  MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhySize");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetPhySize(theValue);
   SMESH::TPythonDump() << _this() << ".SetPhySize( " << theValue << " )";
@@ -140,7 +140,7 @@ void BLSURFPlugin_Hypothesis_i::SetPhySize(CORBA::Double theValue) {
  */
 //=============================================================================
 CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhySize() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPhySize");
+  MESSAGE("BLSURFPlugin_Hypothesis_i::GetPhySize");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetPhySize();
 }
@@ -1690,7 +1690,6 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexEntry(const char* theFaceEntry,
   ASSERT(myBaseImpl);
   MESSAGE("IDL : SetEnforcedVertexEntry(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" << theVertexName << "\", \"" << theVertexEntry << "\", \"" << theGroupName << "\")");
   bool newValue = false;
-
   if (string(theVertexEntry).empty()) {
     try {
       ::BLSURFPlugin_Hypothesis::TEnfVertexCoordsList coordsList =