StdMeshers_ProjectionUtils Namespace Reference

Methods common to Projection algorithms. More...

Classes

class  TrsfFinder2D
 Finds transformation between two sets of 2D points using a least square approximation. More...
 
class  TrsfFinder3D
 Finds transformation between two sets of 3D points using a least square approximation. More...
 

Typedefs

typedef TopTools_IndexedDataMapOfShapeListOfShape TAncestorMap
 
typedef std::map< const SMDS_MeshNode *, const SMDS_MeshNode *, TIDCompareTNodeNodeMap
 
typedef StdMeshers_ShapeShapeBiDirectionMap TShapeShapeMap
 

Functions

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, const bool isClosenessAssoc=false)
 Find association of edges of faces. More...
 
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. More...
 
bool FindSubShapeAssociation (const TopoDS_Shape &theShape1, SMESH_Mesh *theMesh1, const TopoDS_Shape &theShape2, SMESH_Mesh *theMesh2, TShapeShapeMap &theAssociationMap)
 Looks for association of all sub-shapes of two shapes. More...
 
TopoDS_Edge GetBoundaryEdge (const TopoDS_Shape &edgeContainer, const SMESH_Mesh &mesh, std::list< TopoDS_Edge > *allBndEdges=0)
 Return a boundary EDGE (or all boundary EDGEs) of edgeContainer. More...
 
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. More...
 
TopoDS_Face GetNextFace (const TAncestorMap &edgeToFaces, const TopoDS_Edge &edge, const TopoDS_Face &face)
 Return another face sharing an edge. More...
 
TopoDS_Vertex GetNextVertex (const TopoDS_Edge &edge, const TopoDS_Vertex &vertex)
 Return other vertex of an edge. More...
 
std::pair< int, TopoDS_Edge > GetPropagationEdge (SMESH_Mesh *aMesh, const TopoDS_Edge &anEdge, const TopoDS_Edge &fromEdge, TopTools_IndexedMapOfShape *chain=0)
 Return an oriented propagation edge. More...
 
void InitVertexAssociation (const SMESH_Hypothesis *theHyp, TShapeShapeMap &theAssociationMap)
 Insert vertex association defined by a hypothesis into a map. More...
 
bool InsertAssociation (const TopoDS_Shape &theShape1, const TopoDS_Shape &theShape2, TShapeShapeMap &theAssociationMap)
 Inserts association theShape1 <-> theShape2 to TShapeShapeMap. More...
 
bool MakeComputed (SMESH_subMesh *sm, const int iterationNb=0)
 Check that submeshis is computed and try to compute it if is not. More...
 
TopoDS_Shape OuterShape (const TopoDS_Face &face, TopAbs_ShapeEnum type)
 Return any sub-shape of a face belonging to the outer wire. More...
 
void SetEventListener (SMESH_subMesh *subMesh, TopoDS_Shape srcShape, SMESH_Mesh *srcMesh)
 Set event listeners to submesh with projection algo. More...
 
std::string SourceNotComputedError (SMESH_subMesh *sm=0, SMESH_Algo *projAlgo=0)
 Returns an error message to show in case if MakeComputed( sm ) fails. More...
 

Detailed Description

Methods common to Projection algorithms.

Typedef Documentation

◆ TAncestorMap

typedef TopTools_IndexedDataMapOfShapeListOfShape StdMeshers_ProjectionUtils::TAncestorMap

◆ TNodeNodeMap

◆ TShapeShapeMap

Function Documentation

◆ FindFaceAssociation()

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,
const bool  isClosenessAssoc = false 
)

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
isClosenessAssoc- is association starting by VERTEX closeness
Return values
int- nb of edges in an outer wire in a success case, else zero

References SMESH_Algo::EdgeLength(), DraftVecUtils::find(), SMESH_Block::GetOrderedEdges(), SMESH_MesherHelper::IsClosedEdge(), SMESH_Algo::isDegenerated(), and SMESH_MesherHelper::IthVertex().

Referenced by FindSubShapeAssociation().

◆ FindMatchingNodesOnFaces()

bool StdMeshers_ProjectionUtils::FindMatchingNodesOnFaces ( const TopoDS_Face &  face1,
SMESH_Mesh mesh1,
const TopoDS_Face &  face2,
SMESH_Mesh mesh2,
const TShapeShapeMap assocMap,
TNodeNodeMap nodeIn2OutMap 
)

◆ FindSubShapeAssociation()

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

◆ GetBoundaryEdge()

TopoDS_Edge StdMeshers_ProjectionUtils::GetBoundaryEdge ( const TopoDS_Shape &  edgeContainer,
const SMESH_Mesh mesh,
std::list< TopoDS_Edge > *  allBndEdges = 0 
)

Return a boundary EDGE (or all boundary EDGEs) of edgeContainer.

References SMESH_MesherHelper::GetAncestors().

Referenced by FindSubShapeAssociation().

◆ GetEdgeByVertices()

TopoDS_Edge StdMeshers_ProjectionUtils::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.

References SMESH_Mesh::GetAncestors().

Referenced by FindSubShapeAssociation().

◆ GetNextFace()

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

Return another face sharing an edge.

Parameters
edgeToFaces- data map of descendants to ancestors

Referenced by FindSubShapeAssociation().

◆ GetNextVertex()

TopoDS_Vertex StdMeshers_ProjectionUtils::GetNextVertex ( const TopoDS_Edge &  edge,
const TopoDS_Vertex &  vertex 
)

Return other vertex of an edge.

Referenced by FindSubShapeAssociation().

◆ GetPropagationEdge()

pair< int, TopoDS_Edge > StdMeshers_ProjectionUtils::GetPropagationEdge ( SMESH_Mesh aMesh,
const TopoDS_Edge &  anEdge,
const TopoDS_Edge &  fromEdge,
TopTools_IndexedMapOfShape *  chain = 0 
)

Return an oriented propagation edge.

Parameters
aMesh- mesh
fromEdge- start edge for propagation
chain- return, if provided, a propagation chain passed till anEdge; if anEdge.IsNull() then a full propagation chain is returned
Return values
pair<int,TopoDS_Edge>- propagation step and found edge

References SMESH_Mesh::GetAncestors().

Referenced by FindSubShapeAssociation().

◆ InitVertexAssociation()

◆ InsertAssociation()

bool StdMeshers_ProjectionUtils::InsertAssociation ( const TopoDS_Shape &  theShape1,
const TopoDS_Shape &  theShape2,
TShapeShapeMap theAssociationMap 
)

Inserts association theShape1 <-> theShape2 to TShapeShapeMap.

Parameters
theShape1- target shape
theShape2- source shape
theAssociationMap- association map
theBidirectional- if false, inserts theShape1 -> theShape2 association
Return values
bool- true if there was no association for these shapes before

References StdMeshers_ShapeShapeBiDirectionMap::Bind().

Referenced by FindSubShapeAssociation(), and InitVertexAssociation().

◆ MakeComputed()

◆ OuterShape()

TopoDS_Shape StdMeshers_ProjectionUtils::OuterShape ( const TopoDS_Face &  face,
TopAbs_ShapeEnum  type 
)

Return any sub-shape of a face belonging to the outer wire.

Parameters
face- the face
type- type of sub-shape to return
Return values
TopoDS_Shape- the found sub-shape

Referenced by FindMatchingNodesOnFaces(), and FindSubShapeAssociation().

◆ SetEventListener()

void StdMeshers_ProjectionUtils::SetEventListener ( SMESH_subMesh subMesh,
TopoDS_Shape  srcShape,
SMESH_Mesh srcMesh 
)

◆ SourceNotComputedError()

std::string StdMeshers_ProjectionUtils::SourceNotComputedError ( SMESH_subMesh sm = 0,
SMESH_Algo projAlgo = 0 
)