Version: 6.3.1
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | Friends

SMESHDS_Mesh Class Reference

#include <SMESHDS_Mesh.hxx>

Inheritance diagram for SMESHDS_Mesh:
Inheritance graph
[legend]

Public Types

typedef std::vector
< SMDS_MeshNode * > 
SetOfNodes
typedef std::vector
< SMDS_MeshCell * > 
SetOfCells

Public Member Functions

 SMESHDS_Mesh (int theMeshID, bool theIsEmbeddedMode)
bool IsEmbeddedMode ()
void SetPersistentId (int id)
 Store ID persistent during lifecycle.
int GetPersistentId () const
 Return ID persistent during lifecycle.
void ShapeToMesh (const TopoDS_Shape &S)
TopoDS_Shape ShapeToMesh () const
 Set geometry to be meshed.
bool AddHypothesis (const TopoDS_Shape &SS, const SMESHDS_Hypothesis *H)
bool RemoveHypothesis (const TopoDS_Shape &S, const SMESHDS_Hypothesis *H)
virtual SMDS_MeshNodeAddNodeWithID (double x, double y, double z, int ID)
 create a MeshNode and add it to the current Mesh
virtual SMDS_MeshNodeAddNode (double x, double y, double z)
 create a MeshNode and add it to the current Mesh An ID is automatically assigned to the node.
virtual SMDS_Mesh0DElementAdd0DElementWithID (int nodeID, int ID)
 create a Mesh0DElement and add it to the current Mesh
virtual SMDS_Mesh0DElementAdd0DElementWithID (const SMDS_MeshNode *node, int ID)
 Create a new Mesh0DElement and at it to the mesh.
virtual SMDS_Mesh0DElementAdd0DElement (const SMDS_MeshNode *node)
 create a Mesh0DElement and add it to the current Mesh
virtual SMDS_MeshEdgeAddEdgeWithID (int n1, int n2, int ID)
 create a MeshEdge and add it to the current Mesh
virtual SMDS_MeshEdgeAddEdgeWithID (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, int ID)
 Create a new edge and at it to the mesh.
virtual SMDS_MeshEdgeAddEdge (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2)
 create a MeshEdge and add it to the current Mesh
virtual SMDS_MeshEdgeAddEdgeWithID (int n1, int n2, int n12, int ID)
virtual SMDS_MeshEdgeAddEdgeWithID (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n12, int ID)
virtual SMDS_MeshEdgeAddEdge (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n12)
virtual SMDS_MeshFaceAddFaceWithID (int n1, int n2, int n3, int ID)
 Add a triangle defined by its nodes IDs.
virtual SMDS_MeshFaceAddFaceWithID (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, int ID)
 Add a triangle defined by its nodes.
virtual SMDS_MeshFaceAddFace (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3)
 Add a triangle defined by its nodes.
virtual SMDS_MeshFaceAddFaceWithID (int n1, int n2, int n3, int n4, int ID)
 Add a quadrangle defined by its nodes IDs.
virtual SMDS_MeshFaceAddFaceWithID (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, int ID)
 Add a quadrangle defined by its nodes.
virtual SMDS_MeshFaceAddFace (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4)
 Add a quadrangle defined by its nodes.
virtual SMDS_MeshFaceAddFaceWithID (int n1, int n2, int n3, int n12, int n23, int n31, int ID)
virtual SMDS_MeshFaceAddFaceWithID (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n12, const SMDS_MeshNode *n23, const SMDS_MeshNode *n31, int ID)
virtual SMDS_MeshFaceAddFace (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n12, const SMDS_MeshNode *n23, const SMDS_MeshNode *n31)
virtual SMDS_MeshFaceAddFaceWithID (int n1, int n2, int n3, int n4, int n12, int n23, int n34, int n41, int ID)
virtual SMDS_MeshFaceAddFaceWithID (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n12, const SMDS_MeshNode *n23, const SMDS_MeshNode *n34, const SMDS_MeshNode *n41, int ID)
virtual SMDS_MeshFaceAddFace (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n12, const SMDS_MeshNode *n23, const SMDS_MeshNode *n34, const SMDS_MeshNode *n41)
virtual SMDS_MeshVolumeAddVolumeWithID (int n1, int n2, int n3, int n4, int ID)
 Create a new tetrahedron and add it to the mesh.
virtual SMDS_MeshVolumeAddVolumeWithID (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, int ID)
 Create a new tetrahedron and add it to the mesh.
virtual SMDS_MeshVolumeAddVolume (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4)
 Create a new tetrahedron and add it to the mesh.
virtual SMDS_MeshVolumeAddVolumeWithID (int n1, int n2, int n3, int n4, int n5, int ID)
 Create a new pyramid and add it to the mesh.
virtual SMDS_MeshVolumeAddVolumeWithID (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n5, int ID)
 Create a new pyramid and add it to the mesh.
virtual SMDS_MeshVolumeAddVolume (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n5)
 Create a new pyramid and add it to the mesh.
virtual SMDS_MeshVolumeAddVolumeWithID (int n1, int n2, int n3, int n4, int n5, int n6, int ID)
 Create a new prism and add it to the mesh.
virtual SMDS_MeshVolumeAddVolumeWithID (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n5, const SMDS_MeshNode *n6, int ID)
 Create a new prism and add it to the mesh.
virtual SMDS_MeshVolumeAddVolume (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n5, const SMDS_MeshNode *n6)
 Create a new prism and add it to the mesh.
virtual SMDS_MeshVolumeAddVolumeWithID (int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int ID)
 Create a new hexahedron and add it to the mesh.
virtual SMDS_MeshVolumeAddVolumeWithID (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n5, const SMDS_MeshNode *n6, const SMDS_MeshNode *n7, const SMDS_MeshNode *n8, int ID)
 Create a new hexahedron and add it to the mesh.
virtual SMDS_MeshVolumeAddVolume (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n5, const SMDS_MeshNode *n6, const SMDS_MeshNode *n7, const SMDS_MeshNode *n8)
 Create a new hexahedron and add it to the mesh.
virtual SMDS_MeshVolumeAddVolumeWithID (int n1, int n2, int n3, int n4, int n12, int n23, int n31, int n14, int n24, int n34, int ID)
virtual SMDS_MeshVolumeAddVolumeWithID (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n12, const SMDS_MeshNode *n23, const SMDS_MeshNode *n31, const SMDS_MeshNode *n14, const SMDS_MeshNode *n24, const SMDS_MeshNode *n34, int ID)
virtual SMDS_MeshVolumeAddVolume (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n12, const SMDS_MeshNode *n23, const SMDS_MeshNode *n31, const SMDS_MeshNode *n14, const SMDS_MeshNode *n24, const SMDS_MeshNode *n34)
virtual SMDS_MeshVolumeAddVolumeWithID (int n1, int n2, int n3, int n4, int n5, int n12, int n23, int n34, int n41, int n15, int n25, int n35, int n45, int ID)
virtual SMDS_MeshVolumeAddVolumeWithID (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n5, const SMDS_MeshNode *n12, const SMDS_MeshNode *n23, const SMDS_MeshNode *n34, const SMDS_MeshNode *n41, const SMDS_MeshNode *n15, const SMDS_MeshNode *n25, const SMDS_MeshNode *n35, const SMDS_MeshNode *n45, int ID)
virtual SMDS_MeshVolumeAddVolume (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n5, const SMDS_MeshNode *n12, const SMDS_MeshNode *n23, const SMDS_MeshNode *n34, const SMDS_MeshNode *n41, const SMDS_MeshNode *n15, const SMDS_MeshNode *n25, const SMDS_MeshNode *n35, const SMDS_MeshNode *n45)
virtual SMDS_MeshVolumeAddVolumeWithID (int n1, int n2, int n3, int n4, int n5, int n6, int n12, int n23, int n31, int n45, int n56, int n64, int n14, int n25, int n36, int ID)
virtual SMDS_MeshVolumeAddVolumeWithID (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n5, const SMDS_MeshNode *n6, const SMDS_MeshNode *n12, const SMDS_MeshNode *n23, const SMDS_MeshNode *n31, const SMDS_MeshNode *n45, const SMDS_MeshNode *n56, const SMDS_MeshNode *n64, const SMDS_MeshNode *n14, const SMDS_MeshNode *n25, const SMDS_MeshNode *n36, int ID)
virtual SMDS_MeshVolumeAddVolume (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n5, const SMDS_MeshNode *n6, const SMDS_MeshNode *n12, const SMDS_MeshNode *n23, const SMDS_MeshNode *n31, const SMDS_MeshNode *n45, const SMDS_MeshNode *n56, const SMDS_MeshNode *n64, const SMDS_MeshNode *n14, const SMDS_MeshNode *n25, const SMDS_MeshNode *n36)
virtual SMDS_MeshVolumeAddVolumeWithID (int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n12, int n23, int n34, int n41, int n56, int n67, int n78, int n85, int n15, int n26, int n37, int n48, int ID)
virtual SMDS_MeshVolumeAddVolumeWithID (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n5, const SMDS_MeshNode *n6, const SMDS_MeshNode *n7, const SMDS_MeshNode *n8, const SMDS_MeshNode *n12, const SMDS_MeshNode *n23, const SMDS_MeshNode *n34, const SMDS_MeshNode *n41, const SMDS_MeshNode *n56, const SMDS_MeshNode *n67, const SMDS_MeshNode *n78, const SMDS_MeshNode *n85, const SMDS_MeshNode *n15, const SMDS_MeshNode *n26, const SMDS_MeshNode *n37, const SMDS_MeshNode *n48, int ID)
virtual SMDS_MeshVolumeAddVolume (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n5, const SMDS_MeshNode *n6, const SMDS_MeshNode *n7, const SMDS_MeshNode *n8, const SMDS_MeshNode *n12, const SMDS_MeshNode *n23, const SMDS_MeshNode *n34, const SMDS_MeshNode *n41, const SMDS_MeshNode *n56, const SMDS_MeshNode *n67, const SMDS_MeshNode *n78, const SMDS_MeshNode *n85, const SMDS_MeshNode *n15, const SMDS_MeshNode *n26, const SMDS_MeshNode *n37, const SMDS_MeshNode *n48)
virtual SMDS_MeshFaceAddPolygonalFaceWithID (const std::vector< int > &nodes_ids, const int ID)
virtual SMDS_MeshFaceAddPolygonalFaceWithID (const std::vector< const SMDS_MeshNode * > &nodes, const int ID)
virtual SMDS_MeshFaceAddPolygonalFace (const std::vector< const SMDS_MeshNode * > &nodes)
virtual SMDS_MeshVolumeAddPolyhedralVolumeWithID (const std::vector< int > &nodes_ids, const std::vector< int > &quantities, const int ID)
virtual SMDS_MeshVolumeAddPolyhedralVolumeWithID (const std::vector< const SMDS_MeshNode * > &nodes, const std::vector< int > &quantities, const int ID)
virtual SMDS_MeshVolumeAddPolyhedralVolume (const std::vector< const SMDS_MeshNode * > &nodes, const std::vector< int > &quantities)
void MoveNode (const SMDS_MeshNode *, double x, double y, double z)
virtual void RemoveNode (const SMDS_MeshNode *)
 Remove a node and all the elements which own this node.
void RemoveElement (const SMDS_MeshElement *)
void RemoveFreeNode (const SMDS_MeshNode *, SMESHDS_SubMesh *, bool fromGroups=true)
 Remove only the given element/node and only if it is free.
void RemoveFreeElement (const SMDS_MeshElement *, SMESHDS_SubMesh *, bool fromGroups=true)
void ClearMesh ()
 Remove all data from the mesh.
bool ChangeElementNodes (const SMDS_MeshElement *elem, const SMDS_MeshNode *nodes[], const int nbnodes)
bool ChangePolygonNodes (const SMDS_MeshElement *elem, std::vector< const SMDS_MeshNode * > nodes)
bool ChangePolyhedronNodes (const SMDS_MeshElement *elem, std::vector< const SMDS_MeshNode * > nodes, std::vector< int > quantities)
bool ModifyCellNodes (int smdsVolId, std::map< int, int > localClonedNodeIds)
 change some nodes in cell without modifying type or internal connectivity.
void Renumber (const bool isNodes, const int startID=1, const int deltaID=1)
void SetNodeInVolume (SMDS_MeshNode *aNode, const TopoDS_Shell &S)
void SetNodeInVolume (SMDS_MeshNode *aNode, const TopoDS_Solid &S)
void SetNodeOnFace (SMDS_MeshNode *aNode, const TopoDS_Face &S, double u=0., double v=0.)
void SetNodeOnEdge (SMDS_MeshNode *aNode, const TopoDS_Edge &S, double u=0.)
void SetNodeOnVertex (SMDS_MeshNode *aNode, const TopoDS_Vertex &S)
void UnSetNodeOnShape (const SMDS_MeshNode *aNode)
void SetMeshElementOnShape (const SMDS_MeshElement *anElt, const TopoDS_Shape &S)
void UnSetMeshElementOnShape (const SMDS_MeshElement *anElt, const TopoDS_Shape &S)
bool HasMeshElements (const TopoDS_Shape &S) const
SMESHDS_SubMeshMeshElements (const TopoDS_Shape &S) const
 Return the sub mesh linked to the a given TopoDS_Shape or NULL if the given TopoDS_Shape is unknown.
SMESHDS_SubMeshMeshElements (const int Index) const
 Return the sub mesh by Id of shape it is linked to.
std::list< intSubMeshIndices () const
const std::map< int,
SMESHDS_SubMesh * > & 
SubMeshes () const
bool HasHypothesis (const TopoDS_Shape &S)
const std::list< const
SMESHDS_Hypothesis * > & 
GetHypothesis (const TopoDS_Shape &S) const
SMESHDS_ScriptGetScript ()
void ClearScript ()
int ShapeToIndex (const TopoDS_Shape &aShape) const
const TopoDS_Shape & IndexToShape (int ShapeIndex) const
int MaxShapeIndex () const
int MaxSubMeshIndex () const
 Return max index of sub-mesh.
SMESHDS_SubMeshNewSubMesh (int Index)
int AddCompoundSubmesh (const TopoDS_Shape &S, TopAbs_ShapeEnum type=TopAbs_SHAPE)
void SetNodeInVolume (const SMDS_MeshNode *aNode, int Index)
void SetNodeOnFace (SMDS_MeshNode *aNode, int Index, double u=0., double v=0.)
void SetNodeOnEdge (SMDS_MeshNode *aNode, int Index, double u=0.)
void SetNodeOnVertex (SMDS_MeshNode *aNode, int Index)
void SetMeshElementOnShape (const SMDS_MeshElement *anElt, int Index)
void AddGroup (SMESHDS_GroupBase *theGroup)
void RemoveGroup (SMESHDS_GroupBase *theGroup)
int GetNbGroups () const
const std::set
< SMESHDS_GroupBase * > & 
GetGroups () const
bool IsGroupOfSubShapes (const TopoDS_Shape &aSubShape) const
virtual void compactMesh ()
void CleanDownWardConnectivity ()
void BuildDownWardConnectivity (bool withEdges)
 ~SMESHDS_Mesh ()
SMDS_UnstructuredGridgetGrid ()
 actual nodes coordinates, cells definition and reverse connectivity are stored in a vtkUnstructuredGrid
int getMeshId ()
SMDS_NodeIteratorPtr nodesIterator (bool idInceasingOrder=false) const
 Return an iterator on nodes of the current mesh factory.
SMDS_0DElementIteratorPtr elements0dIterator (bool idInceasingOrder=false) const
 Return an iterator on 0D elements of the current mesh.
SMDS_EdgeIteratorPtr edgesIterator (bool idInceasingOrder=false) const
 Return an iterator on edges of the current mesh.
SMDS_FaceIteratorPtr facesIterator (bool idInceasingOrder=false) const
 Return an iterator on faces of the current mesh.
SMDS_VolumeIteratorPtr volumesIterator (bool idInceasingOrder=false) const
 Return an iterator on volumes of the current mesh.
SMDS_ElemIteratorPtr elementsIterator (SMDSAbs_ElementType type=SMDSAbs_All) const
 Return an iterator on elements of the current mesh factory.
SMDSAbs_ElementType GetElementType (const int id, const bool iselem) const
SMDS_MeshAddSubMesh ()
 Create a submesh and add it to the current mesh.
virtual SMDS_MeshFaceAddFaceWithID (const SMDS_MeshEdge *e1, const SMDS_MeshEdge *e2, const SMDS_MeshEdge *e3, int ID)
 Add a triangle defined by its edges.
virtual SMDS_MeshFaceAddFaceWithID (const SMDS_MeshEdge *e1, const SMDS_MeshEdge *e2, const SMDS_MeshEdge *e3, const SMDS_MeshEdge *e4, int ID)
 Add a quadrangle defined by its edges.
virtual SMDS_MeshFaceAddFace (const SMDS_MeshEdge *e1, const SMDS_MeshEdge *e2, const SMDS_MeshEdge *e3)
 Add a triangle defined by its edges.
virtual SMDS_MeshFaceAddFace (const SMDS_MeshEdge *e1, const SMDS_MeshEdge *e2, const SMDS_MeshEdge *e3, const SMDS_MeshEdge *e4)
 Add a quadrangle defined by its edges.
virtual SMDS_MeshVolumeAddVolumeWithID (const SMDS_MeshFace *f1, const SMDS_MeshFace *f2, const SMDS_MeshFace *f3, const SMDS_MeshFace *f4, int ID)
 Create a new tetrahedron defined by its faces and add it to the mesh.
virtual SMDS_MeshVolumeAddVolumeWithID (const SMDS_MeshFace *f1, const SMDS_MeshFace *f2, const SMDS_MeshFace *f3, const SMDS_MeshFace *f4, const SMDS_MeshFace *f5, int ID)
 Create a new pyramid defined by its faces and add it to the mesh.
virtual SMDS_MeshVolumeAddVolumeWithID (const SMDS_MeshFace *f1, const SMDS_MeshFace *f2, const SMDS_MeshFace *f3, const SMDS_MeshFace *f4, const SMDS_MeshFace *f5, const SMDS_MeshFace *f6, int ID)
 Create a new prism defined by its faces and add it to the mesh.
virtual SMDS_MeshVolumeAddVolume (const SMDS_MeshFace *f1, const SMDS_MeshFace *f2, const SMDS_MeshFace *f3, const SMDS_MeshFace *f4)
 Create a new tetrahedron defined by its faces and add it to the mesh.
virtual SMDS_MeshVolumeAddVolume (const SMDS_MeshFace *f1, const SMDS_MeshFace *f2, const SMDS_MeshFace *f3, const SMDS_MeshFace *f4, const SMDS_MeshFace *f5)
 Create a new pyramid defined by its faces and add it to the mesh.
virtual SMDS_MeshVolumeAddVolume (const SMDS_MeshFace *f1, const SMDS_MeshFace *f2, const SMDS_MeshFace *f3, const SMDS_MeshFace *f4, const SMDS_MeshFace *f5, const SMDS_MeshFace *f6)
 Create a new prism defined by its faces and add it to the mesh.
virtual SMDS_MeshFaceAddPolygonalFaceWithID (std::vector< int > nodes_ids, const int ID)
 Add a polygon defined by its nodes IDs.
virtual SMDS_MeshFaceAddPolygonalFaceWithID (std::vector< const SMDS_MeshNode * > nodes, const int ID)
 Add a polygon defined by its nodes.
virtual SMDS_MeshFaceAddPolygonalFace (std::vector< const SMDS_MeshNode * > nodes)
 Add a polygon defined by its nodes.
virtual SMDS_MeshVolumeAddPolyhedralVolumeWithID (std::vector< int > nodes_ids, std::vector< int > quantities, const int ID)
 Create a new polyhedral volume and add it to the mesh.
virtual SMDS_MeshVolumeAddPolyhedralVolumeWithID (std::vector< const SMDS_MeshNode * > nodes, std::vector< int > quantities, const int ID)
 Create a new polyhedral volume and add it to the mesh.
virtual SMDS_MeshVolumeAddPolyhedralVolume (std::vector< const SMDS_MeshNode * > nodes, std::vector< int > quantities)
 Create a new polyhedral volume and add it to the mesh.
virtual SMDS_MeshVolumeAddVolumeFromVtkIds (const std::vector< vtkIdType > &vtkNodeIds)
virtual SMDS_MeshVolumeAddVolumeFromVtkIdsWithID (const std::vector< vtkIdType > &vtkNodeIds, const int ID)
virtual void RemoveElement (const SMDS_MeshElement *elem, std::list< const SMDS_MeshElement * > &removedElems, std::list< const SMDS_MeshElement * > &removedNodes, const bool removenodes=false)
virtual void RemoveElement (const SMDS_MeshElement *elem, bool removenodes=false)
virtual void Remove0DElement (const SMDS_Mesh0DElement *elem0d)
 Remove an edge and all the elements which own this edge.
virtual void RemoveEdge (const SMDS_MeshEdge *edge)
 Remove an edge and all the elements which own this edge.
virtual void RemoveFace (const SMDS_MeshFace *face)
 Remove an face and all the elements which own this face.
virtual void RemoveVolume (const SMDS_MeshVolume *volume)
 Remove a volume.
virtual void RemoveFreeElement (const SMDS_MeshElement *elem)
 Remove only the given element and only if it is free.
virtual void Clear ()
 Clear all data.
virtual bool RemoveFromParent ()
virtual bool RemoveSubMesh (const SMDS_Mesh *aMesh)
bool ChangePolyhedronNodes (const SMDS_MeshElement *elem, const std::vector< const SMDS_MeshNode * > &nodes, const std::vector< int > &quantities)
const SMDS_MeshNodeFindNode (int idnode) const
 Return the node whose SMDS ID is 'ID'.
const SMDS_MeshNodeFindNodeVtk (int idnode) const
 Return the node whose VTK ID is 'vtkId'.
const SMDS_Mesh0DElementFind0DElement (int idnode) const
const SMDS_MeshEdgeFindEdge (int idnode1, int idnode2) const
const SMDS_MeshEdgeFindEdge (int idnode1, int idnode2, int idnode3) const
const SMDS_MeshFaceFindFace (int idnode1, int idnode2, int idnode3) const
const SMDS_MeshFaceFindFace (int idnode1, int idnode2, int idnode3, int idnode4) const
const SMDS_MeshFaceFindFace (int idnode1, int idnode2, int idnode3, int idnode4, int idnode5, int idnode6) const
const SMDS_MeshFaceFindFace (int idnode1, int idnode2, int idnode3, int idnode4, int idnode5, int idnode6, int idnode7, int idnode8) const
const SMDS_MeshFaceFindFace (const std::vector< int > &nodes_ids) const
const SMDS_MeshElementFindElement (int IDelem) const
int MaxNodeID () const
int MinNodeID () const
int MaxElementID () const
int MinElementID () const
const SMDS_MeshInfoGetMeshInfo () const
int NbNodes () const
 Return the number of nodes.
int Nb0DElements () const
 Return the number of 0D elements.
int NbEdges () const
 Return the number of edges (including construction edges)
int NbFaces () const
 Return the number of faces (including construction faces)
int NbVolumes () const
 Return the number of volumes.
int NbSubMesh () const
 Return the number of child mesh of this mesh.
void DumpNodes () const
void Dump0DElements () const
void DumpEdges () const
void DumpFaces () const
void DumpVolumes () const
void DebugStats () const
SMDS_MeshboundaryFaces ()
SMDS_MeshboundaryEdges ()
bool hasConstructionEdges ()
 Return true if this mesh create faces with edges.
bool hasConstructionFaces ()
 Return true if this mesh create volumes with faces A false returned value mean that volumes are created with nodes or edges.
bool hasInverseElements ()
 Return true if nodes are linked to the finit elements, they are belonging to.
void setConstructionEdges (bool)
 Make this mesh creating construction edges (see hasConstructionEdges)
void setConstructionFaces (bool)
 Make this mesh creating construction faces (see hasConstructionFaces)
void setInverseElements (bool)
 Make this mesh creating link from nodes to elements (see hasInverseElements)
bool Contains (const SMDS_MeshElement *elem) const
 Checks if the element is present in mesh.
void updateNodeMinMax ()
void updateBoundingBox ()
double getMaxDim ()
int fromVtkToSmds (int vtkid)
void incrementNodesCapacity (int nbNodes)
void incrementCellsCapacity (int nbCells)
void adjustStructure ()
void dumpGrid (string ficdump="dumpGrid")
void setMyModified ()
 low level modification: add, change or remove node or element
void Modified ()
 modification that needs compact structure and redraw
unsigned long GetMTime ()
 get last modification timeStamp
bool isCompacted ()

Static Public Member Functions

static const SMDS_Mesh0DElementFind0DElement (const SMDS_MeshNode *n)
static const SMDS_MeshEdgeFindEdge (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2)
static const SMDS_MeshEdgeFindEdge (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3)
static const SMDS_MeshFaceFindFace (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3)
static const SMDS_MeshFaceFindFace (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4)
static const SMDS_MeshFaceFindFace (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n5, const SMDS_MeshNode *n6)
static const SMDS_MeshFaceFindFace (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n5, const SMDS_MeshNode *n6, const SMDS_MeshNode *n7, const SMDS_MeshNode *n8)
static const SMDS_MeshFaceFindFace (const std::vector< const SMDS_MeshNode * > &nodes)
static const SMDS_MeshElementFindElement (const std::vector< const SMDS_MeshNode * > &nodes, const SMDSAbs_ElementType type=SMDSAbs_All, const bool noMedium=true)
 Return element based on all given nodes.
static int CheckMemory (const bool doNotRaise=false) throw (std::bad_alloc)
 Raise an exception if free memory (ram+swap) too low.

Static Public Attributes

static std::vector< SMDS_Mesh * > _meshList = vector<SMDS_Mesh*>()
 to retreive this SMDS_Mesh instance from its elements (index stored in SMDS_Elements)
static int chunkSize = 1024

Protected Member Functions

SMDS_MeshFacecreateTriangle (const SMDS_MeshNode *node1, const SMDS_MeshNode *node2, const SMDS_MeshNode *node3, int ID)
 Create a triangle and add it to the current mesh.
SMDS_MeshFacecreateQuadrangle (const SMDS_MeshNode *node1, const SMDS_MeshNode *node2, const SMDS_MeshNode *node3, const SMDS_MeshNode *node4, int ID)
 Create a quadrangle and add it to the current mesh.
SMDS_MeshEdgeFindEdgeOrCreate (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2)
SMDS_MeshFaceFindFaceOrCreate (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3)
SMDS_MeshFaceFindFaceOrCreate (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4)
bool registerElement (int ID, SMDS_MeshElement *element)
 Registers element with the given ID, maintains inverse connections.
void addChildrenWithNodes (std::set< const SMDS_MeshElement * > &setOfChildren, const SMDS_MeshElement *element, std::set< const SMDS_MeshElement * > &nodes)
 Find the children of an element that are made of given nodes.
void adjustmyCellsCapacity (int ID)
void adjustBoundingBox (double x, double y, double z)

Protected Attributes

int myMeshId
 index of this SMDS_mesh in the static vector<SMDS_Mesh*> _meshList
SMDS_UnstructuredGridmyGrid
 actual nodes coordinates, cells definition and reverse connectivity are stored in a vtkUnstructuredGrid
ObjectPool< SMDS_MeshNode > * myNodePool
 Small objects like SMDS_MeshNode are allocated by chunks to limit memory costs of new.
ObjectPool< SMDS_VtkVolume > * myVolumePool
 Small objects like SMDS_VtkVolume are allocated by chunks to limit memory costs of new.
ObjectPool< SMDS_VtkFace > * myFacePool
ObjectPool< SMDS_VtkEdge > * myEdgePool
SetOfNodes myNodes
 SMDS_MeshNodes refer to vtk nodes (vtk id = index in myNodes),store reference to this mesh, and subshape.
SetOfCells myCells
 SMDS_MeshCells refer to vtk cells (vtk id != index in myCells),store reference to this mesh, and subshape.
std::vector< intmyCellIdVtkToSmds
 for cells only: index = ID for SMDS users, value = ID in vtkUnstructuredGrid
SMDS_MeshmyParent
std::list< SMDS_Mesh * > myChildren
SMDS_MeshNodeIDFactorymyNodeIDFactory
SMDS_MeshElementIDFactorymyElementIDFactory
SMDS_MeshInfo myInfo
unsigned long myModifTime
 use a counter to keep track of modifications
unsigned long myCompactTime
int myNodeMin
int myNodeMax
bool myHasConstructionEdges
bool myHasConstructionFaces
bool myHasInverseElements
bool myModified
 any add, remove or change of node or cell
double xmin
double xmax
double ymin
double ymax
double zmin
double zmax

Private Types

typedef std::list< const
SMESHDS_Hypothesis * > 
THypList
typedef NCollection_DataMap
< TopoDS_Shape, THypList
ShapeToHypothesis
typedef std::map< int,
SMESHDS_SubMesh * > 
TShapeIndexToSubMesh
typedef std::set
< SMESHDS_GroupBase * > 
TGroups

Private Member Functions

void addNodeToSubmesh (const SMDS_MeshNode *aNode, int Index)
bool add (const SMDS_MeshElement *elem, SMESHDS_SubMesh *subMesh)
 Add element or node to submesh.
SMESHDS_SubMeshgetSubmesh (const TopoDS_Shape &shape)
 return submesh by shape
SMESHDS_SubMeshgetSubmesh (const int Index)
 return submesh by subshape index

Private Attributes

ShapeToHypothesis myShapeToHypothesis
int myMeshID
int myPersistentID
TopoDS_Shape myShape
TShapeIndexToSubMesh myShapeIndexToSubMesh
TopTools_IndexedMapOfShape myIndexToShape
TGroups myGroups
SMESHDS_ScriptmyScript
bool myIsEmbeddedMode
int myCurSubID
TopoDS_Shape myCurSubShape
SMESHDS_SubMeshmyCurSubMesh

Friends

class SMDS_MeshIDFactory
class SMDS_MeshNodeIDFactory
class SMDS_MeshElementIDFactory
class SMDS_MeshVolumeVtkNodes
class SMDS_MeshNode

Detailed Description

Definition at line 61 of file SMESHDS_Mesh.hxx.


Member Typedef Documentation

typedef std::vector<SMDS_MeshCell *> SMDS_Mesh.SetOfCells [inherited]

Definition at line 576 of file SMDS_Mesh.hxx.

typedef std::vector<SMDS_MeshNode *> SMDS_Mesh.SetOfNodes [inherited]

Definition at line 575 of file SMDS_Mesh.hxx.

typedef NCollection_DataMap< TopoDS_Shape, THypList > SMESHDS_Mesh.ShapeToHypothesis [private]

Definition at line 470 of file SMESHDS_Mesh.hxx.

typedef std::set<SMESHDS_GroupBase*> SMESHDS_Mesh.TGroups [private]

Definition at line 482 of file SMESHDS_Mesh.hxx.

typedef std::list<const SMESHDS_Hypothesis*> SMESHDS_Mesh.THypList [private]

Definition at line 468 of file SMESHDS_Mesh.hxx.

Definition at line 477 of file SMESHDS_Mesh.hxx.


Constructor & Destructor Documentation

SMESHDS_Mesh::SMESHDS_Mesh ( int  theMeshID,
bool  theIsEmbeddedMode 
)

Definition at line 58 of file SMESHDS_Mesh.cxx.

References myCurSubMesh, myScript, and SetPersistentId().

                                                               :
  myMeshID(theMeshID),
  myIsEmbeddedMode(theIsEmbeddedMode),
  myCurSubID(-1)
{
  myScript = new SMESHDS_Script(theIsEmbeddedMode);
  myCurSubMesh = 0;
  SetPersistentId(theMeshID);
}
SMESHDS_Mesh::~SMESHDS_Mesh ( )

Definition at line 1340 of file SMESHDS_Mesh.cxx.

References myScript, and myShapeIndexToSubMesh.

{
  // myScript
  delete myScript;
  // submeshes
  TShapeIndexToSubMesh::iterator i_sm = myShapeIndexToSubMesh.begin();
  for ( ; i_sm != myShapeIndexToSubMesh.end(); ++i_sm )
    delete i_sm->second;
}

Member Function Documentation

bool SMESHDS_Mesh::add ( const SMDS_MeshElement elem,
SMESHDS_SubMesh subMesh 
) [private]

Add element or node to submesh.

Parameters:
elem- element to add
subMesh- submesh to be filled in

Definition at line 950 of file SMESHDS_Mesh.cxx.

References SMESHDS_SubMesh.AddElement(), SMESHDS_SubMesh.AddNode(), SMDS_MeshElement.GetType(), and SMDSAbs_Node.

Referenced by SetMeshElementOnShape(), SetNodeInVolume(), SetNodeOnEdge(), SetNodeOnFace(), and SetNodeOnVertex().

{
  if ( elem && subMesh ) {
    if ( elem->GetType() == SMDSAbs_Node )
      subMesh->AddNode( static_cast<const SMDS_MeshNode* >( elem ));
    else
      subMesh->AddElement( elem );
    return true;
  }
  return false;
}
SMDS_Mesh0DElement * SMESHDS_Mesh::Add0DElement ( const SMDS_MeshNode node) [virtual]

create a Mesh0DElement and add it to the current Mesh

Returns:
: The created Mesh0DElement

Reimplemented from SMDS_Mesh.

Definition at line 299 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.Add0DElement(), SMDS_MeshElement.GetID(), and myScript.

{
  SMDS_Mesh0DElement* anElem = SMDS_Mesh::Add0DElement(node);
  if (anElem) myScript->Add0DElement(anElem->GetID(), node->GetID());
  return anElem;
}
SMDS_Mesh0DElement * SMESHDS_Mesh::Add0DElementWithID ( const SMDS_MeshNode n,
int  ID 
) [virtual]

Create a new Mesh0DElement and at it to the mesh.

Parameters:
idnodeID of the node
IDID of the 0D element to create
Returns:
The created 0D element or NULL if an element with this ID already exists or if input node is not found.

Reimplemented from SMDS_Mesh.

Definition at line 294 of file SMESHDS_Mesh.cxx.

References SMDS_MeshElement.GetID().

{
  return Add0DElementWithID(node->GetID(), ID);
}
SMDS_Mesh0DElement * SMESHDS_Mesh::Add0DElementWithID ( int  idnode,
int  ID 
) [virtual]

create a Mesh0DElement and add it to the current Mesh

Returns:
: The created Mesh0DElement

Reimplemented from SMDS_Mesh.

Definition at line 286 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.Add0DElement(), and myScript.

{
  SMDS_Mesh0DElement* anElem = SMDS_Mesh::Add0DElementWithID(nodeID, ID);
  if (anElem) myScript->Add0DElement(ID, nodeID);
  return anElem;
}
void SMDS_Mesh::addChildrenWithNodes ( std::set< const SMDS_MeshElement * > &  setOfChildren,
const SMDS_MeshElement element,
std::set< const SMDS_MeshElement * > &  nodes 
) [protected, inherited]

Find the children of an element that are made of given nodes.

Parameters:
setOfChildrenThe set in which matching children will be inserted
elementThe element were to search matching children
nodesThe nodes that the children must have to be selected

Definition at line 2913 of file SMDS_Mesh.cxx.

References SMDS_MeshElement.edgesIterator(), SMDS_MeshElement.facesIterator(), SMDS_MeshElement.GetType(), SMDS_Mesh.hasConstructionEdges(), SMDS_Mesh.hasConstructionFaces(), MESSAGE, SMESH_AdvancedEditor.nodes, SMDS_MeshElement.nodesIterator(), SMDSAbs_0DElement, SMDSAbs_Edge, SMDSAbs_Face, SMDSAbs_Node, and SMDSAbs_Volume.

Referenced by SMDS_Mesh.RemoveElement().

{
  switch(element->GetType())
    {
    case SMDSAbs_Node:
      MESSAGE("Internal Error: This should not happen");
      break;
    case SMDSAbs_0DElement:
      {
      }
      break;
    case SMDSAbs_Edge:
        {
                SMDS_ElemIteratorPtr itn=element->nodesIterator();
                while(itn->more())
                {
                        const SMDS_MeshElement * e=itn->next();
                        if(nodes.find(e)!=nodes.end())
                        {
                          setOfChildren.insert(element);
                          break;
                        }
                }
        } break;
    case SMDSAbs_Face:
        {
                SMDS_ElemIteratorPtr itn=element->nodesIterator();
                while(itn->more())
                {
                        const SMDS_MeshElement * e=itn->next();
                        if(nodes.find(e)!=nodes.end())
                        {
                          setOfChildren.insert(element);
                          break;
                        }
                }
                if(hasConstructionEdges())
                {
                        SMDS_ElemIteratorPtr ite=element->edgesIterator();
                        while(ite->more())
                                addChildrenWithNodes(setOfChildren, ite->next(), nodes);
                }
        } break;
    case SMDSAbs_Volume:
        {
                if(hasConstructionFaces())
                {
                        SMDS_ElemIteratorPtr ite=element->facesIterator();
                        while(ite->more())
                                addChildrenWithNodes(setOfChildren, ite->next(), nodes);
                }
                else if(hasConstructionEdges())
                {
                        SMDS_ElemIteratorPtr ite=element->edgesIterator();
                        while(ite->more())
                                addChildrenWithNodes(setOfChildren, ite->next(), nodes);
                }
        }
    }
}
int SMESHDS_Mesh::AddCompoundSubmesh ( const TopoDS_Shape &  S,
TopAbs_ShapeEnum  type = TopAbs_SHAPE 
)

Definition at line 1207 of file SMESHDS_Mesh.cxx.

References SMESHDS_SubMesh.AddSubMesh(), SMESHDS_SubMesh.IsComplexSubmesh(), IsGroupOfSubShapes(), Max(), myIndexToShape, myShape, and NewSubMesh().

Referenced by SMESHDS_GroupOnGeom.SetShape().

{
  int aMainIndex = 0;
  if ( IsGroupOfSubShapes( S ))
  {
    aMainIndex = myIndexToShape.Add( S );
    bool all = ( type == TopAbs_SHAPE );
    if ( all ) // corresponding simple submesh may exist
      aMainIndex = -aMainIndex;
    //MESSAGE("AddCompoundSubmesh index = " << aMainIndex );
    SMESHDS_SubMesh * aNewSub = NewSubMesh( aMainIndex );
    if ( !aNewSub->IsComplexSubmesh() ) // is empty
    {
      int shapeType = Max( TopAbs_SOLID, all ? myShape.ShapeType() : type );
      int typeLimit = all ? TopAbs_VERTEX : type;
      for ( ; shapeType <= typeLimit; shapeType++ )
      {
        TopExp_Explorer exp( S, TopAbs_ShapeEnum( shapeType ));
        for ( ; exp.More(); exp.Next() )
        {
          int index = myIndexToShape.FindIndex( exp.Current() );
          if ( index )
            aNewSub->AddSubMesh( NewSubMesh( index ));
        }
      }
    }
  }
  return aMainIndex;
}
SMDS_MeshEdge * SMESHDS_Mesh::AddEdge ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n12 
) [virtual]

Reimplemented from SMDS_Mesh.

Definition at line 1374 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddEdge(), AddEdge(), SMDS_MeshElement.GetID(), and myScript.

{
  SMDS_MeshEdge* anElem = SMDS_Mesh::AddEdge(n1,n2,n12);
  if(anElem) myScript->AddEdge(anElem->GetID(), 
                               n1->GetID(), 
                               n2->GetID(),
                               n12->GetID());
  return anElem;
}
SMDS_MeshEdge * SMESHDS_Mesh::AddEdge ( const SMDS_MeshNode node1,
const SMDS_MeshNode node2 
) [virtual]

create a MeshEdge and add it to the current Mesh

Returns:
: The created MeshEdge

Reimplemented from SMDS_Mesh.

Definition at line 326 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddEdge(), SMDS_MeshElement.GetID(), and myScript.

Referenced by AddEdge(), SMESH_MesherHelper.AddEdge(), SMESH.SMESH_Gen.Compute(), and SMESH_MeshEditor.sweepElement().

{
  SMDS_MeshEdge* anElem = SMDS_Mesh::AddEdge(n1,n2);
  if(anElem) myScript->AddEdge(anElem->GetID(), 
                               n1->GetID(), 
                               n2->GetID());
  return anElem;
}
SMDS_MeshEdge * SMESHDS_Mesh::AddEdgeWithID ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n12,
int  ID 
) [virtual]

Reimplemented from SMDS_Mesh.

Definition at line 1390 of file SMESHDS_Mesh.cxx.

References AddEdgeWithID(), and SMDS_MeshElement.GetID().

{
  return AddEdgeWithID(n1->GetID(),
                       n2->GetID(),
                       n12->GetID(),
                       ID);
}
SMDS_MeshEdge * SMESHDS_Mesh::AddEdgeWithID ( int  n1,
int  n2,
int  n12,
int  ID 
) [virtual]

Reimplemented from SMDS_Mesh.

Definition at line 1363 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddEdge(), AddEdgeWithID(), and myScript.

{
  SMDS_MeshEdge* anElem = SMDS_Mesh::AddEdgeWithID(n1,n2,n12,ID);
  if(anElem) myScript->AddEdge(ID,n1,n2,n12);
  return anElem;
}
SMDS_MeshEdge * SMESHDS_Mesh::AddEdgeWithID ( int  idnode1,
int  idnode2,
int  ID 
) [virtual]

create a MeshEdge and add it to the current Mesh

Returns:
: The created MeshEdge

Reimplemented from SMDS_Mesh.

Definition at line 310 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddEdge(), and myScript.

Referenced by SMESH_MesherHelper.AddEdge(), and AddEdgeWithID().

{
  SMDS_MeshEdge* anElem = SMDS_Mesh::AddEdgeWithID(n1,n2,ID);
  if(anElem) myScript->AddEdge(ID,n1,n2);
  return anElem;
}
SMDS_MeshEdge * SMESHDS_Mesh::AddEdgeWithID ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
int  ID 
) [virtual]

Create a new edge and at it to the mesh.

Parameters:
idnode1ID of the first node
idnode2ID of the second node
IDID of the edge to create
Returns:
The created edge or NULL if an element with this ID already exists or if input nodes are not found.

Reimplemented from SMDS_Mesh.

Definition at line 317 of file SMESHDS_Mesh.cxx.

References AddEdgeWithID(), and SMDS_MeshElement.GetID().

{
  return AddEdgeWithID(n1->GetID(),
                       n2->GetID(),
                       ID);
}
SMDS_MeshFace * SMESHDS_Mesh::AddFace ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3 
) [virtual]

Add a triangle defined by its nodes.

An ID is automatically affected to the Created face

Reimplemented from SMDS_Mesh.

Definition at line 358 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddFace(), SMDS_MeshElement.GetID(), and myScript.

Referenced by AddFace(), SMESH_MesherHelper.AddFace(), StdMeshers_QuadToTriaAdaptor.Compute(), SMESH_Pattern.createElements(), SMESH_MeshEditor.DeleteDiag(), SMESH_MeshEditor.InsertNodesIntoLink(), SMESH_MeshEditor.QuadToTri(), and SMESH_MeshEditor.sweepElement().

{
  SMDS_MeshFace *anElem = SMDS_Mesh::AddFace(n1, n2, n3);
  if(anElem) myScript->AddFace(anElem->GetID(), 
                               n1->GetID(), 
                               n2->GetID(),
                               n3->GetID());
  return anElem;
}
SMDS_MeshFace * SMESHDS_Mesh::AddFace ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4 
) [virtual]

Add a quadrangle defined by its nodes.

An ID is automatically affected to the created face

Reimplemented from SMDS_Mesh.

Definition at line 394 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddFace(), AddFace(), SMDS_MeshElement.GetID(), and myScript.

{
  SMDS_MeshFace *anElem = SMDS_Mesh::AddFace(n1, n2, n3, n4);
  if(anElem) myScript->AddFace(anElem->GetID(), 
                               n1->GetID(), 
                               n2->GetID(), 
                               n3->GetID(),
                               n4->GetID());
  return anElem;
}
SMDS_MeshFace * SMESHDS_Mesh::AddFace ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n12,
const SMDS_MeshNode n23,
const SMDS_MeshNode n31 
) [virtual]

Reimplemented from SMDS_Mesh.

Definition at line 1406 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddFace(), AddFace(), SMDS_MeshElement.GetID(), and myScript.

{
  SMDS_MeshFace *anElem = SMDS_Mesh::AddFace(n1,n2,n3,n12,n23,n31);
  if(anElem) myScript->AddFace(anElem->GetID(), 
                               n1->GetID(), n2->GetID(), n3->GetID(),
                               n12->GetID(), n23->GetID(), n31->GetID());
  return anElem;
}
SMDS_MeshFace * SMESHDS_Mesh::AddFace ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4,
const SMDS_MeshNode n12,
const SMDS_MeshNode n23,
const SMDS_MeshNode n34,
const SMDS_MeshNode n41 
) [virtual]

Reimplemented from SMDS_Mesh.

Definition at line 1454 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddFace(), AddFace(), SMDS_MeshElement.GetID(), and myScript.

{
  SMDS_MeshFace *anElem = SMDS_Mesh::AddFace(n1,n2,n3,n4,n12,n23,n34,n41);
  if(anElem) myScript->AddFace(anElem->GetID(), 
                               n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(),
                               n12->GetID(), n23->GetID(), n34->GetID(), n41->GetID());
  return anElem;
}
SMDS_MeshFace * SMDS_Mesh::AddFace ( const SMDS_MeshEdge e1,
const SMDS_MeshEdge e2,
const SMDS_MeshEdge e3 
) [virtual, inherited]

Add a triangle defined by its edges.

An ID is automatically assigned to the Created face

Definition at line 458 of file SMDS_Mesh.cxx.

References SMDS_Mesh.AddFaceWithID(), SMDS_MeshElementIDFactory.GetFreeID(), SMDS_Mesh.hasConstructionEdges(), and SMDS_Mesh.myElementIDFactory.

{
  if (!hasConstructionEdges())
    return NULL;
     //MESSAGE("AddFaceWithID");
 return AddFaceWithID(e1,e2,e3, myElementIDFactory->GetFreeID());
}
SMDS_MeshFace * SMDS_Mesh::AddFace ( const SMDS_MeshEdge e1,
const SMDS_MeshEdge e2,
const SMDS_MeshEdge e3,
const SMDS_MeshEdge e4 
) [virtual, inherited]

Add a quadrangle defined by its edges.

An ID is automatically assigned to the Created face

Definition at line 502 of file SMDS_Mesh.cxx.

References SMDS_Mesh.AddFaceWithID(), SMDS_MeshElementIDFactory.GetFreeID(), SMDS_Mesh.hasConstructionEdges(), and SMDS_Mesh.myElementIDFactory.

{
  if (!hasConstructionEdges())
    return NULL;
     //MESSAGE("AddFaceWithID" );
 return AddFaceWithID(e1,e2,e3,e4, myElementIDFactory->GetFreeID());
}
SMDS_MeshFace * SMESHDS_Mesh::AddFaceWithID ( int  n1,
int  n2,
int  n3,
int  ID 
) [virtual]

Add a triangle defined by its nodes IDs.

Reimplemented from SMDS_Mesh.

Definition at line 340 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddFace(), and myScript.

Referenced by SMESH_MesherHelper.AddFace(), and AddFaceWithID().

{
  SMDS_MeshFace *anElem = SMDS_Mesh::AddFaceWithID(n1, n2, n3, ID);
  if(anElem) myScript->AddFace(ID,n1,n2,n3);
  return anElem;
}
SMDS_MeshFace * SMESHDS_Mesh::AddFaceWithID ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
int  ID 
) [virtual]

Add a triangle defined by its nodes.

Reimplemented from SMDS_Mesh.

Definition at line 347 of file SMESHDS_Mesh.cxx.

References AddFaceWithID(), and SMDS_MeshElement.GetID().

{
  return AddFaceWithID(n1->GetID(),
                       n2->GetID(),
                       n3->GetID(),
                       ID);
}
SMDS_MeshFace * SMESHDS_Mesh::AddFaceWithID ( int  n1,
int  n2,
int  n3,
int  n4,
int  ID 
) [virtual]

Add a quadrangle defined by its nodes IDs.

Reimplemented from SMDS_Mesh.

Definition at line 374 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddFace(), AddFaceWithID(), and myScript.

{
  SMDS_MeshFace *anElem = SMDS_Mesh::AddFaceWithID(n1, n2, n3, n4, ID);
  if(anElem) myScript->AddFace(ID, n1, n2, n3, n4);
  return anElem;
}
SMDS_MeshFace * SMESHDS_Mesh::AddFaceWithID ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4,
int  ID 
) [virtual]

Add a quadrangle defined by its nodes.

Reimplemented from SMDS_Mesh.

Definition at line 381 of file SMESHDS_Mesh.cxx.

References AddFaceWithID(), and SMDS_MeshElement.GetID().

{
  return AddFaceWithID(n1->GetID(),
                       n2->GetID(),
                       n3->GetID(),
                       n4->GetID(),
                       ID);
}
SMDS_MeshFace * SMESHDS_Mesh::AddFaceWithID ( int  n1,
int  n2,
int  n3,
int  n12,
int  n23,
int  n31,
int  ID 
) [virtual]

Reimplemented from SMDS_Mesh.

Definition at line 1424 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddFace(), AddFaceWithID(), and myScript.

{
  SMDS_MeshFace *anElem = SMDS_Mesh::AddFaceWithID(n1,n2,n3,n12,n23,n31,ID);
  if(anElem) myScript->AddFace(ID,n1,n2,n3,n12,n23,n31);
  return anElem;
}
SMDS_MeshFace * SMESHDS_Mesh::AddFaceWithID ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n12,
const SMDS_MeshNode n23,
const SMDS_MeshNode n31,
int  ID 
) [virtual]

Reimplemented from SMDS_Mesh.

Definition at line 1436 of file SMESHDS_Mesh.cxx.

References AddFaceWithID(), and SMDS_MeshElement.GetID().

{
  return AddFaceWithID(n1->GetID(), n2->GetID(), n3->GetID(),
                       n12->GetID(), n23->GetID(), n31->GetID(),
                       ID);
}
SMDS_MeshFace * SMESHDS_Mesh::AddFaceWithID ( int  n1,
int  n2,
int  n3,
int  n4,
int  n12,
int  n23,
int  n34,
int  n41,
int  ID 
) [virtual]

Reimplemented from SMDS_Mesh.

Definition at line 1474 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddFace(), AddFaceWithID(), and myScript.

{
  SMDS_MeshFace *anElem = SMDS_Mesh::AddFaceWithID(n1,n2,n3,n4,n12,n23,n34,n41,ID);
  if(anElem) myScript->AddFace(ID,n1,n2,n3,n4,n12,n23,n34,n41);
  return anElem;
}
SMDS_MeshFace * SMESHDS_Mesh::AddFaceWithID ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4,
const SMDS_MeshNode n12,
const SMDS_MeshNode n23,
const SMDS_MeshNode n34,
const SMDS_MeshNode n41,
int  ID 
) [virtual]

Reimplemented from SMDS_Mesh.

Definition at line 1486 of file SMESHDS_Mesh.cxx.

References AddFaceWithID(), and SMDS_MeshElement.GetID().

{
  return AddFaceWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(),
                       n12->GetID(), n23->GetID(), n34->GetID(), n41->GetID(),
                       ID);
}
SMDS_MeshFace * SMDS_Mesh::AddFaceWithID ( const SMDS_MeshEdge e1,
const SMDS_MeshEdge e2,
const SMDS_MeshEdge e3,
int  ID 
) [virtual, inherited]
SMDS_MeshFace * SMDS_Mesh::AddFaceWithID ( const SMDS_MeshEdge e1,
const SMDS_MeshEdge e2,
const SMDS_MeshEdge e3,
const SMDS_MeshEdge e4,
int  ID 
) [virtual, inherited]
SMESH_Group * SMESH_Mesh::AddGroup ( SMESHDS_GroupBase theGroup)

Definition at line 440 of file SMESHDS_Mesh.hxx.

{ myGroups.insert(theGroup); }
bool SMESHDS_Mesh::AddHypothesis ( const TopoDS_Shape &  SS,
const SMESHDS_Hypothesis H 
)

Definition at line 143 of file SMESHDS_Mesh.cxx.

References myShapeToHypothesis.

Referenced by SMESH_subMesh.AlgoStateEngine().

{
  if (!myShapeToHypothesis.IsBound(SS.Oriented(TopAbs_FORWARD))) {
    list<const SMESHDS_Hypothesis *> aList;
    myShapeToHypothesis.Bind(SS.Oriented(TopAbs_FORWARD), aList);
  }
  list<const SMESHDS_Hypothesis *>& alist =
    myShapeToHypothesis(SS.Oriented(TopAbs_FORWARD)); // ignore orientation of SS

  //Check if the Hypothesis is still present
  list<const SMESHDS_Hypothesis*>::iterator ith = find(alist.begin(),alist.end(), H );

  if (alist.end() != ith) return false;

  alist.push_back(H);
  return true;
}
SMDS_MeshNode * SMESHDS_Mesh::AddNode ( double  x,
double  y,
double  z 
) [virtual]
void SMESHDS_Mesh.addNodeToSubmesh ( const SMDS_MeshNode aNode,
int  Index 
) [private]

Definition at line 454 of file SMESHDS_Mesh.hxx.

  {
    //Update or build submesh
    std::map<int,SMESHDS_SubMesh*>::iterator it = myShapeIndexToSubMesh.find( Index );
    if ( it == myShapeIndexToSubMesh.end() )
      it = myShapeIndexToSubMesh.insert( std::make_pair(Index, new SMESHDS_SubMesh(this, Index) )).first;
    it->second->AddNode( aNode ); // add aNode to submesh
  }
SMDS_MeshNode * SMESHDS_Mesh::AddNodeWithID ( double  x,
double  y,
double  z,
int  ID 
) [virtual]

create a MeshNode and add it to the current Mesh

Parameters:
ID: The ID of the MeshNode to create
Returns:
: The created node or NULL if a node with this ID already exists

Reimplemented from SMDS_Mesh.

Definition at line 193 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddNode(), SMDS_MeshElement.GetID(), myScript, ex29_refine.node(), ex13_hole1partial.x, and ex13_hole1partial.y.

Referenced by SMESH_MesherHelper.AddNode(), and SMESH_Gen_i.CopyMesh().

                                                                              {
  SMDS_MeshNode* node = SMDS_Mesh::AddNodeWithID(x,y,z,ID);
  if(node!=NULL) myScript->AddNode(node->GetID(), x, y, z);
  return node;
}
SMDS_MeshFace * SMDS_Mesh::AddPolygonalFace ( std::vector< const SMDS_MeshNode * >  nodes) [virtual, inherited]

Add a polygon defined by its nodes.

An ID is automatically affected to the created face.

Definition at line 1214 of file SMDS_Mesh.cxx.

References SMDS_Mesh.AddPolygonalFaceWithID(), SMDS_MeshElementIDFactory.GetFreeID(), and SMDS_Mesh.myElementIDFactory.

Referenced by AddPolygonalFace().

SMDS_MeshFace * SMESHDS_Mesh::AddPolygonalFace ( const std::vector< const SMDS_MeshNode * > &  nodes) [virtual]

Definition at line 619 of file SMESHDS_Mesh.cxx.

References SMDS_Mesh.AddPolygonalFace(), and SMDS_MeshElement.GetID().

Referenced by SMESH_MesherHelper.AddPolygonalFace(), SMESH_Pattern.createElements(), SMESH_MeshEditor.InsertNodesIntoLink(), StdMeshers_Prism_3D.projectBottomToTop(), and SMESH_MeshEditor.Transform().

{
  SMDS_MeshFace *anElem = SMDS_Mesh::AddPolygonalFace(nodes);
  if (anElem) {
    int i, len = nodes.size();
    std::vector<int> nodes_ids (len);
    for (i = 0; i < len; i++) {
      nodes_ids[i] = nodes[i]->GetID();
    }
    myScript->AddPolygonalFace(anElem->GetID(), nodes_ids);
  }
  return anElem;
}
SMDS_MeshFace * SMDS_Mesh::AddPolygonalFaceWithID ( std::vector< int nodes_ids,
const int  ID 
) [virtual, inherited]

Add a polygon defined by its nodes IDs.

Definition at line 1140 of file SMDS_Mesh.cxx.

References SMDS_MeshNodeIDFactory.MeshElement(), SMDS_Mesh.myNodeIDFactory, and SMESH_AdvancedEditor.nodes.

Referenced by SMDS_Mesh.AddPolygonalFace(), and AddPolygonalFaceWithID().

{
  int nbNodes = nodes_ids.size();
  vector<const SMDS_MeshNode*> nodes (nbNodes);
  for (int i = 0; i < nbNodes; i++) {
    nodes[i] = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(nodes_ids[i]);
    if (!nodes[i]) return NULL;
  }
  return SMDS_Mesh::AddPolygonalFaceWithID(nodes, ID);
}
SMDS_MeshFace * SMDS_Mesh::AddPolygonalFaceWithID ( std::vector< const SMDS_MeshNode * >  nodes,
const int  ID 
) [virtual, inherited]

Add a polygon defined by its nodes.

Definition at line 1157 of file SMDS_Mesh.cxx.

References CHECKMEMORY_INTERVAL, PAL_MESH_043_3D.face, SMDS_MeshElement.getVtkId(), SMDS_VtkFace.initPoly(), and MESSAGE.

{
  SMDS_MeshFace * face;

  if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
  if (hasConstructionEdges())
    {
      MESSAGE("Error : Not implemented");
      return NULL;
    }
  else
    {
//#ifdef VTK_HAVE_POLYHEDRON
    //MESSAGE("AddPolygonalFaceWithID vtk " << ID);
    vector<vtkIdType> nodeIds;
    nodeIds.clear();
    vector<const SMDS_MeshNode*>::iterator it = nodes.begin();
    for ( ; it != nodes.end(); ++it)
      nodeIds.push_back((*it)->getVtkId());

    SMDS_VtkFace *facevtk = myFacePool->getNew();
    facevtk->initPoly(nodeIds, this);
    if (!this->registerElement(ID,facevtk))
      {
        this->myGrid->GetCellTypesArray()->SetValue(facevtk->getVtkId(), VTK_EMPTY_CELL);
        myFacePool->destroy(facevtk);
        return 0;
      }
    face = facevtk;
//#else
//    MESSAGE("AddPolygonalFaceWithID smds " << ID);
//     for ( int i = 0; i < nodes.size(); ++i )
//      if ( !nodes[ i ] ) return 0;
//      face = new SMDS_PolygonalFaceOfNodes(nodes);
//#endif
      adjustmyCellsCapacity(ID);
      myCells[ID] = face;
      myInfo.myNbPolygons++;
    }

//#ifndef VTK_HAVE_POLYHEDRON
//  if (!registerElement(ID, face))
//    {
//      registerElement(myElementIDFactory->GetFreeID(), face);
//      //RemoveElement(face, false);
//      //face = NULL;
//    }
//#endif
 return face;
}
SMDS_MeshFace * SMESHDS_Mesh::AddPolygonalFaceWithID ( const std::vector< int > &  nodes_ids,
const int  ID 
) [virtual]

Definition at line 592 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddPolygonalFace(), and myScript.

Referenced by SMESH_MesherHelper.AddPolygonalFace().

{
  SMDS_MeshFace *anElem = SMDS_Mesh::AddPolygonalFaceWithID(nodes_ids, ID);
  if (anElem) {
    myScript->AddPolygonalFace(ID, nodes_ids);
  }
  return anElem;
}
SMDS_MeshFace * SMESHDS_Mesh::AddPolygonalFaceWithID ( const std::vector< const SMDS_MeshNode * > &  nodes,
const int  ID 
) [virtual]

Definition at line 603 of file SMESHDS_Mesh.cxx.

References SMDS_Mesh.AddPolygonalFaceWithID().

{
  SMDS_MeshFace *anElem = SMDS_Mesh::AddPolygonalFaceWithID(nodes, ID);
  if (anElem) {
    int i, len = nodes.size();
    std::vector<int> nodes_ids (len);
    for (i = 0; i < len; i++) {
      nodes_ids[i] = nodes[i]->GetID();
    }
    myScript->AddPolygonalFace(ID, nodes_ids);
  }
  return anElem;
}
SMDS_MeshVolume * SMDS_Mesh::AddPolyhedralVolume ( std::vector< const SMDS_MeshNode * >  nodes,
std::vector< int quantities 
) [virtual, inherited]

Create a new polyhedral volume and add it to the mesh.

Returns:
The created volume

Definition at line 1310 of file SMDS_Mesh.cxx.

References SMDS_Mesh.AddPolyhedralVolumeWithID().

Referenced by AddPolyhedralVolume().

{
  int ID = myElementIDFactory->GetFreeID();
  SMDS_MeshVolume * v = SMDS_Mesh::AddPolyhedralVolumeWithID(nodes, quantities, ID);
  if (v == NULL) myElementIDFactory->ReleaseID(ID);
  return v;
}
SMDS_MeshVolume * SMESHDS_Mesh::AddPolyhedralVolume ( const std::vector< const SMDS_MeshNode * > &  nodes,
const std::vector< int > &  quantities 
) [virtual]

Definition at line 666 of file SMESHDS_Mesh.cxx.

References SMDS_Mesh.AddPolyhedralVolume(), and SMDS_MeshElement.GetID().

Referenced by SMESH_MesherHelper.AddPolyhedralVolume(), StdMeshers_Prism_3D.AddPrisms(), StdMeshers_Projection_3D.Compute(), SMESH_Gen_i.ConcatenateCommon(), SMESH_Pattern.createElements(), SMESH_MeshEditor.sweepElement(), SMESH_MeshEditor.Transform(), and SMESH_MeshEditor.UpdateVolumes().

{
  SMDS_MeshVolume *anElem = SMDS_Mesh::AddPolyhedralVolume(nodes, quantities);
  if (anElem) {
    int i, len = nodes.size();
    std::vector<int> nodes_ids (len);
    for (i = 0; i < len; i++) {
      nodes_ids[i] = nodes[i]->GetID();
    }
    myScript->AddPolyhedralVolume(anElem->GetID(), nodes_ids, quantities);
  }
  return anElem;
}
SMDS_MeshVolume * SMDS_Mesh::AddPolyhedralVolumeWithID ( std::vector< int nodes_ids,
std::vector< int quantities,
const int  ID 
) [virtual, inherited]

Create a new polyhedral volume and add it to the mesh.

Parameters:
IDThe ID of the new volume
Returns:
The created volume or NULL if an element with this ID already exists or if input nodes are not found.

Definition at line 1227 of file SMDS_Mesh.cxx.

References SMESH_AdvancedEditor.nodes.

Referenced by SMDS_Mesh.AddPolyhedralVolume(), and AddPolyhedralVolumeWithID().

{
  int nbNodes = nodes_ids.size();
  vector<const SMDS_MeshNode*> nodes (nbNodes);
  for (int i = 0; i < nbNodes; i++) {
    nodes[i] = (SMDS_MeshNode *)myNodeIDFactory->MeshElement(nodes_ids[i]);
    if (!nodes[i]) return NULL;
  }
  return SMDS_Mesh::AddPolyhedralVolumeWithID(nodes, quantities, ID);
}
SMDS_MeshVolume * SMDS_Mesh::AddPolyhedralVolumeWithID ( std::vector< const SMDS_MeshNode * >  nodes,
std::vector< int quantities,
const int  ID 
) [virtual, inherited]

Create a new polyhedral volume and add it to the mesh.

Parameters:
IDThe ID of the new volume
Returns:
The created volume

Definition at line 1247 of file SMDS_Mesh.cxx.

References CHECKMEMORY_INTERVAL, SMDS_MeshElement.getVtkId(), SMDS_VtkVolume.initPoly(), and MESSAGE.

{
  SMDS_MeshVolume* volume;
  if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
  if (hasConstructionFaces())
    {
      MESSAGE("Error : Not implemented");
      return NULL;
    }
  else if (hasConstructionEdges())
    {
      MESSAGE("Error : Not implemented");
      return NULL;
    }
  else
    {
//#ifdef VTK_HAVE_POLYHEDRON
      //MESSAGE("AddPolyhedralVolumeWithID vtk " << ID);
      vector<vtkIdType> nodeIds;
      nodeIds.clear();
      vector<const SMDS_MeshNode*>::iterator it = nodes.begin();
      for (; it != nodes.end(); ++it)
        nodeIds.push_back((*it)->getVtkId());

      SMDS_VtkVolume *volvtk = myVolumePool->getNew();
      volvtk->initPoly(nodeIds, quantities, this);
      if (!this->registerElement(ID, volvtk))
        {
          this->myGrid->GetCellTypesArray()->SetValue(volvtk->getVtkId(), VTK_EMPTY_CELL);
          myVolumePool->destroy(volvtk);
          return 0;
        }
      volume = volvtk;
//#else
//      MESSAGE("AddPolyhedralVolumeWithID smds " << ID);
//      for ( int i = 0; i < nodes.size(); ++i )
//      if ( !nodes[ i ] ) return 0;
//      volume = new SMDS_PolyhedralVolumeOfNodes(nodes, quantities);
//#endif
      adjustmyCellsCapacity(ID);
      myCells[ID] = volume;
      myInfo.myNbPolyhedrons++;
    }

//#ifndef VTK_HAVE_POLYHEDRON
//  if (!registerElement(ID, volume))
//    {
//      registerElement(myElementIDFactory->GetFreeID(), volume);
//      //RemoveElement(volume, false);
//      //volume = NULL;
//    }
//#endif
  return volume;
}
SMDS_MeshVolume * SMESHDS_Mesh::AddPolyhedralVolumeWithID ( const std::vector< int > &  nodes_ids,
const std::vector< int > &  quantities,
const int  ID 
) [virtual]

Definition at line 637 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddPolyhedralVolume(), and myScript.

Referenced by SMESH_MesherHelper.AddPolyhedralVolume().

{
  SMDS_MeshVolume *anElem = SMDS_Mesh::AddPolyhedralVolumeWithID(nodes_ids, quantities, ID);
  if (anElem) {
    myScript->AddPolyhedralVolume(ID, nodes_ids, quantities);
  }
  return anElem;
}
SMDS_MeshVolume * SMESHDS_Mesh::AddPolyhedralVolumeWithID ( const std::vector< const SMDS_MeshNode * > &  nodes,
const std::vector< int > &  quantities,
const int  ID 
) [virtual]

Definition at line 649 of file SMESHDS_Mesh.cxx.

References SMDS_Mesh.AddPolyhedralVolumeWithID().

{
  SMDS_MeshVolume *anElem = SMDS_Mesh::AddPolyhedralVolumeWithID(nodes, quantities, ID);
  if (anElem) {
    int i, len = nodes.size();
    std::vector<int> nodes_ids (len);
    for (i = 0; i < len; i++) {
      nodes_ids[i] = nodes[i]->GetID();
    }
    myScript->AddPolyhedralVolume(ID, nodes_ids, quantities);
  }
  return anElem;
}
SMDS_Mesh * SMDS_Mesh::AddSubMesh ( ) [inherited]

Create a submesh and add it to the current mesh.

Definition at line 191 of file SMDS_Mesh.cxx.

References SMDS_Mesh.myChildren, SMDS_Mesh.SMDS_Mesh(), and SMESH_test4.submesh.

{
        SMDS_Mesh *submesh = new SMDS_Mesh(this);
        myChildren.insert(myChildren.end(), submesh);
        return submesh;
}
SMDS_MeshVolume * SMDS_Mesh::AddVolume ( const SMDS_MeshFace f1,
const SMDS_MeshFace f2,
const SMDS_MeshFace f3,
const SMDS_MeshFace f4 
) [virtual, inherited]

Create a new tetrahedron defined by its faces and add it to the mesh.

Returns:
The created tetrahedron

Definition at line 997 of file SMDS_Mesh.cxx.

References SMDS_Mesh.AddVolumeWithID(), SMDS_MeshElementIDFactory.GetFreeID(), SMDS_Mesh.hasConstructionFaces(), and SMDS_Mesh.myElementIDFactory.

{
    //MESSAGE("AddVolumeWithID");
  if (!hasConstructionFaces())
    return NULL;
  return AddVolumeWithID(f1,f2,f3,f4, myElementIDFactory->GetFreeID());
}
SMDS_MeshVolume * SMDS_Mesh::AddVolume ( const SMDS_MeshFace f1,
const SMDS_MeshFace f2,
const SMDS_MeshFace f3,
const SMDS_MeshFace f4,
const SMDS_MeshFace f5 
) [virtual, inherited]

Create a new pyramid defined by its faces and add it to the mesh.

Returns:
The created pyramid

Definition at line 1043 of file SMDS_Mesh.cxx.

References SMDS_Mesh.AddVolumeWithID(), SMDS_MeshElementIDFactory.GetFreeID(), SMDS_Mesh.hasConstructionFaces(), and SMDS_Mesh.myElementIDFactory.

{
     //MESSAGE("AddVolumeWithID");
 if (!hasConstructionFaces())
    return NULL;
  return AddVolumeWithID(f1,f2,f3,f4,f5, myElementIDFactory->GetFreeID());
}
SMDS_MeshVolume * SMDS_Mesh::AddVolume ( const SMDS_MeshFace f1,
const SMDS_MeshFace f2,
const SMDS_MeshFace f3,
const SMDS_MeshFace f4,
const SMDS_MeshFace f5,
const SMDS_MeshFace f6 
) [virtual, inherited]

Create a new prism defined by its faces and add it to the mesh.

Returns:
The created prism

Definition at line 1091 of file SMDS_Mesh.cxx.

References SMDS_Mesh.AddVolumeWithID(), SMDS_MeshElementIDFactory.GetFreeID(), SMDS_Mesh.hasConstructionFaces(), and SMDS_Mesh.myElementIDFactory.

{
     //MESSAGE("AddVolumeWithID" );
 if (!hasConstructionFaces())
    return NULL;
  return AddVolumeWithID(f1,f2,f3,f4,f5,f6, myElementIDFactory->GetFreeID());
}
SMDS_MeshVolume * SMESHDS_Mesh::AddVolume ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4 
) [virtual]

Create a new tetrahedron and add it to the mesh.

Returns:
The created tetrahedron

Reimplemented from SMDS_Mesh.

Definition at line 432 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddVolume(), SMDS_MeshElement.GetID(), and myScript.

Referenced by AddVolume(), SMESH_MesherHelper.AddVolume(), SMESH_Pattern.createElements(), SMESH_MeshEditor.CreateFlatElementsOnFacesGroups(), and SMESH_MeshEditor.sweepElement().

{
  SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolume(n1, n2, n3, n4);
  if(anElem) myScript->AddVolume(anElem->GetID(), 
                                 n1->GetID(), 
                                 n2->GetID(), 
                                 n3->GetID(),
                                 n4->GetID());
  return anElem;
}
SMDS_MeshVolume * SMESHDS_Mesh::AddVolume ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4,
const SMDS_MeshNode n5 
) [virtual]

Create a new pyramid and add it to the mesh.

Nodes 1,2,3 and 4 define the base of the pyramid

Returns:
The created pyramid

Reimplemented from SMDS_Mesh.

Definition at line 472 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddVolume(), AddVolume(), SMDS_MeshElement.GetID(), and myScript.

{
  SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolume(n1, n2, n3, n4, n5);
  if(anElem) myScript->AddVolume(anElem->GetID(), 
                                 n1->GetID(), 
                                 n2->GetID(), 
                                 n3->GetID(),
                                 n4->GetID(), 
                                 n5->GetID());
  return anElem;
}
SMDS_MeshVolume * SMESHDS_Mesh::AddVolume ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4,
const SMDS_MeshNode n5,
const SMDS_MeshNode n6 
) [virtual]

Create a new prism and add it to the mesh.

Nodes 1,2,3 is a triangle and 1,2,5,4 a quadrangle.

Returns:
The created prism

Reimplemented from SMDS_Mesh.

Definition at line 516 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddVolume(), AddVolume(), SMDS_MeshElement.GetID(), and myScript.

{
  SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolume(n1, n2, n3, n4, n5, n6);
  if(anElem) myScript->AddVolume(anElem->GetID(), 
                                 n1->GetID(), 
                                 n2->GetID(), 
                                 n3->GetID(),
                                 n4->GetID(), 
                                 n5->GetID(), 
                                 n6->GetID());
  return anElem;
}
SMDS_MeshVolume * SMESHDS_Mesh::AddVolume ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4,
const SMDS_MeshNode n5,
const SMDS_MeshNode n6,
const SMDS_MeshNode n7,
const SMDS_MeshNode n8 
) [virtual]

Create a new hexahedron and add it to the mesh.

Nodes 1,2,3,4 and 5,6,7,8 are quadrangle and 5,1 and 7,3 are an edges.

Returns:
The created hexahedron

Reimplemented from SMDS_Mesh.

Definition at line 566 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddVolume(), AddVolume(), SMDS_MeshElement.GetID(), and myScript.

{
  SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolume(n1, n2, n3, n4, n5, n6, n7, n8);
  if(anElem) myScript->AddVolume(anElem->GetID(), 
                                 n1->GetID(), 
                                 n2->GetID(), 
                                 n3->GetID(),
                                 n4->GetID(), 
                                 n5->GetID(), 
                                 n6->GetID(), 
                                 n7->GetID(), 
                                 n8->GetID());
  return anElem;
}
SMDS_MeshVolume * SMESHDS_Mesh::AddVolume ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4,
const SMDS_MeshNode n12,
const SMDS_MeshNode n23,
const SMDS_MeshNode n31,
const SMDS_MeshNode n14,
const SMDS_MeshNode n24,
const SMDS_MeshNode n34 
) [virtual]

Reimplemented from SMDS_Mesh.

Definition at line 1506 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddVolume(), AddVolume(), SMDS_MeshElement.GetID(), and myScript.

{
  SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolume(n1,n2,n3,n4,n12,n23,n31,n14,n24,n34);
  if(anElem) myScript->AddVolume(anElem->GetID(), 
                                 n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(),
                                 n12->GetID(), n23->GetID(), n31->GetID(),
                                 n14->GetID(), n24->GetID(), n34->GetID());
  return anElem;
}
SMDS_MeshVolume * SMESHDS_Mesh::AddVolume ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4,
const SMDS_MeshNode n5,
const SMDS_MeshNode n12,
const SMDS_MeshNode n23,
const SMDS_MeshNode n34,
const SMDS_MeshNode n41,
const SMDS_MeshNode n15,
const SMDS_MeshNode n25,
const SMDS_MeshNode n35,
const SMDS_MeshNode n45 
) [virtual]

Reimplemented from SMDS_Mesh.

Definition at line 1565 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddVolume(), AddVolume(), SMDS_MeshElement.GetID(), and myScript.

{
  SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolume(n1,n2,n3,n4,n5,n12,n23,n34,n41,
                                                 n15,n25,n35,n45);
  if(anElem)
    myScript->AddVolume(anElem->GetID(), n1->GetID(), n2->GetID(),
                        n3->GetID(), n4->GetID(), n5->GetID(),
                        n12->GetID(), n23->GetID(), n34->GetID(), n41->GetID(),
                        n15->GetID(), n25->GetID(), n35->GetID(), n45->GetID());
  return anElem;
}
SMDS_MeshVolume * SMESHDS_Mesh::AddVolume ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4,
const SMDS_MeshNode n5,
const SMDS_MeshNode n6,
const SMDS_MeshNode n12,
const SMDS_MeshNode n23,
const SMDS_MeshNode n31,
const SMDS_MeshNode n45,
const SMDS_MeshNode n56,
const SMDS_MeshNode n64,
const SMDS_MeshNode n14,
const SMDS_MeshNode n25,
const SMDS_MeshNode n36 
) [virtual]

Reimplemented from SMDS_Mesh.

Definition at line 1636 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddVolume(), AddVolume(), SMDS_MeshElement.GetID(), and myScript.

{
  SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolume(n1,n2,n3,n4,n5,n6,n12,n23,n31,
                                                 n45,n56,n64,n14,n25,n36);
  if(anElem)
    myScript->AddVolume(anElem->GetID(), n1->GetID(), n2->GetID(),
                        n3->GetID(), n4->GetID(), n5->GetID(), n6->GetID(),
                        n12->GetID(), n23->GetID(), n31->GetID(),
                        n45->GetID(), n56->GetID(), n64->GetID(),
                        n14->GetID(), n25->GetID(), n36->GetID());
  return anElem;
}
SMDS_MeshVolume * SMESHDS_Mesh::AddVolume ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4,
const SMDS_MeshNode n5,
const SMDS_MeshNode n6,
const SMDS_MeshNode n7,
const SMDS_MeshNode n8,
const SMDS_MeshNode n12,
const SMDS_MeshNode n23,
const SMDS_MeshNode n34,
const SMDS_MeshNode n41,
const SMDS_MeshNode n56,
const SMDS_MeshNode n67,
const SMDS_MeshNode n78,
const SMDS_MeshNode n85,
const SMDS_MeshNode n15,
const SMDS_MeshNode n26,
const SMDS_MeshNode n37,
const SMDS_MeshNode n48 
) [virtual]

Reimplemented from SMDS_Mesh.

Definition at line 1716 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddVolume(), AddVolume(), SMDS_MeshElement.GetID(), and myScript.

{
  SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolume(n1,n2,n3,n4,n5,n6,n7,n8,
                                                 n12,n23,n34,n41,
                                                 n56,n67,n78,n85,
                                                 n15,n26,n37,n48);
  if(anElem)
    myScript->AddVolume(anElem->GetID(), n1->GetID(), n2->GetID(),
                        n3->GetID(), n4->GetID(), n5->GetID(),
                        n6->GetID(), n7->GetID(), n8->GetID(),
                        n12->GetID(), n23->GetID(), n34->GetID(), n41->GetID(),
                        n56->GetID(), n67->GetID(), n78->GetID(), n85->GetID(),
                        n15->GetID(), n26->GetID(), n37->GetID(), n48->GetID());
  return anElem;
}
SMDS_MeshVolume * SMDS_Mesh::AddVolumeFromVtkIds ( const std::vector< vtkIdType > &  vtkNodeIds) [virtual, inherited]
SMDS_MeshVolume * SMDS_Mesh::AddVolumeFromVtkIdsWithID ( const std::vector< vtkIdType > &  vtkNodeIds,
const int  ID 
) [virtual, inherited]

Definition at line 1327 of file SMDS_Mesh.cxx.

References SMDS_Mesh.adjustmyCellsCapacity(), ObjectPool< X >.destroy(), ObjectPool< X >.getNew(), SMDS_MeshElement.getVtkId(), SMDS_VtkVolume.GetVtkType(), SMDS_VtkVolume.init(), SMDS_Mesh.myCells, SMDS_Mesh.myGrid, SMDS_Mesh.myInfo, SMDS_MeshInfo.myNbHexas, SMDS_MeshInfo.myNbPolyhedrons, SMDS_MeshInfo.myNbPrisms, SMDS_MeshInfo.myNbPyramids, SMDS_MeshInfo.myNbQuadHexas, SMDS_MeshInfo.myNbQuadPrisms, SMDS_MeshInfo.myNbQuadPyramids, SMDS_MeshInfo.myNbQuadTetras, SMDS_MeshInfo.myNbTetras, SMDS_Mesh.myVolumePool, and SMDS_Mesh.registerElement().

Referenced by SMDS_Mesh.AddVolumeFromVtkIds().

{
  SMDS_VtkVolume *volvtk = myVolumePool->getNew();
  volvtk->init(vtkNodeIds, this);
  if (!this->registerElement(ID,volvtk))
    {
      this->myGrid->GetCellTypesArray()->SetValue(volvtk->getVtkId(), VTK_EMPTY_CELL);
      myVolumePool->destroy(volvtk);
      return 0;
    }
  adjustmyCellsCapacity(ID);
  myCells[ID] = volvtk;
  vtkIdType aVtkType = volvtk->GetVtkType();
  switch (aVtkType)
  {
    case VTK_TETRA:
      myInfo.myNbTetras++;
      break;
    case VTK_PYRAMID:
      myInfo.myNbPyramids++;
      break;
    case VTK_WEDGE:
      myInfo.myNbPrisms++;
      break;
    case VTK_HEXAHEDRON:
      myInfo.myNbHexas++;
      break;
    case VTK_QUADRATIC_TETRA:
      myInfo.myNbQuadTetras++;
      break;
    case VTK_QUADRATIC_PYRAMID:
      myInfo.myNbQuadPyramids++;
      break;
    case VTK_QUADRATIC_WEDGE:
      myInfo.myNbQuadPrisms++;
      break;
    case VTK_QUADRATIC_HEXAHEDRON:
      myInfo.myNbQuadHexas++;
      break;
//#ifdef VTK_HAVE_POLYHEDRON
    case VTK_POLYHEDRON:
      myInfo.myNbPolyhedrons++;
      break;
//#endif
    default:
      myInfo.myNbPolyhedrons++;
      break;
  }
  return volvtk;
}
SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID ( const SMDS_MeshFace f1,
const SMDS_MeshFace f2,
const SMDS_MeshFace f3,
const SMDS_MeshFace f4,
const SMDS_MeshFace f5,
const SMDS_MeshFace f6,
int  ID 
) [virtual, inherited]

Create a new prism defined by its faces and add it to the mesh.

Parameters:
IDThe ID of the new volume
Returns:
The created prism

Definition at line 1110 of file SMDS_Mesh.cxx.

References SMDS_Mesh.adjustmyCellsCapacity(), SMDS_Mesh.CheckMemory(), CHECKMEMORY_INTERVAL, SMDS_MeshElementIDFactory.GetFreeID(), SMDS_Mesh.hasConstructionFaces(), MESSAGE, SMDS_Mesh.myCells, SMDS_Mesh.myElementIDFactory, SMDS_Mesh.myInfo, SMDS_MeshInfo.myNbPrisms, SMDS_Mesh.NbVolumes(), and SMDS_Mesh.registerElement().

{
  MESSAGE("AddVolumeWithID" << ID);
  if (!hasConstructionFaces())
    return NULL;
  if ( !f1 || !f2 || !f3 || !f4 || !f5 || !f6) return 0;
  if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
  SMDS_MeshVolume * volume = new SMDS_VolumeOfFaces(f1,f2,f3,f4,f5,f6);
  adjustmyCellsCapacity(ID);
  myCells[ID] = volume;
  myInfo.myNbPrisms++;

  if (!registerElement(ID, volume)) {
    registerElement(myElementIDFactory->GetFreeID(), volume);
    //RemoveElement(volume, false);
    //volume = NULL;
  }
  return volume;
}
SMDS_MeshVolume * SMESHDS_Mesh::AddVolumeWithID ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4,
int  ID 
) [virtual]

Create a new tetrahedron and add it to the mesh.

Parameters:
IDThe ID of the new volume
Returns:
The created tetrahedron

Reimplemented from SMDS_Mesh.

Definition at line 419 of file SMESHDS_Mesh.cxx.

References AddVolumeWithID(), and SMDS_MeshElement.GetID().

{
  return AddVolumeWithID(n1->GetID(), 
                         n2->GetID(), 
                         n3->GetID(),
                         n4->GetID(),
                         ID);
}
SMDS_MeshVolume * SMESHDS_Mesh::AddVolumeWithID ( int  idnode1,
int  idnode2,
int  idnode3,
int  idnode4,
int  idnode5,
int  ID 
) [virtual]

Create a new pyramid and add it to the mesh.

Nodes 1,2,3 and 4 define the base of the pyramid

Parameters:
IDThe ID of the new volume
Returns:
The created pyramid or NULL if an element with this ID already exists or if input nodes are not found.

Reimplemented from SMDS_Mesh.

Definition at line 450 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddVolume(), AddVolumeWithID(), and myScript.

{
  SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, ID);
  if(anElem) myScript->AddVolume(ID, n1, n2, n3, n4, n5);
  return anElem;
}
SMDS_MeshVolume * SMESHDS_Mesh::AddVolumeWithID ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4,
const SMDS_MeshNode n5,
int  ID 
) [virtual]

Create a new pyramid and add it to the mesh.

Nodes 1,2,3 and 4 define the base of the pyramid

Parameters:
IDThe ID of the new volume
Returns:
The created pyramid

Reimplemented from SMDS_Mesh.

Definition at line 457 of file SMESHDS_Mesh.cxx.

References AddVolumeWithID(), and SMDS_MeshElement.GetID().

{
  return AddVolumeWithID(n1->GetID(), 
                         n2->GetID(), 
                         n3->GetID(),
                         n4->GetID(), 
                         n5->GetID(),
                         ID);
}
SMDS_MeshVolume * SMESHDS_Mesh::AddVolumeWithID ( int  idnode1,
int  idnode2,
int  idnode3,
int  idnode4,
int  idnode5,
int  idnode6,
int  ID 
) [virtual]

Create a new prism and add it to the mesh.

Nodes 1,2,3 is a triangle and 1,2,5,4 a quadrangle.

Parameters:
IDThe ID of the new volume
Returns:
The created prism or NULL if an element with this ID already exists or if input nodes are not found.

Reimplemented from SMDS_Mesh.

Definition at line 492 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddVolume(), AddVolumeWithID(), and myScript.

{
  SMDS_MeshVolume *anElem= SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, ID);
  if(anElem) myScript->AddVolume(ID, n1, n2, n3, n4, n5, n6);
  return anElem;
}
SMDS_MeshVolume * SMESHDS_Mesh::AddVolumeWithID ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4,
const SMDS_MeshNode n5,
const SMDS_MeshNode n6,
int  ID 
) [virtual]

Create a new prism and add it to the mesh.

Nodes 1,2,3 is a triangle and 1,2,5,4 a quadrangle.

Parameters:
IDThe ID of the new volume
Returns:
The created prism

Reimplemented from SMDS_Mesh.

Definition at line 499 of file SMESHDS_Mesh.cxx.

References AddVolumeWithID(), and SMDS_MeshElement.GetID().

{
  return AddVolumeWithID(n1->GetID(), 
                         n2->GetID(), 
                         n3->GetID(),
                         n4->GetID(), 
                         n5->GetID(), 
                         n6->GetID(),
                         ID);
}
SMDS_MeshVolume * SMESHDS_Mesh::AddVolumeWithID ( int  idnode1,
int  idnode2,
int  idnode3,
int  idnode4,
int  idnode5,
int  idnode6,
int  idnode7,
int  idnode8,
int  ID 
) [virtual]

Create a new hexahedron and add it to the mesh.

Nodes 1,2,3,4 and 5,6,7,8 are quadrangle and 5,1 and 7,3 are an edges.

Parameters:
IDThe ID of the new volume
Returns:
The created hexahedron or NULL if an element with this ID already exists or if input nodes are not found.

Reimplemented from SMDS_Mesh.

Definition at line 538 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddVolume(), AddVolumeWithID(), and myScript.

{
  SMDS_MeshVolume *anElem= SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, n7, n8, ID);
  if(anElem) myScript->AddVolume(ID, n1, n2, n3, n4, n5, n6, n7, n8);
  return anElem;
}
SMDS_MeshVolume * SMESHDS_Mesh::AddVolumeWithID ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4,
const SMDS_MeshNode n5,
const SMDS_MeshNode n6,
const SMDS_MeshNode n7,
const SMDS_MeshNode n8,
int  ID 
) [virtual]

Create a new hexahedron and add it to the mesh.

Nodes 1,2,3,4 and 5,6,7,8 are quadrangle and 5,1 and 7,3 are an edges.

Parameters:
IDThe ID of the new volume
Returns:
The created prism or NULL if an element with this ID already exists or if input nodes are not found.

Reimplemented from SMDS_Mesh.

Definition at line 545 of file SMESHDS_Mesh.cxx.

References AddVolumeWithID(), and SMDS_MeshElement.GetID().

{
  return AddVolumeWithID(n1->GetID(), 
                         n2->GetID(), 
                         n3->GetID(),
                         n4->GetID(), 
                         n5->GetID(), 
                         n6->GetID(), 
                         n7->GetID(), 
                         n8->GetID(),
                         ID);
}
SMDS_MeshVolume * SMESHDS_Mesh::AddVolumeWithID ( int  n1,
int  n2,
int  n3,
int  n4,
int  n12,
int  n23,
int  n31,
int  n14,
int  n24,
int  n34,
int  ID 
) [virtual]

Reimplemented from SMDS_Mesh.

Definition at line 1529 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddVolume(), AddVolumeWithID(), and myScript.

{
  SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n12,n23,
                                                       n31,n14,n24,n34,ID);
  if(anElem) myScript->AddVolume(ID,n1,n2,n3,n4,n12,n23,n31,n14,n24,n34);
  return anElem;
}
SMDS_MeshVolume * SMESHDS_Mesh::AddVolumeWithID ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4,
const SMDS_MeshNode n12,
const SMDS_MeshNode n23,
const SMDS_MeshNode n31,
const SMDS_MeshNode n14,
const SMDS_MeshNode n24,
const SMDS_MeshNode n34,
int  ID 
) [virtual]

Reimplemented from SMDS_Mesh.

Definition at line 1543 of file SMESHDS_Mesh.cxx.

References AddVolumeWithID(), and SMDS_MeshElement.GetID().

{
  return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(),
                         n12->GetID(), n23->GetID(), n31->GetID(),
                         n14->GetID(), n24->GetID(), n34->GetID(), ID);
}
SMDS_MeshVolume * SMESHDS_Mesh::AddVolumeWithID ( int  n1,
int  n2,
int  n3,
int  n4,
int  n5,
int  n12,
int  n23,
int  n34,
int  n41,
int  n15,
int  n25,
int  n35,
int  n45,
int  ID 
) [virtual]

Reimplemented from SMDS_Mesh.

Definition at line 1593 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddVolume(), AddVolumeWithID(), and myScript.

{
  SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5,
                                                       n12,n23,n34,n41,
                                                       n15,n25,n35,n45,ID);
  if(anElem) myScript->AddVolume(ID,n1,n2,n3,n4,n5,n12,n23,n34,n41,
                                 n15,n25,n35,n45);
  return anElem;
}
SMDS_MeshVolume * SMESHDS_Mesh::AddVolumeWithID ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4,
const SMDS_MeshNode n5,
const SMDS_MeshNode n12,
const SMDS_MeshNode n23,
const SMDS_MeshNode n34,
const SMDS_MeshNode n41,
const SMDS_MeshNode n15,
const SMDS_MeshNode n25,
const SMDS_MeshNode n35,
const SMDS_MeshNode n45,
int  ID 
) [virtual]

Reimplemented from SMDS_Mesh.

Definition at line 1609 of file SMESHDS_Mesh.cxx.

References AddVolumeWithID(), and SMDS_MeshElement.GetID().

{
  return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(),
                         n4->GetID(), n5->GetID(),
                         n12->GetID(), n23->GetID(), n34->GetID(), n41->GetID(),
                         n15->GetID(), n25->GetID(), n35->GetID(), n45->GetID(),
                         ID);
}
SMDS_MeshVolume * SMESHDS_Mesh::AddVolumeWithID ( int  n1,
int  n2,
int  n3,
int  n4,
int  n5,
int  n6,
int  n12,
int  n23,
int  n31,
int  n45,
int  n56,
int  n64,
int  n14,
int  n25,
int  n36,
int  ID 
) [virtual]

Reimplemented from SMDS_Mesh.

Definition at line 1667 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddVolume(), AddVolumeWithID(), and myScript.

{
  SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5,n6,
                                                       n12,n23,n31,
                                                       n45,n56,n64,
                                                       n14,n25,n36,ID);
  if(anElem) myScript->AddVolume(ID,n1,n2,n3,n4,n5,n6,n12,n23,n31,
                                 n45,n56,n64,n14,n25,n36);
  return anElem;
}
SMDS_MeshVolume * SMESHDS_Mesh::AddVolumeWithID ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4,
const SMDS_MeshNode n5,
const SMDS_MeshNode n6,
const SMDS_MeshNode n12,
const SMDS_MeshNode n23,
const SMDS_MeshNode n31,
const SMDS_MeshNode n45,
const SMDS_MeshNode n56,
const SMDS_MeshNode n64,
const SMDS_MeshNode n14,
const SMDS_MeshNode n25,
const SMDS_MeshNode n36,
int  ID 
) [virtual]

Reimplemented from SMDS_Mesh.

Definition at line 1686 of file SMESHDS_Mesh.cxx.

References AddVolumeWithID(), and SMDS_MeshElement.GetID().

{
  return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(),
                         n4->GetID(), n5->GetID(), n6->GetID(),
                         n12->GetID(), n23->GetID(), n31->GetID(),
                         n45->GetID(), n56->GetID(), n64->GetID(),
                         n14->GetID(), n25->GetID(), n36->GetID(),
                         ID);
}
SMDS_MeshVolume * SMESHDS_Mesh::AddVolumeWithID ( int  n1,
int  n2,
int  n3,
int  n4,
int  n5,
int  n6,
int  n7,
int  n8,
int  n12,
int  n23,
int  n34,
int  n41,
int  n56,
int  n67,
int  n78,
int  n85,
int  n15,
int  n26,
int  n37,
int  n48,
int  ID 
) [virtual]

Reimplemented from SMDS_Mesh.

Definition at line 1755 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddVolume(), AddVolumeWithID(), and myScript.

{
  SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5,n6,n7,n8,
                                                       n12,n23,n34,n41,
                                                       n56,n67,n78,n85,
                                                       n15,n26,n37,n48,ID);
  if(anElem) myScript->AddVolume(ID,n1,n2,n3,n4,n5,n6,n7,n8,n12,n23,n34,n41,
                                 n56,n67,n78,n85,n15,n26,n37,n48);
  return anElem;
}
SMDS_MeshVolume * SMESHDS_Mesh::AddVolumeWithID ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4,
const SMDS_MeshNode n5,
const SMDS_MeshNode n6,
const SMDS_MeshNode n7,
const SMDS_MeshNode n8,
const SMDS_MeshNode n12,
const SMDS_MeshNode n23,
const SMDS_MeshNode n34,
const SMDS_MeshNode n41,
const SMDS_MeshNode n56,
const SMDS_MeshNode n67,
const SMDS_MeshNode n78,
const SMDS_MeshNode n85,
const SMDS_MeshNode n15,
const SMDS_MeshNode n26,
const SMDS_MeshNode n37,
const SMDS_MeshNode n48,
int  ID 
) [virtual]

Reimplemented from SMDS_Mesh.

Definition at line 1774 of file SMESHDS_Mesh.cxx.

References AddVolumeWithID(), and SMDS_MeshElement.GetID().

{
  return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(),
                         n5->GetID(), n6->GetID(), n7->GetID(), n8->GetID(),
                         n12->GetID(), n23->GetID(), n34->GetID(), n41->GetID(),
                         n56->GetID(), n67->GetID(), n78->GetID(), n85->GetID(),
                         n15->GetID(), n26->GetID(), n37->GetID(), n48->GetID(),
                         ID);
}
SMDS_MeshVolume * SMESHDS_Mesh::AddVolumeWithID ( int  idnode1,
int  idnode2,
int  idnode3,
int  idnode4,
int  ID 
) [virtual]

Create a new tetrahedron and add it to the mesh.

Parameters:
IDThe ID of the new volume
Returns:
The created tetrahedron or NULL if an element with this ID already exists or if input nodes are not found.

Reimplemented from SMDS_Mesh.

Definition at line 412 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.AddVolume(), and myScript.

Referenced by SMESH_MesherHelper.AddVolume(), and AddVolumeWithID().

{
  SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, ID);
  if(anElem) myScript->AddVolume(ID, n1, n2, n3, n4);
  return anElem;
}
SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID ( const SMDS_MeshFace f1,
const SMDS_MeshFace f2,
const SMDS_MeshFace f3,
const SMDS_MeshFace f4,
int  ID 
) [virtual, inherited]

Create a new tetrahedron defined by its faces and add it to the mesh.

Parameters:
IDThe ID of the new volume
Returns:
The created tetrahedron

Definition at line 1014 of file SMDS_Mesh.cxx.

References SMDS_Mesh.adjustmyCellsCapacity(), SMDS_Mesh.CheckMemory(), CHECKMEMORY_INTERVAL, SMDS_MeshElementIDFactory.GetFreeID(), SMDS_Mesh.hasConstructionFaces(), MESSAGE, SMDS_Mesh.myCells, SMDS_Mesh.myElementIDFactory, SMDS_Mesh.myInfo, SMDS_MeshInfo.myNbTetras, SMDS_Mesh.NbVolumes(), and SMDS_Mesh.registerElement().

{
  MESSAGE("AddVolumeWithID" << ID);
  if (!hasConstructionFaces())
    return NULL;
  if ( !f1 || !f2 || !f3 || !f4) return 0;
  if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
  SMDS_MeshVolume * volume = new SMDS_VolumeOfFaces(f1,f2,f3,f4);
  adjustmyCellsCapacity(ID);
  myCells[ID] = volume;
  myInfo.myNbTetras++;

  if (!registerElement(ID, volume)) {
    registerElement(myElementIDFactory->GetFreeID(), volume);
    //RemoveElement(volume, false);
    //volume = NULL;
  }
  return volume;
}
SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID ( const SMDS_MeshFace f1,
const SMDS_MeshFace f2,
const SMDS_MeshFace f3,
const SMDS_MeshFace f4,
const SMDS_MeshFace f5,
int  ID 
) [virtual, inherited]

Create a new pyramid defined by its faces and add it to the mesh.

Parameters:
IDThe ID of the new volume
Returns:
The created pyramid

Definition at line 1061 of file SMDS_Mesh.cxx.

References SMDS_Mesh.adjustmyCellsCapacity(), SMDS_Mesh.CheckMemory(), CHECKMEMORY_INTERVAL, SMDS_MeshElementIDFactory.GetFreeID(), SMDS_Mesh.hasConstructionFaces(), MESSAGE, SMDS_Mesh.myCells, SMDS_Mesh.myElementIDFactory, SMDS_Mesh.myInfo, SMDS_MeshInfo.myNbPyramids, SMDS_Mesh.NbVolumes(), and SMDS_Mesh.registerElement().

{
  MESSAGE("AddVolumeWithID" << ID);
  if (!hasConstructionFaces())
    return NULL;
  if ( !f1 || !f2 || !f3 || !f4 || !f5) return 0;
  if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
  SMDS_MeshVolume * volume = new SMDS_VolumeOfFaces(f1,f2,f3,f4,f5);
  adjustmyCellsCapacity(ID);
  myCells[ID] = volume;
  myInfo.myNbPyramids++;

  if (!registerElement(ID, volume)) {
    registerElement(myElementIDFactory->GetFreeID(), volume);
    //RemoveElement(volume, false);
    //volume = NULL;
  }
  return volume;
}
void SMDS_Mesh.adjustBoundingBox ( double  x,
double  y,
double  z 
) [protected, inherited]

Definition at line 633 of file SMDS_Mesh.hxx.

References ex13_hole1partial.x, and ex13_hole1partial.y.

Referenced by SMDS_Mesh.AddNodeWithID(), and SMDS_MeshNode.setXYZ().

  {
    if (x > xmax) xmax = x;
    else if (x < xmin) xmin = x;
    if (y > ymax) ymax = y;
    else if (y < ymin) ymin = y;
    if (z > zmax) zmax = z;
    else if (z < zmin) zmin = z;
  }
void SMDS_Mesh.adjustmyCellsCapacity ( int  ID) [protected, inherited]
void SMDS_Mesh::adjustStructure ( ) [inherited]
SMDS_Mesh* SMDS_Mesh.boundaryEdges ( ) [inherited]
SMDS_Mesh* SMDS_Mesh.boundaryFaces ( ) [inherited]
void SMESHDS_Mesh::BuildDownWardConnectivity ( bool  withEdges)
bool SMESHDS_Mesh::ChangeElementNodes ( const SMDS_MeshElement elem,
const SMDS_MeshNode nodes[],
const int  nbnodes 
)

Reimplemented from SMDS_Mesh.

Definition at line 215 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.ChangeElementNodes(), SMDS_Mesh.ChangeElementNodes(), SMDS_MeshElement.GetID(), and myScript.

Referenced by SMESH_MeshEditor.DoubleNodes(), SMESH_MeshEditor.doubleNodes(), VISCOUS._ViscousBuilder.shrink(), VISCOUS._Shrinker1D.SwapSrcTgtNodes(), and SMESH_MeshEditor.Transform().

{
  //MESSAGE("SMESHDS_Mesh::ChangeElementNodes");
  if ( ! SMDS_Mesh::ChangeElementNodes( elem, nodes, nbnodes ))
    return false;

  vector<int> IDs( nbnodes );
  for ( int i = 0; i < nbnodes; i++ )
    IDs [ i ] = nodes[ i ]->GetID();
  myScript->ChangeElementNodes( elem->GetID(), &IDs[0], nbnodes);

  return true;
}
bool SMESHDS_Mesh::ChangePolygonNodes ( const SMDS_MeshElement elem,
std::vector< const SMDS_MeshNode * >  nodes 
)

Definition at line 236 of file SMESHDS_Mesh.cxx.

Referenced by SMESH_MeshEditor.InsertNodesIntoLink(), and SMESH_MeshEditor.Transform().

{
  ASSERT(nodes.size() > 3);

  return ChangeElementNodes(elem, &nodes[0], nodes.size());
}
bool SMESHDS_Mesh::ChangePolyhedronNodes ( const SMDS_MeshElement elem,
std::vector< const SMDS_MeshNode * >  nodes,
std::vector< int quantities 
)

Definition at line 249 of file SMESHDS_Mesh.cxx.

References SMDS_Mesh.ChangePolyhedronNodes(), and SMDS_MeshElement.GetID().

Referenced by SMESH_MeshEditor.Transform(), and SMESH_MeshEditor.UpdateVolumes().

{
  ASSERT(nodes.size() > 3);

  if (!SMDS_Mesh::ChangePolyhedronNodes(elem, nodes, quantities))
    return false;

  int i, len = nodes.size();
  std::vector<int> nodes_ids (len);
  for (i = 0; i < len; i++) {
    nodes_ids[i] = nodes[i]->GetID();
  }
  myScript->ChangePolyhedronNodes(elem->GetID(), nodes_ids, quantities);

  return true;
}
bool SMDS_Mesh::ChangePolyhedronNodes ( const SMDS_MeshElement elem,
const std::vector< const SMDS_MeshNode * > &  nodes,
const std::vector< int > &  quantities 
) [inherited]

Definition at line 1686 of file SMDS_Mesh.cxx.

References SMDS_MeshElement.GetType(), MESSAGE, SMDS_MeshElement.nodesIterator(), SMDS_MeshNode.RemoveInverseElement(), SMDSAbs_Volume, and SMESH_demo_hexa2_upd.vol.

Referenced by ChangePolyhedronNodes().

{
  if (elem->GetType() != SMDSAbs_Volume) {
    MESSAGE("WRONG ELEM TYPE");
    return false;
  }

  const SMDS_VtkVolume* vol = dynamic_cast<const SMDS_VtkVolume*>(elem);
  if (!vol) {
    return false;
  }

  // keep current nodes of elem
  set<const SMDS_MeshElement*> oldNodes;
  SMDS_ElemIteratorPtr itn = elem->nodesIterator();
  while (itn->more()) {
    oldNodes.insert(itn->next());
  }

  // change nodes
  // TODO remove this function
  //bool Ok = const_cast<SMDS_VtkVolume*>(vol)->ChangeNodes(nodes, quantities);
  bool Ok = false;
  if (!Ok) {
    return false;
  }

  // update InverseElements

  // AddInverseElement to new nodes
  int nbnodes = nodes.size();
  set<const SMDS_MeshElement*>::iterator it;
  for (int i = 0; i < nbnodes; i++) {
    it = oldNodes.find(nodes[i]);
    if (it == oldNodes.end()) {
      // new node
      const_cast<SMDS_MeshNode*>(nodes[i])->AddInverseElement(elem);
    } else {
      // remove from oldNodes a node that remains in elem
      oldNodes.erase(it);
    }
  }

  // RemoveInverseElement from the nodes removed from elem
  for (it = oldNodes.begin(); it != oldNodes.end(); it++) {
    SMDS_MeshNode * n = static_cast<SMDS_MeshNode *>
      (const_cast<SMDS_MeshElement *>( *it ));
    n->RemoveInverseElement(elem);
  }

  return Ok;
}
int SMDS_Mesh::CheckMemory ( const bool  doNotRaise = false) throw (std::bad_alloc) [static, inherited]

Raise an exception if free memory (ram+swap) too low.

Parameters:
doNotRaise- if true, suppres exception, just return free memory size
Return values:
int- amount of available memory in MB or negative number in failure case

Definition at line 75 of file SMDS_Mesh.cxx.

References MESSAGE, and ex30_tepal.status.

Referenced by SMDS_Mesh.Add0DElementWithID(), SMDS_Mesh.AddFaceWithID(), SMDS_Mesh.AddVolumeWithID(), SMESH_VisualObjDef.buildElemPrs(), SMESH_VisualObjDef.buildNodePrs(), SMESHGUI_BaseComputeOp.computeMesh(), SMESH_subMesh.ComputeStateEngine(), SMDS_Mesh.createQuadrangle(), SMDS_Mesh.createTriangle(), SMDS_Mesh.FindEdgeOrCreate(), and SMESH.GetVisualObj().

{
#ifndef WIN32
  struct sysinfo si;
  int err = sysinfo( &si );
  if ( err )
    return -1;

  const unsigned long Mbyte = 1024 * 1024;

  static int limit = -1;
  if ( limit < 0 ) {
    int status = system("SMDS_MemoryLimit"); // it returns lower limit of free RAM
    if (status >= 0 ) {
      limit = WEXITSTATUS(status);
    }
    else {
      double factor = ( si.totalswap == 0 ) ? 0.1 : 0.2;
      limit = int(( factor * si.totalram * si.mem_unit ) / Mbyte );
    }
    if ( limit < 20 )
      limit = 20;
    else
      limit = int ( limit * 1.5 );
    MESSAGE ( "SMDS_Mesh::CheckMemory() memory limit = " << limit << " MB" );
  }

  // compute separately to avoid overflow
  int freeMb =
    ( si.freeram  * si.mem_unit ) / Mbyte +
    ( si.freeswap * si.mem_unit ) / Mbyte;
  //cout << "freeMb = " << freeMb << " limit = " << limit << endl;

  if ( freeMb > limit )
    return freeMb - limit;

  if ( doNotRaise )
    return 0;

  MESSAGE ("SMDS_Mesh::CheckMemory() throws as free memory too low: " << freeMb <<" MB" );
  throw std::bad_alloc();
#else
  return -1;
#endif
}
void SMESHDS_Mesh::CleanDownWardConnectivity ( )
void SMDS_Mesh::Clear ( ) [virtual, inherited]

Clear all data.

Definition at line 2440 of file SMDS_Mesh.cxx.

References SMDS_UnstructuredGrid.BuildLinks(), SMDS_MeshInfo.Clear(), SMDS_MeshElementIDFactory.Clear(), SMDS_MeshNodeIDFactory.Clear(), ObjectPool< X >.destroy(), SMDS_Mesh.elementsIterator(), SMDS_MeshElement.GetID(), SMDS_MeshElement.GetType(), SMDS_MeshElement.getVtkId(), MESSAGE, SMDS_Mesh.myCellIdVtkToSmds, SMDS_Mesh.myCells, SMDS_Mesh.myChildren, SMDS_Mesh.myEdgePool, SMDS_Mesh.myElementIDFactory, SMDS_Mesh.myFacePool, SMDS_Mesh.myGrid, SMDS_Mesh.myInfo, SMDS_Mesh.myModified, SMDS_Mesh.myNodeIDFactory, SMDS_Mesh.myNodePool, SMDS_Mesh.myNodes, SMDS_Mesh.myParent, SMDS_Mesh.myVolumePool, ex29_refine.node(), SMDS_Mesh.nodesIterator(), SMDS_SpacePosition.originSpacePosition(), SMDS_MeshNodeIDFactory.ReleaseID(), SMDS_MeshElementIDFactory.ReleaseID(), SMDS_MeshNode.SetPosition(), SMDSAbs_0DElement, SMDSAbs_Edge, SMDSAbs_Face, SMDSAbs_Volume, SMDS_Mesh.xmax, SMDS_Mesh.xmin, SMDS_Mesh.ymax, SMDS_Mesh.ymin, SMDS_Mesh.zmax, and SMDS_Mesh.zmin.

Referenced by ClearMesh(), SMESH.Controls.ElementsOnSurface.ElementsOnSurface(), and SMESH_Client.Update().

{
  MESSAGE("SMDS_Mesh::Clear");
  if (myParent!=NULL)
    {
    SMDS_ElemIteratorPtr eIt = elementsIterator();
    while ( eIt->more() )
      {
        const SMDS_MeshElement *elem = eIt->next();
        myElementIDFactory->ReleaseID(elem->GetID(), elem->getVtkId());
      }
    SMDS_NodeIteratorPtr itn = nodesIterator();
    while (itn->more())
      {
        const SMDS_MeshNode *node = itn->next();
        myNodeIDFactory->ReleaseID(node->GetID(), node->getVtkId());
      }
    }
  else
    {
    myNodeIDFactory->Clear();
    myElementIDFactory->Clear();
    }

  SMDS_ElemIteratorPtr itv = elementsIterator();
  while (itv->more())
    {
      SMDS_MeshElement* elem = (SMDS_MeshElement*)(itv->next());
      SMDSAbs_ElementType aType = elem->GetType();
      switch (aType)
      {
        case SMDSAbs_0DElement:
          delete elem;
          break;
        case SMDSAbs_Edge:
           myEdgePool->destroy(static_cast<SMDS_VtkEdge*>(elem));
          break;
        case SMDSAbs_Face:
          myFacePool->destroy(static_cast<SMDS_VtkFace*>(elem));
          break;
        case SMDSAbs_Volume:
          myVolumePool->destroy(static_cast<SMDS_VtkVolume*>(elem));
          break;
        default:
          break;
      }
    }
  myCells.clear();
  myCellIdVtkToSmds.clear();
  //myCellIdSmdsToVtk.clear();

  SMDS_NodeIteratorPtr itn = nodesIterator();
  while (itn->more())
    {
      SMDS_MeshNode *node = (SMDS_MeshNode*)(itn->next());
      node->SetPosition(SMDS_SpacePosition::originSpacePosition());
      myNodePool->destroy(node);
    }
  myNodes.clear();

  list<SMDS_Mesh*>::iterator itc=myChildren.begin();
  while(itc!=myChildren.end())
    (*itc)->Clear();

  myModified = false;
  xmin = 0; xmax = 0;
  ymin = 0; ymax = 0;
  zmin = 0; zmax = 0;

  myInfo.Clear();

  myGrid->Initialize();
  myGrid->Allocate();
  vtkPoints* points = vtkPoints::New();
  // rnv: to fix bug "21125: EDF 1233 SMESH: Degrardation of precision in a test case for quadratic conversion"
  // using double type for storing coordinates of nodes instead float.
  points->SetDataType(VTK_DOUBLE);
  points->SetNumberOfPoints(0 /*SMDS_Mesh::chunkSize*/);
  myGrid->SetPoints( points );
  points->Delete();
  myGrid->BuildLinks();
}
void SMESHDS_Mesh::ClearMesh ( )

Remove all data from the mesh.

Definition at line 875 of file SMESHDS_Mesh.cxx.

References SMDS_Mesh.Clear(), SMESHDS_Script.ClearMesh(), ex21_lamp.group, myGroups, myScript, and myShapeIndexToSubMesh.

{
  myScript->ClearMesh();
  SMDS_Mesh::Clear();

  // clear submeshes
  map<int,SMESHDS_SubMesh*>::iterator sub, subEnd = myShapeIndexToSubMesh.end();
  for ( sub = myShapeIndexToSubMesh.begin(); sub != subEnd; ++sub )
    sub->second->Clear();

  // clear groups
  TGroups::iterator group, groupEnd = myGroups.end();
  for ( group = myGroups.begin(); group != groupEnd; ++group ) {
    if ( SMESHDS_Group* g = dynamic_cast<SMESHDS_Group*>(*group)) {
      SMDSAbs_ElementType groupType = g->GetType();
      g->Clear();
      g->SetType( groupType );
    }
  }
}
void SMESHDS_Mesh::ClearScript ( )

Definition at line 1159 of file SMESHDS_Mesh.cxx.

References SMESHDS_Script.Clear(), and myScript.

{
        myScript->Clear();
}
void SMESHDS_Mesh::compactMesh ( ) [virtual]

Reimplemented from SMDS_Mesh.

Definition at line 1804 of file SMESHDS_Mesh.cxx.

References SMDS_UnstructuredGrid.compactGrid(), SMDS_MeshNodeIDFactory.emptyPool(), MESSAGE, SMDS_Mesh.myCellIdVtkToSmds, SMDS_Mesh.myCells, SMDS_Mesh.myElementIDFactory, SMDS_Mesh.myGrid, SMDS_Mesh.myNodeIDFactory, SMDS_Mesh.myNodes, myScript, myShapeIndexToSubMesh, and SMESHDS_Script.SetModified().

Referenced by Renumber().

{
  int newNodeSize = 0;
  int nbNodes = myNodes.size();
  int nbVtkNodes = myGrid->GetNumberOfPoints();
  MESSAGE("nbNodes=" << nbNodes << " nbVtkNodes=" << nbVtkNodes);
  int nbNodeTemp = nbVtkNodes;
  if (nbNodes > nbVtkNodes)
    nbNodeTemp = nbNodes;
  vector<int> idNodesOldToNew;
  idNodesOldToNew.clear();
  idNodesOldToNew.resize(nbNodeTemp, -1); // all unused id will be -1

  for (int i = 0; i < nbNodes; i++)
    {
      if (myNodes[i])
        {
          int vtkid = myNodes[i]->getVtkId();
          idNodesOldToNew[vtkid] = i; // old vtkId --> old smdsId (valid smdsId are >= 0)
          newNodeSize++;
        }
    }
  bool areNodesModified = (newNodeSize < nbVtkNodes);
  MESSAGE("------------------------- compactMesh Nodes Modified: " << areNodesModified);
  areNodesModified = true;

  int newCellSize = 0;
  int nbCells = myCells.size();
  int nbVtkCells = myGrid->GetNumberOfCells();
  MESSAGE("nbCells=" << nbCells << " nbVtkCells=" << nbVtkCells);
  int nbCellTemp = nbVtkCells;
  if (nbCells > nbVtkCells)
    nbCellTemp = nbCells;
  vector<int> idCellsOldToNew;
  idCellsOldToNew.clear();
  idCellsOldToNew.resize(nbCellTemp, -1); // all unused id will be -1

  for (int i = 0; i < nbCells; i++)
    {
      if (myCells[i])
        {
//          //idCellsOldToNew[i] = myCellIdVtkToSmds[i]; // valid vtk indexes are > = 0
//          int vtkid = myCells[i]->getVtkId();
//          idCellsOldToNew[vtkid] = i; // old vtkId --> old smdsId (not used in input)
          newCellSize++;
        }
    }
  if (areNodesModified)
    myGrid->compactGrid(idNodesOldToNew, newNodeSize, idCellsOldToNew, newCellSize);
  else
    myGrid->compactGrid(idNodesOldToNew, 0, idCellsOldToNew, newCellSize);

  int nbVtkPts = myGrid->GetNumberOfPoints();
  nbVtkCells = myGrid->GetNumberOfCells();
  if (nbVtkPts != newNodeSize)
    {
      MESSAGE("===> nbVtkPts != newNodeSize " << nbVtkPts << " " << newNodeSize);
      if (nbVtkPts > newNodeSize) newNodeSize = nbVtkPts; // several points with same SMDS Id
    }
  if (nbVtkCells != newCellSize)
    {
      MESSAGE("===> nbVtkCells != newCellSize " << nbVtkCells << " " << newCellSize);
      if (nbVtkCells > newCellSize) newCellSize = nbVtkCells; // several cells with same SMDS Id
    }

  // --- SMDS_MeshNode and myNodes (id in SMDS and in VTK are the same), myNodeIdFactory

  if (areNodesModified)
    {
      MESSAGE("-------------- modify myNodes");
      SetOfNodes newNodes;
      newNodes.resize(newNodeSize+1,0); // 0 not used, SMDS numbers 1..n
      int newSmdsId = 0;
      for (int i = 0; i < nbNodes; i++)
        {
          if (myNodes[i])
            {
              newSmdsId++; // SMDS id start to 1
              int oldVtkId = myNodes[i]->getVtkId();
              int newVtkId = idNodesOldToNew[oldVtkId];
              //MESSAGE("myNodes["<< i << "] vtkId " << oldVtkId << " --> " << newVtkId);
              myNodes[i]->setVtkId(newVtkId);
              myNodes[i]->setId(newSmdsId);
              newNodes[newSmdsId] = myNodes[i];
              //MESSAGE("myNodes["<< i << "] --> newNodes[" << newSmdsId << "]");
            }
        }
      myNodes.swap(newNodes);
      this->myNodeIDFactory->emptyPool(newSmdsId); // newSmdsId = number of nodes
      MESSAGE("myNodes.size " << myNodes.size());
    }

  // --- SMDS_MeshCell, myCellIdVtkToSmds, myCellIdSmdsToVtk, myCells

  int vtkIndexSize = myCellIdVtkToSmds.size();
  int maxVtkId = -1;
  for (int oldVtkId = 0; oldVtkId < vtkIndexSize; oldVtkId++)
    {
      int oldSmdsId = this->myCellIdVtkToSmds[oldVtkId];
      if (oldSmdsId > 0)
        {
          int newVtkId = idCellsOldToNew[oldVtkId];
          if (newVtkId > maxVtkId)
            maxVtkId = newVtkId;
          //MESSAGE("myCells["<< oldSmdsId << "] vtkId " << oldVtkId << " --> " << newVtkId);
          myCells[oldSmdsId]->setVtkId(newVtkId);
        }
    }
//  MESSAGE("myCells.size()=" << myCells.size()
//          << " myCellIdSmdsToVtk.size()=" << myCellIdSmdsToVtk.size()
//          << " myCellIdVtkToSmds.size()=" << myCellIdVtkToSmds.size() );

  SetOfCells newCells;
  //vector<int> newSmdsToVtk;
  vector<int> newVtkToSmds;

  assert(maxVtkId < newCellSize);
  newCells.resize(newCellSize+1, 0); // 0 not used, SMDS numbers 1..n
  //newSmdsToVtk.resize(newCellSize+1, -1);
  newVtkToSmds.resize(newCellSize+1, -1);

  int myCellsSize = myCells.size();
  int newSmdsId = 0;
  for (int i = 0; i < myCellsSize; i++)
    {
      if (myCells[i])
        {
          newSmdsId++; // SMDS id start to 1
          assert(newSmdsId <= newCellSize);
          newCells[newSmdsId] = myCells[i];
          newCells[newSmdsId]->setId(newSmdsId);
          //MESSAGE("myCells["<< i << "] --> newCells[" << newSmdsId << "]");
          int idvtk = myCells[i]->getVtkId();
          //newSmdsToVtk[newSmdsId] = idvtk;
          assert(idvtk < newCellSize);
          newVtkToSmds[idvtk] = newSmdsId;
        }
    }

  myCells.swap(newCells);
  //myCellIdSmdsToVtk.swap(newSmdsToVtk);
  myCellIdVtkToSmds.swap(newVtkToSmds);
  MESSAGE("myCells.size()=" << myCells.size()
          << " myCellIdVtkToSmds.size()=" << myCellIdVtkToSmds.size() );
  this->myElementIDFactory->emptyPool(newSmdsId);

  this->myScript->SetModified(true); // notify GUI client for buildPrs when update

  // --- compact list myNodes and myElements in submeshes

  map<int,SMESHDS_SubMesh*>::iterator it = myShapeIndexToSubMesh.begin();
  for(; it != myShapeIndexToSubMesh.end(); ++it)
    {
      (*it).second->compactList();
    }

}
bool SMDS_Mesh::Contains ( const SMDS_MeshElement elem) const [inherited]

Checks if the element is present in mesh.

Useful to determine dead pointers. Use this function for debug purpose only! Do not check in the code using it even in _DEBUG_ mode

Useful to determine dead pointers.

Definition at line 3219 of file SMDS_Mesh.cxx.

References SMDS_Mesh.edgesIterator(), SMDS_Mesh.elements0dIterator(), SMDS_Mesh.facesIterator(), SMDS_Mesh.nodesIterator(), and SMDS_Mesh.volumesIterator().

{
  // we should not imply on validity of *elem, so iterate on containers
  // of all types in the hope of finding <elem> somewhere there
  SMDS_NodeIteratorPtr itn = nodesIterator();
  while (itn->more())
    if (elem == itn->next())
      return true;
  SMDS_0DElementIteratorPtr it0d = elements0dIterator();
  while (it0d->more())
    if (elem == it0d->next())
      return true;
  SMDS_EdgeIteratorPtr ite = edgesIterator();
  while (ite->more())
    if (elem == ite->next())
      return true;
  SMDS_FaceIteratorPtr itf = facesIterator();
  while (itf->more())
    if (elem == itf->next())
      return true;
  SMDS_VolumeIteratorPtr itv = volumesIterator();
  while (itv->more())
    if (elem == itv->next())
      return true;
  return false;
}
SMDS_MeshFace * SMDS_Mesh::createQuadrangle ( const SMDS_MeshNode node1,
const SMDS_MeshNode node2,
const SMDS_MeshNode node3,
const SMDS_MeshNode node4,
int  ID 
) [protected, inherited]

Create a quadrangle and add it to the current mesh.

This methode do not bind a ID to the create triangle.

Definition at line 1497 of file SMDS_Mesh.cxx.

References SMDS_Mesh.adjustmyCellsCapacity(), SMDS_Mesh.CheckMemory(), CHECKMEMORY_INTERVAL, ObjectPool< X >.destroy(), ex06_hole1boolean.edge1, ex06_hole1boolean.edge2, ex06_hole1boolean.edge3, ex06_hole1boolean.edge4, PAL_MESH_043_3D.face, SMDS_Mesh.FindEdgeOrCreate(), ObjectPool< X >.getNew(), SMDS_MeshElement.getVtkId(), SMDS_Mesh.hasConstructionEdges(), SMDS_VtkFace.init(), SMDS_Mesh.myCells, SMDS_Mesh.myFacePool, SMDS_Mesh.myGrid, SMDS_Mesh.myInfo, SMDS_MeshInfo.myNbQuadrangles, SMDS_Mesh.NbFaces(), and SMDS_Mesh.registerElement().

Referenced by SMDS_Mesh.AddFaceWithID(), and SMDS_Mesh.FindFaceOrCreate().

{
  if ( !node1 || !node2 || !node3 || !node4 ) return 0;
  if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
  if(hasConstructionEdges())
  {
      //MESSAGE("createQuadrangle hasConstructionEdges "<< ID);
    SMDS_MeshEdge *edge1, *edge2, *edge3, *edge4;
    edge1=FindEdgeOrCreate(node1,node2);
    edge2=FindEdgeOrCreate(node2,node3);
    edge3=FindEdgeOrCreate(node3,node4);
    edge4=FindEdgeOrCreate(node4,node1);

    SMDS_MeshFace * face = new SMDS_FaceOfEdges(edge1,edge2,edge3,edge4);
    adjustmyCellsCapacity(ID);
    myCells[ID] = face;
    myInfo.myNbQuadrangles++;
    return face;
  }
  else
  {
    // --- retrieve nodes ID
    vector<vtkIdType> nodeIds;
    nodeIds.clear();
    nodeIds.push_back(node1->getVtkId());
    nodeIds.push_back(node2->getVtkId());
    nodeIds.push_back(node3->getVtkId());
    nodeIds.push_back(node4->getVtkId());

    SMDS_MeshFace * face = 0;
    SMDS_VtkFace *facevtk = myFacePool->getNew();
    facevtk->init(nodeIds, this);
    if (!this->registerElement(ID,facevtk))
      {
        this->myGrid->GetCellTypesArray()->SetValue(facevtk->getVtkId(), VTK_EMPTY_CELL);
        myFacePool->destroy(facevtk);
        return 0;
      }
    face = facevtk;
    adjustmyCellsCapacity(ID);
    myCells[ID] = face;
    myInfo.myNbQuadrangles++;
    return face;
  }
}
SMDS_MeshFace * SMDS_Mesh::createTriangle ( const SMDS_MeshNode node1,
const SMDS_MeshNode node2,
const SMDS_MeshNode node3,
int  ID 
) [protected, inherited]

Create a triangle and add it to the current mesh.

This method do not bind an ID to the create triangle.

Definition at line 1445 of file SMDS_Mesh.cxx.

References SMDS_Mesh.adjustmyCellsCapacity(), SMDS_Mesh.CheckMemory(), CHECKMEMORY_INTERVAL, ObjectPool< X >.destroy(), ex06_hole1boolean.edge1, ex06_hole1boolean.edge2, ex06_hole1boolean.edge3, PAL_MESH_043_3D.face, SMDS_Mesh.FindEdgeOrCreate(), ObjectPool< X >.getNew(), SMDS_MeshElement.getVtkId(), SMDS_Mesh.hasConstructionEdges(), SMDS_VtkFace.init(), SMDS_Mesh.myCells, SMDS_Mesh.myFacePool, SMDS_Mesh.myGrid, SMDS_Mesh.myInfo, SMDS_MeshInfo.myNbTriangles, SMDS_Mesh.NbFaces(), and SMDS_Mesh.registerElement().

Referenced by SMDS_Mesh.AddFaceWithID(), and SMDS_Mesh.FindFaceOrCreate().

{
  if ( !node1 || !node2 || !node3) return 0;
  if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
  if(hasConstructionEdges())
  {
    SMDS_MeshEdge *edge1, *edge2, *edge3;
    edge1=FindEdgeOrCreate(node1,node2);
    edge2=FindEdgeOrCreate(node2,node3);
    edge3=FindEdgeOrCreate(node3,node1);

    //int ID = myElementIDFactory->GetFreeID(); // -PR- voir si on range cet element
    SMDS_MeshFace * face = new SMDS_FaceOfEdges(edge1,edge2,edge3);
    adjustmyCellsCapacity(ID);
    myCells[ID] = face;
    myInfo.myNbTriangles++;
    return face;
  }
  else
  {
    // --- retrieve nodes ID
    vector<vtkIdType> nodeIds;
    nodeIds.clear();
    nodeIds.push_back(node1->getVtkId());
    nodeIds.push_back(node2->getVtkId());
    nodeIds.push_back(node3->getVtkId());

    SMDS_MeshFace * face = 0;
    SMDS_VtkFace *facevtk = myFacePool->getNew();
    facevtk->init(nodeIds, this); // put in vtkUnstructuredGrid
    if (!this->registerElement(ID,facevtk))
      {
        this->myGrid->GetCellTypesArray()->SetValue(facevtk->getVtkId(), VTK_EMPTY_CELL);
        myFacePool->destroy(facevtk);
        return 0;
      }
    face = facevtk;
    adjustmyCellsCapacity(ID);
    myCells[ID] = face;
    //MESSAGE("createTriangle " << ID << " " << face);
    myInfo.myNbTriangles++;
    return face;
  }
}
void SMDS_Mesh::DebugStats ( ) const [inherited]

Definition at line 2268 of file SMDS_Mesh.cxx.

References PAL_MESH_043_3D.face, SMDS_Mesh.facesIterator(), SMDS_MeshNode.GetInverseElementIterator(), MESSAGE, SMDS_Mesh.Nb0DElements(), SMDS_Mesh.NbEdges(), SMDS_Mesh.NbFaces(), SMDS_Mesh.NbNodes(), SMDS_Mesh.NbVolumes(), ex29_refine.node(), and SMDS_Mesh.nodesIterator().

{
  MESSAGE("Debug stats of mesh : ");

  MESSAGE("===== NODES ====="<<NbNodes());
  MESSAGE("===== 0DELEMS ====="<<Nb0DElements());
  MESSAGE("===== EDGES ====="<<NbEdges());
  MESSAGE("===== FACES ====="<<NbFaces());
  MESSAGE("===== VOLUMES ====="<<NbVolumes());

  MESSAGE("End Debug stats of mesh ");

  //#ifdef DEB

  SMDS_NodeIteratorPtr itnode=nodesIterator();
  int sizeofnodes = 0;
  int sizeoffaces = 0;

  while(itnode->more())
  {
    const SMDS_MeshNode *node = itnode->next();

    sizeofnodes += sizeof(*node);

    SMDS_ElemIteratorPtr it = node->GetInverseElementIterator();
    while(it->more())
    {
      const SMDS_MeshElement *me = it->next();
      sizeofnodes += sizeof(me);
    }
  }

  SMDS_FaceIteratorPtr itface=facesIterator();
  while(itface->more())
  {
    const SMDS_MeshElement *face = itface->next();
    sizeoffaces += sizeof(*face);
  }

  MESSAGE("total size of node elements = " << sizeofnodes);;
  MESSAGE("total size of face elements = " << sizeoffaces);;

  //#endif
}
void SMDS_Mesh::Dump0DElements ( ) const [inherited]

Definition at line 2220 of file SMDS_Mesh.cxx.

References SMDS_Mesh.elements0dIterator(), and MESSAGE.

{
  MESSAGE("dump 0D elements of mesh : ");
  SMDS_0DElementIteratorPtr it0d = elements0dIterator();
  while(it0d->more()) ; //MESSAGE(it0d->next());
}
void SMDS_Mesh::DumpEdges ( ) const [inherited]

Definition at line 2232 of file SMDS_Mesh.cxx.

References SMDS_Mesh.edgesIterator(), and MESSAGE.

{
        MESSAGE("dump edges of mesh : ");
        SMDS_EdgeIteratorPtr itedge=edgesIterator();
        while(itedge->more()) ; //MESSAGE(itedge->next());
}
void SMDS_Mesh::DumpFaces ( ) const [inherited]

Definition at line 2244 of file SMDS_Mesh.cxx.

References SMDS_Mesh.facesIterator(), and MESSAGE.

{
        MESSAGE("dump faces of mesh : ");
        SMDS_FaceIteratorPtr itface=facesIterator();
        while(itface->more()) ; //MESSAGE(itface->next());
}
void SMDS_Mesh::dumpGrid ( string  ficdump = "dumpGrid") [inherited]

Definition at line 4132 of file SMDS_Mesh.cxx.

References MESSAGE, and SMDS_Mesh.myGrid.

{
        MESSAGE("SMDS_Mesh::dumpGrid " << ficdump);
//  vtkUnstructuredGridWriter* aWriter = vtkUnstructuredGridWriter::New();
//  aWriter->SetFileName(ficdump.c_str());
//  aWriter->SetInput(myGrid);
//  if(myGrid->GetNumberOfCells())
//  {
//    aWriter->Write();
//  }
//  aWriter->Delete();
  ficdump = ficdump + "_connectivity";
  ofstream ficcon(ficdump.c_str(), ios::out);
  int nbPoints = myGrid->GetNumberOfPoints();
  ficcon << "-------------------------------- points " <<  nbPoints << endl;
  for (int i=0; i<nbPoints; i++)
  {
        ficcon << i << " " << *(myGrid->GetPoint(i)) << " " << *(myGrid->GetPoint(i)+1) << " " << " " << *(myGrid->GetPoint(i)+2) << endl;
  }
  int nbCells = myGrid->GetNumberOfCells();
  ficcon << "-------------------------------- cells " <<  nbCells << endl;
  for (int i=0; i<nbCells; i++)
  {
//      MESSAGE(i << " " << myGrid->GetCell(i));
//      MESSAGE("  " << myGrid->GetCell(i)->GetCellType());
        ficcon << i << " - " << myGrid->GetCell(i)->GetCellType() << " -";
        int nbptcell = myGrid->GetCell(i)->GetNumberOfPoints();
        vtkIdList *listid = myGrid->GetCell(i)->GetPointIds();
        for (int j=0; j<nbptcell; j++)
        {
                ficcon << " " <<  listid->GetId(j);
        }
        ficcon << endl;
  }
  ficcon << "-------------------------------- connectivity " <<  nbPoints << endl;
        vtkCellLinks *links = myGrid->GetCellLinks();
  for (int i=0; i<nbPoints; i++)
  {
        int ncells = links->GetNcells(i);
        vtkIdType *cells = links->GetCells(i);
        ficcon << i << " - " << ncells << " -";
        for (int j=0; j<ncells; j++)
        {
                ficcon << " " << cells[j];
        }
        ficcon << endl;
  }
  ficcon.close();

}
void SMDS_Mesh::DumpNodes ( ) const [inherited]

Definition at line 2209 of file SMDS_Mesh.cxx.

References MESSAGE, and SMDS_Mesh.nodesIterator().

{
        MESSAGE("dump nodes of mesh : ");
        SMDS_NodeIteratorPtr itnode=nodesIterator();
        while(itnode->more()) ; //MESSAGE(itnode->next());
}
void SMDS_Mesh::DumpVolumes ( ) const [inherited]

Definition at line 2256 of file SMDS_Mesh.cxx.

References MESSAGE, and SMDS_Mesh.volumesIterator().

{
        MESSAGE("dump volumes of mesh : ");
        SMDS_VolumeIteratorPtr itvol=volumesIterator();
        while(itvol->more()) ; //MESSAGE(itvol->next());
}
SMDS_EdgeIteratorPtr SMDS_Mesh::edgesIterator ( bool  idInceasingOrder = false) const [inherited]

Return an iterator on edges of the current mesh.

Definition at line 2740 of file SMDS_Mesh.cxx.

References SMDS_Mesh.myCells, and SMDSAbs_Edge.

Referenced by SMESH_MEDMesh_i.calculeNbElts(), SMDS_Mesh.Contains(), SMESH_MeshEditor.ConvertToQuadratic(), SMDS_Mesh.DumpEdges(), SMESH.Controls.Filter.GetElementsId(), SMESH.Filter_i.GetMeshInfo(), DriverMED_W_SMESHDS_Mesh.Perform(), SMESH.Controls.ElementsOnShape.process(), and SMESH.Controls.ElementsOnSurface.process().

{
  typedef MYElem_Map_Iterator
    < SetOfCells, const SMDS_MeshEdge*, SMDS_EdgeIterator > TIterator;
  return SMDS_EdgeIteratorPtr(new TIterator(myCells, SMDSAbs_Edge)); // naturally always sorted by ID

//  typedef MYNCollection_Map_Iterator
//    < SetOfEdges, const SMDS_MeshEdge*, SMDS_EdgeIterator > TIterator;
//  typedef IdSortedIterator< const SMDS_MeshEdge* >          TSortedIterator;
//  return ( idInceasingOrder ?
//           SMDS_EdgeIteratorPtr( new TSortedIterator( *myElementIDFactory,
//                                                      SMDSAbs_Edge,
//                                                      NbEdges() )) :
//           SMDS_EdgeIteratorPtr(new TIterator(myEdges)));
}
SMDS_0DElementIteratorPtr SMDS_Mesh::elements0dIterator ( bool  idInceasingOrder = false) const [inherited]

Return an iterator on 0D elements of the current mesh.

Definition at line 2720 of file SMDS_Mesh.cxx.

References SMDS_Mesh.myCells, and SMDSAbs_0DElement.

Referenced by SMDS_Mesh.Contains(), SMDS_Mesh.Dump0DElements(), and DriverMED_W_SMESHDS_Mesh.Perform().

{
  typedef MYElem_Map_Iterator
    < SetOfCells, const SMDS_Mesh0DElement*, SMDS_0DElementIterator > TIterator;
  return SMDS_0DElementIteratorPtr(new TIterator(myCells, SMDSAbs_0DElement)); // naturally always sorted by ID

//  typedef MYNCollection_Map_Iterator
//    < SetOf0DElements, const SMDS_Mesh0DElement*, SMDS_0DElementIterator > TIterator;
//  typedef IdSortedIterator< const SMDS_Mesh0DElement* >                    TSortedIterator;
//  return ( idInceasingOrder ?
//           SMDS_0DElementIteratorPtr( new TSortedIterator( *myElementIDFactory,
//                                                           SMDSAbs_0DElement,
//                                                           Nb0DElements() )) :
//           SMDS_0DElementIteratorPtr( new TIterator(my0DElements)));
}
SMDS_ElemIteratorPtr SMDS_Mesh::elementsIterator ( SMDSAbs_ElementType  type = SMDSAbs_All) const [inherited]

Return an iterator on elements of the current mesh factory.

Definition at line 2799 of file SMDS_Mesh.cxx.

References SMDS_MeshElementIDFactory.elementsIterator(), SMDS_Mesh.myCells, SMDS_Mesh.myElementIDFactory, SMDS_Mesh.myNodes, SMDSAbs_0DElement, SMDSAbs_All, SMDSAbs_Edge, SMDSAbs_Face, SMDSAbs_Node, and SMDSAbs_Volume.

Referenced by SMDS_Mesh.Clear(), SMESH_Gen_i.ConcatenateCommon(), SMESH_Gen_i.CopyMesh(), SMDS_MeshNodeIDFactory.elementsIterator(), SMDS_MeshElementIDFactory.elementsIterator(), SMESH_Mesh_i.GetElementsByType(), SMESH_Mesh_i.GetElementsId(), SMESH_ProxyMesh.GetFaces(), DriverSTL_W_SMDS_Mesh.getFaces(), SMESH.Filter_i.GetMeshInfo(), SMESH_ElementSearcherImpl.getTolerance(), StdMeshers_Import_1D.importMesh(), SMESH_Gen_i.Load(), SMESH_Gen_i.Save(), SMESH_MeshEditor_i.storeResult(), SMESH_MeshEditor.Transform(), and SMDS_Mesh.~SMDS_Mesh().

{
  switch (type) {
  case SMDSAbs_All:
    return SMDS_ElemIteratorPtr (new MYElem_Map_Iterator< SetOfCells >(myCells, SMDSAbs_All));
    break;
  case SMDSAbs_Volume:
    return SMDS_ElemIteratorPtr (new MYElem_Map_Iterator< SetOfCells >(myCells, SMDSAbs_Volume));
  case SMDSAbs_Face:
    return SMDS_ElemIteratorPtr (new MYElem_Map_Iterator< SetOfCells >(myCells, SMDSAbs_Face));
  case SMDSAbs_Edge:
    return SMDS_ElemIteratorPtr (new MYElem_Map_Iterator< SetOfCells >(myCells, SMDSAbs_Edge));
  case SMDSAbs_0DElement:
    return SMDS_ElemIteratorPtr (new MYElem_Map_Iterator< SetOfCells >(myCells, SMDSAbs_0DElement));
  case SMDSAbs_Node:
    return SMDS_ElemIteratorPtr (new MYElem_Map_Iterator< SetOfNodes >(myNodes, SMDSAbs_All));
    //return myNodeIDFactory->elementsIterator();
  default:;
  }
  return myElementIDFactory->elementsIterator();
}
SMDS_FaceIteratorPtr SMDS_Mesh::facesIterator ( bool  idInceasingOrder = false) const [inherited]

Return an iterator on faces of the current mesh.

Definition at line 2760 of file SMDS_Mesh.cxx.

References SMDS_Mesh.myCells, and SMDSAbs_Face.

Referenced by SMESH_MEDMesh_i.calculeNbElts(), StdMeshers_QuadToTriaAdaptor.Compute(), SMDS_Mesh.Contains(), SMESH_MeshEditor.ConvertToQuadratic(), SMDS_Mesh.DebugStats(), SMDS_Mesh.DumpFaces(), SMESH.Controls.FreeEdges.GetBoreders(), SMESH.Controls.Filter.GetElementsId(), SMESH.Filter_i.GetMeshInfo(), SMESH.Controls.MultiConnection2D.GetValues(), SMESH.Controls.Length2D.GetValues(), isMeshBoundToShape(), SMESH_MesherHelper.IsQuadraticSubMesh(), DriverMED_W_SMESHDS_Mesh.Perform(), SMESH.Controls.ElementsOnShape.process(), SMESH.Controls.ElementsOnSurface.process(), SMESH.Controls.ManifoldPart.process(), and DriverSTL_W_SMDS_Mesh.writeBinary().

{
  typedef MYElem_Map_Iterator
    < SetOfCells, const SMDS_MeshFace*, SMDS_FaceIterator > TIterator;
  return SMDS_FaceIteratorPtr(new TIterator(myCells, SMDSAbs_Face)); // naturally always sorted by ID

//  typedef MYNCollection_Map_Iterator
//    < SetOfFaces, const SMDS_MeshFace*, SMDS_FaceIterator > TIterator;
//  typedef IdSortedIterator< const SMDS_MeshFace* >          TSortedIterator;
//  return ( idInceasingOrder ?
//           SMDS_FaceIteratorPtr( new TSortedIterator( *myElementIDFactory,
//                                                      SMDSAbs_Face,
//                                                      NbFaces() )) :
//           SMDS_FaceIteratorPtr(new TIterator(myFaces)));
}
const SMDS_Mesh0DElement * SMDS_Mesh::Find0DElement ( int  idnode) const [inherited]

Definition at line 1746 of file SMDS_Mesh.cxx.

References SMDS_Mesh.FindNode(), and ex29_refine.node().

{
  const SMDS_MeshNode * node = FindNode(idnode);
  if(node == NULL) return NULL;
  return Find0DElement(node);
}
const SMDS_Mesh0DElement * SMDS_Mesh::Find0DElement ( const SMDS_MeshNode n) [static, inherited]

Definition at line 1753 of file SMDS_Mesh.cxx.

References SMDS_MeshNode.GetInverseElementIterator(), SMDS_MeshElement.NbNodes(), and SMDSAbs_0DElement.

{
  if (!node) return 0;
  const SMDS_Mesh0DElement* toReturn = NULL;
  SMDS_ElemIteratorPtr it1 = node->GetInverseElementIterator(SMDSAbs_0DElement);
  while (it1->more() && (toReturn == NULL)) {
    const SMDS_MeshElement* e = it1->next();
    if (e->NbNodes() == 1) {
      toReturn = static_cast<const SMDS_Mesh0DElement*>(e);
    }
  }
  return toReturn;
}
const SMDS_MeshEdge * SMDS_Mesh::FindEdge ( int  idnode1,
int  idnode2 
) const [inherited]

Definition at line 1791 of file SMDS_Mesh.cxx.

References SMDS_Mesh.FindNode().

Referenced by _MyEdgeIterator._MyEdgeIterator(), SMDS_Mesh.FindEdge(), SMDS_Mesh.FindEdgeOrCreate(), and SMDS_VolumeTool.GetAllExistingEdges().

{
  const SMDS_MeshNode * node1=FindNode(idnode1);
  const SMDS_MeshNode * node2=FindNode(idnode2);
  if((node1==NULL)||(node2==NULL)) return NULL;
  return FindEdge(node1,node2);
}
const SMDS_MeshEdge * SMDS_Mesh::FindEdge ( int  idnode1,
int  idnode2,
int  idnode3 
) const [inherited]

Definition at line 1863 of file SMDS_Mesh.cxx.

References SMDS_Mesh.FindEdge(), and SMDS_Mesh.FindNode().

{
  const SMDS_MeshNode * node1=FindNode(idnode1);
  const SMDS_MeshNode * node2=FindNode(idnode2);
  const SMDS_MeshNode * node3=FindNode(idnode3);
  return FindEdge(node1,node2,node3);
}
const SMDS_MeshEdge * SMDS_Mesh::FindEdge ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2 
) [static, inherited]

Definition at line 1800 of file SMDS_Mesh.cxx.

References SMDS_MeshNode.GetInverseElementIterator(), SMDS_MeshElement.GetNodeIndex(), SMDS_MeshElement.NbNodes(), and SMDSAbs_Edge.

{
  if ( !node1 ) return 0;
  const SMDS_MeshEdge * toReturn=NULL;
  //PROFILER_Init();
  //PROFILER_Set();
  SMDS_ElemIteratorPtr it1=node1->GetInverseElementIterator(SMDSAbs_Edge);
  //PROFILER_Get(0);
  //PROFILER_Set();
  while(it1->more()) {
    const SMDS_MeshElement * e = it1->next();
    if ( e->NbNodes() == 2 && e->GetNodeIndex( node2 ) >= 0 ) {
      toReturn = static_cast<const SMDS_MeshEdge*>( e );
      break;
    }
  }
  //PROFILER_Get(1);
  return toReturn;
}
const SMDS_MeshEdge * SMDS_Mesh::FindEdge ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3 
) [static, inherited]

Definition at line 1872 of file SMDS_Mesh.cxx.

References SMDS_MeshNode.GetInverseElementIterator(), SMDS_MeshElement.NbNodes(), SMDS_MeshElement.nodesIterator(), and SMDSAbs_Edge.

{
  if ( !node1 ) return 0;
  SMDS_ElemIteratorPtr it1 = node1->GetInverseElementIterator(SMDSAbs_Edge);
  while(it1->more()) {
    const SMDS_MeshElement * e = it1->next();
    if ( e->NbNodes() == 3 ) {
      SMDS_ElemIteratorPtr it2 = e->nodesIterator();
      while(it2->more()) {
        const SMDS_MeshElement* n = it2->next();
        if( n!=node1 &&
            n!=node2 &&
            n!=node3 )
        {
          e = 0;
          break;
        }
      }
      if ( e )
        return static_cast<const SMDS_MeshEdge *> (e);
    }
  }
  return 0;
}
SMDS_MeshEdge * SMDS_Mesh::FindEdgeOrCreate ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2 
) [protected, inherited]

Definition at line 1827 of file SMDS_Mesh.cxx.

References SMDS_Mesh.adjustmyCellsCapacity(), SMDS_Mesh.CheckMemory(), CHECKMEMORY_INTERVAL, ObjectPool< X >.destroy(), SMDS_Mesh.FindEdge(), SMDS_MeshElementIDFactory.GetFreeID(), ObjectPool< X >.getNew(), SMDS_MeshElement.getVtkId(), SMDS_VtkEdge.init(), SMDS_Mesh.myCells, SMDS_Mesh.myEdgePool, SMDS_Mesh.myElementIDFactory, SMDS_Mesh.myGrid, SMDS_Mesh.myInfo, SMDS_MeshInfo.myNbEdges, SMDS_Mesh.NbEdges(), and SMDS_Mesh.registerElement().

Referenced by SMDS_Mesh.createQuadrangle(), and SMDS_Mesh.createTriangle().

{
  if ( !node1 || !node2) return 0;
  SMDS_MeshEdge * toReturn=NULL;
  toReturn=const_cast<SMDS_MeshEdge*>(FindEdge(node1,node2));
  if(toReturn==NULL) {
    if ( NbEdges() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
    int ID = myElementIDFactory->GetFreeID(); // -PR- voir si on range cet element
    adjustmyCellsCapacity(ID);
    vector<vtkIdType> nodeIds;
    nodeIds.clear();
    nodeIds.push_back(node1->getVtkId());
    nodeIds.push_back(node2->getVtkId());

    SMDS_VtkEdge *edgevtk = myEdgePool->getNew();
    edgevtk->init(nodeIds, this);
    if (!this->registerElement(ID,edgevtk))
      {
        this->myGrid->GetCellTypesArray()->SetValue(edgevtk->getVtkId(), VTK_EMPTY_CELL);
        myEdgePool->destroy(edgevtk);
        return 0;
      }
    toReturn = edgevtk;
    myCells[ID] = toReturn;
    myInfo.myNbEdges++;
  }
  return toReturn;
}
const SMDS_MeshElement * SMDS_Mesh::FindElement ( int  IDelem) const [inherited]

Definition at line 2130 of file SMDS_Mesh.cxx.

References MESSAGE, and SMDS_Mesh.myCells.

Referenced by SMESH_Mesh_i.BaryCenter(), SMESHGUI_CreatePolyhedralVolumeDlg.checkEditLine(), SMESH_Gen_i.CopyMesh(), SMESH_Mesh_i.CreateDimGroup(), SMESHGUI_CuttingOfQuadsDlg.displayPreview(), SMESHGUI_CreatePolyhedralVolumeDlg.displaySimulation(), SMESH_MeshEditor.DoubleNodes(), SMESH_MeshEditor.DoubleNodesOnGroupBoundaries(), SMESH_Mesh_i.ElemNbEdges(), SMESH_Mesh_i.ElemNbFaces(), enlargeBoundingBox(), SMESH_MeshEditor_i.FindEqualElements(), SMDS_Mesh.FindFace(), SMESH_Gen_i.FindGeometryByMeshElement(), SMESHGUI_MergeDlg.FindGravityCenter(), SMESHDS_GroupBase.findInMesh(), DriverSTL_W_SMDS_Mesh.findVolumeTriangles(), SMESH_VisualObjDef.GetEdgeNodes(), SMESH_Mesh_i.GetElemNbNodes(), SMESH_Mesh_i.GetElemNode(), getNodesFromElems(), getPointers(), SMESH.Controls.NumericalFunctor.GetPoints(), SMESHGUI_ExtrusionAlongPathDlg.getSelectedElements(), SMESH_Mesh_i.GetShapeIDForElem(), SMESH.Controls.MultiConnection2D.GetValue(), SMESH.Controls.Length2D.GetValue(), SMESH.Controls.AspectRatio3D.GetValue(), SMESH.Controls.MaxElementLength3D.GetValue(), SMESH.Controls.MaxElementLength2D.GetValue(), SMESH.Controls.Volume.GetValue(), SMESH.Controls.NumericalFunctor.GetValue(), StdMeshers_Import_1D.importMesh(), SMESH_Mesh_i.IsMediumNode(), SMESHGUI_VolumesFilter.IsObjValid(), SMESHGUI_FacesFilter.IsObjValid(), SMESHGUI_TriangleFilter.IsObjValid(), SMESHGUI_QuadrangleFilter.IsObjValid(), SMESHGUI_PredicateFilter.IsObjValid(), SMESH_Mesh_i.IsPoly(), SMESH_Mesh_i.IsQuadratic(), SMESH.Controls.RangeOfIds.IsSatisfy(), SMESH.Controls.CoplanarFaces.IsSatisfy(), SMESH.Controls.ElemGeomType.IsSatisfy(), SMESH.Controls.LinearOrQuadratic.IsSatisfy(), SMESH.Controls.FreeFaces.IsSatisfy(), SMESH.Controls.FreeEdges.IsSatisfy(), SMESH.Controls.OverConstrainedFace.IsSatisfy(), SMESH.Controls.OverConstrainedVolume.IsSatisfy(), SMESH.Controls.BareBorderFace.IsSatisfy(), SMESH.Controls.BareBorderVolume.IsSatisfy(), SMESH.Controls.BadOrientedVolume.IsSatisfy(), SMESHGUI_VolumesFilter.IsValid(), SMESHGUI_FacesFilter.IsValid(), SMESHGUI_TriangleFilter.IsValid(), SMESHGUI_QuadrangleFilter.IsValid(), SMESHGUI_PredicateFilter.IsValid(), SMESH_MeshEditor.MergeElements(), SMDS_MeshElementIDFactory.MeshElement(), SMDS_MeshNode.NbInverseElements(), SMDS_MeshNode_MyInvIterator.next(), SMESHGUI_WhatIsDlg.onTextChange(), SMESHGUI_TranslationDlg.onTextChange(), SMESHGUI_SymmetryDlg.onTextChange(), SMESHGUI_SmoothingDlg.onTextChange(), SMESHGUI_SewingDlg.onTextChange(), SMESHGUI_ScaleDlg.onTextChange(), SMESHGUI_RotationDlg.onTextChange(), SMESHGUI_RevolutionDlg.onTextChange(), SMESHGUI_ExtrusionDlg.onTextChange(), SMESHGUI_ExtrusionAlongPathDlg.onTextChange(), SMESHGUI_CreatePolyhedralVolumeDlg.onTextChange(), SMESHGUI_CopyMeshDlg.onTextChange(), SMESHGUI_MeshPatternDlg.onTextChanged(), SMESH.Controls.ManifoldPart.process(), SMESH.SMESH_Group.Remove(), SMESHGUI_RevolutionDlg.SelectionIntoArgument(), SMESHGUI_ExtrusionDlg.SelectionIntoArgument(), SMESH_MeshEditor_i.SetMeshElementOnShape(), SMDS_MeshNode_MyInvIterator.SMDS_MeshNode_MyInvIterator(), and SMDS_MeshNode_MyIterator.SMDS_MeshNode_MyIterator().

{
  if ((IDelem <= 0) || IDelem >= myCells.size())
  {
    MESSAGE("--------------------------------------------------------------------------------- ");
    MESSAGE("----------------------------------- bad IDelem " << IDelem << " " << myCells.size());
    MESSAGE("--------------------------------------------------------------------------------- ");
    // TODO raise an exception
    //assert(0);
    return 0;
  }
  return myCells[IDelem];
}
const SMDS_MeshElement * SMDS_Mesh::FindElement ( const std::vector< const SMDS_MeshNode * > &  nodes,
const SMDSAbs_ElementType  type = SMDSAbs_All,
const bool  noMedium = true 
) [static, inherited]

Return element based on all given nodes.

Parameters:
nodes- node of element
type- type of element
noMedium- true if medium nodes of quadratic element are not included in <nodes>
Return values:
constSMDS_MeshElement* - found element or NULL

Definition at line 2177 of file SMDS_Mesh.cxx.

References SMDS_MeshElement.GetNodeIndex(), SMDS_MeshElement.NbCornerNodes(), and SMDS_MeshElement.NbNodes().

{
  if ( nodes.size() > 0 && nodes[0] )
  {
    SMDS_ElemIteratorPtr itF = nodes[0]->GetInverseElementIterator(type);
    while (itF->more())
    {
      const SMDS_MeshElement* e = itF->next();
      int nbNodesToCheck = noMedium ? e->NbCornerNodes() : e->NbNodes();
      if ( nbNodesToCheck == nodes.size() )
      {
        for ( int i = 1; e && i < nodes.size(); ++ i )
        {
          int nodeIndex = e->GetNodeIndex( nodes[ i ]);
          if ( nodeIndex < 0 || nodeIndex >= nbNodesToCheck )
            e = 0;
        }
        if ( e )
          return static_cast<const SMDS_MeshFace *> (e);
      }
    }
  }
  return NULL;
}
const SMDS_MeshFace * SMDS_Mesh::FindFace ( int  idnode1,
int  idnode2,
int  idnode3 
) const [inherited]

Definition at line 1905 of file SMDS_Mesh.cxx.

References SMDS_Mesh.FindNode().

Referenced by SMDS_Mesh.FindFace(), SMDS_Mesh.FindFaceOrCreate(), SMESH_MesherHelper.FixQuadraticElements(), SMDS_VolumeTool.GetAllExistingFaces(), and SMESH.SMESH_MeshEditor.Make2DMeshFrom3D().

{
  const SMDS_MeshNode * node1=FindNode(idnode1);
  const SMDS_MeshNode * node2=FindNode(idnode2);
  const SMDS_MeshNode * node3=FindNode(idnode3);
  return FindFace(node1, node2, node3);
}
const SMDS_MeshFace * SMDS_Mesh::FindFace ( const std::vector< const SMDS_MeshNode * > &  nodes) [static, inherited]

Definition at line 2161 of file SMDS_Mesh.cxx.

References SMDS_Mesh.FindElement(), and SMDSAbs_Face.

{
  return (const SMDS_MeshFace*) FindElement( nodes, SMDSAbs_Face );
}
const SMDS_MeshFace * SMDS_Mesh::FindFace ( const std::vector< int > &  nodes_ids) const [inherited]

Definition at line 2149 of file SMDS_Mesh.cxx.

References SMDS_Mesh.FindFace(), SMDS_Mesh.FindNode(), and ex29_refine.node().

{
  int nbnodes = nodes_ids.size();
  vector<const SMDS_MeshNode *> poly_nodes (nbnodes);
  for (int inode = 0; inode < nbnodes; inode++) {
    const SMDS_MeshNode * node = FindNode(nodes_ids[inode]);
    if (node == NULL) return NULL;
    poly_nodes[inode] = node;
  }
  return FindFace(poly_nodes);
}
const SMDS_MeshFace * SMDS_Mesh::FindFace ( int  idnode1,
int  idnode2,
int  idnode3,
int  idnode4 
) const [inherited]

Definition at line 1960 of file SMDS_Mesh.cxx.

References SMDS_Mesh.FindFace(), and SMDS_Mesh.FindNode().

{
  const SMDS_MeshNode * node1=FindNode(idnode1);
  const SMDS_MeshNode * node2=FindNode(idnode2);
  const SMDS_MeshNode * node3=FindNode(idnode3);
  const SMDS_MeshNode * node4=FindNode(idnode4);
  return FindFace(node1, node2, node3, node4);
}
const SMDS_MeshFace * SMDS_Mesh::FindFace ( int  idnode1,
int  idnode2,
int  idnode3,
int  idnode4,
int  idnode5,
int  idnode6 
) const [inherited]

Definition at line 2019 of file SMDS_Mesh.cxx.

References SMDS_Mesh.FindFace(), and SMDS_Mesh.FindNode().

{
  const SMDS_MeshNode * node1 = FindNode(idnode1);
  const SMDS_MeshNode * node2 = FindNode(idnode2);
  const SMDS_MeshNode * node3 = FindNode(idnode3);
  const SMDS_MeshNode * node4 = FindNode(idnode4);
  const SMDS_MeshNode * node5 = FindNode(idnode5);
  const SMDS_MeshNode * node6 = FindNode(idnode6);
  return FindFace(node1, node2, node3, node4, node5, node6);
}
const SMDS_MeshFace * SMDS_Mesh::FindFace ( int  idnode1,
int  idnode2,
int  idnode3,
int  idnode4,
int  idnode5,
int  idnode6,
int  idnode7,
int  idnode8 
) const [inherited]

Definition at line 2071 of file SMDS_Mesh.cxx.

References SMDS_Mesh.FindFace(), and SMDS_Mesh.FindNode().

{
  const SMDS_MeshNode * node1 = FindNode(idnode1);
  const SMDS_MeshNode * node2 = FindNode(idnode2);
  const SMDS_MeshNode * node3 = FindNode(idnode3);
  const SMDS_MeshNode * node4 = FindNode(idnode4);
  const SMDS_MeshNode * node5 = FindNode(idnode5);
  const SMDS_MeshNode * node6 = FindNode(idnode6);
  const SMDS_MeshNode * node7 = FindNode(idnode7);
  const SMDS_MeshNode * node8 = FindNode(idnode8);
  return FindFace(node1, node2, node3, node4, node5, node6, node7, node8);
}
const SMDS_MeshFace * SMDS_Mesh::FindFace ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4 
) [static, inherited]

Definition at line 1970 of file SMDS_Mesh.cxx.

References SMDS_MeshNode.GetInverseElementIterator(), SMDS_MeshElement.NbNodes(), SMDS_MeshElement.nodesIterator(), and SMDSAbs_Face.

{
  if ( !node1 ) return 0;
  SMDS_ElemIteratorPtr it1 = node1->GetInverseElementIterator(SMDSAbs_Face);
  while(it1->more()) {
    const SMDS_MeshElement * e = it1->next();
    if ( e->NbNodes() == 4 ) {
      SMDS_ElemIteratorPtr it2 = e->nodesIterator();
      while(it2->more()) {
        const SMDS_MeshElement* n = it2->next();
        if( n!=node1 &&
            n!=node2 &&
            n!=node3 &&
            n!=node4 )
        {
          e = 0;
          break;
        }
      }
      if ( e )
        return static_cast<const SMDS_MeshFace *> (e);
    }
  }
  return 0;
}
const SMDS_MeshFace * SMDS_Mesh::FindFace ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4,
const SMDS_MeshNode n5,
const SMDS_MeshNode n6 
) [static, inherited]

Definition at line 2032 of file SMDS_Mesh.cxx.

References SMDS_MeshNode.GetInverseElementIterator(), SMDS_MeshElement.NbNodes(), SMDS_MeshElement.nodesIterator(), and SMDSAbs_Face.

{
  if ( !node1 ) return 0;
  SMDS_ElemIteratorPtr it1 = node1->GetInverseElementIterator(SMDSAbs_Face);
  while(it1->more()) {
    const SMDS_MeshElement * e = it1->next();
    if ( e->NbNodes() == 6 ) {
      SMDS_ElemIteratorPtr it2 = e->nodesIterator();
      while(it2->more()) {
        const SMDS_MeshElement* n = it2->next();
        if( n!=node1 &&
            n!=node2 &&
            n!=node3 &&
            n!=node4 &&
            n!=node5 &&
            n!=node6 )
        {
          e = 0;
          break;
        }
      }
      if ( e )
        return static_cast<const SMDS_MeshFace *> (e);
    }
  }
  return 0;
}
const SMDS_MeshFace * SMDS_Mesh::FindFace ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4,
const SMDS_MeshNode n5,
const SMDS_MeshNode n6,
const SMDS_MeshNode n7,
const SMDS_MeshNode n8 
) [static, inherited]

Definition at line 2087 of file SMDS_Mesh.cxx.

References SMDS_MeshNode.GetInverseElementIterator(), SMDS_MeshElement.NbNodes(), SMDS_MeshElement.nodesIterator(), and SMDSAbs_Face.

{
  if ( !node1 ) return 0;
  SMDS_ElemIteratorPtr it1 = node1->GetInverseElementIterator(SMDSAbs_Face);
  while(it1->more()) {
    const SMDS_MeshElement * e = it1->next();
    if ( e->NbNodes() == 8 ) {
      SMDS_ElemIteratorPtr it2 = e->nodesIterator();
      while(it2->more()) {
        const SMDS_MeshElement* n = it2->next();
        if( n!=node1 &&
            n!=node2 &&
            n!=node3 &&
            n!=node4 &&
            n!=node5 &&
            n!=node6 &&
            n!=node7 &&
            n!=node8 )
        {
          e = 0;
          break;
        }
      }
      if ( e )
        return static_cast<const SMDS_MeshFace *> (e);
    }
  }
  return 0;
}
const SMDS_MeshFace * SMDS_Mesh::FindFace ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3 
) [static, inherited]

Definition at line 1914 of file SMDS_Mesh.cxx.

References SMDS_MeshNode.GetInverseElementIterator(), SMDS_MeshElement.NbNodes(), SMDS_MeshElement.nodesIterator(), and SMDSAbs_Face.

{
  if ( !node1 ) return 0;
  SMDS_ElemIteratorPtr it1 = node1->GetInverseElementIterator(SMDSAbs_Face);
  while(it1->more()) {
    const SMDS_MeshElement * e = it1->next();
    if ( e->NbNodes() == 3 ) {
      SMDS_ElemIteratorPtr it2 = e->nodesIterator();
      while(it2->more()) {
        const SMDS_MeshElement* n = it2->next();
        if( n!=node1 &&
            n!=node2 &&
            n!=node3 )
        {
          e = 0;
          break;
        }
      }
      if ( e )
        return static_cast<const SMDS_MeshFace *> (e);
    }
  }
  return 0;
}
SMDS_MeshFace * SMDS_Mesh::FindFaceOrCreate ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4 
) [protected, inherited]

Definition at line 1999 of file SMDS_Mesh.cxx.

References SMDS_Mesh.createQuadrangle(), SMDS_Mesh.FindFace(), SMDS_MeshElementIDFactory.GetFreeID(), and SMDS_Mesh.myElementIDFactory.

{
  SMDS_MeshFace * toReturn=NULL;
  toReturn=const_cast<SMDS_MeshFace*>(FindFace(node1,node2,node3,node4));
  if(toReturn==NULL) {
    int ID = myElementIDFactory->GetFreeID();
    toReturn=createQuadrangle(node1,node2,node3,node4,ID);
  }
  return toReturn;
}
SMDS_MeshFace * SMDS_Mesh::FindFaceOrCreate ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3 
) [protected, inherited]

Definition at line 1941 of file SMDS_Mesh.cxx.

References SMDS_Mesh.createTriangle(), SMDS_Mesh.FindFace(), SMDS_MeshElementIDFactory.GetFreeID(), and SMDS_Mesh.myElementIDFactory.

Referenced by SMDS_Mesh.AddVolumeWithID().

{
  SMDS_MeshFace * toReturn=NULL;
  toReturn = const_cast<SMDS_MeshFace*>(FindFace(node1,node2,node3));
  if(toReturn==NULL) {
    int ID = myElementIDFactory->GetFreeID();
    toReturn = createTriangle(node1,node2,node3, ID);
  }
  return toReturn;
}
const SMDS_MeshNode * SMDS_Mesh::FindNode ( int  idnode) const [inherited]

Return the node whose SMDS ID is 'ID'.

Definition at line 1413 of file SMDS_Mesh.cxx.

References MESSAGE, and SMDS_Mesh.myNodes.

Referenced by SMESHGUI_CreatePolyhedralVolumeDlg.checkEditLine(), SMESH_Gen_i.ConcatenateCommon(), SMESH_Gen_i.CopyMesh(), SMESH_Mesh_i.CreateDimGroup(), SMESHGUI_CreatePolyhedralVolumeDlg.displaySimulation(), SMESH_MeshEditor.DoubleNodes(), enlargeBoundingBox(), SMDS_Mesh.Find0DElement(), SMDS_Mesh.FindEdge(), SMDS_Mesh.FindFace(), SMESHDS_GroupBase.findInMesh(), FindNode(), SMESH_Mesh_i.GetNodeInverseElements(), SMESH_Mesh_i.GetNodePosition(), SMESH_Mesh_i.GetNodeXYZ(), getPointers(), SMESH_Mesh_i.GetShapeID(), SMESH_Mesh_i.IsMediumNode(), SMESH_Mesh_i.IsMediumNodeOfAnyElem(), SMESHGUI_PredicateFilter.IsObjValid(), SMESH.Controls.RangeOfIds.IsSatisfy(), SMESH.Controls.FreeNodes.IsSatisfy(), SMESHGUI_PredicateFilter.IsValid(), SMESHGUI_AddQuadraticElementDlg.IsValid(), SMESH_Gen_i.Load(), SMESH_MeshEditor_i.MergeNodes(), SMDS_MeshNodeIDFactory.MeshElement(), SMESH.Measurements_i.MinDistance(), SMESHGUI_WhatIsDlg.onTextChange(), SMESHGUI_SmoothingDlg.onTextChange(), SMESHGUI_SewingDlg.onTextChange(), SMESHGUI_ExtrusionAlongPathDlg.onTextChange(), SMESHGUI_CreatePolyhedralVolumeDlg.onTextChange(), SMESHGUI_AddQuadraticElementDlg.onTextChange(), SMESHGUI_AddMeshElementDlg.onTextChange(), SMESHGUI_SelectionOp.onTextChanged(), SMESH.SMESH_Group.Remove(), SMESHGUI_TranslationDlg.SelectionIntoArgument(), SMESHGUI_SymmetryDlg.SelectionIntoArgument(), SMESHGUI_ScaleDlg.SelectionIntoArgument(), SMESHGUI_RotationDlg.SelectionIntoArgument(), SMESHGUI_RevolutionDlg.SelectionIntoArgument(), SMESHGUI_ExtrusionAlongPathDlg.SelectionIntoArgument(), SMESH_MeshEditor_i.SetNodeInVolume(), SMESH_MeshEditor_i.SetNodeOnEdge(), SMESH_MeshEditor_i.SetNodeOnFace(), SMESH_MeshEditor_i.SetNodeOnVertex(), SMESH.TIdPreview.SetPointsData(), SMESH_MeshEditor_i.SewBorderToSide(), SMESH_MeshEditor_i.SewConformFreeBorders(), SMESH_MeshEditor_i.SewFreeBorders(), SMESH_MeshEditor_i.SewSideElements(), and SMESH_MeshEditor_i.smooth().

{
  if (ID < 1 || ID >= myNodes.size())
  {
    MESSAGE("------------------------------------------------------------------------- ");
    MESSAGE("----------------------------------- bad ID " << ID << " " << myNodes.size());
    MESSAGE("------------------------------------------------------------------------- ");
    return 0;
  }
  return (const SMDS_MeshNode *)myNodes[ID];
}
const SMDS_MeshNode * SMDS_Mesh::FindNodeVtk ( int  idnode) const [inherited]

Return the node whose VTK ID is 'vtkId'.

Definition at line 1428 of file SMDS_Mesh.cxx.

References MESSAGE, and SMDS_Mesh.myNodes.

Referenced by SMDS_VtkVolume.GetFaceNode(), and SMDS_VtkCellIterator.next().

{
  // TODO if needed use mesh->nodeIdFromVtkToSmds
  if (vtkId < 0 || vtkId >= (myNodes.size() -1))
  {
    MESSAGE("------------------------------------------------------------------------- ");
    MESSAGE("---------------------------- bad VTK ID " << vtkId << " " << myNodes.size());
    MESSAGE("------------------------------------------------------------------------- ");
    return 0;
  }
  return (const SMDS_MeshNode *)myNodes[vtkId+1];
}
int SMDS_Mesh::fromVtkToSmds ( int  vtkid) [inherited]
SMDSAbs_ElementType SMDS_Mesh::GetElementType ( const int  id,
const bool  iselem 
) const [inherited]

Definition at line 3331 of file SMDS_Mesh.cxx.

References SMDS_MeshElement.GetType(), SMDS_MeshNodeIDFactory.MeshElement(), SMDS_MeshElementIDFactory.MeshElement(), SMDS_Mesh.myElementIDFactory, SMDS_Mesh.myNodeIDFactory, and SMDSAbs_All.

Referenced by SMESHGUI_CreatePolyhedralVolumeDlg.checkEditLine(), and SMESHGUI_CreatePolyhedralVolumeDlg.displaySimulation().

{
  SMDS_MeshElement* elem = 0;
  if( iselem )
    elem = myElementIDFactory->MeshElement( id );
  else
    elem = myNodeIDFactory->MeshElement( id );

  if( !elem )
  {
    //throw SALOME_Exception(LOCALIZED ("this element isn't exist"));
    return SMDSAbs_All;
  }
  else
    return elem->GetType();
}
SMDS_UnstructuredGrid* SMDS_Mesh.getGrid ( ) [inherited]
const std::set<SMESHDS_GroupBase*>& SMESHDS_Mesh.GetGroups ( ) const
const list< const SMESHDS_Hypothesis * > & SMESHDS_Mesh::GetHypothesis ( const TopoDS_Shape &  S) const

Definition at line 1137 of file SMESHDS_Mesh.cxx.

References myShapeToHypothesis.

Referenced by SMESH_Mesh_i.CheckGeomGroupModif(), and SMESH_Gen_i.Save().

{
  if ( myShapeToHypothesis.IsBound( S.Oriented(TopAbs_FORWARD) ) ) // ignore orientation of S
     return myShapeToHypothesis.Find( S.Oriented(TopAbs_FORWARD) );

  static list<const SMESHDS_Hypothesis*> empty;
  return empty;
}
double SMDS_Mesh::getMaxDim ( ) [inherited]

Definition at line 4218 of file SMDS_Mesh.cxx.

References MESSAGE, SMDS_Mesh.xmax, SMDS_Mesh.xmin, SMDS_Mesh.ymax, SMDS_Mesh.ymin, SMDS_Mesh.zmax, and SMDS_Mesh.zmin.

{
  double dmax = 1.e-3;
  if ((xmax - xmin) > dmax) dmax = xmax -xmin;
  if ((ymax - ymin) > dmax) dmax = ymax -ymin;
  if ((zmax - zmin) > dmax) dmax = zmax -zmin;
  MESSAGE("getMaxDim " << dmax);
  return dmax;
}
int SMDS_Mesh.getMeshId ( ) [inherited]
const SMDS_MeshInfo& SMDS_Mesh.GetMeshInfo ( ) const [inherited]
unsigned long SMDS_Mesh::GetMTime ( ) [inherited]

get last modification timeStamp

Definition at line 4240 of file SMDS_Mesh.cxx.

References SMDS_Mesh.myModifTime.

{
  return this->myModifTime;
}
int SMESHDS_Mesh.GetNbGroups ( ) const

Definition at line 442 of file SMESHDS_Mesh.hxx.

Referenced by SMESH.Controls.GroupColor.SetMesh().

{ return myGroups.size(); }
int SMESHDS_Mesh::GetPersistentId ( ) const

Return ID persistent during lifecycle.

Definition at line 91 of file SMESHDS_Mesh.cxx.

References myPersistentID.

Referenced by StdMeshers_ImportSource1D.GetSourceMeshes(), and SMESH_Gen_i.Save().

{
  return myPersistentID;
}
SMESHDS_Script * SMESHDS_Mesh::GetScript ( )

Definition at line 1150 of file SMESHDS_Mesh.cxx.

References myScript.

Referenced by SMESH_Client.Update().

{
        return myScript;
}
SMESHDS_SubMesh * SMESHDS_Mesh::getSubmesh ( const TopoDS_Shape &  shape) [private]

return submesh by shape

Parameters:
shape- the subshape
Return values:
SMESHDS_SubMesh*- the found submesh

search of submeshes is optimized

Definition at line 906 of file SMESHDS_Mesh.cxx.

References myCurSubMesh, myCurSubShape, SMESH_fixation.shape, and ShapeToIndex().

Referenced by SetMeshElementOnShape(), SetNodeInVolume(), SetNodeOnEdge(), SetNodeOnFace(), and SetNodeOnVertex().

{
  if ( shape.IsNull() )
    return 0;

  if ( !myCurSubShape.IsNull() && shape.IsSame( myCurSubShape ))
    return myCurSubMesh;

  getSubmesh( ShapeToIndex( shape ));
  myCurSubShape = shape;
  return myCurSubMesh;
}
SMESHDS_SubMesh * SMESHDS_Mesh::getSubmesh ( const int  Index) [private]

return submesh by subshape index

Parameters:
Index- the subshape index
Return values:
SMESHDS_SubMesh*- the found submesh search of submeshes is optimized

Definition at line 928 of file SMESHDS_Mesh.cxx.

References myCurSubID, myCurSubMesh, myCurSubShape, and myShapeIndexToSubMesh.

{
  //Update or build submesh
  if ( Index != myCurSubID ) {
    map<int,SMESHDS_SubMesh*>::iterator it = myShapeIndexToSubMesh.find( Index );
    if ( it == myShapeIndexToSubMesh.end() )
      it = myShapeIndexToSubMesh.insert( make_pair(Index, new SMESHDS_SubMesh(this, Index) )).first;
    myCurSubMesh = it->second;
    myCurSubID = Index;
    myCurSubShape.Nullify(); // myCurSubShape no more corresponds to submesh
  }
  return myCurSubMesh;
}
bool SMDS_Mesh::hasConstructionEdges ( ) [inherited]

Return true if this mesh create faces with edges.

A false returned value mean that faces are created with nodes. A concequence is, iteration on edges (SMDS_Element.edgesIterator) will be unavailable.

Definition at line 2528 of file SMDS_Mesh.cxx.

References SMDS_Mesh.myHasConstructionEdges.

Referenced by SMDS_Mesh.addChildrenWithNodes(), SMDS_Mesh.AddFace(), SMDS_Mesh.AddFaceWithID(), SMDS_Mesh.AddVolumeWithID(), SMDS_Mesh.createQuadrangle(), SMDS_Mesh.createTriangle(), DriverMED_W_SMESHDS_Mesh.Perform(), RemoveElement(), SMDS_Mesh.RemoveElement(), RemoveFreeElement(), SMDS_Mesh.RemoveFreeElement(), and RemoveNode().

bool SMDS_Mesh::hasConstructionFaces ( ) [inherited]

Return true if this mesh create volumes with faces A false returned value mean that volumes are created with nodes or edges.

(see hasConstructionEdges) A concequence is, iteration on faces (SMDS_Element.facesIterator) will be unavailable.

Definition at line 2540 of file SMDS_Mesh.cxx.

References SMDS_Mesh.myHasConstructionFaces.

Referenced by SMDS_Mesh.addChildrenWithNodes(), SMDS_Mesh.AddVolume(), SMDS_Mesh.AddVolumeWithID(), DriverMED_W_SMESHDS_Mesh.Perform(), RemoveElement(), SMDS_Mesh.RemoveElement(), RemoveFreeElement(), SMDS_Mesh.RemoveFreeElement(), and RemoveNode().

bool SMESHDS_Mesh::HasHypothesis ( const TopoDS_Shape &  S)

Definition at line 1179 of file SMESHDS_Mesh.cxx.

References myShapeToHypothesis.

{
  return myShapeToHypothesis.IsBound(S.Oriented(TopAbs_FORWARD));
}
bool SMDS_Mesh::hasInverseElements ( ) [inherited]

Return true if nodes are linked to the finit elements, they are belonging to.

Currently, It always return true.

Definition at line 2549 of file SMDS_Mesh.cxx.

References SMDS_Mesh.myHasInverseElements.

bool SMESHDS_Mesh::HasMeshElements ( const TopoDS_Shape &  S) const

Definition at line 1168 of file SMESHDS_Mesh.cxx.

References MESSAGE, myIndexToShape, myShape, and myShapeIndexToSubMesh.

{
        if (myShape.IsNull()) MESSAGE("myShape is NULL");
        int Index = myIndexToShape.FindIndex(S);
        return myShapeIndexToSubMesh.find(Index)!=myShapeIndexToSubMesh.end();
}
void SMDS_Mesh::incrementCellsCapacity ( int  nbCells) [inherited]

Definition at line 4117 of file SMDS_Mesh.cxx.

References MESSAGE, SMDS_Mesh.myCellIdVtkToSmds, SMDS_Mesh.myCells, and SMDS_Mesh.myNodes.

{
  int val = myCellIdVtkToSmds.size();
  MESSAGE(" ------------------- resize myCellIdVtkToSmds " << val << " --> " << val + nbCells);
  myCellIdVtkToSmds.resize(val + nbCells, -1); // fill new elements with -1
  val = myCells.size();
  MESSAGE(" ------------------- resize myCells " << val << " --> " << val + nbCells);
  myNodes.resize(val +nbCells, 0);
}
void SMDS_Mesh::incrementNodesCapacity ( int  nbNodes) [inherited]

Definition at line 4107 of file SMDS_Mesh.cxx.

References MESSAGE, and SMDS_Mesh.myNodes.

{
//  int val = myCellIdSmdsToVtk.size();
//  MESSAGE(" ------------------- resize myCellIdSmdsToVtk " << val << " --> " << val + nbNodes);
//  myCellIdSmdsToVtk.resize(val + nbNodes, -1); // fill new elements with -1
  int val = myNodes.size();
  MESSAGE(" ------------------- resize myNodes " << val << " --> " << val + nbNodes);
  myNodes.resize(val +nbNodes, 0);
}
const TopoDS_Shape & SMESHDS_Mesh::IndexToShape ( int  ShapeIndex) const
bool SMDS_Mesh::isCompacted ( ) [inherited]

Definition at line 4245 of file SMDS_Mesh.cxx.

References MESSAGE, SMDS_Mesh.myCompactTime, and SMDS_Mesh.myModifTime.

Referenced by Renumber().

{
  if (this->myModifTime > this->myCompactTime)
    {
      MESSAGE(" *** isCompacted " << myCompactTime << " < " << myModifTime);
      this->myCompactTime = this->myModifTime;
      return false;
    }
  return true;
}
bool SMESHDS_Mesh::IsEmbeddedMode ( )

Definition at line 69 of file SMESHDS_Mesh.cxx.

References myIsEmbeddedMode.

Referenced by StdMeshers_QuadToTriaAdaptor.Compute2ndPart().

{
  return myIsEmbeddedMode;
}
bool SMESHDS_Mesh::IsGroupOfSubShapes ( const TopoDS_Shape &  aSubShape) const

Definition at line 1079 of file SMESHDS_Mesh.cxx.

References myIndexToShape.

Referenced by AddCompoundSubmesh().

{
  if ( myIndexToShape.Contains(theShape) )
    return true;

  for ( TopoDS_Iterator it( theShape ); it.More(); it.Next() )
    if (IsGroupOfSubShapes( it.Value() ))
      return true;

  return false;
}
int SMDS_Mesh::MaxElementID ( ) const [inherited]
int SMDS_Mesh::MaxNodeID ( ) const [inherited]

Definition at line 3251 of file SMDS_Mesh.cxx.

References SMDS_Mesh.myNodeMax.

Referenced by SMDS_MeshNodeIDFactory.updateMinMax().

{
  return myNodeMax;
}
int SMESHDS_Mesh.MaxShapeIndex ( ) const
int SMESHDS_Mesh::MaxSubMeshIndex ( ) const

Return max index of sub-mesh.

Definition at line 1261 of file SMESHDS_Mesh.cxx.

References myShapeIndexToSubMesh.

Referenced by SMESH_Gen_i.Load().

{
  return myShapeIndexToSubMesh.empty() ? 0 : myShapeIndexToSubMesh.rbegin()->first;
}
SMESHDS_SubMesh * SMESHDS_Mesh::MeshElements ( const TopoDS_Shape &  S) const
SMESHDS_SubMesh * SMESHDS_Mesh::MeshElements ( const int  Index) const

Return the sub mesh by Id of shape it is linked to.

Definition at line 1108 of file SMESHDS_Mesh.cxx.

References myShapeIndexToSubMesh.

{
  TShapeIndexToSubMesh::const_iterator anIter = myShapeIndexToSubMesh.find(Index);
  if (anIter != myShapeIndexToSubMesh.end())
    return anIter->second;
  else
    return NULL;
}
int SMDS_Mesh::MinElementID ( ) const [inherited]
int SMDS_Mesh::MinNodeID ( ) const [inherited]

Definition at line 3261 of file SMDS_Mesh.cxx.

References SMDS_Mesh.myNodeMin.

Referenced by SMDS_MeshNodeIDFactory.updateMinMax().

{
  return myNodeMin;
}
void SMDS_Mesh::Modified ( ) [inherited]

modification that needs compact structure and redraw

Definition at line 4229 of file SMDS_Mesh.cxx.

References MESSAGE, SMDS_Mesh.myModified, and SMDS_Mesh.myModifTime.

Referenced by SMESH_Gen_i.ConcatenateCommon(), SMESH_Gen_i.CopyMesh(), and SMDS_Mesh.SMDS_Mesh().

{
  if (this->myModified)
    {
      this->myModifTime++;
      MESSAGE("modified");
      myModified = false;
    }
}
bool SMESHDS_Mesh::ModifyCellNodes ( int  vtkVolId,
std::map< int, int localClonedNodeIds 
)

change some nodes in cell without modifying type or internal connectivity.

Nodes inverse connectivity is maintained up to date.

Parameters:
vtkVolIdvtk id of the cell.
localClonedNodeIdsmap old node id to new node id.
Returns:
ok if success.

Definition at line 1978 of file SMESHDS_Mesh.cxx.

References SMDS_UnstructuredGrid.ModifyCellNodes(), and SMDS_Mesh.myGrid.

Referenced by SMESH_MeshEditor.DoubleNodesOnGroupBoundaries().

{
  myGrid->ModifyCellNodes(vtkVolId, localClonedNodeIds);
  return true;
}
void SMESHDS_Mesh::MoveNode ( const SMDS_MeshNode n,
double  x,
double  y,
double  z 
)
int SMDS_Mesh::Nb0DElements ( ) const [inherited]

Return the number of 0D elements.

Definition at line 2327 of file SMDS_Mesh.cxx.

References SMDS_Mesh.myInfo, and SMDS_MeshInfo.Nb0DElements().

Referenced by SMDS_Mesh.Add0DElementWithID(), SMDS_Mesh.DebugStats(), and SMESH_Client.Update().

{
  return myInfo.Nb0DElements(); // -PR- a verfier
}
int SMDS_Mesh::NbEdges ( ) const [inherited]
int SMDS_Mesh::NbFaces ( ) const [inherited]
int SMDS_Mesh::NbNodes ( ) const [inherited]
int SMDS_Mesh::NbSubMesh ( ) const [inherited]

Return the number of child mesh of this mesh.

Note that the tree structure of SMDS_Mesh seems to be unused in this version (2003-09-08) of SMESH

Definition at line 2361 of file SMDS_Mesh.cxx.

References SMDS_Mesh.myChildren.

{
        return myChildren.size();
}
int SMDS_Mesh::NbVolumes ( ) const [inherited]
SMESHDS_SubMesh * SMESHDS_Mesh::NewSubMesh ( int  Index)

Definition at line 1188 of file SMESHDS_Mesh.cxx.

References myShapeIndexToSubMesh.

Referenced by AddCompoundSubmesh(), SMESH_subMesh.CreateSubMeshDS(), and SMESH_Gen_i.Load().

{
  SMESHDS_SubMesh* SM = 0;
  TShapeIndexToSubMesh::iterator anIter = myShapeIndexToSubMesh.find(Index);
  if (anIter == myShapeIndexToSubMesh.end())
  {
    SM = new SMESHDS_SubMesh(this, Index);
    myShapeIndexToSubMesh[Index]=SM;
  }
  else
    SM = anIter->second;
  return SM;
}
SMDS_NodeIteratorPtr SMDS_Mesh::nodesIterator ( bool  idInceasingOrder = false) const [inherited]

Return an iterator on nodes of the current mesh factory.

Definition at line 2704 of file SMDS_Mesh.cxx.

References SMDS_Mesh.myNodes.

Referenced by SMESH_MEDMesh_i.calculeNbElts(), SMDS_Mesh.Clear(), SMESH_Gen_i.ConcatenateCommon(), SMDS_Mesh.Contains(), StdMeshers_Penta_3D.CreateNode(), SMDS_Mesh.DebugStats(), SMDS_Mesh.DumpNodes(), SMESH.Controls.Filter.GetElementsId(), SMESH.Filter_i.GetMeshInfo(), SMESH_Mesh_i.GetNodesId(), SMESH_ElementSearcherImpl.getTolerance(), StdMeshers_Import_1D.importMesh(), SMESH_Gen_i.Load(), DriverMED_W_SMESHDS_Mesh.Perform(), SMESH.Controls.ElementsOnShape.process(), SMESH.Controls.ElementsOnSurface.process(), SMESH_Gen_i.Save(), SMESH_NodeSearcherImpl.SMESH_NodeSearcherImpl(), SMESH_MeshEditor.Transform(), and SMDS_Mesh.~SMDS_Mesh().

{
  typedef MYNode_Map_Iterator
    < SetOfNodes, const SMDS_MeshNode*, SMDS_NodeIterator > TIterator;
  return SMDS_NodeIteratorPtr( new TIterator(myNodes)); // naturally always sorted by ID

//  typedef IdSortedIterator< const SMDS_MeshNode* >          TSortedIterator;
//  return ( idInceasingOrder ?
//           SMDS_NodeIteratorPtr( new TSortedIterator( *myNodeIDFactory, SMDSAbs_Node, NbNodes())) :
//           SMDS_NodeIteratorPtr( new TIterator(myNodes)));
}
bool SMDS_Mesh::registerElement ( int  ID,
SMDS_MeshElement element 
) [protected, inherited]

Registers element with the given ID, maintains inverse connections.

Definition at line 1381 of file SMDS_Mesh.cxx.

References SMDS_Mesh.chunkSize, SMDS_MeshElement.getVtkId(), MESSAGE, MYASSERT, SMDS_Mesh.myCellIdVtkToSmds, SMDS_Mesh.myCells, SMDS_Mesh.myElementIDFactory, SMDS_MeshElement.myID, SMDS_Mesh.myMeshId, SMDS_MeshElement.myMeshId, SMDS_MeshElementIDFactory.SetInVtkGrid(), and SMDS_MeshElementIDFactory.updateMinMax().

Referenced by SMDS_Mesh.AddEdgeWithID(), SMDS_Mesh.AddFaceWithID(), SMDS_Mesh.AddVolumeFromVtkIdsWithID(), SMDS_Mesh.AddVolumeWithID(), SMDS_MeshElementIDFactory.BindID(), SMDS_Mesh.createQuadrangle(), SMDS_Mesh.createTriangle(), and SMDS_Mesh.FindEdgeOrCreate().

{
  //MESSAGE("registerElement " << ID);
  if ((ID >=0) && (ID < myCells.size()) && myCells[ID]) // --- already bound
  {
    MESSAGE(" ------------------ already bound "<< ID << " " << myCells[ID]->getVtkId());
    return false;
  }

  element->myID = ID;
  element->myMeshId = myMeshId;

  SMDS_MeshCell *cell = dynamic_cast<SMDS_MeshCell*>(element);
  MYASSERT(cell);
  int vtkId = cell->getVtkId();  
  if (vtkId == -1)
    vtkId = myElementIDFactory->SetInVtkGrid(element);

  if (vtkId >= myCellIdVtkToSmds.size()) // --- resize local vector
  {
    MESSAGE(" --------------------- resize myCellIdVtkToSmds " << vtkId << " --> " << vtkId + SMDS_Mesh::chunkSize);
    myCellIdVtkToSmds.resize(vtkId + SMDS_Mesh::chunkSize, -1);
  }
  myCellIdVtkToSmds[vtkId] = ID;

  myElementIDFactory->updateMinMax(ID);
  return true;
}
void SMDS_Mesh::Remove0DElement ( const SMDS_Mesh0DElement elem0d) [virtual, inherited]

Remove an edge and all the elements which own this edge.

Definition at line 1561 of file SMDS_Mesh.cxx.

References MESSAGE, and SMDS_Mesh.RemoveElement().

{
    MESSAGE("Remove0DElement");
  RemoveElement(elem0d,true);
}
void SMDS_Mesh::RemoveEdge ( const SMDS_MeshEdge edge) [virtual, inherited]

Remove an edge and all the elements which own this edge.

Definition at line 1571 of file SMDS_Mesh.cxx.

References MESSAGE, and SMDS_Mesh.RemoveElement().

{
    MESSAGE("RemoveEdge");
        RemoveElement(edge,true);
}
void SMDS_Mesh::RemoveElement ( const SMDS_MeshElement elem,
std::list< const SMDS_MeshElement * > &  removedElems,
std::list< const SMDS_MeshElement * > &  removedNodes,
const bool  removenodes = false 
) [virtual, inherited]
Parameters:
elemThe element to delete
removedElemsto be filled with all removed elements
removedNodesto be filled with all removed nodes
removenodesif true remaining nodes will be removed

Definition at line 2994 of file SMDS_Mesh.cxx.

References SMDS_Mesh.addChildrenWithNodes(), ObjectPool< X >.destroy(), getExclusiveNodes(), getFinitElements(), SMDS_MeshElement.GetType(), SMDS_Mesh.hasConstructionEdges(), SMDS_Mesh.hasConstructionFaces(), MYASSERT, SMDS_Mesh.myCells, SMDS_Mesh.myEdgePool, SMDS_Mesh.myElementIDFactory, SMDS_Mesh.myFacePool, SMDS_Mesh.myGrid, SMDS_Mesh.myInfo, SMDS_MeshInfo.myNbNodes, SMDS_Mesh.myNodeIDFactory, SMDS_Mesh.myNodePool, SMDS_Mesh.myNodes, SMDS_Mesh.myVolumePool, SMDS_SpacePosition.originSpacePosition(), SMDS_MeshNodeIDFactory.ReleaseID(), SMDS_MeshElementIDFactory.ReleaseID(), SMDS_MeshInfo.remove(), SMDS_MeshInfo.RemoveEdge(), SMDS_MeshInfo.RemoveFace(), SMDS_MeshNode.RemoveInverseElement(), SMDS_MeshInfo.RemoveVolume(), SMDSAbs_0DElement, SMDSAbs_Edge, SMDSAbs_Face, SMDSAbs_Node, and SMDSAbs_Volume.

Referenced by SMDS_Mesh.Remove0DElement(), SMDS_Mesh.RemoveEdge(), SMDS_Mesh.RemoveElement(), SMDS_Mesh.RemoveFace(), SMDS_Mesh.RemoveNode(), SMDS_Mesh.RemoveVolume(), and SMESH_Client.Update().

{
  //MESSAGE("SMDS_Mesh::RemoveElement " << elem->getVtkId() << " " << removenodes);
  // get finite elements built on elem
  set<const SMDS_MeshElement*> * s1;
  if (    (elem->GetType() == SMDSAbs_0DElement)
      || ((elem->GetType() == SMDSAbs_Edge) && !hasConstructionEdges())
      || ((elem->GetType() == SMDSAbs_Face) && !hasConstructionFaces())
      ||  (elem->GetType() == SMDSAbs_Volume) )
    {
      s1 = new set<const SMDS_MeshElement*> ();
      s1->insert(elem);
    }
  else
    s1 = getFinitElements(elem);

  // get exclusive nodes (which would become free afterwards)
  set<const SMDS_MeshElement*> * s2;
  if (elem->GetType() == SMDSAbs_Node) // a node is removed
    {
      // do not remove nodes except elem
      s2 = new set<const SMDS_MeshElement*> ();
      s2->insert(elem);
      removenodes = true;
    }
  else
    s2 = getExclusiveNodes(*s1);

  // form the set of finite and construction elements to remove
  set<const SMDS_MeshElement*> s3;
  set<const SMDS_MeshElement*>::iterator it = s1->begin();
  while (it != s1->end())
    {
      addChildrenWithNodes(s3, *it, *s2);
      s3.insert(*it);
      it++;
    }
  if (elem->GetType() != SMDSAbs_Node)
    s3.insert(elem);

  // remove finite and construction elements
  it = s3.begin();
  while (it != s3.end())
    {
      // Remove element from <InverseElements> of its nodes
      SMDS_ElemIteratorPtr itn = (*it)->nodesIterator();
      while (itn->more())
        {
          SMDS_MeshNode * n = static_cast<SMDS_MeshNode *> (const_cast<SMDS_MeshElement *> (itn->next()));
          n->RemoveInverseElement((*it));
        }
      int IdToRemove = (*it)->GetID();
      int vtkid = (*it)->getVtkId();
      //MESSAGE("elem Id to remove " << IdToRemove << " vtkid " << vtkid <<
      //        " vtktype " << (*it)->GetVtkType() << " type " << (*it)->GetType());
      switch ((*it)->GetType())
      {
        case SMDSAbs_Node:
          MYASSERT("Internal Error: This should not happen")
          ;
          break;
        case SMDSAbs_0DElement:
          if (IdToRemove >= 0)
            {
              myCells[IdToRemove] = 0; // -PR- ici ou dans myElementIDFactory->ReleaseID ?
              myInfo.remove(*it);
            }
          removedElems.push_back((*it));
          myElementIDFactory->ReleaseID(IdToRemove, vtkid);
          delete (*it);
          break;
        case SMDSAbs_Edge:
          if (IdToRemove >= 0)
            {
              myCells[IdToRemove] = 0;
              myInfo.RemoveEdge(*it);
            }
          removedElems.push_back((*it));
          myElementIDFactory->ReleaseID(IdToRemove, vtkid);
          if (const SMDS_VtkEdge* vtkElem = dynamic_cast<const SMDS_VtkEdge*>(*it))
            myEdgePool->destroy((SMDS_VtkEdge*) vtkElem);
          else
            delete (*it);
          break;
        case SMDSAbs_Face:
          if (IdToRemove >= 0)
            {
              myCells[IdToRemove] = 0;
              myInfo.RemoveFace(*it);
            }
          removedElems.push_back((*it));
          myElementIDFactory->ReleaseID(IdToRemove, vtkid);
          if (const SMDS_VtkFace* vtkElem = dynamic_cast<const SMDS_VtkFace*>(*it))
            myFacePool->destroy((SMDS_VtkFace*) vtkElem);
          else
            delete (*it);
          break;
        case SMDSAbs_Volume:
          if (IdToRemove >= 0)
            {
              myCells[IdToRemove] = 0;
              myInfo.RemoveVolume(*it);
            }
          removedElems.push_back((*it));
          myElementIDFactory->ReleaseID(IdToRemove, vtkid);
          if (const SMDS_VtkVolume* vtkElem = dynamic_cast<const SMDS_VtkVolume*>(*it))
            myVolumePool->destroy((SMDS_VtkVolume*) vtkElem);
          else
            delete (*it);
          break;
      }
      if (vtkid >= 0)
        {
          //MESSAGE("VTK_EMPTY_CELL in " << vtkid);
          this->myGrid->GetCellTypesArray()->SetValue(vtkid, VTK_EMPTY_CELL);
        }
      it++;
    }

  // remove exclusive (free) nodes
  if (removenodes)
    {
      it = s2->begin();
      while (it != s2->end())
        {
          int IdToRemove = (*it)->GetID();
          //MESSAGE( "SMDS: RM node " << IdToRemove);
          if (IdToRemove >= 0)
            {
              myNodes[IdToRemove] = 0;
              myInfo.myNbNodes--;
            }
          myNodeIDFactory->ReleaseID((*it)->GetID(), (*it)->getVtkId());
          removedNodes.push_back((*it));
          if (const SMDS_MeshNode* vtkElem = dynamic_cast<const SMDS_MeshNode*>(*it))
          {
            ((SMDS_MeshNode*)vtkElem)->SetPosition(SMDS_SpacePosition::originSpacePosition());
            myNodePool->destroy((SMDS_MeshNode*) vtkElem);
          }
          else
            delete (*it);
          it++;
        }
    }

  delete s2;
  delete s1;
}
void SMDS_Mesh::RemoveElement ( const SMDS_MeshElement elem,
bool  removenodes = false 
) [virtual, inherited]
Parameters:
elemThe element to delete
removenodesif true remaining nodes will be removed

Definition at line 2980 of file SMDS_Mesh.cxx.

References SMDS_Mesh.RemoveElement().

{
  list<const SMDS_MeshElement *> removedElems;
  list<const SMDS_MeshElement *> removedNodes;
  RemoveElement( elem, removedElems, removedNodes, removenodes );
}
void SMESHDS_Mesh::RemoveElement ( const SMDS_MeshElement elt)

Definition at line 801 of file SMESHDS_Mesh.cxx.

References SMDS_MeshElement.GetID(), SMDS_MeshElement.GetType(), SMDS_Mesh.hasConstructionEdges(), SMDS_Mesh.hasConstructionFaces(), myGroups, myScript, myShapeIndexToSubMesh, SMESHDS_Script.RemoveElement(), RemoveFreeElement(), removeFromContainers(), RemoveNode(), and SMDSAbs_Node.

Referenced by clearSubMesh(), SMESH_MeshEditor.DeleteDiag(), SMESH_MeshEditor.InsertNodesIntoLink(), SMESH_Gen_i.Load(), SMESH_MeshEditor.QuadToTri(), SMESH.SMESH_Group.Remove(), RemoveNode(), StdMeshers_MEFISTO_2D.StoreResult(), and SMESH_MeshEditor.UpdateVolumes().

{
  if (elt->GetType() == SMDSAbs_Node)
  {
    RemoveNode( static_cast<const SMDS_MeshNode*>( elt ));
    return;
  }
  if (!hasConstructionEdges() && !hasConstructionFaces())
  {
    SMESHDS_SubMesh* subMesh=0;
    map<int,SMESHDS_SubMesh*>::iterator SubIt = myShapeIndexToSubMesh.begin();
    for ( ; !subMesh && SubIt != myShapeIndexToSubMesh.end(); SubIt++ )
      if (!SubIt->second->IsComplexSubmesh() && SubIt->second->Contains( elt ))
        subMesh = SubIt->second;
    //MESSAGE("subMesh " << elt->getshapeId());
    RemoveFreeElement( elt, subMesh, true);
    return;
  }
 
  myScript->RemoveElement(elt->GetID());

  list<const SMDS_MeshElement *> removedElems;
  list<const SMDS_MeshElement *> removedNodes;

  SMDS_Mesh::RemoveElement(elt, removedElems, removedNodes, false);
  
  removeFromContainers( myShapeIndexToSubMesh, myGroups, removedElems, false );
}
void SMDS_Mesh::RemoveFace ( const SMDS_MeshFace face) [virtual, inherited]

Remove an face and all the elements which own this face.

Definition at line 1581 of file SMDS_Mesh.cxx.

References MESSAGE, and SMDS_Mesh.RemoveElement().

{
    MESSAGE("RemoveFace");
        RemoveElement(face, true);
}
void SMDS_Mesh::RemoveFreeElement ( const SMDS_MeshElement elem) [virtual, inherited]

Remove only the given element and only if it is free.

Method does not work for meshes with descendants. Implemented for fast cleaning of meshes.

Parameters:
elemThe element to delete

Definition at line 3150 of file SMDS_Mesh.cxx.

References ObjectPool< X >.destroy(), SMDS_MeshElement.GetID(), SMDS_MeshNode.GetInverseElementIterator(), SMDS_MeshElement.GetType(), SMDS_MeshElement.getVtkId(), SMDS_Mesh.hasConstructionEdges(), SMDS_Mesh.hasConstructionFaces(), SMDS_Mesh.myCells, SMDS_Mesh.myEdgePool, SMDS_Mesh.myElementIDFactory, SMDS_Mesh.myFacePool, SMDS_Mesh.myGrid, SMDS_Mesh.myInfo, SMDS_MeshInfo.myNbNodes, SMDS_Mesh.myNodeIDFactory, SMDS_Mesh.myNodePool, SMDS_Mesh.myNodes, SMDS_Mesh.myVolumePool, SMDS_MeshElement.nodesIterator(), SMDS_SpacePosition.originSpacePosition(), SMDS_MeshElementIDFactory.ReleaseID(), SMDS_MeshNodeIDFactory.ReleaseID(), SMDS_MeshInfo.remove(), SMDS_MeshInfo.RemoveEdge(), SMDS_MeshInfo.RemoveFace(), SMDS_MeshNode.RemoveInverseElement(), SMDS_MeshInfo.RemoveVolume(), SMDSAbs_0DElement, SMDSAbs_Edge, SMDSAbs_Face, SMDSAbs_Node, and SMDSAbs_Volume.

{
  int elemId = elem->GetID();
  int vtkId = elem->getVtkId();
  //MESSAGE("RemoveFreeElement " << elemId);
  SMDSAbs_ElementType aType = elem->GetType();
  SMDS_MeshElement* todest = (SMDS_MeshElement*)(elem);
  if (aType == SMDSAbs_Node) {
    //MESSAGE("Remove free node " << elemId);
    // only free node can be removed by this method
    const SMDS_MeshNode* n = static_cast<SMDS_MeshNode*>(todest);
    SMDS_ElemIteratorPtr itFe = n->GetInverseElementIterator();
    if (!itFe->more()) { // free node
      myNodes[elemId] = 0;
      myInfo.myNbNodes--;
      ((SMDS_MeshNode*) n)->SetPosition(SMDS_SpacePosition::originSpacePosition());
      myNodePool->destroy(static_cast<SMDS_MeshNode*>(todest));
      myNodeIDFactory->ReleaseID(elemId, vtkId);
    }
  } else {
    if (hasConstructionEdges() || hasConstructionFaces())
      // this methods is only for meshes without descendants
      return;

    //MESSAGE("Remove free element " << elemId);
    // Remove element from <InverseElements> of its nodes
    SMDS_ElemIteratorPtr itn = elem->nodesIterator();
    while (itn->more()) {
      SMDS_MeshNode * n = static_cast<SMDS_MeshNode *>
        (const_cast<SMDS_MeshElement *>(itn->next()));
      n->RemoveInverseElement(elem);
    }

    // in meshes without descendants elements are always free
     switch (aType) {
    case SMDSAbs_0DElement:
      myCells[elemId] = 0;
      myInfo.remove(elem);
      delete elem;
      break;
    case SMDSAbs_Edge:
      myCells[elemId] = 0;
      myInfo.RemoveEdge(elem);
      myEdgePool->destroy(static_cast<SMDS_VtkEdge*>(todest));
      break;
    case SMDSAbs_Face:
      myCells[elemId] = 0;
      myInfo.RemoveFace(elem);
      myFacePool->destroy(static_cast<SMDS_VtkFace*>(todest));
      break;
    case SMDSAbs_Volume:
      myCells[elemId] = 0;
      myInfo.RemoveVolume(elem);
      myVolumePool->destroy(static_cast<SMDS_VtkVolume*>(todest));
      break;
    default:
      break;
    }
    myElementIDFactory->ReleaseID(elemId, vtkId);

    this->myGrid->GetCellTypesArray()->SetValue(vtkId, VTK_EMPTY_CELL);
    // --- to do: keep vtkid in a list of reusable cells
  }
}
void SMESHDS_Mesh::RemoveFreeElement ( const SMDS_MeshElement elt,
SMESHDS_SubMesh subMesh,
bool  fromGroups = true 
)

Definition at line 834 of file SMESHDS_Mesh.cxx.

References SMDS_MeshElement.GetID(), SMDS_MeshElement.GetType(), ex21_lamp.group, SMDS_Mesh.hasConstructionEdges(), SMDS_Mesh.hasConstructionFaces(), SMESHDS_Group.IsEmpty(), myGroups, myScript, SMDS_MeshGroup.Remove(), SMESHDS_SubMesh.RemoveElement(), SMESHDS_Script.RemoveElement(), RemoveFreeNode(), SMDSAbs_Node, and SMESHDS_Group.SMDSGroup().

Referenced by cleanSubMesh(), SMESH_MeshEditor.ConvertToQuadratic(), RemoveElement(), RemoveFreeNode(), SMESH_MeshEditor.removeQuadElem(), SMESH_ProxyMesh.removeTmpElement(), and SMESH_ProxyMesh.~SMESH_ProxyMesh().

{
  //MESSAGE(" --------------------------------> SMESHDS_Mesh::RemoveFreeElement " << subMesh << " " << fromGroups);
  if (elt->GetType() == SMDSAbs_Node) {
    RemoveFreeNode( static_cast<const SMDS_MeshNode*>(elt), subMesh);
    return;
  }

  if (hasConstructionEdges() || hasConstructionFaces())
    // this methods is only for meshes without descendants
    return;

  myScript->RemoveElement(elt->GetID());

  // Rm from group
  // Node can belong to several groups
  if ( fromGroups && !myGroups.empty() ) {
    set<SMESHDS_GroupBase*>::iterator GrIt = myGroups.begin();
    for (; GrIt != myGroups.end(); GrIt++) {
      SMESHDS_Group* group = dynamic_cast<SMESHDS_Group*>(*GrIt);
      if (group && !group->IsEmpty())
        group->SMDSGroup().Remove(elt);
    }
  }

  // Rm from sub-mesh
  // Element should belong to only one sub-mesh
  if( subMesh )
    subMesh->RemoveElement(elt, /*deleted=*/false);

  SMDS_Mesh::RemoveFreeElement(elt);
}
void SMESHDS_Mesh::RemoveFreeNode ( const SMDS_MeshNode n,
SMESHDS_SubMesh subMesh,
bool  fromGroups = true 
)

Remove only the given element/node and only if it is free.

Methods do not work for meshes with descendants. Implemented for fast cleaning of meshes.

Definition at line 772 of file SMESHDS_Mesh.cxx.

References SMDS_MeshElement.GetID(), ex21_lamp.group, SMESHDS_Group.IsEmpty(), myGroups, myScript, SMDS_MeshGroup.Remove(), RemoveFreeElement(), SMESHDS_SubMesh.RemoveNode(), SMESHDS_Script.RemoveNode(), and SMESHDS_Group.SMDSGroup().

Referenced by cleanSubMesh(), RemoveFreeElement(), RemoveNode(), and SMESH_MeshEditor.removeQuadElem().

{
  myScript->RemoveNode(n->GetID());

  // Rm from group
  // Node can belong to several groups
  if (fromGroups && !myGroups.empty()) {
    set<SMESHDS_GroupBase*>::iterator GrIt = myGroups.begin();
    for (; GrIt != myGroups.end(); GrIt++) {
      SMESHDS_Group* group = dynamic_cast<SMESHDS_Group*>(*GrIt);
      if (!group || group->IsEmpty()) continue;
      group->SMDSGroup().Remove(n);
    }
  }

  // Rm from sub-mesh
  // Node should belong to only one sub-mesh
  if( subMesh )
    subMesh->RemoveNode(n,/*deleted=*/false);

  SMDS_Mesh::RemoveFreeElement(n);
}
bool SMDS_Mesh::RemoveFromParent ( ) [virtual, inherited]

Definition at line 1602 of file SMDS_Mesh.cxx.

References SMDS_Mesh.myParent, and SMDS_Mesh.RemoveSubMesh().

{
        if (myParent==NULL) return false;
        else return (myParent->RemoveSubMesh(this));
}
void SMESHDS_Mesh.RemoveGroup ( SMESHDS_GroupBase theGroup)

Definition at line 441 of file SMESHDS_Mesh.hxx.

{ myGroups.erase(theGroup); }
bool SMESHDS_Mesh::RemoveHypothesis ( const TopoDS_Shape &  S,
const SMESHDS_Hypothesis H 
)

Definition at line 167 of file SMESHDS_Mesh.cxx.

References myShapeToHypothesis.

Referenced by SMESH_subMesh.AlgoStateEngine().

{
  if( myShapeToHypothesis.IsBound( S.Oriented(TopAbs_FORWARD) ) )
  {
    list<const SMESHDS_Hypothesis *>& alist=myShapeToHypothesis.ChangeFind( S.Oriented(TopAbs_FORWARD) );
    list<const SMESHDS_Hypothesis*>::iterator ith=find(alist.begin(),alist.end(), H );
    if (ith != alist.end())
    {
      alist.erase(ith);
      return true;
    }
  }
  return false;
}
void SMESHDS_Mesh::RemoveNode ( const SMDS_MeshNode node) [virtual]

Remove a node and all the elements which own this node.

Reimplemented from SMDS_Mesh.

Definition at line 738 of file SMESHDS_Mesh.cxx.

References SMDS_MeshElement.GetID(), SMDS_MeshElement.getshapeId(), SMDS_Mesh.hasConstructionEdges(), SMDS_Mesh.hasConstructionFaces(), myGroups, myScript, myShapeIndexToSubMesh, SMDS_MeshNode.NbInverseElements(), RemoveElement(), RemoveFreeNode(), removeFromContainers(), and SMESHDS_Script.RemoveNode().

Referenced by cleanSubMesh(), clearSubMesh(), SMESH.SMESH_Gen.Compute(), _QuadFaceGrid.LoadGrid(), SMESH.SMESH_Group.Remove(), and RemoveElement().

{
  if ( n->NbInverseElements() == 0 && !(hasConstructionEdges() || hasConstructionFaces()))
  {
    SMESHDS_SubMesh* subMesh=0;
    map<int,SMESHDS_SubMesh*>::iterator SubIt =
      myShapeIndexToSubMesh.find( n->getshapeId() );
    if ( SubIt != myShapeIndexToSubMesh.end() )
      subMesh = SubIt->second;
    else
      SubIt = myShapeIndexToSubMesh.begin();
    for ( ; !subMesh && SubIt != myShapeIndexToSubMesh.end(); SubIt++ )
      if (!SubIt->second->IsComplexSubmesh() && SubIt->second->Contains( n ))
        subMesh = SubIt->second;

    RemoveFreeNode( n, subMesh, true);
    return;
  }
    
  myScript->RemoveNode(n->GetID());
  
  list<const SMDS_MeshElement *> removedElems;
  list<const SMDS_MeshElement *> removedNodes;

  SMDS_Mesh::RemoveElement( n, removedElems, removedNodes, true );

  removeFromContainers( myShapeIndexToSubMesh, myGroups, removedElems, false );
  removeFromContainers( myShapeIndexToSubMesh, myGroups, removedNodes, true );
}
bool SMDS_Mesh::RemoveSubMesh ( const SMDS_Mesh aMesh) [virtual, inherited]

Definition at line 1613 of file SMDS_Mesh.cxx.

References SMDS_Mesh.myChildren, and SMESH_test4.submesh.

Referenced by SMDS_Mesh.RemoveFromParent().

{
        bool found = false;

        list<SMDS_Mesh *>::iterator itmsh=myChildren.begin();
        for (; itmsh!=myChildren.end() && !found; itmsh++)
        {
                SMDS_Mesh * submesh = *itmsh;
                if (submesh == aMesh)
                {
                        found = true;
                        myChildren.erase(itmsh);
                }
        }

        return found;
}
void SMDS_Mesh::RemoveVolume ( const SMDS_MeshVolume volume) [virtual, inherited]

Remove a volume.

Definition at line 1591 of file SMDS_Mesh.cxx.

References MESSAGE, and SMDS_Mesh.RemoveElement().

{
    MESSAGE("RemoveVolume");
        RemoveElement(volume, true);
}
void SMESHDS_Mesh::Renumber ( const bool  isNodes,
const int  startID = 1,
const int  deltaID = 1 
) [virtual]

Reimplemented from SMDS_Mesh.

Definition at line 273 of file SMESHDS_Mesh.cxx.

References compactMesh(), and SMDS_Mesh.isCompacted().

{
  // TODO not possible yet to have node numbers not starting to O and continuous.
  if (!this->isCompacted())
    this->compactMesh();
//  SMDS_Mesh::Renumber( isNodes, startID, deltaID );
//  myScript->Renumber( isNodes, startID, deltaID );
}
void SMDS_Mesh::setConstructionEdges ( bool  b) [inherited]

Make this mesh creating construction edges (see hasConstructionEdges)

Parameters:
btrue to have construction edges, else false.

Definition at line 2558 of file SMDS_Mesh.cxx.

References SMDS_Mesh.myHasConstructionEdges.

void SMDS_Mesh::setConstructionFaces ( bool  b) [inherited]

Make this mesh creating construction faces (see hasConstructionFaces)

Parameters:
btrue to have construction faces, else false.

Definition at line 2567 of file SMDS_Mesh.cxx.

References SMDS_Mesh.myHasConstructionFaces.

void SMDS_Mesh::setInverseElements ( bool  b) [inherited]

Make this mesh creating link from nodes to elements (see hasInverseElements)

Parameters:
btrue to link nodes to elements, else false.

Definition at line 2576 of file SMDS_Mesh.cxx.

References MESSAGE, and SMDS_Mesh.myHasInverseElements.

{
  if(!b) MESSAGE("Error : inverseElement=false not implemented");
  myHasInverseElements=b;
}
void SMESHDS_Mesh::SetMeshElementOnShape ( const SMDS_MeshElement anElt,
const TopoDS_Shape &  S 
)
void SMESHDS_Mesh::SetMeshElementOnShape ( const SMDS_MeshElement anElt,
int  Index 
)

Definition at line 1330 of file SMESHDS_Mesh.cxx.

References add(), and getSubmesh().

{
  add( anElement, getSubmesh( Index ));
}
void SMDS_Mesh.setMyModified ( ) [inherited]
void SMESHDS_Mesh::SetNodeInVolume ( const SMDS_MeshNode aNode,
int  Index 
)

Definition at line 1284 of file SMESHDS_Mesh.cxx.

References add(), getSubmesh(), and SMDS_SpacePosition.originSpacePosition().

{
  //add(aNode, getSubmesh(Index));
  if ( add( aNode, getSubmesh( Index )))
    ((SMDS_MeshNode*) aNode)->SetPosition( SMDS_SpacePosition::originSpacePosition());
}
void SMESHDS_Mesh::SetNodeInVolume ( SMDS_MeshNode aNode,
const TopoDS_Shell &  S 
)
void SMESHDS_Mesh::SetNodeInVolume ( SMDS_MeshNode aNode,
const TopoDS_Solid &  S 
)
void SMESHDS_Mesh::SetNodeOnEdge ( SMDS_MeshNode aNode,
const TopoDS_Edge &  S,
double  u = 0. 
)
void SMESHDS_Mesh::SetNodeOnEdge ( SMDS_MeshNode aNode,
int  Index,
double  u = 0. 
)

Definition at line 1306 of file SMESHDS_Mesh.cxx.

References add(), getSubmesh(), and SMDS_MeshNode.SetPosition().

{
  //Set Position on Node
  if ( add( aNode, getSubmesh( Index )))
    aNode->SetPosition(SMDS_PositionPtr(new SMDS_EdgePosition(u)));
}
void SMESHDS_Mesh::SetNodeOnFace ( SMDS_MeshNode aNode,
int  Index,
double  u = 0.,
double  v = 0. 
)

Definition at line 1295 of file SMESHDS_Mesh.cxx.

References add(), getSubmesh(), and SMDS_MeshNode.SetPosition().

{
  //Set Position on Node
  if ( add( aNode, getSubmesh( Index )))
    aNode->SetPosition(SMDS_PositionPtr(new SMDS_FacePosition( u, v)));
}
void SMESHDS_Mesh::SetNodeOnFace ( SMDS_MeshNode aNode,
const TopoDS_Face &  S,
double  u = 0.,
double  v = 0. 
)
void SMESHDS_Mesh::SetNodeOnVertex ( SMDS_MeshNode aNode,
int  Index 
)

Definition at line 1319 of file SMESHDS_Mesh.cxx.

References add(), getSubmesh(), and SMDS_MeshNode.SetPosition().

{
  //Set Position on Node
  if ( add( aNode, getSubmesh( Index )))
    aNode->SetPosition(SMDS_PositionPtr(new SMDS_VertexPosition()));
}
void SMESHDS_Mesh::SetNodeOnVertex ( SMDS_MeshNode aNode,
const TopoDS_Vertex &  S 
)
void SMESHDS_Mesh::SetPersistentId ( int  id)

Store ID persistent during lifecycle.

Definition at line 80 of file SMESHDS_Mesh.cxx.

References myPersistentID, and SMDS_Mesh.NbNodes().

Referenced by SMESHDS_Mesh().

{
  if (NbNodes() == 0)
    myPersistentID = id;
}
int SMESHDS_Mesh::ShapeToIndex ( const TopoDS_Shape &  aShape) const
void SMESHDS_Mesh::ShapeToMesh ( const TopoDS_Shape &  S)

Definition at line 100 of file SMESHDS_Mesh.cxx.

References myGroups, myIndexToShape, myShape, myShapeIndexToSubMesh, and myShapeToHypothesis.

Referenced by SMESH_Mesh_i.CheckGeomGroupModif(), SMESH_Pattern.createElements(), SMESH_MeshEditor.FindShape(), SMESH_Gen_i.GetMeshOrSubmeshByShape(), SMESH_Gen_i.Save(), and SMESH_Mesh.SMESH_Mesh().

{
  if ( !myShape.IsNull() && S.IsNull() )
  {
    // removal of a shape to mesh, delete ...
    // - hypotheses
    myShapeToHypothesis.Clear();
    // - shape indices in SMDS_Position of nodes
    map<int,SMESHDS_SubMesh*>::iterator i_sub = myShapeIndexToSubMesh.begin();
    for ( ; i_sub != myShapeIndexToSubMesh.end(); i_sub++ ) {
      if ( !i_sub->second->IsComplexSubmesh() ) {
        SMDS_NodeIteratorPtr nIt = i_sub->second->GetNodes();
        while ( nIt->more() )
          i_sub->second->RemoveNode(nIt->next(), false);
      }
    }
    // - sub-meshes
    TShapeIndexToSubMesh::iterator i_sm = myShapeIndexToSubMesh.begin();
    for ( ; i_sm != myShapeIndexToSubMesh.end(); ++i_sm )
      delete i_sm->second;
    myShapeIndexToSubMesh.clear();
    myIndexToShape.Clear();
    // - groups on geometry
    set<SMESHDS_GroupBase*>::iterator gr = myGroups.begin();
    while ( gr != myGroups.end() ) {
      if ( dynamic_cast<SMESHDS_GroupOnGeom*>( *gr ))
        myGroups.erase( gr++ );
      else
        gr++;
    }
  }
  else {
    myShape = S;
    if ( !S.IsNull() )
      TopExp::MapShapes(myShape, myIndexToShape);
  }
}
TopoDS_Shape SMESHDS_Mesh::ShapeToMesh ( ) const

Set geometry to be meshed.

Definition at line 158 of file SMESH_Mesh.cxx.

References MESSAGE, and MYDEBUG.

{
  if(MYDEBUG) MESSAGE("SMESH_Mesh::ShapeToMesh");

  if ( !aShape.IsNull() && _isShapeToMesh ) {
    if ( aShape.ShapeType() != TopAbs_COMPOUND && // group contents is allowed to change
         _myMeshDS->ShapeToMesh().ShapeType() != TopAbs_COMPOUND )
      throw SALOME_Exception(LOCALIZED ("a shape to mesh has already been defined"));
  }
  // clear current data
  if ( !_myMeshDS->ShapeToMesh().IsNull() )
  {
    // removal of a shape to mesh, delete objects referring to sub-shapes:
    // - sub-meshes
    map <int, SMESH_subMesh *>::iterator i_sm = _mapSubMesh.begin();
    for ( ; i_sm != _mapSubMesh.end(); ++i_sm )
      delete i_sm->second;
    _mapSubMesh.clear();
    //  - groups on geometry
    map <int, SMESH_Group *>::iterator i_gr = _mapGroup.begin();
    while ( i_gr != _mapGroup.end() ) {
      if ( dynamic_cast<SMESHDS_GroupOnGeom*>( i_gr->second->GetGroupDS() )) {
        _myMeshDS->RemoveGroup( i_gr->second->GetGroupDS() );
        delete i_gr->second;
        _mapGroup.erase( i_gr++ );
      }
      else
        i_gr++;
    }
    _mapAncestors.Clear();

    // clear SMESHDS
    TopoDS_Shape aNullShape;
    _myMeshDS->ShapeToMesh( aNullShape );

    _shapeDiagonal = 0.0;
  }

  // set a new geometry
  if ( !aShape.IsNull() )
  {
    _myMeshDS->ShapeToMesh(aShape);
    _isShapeToMesh = true;
    _nbSubShapes = _myMeshDS->MaxShapeIndex();

    // fill map of ancestors
    fillAncestorsMap(aShape);
  }
  else
  {
    _isShapeToMesh = false;
    _shapeDiagonal = 0.0;
    _myMeshDS->ShapeToMesh( PseudoShape() );
  }
  _isModified = false;
}
const std::map<int,SMESHDS_SubMesh*>& SMESHDS_Mesh.SubMeshes ( ) const

Definition at line 420 of file SMESHDS_Mesh.hxx.

Referenced by DriverMED_W_SMESHDS_Mesh.Perform(), and SMESH_Gen_i.Save().

  { return myShapeIndexToSubMesh; }
list< int > SMESHDS_Mesh::SubMeshIndices ( ) const

Definition at line 1121 of file SMESHDS_Mesh.cxx.

References myShapeIndexToSubMesh.

{
  list<int> anIndices;
  std::map<int,SMESHDS_SubMesh*>::const_iterator anIter = myShapeIndexToSubMesh.begin();
  for (; anIter != myShapeIndexToSubMesh.end(); anIter++) {
    anIndices.push_back((*anIter).first);
  }
  return anIndices;
}
void SMESHDS_Mesh::UnSetMeshElementOnShape ( const SMDS_MeshElement anElt,
const TopoDS_Shape &  S 
)

Definition at line 1049 of file SMESHDS_Mesh.cxx.

References SMDS_MeshElement.GetType(), myIndexToShape, myShapeIndexToSubMesh, and SMDSAbs_Node.

{
  int Index = myIndexToShape.FindIndex(S);

  map<int,SMESHDS_SubMesh*>::iterator it = myShapeIndexToSubMesh.find( Index );
  if ( it != myShapeIndexToSubMesh.end() )
    {
      if (elem->GetType() == SMDSAbs_Node)
        it->second->RemoveNode(static_cast<const SMDS_MeshNode*> (elem), /*deleted=*/false);
      else
        it->second->RemoveElement(elem, /*deleted=*/false);
    }
}
void SMESHDS_Mesh::UnSetNodeOnShape ( const SMDS_MeshNode aNode)

Definition at line 1024 of file SMESHDS_Mesh.cxx.

References SMDS_MeshElement.getshapeId(), and myShapeIndexToSubMesh.

{
  int shapeId = aNode->getshapeId();
  if (shapeId >= 0)
    {
      map<int, SMESHDS_SubMesh*>::iterator it = myShapeIndexToSubMesh.find(shapeId);
      if (it != myShapeIndexToSubMesh.end())
        it->second->RemoveNode(aNode, /*deleted=*/false);
    }
}
void SMDS_Mesh::updateBoundingBox ( ) [inherited]

Definition at line 4195 of file SMDS_Mesh.cxx.

References SMDS_UnstructuredGrid.GetPoints(), SMDS_Mesh.myGrid, SMDS_Mesh.myNodes, SMDS_Mesh.xmax, SMDS_Mesh.xmin, SMDS_Mesh.ymax, SMDS_Mesh.ymin, SMDS_Mesh.zmax, and SMDS_Mesh.zmin.

{
  xmin = 0; xmax = 0;
  ymin = 0; ymax = 0;
  zmin = 0; zmax = 0;
  vtkPoints *points = myGrid->GetPoints();
  int myNodesSize = this->myNodes.size();
  for (int i = 0; i < myNodesSize; i++)
    {
      if (SMDS_MeshNode *n = myNodes[i])
        {
          double coords[3];
          points->GetPoint(n->myVtkID, coords);
          if (coords[0] < xmin) xmin = coords[0];
          else if (coords[0] > xmax) xmax = coords[0];
          if (coords[1] < ymin) ymin = coords[1];
          else if (coords[1] > ymax) ymax = coords[1];
          if (coords[2] < zmin) zmin = coords[2];
          else if (coords[2] > zmax) zmax = coords[2];
        }
    }
}
void SMDS_Mesh::updateNodeMinMax ( ) [inherited]

Definition at line 4092 of file SMDS_Mesh.cxx.

References SMDS_Mesh.myNodeMax, SMDS_Mesh.myNodeMin, and SMDS_Mesh.myNodes.

Referenced by SMDS_MeshNodeIDFactory.updateMinMax().

{
  myNodeMin = 0;
  if (myNodes.size() == 0)
  {
        myNodeMax=0;
        return;
  }
  while (!myNodes[myNodeMin] && (myNodeMin<myNodes.size()))
    myNodeMin++;
  myNodeMax=myNodes.size()-1;
  while (!myNodes[myNodeMax] && (myNodeMin>=0))
    myNodeMin--;
}
SMDS_VolumeIteratorPtr SMDS_Mesh::volumesIterator ( bool  idInceasingOrder = false) const [inherited]

Return an iterator on volumes of the current mesh.

Definition at line 2780 of file SMDS_Mesh.cxx.

References SMDS_Mesh.myCells, and SMDSAbs_Volume.

Referenced by SMESH_MEDMesh_i.calculeNbElts(), SMDS_Mesh.Contains(), SMESH_MeshEditor.ConvertToQuadratic(), SMDS_Mesh.DumpVolumes(), DriverSTL_W_SMDS_Mesh.findVolumeTriangles(), SMESH.Controls.Filter.GetElementsId(), SMESH.Filter_i.GetMeshInfo(), SMESH.SMESH_MeshEditor.Make2DMeshFrom3D(), DriverMED_W_SMESHDS_Mesh.Perform(), and SMESH.Controls.ElementsOnShape.process().

{
  typedef MYElem_Map_Iterator
    < SetOfCells, const SMDS_MeshVolume*, SMDS_VolumeIterator > TIterator;
  return SMDS_VolumeIteratorPtr(new TIterator(myCells, SMDSAbs_Volume)); // naturally always sorted by ID

  //  typedef MYNCollection_Map_Iterator
//    < SetOfVolumes, const SMDS_MeshVolume*, SMDS_VolumeIterator > TIterator;
//  typedef IdSortedIterator< const SMDS_MeshVolume* >              TSortedIterator;
//  return ( idInceasingOrder ?
//           SMDS_VolumeIteratorPtr( new TSortedIterator( *myElementIDFactory,
//                                                        SMDSAbs_Volume,
//                                                        NbVolumes() )) :
//           SMDS_VolumeIteratorPtr(new TIterator(myVolumes)));
}

Friends And Related Function Documentation

friend class SMDS_MeshElementIDFactory [friend, inherited]

Definition at line 62 of file SMDS_Mesh.hxx.

friend class SMDS_MeshIDFactory [friend, inherited]

Definition at line 60 of file SMDS_Mesh.hxx.

friend class SMDS_MeshNode [friend, inherited]

Definition at line 64 of file SMDS_Mesh.hxx.

friend class SMDS_MeshNodeIDFactory [friend, inherited]

Definition at line 61 of file SMDS_Mesh.hxx.

friend class SMDS_MeshVolumeVtkNodes [friend, inherited]

Definition at line 63 of file SMDS_Mesh.hxx.


Field Documentation

vector< SMDS_Mesh * > SMDS_Mesh::_meshList = vector<SMDS_Mesh*>() [static, inherited]

to retreive this SMDS_Mesh instance from its elements (index stored in SMDS_Elements)

Definition at line 69 of file SMDS_Mesh.hxx.

Referenced by SMDS_MeshNode.AddInverseElement(), SMDS_VtkFace.ChangeApex(), SMDS_VtkVolume.ChangeNodes(), SMDS_VtkFace.ChangeNodes(), SMDS_VtkEdge.ChangeNodes(), SMDS_MeshNode.ClearInverseElements(), SMDS_VtkVolume.elementsIterator(), SMDS_VtkFace.elementsIterator(), SMDS_VtkEdge.elementsIterator(), SMDS_MeshNode.elementsIterator(), SMDS_MeshNode.emptyInverseElements(), SMDS_MeshNode.getCoord(), SMDS_VtkVolume.GetEntityType(), SMDS_VtkFace.GetEntityType(), SMDS_VtkVolume.GetFaceNode(), SMDS_MeshNode.GetInverseElementIterator(), SMDS_VtkVolume.GetQuantities(), SMDS_VolumeTool.GetSize(), SMESH.Controls.AspectRatio3D.GetValue(), SMDS_VtkVolume.GetVtkType(), SMDS_VtkFace.GetVtkType(), SMDS_MeshNode.init(), SMDS_VtkVolume.interlacedNodesElemIterator(), SMDS_VtkFace.interlacedNodesElemIterator(), SMDS_VtkEdge.interlacedNodesElemIterator(), SMDS_VtkVolume.IsMediumNode(), SMDS_VtkFace.IsMediumNode(), SMDS_VtkEdge.IsMediumNode(), SMDS_VtkVolume.IsPoly(), SMDS_VtkFace.IsPoly(), SMDS_VtkVolume.IsQuadratic(), SMDS_VtkFace.IsQuadratic(), SMDS_VtkVolume.NbEdges(), SMDS_VtkFace.NbEdges(), SMDS_VtkVolume.NbFaceNodes(), SMDS_VtkVolume.NbFaces(), SMDS_MeshNode.NbInverseElements(), SMDS_VtkVolume.NbNodes(), SMDS_VtkFace.NbNodes(), SMDS_VtkEdge.NbNodes(), SMDS_VtkVolume.NbUniqueNodes(), SMDS_VtkVolume.nodesIteratorToUNV(), SMDS_VtkFace.nodesIteratorToUNV(), SMDS_VtkEdge.nodesIteratorToUNV(), SMDS_MeshNode.RemoveInverseElement(), SMDS_MeshNode.setXYZ(), SMDS_Mesh.SMDS_Mesh(), SMESH_Gen.SMESH_Gen(), SMDS_VtkVolume.uniqueNodesIterator(), and SMDS_VtkVolume.vtkOrder().

int SMDS_Mesh::chunkSize = 1024 [static, inherited]
std::vector<int> SMDS_Mesh.myCellIdVtkToSmds [protected, inherited]
SetOfCells SMDS_Mesh.myCells [protected, inherited]
std::list<SMDS_Mesh *> SMDS_Mesh.myChildren [protected, inherited]
unsigned long SMDS_Mesh.myCompactTime [protected, inherited]

Definition at line 678 of file SMDS_Mesh.hxx.

Referenced by SMDS_Mesh.isCompacted().

Definition at line 493 of file SMESHDS_Mesh.hxx.

Referenced by getSubmesh().

Definition at line 495 of file SMESHDS_Mesh.hxx.

Referenced by getSubmesh(), and SMESHDS_Mesh().

TopoDS_Shape SMESHDS_Mesh.myCurSubShape [private]

Definition at line 494 of file SMESHDS_Mesh.hxx.

Referenced by getSubmesh().

ObjectPool<SMDS_VtkEdge>* SMDS_Mesh.myEdgePool [protected, inherited]
ObjectPool<SMDS_VtkFace>* SMDS_Mesh.myFacePool [protected, inherited]
SMDS_UnstructuredGrid* SMDS_Mesh.myGrid [protected, inherited]
bool SMDS_Mesh.myHasConstructionEdges [protected, inherited]
bool SMDS_Mesh.myHasConstructionFaces [protected, inherited]
bool SMDS_Mesh.myHasInverseElements [protected, inherited]

Definition at line 685 of file SMDS_Mesh.hxx.

Referenced by SMDS_Mesh.hasInverseElements(), and SMDS_Mesh.setInverseElements().

TopTools_IndexedMapOfShape SMESHDS_Mesh.myIndexToShape [private]
SMDS_MeshInfo SMDS_Mesh.myInfo [protected, inherited]

Definition at line 486 of file SMESHDS_Mesh.hxx.

Referenced by IsEmbeddedMode().

Definition at line 474 of file SMESHDS_Mesh.hxx.

int SMDS_Mesh.myMeshId [protected, inherited]

index of this SMDS_mesh in the static vector<SMDS_Mesh*> _meshList

Definition at line 646 of file SMDS_Mesh.hxx.

Referenced by SMDS_Mesh.AddNodeWithID(), SMDS_Mesh.registerElement(), and SMDS_Mesh.SMDS_Mesh().

bool SMDS_Mesh.myModified [protected, inherited]

any add, remove or change of node or cell

Definition at line 688 of file SMDS_Mesh.hxx.

Referenced by SMDS_Mesh.AddNodeWithID(), SMDS_Mesh.Clear(), and SMDS_Mesh.Modified().

unsigned long SMDS_Mesh.myModifTime [protected, inherited]

use a counter to keep track of modifications

Definition at line 678 of file SMDS_Mesh.hxx.

Referenced by SMDS_Mesh.GetMTime(), SMDS_Mesh.isCompacted(), and SMDS_Mesh.Modified().

int SMDS_Mesh.myNodeMax [protected, inherited]

Definition at line 681 of file SMDS_Mesh.hxx.

Referenced by SMDS_Mesh.MaxNodeID(), and SMDS_Mesh.updateNodeMinMax().

int SMDS_Mesh.myNodeMin [protected, inherited]

Definition at line 680 of file SMDS_Mesh.hxx.

Referenced by SMDS_Mesh.MinNodeID(), and SMDS_Mesh.updateNodeMinMax().

ObjectPool<SMDS_MeshNode>* SMDS_Mesh.myNodePool [protected, inherited]

Small objects like SMDS_MeshNode are allocated by chunks to limit memory costs of new.

Definition at line 652 of file SMDS_Mesh.hxx.

Referenced by SMDS_Mesh.AddNodeWithID(), SMDS_Mesh.Clear(), SMDS_Mesh.RemoveElement(), SMDS_Mesh.RemoveFreeElement(), and SMDS_Mesh.SMDS_Mesh().

SetOfNodes SMDS_Mesh.myNodes [protected, inherited]
SMDS_Mesh* SMDS_Mesh.myParent [protected, inherited]

Definition at line 474 of file SMESHDS_Mesh.hxx.

Referenced by GetPersistentId(), and SetPersistentId().

TopoDS_Shape SMESHDS_Mesh.myShape [private]

Definition at line 475 of file SMESHDS_Mesh.hxx.

Referenced by AddCompoundSubmesh(), HasMeshElements(), ShapeToIndex(), and ShapeToMesh().

Small objects like SMDS_VtkVolume are allocated by chunks to limit memory costs of new.

Definition at line 655 of file SMDS_Mesh.hxx.

Referenced by SMDS_Mesh.AddVolumeFromVtkIdsWithID(), SMDS_Mesh.AddVolumeWithID(), SMDS_Mesh.Clear(), SMDS_Mesh.RemoveElement(), SMDS_Mesh.RemoveFreeElement(), and SMDS_Mesh.SMDS_Mesh().

double SMDS_Mesh.xmax [protected, inherited]
double SMDS_Mesh.xmin [protected, inherited]
double SMDS_Mesh.ymax [protected, inherited]
double SMDS_Mesh.ymin [protected, inherited]
double SMDS_Mesh.zmax [protected, inherited]
double SMDS_Mesh.zmin [protected, inherited]
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS