Methods common to Projection algorithms. More...
Data Structures | |
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 StdMeshers_ShapeShapeBiDirectionMap | TShapeShapeMap |
typedef TopTools_IndexedDataMapOfShapeListOfShape | TAncestorMap |
typedef std::map< const SMDS_MeshNode *, const SMDS_MeshNode *, TIDCompare > | TNodeNodeMap |
Functions | |
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... | |
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... | |
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... | |
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... | |
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... | |
TopoDS_Shape | OuterShape (const TopoDS_Face &face, TopAbs_ShapeEnum type) |
Return any sub-shape of a face belonging to the outer wire. More... | |
bool | MakeComputed (SMESH_subMesh *sm, const int iterationNb=0) |
Check that submeshis is computed and try to compute it if is not. 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... | |
void | SetEventListener (SMESH_subMesh *subMesh, TopoDS_Shape srcShape, SMESH_Mesh *srcMesh) |
Set event listeners to submesh with projection algo. 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... | |
Methods common to Projection algorithms.
typedef TopTools_IndexedDataMapOfShapeListOfShape StdMeshers_ProjectionUtils::TAncestorMap |
typedef std::map<const SMDS_MeshNode*, const SMDS_MeshNode*, TIDCompare> StdMeshers_ProjectionUtils::TNodeNodeMap |
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.
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 |
int | - nb of edges in an outer wire in a success case, else zero |
References Abs(), CONT_BAD_RESULT, SMESH_Algo::EdgeLength(), SMESH_Block::GetOrderedEdges(), Handle(), SMESH_MesherHelper::IsClosedEdge(), SMESH_Algo::isDegenerated(), SMESH_MesherHelper::IthVertex(), Max(), RETURN_BAD_RESULT, and reverse().
Referenced by FindSubShapeAssociation().
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.
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 |
bool | - is a success |
References SMESHDS_SubMesh::Contains(), Edge, SMESH_MeshAlgos::FindFaceInSet(), SMESH_MeshEditor::FindMatchingNodes(), SMESHDS_SubMesh::GetElements(), SMDS_MeshNode::GetInverseElementIterator(), SMDS_MeshElement::GetNode(), SMESHDS_SubMesh::GetNodes(), SMESH_MesherHelper::GetNodeU(), SMESH_MesherHelper::GetNodeUV(), SMDS_MeshNode::GetPosition(), SMDS_MeshElement::getshapeId(), SMDS_Position::GetTypeOfPosition(), SMDS_EdgePosition::GetUParameter(), SMESH_MesherHelper::HasRealSeam(), 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(), RETURN_BAD_RESULT, reverse(), second, SMESH_MesherHelper::SetSubShape(), SMESH_MeshEditor::SEW_OK, SMESHDS_Mesh::ShapeToIndex(), SMDS_TOP_FACE, SMDSAbs_Edge, SMDSAbs_Face, and SMESH_Algo::VertexNode().
Referenced by StdMeshers_Prism_3D::assocOrProjBottom2Top(), StdMeshers_Projection_3D::Compute(), and StdMeshers_RadialPrism_3D::Compute().
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.
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 |
bool | - true if association found |
References StdMeshers_ShapeShapeBiDirectionMap::_assocType, StdMeshers_ShapeShapeBiDirectionMap::_map1to2, StdMeshers_ShapeShapeBiDirectionMap::Bind(), SMESH_MesherHelper::Count(), Edge, StdMeshers_ShapeShapeBiDirectionMap::Extent(), Face, FindFaceAssociation(), SMESH_MesherHelper::GetAncestors(), GetBoundaryEdge(), GetEdgeByVertices(), GetNextFace(), GetNextVertex(), GetPropagationEdge(), SMESH_MesherHelper::GetSubShapeOri(), InsertAssociation(), StdMeshers_ShapeShapeBiDirectionMap::IsBound(), SMESH_MesherHelper::IsClosedEdge(), StdMeshers_ShapeShapeBiDirectionMap::IsEmpty(), SMESH_MesherHelper::IthVertex(), OuterShape(), RETURN_BAD_RESULT, and StdMeshers_ShapeShapeBiDirectionMap::SetAssocType().
Referenced by StdMeshers_Prism_3D::assocOrProjBottom2Top(), StdMeshers_Projection_3D::Compute(), StdMeshers_Projection_2D::Compute(), StdMeshers_Projection_1D::Compute(), StdMeshers_RadialPrism_3D::Compute(), StdMeshers_Projection_1D2D::Evaluate(), StdMeshers_Projection_2D::Evaluate(), StdMeshers_Projection_1D::Evaluate(), and StdMeshers_RadialPrism_3D::Evaluate().
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 Edge, and SMESH_MesherHelper::GetAncestors().
Referenced by FindSubShapeAssociation().
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 Edge.
Referenced by StdMeshers_Projection_3D::CheckHypothesis(), StdMeshers_Projection_2D::CheckHypothesis(), and FindSubShapeAssociation().
TopoDS_Face StdMeshers_ProjectionUtils::GetNextFace | ( | const TAncestorMap & | edgeToFaces, |
const TopoDS_Edge & | edge, | ||
const TopoDS_Face & | face | ||
) |
Return another face sharing an edge.
edgeToFaces | - data map of descendants to ancestors |
References Face.
Referenced by FindSubShapeAssociation().
TopoDS_Vertex StdMeshers_ProjectionUtils::GetNextVertex | ( | const TopoDS_Edge & | edge, |
const TopoDS_Vertex & | vertex | ||
) |
Return other vertex of an edge.
Referenced by FindSubShapeAssociation().
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.
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 |
pair<int,TopoDS_Edge> | - propagation step and found edge |
References Edge.
Referenced by StdMeshers_Prism_3D::Compute(), and FindSubShapeAssociation().
void StdMeshers_ProjectionUtils::InitVertexAssociation | ( | const SMESH_Hypothesis * | theHyp, |
TShapeShapeMap & | theAssociationMap | ||
) |
Insert vertex association defined by a hypothesis into a map.
theHyp | - hypothesis |
theAssociationMap | - association map |
theTargetShape | - the shape theHyp assigned to |
References InsertAssociation().
Referenced by StdMeshers_Projection_2D::Compute(), StdMeshers_Projection_1D::Compute(), StdMeshers_Projection_1D2D::Evaluate(), StdMeshers_Projection_2D::Evaluate(), and StdMeshers_Projection_1D::Evaluate().
bool StdMeshers_ProjectionUtils::InsertAssociation | ( | const TopoDS_Shape & | theShape1, |
const TopoDS_Shape & | theShape2, | ||
TShapeShapeMap & | theAssociationMap | ||
) |
Inserts association theShape1 <-> theShape2 to TShapeShapeMap.
theShape1 | - target shape |
theShape2 | - source shape |
theAssociationMap | - association map |
theBidirectional | - if false, inserts theShape1 -> theShape2 association |
bool | - true if there was no association for these shapes before |
References StdMeshers_ShapeShapeBiDirectionMap::Bind(), and SHOW_SHAPE.
Referenced by StdMeshers_Prism_3D::assocOrProjBottom2Top(), FindSubShapeAssociation(), and InitVertexAssociation().
bool StdMeshers_ProjectionUtils::MakeComputed | ( | SMESH_subMesh * | sm, |
const int | iterationNb = 0 |
||
) |
Check that submeshis is computed and try to compute it if is not.
sm | - submesh to compute |
iterationNb | - int used to stop infinite recursive call |
bool | - true if computed |
References SMESH_HypoFilter::And(), SMESH_HypoFilter::HasDim(), SMESH_HypoFilter::IsAlgo(), RETURN_BAD_RESULT, and SMESH_Gen::SHAPE_ONLY.
Referenced by StdMeshers_Projection_3D::Compute(), StdMeshers_Projection_2D::Compute(), StdMeshers_Projection_1D::Compute(), and StdMeshers_Projection_1D::Evaluate().
TopoDS_Shape StdMeshers_ProjectionUtils::OuterShape | ( | const TopoDS_Face & | face, |
TopAbs_ShapeEnum | type | ||
) |
Return any sub-shape of a face belonging to the outer wire.
face | - the face |
type | - type of sub-shape to return |
TopoDS_Shape | - the found sub-shape |
Referenced by FindMatchingNodesOnFaces(), and FindSubShapeAssociation().
void StdMeshers_ProjectionUtils::SetEventListener | ( | SMESH_subMesh * | subMesh, |
TopoDS_Shape | srcShape, | ||
SMESH_Mesh * | srcMesh | ||
) |
Set event listeners to submesh with projection algo.
subMesh | - submesh with projection algo |
srcShape | - source shape |
srcMesh | - source mesh |
References SMESH_subMeshEventListenerData::MakeData(), and SMESH_subMeshEventListenerData::mySubMeshes.
Referenced by StdMeshers_Projection_3D::SetEventListener(), StdMeshers_Projection_2D::SetEventListener(), StdMeshers_Projection_1D::SetEventListener(), StdMeshers_Import_1D::SubmeshRestored(), and StdMeshers_Import_1D2D::SubmeshRestored().
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_HypoFilter::And(), SMESH_Gen::GetShapeDim(), SMESH_HypoFilter::HasDim(), SMESH_HypoFilter::IsAlgo(), and SMESH_subMesh::NO_ALGO.
Referenced by StdMeshers_Projection_3D::Compute(), StdMeshers_Projection_2D::Compute(), and StdMeshers_Projection_1D::Compute().