Version: 8.3.0
SMESH_Gen Class Reference

#include <SMESH_Gen.hxx>

Data Structures

struct  TAlgoStateError
 

Public Types

enum  ComputeFlags { SHAPE_ONLY = 1, UPWARD = 2, COMPACT_MESH = 4, SHAPE_ONLY_UPWARD = 3 }
 

Public Member Functions

 SMESH_Gen ()
 Constructor. More...
 
 ~SMESH_Gen ()
 Destructor. More...
 
SMESH_MeshCreateMesh (int theStudyId, bool theIsEmbeddedMode) throw (SALOME_Exception)
 Creates a mesh in a study. More...
 
bool Compute (::SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, const int aFlags=COMPACT_MESH, const ::MeshDimension aDim=::MeshDim_3D, TSetOfInt *aShapesId=0)
 Computes aMesh on aShape. More...
 
void PrepareCompute (::SMESH_Mesh &aMesh, const TopoDS_Shape &aShape)
 Prepare Compute a mesh. More...
 
void CancelCompute (::SMESH_Mesh &aMesh, const TopoDS_Shape &aShape)
 
const SMESH_subMeshGetCurrentSubMesh () const
 Returns a sub-mesh being currently computed. More...
 
bool Evaluate (::SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, MapShapeNbElems &aResMap, const bool anUpward=false, TSetOfInt *aShapesId=0)
 evaluates size of prospective mesh on a shape More...
 
bool CheckAlgoState (SMESH_Mesh &aMesh, const TopoDS_Shape &aShape)
 
void SetBoundaryBoxSegmentation (int theNbSegments)
 Sets number of segments per diagonal of boundary box of geometry by which default segment length of appropriate 1D hypotheses is defined. More...
 
int GetBoundaryBoxSegmentation () const
 
void SetDefaultNbSegments (int nb)
 Sets default number of segments per edge. More...
 
int GetDefaultNbSegments () const
 
bool GetAlgoState (SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, std::list< SMESH_Gen::TAlgoStateError > &theErrors)
 
StudyContextStructGetStudyContext (int studyId)
 Returns StudyContextStruct for a study. More...
 
SMESH_AlgoGetAlgo (SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, TopoDS_Shape *assignedTo=0)
 
SMESH_AlgoGetAlgo (SMESH_subMesh *aSubMesh, TopoDS_Shape *assignedTo=0)
 
int GetANewId ()
 Genarate a new id unique within this Gen. More...
 

Static Public Member Functions

static int GetShapeDim (const TopAbs_ShapeEnum &aShapeType)
 Return shape dimension by TopAbs_ShapeEnum. More...
 
static int GetShapeDim (const TopoDS_Shape &aShape)
 
static bool IsGlobalHypothesis (const SMESH_Hypothesis *theHyp, SMESH_Mesh &aMesh)
 
static std::vector< std::string > GetPluginXMLPaths ()
 Return paths to xml files of plugins. More...
 

Private Member Functions

void setCurrentSubMesh (SMESH_subMesh *sm)
 Sets a sub-mesh being currently computed. More...
 
void resetCurrentSubMesh ()
 

Private Attributes

int _localId
 
std::map< int,
StudyContextStruct * > 
_mapStudyContext
 
int _hypId
 
int _segmentation
 
int _nbSegments
 
volatile bool _compute_canceled
 
std::list< SMESH_subMesh * > _sm_current
 

Member Enumeration Documentation

Enumerator
SHAPE_ONLY 
UPWARD 
COMPACT_MESH 
SHAPE_ONLY_UPWARD 

Constructor & Destructor Documentation

SMESH_Gen::SMESH_Gen ( )

Constructor.

References SMDS_Mesh::_meshList.

SMESH_Gen::~SMESH_Gen ( )

Member Function Documentation

void SMESH_Gen::CancelCompute ( ::SMESH_Mesh aMesh,
const TopoDS_Shape &  aShape 
)
bool SMESH_Gen::CheckAlgoState ( SMESH_Mesh aMesh,
const TopoDS_Shape &  aShape 
)
bool SMESH_Gen::Compute ( ::SMESH_Mesh aMesh,
const TopoDS_Shape &  aShape,
const int  aFlags = COMPACT_MESH,
const ::MeshDimension  aDim = ::MeshDim_3D,
TSetOfInt aShapesId = 0 
)

Computes aMesh on aShape.

Parameters
aMesh- the mesh.
aShape- the shape.
aFlags- ComputeFlags. By default compute the whole mesh and compact at the end.
aDim- upper level dimension of the mesh computation (for preview)
aShapesId- list of shapes with computed mesh entities (elements or nodes)
Return values
bool- true if none sub-mesh failed to compute
SMESH_Mesh * SMESH_Gen::CreateMesh ( int  theStudyId,
bool  theIsEmbeddedMode 
) throw (SALOME_Exception)

Creates a mesh in a study.

if (theIsEmbeddedMode) { mesh modification commands are not logged }

References studyContextStruct::mapMesh, and studyContextStruct::myDocument.

bool SMESH_Gen::Evaluate ( ::SMESH_Mesh aMesh,
const TopoDS_Shape &  aShape,
MapShapeNbElems aResMap,
const bool  anUpward = false,
TSetOfInt aShapesId = 0 
)

evaluates size of prospective mesh on a shape

Parameters
aMesh- the mesh
aShape- the shape
aResMap- map for prospective numbers of elements
Return values
bool- is a success
SMESH_Algo* SMESH_Gen::GetAlgo ( SMESH_Mesh aMesh,
const TopoDS_Shape &  aShape,
TopoDS_Shape *  assignedTo = 0 
)
SMESH_Algo* SMESH_Gen::GetAlgo ( SMESH_subMesh aSubMesh,
TopoDS_Shape *  assignedTo = 0 
)
bool SMESH_Gen::GetAlgoState ( SMESH_Mesh aMesh,
const TopoDS_Shape &  aShape,
std::list< SMESH_Gen::TAlgoStateError > &  theErrors 
)
int SMESH_Gen::GetBoundaryBoxSegmentation ( ) const
const SMESH_subMesh * SMESH_Gen::GetCurrentSubMesh ( ) const

Returns a sub-mesh being currently computed.

int SMESH_Gen::GetDefaultNbSegments ( ) const
std::vector< std::string > SMESH_Gen::GetPluginXMLPaths ( )
static

Return paths to xml files of plugins.

Referenced by _pyHypothesisReader::_pyHypothesisReader(), and SMESH_Algo::GetFeatures().

static int SMESH_Gen::GetShapeDim ( const TopoDS_Shape &  aShape)
static

References GetShapeDim().

Referenced by GetShapeDim().

StudyContextStruct * SMESH_Gen::GetStudyContext ( int  studyId)

Returns StudyContextStruct for a study.

References studyContextStruct::myDocument.

bool SMESH_Gen::IsGlobalHypothesis ( const SMESH_Hypothesis theHyp,
SMESH_Mesh aMesh 
)
static
void SMESH_Gen::PrepareCompute ( ::SMESH_Mesh aMesh,
const TopoDS_Shape &  aShape 
)

Prepare Compute a mesh.

void SMESH_Gen::resetCurrentSubMesh ( )
private
void SMESH_Gen::SetBoundaryBoxSegmentation ( int  theNbSegments)

Sets number of segments per diagonal of boundary box of geometry by which default segment length of appropriate 1D hypotheses is defined.

void SMESH_Gen::setCurrentSubMesh ( SMESH_subMesh sm)
private

Sets a sub-mesh being currently computed.

An algorithm can call Compute() for a sub-shape, hence we keep a stack of sub-meshes

void SMESH_Gen::SetDefaultNbSegments ( int  nb)

Sets default number of segments per edge.

Field Documentation

volatile bool SMESH_Gen::_compute_canceled
private
int SMESH_Gen::_hypId
private
int SMESH_Gen::_localId
private
std::map< int, StudyContextStruct * > SMESH_Gen::_mapStudyContext
private
int SMESH_Gen::_nbSegments
private
int SMESH_Gen::_segmentation
private
std::list< SMESH_subMesh* > SMESH_Gen::_sm_current
private