Methods common to Projection algorithms. More...
Classes | |
class | TrsfFinder2D |
Finds transformation beween two sets of 2D points using a least square approximation. More... | |
class | TrsfFinder3D |
Finds transformation beween 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 *, TIDCompare > | TNodeNodeMap |
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
typedef std::map<const SMDS_MeshNode*, const SMDS_MeshNode*, TIDCompare> StdMeshers_ProjectionUtils::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 | ||
) |
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 sub-shapes of the faces nodeIn2OutMap - map containing found matching nodes
- Return values
-
bool - is a success
References SMESHDS_SubMesh::Contains(), SMESH_MeshAlgos::FindFaceInSet(), SMESH_MeshEditor::FindMatchingNodes(), SMESHDS_SubMesh::GetElements(), SMDS_MeshNode::GetInverseElementIterator(), SMESH_Mesh::GetMeshDS(), SMDS_MeshElement::GetNode(), SMESHDS_SubMesh::GetNodes(), SMESH_MesherHelper::GetNodeU(), SMESH_MesherHelper::GetNodeUV(), SMDS_MeshNode::GetPosition(), SMDS_MeshElement::getshapeId(), SMDS_Position::GetTypeOfPosition(), SMESH_MesherHelper::HasSeam(), StdMeshers_ShapeShapeBiDirectionMap::IsBound(), SMESH_MesherHelper::IsClosedEdge(), SMDS_MeshElement::IsQuadratic(), SMESH_MesherHelper::IsRealSeam(), SMESH_MesherHelper::IsSeamShape(), SMESH_MesherHelper::IsSubShape(), SMESHDS_Mesh::MeshElements(), SMESHDS_SubMesh::NbElements(), SMESHDS_SubMesh::NbNodes(), SMDS_MeshElement::NbNodes(), OuterShape(), SMESH_MesherHelper::SetSubShape(), SMESH_MeshEditor::SEW_OK, SMESHDS_Mesh::ShapeToIndex(), and SMESH_Algo::VertexNode().
◆ FindSubShapeAssociation()
bool StdMeshers_ProjectionUtils::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.
- 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
References StdMeshers_ShapeShapeBiDirectionMap::Bind(), SMESH_MesherHelper::Count(), StdMeshers_ShapeShapeBiDirectionMap::Extent(), FindFaceAssociation(), FindSubShapeAssociation(), SMESH_Mesh::GetAncestorMap(), SMESH_MesherHelper::GetAncestors(), SMESH_Mesh::GetAncestors(), GetBoundaryEdge(), GetEdgeByVertices(), SMESH_Mesh::GetMeshDS(), GetNextFace(), GetNextVertex(), GetPropagationEdge(), SMESH_MesherHelper::GetSubShapeOri(), InsertAssociation(), StdMeshers_ShapeShapeBiDirectionMap::IsBound(), SMESH_MesherHelper::IsClosedEdge(), StdMeshers_ShapeShapeBiDirectionMap::IsEmpty(), SMESHDS_Mesh::MeshElements(), OuterShape(), StdMeshers_ShapeShapeBiDirectionMap::SetAssocType(), and SMESHDS_Mesh::ShapeToIndex().
Referenced by FindSubShapeAssociation().
◆ 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 StdMeshers_Prism_3D::Compute(), and FindSubShapeAssociation().
◆ InitVertexAssociation()
void StdMeshers_ProjectionUtils::InitVertexAssociation | ( | const SMESH_Hypothesis * | theHyp, |
TShapeShapeMap & | theAssociationMap | ||
) |
Insert vertex association defined by a hypothesis into a map.
- Parameters
-
theHyp - hypothesis theAssociationMap - association map theTargetShape - the shape theHyp assigned to
References SMESHDS_Hypothesis::GetName(), StdMeshers_ProjectionSource3D::GetSourceVertex(), StdMeshers_ProjectionSource1D::GetSourceVertex(), StdMeshers_ProjectionSource2D::GetSourceVertex(), StdMeshers_ProjectionSource3D::GetTargetVertex(), StdMeshers_ProjectionSource1D::GetTargetVertex(), StdMeshers_ProjectionSource2D::GetTargetVertex(), StdMeshers_ProjectionSource3D::HasVertexAssociation(), StdMeshers_ProjectionSource1D::HasVertexAssociation(), StdMeshers_ProjectionSource2D::HasVertexAssociation(), and InsertAssociation().
◆ 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()
bool StdMeshers_ProjectionUtils::MakeComputed | ( | SMESH_subMesh * | sm, |
const int | iterationNb = 0 |
||
) |
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
References SMESH_HypoFilter::And(), SMESH_Gen::Compute(), SMESH_subMesh::GetAlgo(), SMESH_subMesh::GetFather(), SMESHDS_Hypothesis::GetName(), SMESH_Gen::GetShapeDim(), StdMeshers_ProjectionSource3D::GetSource3DShape(), StdMeshers_ProjectionSource1D::GetSourceEdge(), StdMeshers_ProjectionSource2D::GetSourceFace(), StdMeshers_ProjectionSource3D::GetSourceMesh(), StdMeshers_ProjectionSource1D::GetSourceMesh(), StdMeshers_ProjectionSource2D::GetSourceMesh(), SMESH_Mesh::GetSubMesh(), SMESH_subMesh::GetSubShape(), SMESH_Algo::GetUsedHypothesis(), SMESH_HypoFilter::HasDim(), SMESH_HypoFilter::IsAlgo(), SMESH_subMesh::IsMeshComputed(), and MakeComputed().
Referenced by 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 | ||
) |
Set event listeners to submesh with projection algo.
- Parameters
-
subMesh - submesh with projection algo srcShape - source shape srcMesh - source mesh
References DraftVecUtils::find(), SMESH_subMesh::GetEventListenerData(), SMESH_subMesh::GetFather(), SMESH_Mesh::GetSubMesh(), SMESH_subMesh::GetSubMeshDS(), SMESH_subMesh::GetSubShape(), SMESHDS_SubMesh::IsComplexSubmesh(), SMESH_subMeshEventListenerData::MakeData(), SMESH_subMeshEventListenerData::mySubMeshes, and SMESH_subMesh::SetEventListener().
◆ SourceNotComputedError()
std::string StdMeshers_ProjectionUtils::SourceNotComputedError | ( | SMESH_subMesh * | sm = 0 , |
SMESH_Algo * | projAlgo = 0 |
||
) |
Returns an error message to show in case if MakeComputed( sm ) fails.
References SMESH_subMesh::GetAlgoState(), SMESH_subMesh::GetFather(), SMESH_Algo::GetFeatures(), SMESH_Mesh::GetHypothesis(), SMESH_Gen::GetShapeDim(), SMESH_subMesh::GetSubShape(), SMESH_HypoFilter::IsAlgo(), SMESH_Algo::NeedDiscreteBoundary(), and SMESH_subMesh::NO_ALGO.