From 3093c53c5072461b3a059fa57b2e96644933c9c3 Mon Sep 17 00:00:00 2001 From: gdd Date: Tue, 26 Jul 2011 08:50:25 +0000 Subject: [PATCH] Automatic switch to physicalMesh=SIZEMAP when a sizemap or an enforced vertex is set --- src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx | 13 ++++++------- src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx | 3 ++- src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx | 5 ++--- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx index 4ee7e43..41d3d05 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx @@ -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; diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx index 33dc789..f136089 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx @@ -53,7 +53,8 @@ public: enum PhysicalMesh { DefaultSize, - PhysicalUserDefined + PhysicalUserDefined, + SizeMap }; enum GeometricMesh { diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx index 2b10482..78898fe 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx @@ -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 = -- 2.39.2