SALOME - SMESH
StdMeshers_ProjectionUtils Class Reference

Class encapsulating methods common to Projection algorithms. More...

#include <StdMeshers_ProjectionUtils.hxx>

Public Types

typedef
TopTools_DataMapOfShapeShape 
TShapeShapeMap
typedef
TopTools_IndexedDataMapOfShapeListOfShape 
TAncestorMap
typedef std::map< const
SMDS_MeshNode *, const
SMDS_MeshNode * > 
TNodeNodeMap

Static Public Member Functions

static bool FindSubShapeAssociation (const TopoDS_Shape &theShape1, SMESH_Mesh *theMesh1, const TopoDS_Shape &theShape2, SMESH_Mesh *theMesh2, TShapeShapeMap &theAssociationMap)
 Looks for association of all subshapes of two shapes.
static int FindFaceAssociation (const TopoDS_Face &face1, TopoDS_Vertex VV1[2], const TopoDS_Face &face2, TopoDS_Vertex VV2[2], std::list< TopoDS_Edge > &edges1, std::list< TopoDS_Edge > &edges2)
 Find association of edges of faces.
static void InitVertexAssociation (const SMESH_Hypothesis *theHyp, TShapeShapeMap &theAssociationMap, const TopoDS_Shape &theTargetShape)
 Insert vertex association defined by a hypothesis into a map.
static bool InsertAssociation (const TopoDS_Shape &theShape1, const TopoDS_Shape &theShape2, TShapeShapeMap &theAssociationMap, const bool theBidirectional=true)
 Inserts association theShape1 <-> theShape2 to TShapeShapeMap.
static bool IsSubShape (const TopoDS_Shape &shape, SMESH_Mesh *aMesh)
static bool IsSubShape (const TopoDS_Shape &shape, const TopoDS_Shape &mainShape)
static TopoDS_Edge GetEdgeByVertices (SMESH_Mesh *aMesh, const TopoDS_Vertex &V1, const TopoDS_Vertex &V2)
 Finds an edge by its vertices in a main shape of the mesh.
static TopoDS_Face GetNextFace (const TAncestorMap &edgeToFaces, const TopoDS_Edge &edge, const TopoDS_Face &face)
 Return another face sharing an edge.
static TopoDS_Vertex GetNextVertex (const TopoDS_Edge &edge, const TopoDS_Vertex &vertex)
 Return other vertex of an edge.
static std::pair< int,
TopoDS_Edge > 
GetPropagationEdge (SMESH_Mesh *aMesh, const TopoDS_Edge &anEdge, const TopoDS_Edge &fromEdge)
 Return an oriented propagation edge.
static bool FindMatchingNodesOnFaces (const TopoDS_Face &face1, SMESH_Mesh *mesh1, const TopoDS_Face &face2, SMESH_Mesh *mesh2, const TShapeShapeMap &assocMap, TNodeNodeMap &nodeIn2OutMap)
 Find corresponding nodes on two faces.
static bool IsClosedEdge (const TopoDS_Edge &anEdge)
 Check if the first and last vertices of an edge are the same.
static TopoDS_Shape OuterShape (const TopoDS_Face &face, TopAbs_ShapeEnum type)
 Return any subshape of a face belonging to the outer wire.
static bool MakeComputed (SMESH_subMesh *sm, const int iterationNb=0)
 Check that submeshis is computed and try to compute it if is not.
static int Count (const TopoDS_Shape &shape, const TopAbs_ShapeEnum type, const bool ignoreSame)
 Count nb of subshapes.
static void SetEventListener (SMESH_subMesh *subMesh, TopoDS_Shape srcShape, SMESH_Mesh *srcMesh)
 Set event listeners to submesh with projection algo.
static bool IsBoundaryEdge (const TopoDS_Edge &edge, const TopoDS_Shape &edgeContainer, SMESH_Mesh &mesh)
 Return true if edge is a boundary of edgeContainer.

Detailed Description

Class encapsulating methods common to Projection algorithms.


Member Typedef Documentation

typedef TopTools_DataMapOfShapeShape StdMeshers_ProjectionUtils::TShapeShapeMap

Definition at line 54 of file StdMeshers_ProjectionUtils.hxx.

typedef TopTools_IndexedDataMapOfShapeListOfShape StdMeshers_ProjectionUtils::TAncestorMap

Definition at line 55 of file StdMeshers_ProjectionUtils.hxx.


Member Function Documentation

static bool StdMeshers_ProjectionUtils::FindSubShapeAssociation ( const TopoDS_Shape theShape1,
SMESH_Mesh theMesh1,
const TopoDS_Shape theShape2,
SMESH_Mesh theMesh2,
TShapeShapeMap theAssociationMap 
) [static]

Looks for association of all subshapes of two shapes.

Parameters:
theShape1- shape 1
theMesh1- mesh built on shape 1
theShape2- shape 2
theMesh2- mesh built on shape 2
theAssociation- association map to be filled that may contain association of one or two pairs of vertices
Return values:
bool- true if association found
static int StdMeshers_ProjectionUtils::FindFaceAssociation ( const TopoDS_Face &  face1,
TopoDS_Vertex  VV1[2],
const TopoDS_Face &  face2,
TopoDS_Vertex  VV2[2],
std::list< TopoDS_Edge > &  edges1,
std::list< TopoDS_Edge > &  edges2 
) [static]

Find association of edges of faces.

Parameters:
face1- face 1
VV1- vertices of face 1
face2- face 2
VV2- vertices of face 2 associated with oned of face 1
edges1- out list of edges of face 1
edges2- out list of edges of face 2
Return values:
int- nb of edges in an outer wire in a success case, else zero
static void StdMeshers_ProjectionUtils::InitVertexAssociation ( const SMESH_Hypothesis theHyp,
TShapeShapeMap theAssociationMap,
const TopoDS_Shape theTargetShape 
) [static]

Insert vertex association defined by a hypothesis into a map.

Parameters:
theHyp- hypothesis
theAssociationMap- association map
theTargetShape- the shape theHyp assigned to
static bool StdMeshers_ProjectionUtils::InsertAssociation ( const TopoDS_Shape theShape1,
const TopoDS_Shape theShape2,
TShapeShapeMap theAssociationMap,
const bool  theBidirectional = true 
) [static]

Inserts association theShape1 <-> theShape2 to TShapeShapeMap.

Parameters:
theShape1- shape 1
theShape2- shape 2
theAssociationMap- association map
theBidirectional- if false, inserts theShape1 -> theShape2 association
Return values:
bool- true if there was no association for these shapes before
static bool StdMeshers_ProjectionUtils::IsSubShape ( const TopoDS_Shape shape,
SMESH_Mesh aMesh 
) [static]
static bool StdMeshers_ProjectionUtils::IsSubShape ( const TopoDS_Shape shape,
const TopoDS_Shape mainShape 
) [static]
static TopoDS_Edge StdMeshers_ProjectionUtils::GetEdgeByVertices ( SMESH_Mesh aMesh,
const TopoDS_Vertex &  V1,
const TopoDS_Vertex &  V2 
) [static]

Finds an edge by its vertices in a main shape of the mesh.

static TopoDS_Face StdMeshers_ProjectionUtils::GetNextFace ( const TAncestorMap edgeToFaces,
const TopoDS_Edge &  edge,
const TopoDS_Face &  face 
) [static]

Return another face sharing an edge.

Parameters:
edgeToFaces- data map of descendants to ancestors
static TopoDS_Vertex StdMeshers_ProjectionUtils::GetNextVertex ( const TopoDS_Edge &  edge,
const TopoDS_Vertex &  vertex 
) [static]

Return other vertex of an edge.

static std::pair<int,TopoDS_Edge> StdMeshers_ProjectionUtils::GetPropagationEdge ( SMESH_Mesh aMesh,
const TopoDS_Edge &  anEdge,
const TopoDS_Edge &  fromEdge 
) [static]

Return an oriented propagation edge.

Parameters:
aMesh- mesh
fromEdge- start edge for propagation
Return values:
pair<int,TopoDS_Edge>- propagation step and found edge
static bool StdMeshers_ProjectionUtils::FindMatchingNodesOnFaces ( const TopoDS_Face &  face1,
SMESH_Mesh mesh1,
const TopoDS_Face &  face2,
SMESH_Mesh mesh2,
const TShapeShapeMap assocMap,
TNodeNodeMap nodeIn2OutMap 
) [static]

Find corresponding nodes on two faces.

Parameters:
face1- the first face
mesh1- mesh containing elements on the first face
face2- the second face
mesh2- mesh containing elements on the second face
assocMap- map associating subshapes of the faces
nodeIn2OutMap- map containing found matching nodes
Return values:
bool- is a success
static bool StdMeshers_ProjectionUtils::IsClosedEdge ( const TopoDS_Edge &  anEdge) [static]

Check if the first and last vertices of an edge are the same.

Parameters:
anEdge- the edge to check
Return values:
bool- true if same
static TopoDS_Shape StdMeshers_ProjectionUtils::OuterShape ( const TopoDS_Face &  face,
TopAbs_ShapeEnum  type 
) [static]

Return any subshape of a face belonging to the outer wire.

Parameters:
face- the face
type- type of subshape to return
Return values:
TopoDS_Shape- the found subshape
static bool StdMeshers_ProjectionUtils::MakeComputed ( SMESH_subMesh sm,
const int  iterationNb = 0 
) [static]

Check that submeshis is computed and try to compute it if is not.

Parameters:
sm- submesh to compute
iterationNb- int used to stop infinite recursive call
Return values:
bool- true if computed
static int StdMeshers_ProjectionUtils::Count ( const TopoDS_Shape shape,
const TopAbs_ShapeEnum  type,
const bool  ignoreSame 
) [static]

Count nb of subshapes.

Parameters:
shape- the shape
type- the type of subshapes to count
ignoreSame- if true, use map not to count same shapes, esle use explorer
Return values:
int- the calculated number
static void StdMeshers_ProjectionUtils::SetEventListener ( SMESH_subMesh subMesh,
TopoDS_Shape  srcShape,
SMESH_Mesh srcMesh 
) [static]

Set event listeners to submesh with projection algo.

Parameters:
subMesh- submesh with projection algo
srcShape- source shape
srcMesh- source mesh
static bool StdMeshers_ProjectionUtils::IsBoundaryEdge ( const TopoDS_Edge &  edge,
const TopoDS_Shape edgeContainer,
SMESH_Mesh mesh 
) [static]

Return true if edge is a boundary of edgeContainer.