From 154b1ad73e40925b5163142ed3bc349a0f4f2cbe Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 28 Jan 2013 08:19:29 +0000 Subject: [PATCH] 0021893: EDF 2133 SMESH : Improvement of 3D extrusion algorithm Make SubMeshesComputed() public Make getDependsOnIterator() const --- src/SMESH/SMESH_subMesh.cxx | 21 +++++++++++---------- src/SMESH/SMESH_subMesh.hxx | 7 +++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index 270a4f870..1c03f3fc3 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -264,11 +264,11 @@ bool SMESH_subMesh::IsMeshComputed() const //============================================================================= /*! - * + * Return true if all sub-meshes have been meshed */ //============================================================================= -bool SMESH_subMesh::subMeshesComputed() +bool SMESH_subMesh::SubMeshesComputed() const { int myDim = SMESH_Gen::GetShapeDim( _subShape ); int dimToCheck = myDim - 1; @@ -1398,7 +1398,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event) if (!algo->OnlyUnaryInput()) shape = getCollection( gen, algo, subComputed ); else - subComputed = subMeshesComputed(); + subComputed = SubMeshesComputed(); ret = ( algo->NeedDiscreteBoundary() ? subComputed : algo->SupportSubmeshes() ? true : ( !subComputed || _father->IsNotConformAllowed() )); @@ -1953,7 +1953,7 @@ TopoDS_Shape SMESH_subMesh::getCollection(SMESH_Gen * theGen, SMESH_Algo* theAlgo, bool & theSubComputed) { - theSubComputed = subMeshesComputed(); + theSubComputed = SubMeshesComputed(); TopoDS_Shape mainShape = _father->GetMeshDS()->ShapeToMesh(); @@ -1986,7 +1986,7 @@ TopoDS_Shape SMESH_subMesh::getCollection(SMESH_Gen * theGen, if (strcmp( anAlgo->GetName(), theAlgo->GetName()) == 0 && // same algo anAlgo->GetUsedHypothesis( *_father, S, ignoreAuxiliaryHyps ) == aUsedHyp) // same hyps aBuilder.Add( aCompound, S ); - if ( !subMesh->subMeshesComputed() ) + if ( !subMesh->SubMeshesComputed() ) theSubComputed = false; } } @@ -2362,22 +2362,23 @@ namespace { //================================================================================ SMESH_subMeshIteratorPtr SMESH_subMesh::getDependsOnIterator(const bool includeSelf, - const bool reverse) + const bool reverse) const { + SMESH_subMesh *me = (SMESH_subMesh*) this; SMESH_subMesh *prepend=0, *append=0; if ( includeSelf ) { - if ( reverse ) prepend = this; - else append = this; + if ( reverse ) prepend = me; + else append = me; } typedef map < int, SMESH_subMesh * > TMap; if ( reverse ) { return SMESH_subMeshIteratorPtr - ( new _Iterator( new SMDS_mapReverseIterator( DependsOn() ), prepend, append )); + ( new _Iterator( new SMDS_mapReverseIterator( me->DependsOn() ), prepend, append )); } { return SMESH_subMeshIteratorPtr - ( new _Iterator( new SMDS_mapIterator( DependsOn() ), prepend, append )); + ( new _Iterator( new SMDS_mapIterator( me->DependsOn() ), prepend, append )); } } diff --git a/src/SMESH/SMESH_subMesh.hxx b/src/SMESH/SMESH_subMesh.hxx index 43b8349f1..0c956cea6 100644 --- a/src/SMESH/SMESH_subMesh.hxx +++ b/src/SMESH/SMESH_subMesh.hxx @@ -84,7 +84,7 @@ class SMESH_EXPORT SMESH_subMesh * \brief Return iterator on the submeshes this one depends on */ SMESH_subMeshIteratorPtr getDependsOnIterator(const bool includeSelf, - const bool complexShapeFirst); + const bool complexShapeFirst) const; const TopoDS_Shape & GetSubShape() const; @@ -253,6 +253,8 @@ public: void SetIsAlwaysComputed(bool isAlCo); bool IsAlwaysComputed() { return _alwaysComputed; } + bool SubMeshesComputed() const; + /*! * \brief Find common submeshes (based on shared subshapes with other @@ -267,9 +269,6 @@ protected: // ================================================================== void insertDependence(const TopoDS_Shape aSubShape); - bool subMeshesComputed(); - //bool SubMeshesReady(); - void removeSubMeshElementsAndNodes(); void updateDependantsState(const compute_event theEvent); void updateSubMeshState(const compute_state theState); -- 2.39.2