X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH%2FSMESH_ProxyMesh.hxx;h=c7e92a8c4d95a1e745bde5d53c0e6cba084b5e63;hp=a64002e02527730fc238d6ca4568f4efeed9927b;hb=2f529dcd2629679dadcca3047583bfcf28ca7b1a;hpb=a1920ff31054e2c882bd94d4f3c04abe53980ce0 diff --git a/src/SMESH/SMESH_ProxyMesh.hxx b/src/SMESH/SMESH_ProxyMesh.hxx index a64002e02..c7e92a8c4 100644 --- a/src/SMESH/SMESH_ProxyMesh.hxx +++ b/src/SMESH/SMESH_ProxyMesh.hxx @@ -26,6 +26,7 @@ #include "SMESH_SMESH.hxx" +#include "SMDS_ElementHolder.hxx" #include "SMESHDS_SubMesh.hxx" #include "SMESH_TypeDefs.hxx" @@ -66,19 +67,19 @@ public: virtual void AddElement(const SMDS_MeshElement * e); virtual int NbElements() const; virtual int NbNodes() const; - virtual SMDS_ElemIteratorPtr GetElements(bool reverse=false) const; - virtual SMDS_NodeIteratorPtr GetNodes(bool reverse=false) const; + virtual SMDS_ElemIteratorPtr GetElements() const; + virtual SMDS_NodeIteratorPtr GetNodes() const; virtual void Clear(); virtual bool Contains(const SMDS_MeshElement * ME) const; template< class ITERATOR > - void ChangeElements( ITERATOR it, ITERATOR end ) + void ChangeElements( ITERATOR it, ITERATOR end ) { // change SubMesh contents without deleting tmp elements // for which the caller is responsible _elements.assign( it, end ); } - SubMesh(int index=0):SMESHDS_SubMesh(0,index),_n2n(0) {} + SubMesh(const SMDS_Mesh* mesh, int index=0); virtual ~SubMesh() { Clear(); } protected: @@ -86,13 +87,20 @@ public: TN2NMap* _n2n; UVPtStructVec _uvPtStructVec; // for SubMesh of EDGE friend class SMESH_ProxyMesh; + + protected: // methods of SMDS_ElementHolder; remove elements before mesh compacting or clearing + virtual SMDS_ElemIteratorPtr getElements() { Clear(); return GetElements(); } + virtual void tmpClear() {} + virtual void add( const SMDS_MeshElement* element ) {} + virtual void compact() {} + virtual void clear() { Clear(); } }; //-------------------------------------------------------------------------------- // Public interface SMESH_ProxyMesh(); SMESH_ProxyMesh(std::vector& components); - SMESH_ProxyMesh(const SMESH_Mesh& mesh) { _mesh = &mesh; } + SMESH_ProxyMesh(const SMESH_Mesh& mesh); virtual ~SMESH_ProxyMesh(); // Returns the submesh of a shape; it can be a proxy sub-mesh @@ -129,11 +137,11 @@ public: // Interface for descendants protected: - void setMesh(const SMESH_Mesh& mesh) { _mesh = &mesh; } + void setMesh(const SMESH_Mesh& mesh); int shapeIndex(const TopoDS_Shape& shape) const; - virtual SubMesh* newSubmesh(int index=0) const { return new SubMesh(index); } + virtual SubMesh* newSubmesh(int index=0) const; // returns a proxy sub-mesh; zero index is for the case of mesh w/o shape SubMesh* findProxySubMesh(int shapeIndex=0) const; @@ -177,7 +185,7 @@ public: std::set< const SMDS_MeshElement* > _elemsInMesh; // Complex submesh used to iterate over elements in other sub-meshes - mutable SubMesh _subContainer; + mutable SubMesh* _subContainer; }; #endif