SALOME - SMESH
SMESH_3D_Algo Class Referenceabstract

#include <SMESH_3D_Algo.hxx>

Inheritance diagram for SMESH_3D_Algo:
Inheritance graph
Collaboration diagram for SMESH_3D_Algo:
Collaboration graph

Public Types

enum  Hypothesis_Status {
  HYP_OK = 0, HYP_MISSING, HYP_CONCURENT, HYP_BAD_PARAMETER,
  HYP_HIDDEN_ALGO, HYP_HIDING_ALGO, HYP_UNKNOWN_FATAL, HYP_INCOMPATIBLE,
  HYP_NOTCONFORM, HYP_ALREADY_EXIST, HYP_BAD_DIM, HYP_BAD_SUBSHAPE,
  HYP_BAD_GEOMETRY, HYP_NEED_SHAPE
}
 
enum  hypothesis_type {
  PARAM_ALGO, ALGO_0D, ALGO_1D, ALGO_2D,
  ALGO_3D
}
 

Public Member Functions

 SMESH_3D_Algo (int hypId, int studyId, SMESH_Gen *gen)
 
virtual ~SMESH_3D_Algo ()
 
virtual std::ostream & SaveTo (std::ostream &save)
 Saves nothing in a stream. More...
 
virtual std::istream & LoadFrom (std::istream &load)
 Loads nothing from a stream. More...
 
const std::vector< std::string > & GetCompatibleHypothesis ()
 Returns all types of compatible hypotheses. More...
 
virtual bool CheckHypothesis (SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, SMESH_Hypothesis::Hypothesis_Status &aStatus)=0
 Check hypothesis definition to mesh a shape. More...
 
virtual bool Compute (SMESH_Mesh &aMesh, const TopoDS_Shape &aShape)=0
 Computes mesh on a shape. More...
 
virtual bool Compute (SMESH_Mesh &aMesh, SMESH_MesherHelper *aHelper)
 Computes mesh without geometry. More...
 
virtual bool Evaluate (SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, MapShapeNbElems &aResMap)=0
 evaluates size of prospective mesh on a shape More...
 
virtual const std::list< const SMESHDS_Hypothesis * > & GetUsedHypothesis (SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, const bool ignoreAuxiliary=true)
 Returns a list of compatible hypotheses used to mesh a shape. More...
 
const std::list< const SMESHDS_Hypothesis * > & GetAppliedHypothesis (SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, const bool ignoreAuxiliary=true)
 Returns a list of compatible hypotheses assigned to a shape in a mesh. More...
 
bool InitCompatibleHypoFilter (SMESH_HypoFilter &theFilter, const bool ignoreAuxiliary) const
 Make the filter recognize only compatible hypotheses. More...
 
virtual bool SetParametersByMesh (const SMESH_Mesh *theMesh, const TopoDS_Shape &theShape)
 Just return false as the algorithm does not hold parameters values. More...
 
virtual bool SetParametersByDefaults (const TDefaults &dflts, const SMESH_Mesh *theMesh=0)
 Initialize my parameter values by default parameters. More...
 
SMESH_ComputeErrorPtr GetComputeError () const
 return compute error More...
 
void InitComputeError ()
 initialize compute error More...
 
bool OnlyUnaryInput () const
 
bool NeedDescretBoundary () const
 
bool NeedShape () const
 
bool SupportSubmeshes () const
 
virtual void SetEventListener (SMESH_subMesh *subMesh)
 Sets event listener to submeshes if necessary. More...
 
virtual void SubmeshRestored (SMESH_subMesh *subMesh)
 Allow algo to do something after persistent restoration. More...
 
virtual int GetDim () const
 
int GetStudyId () const
 
virtual void NotifySubMeshesHypothesisModification ()
 
virtual int GetShapeType () const
 
virtual const char * GetLibName () const
 
void SetLibName (const char *theLibName)
 
void SetParameters (const char *theParameters)
 
char * GetParameters () const
 
void SetLastParameters (const char *theParameters)
 
char * GetLastParameters () const
 
void ClearParameters ()
 
virtual bool IsAuxiliary () const
 Return true if me is an auxiliary hypothesis. More...
 
const char * GetName () const
 
int GetID () const
 
int GetType () const
 

Static Public Member Functions

static bool GetNodeParamOnEdge (const SMESHDS_Mesh *theMesh, const TopoDS_Edge &theEdge, std::vector< double > &theParams)
 Fill vector of node parameters on geometrical edge, including vertex nodes. More...
 
static bool GetSortedNodesOnEdge (const SMESHDS_Mesh *theMesh, const TopoDS_Edge &theEdge, const bool ignoreMediumNodes, std::map< double, const SMDS_MeshNode * > &theNodes)
 Fill map of node parameter on geometrical edge to node it-self. More...
 
static bool IsReversedSubMesh (const TopoDS_Face &theFace, SMESHDS_Mesh *theMeshDS)
 Find out elements orientation on a geometrical face. More...
 
static double EdgeLength (const TopoDS_Edge &E)
 Compute length of an edge. More...
 
static GeomAbs_Shape Continuity (const TopoDS_Edge &E1, const TopoDS_Edge &E2)
 Return continuity of two edges. More...
 
static bool IsContinuous (const TopoDS_Edge &E1, const TopoDS_Edge &E2)
 Return true if an edge can be considered as a continuation of another. More...
 
static const SMDS_MeshNodeVertexNode (const TopoDS_Vertex &V, const SMESHDS_Mesh *meshDS)
 Return the node built on a vertex. More...
 
static bool IsStatusFatal (Hypothesis_Status theStatus)
 

Protected Member Functions

bool error (int error, const SMESH_Comment &comment="")
 store error and comment and then return ( error == COMPERR_OK ) More...
 
bool error (const SMESH_Comment &comment="")
 store COMPERR_ALGO_FAILED error and comment and then return false More...
 
bool error (SMESH_ComputeErrorPtr error)
 store error and return error->IsOK() More...
 
void addBadInputElement (const SMDS_MeshElement *elem)
 store a bad input element preventing computation, which may be a temporary one i.e. not residing the mesh, then it will be deleted by InitComputeError() More...
 

Protected Attributes

std::vector< std::string > _compatibleHypothesis
 
std::list< const SMESHDS_Hypothesis * > _appliedHypList
 
std::list< const SMESHDS_Hypothesis * > _usedHypList
 
bool _onlyUnaryInput
 
bool _requireDescretBoundary
 
bool _requireShape
 
bool _supportSubmeshes
 
bool _quadraticMesh
 
int _error
 SMESH_ComputeErrorName or anything algo specific. More...
 
std::string _comment
 any text explaining what is wrong in Compute() More...
 
std::list< const SMDS_MeshElement * > _badInputElements
 to explain COMPERR_BAD_INPUT_MESH More...
 
SMESH_Gen_gen
 
int _studyId
 
int _shapeType
 
int _param_algo_dim
 
std::string _name
 
int _hypId
 
int _type
 

Detailed Description

Definition at line 35 of file SMESH_3D_Algo.hxx.

Member Enumeration Documentation

◆ Hypothesis_Status

Enumerator
HYP_OK 
HYP_MISSING 
HYP_CONCURENT 
HYP_BAD_PARAMETER 
HYP_HIDDEN_ALGO 
HYP_HIDING_ALGO 
HYP_UNKNOWN_FATAL 
HYP_INCOMPATIBLE 
HYP_NOTCONFORM 
HYP_ALREADY_EXIST 
HYP_BAD_DIM 
HYP_BAD_SUBSHAPE 
HYP_BAD_GEOMETRY 
HYP_NEED_SHAPE 

Definition at line 50 of file SMESH_Hypothesis.hxx.

◆ hypothesis_type

Enumerator
PARAM_ALGO 
ALGO_0D 
ALGO_1D 
ALGO_2D 
ALGO_3D 

Definition at line 49 of file SMESHDS_Hypothesis.hxx.

Constructor & Destructor Documentation

◆ SMESH_3D_Algo()

SMESH_3D_Algo::SMESH_3D_Algo ( int  hypId,
int  studyId,
SMESH_Gen gen 
)

◆ ~SMESH_3D_Algo()

virtual SMESH_3D_Algo::~SMESH_3D_Algo ( )
virtual

Member Function Documentation

◆ SaveTo()

virtual std::ostream& SMESH_Algo::SaveTo ( std::ostream &  save)
virtualinherited

Saves nothing in a stream.

Parameters
save- the stream
Return values
virtualstd::ostream & - the stream

Implements SMESHDS_Hypothesis.

◆ LoadFrom()

virtual std::istream& SMESH_Algo::LoadFrom ( std::istream &  load)
virtualinherited

Loads nothing from a stream.

Parameters
load- the stream
Return values
virtualstd::ostream & - the stream

Implements SMESHDS_Hypothesis.

◆ GetCompatibleHypothesis()

const std::vector< std::string >& SMESH_Algo::GetCompatibleHypothesis ( )
inherited

Returns all types of compatible hypotheses.

◆ CheckHypothesis()

virtual bool SMESH_Algo::CheckHypothesis ( SMESH_Mesh aMesh,
const TopoDS_Shape &  aShape,
SMESH_Hypothesis::Hypothesis_Status aStatus 
)
pure virtualinherited

◆ Compute() [1/2]

virtual bool SMESH_Algo::Compute ( SMESH_Mesh aMesh,
const TopoDS_Shape &  aShape 
)
pure virtualinherited

◆ Compute() [2/2]

virtual bool SMESH_Algo::Compute ( SMESH_Mesh aMesh,
SMESH_MesherHelper aHelper 
)
virtualinherited

Computes mesh without geometry.

Parameters
aMesh- the mesh
aHelper- helper that must be used for adding elements to
Return values
bool- is a success

The method is called if ( !aMesh->HasShapeToMesh() )

Reimplemented in NETGENPlugin_NETGEN_3D.

◆ Evaluate()

virtual bool SMESH_Algo::Evaluate ( SMESH_Mesh aMesh,
const TopoDS_Shape &  aShape,
MapShapeNbElems aResMap 
)
pure virtualinherited

◆ GetUsedHypothesis()

virtual const std::list<const SMESHDS_Hypothesis *>& SMESH_Algo::GetUsedHypothesis ( SMESH_Mesh aMesh,
const TopoDS_Shape &  aShape,
const bool  ignoreAuxiliary = true 
)
virtualinherited

Returns a list of compatible hypotheses used to mesh a shape.

Parameters
aMesh- the mesh
aShape- the shape
ignoreAuxiliary- do not include auxiliary hypotheses in the list
Return values
conststd::list <const SMESHDS_Hypothesis*> - hypotheses list

List the hypothesis used by the algorithm associated to the shape. Hypothesis associated to father shape -are- taken into account (see GetAppliedHypothesis). Relevant hypothesis have a name (type) listed in the algorithm. This method could be surcharged by specific algorithms, in case of several hypothesis simultaneously applicable.

Reimplemented in StdMeshers_Regular_1D.

◆ GetAppliedHypothesis()

const std::list<const SMESHDS_Hypothesis *>& SMESH_Algo::GetAppliedHypothesis ( SMESH_Mesh aMesh,
const TopoDS_Shape &  aShape,
const bool  ignoreAuxiliary = true 
)
inherited

Returns a list of compatible hypotheses assigned to a shape in a mesh.

Parameters
aMesh- the mesh
aShape- the shape
ignoreAuxiliary- do not include auxiliary hypotheses in the list
Return values
conststd::list <const SMESHDS_Hypothesis*> - hypotheses list

List the relevant hypothesis associated to the shape. Relevant hypothesis have a name (type) listed in the algorithm. Hypothesis associated to father shape -are not- taken into account (see GetUsedHypothesis)

◆ InitCompatibleHypoFilter()

bool SMESH_Algo::InitCompatibleHypoFilter ( SMESH_HypoFilter theFilter,
const bool  ignoreAuxiliary 
) const
inherited

Make the filter recognize only compatible hypotheses.

Parameters
theFilter- the filter to initialize
ignoreAuxiliary- make filter ignore compatible auxiliary hypotheses
Return values
bool- true if the algo has compatible hypotheses

◆ SetParametersByMesh()

virtual bool SMESH_Algo::SetParametersByMesh ( const SMESH_Mesh theMesh,
const TopoDS_Shape &  theShape 
)
virtualinherited

Just return false as the algorithm does not hold parameters values.

Implements SMESH_Hypothesis.

◆ SetParametersByDefaults()

virtual bool SMESH_Algo::SetParametersByDefaults ( const TDefaults dflts,
const SMESH_Mesh theMesh = 0 
)
virtualinherited

Initialize my parameter values by default parameters.

Return values
bool- true if parameter values have been successfully defined

Implements SMESH_Hypothesis.

◆ GetComputeError()

SMESH_ComputeErrorPtr SMESH_Algo::GetComputeError ( ) const
inherited

return compute error

◆ InitComputeError()

void SMESH_Algo::InitComputeError ( )
inherited

initialize compute error

◆ OnlyUnaryInput()

bool SMESH_Algo::OnlyUnaryInput ( ) const
inherited

Definition at line 201 of file SMESH_Algo.hxx.

◆ NeedDescretBoundary()

bool SMESH_Algo::NeedDescretBoundary ( ) const
inherited

Definition at line 209 of file SMESH_Algo.hxx.

◆ NeedShape()

bool SMESH_Algo::NeedShape ( ) const
inherited

Definition at line 212 of file SMESH_Algo.hxx.

◆ SupportSubmeshes()

bool SMESH_Algo::SupportSubmeshes ( ) const
inherited

Definition at line 215 of file SMESH_Algo.hxx.

◆ SetEventListener()

virtual void SMESH_Algo::SetEventListener ( SMESH_subMesh subMesh)
virtualinherited

Sets event listener to submeshes if necessary.

Parameters
subMesh- submesh where algo is set

This method is called when a submesh gets HYP_OK algo_state. After being set, event listener is notified on each event of a submesh. By default non listener is set

Reimplemented in StdMeshers_Regular_1D, StdMeshers_Projection_1D, StdMeshers_Projection_2D, StdMeshers_Projection_3D, and StdMeshers_CompositeSegment_1D.

◆ SubmeshRestored()

virtual void SMESH_Algo::SubmeshRestored ( SMESH_subMesh subMesh)
virtualinherited

Allow algo to do something after persistent restoration.

Parameters
subMesh- restored submesh

This method is called only if a submesh has HYP_OK algo_state.

Reimplemented in StdMeshers_Regular_1D, and StdMeshers_RadialQuadrangle_1D2D.

◆ GetNodeParamOnEdge()

static bool SMESH_Algo::GetNodeParamOnEdge ( const SMESHDS_Mesh theMesh,
const TopoDS_Edge &  theEdge,
std::vector< double > &  theParams 
)
staticinherited

Fill vector of node parameters on geometrical edge, including vertex nodes.

Parameters
theMesh- The mesh containing nodes
theEdge- The geometrical edge of interest
theParams- The resulting vector of sorted node parameters
Return values
bool- false if not all parameters are OK

◆ GetSortedNodesOnEdge()

static bool SMESH_Algo::GetSortedNodesOnEdge ( const SMESHDS_Mesh theMesh,
const TopoDS_Edge &  theEdge,
const bool  ignoreMediumNodes,
std::map< double, const SMDS_MeshNode * > &  theNodes 
)
staticinherited

Fill map of node parameter on geometrical edge to node it-self.

Parameters
theMesh- The mesh containing nodes
theEdge- The geometrical edge of interest
theNodes- The resulting map
ignoreMediumNodes- to store medium nodes of quadratic elements or not
Return values
bool- false if not all parameters are OK

◆ IsReversedSubMesh()

static bool SMESH_Algo::IsReversedSubMesh ( const TopoDS_Face &  theFace,
SMESHDS_Mesh theMeshDS 
)
staticinherited

Find out elements orientation on a geometrical face.

Parameters
theFace- The face correctly oriented in the shape being meshed
theMeshDS- The mesh data structure
Return values
bool- true if the face normal and the normal of first element in the correspoding submesh point in different directions

◆ EdgeLength()

static double SMESH_Algo::EdgeLength ( const TopoDS_Edge &  E)
staticinherited

Compute length of an edge.

Parameters
E- the edge
Return values
double- the length

◆ Continuity()

static GeomAbs_Shape SMESH_Algo::Continuity ( const TopoDS_Edge &  E1,
const TopoDS_Edge &  E2 
)
staticinherited

Return continuity of two edges.

Parameters
E1- the 1st edge
E2- the 2nd edge
Return values
GeomAbs_Shape- regularity at the junction between E1 and E2

◆ IsContinuous()

static bool SMESH_Algo::IsContinuous ( const TopoDS_Edge &  E1,
const TopoDS_Edge &  E2 
)
staticinherited

Return true if an edge can be considered as a continuation of another.

Definition at line 295 of file SMESH_Algo.hxx.

◆ VertexNode()

static const SMDS_MeshNode* SMESH_Algo::VertexNode ( const TopoDS_Vertex &  V,
const SMESHDS_Mesh meshDS 
)
staticinherited

Return the node built on a vertex.

Parameters
V- the vertex
meshDS- mesh
Return values
constSMDS_MeshNode* - found node or NULL

◆ error() [1/3]

bool SMESH_Algo::error ( int  error,
const SMESH_Comment comment = "" 
)
protectedinherited

store error and comment and then return ( error == COMPERR_OK )

◆ error() [2/3]

bool SMESH_Algo::error ( const SMESH_Comment comment = "")
protectedinherited

store COMPERR_ALGO_FAILED error and comment and then return false

Definition at line 317 of file SMESH_Algo.hxx.

References COMPERR_ALGO_FAILED.

◆ error() [3/3]

bool SMESH_Algo::error ( SMESH_ComputeErrorPtr  error)
protectedinherited

store error and return error->IsOK()

◆ addBadInputElement()

void SMESH_Algo::addBadInputElement ( const SMDS_MeshElement elem)
protectedinherited

store a bad input element preventing computation, which may be a temporary one i.e. not residing the mesh, then it will be deleted by InitComputeError()

◆ IsStatusFatal()

static bool SMESH_Hypothesis::IsStatusFatal ( Hypothesis_Status  theStatus)
staticinherited

Definition at line 68 of file SMESH_Hypothesis.hxx.

◆ GetDim()

virtual int SMESH_Hypothesis::GetDim ( ) const
virtualinherited

Referenced by SMESH_Gen::TAlgoStateError::Set().

Here is the caller graph for this function:

◆ GetStudyId()

int SMESH_Hypothesis::GetStudyId ( ) const
inherited

◆ NotifySubMeshesHypothesisModification()

virtual void SMESH_Hypothesis::NotifySubMeshesHypothesisModification ( )
virtualinherited

◆ GetShapeType()

virtual int SMESH_Hypothesis::GetShapeType ( ) const
virtualinherited

◆ GetLibName()

virtual const char* SMESH_Hypothesis::GetLibName ( ) const
virtualinherited

◆ SetLibName()

void SMESH_Hypothesis::SetLibName ( const char *  theLibName)
inherited

◆ SetParameters()

void SMESH_Hypothesis::SetParameters ( const char *  theParameters)
inherited

◆ GetParameters()

char* SMESH_Hypothesis::GetParameters ( ) const
inherited

◆ SetLastParameters()

void SMESH_Hypothesis::SetLastParameters ( const char *  theParameters)
inherited

◆ GetLastParameters()

char* SMESH_Hypothesis::GetLastParameters ( ) const
inherited

◆ ClearParameters()

void SMESH_Hypothesis::ClearParameters ( )
inherited

◆ IsAuxiliary()

virtual bool SMESH_Hypothesis::IsAuxiliary ( ) const
virtualinherited

Return true if me is an auxiliary hypothesis.

Return values
bool- auxiliary or not

An auxiliary hypothesis is optional, i.e. an algorithm can work without it and another hypothesis of the same dimention can be assigned to the shape

Definition at line 114 of file SMESH_Hypothesis.hxx.

References SMESHDS_Hypothesis::GetType().

Here is the call graph for this function:

◆ GetName()

const char* SMESHDS_Hypothesis::GetName ( ) const
inherited

◆ GetID()

int SMESHDS_Hypothesis::GetID ( ) const
inherited

◆ GetType()

int SMESHDS_Hypothesis::GetType ( ) const
inherited

Referenced by SMESH_Hypothesis::IsAuxiliary().

Here is the caller graph for this function:

Field Documentation

◆ _compatibleHypothesis

std::vector<std::string> SMESH_Algo::_compatibleHypothesis
protectedinherited

Definition at line 332 of file SMESH_Algo.hxx.

◆ _appliedHypList

std::list<const SMESHDS_Hypothesis *> SMESH_Algo::_appliedHypList
protectedinherited

Definition at line 333 of file SMESH_Algo.hxx.

◆ _usedHypList

std::list<const SMESHDS_Hypothesis *> SMESH_Algo::_usedHypList
protectedinherited

Definition at line 334 of file SMESH_Algo.hxx.

◆ _onlyUnaryInput

bool SMESH_Algo::_onlyUnaryInput
protectedinherited

Definition at line 339 of file SMESH_Algo.hxx.

◆ _requireDescretBoundary

bool SMESH_Algo::_requireDescretBoundary
protectedinherited

Definition at line 340 of file SMESH_Algo.hxx.

◆ _requireShape

bool SMESH_Algo::_requireShape
protectedinherited

Definition at line 341 of file SMESH_Algo.hxx.

◆ _supportSubmeshes

bool SMESH_Algo::_supportSubmeshes
protectedinherited

Definition at line 342 of file SMESH_Algo.hxx.

◆ _quadraticMesh

bool SMESH_Algo::_quadraticMesh
protectedinherited

Definition at line 346 of file SMESH_Algo.hxx.

◆ _error

int SMESH_Algo::_error
protectedinherited

SMESH_ComputeErrorName or anything algo specific.

Definition at line 348 of file SMESH_Algo.hxx.

◆ _comment

std::string SMESH_Algo::_comment
protectedinherited

any text explaining what is wrong in Compute()

Definition at line 349 of file SMESH_Algo.hxx.

◆ _badInputElements

std::list<const SMDS_MeshElement*> SMESH_Algo::_badInputElements
protectedinherited

to explain COMPERR_BAD_INPUT_MESH

Definition at line 350 of file SMESH_Algo.hxx.

◆ _gen

SMESH_Gen* SMESH_Hypothesis::_gen
protectedinherited

Definition at line 118 of file SMESH_Hypothesis.hxx.

◆ _studyId

int SMESH_Hypothesis::_studyId
protectedinherited

Definition at line 119 of file SMESH_Hypothesis.hxx.

◆ _shapeType

int SMESH_Hypothesis::_shapeType
protectedinherited

Definition at line 120 of file SMESH_Hypothesis.hxx.

◆ _param_algo_dim

int SMESH_Hypothesis::_param_algo_dim
protectedinherited

Definition at line 121 of file SMESH_Hypothesis.hxx.

◆ _name

std::string SMESHDS_Hypothesis::_name
protectedinherited

Definition at line 52 of file SMESHDS_Hypothesis.hxx.

◆ _hypId

int SMESHDS_Hypothesis::_hypId
protectedinherited

Definition at line 53 of file SMESHDS_Hypothesis.hxx.

◆ _type

int SMESHDS_Hypothesis::_type
protectedinherited

Definition at line 54 of file SMESHDS_Hypothesis.hxx.