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 *, 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... | |
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 SMESH_Algo::EdgeLength(), DraftVecUtils::find(), SMESH_Block::GetOrderedEdges(), SMESH_MesherHelper::IsClosedEdge(), SMESH_Algo::isDegenerated(), and SMESH_MesherHelper::IthVertex().
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(), 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(), SMDS_MeshElement::NbNodes(), SMESHDS_SubMesh::NbNodes(), OuterShape(), SMESH_MesherHelper::SetSubShape(), SMESH_MeshEditor::SEW_OK, SMESHDS_Mesh::ShapeToIndex(), and SMESH_Algo::VertexNode().
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::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(), SMESHDS_Mesh::ShapeToIndex(), and draftgeoutils.general::v1().
Referenced by FindSubShapeAssociation().
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().
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().
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 |
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 SMESH_Mesh::GetAncestors().
Referenced by 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 SMESHDS_Hypothesis::GetName(), StdMeshers_ProjectionSource1D::GetSourceVertex(), StdMeshers_ProjectionSource2D::GetSourceVertex(), StdMeshers_ProjectionSource3D::GetSourceVertex(), StdMeshers_ProjectionSource1D::GetTargetVertex(), StdMeshers_ProjectionSource2D::GetTargetVertex(), StdMeshers_ProjectionSource3D::GetTargetVertex(), StdMeshers_ProjectionSource1D::HasVertexAssociation(), StdMeshers_ProjectionSource2D::HasVertexAssociation(), StdMeshers_ProjectionSource3D::HasVertexAssociation(), and InsertAssociation().
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().
Referenced by 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_Gen::Compute(), SMESH_subMesh::GetAlgo(), SMESH_subMesh::GetFather(), SMESHDS_Hypothesis::GetName(), SMESH_Gen::GetShapeDim(), StdMeshers_ProjectionSource3D::GetSource3DShape(), StdMeshers_ProjectionSource1D::GetSourceEdge(), StdMeshers_ProjectionSource2D::GetSourceFace(), StdMeshers_ProjectionSource1D::GetSourceMesh(), StdMeshers_ProjectionSource2D::GetSourceMesh(), StdMeshers_ProjectionSource3D::GetSourceMesh(), SMESH_Mesh::GetSubMesh(), SMESH_subMesh::GetSubShape(), SMESH_Algo::GetUsedHypothesis(), SMESH_HypoFilter::HasDim(), SMESH_HypoFilter::IsAlgo(), SMESH_subMesh::IsMeshComputed(), and MakeComputed().
Referenced by MakeComputed().
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 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().
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.