SALOME - SMESH
SMESH_Mesh Class Reference

#include <SMESH_Mesh.hxx>

Collaboration diagram for SMESH_Mesh:
Collaboration graph

Public Types

typedef TopTools_IndexedDataMapOfShapeListOfShape TAncestorMap
 Return data map of descendant to ancestor shapes. More...
 
typedef boost::shared_ptr< SMDS_Iterator< SMESH_Group * > > GroupIteratorPtr
 

Public Member Functions

 SMESH_Mesh (int theLocalId, int theStudyId, SMESH_Gen *theGen, bool theIsEmbeddedMode, SMESHDS_Document *theDocument)
 
virtual ~SMESH_Mesh ()
 
void ShapeToMesh (const TopoDS_Shape &aShape)
 Set geometry to be meshed. More...
 
TopoDS_Shape GetShapeToMesh () const
 Return geometry to be meshed. (It may be a PseudoShape()!) More...
 
bool HasShapeToMesh () const
 Return true if there is a geometry to be meshed, not PseudoShape() More...
 
double GetShapeDiagonalSize () const
 Return diagonal size of bounding box of shape to mesh. More...
 
void Clear ()
 Remove all nodes and elements. More...
 
void ClearSubMesh (const int theShapeId)
 Remove all nodes and elements of indicated shape. More...
 
int UNVToMesh (const char *theFileName)
 
int MEDToMesh (const char *theFileName, const char *theMeshName)
 
int STLToMesh (const char *theFileName)
 
int DATToMesh (const char *theFileName)
 
SMESH_Hypothesis::Hypothesis_Status AddHypothesis (const TopoDS_Shape &aSubShape, int anHypId) throw ( SMESH_Exception )
 
SMESH_Hypothesis::Hypothesis_Status RemoveHypothesis (const TopoDS_Shape &aSubShape, int anHypId) throw ( SMESH_Exception )
 
const std::list< const SMESHDS_Hypothesis *> & GetHypothesisList (const TopoDS_Shape &aSubShape) const throw ( SMESH_Exception )
 
const SMESH_HypothesisGetHypothesis (const TopoDS_Shape &aSubShape, const SMESH_HypoFilter &aFilter, const bool andAncestors, TopoDS_Shape *assignedTo=0) const
 
int GetHypotheses (const TopoDS_Shape &aSubShape, const SMESH_HypoFilter &aFilter, std::list< const SMESHDS_Hypothesis * > &aHypList, const bool andAncestors) const
 
const std::list< SMESHDS_Command * > & GetLog () throw ( SMESH_Exception )
 
void ClearLog () throw ( SMESH_Exception )
 
int GetId ()
 
SMESHDS_MeshGetMeshDS ()
 
SMESH_GenGetGen ()
 
SMESH_subMeshGetSubMesh (const TopoDS_Shape &aSubShape) throw ( SMESH_Exception )
 
SMESH_subMeshGetSubMeshContaining (const TopoDS_Shape &aSubShape) const throw ( SMESH_Exception )
 
SMESH_subMeshGetSubMeshContaining (const int aShapeID) const throw ( SMESH_Exception )
 
std::list< SMESH_subMesh * > GetGroupSubMeshesContaining (const TopoDS_Shape &shape) const throw ( SMESH_Exception )
 Return submeshes of groups containing the given subshape. More...
 
void NotifySubMeshesHypothesisModification (const SMESH_Hypothesis *theChangedHyp)
 Say all submeshes that theChangedHyp has been modified. More...
 
const std::list< SMESH_subMesh *> & GetSubMeshUsingHypothesis (SMESHDS_Hypothesis *anHyp) throw ( SMESH_Exception )
 
bool IsUsedHypothesis (SMESHDS_Hypothesis *anHyp, const SMESH_subMesh *aSubMesh)
 Return True if anHyp is used to mesh aSubShape. More...
 
bool IsNotConformAllowed () const
 check if a hypothesis alowing notconform mesh is present More...
 
bool IsMainShape (const TopoDS_Shape &theShape) const
 
const TopTools_ListOfShape & GetAncestors (const TopoDS_Shape &theSubShape) const
 Return list of ancestors of theSubShape in the order that lower dimention shapes come first. More...
 
void SetAutoColor (bool theAutoColor) throw ( SMESH_Exception )
 
bool GetAutoColor () throw ( SMESH_Exception )
 
const TAncestorMapGetAncestorMap () const
 
bool HasDuplicatedGroupNamesMED ()
 Check group names for duplications. Consider maximum group name length stored in MED file. More...
 
void ExportMED (const char *file, const char *theMeshName=NULL, bool theAutoGroups=true, int theVersion=0) throw ( SMESH_Exception )
 
void ExportDAT (const char *file) throw ( SMESH_Exception )
 
void ExportUNV (const char *file) throw ( SMESH_Exception )
 
void ExportSTL (const char *file, const bool isascii) throw ( SMESH_Exception )
 
int NbNodes () throw ( SMESH_Exception )
 
int Nb0DElements () throw ( SMESH_Exception )
 
int NbEdges (SMDSAbs_ElementOrder order=ORDER_ANY) throw ( SMESH_Exception )
 
int NbFaces (SMDSAbs_ElementOrder order=ORDER_ANY) throw ( SMESH_Exception )
 
int NbTriangles (SMDSAbs_ElementOrder order=ORDER_ANY) throw ( SMESH_Exception )
 
int NbQuadrangles (SMDSAbs_ElementOrder order=ORDER_ANY) throw ( SMESH_Exception )
 
int NbPolygons () throw ( SMESH_Exception )
 
int NbVolumes (SMDSAbs_ElementOrder order=ORDER_ANY) throw ( SMESH_Exception )
 
int NbTetras (SMDSAbs_ElementOrder order=ORDER_ANY) throw ( SMESH_Exception )
 
int NbHexas (SMDSAbs_ElementOrder order=ORDER_ANY) throw ( SMESH_Exception )
 
int NbPyramids (SMDSAbs_ElementOrder order=ORDER_ANY) throw ( SMESH_Exception )
 
int NbPrisms (SMDSAbs_ElementOrder order=ORDER_ANY) throw ( SMESH_Exception )
 
int NbPolyhedrons () throw ( SMESH_Exception )
 
int NbSubMesh () throw ( SMESH_Exception )
 
int NbGroup () const
 
SMESH_GroupAddGroup (const SMDSAbs_ElementType theType, const char *theName, int &theId, const TopoDS_Shape &theShape=TopoDS_Shape())
 
GroupIteratorPtr GetGroups () const
 
std::list< intGetGroupIds () const
 
SMESH_GroupGetGroup (const int theGroupID)
 
void RemoveGroup (const int theGroupID)
 
SMESH_GroupConvertToStandalone (int theGroupID)
 
SMDSAbs_ElementType GetElementType (const int id, const bool iselem)
 
ostream & Dump (ostream &save)
 

Static Public Member Functions

static double GetShapeDiagonalSize (const TopoDS_Shape &aShape)
 Return diagonal size of bounding box of a shape. More...
 
static const TopoDS_Solid & PseudoShape ()
 Return a solid which is returned by GetShapeToMesh() if a real geometry to be meshed was not set. More...
 

Protected Member Functions

 SMESH_Mesh ()
 
 SMESH_Mesh (const SMESH_Mesh &)
 

Protected Attributes

int _id
 
int _studyId
 
int _idDoc
 
int _groupId
 
int _nbSubShapes
 
bool _isShapeToMesh
 
std::list< SMESH_subMesh * > _subMeshesUsingHypothesisList
 
SMESHDS_Document_myDocument
 
SMESHDS_Mesh_myMeshDS
 
std::map< int, SMESH_subMesh * > _mapSubMesh
 
std::map< int, SMESH_Group * > _mapGroup
 
SMESH_Gen_gen
 
bool _isAutoColor
 
double _shapeDiagonal
 diagonal size of bounding box of shape to mesh More...
 
TopTools_IndexedDataMapOfShapeListOfShape _mapAncestors
 

Detailed Description

Definition at line 54 of file SMESH_Mesh.hxx.

Member Typedef Documentation

◆ TAncestorMap

typedef TopTools_IndexedDataMapOfShapeListOfShape SMESH_Mesh::TAncestorMap

Return data map of descendant to ancestor shapes.

Definition at line 187 of file SMESH_Mesh.hxx.

◆ GroupIteratorPtr

typedef boost::shared_ptr< SMDS_Iterator<SMESH_Group*> > SMESH_Mesh::GroupIteratorPtr

Definition at line 240 of file SMESH_Mesh.hxx.

Constructor & Destructor Documentation

◆ SMESH_Mesh() [1/3]

SMESH_Mesh::SMESH_Mesh ( int  theLocalId,
int  theStudyId,
SMESH_Gen theGen,
bool  theIsEmbeddedMode,
SMESHDS_Document theDocument 
)

◆ ~SMESH_Mesh()

virtual SMESH_Mesh::~SMESH_Mesh ( )
virtual

◆ SMESH_Mesh() [2/3]

SMESH_Mesh::SMESH_Mesh ( )
protected

Definition at line 280 of file SMESH_Mesh.hxx.

◆ SMESH_Mesh() [3/3]

SMESH_Mesh::SMESH_Mesh ( const SMESH_Mesh )
protected

Definition at line 281 of file SMESH_Mesh.hxx.

Member Function Documentation

◆ ShapeToMesh()

void SMESH_Mesh::ShapeToMesh ( const TopoDS_Shape &  aShape)

Set geometry to be meshed.

◆ GetShapeToMesh()

TopoDS_Shape SMESH_Mesh::GetShapeToMesh ( ) const

Return geometry to be meshed. (It may be a PseudoShape()!)

◆ HasShapeToMesh()

bool SMESH_Mesh::HasShapeToMesh ( ) const

Return true if there is a geometry to be meshed, not PseudoShape()

Definition at line 76 of file SMESH_Mesh.hxx.

◆ GetShapeDiagonalSize() [1/2]

double SMESH_Mesh::GetShapeDiagonalSize ( ) const

Return diagonal size of bounding box of shape to mesh.

◆ GetShapeDiagonalSize() [2/2]

static double SMESH_Mesh::GetShapeDiagonalSize ( const TopoDS_Shape &  aShape)
static

Return diagonal size of bounding box of a shape.

◆ PseudoShape()

static const TopoDS_Solid& SMESH_Mesh::PseudoShape ( )
static

Return a solid which is returned by GetShapeToMesh() if a real geometry to be meshed was not set.

◆ Clear()

void SMESH_Mesh::Clear ( )

Remove all nodes and elements.

◆ ClearSubMesh()

void SMESH_Mesh::ClearSubMesh ( const int  theShapeId)

Remove all nodes and elements of indicated shape.

◆ UNVToMesh()

int SMESH_Mesh::UNVToMesh ( const char *  theFileName)

◆ MEDToMesh()

int SMESH_Mesh::MEDToMesh ( const char *  theFileName,
const char *  theMeshName 
)

consult DriverMED_R_SMESHDS_Mesh::ReadStatus for returned value

◆ STLToMesh()

int SMESH_Mesh::STLToMesh ( const char *  theFileName)

◆ DATToMesh()

int SMESH_Mesh::DATToMesh ( const char *  theFileName)

◆ AddHypothesis()

SMESH_Hypothesis::Hypothesis_Status SMESH_Mesh::AddHypothesis ( const TopoDS_Shape &  aSubShape,
int  anHypId 
)
throw (SMESH_Exception
)

◆ RemoveHypothesis()

SMESH_Hypothesis::Hypothesis_Status SMESH_Mesh::RemoveHypothesis ( const TopoDS_Shape &  aSubShape,
int  anHypId 
)
throw (SMESH_Exception
)

◆ GetHypothesisList()

const std::list<const SMESHDS_Hypothesis * >& SMESH_Mesh::GetHypothesisList ( const TopoDS_Shape &  aSubShape) const
throw (SMESH_Exception
)

◆ GetHypothesis()

const SMESH_Hypothesis* SMESH_Mesh::GetHypothesis ( const TopoDS_Shape &  aSubShape,
const SMESH_HypoFilter aFilter,
const bool  andAncestors,
TopoDS_Shape *  assignedTo = 0 
) const

◆ GetHypotheses()

int SMESH_Mesh::GetHypotheses ( const TopoDS_Shape &  aSubShape,
const SMESH_HypoFilter aFilter,
std::list< const SMESHDS_Hypothesis * > &  aHypList,
const bool  andAncestors 
) const

◆ GetLog()

const std::list<SMESHDS_Command*>& SMESH_Mesh::GetLog ( )
throw (SMESH_Exception
)

◆ ClearLog()

void SMESH_Mesh::ClearLog ( )
throw (SMESH_Exception
)

◆ GetId()

int SMESH_Mesh::GetId ( )

Definition at line 137 of file SMESH_Mesh.hxx.

◆ GetMeshDS()

SMESHDS_Mesh* SMESH_Mesh::GetMeshDS ( )

Definition at line 139 of file SMESH_Mesh.hxx.

◆ GetGen()

SMESH_Gen* SMESH_Mesh::GetGen ( )

Definition at line 141 of file SMESH_Mesh.hxx.

◆ GetSubMesh()

SMESH_subMesh* SMESH_Mesh::GetSubMesh ( const TopoDS_Shape &  aSubShape)
throw (SMESH_Exception
)

◆ GetSubMeshContaining() [1/2]

SMESH_subMesh* SMESH_Mesh::GetSubMeshContaining ( const TopoDS_Shape &  aSubShape) const
throw (SMESH_Exception
)

◆ GetSubMeshContaining() [2/2]

SMESH_subMesh* SMESH_Mesh::GetSubMeshContaining ( const int  aShapeID) const
throw (SMESH_Exception
)

◆ GetGroupSubMeshesContaining()

std::list<SMESH_subMesh*> SMESH_Mesh::GetGroupSubMeshesContaining ( const TopoDS_Shape &  shape) const
throw (SMESH_Exception
)

Return submeshes of groups containing the given subshape.

◆ NotifySubMeshesHypothesisModification()

void SMESH_Mesh::NotifySubMeshesHypothesisModification ( const SMESH_Hypothesis theChangedHyp)

Say all submeshes that theChangedHyp has been modified.

◆ GetSubMeshUsingHypothesis()

const std::list< SMESH_subMesh * >& SMESH_Mesh::GetSubMeshUsingHypothesis ( SMESHDS_Hypothesis anHyp)
throw (SMESH_Exception
)

◆ IsUsedHypothesis()

bool SMESH_Mesh::IsUsedHypothesis ( SMESHDS_Hypothesis anHyp,
const SMESH_subMesh aSubMesh 
)

Return True if anHyp is used to mesh aSubShape.

◆ IsNotConformAllowed()

bool SMESH_Mesh::IsNotConformAllowed ( ) const

check if a hypothesis alowing notconform mesh is present

◆ IsMainShape()

bool SMESH_Mesh::IsMainShape ( const TopoDS_Shape &  theShape) const

◆ GetAncestors()

const TopTools_ListOfShape& SMESH_Mesh::GetAncestors ( const TopoDS_Shape &  theSubShape) const

Return list of ancestors of theSubShape in the order that lower dimention shapes come first.

◆ SetAutoColor()

void SMESH_Mesh::SetAutoColor ( bool  theAutoColor)
throw (SMESH_Exception
)

◆ GetAutoColor()

bool SMESH_Mesh::GetAutoColor ( )
throw (SMESH_Exception
)

◆ GetAncestorMap()

const TAncestorMap& SMESH_Mesh::GetAncestorMap ( ) const

Definition at line 188 of file SMESH_Mesh.hxx.

◆ HasDuplicatedGroupNamesMED()

bool SMESH_Mesh::HasDuplicatedGroupNamesMED ( )

Check group names for duplications. Consider maximum group name length stored in MED file.

◆ ExportMED()

void SMESH_Mesh::ExportMED ( const char *  file,
const char *  theMeshName = NULL,
bool  theAutoGroups = true,
int  theVersion = 0 
)
throw (SMESH_Exception
)

◆ ExportDAT()

void SMESH_Mesh::ExportDAT ( const char *  file)
throw (SMESH_Exception
)

◆ ExportUNV()

void SMESH_Mesh::ExportUNV ( const char *  file)
throw (SMESH_Exception
)

◆ ExportSTL()

void SMESH_Mesh::ExportSTL ( const char *  file,
const bool  isascii 
)
throw (SMESH_Exception
)

◆ NbNodes()

int SMESH_Mesh::NbNodes ( )
throw (SMESH_Exception
)

◆ Nb0DElements()

int SMESH_Mesh::Nb0DElements ( )
throw (SMESH_Exception
)

◆ NbEdges()

int SMESH_Mesh::NbEdges ( SMDSAbs_ElementOrder  order = ORDER_ANY)
throw (SMESH_Exception
)

◆ NbFaces()

int SMESH_Mesh::NbFaces ( SMDSAbs_ElementOrder  order = ORDER_ANY)
throw (SMESH_Exception
)

◆ NbTriangles()

int SMESH_Mesh::NbTriangles ( SMDSAbs_ElementOrder  order = ORDER_ANY)
throw (SMESH_Exception
)

◆ NbQuadrangles()

int SMESH_Mesh::NbQuadrangles ( SMDSAbs_ElementOrder  order = ORDER_ANY)
throw (SMESH_Exception
)

◆ NbPolygons()

int SMESH_Mesh::NbPolygons ( )
throw (SMESH_Exception
)

◆ NbVolumes()

int SMESH_Mesh::NbVolumes ( SMDSAbs_ElementOrder  order = ORDER_ANY)
throw (SMESH_Exception
)

◆ NbTetras()

int SMESH_Mesh::NbTetras ( SMDSAbs_ElementOrder  order = ORDER_ANY)
throw (SMESH_Exception
)

◆ NbHexas()

int SMESH_Mesh::NbHexas ( SMDSAbs_ElementOrder  order = ORDER_ANY)
throw (SMESH_Exception
)

◆ NbPyramids()

int SMESH_Mesh::NbPyramids ( SMDSAbs_ElementOrder  order = ORDER_ANY)
throw (SMESH_Exception
)

◆ NbPrisms()

int SMESH_Mesh::NbPrisms ( SMDSAbs_ElementOrder  order = ORDER_ANY)
throw (SMESH_Exception
)

◆ NbPolyhedrons()

int SMESH_Mesh::NbPolyhedrons ( )
throw (SMESH_Exception
)

◆ NbSubMesh()

int SMESH_Mesh::NbSubMesh ( )
throw (SMESH_Exception
)

◆ NbGroup()

int SMESH_Mesh::NbGroup ( ) const

Definition at line 233 of file SMESH_Mesh.hxx.

◆ AddGroup()

SMESH_Group* SMESH_Mesh::AddGroup ( const SMDSAbs_ElementType  theType,
const char *  theName,
int theId,
const TopoDS_Shape &  theShape = TopoDS_Shape() 
)

◆ GetGroups()

GroupIteratorPtr SMESH_Mesh::GetGroups ( ) const

◆ GetGroupIds()

std::list<int> SMESH_Mesh::GetGroupIds ( ) const

◆ GetGroup()

SMESH_Group* SMESH_Mesh::GetGroup ( const int  theGroupID)

◆ RemoveGroup()

void SMESH_Mesh::RemoveGroup ( const int  theGroupID)

◆ ConvertToStandalone()

SMESH_Group* SMESH_Mesh::ConvertToStandalone ( int  theGroupID)

◆ GetElementType()

SMDSAbs_ElementType SMESH_Mesh::GetElementType ( const int  id,
const bool  iselem 
)

◆ Dump()

ostream& SMESH_Mesh::Dump ( ostream &  save)

Field Documentation

◆ _id

int SMESH_Mesh::_id
protected

Definition at line 260 of file SMESH_Mesh.hxx.

◆ _studyId

int SMESH_Mesh::_studyId
protected

Definition at line 261 of file SMESH_Mesh.hxx.

◆ _idDoc

int SMESH_Mesh::_idDoc
protected

Definition at line 262 of file SMESH_Mesh.hxx.

◆ _groupId

int SMESH_Mesh::_groupId
protected

Definition at line 263 of file SMESH_Mesh.hxx.

◆ _nbSubShapes

int SMESH_Mesh::_nbSubShapes
protected

Definition at line 264 of file SMESH_Mesh.hxx.

◆ _isShapeToMesh

bool SMESH_Mesh::_isShapeToMesh
protected

Definition at line 265 of file SMESH_Mesh.hxx.

◆ _subMeshesUsingHypothesisList

std::list<SMESH_subMesh*> SMESH_Mesh::_subMeshesUsingHypothesisList
protected

Definition at line 266 of file SMESH_Mesh.hxx.

◆ _myDocument

SMESHDS_Document* SMESH_Mesh::_myDocument
protected

Definition at line 267 of file SMESH_Mesh.hxx.

◆ _myMeshDS

SMESHDS_Mesh* SMESH_Mesh::_myMeshDS
protected

Definition at line 268 of file SMESH_Mesh.hxx.

◆ _mapSubMesh

std::map<int, SMESH_subMesh*> SMESH_Mesh::_mapSubMesh
protected

Definition at line 269 of file SMESH_Mesh.hxx.

◆ _mapGroup

std::map<int, SMESH_Group*> SMESH_Mesh::_mapGroup
protected

Definition at line 270 of file SMESH_Mesh.hxx.

◆ _gen

SMESH_Gen* SMESH_Mesh::_gen
protected

Definition at line 271 of file SMESH_Mesh.hxx.

◆ _isAutoColor

bool SMESH_Mesh::_isAutoColor
protected

Definition at line 273 of file SMESH_Mesh.hxx.

◆ _shapeDiagonal

double SMESH_Mesh::_shapeDiagonal
protected

diagonal size of bounding box of shape to mesh

Definition at line 275 of file SMESH_Mesh.hxx.

◆ _mapAncestors

TopTools_IndexedDataMapOfShapeListOfShape SMESH_Mesh::_mapAncestors
protected

Definition at line 277 of file SMESH_Mesh.hxx.