#include <SMESH_Block.hxx>
Classes | |
class | TEdge |
class | TFace |
Public Types | |
enum | TShapeID { ID_NONE = 0, ID_V000 = 1, ID_V100, ID_V010, ID_V110, ID_V001, ID_V101, ID_V011, ID_V111, ID_Ex00, ID_Ex10, ID_Ex01, ID_Ex11, ID_E0y0, ID_E1y0, ID_E0y1, ID_E1y1, ID_E00z, ID_E10z, ID_E01z, ID_E11z, ID_Fxy0, ID_Fxy1, ID_Fx0z, ID_Fx1z, ID_F0yz, ID_F1yz, ID_Shell, ID_FirstV = ID_V000, ID_FirstE = ID_Ex00, ID_FirstF = ID_Fxy0 } |
Public Member Functions | |
bool | ComputeParameters (const gp_Pnt &thePoint, gp_XYZ &theParams, const int theShapeID=ID_Shell, const gp_XYZ &theParamsHint=gp_XYZ(-1,-1,-1)) |
Standard_Boolean | Derivatives (const math_Vector &X, math_Matrix &D) |
double | DistanceReached () const |
bool | EdgeParameters (const int theEdgeID, const double theU, gp_XYZ &theParams) |
bool | EdgePoint (const int theEdgeID, const gp_XYZ &theParams, gp_XYZ &thePoint) const |
bool | EdgeU (const int theEdgeID, const gp_XYZ &theParams, double &theU) const |
bool | FacePoint (const int theFaceID, const gp_XYZ &theParams, gp_XYZ &thePoint) const |
bool | FaceUV (const int theFaceID, const gp_XYZ &theParams, gp_XY &theUV) const |
Standard_Integer | GetStateNumber () |
double | GetTolerance () const |
bool | IsToleranceReached () const |
bool | LoadBlockShapes (const TopoDS_Shell &theShell, const TopoDS_Vertex &theVertex000, const TopoDS_Vertex &theVertex001, TopTools_IndexedMapOfOrientedShape &theShapeIDMap) |
bool | LoadBlockShapes (const TopTools_IndexedMapOfOrientedShape &theShapeIDMap) |
Initialize block geometry with shapes from theShapeIDMap. More... | |
bool | LoadFace (const TopoDS_Face &theFace, const int theFaceID, const TopTools_IndexedMapOfOrientedShape &theShapeIDMap) |
Load face geometry. More... | |
bool | LoadMeshBlock (const SMDS_MeshVolume *theVolume, const int theNode000Index, const int theNode001Index, std::vector< const SMDS_MeshNode * > &theOrderedNodes) |
Standard_Integer | NbEquations () const |
Standard_Integer | NbVariables () const |
void | SetTolerance (const double tol) |
bool | ShellPoint (const gp_XYZ &theParams, gp_XYZ &thePoint) const |
SMESH_Block () | |
Standard_Boolean | Value (const math_Vector &X, math_Vector &F) |
Standard_Boolean | Values (const math_Vector &X, math_Vector &F, math_Matrix &D) |
bool | VertexParameters (const int theVertexID, gp_XYZ &theParams) |
bool | VertexPoint (const int theVertexID, gp_XYZ &thePoint) const |
Static Public Member Functions | |
static std::ostream & | DumpShapeID (const int theBlockShapeID, std::ostream &stream) |
static bool | FindBlockShapes (const TopoDS_Shell &theShell, const TopoDS_Vertex &theVertex000, const TopoDS_Vertex &theVertex001, TopTools_IndexedMapOfOrientedShape &theShapeIDMap) |
static int | GetCoordIndOnEdge (const int theEdgeID) |
static void | GetEdgeVertexIDs (const int edgeID, std::vector< int > &vertexVec) |
static void | GetFaceEdgesIDs (const int faceID, std::vector< int > &edgeVec) |
static int | GetOrderedEdges (const TopoDS_Face &theFace, std::list< TopoDS_Edge > &theEdges, std::list< int > &theNbEdgesInWires, TopoDS_Vertex theFirstVertex=TopoDS_Vertex(), const bool theShapeAnalysisAlgo=false) |
Return number of wires and a list of oredered edges. More... | |
static double * | GetShapeCoef (const int theShapeID) |
static int | GetShapeIDByParams (const gp_XYZ &theParams) |
static bool | Insert (const TopoDS_Shape &theShape, const int theShapeID, TopTools_IndexedMapOfOrientedShape &theShapeIDMap) |
/ Insert theShape into theShapeIDMap with theShapeID More... | |
static bool | IsEdgeID (int theShapeID) |
static bool | IsFaceID (int theShapeID) |
static bool | IsForwardEdge (const TopoDS_Edge &theEdge, const TopTools_IndexedMapOfOrientedShape &theShapeIDMap) |
static bool | IsVertexID (int theShapeID) |
static int | NbEdges () |
static int | NbFaces () |
static int | NbSubShapes () |
static int | NbVertices () |
static int | ShapeIndex (int theShapeID) |
static bool | ShellPoint (const gp_XYZ &theParams, const std::vector< gp_XYZ > &thePointOnShape, gp_XYZ &thePoint) |
Protected Types | |
enum | { SQUARE_DIST = 0, DRV_1, DRV_2, DRV_3 } |
typedef std::pair< gp_XYZ, gp_XYZ > | TxyzPair |
Protected Member Functions | |
bool | computeParameters (const gp_Pnt &thePoint, gp_XYZ &theParams, const gp_XYZ &theParamsHint, int) |
double | distance () const |
bool | findUVAround (const gp_Pnt &thePoint, const gp_XY &theUV, const TFace &tface, gp_XYZ &theParams, int nbGetWorstLimit) |
Finds parameters corresponding to a given UV of a given face by searching around the starting solution. More... | |
bool | findUVByHalfDivision (const gp_Pnt &thePoint, const gp_XY &theUV, const TFace &tface, gp_XYZ &theParams) |
Finds parameters corresponding to a given UV of a given face using half-division. More... | |
double | funcValue (double sqDist) const |
void | init () |
Call it after geometry initialisation. More... | |
void | refineParametersOnFace (const gp_Pnt &thePoint, gp_XYZ &theParams, int theFaceID) |
Find more precise solution. More... | |
bool | saveBetterSolution (const gp_XYZ &theNewParams, gp_XYZ &theParams, double sqDistance) |
Store a solution if it's better than a previous one. More... | |
Protected Attributes | |
TxyzPair | my3x3x3GridNodes [1000] |
TEdge | myEdge [12] |
TFace | myFace [6] |
int | myFaceIndex |
double | myFaceParam |
bool | myGridComputed |
int | myNbIterations |
gp_XYZ | myParam |
gp_XYZ | myPnt [8] |
gp_XYZ | myPoint |
bool | mySquareFunc |
double | mySumDist |
double | myTolerance |
double | myValues [4] |
Member Typedef Documentation
◆ TxyzPair
|
protected |
Member Enumeration Documentation
◆ anonymous enum
◆ TShapeID
Constructor & Destructor Documentation
◆ SMESH_Block()
SMESH_Block::SMESH_Block | ( | ) |
Member Function Documentation
◆ computeParameters()
|
protected |
References distance(), myFaceIndex, myFaceParam, myNbIterations, myParam, myPoint, mySquareFunc, mySumDist, myTolerance, myValues, refineParametersOnFace(), and SQUARE_DIST.
Referenced by ComputeParameters().
◆ ComputeParameters()
bool SMESH_Block::ComputeParameters | ( | const gp_Pnt & | thePoint, |
gp_XYZ & | theParams, | ||
const int | theShapeID = ID_Shell , |
||
const gp_XYZ & | theParamsHint = gp_XYZ(-1,-1,-1) |
||
) |
References computeParameters(), DraftVecUtils::dist(), distance(), EdgeParameters(), GetShapeCoef(), ID_FirstE, IsEdgeID(), IsFaceID(), my3x3x3GridNodes, myEdge, myFaceIndex, myFaceParam, myGridComputed, myNbIterations, mySumDist, myTolerance, myValues, SMESH_Block::TEdge::Point(), refineParametersOnFace(), ShellPoint(), SQUARE_DIST, and VertexParameters().
Referenced by StdMeshers_Projection_3D::Compute(), and StdMeshers_SMESHBlock::ComputeParameters().
◆ Derivatives()
Standard_Boolean SMESH_Block::Derivatives | ( | const math_Vector & | X, |
math_Matrix & | D | ||
) |
References Values().
◆ distance()
|
protected |
◆ DistanceReached()
double SMESH_Block::DistanceReached | ( | ) | const |
◆ DumpShapeID()
|
static |
◆ EdgeParameters()
bool SMESH_Block::EdgeParameters | ( | const int | theEdgeID, |
const double | theU, | ||
gp_XYZ & | theParams | ||
) |
References GetEdgeVertexIDs(), ID_Ex00, IsEdgeID(), myEdge, and VertexParameters().
Referenced by StdMeshers_SMESHBlock::ComputeParameters(), and ComputeParameters().
◆ EdgePoint()
bool SMESH_Block::EdgePoint | ( | const int | theEdgeID, |
const gp_XYZ & | theParams, | ||
gp_XYZ & | thePoint | ||
) | const |
Referenced by StdMeshers_SMESHBlock::Point(), and StdMeshers_Penta_3D::SetHorizEdgeXYZ().
◆ EdgeU()
bool SMESH_Block::EdgeU | ( | const int | theEdgeID, |
const gp_XYZ & | theParams, | ||
double & | theU | ||
) | const |
◆ FacePoint()
bool SMESH_Block::FacePoint | ( | const int | theFaceID, |
const gp_XYZ & | theParams, | ||
gp_XYZ & | thePoint | ||
) | const |
Referenced by StdMeshers_SMESHBlock::Point().
◆ FaceUV()
bool SMESH_Block::FaceUV | ( | const int | theFaceID, |
const gp_XYZ & | theParams, | ||
gp_XY & | theUV | ||
) | const |
◆ FindBlockShapes()
|
static |
References GetOrderedEdges().
Referenced by StdMeshers_Projection_3D::IsApplicable(), StdMeshers_Prism_3D::IsApplicable(), SMESH_MesherHelper::IsBlock(), and LoadBlockShapes().
◆ findUVAround()
|
protected |
Finds parameters corresponding to a given UV of a given face by searching around the starting solution.
- Parameters
-
[in] theUV - the UV to locate [in] tface - the face [in,out] theParams - the starting parameters to improve [in] nbGetWorstLimit - nb of steps from the starting solution w/o improvement to stop searching in this direction
- Returns
- bool -
true
if found solution is within myTolerance
References DraftVecUtils::dist(), distance(), SMESH_Block::TFace::GetUInd(), SMESH_Block::TFace::GetVInd(), SMESH_Block::TFace::Point(), and saveBetterSolution().
Referenced by refineParametersOnFace().
◆ findUVByHalfDivision()
|
protected |
Finds parameters corresponding to a given UV of a given face using half-division.
- Parameters
-
[in] theUV - the UV to locate [in] tface - the face [in,out] theParams - the starting parameters to improve
- Returns
- bool -
true
if found solution is within myTolerance
References distance(), SMESH_Block::TFace::GetUInd(), SMESH_Block::TFace::GetVInd(), SMESH_Block::TFace::IsUVInQuad(), SMESH_Block::TFace::Point(), and saveBetterSolution().
Referenced by refineParametersOnFace().
◆ funcValue()
◆ GetCoordIndOnEdge()
|
static |
Referenced by SMESH_Pattern::Load(), SMESH_Block::TEdge::Set(), and StdMeshers_Penta_3D::SetHorizEdgeXYZ().
◆ GetEdgeVertexIDs()
|
static |
References ID_E00z, ID_E01z, ID_E0y0, ID_E0y1, ID_E10z, ID_E11z, ID_E1y0, ID_E1y1, ID_Ex00, ID_Ex01, ID_Ex10, ID_Ex11, ID_V000, ID_V001, ID_V010, ID_V011, ID_V100, ID_V101, ID_V110, and ID_V111.
Referenced by SMESH_Pattern::Apply(), StdMeshers_Projection_3D::Compute(), EdgeParameters(), StdMeshers_PrismAsBlock::Init(), and LoadMeshBlock().
◆ GetFaceEdgesIDs()
|
static |
References ID_E00z, ID_E01z, ID_E0y0, ID_E0y1, ID_E10z, ID_E11z, ID_E1y0, ID_E1y1, ID_Ex00, ID_Ex01, ID_Ex10, ID_Ex11, ID_F0yz, ID_F1yz, ID_Fx0z, ID_Fx1z, ID_Fxy0, and ID_Fxy1.
Referenced by SMESH_Pattern::Apply(), StdMeshers_Projection_3D::Compute(), StdMeshers_PrismAsBlock::Init(), LoadFace(), LoadMeshBlock(), and StdMeshers_Penta_3D::SetHorizEdgeXYZ().
◆ GetOrderedEdges()
|
static |
Return number of wires and a list of oredered edges.
- Parameters
-
theFace - the face to process theEdges - all ordered edges of theFace (outer edges go first). theNbEdgesInWires - nb of edges (== nb of vertices in closed wire) in each wire theFirstVertex - the vertex of the outer wire to set first in the returned list ( theFirstVertex may be NULL ) theShapeAnalysisAlgo - if true, ShapeAnalysis::OuterWire() is used to find the outer wire else BRepTools::OuterWire() is used.
- Return values
-
int - nb of wires
Always try to set a seam edge first. BRepTools::OuterWire() fails e.g. in the case of issue 0020184, ShapeAnalysis::OuterWire() fails in the case of issue 0020452
Referenced by SMESH_Pattern::Apply(), StdMeshers_Quadrangle_2D::CheckNbEdges(), StdMeshers_Quadrangle_2D::checkNbEdgesForEvaluate(), StdMeshers_Projection_2D::Compute(), FindBlockShapes(), StdMeshers_ProjectionUtils::FindFaceAssociation(), StdMeshers_FaceSide::GetFaceWires(), SMESH_MesherHelper::IsStructured(), and SMESH_Pattern::Load().
◆ GetShapeCoef()
|
static |
Referenced by ComputeParameters().
◆ GetShapeIDByParams()
|
static |
Referenced by StdMeshers_Penta_3D::FindNodeOnShape().
◆ GetStateNumber()
Standard_Integer SMESH_Block::GetStateNumber | ( | ) |
◆ GetTolerance()
double SMESH_Block::GetTolerance | ( | ) | const |
◆ init()
|
protected |
Call it after geometry initialisation.
References myGridComputed, myNbIterations, and mySumDist.
Referenced by StdMeshers_PrismAsBlock::Init(), LoadBlockShapes(), LoadMeshBlock(), and DocumentObject.DocumentObject::onChanged().
◆ Insert()
|
static |
/ Insert theShape into theShapeIDMap with theShapeID
- Parameters
-
theShape - shape to insert theShapeID - shape in-block ID theShapeIDMap - map of block sub-shapes
Referenced by StdMeshers_PrismAsBlock::Init().
◆ IsEdgeID()
|
static |
◆ IsFaceID()
|
static |
Referenced by ComputeParameters(), StdMeshers_Penta_3D::FindNodeOnShape(), LoadFace(), and StdMeshers_SMESHBlock::Point().
◆ IsForwardEdge()
|
static |
Referenced by StdMeshers_SMESHBlock::IsForwadEdge(), SMESH_Pattern::Load(), LoadBlockShapes(), and LoadFace().
◆ IsToleranceReached()
bool SMESH_Block::IsToleranceReached | ( | ) | const |
References distance(), and myTolerance.
◆ IsVertexID()
|
static |
◆ LoadBlockShapes() [1/2]
bool SMESH_Block::LoadBlockShapes | ( | const TopoDS_Shell & | theShell, |
const TopoDS_Vertex & | theVertex000, | ||
const TopoDS_Vertex & | theVertex001, | ||
TopTools_IndexedMapOfOrientedShape & | theShapeIDMap | ||
) |
References FindBlockShapes().
Referenced by StdMeshers_Projection_3D::Compute(), and StdMeshers_SMESHBlock::Load().
◆ LoadBlockShapes() [2/2]
bool SMESH_Block::LoadBlockShapes | ( | const TopTools_IndexedMapOfOrientedShape & | theShapeIDMap | ) |
Initialize block geometry with shapes from theShapeIDMap.
- Parameters
-
theShapeIDMap - map of block sub-shapes
- Return values
-
bool - is a success
References ID_FirstE, ID_V000, ID_V111, init(), IsEdgeID(), IsForwardEdge(), IsVertexID(), LoadFace(), myEdge, myPnt, and SMESH_Block::TEdge::Set().
◆ LoadFace()
bool SMESH_Block::LoadFace | ( | const TopoDS_Face & | theFace, |
const int | theFaceID, | ||
const TopTools_IndexedMapOfOrientedShape & | theShapeIDMap | ||
) |
Load face geometry.
- Parameters
-
theFace - face theFaceID - face in-block ID theShapeIDMap - map of block sub-shapes
- Return values
-
bool - is a success
It is enough to compute params or coordinates on the face. Face sub-shapes must be loaded into theShapeIDMap before
References GetFaceEdgesIDs(), ID_FirstF, IsFaceID(), IsForwardEdge(), myFace, and SMESH_Block::TFace::Set().
Referenced by LoadBlockShapes().
◆ LoadMeshBlock()
bool SMESH_Block::LoadMeshBlock | ( | const SMDS_MeshVolume * | theVolume, |
const int | theNode000Index, | ||
const int | theNode001Index, | ||
std::vector< const SMDS_MeshNode * > & | theOrderedNodes | ||
) |
References DraftVecUtils::find(), GetEdgeVertexIDs(), GetFaceEdgesIDs(), SMDS_VolumeTool::GetFaceNodesIndices(), SMDS_VolumeTool::GetNodes(), ID_Ex00, ID_FirstE, ID_FirstF, ID_Fxy0, ID_Shell, ID_V000, ID_V001, ID_V010, ID_V011, ID_V100, ID_V101, ID_V110, ID_V111, init(), SMDS_VolumeTool::IsLinked(), myEdge, myFace, myPnt, NbEdges(), SMDS_VolumeTool::NbFaces(), SMDS_VolumeTool::NbNodes(), SMDS_VolumeTool::Set(), SMESH_Block::TEdge::Set(), SMESH_Block::TFace::Set(), and SMDS_VolumeTool::SetExternalNormal().
◆ NbEdges()
|
static |
Referenced by LoadMeshBlock(), and StdMeshers_SMESHBlock::StdMeshers_SMESHBlock().
◆ NbEquations()
Standard_Integer SMESH_Block::NbEquations | ( | ) | const |
◆ NbFaces()
|
static |
Referenced by StdMeshers_Penta_3D::StdMeshers_Penta_3D().
◆ NbSubShapes()
|
static |
Referenced by StdMeshers_Penta_3D::StdMeshers_Penta_3D().
◆ NbVariables()
Standard_Integer SMESH_Block::NbVariables | ( | ) | const |
◆ NbVertices()
|
static |
◆ refineParametersOnFace()
|
protected |
Find more precise solution.
- Parameters
-
[in] thePoint - the point [in,out] theParams - solution to precise [in] theFaceID - FACE ID
References distance(), findUVAround(), findUVByHalfDivision(), SMESH_Block::TFace::GetUInd(), SMESH_Block::TFace::GetVInd(), ID_FirstF, myFace, myTolerance, SMESH_Block::TFace::Point(), and SMESH_Block::TFace::Surface().
Referenced by ComputeParameters(), and computeParameters().
◆ saveBetterSolution()
|
protected |
Store a solution if it's better than a previous one.
- Parameters
-
[in] theNewParams - a new solution [out] theParams - the parameters to store solution in [in] sqDistance - a square distance reached at theNewParams
- Returns
- bool - true if the reached distance is within the tolerance
References distance(), myTolerance, myValues, and SQUARE_DIST.
Referenced by findUVAround(), and findUVByHalfDivision().
◆ SetTolerance()
void SMESH_Block::SetTolerance | ( | const double | tol | ) |
References myTolerance.
◆ ShapeIndex()
|
static |
◆ ShellPoint() [1/2]
|
static |
◆ ShellPoint() [2/2]
bool SMESH_Block::ShellPoint | ( | const gp_XYZ & | theParams, |
gp_XYZ & | thePoint | ||
) | const |
Referenced by SMESH_MesherHelper::AddVolume(), StdMeshers_HexaFromSkin_3D::Compute(), StdMeshers_Projection_3D::Compute(), StdMeshers_CompositeHexa_3D::Compute(), StdMeshers_Hexa_3D::Compute(), ComputeParameters(), StdMeshers_Penta_3D::CreateNode(), SMESH_MesherHelper::FixQuadraticElements(), StdMeshers_SMESHBlock::Point(), Value(), and Values().
◆ Value()
Standard_Boolean SMESH_Block::Value | ( | const math_Vector & | X, |
math_Vector & | F | ||
) |
References funcValue(), myParam, myPoint, myValues, ShellPoint(), and SQUARE_DIST.
◆ Values()
Standard_Boolean SMESH_Block::Values | ( | const math_Vector & | X, |
math_Vector & | F, | ||
math_Matrix & | D | ||
) |
References DRV_1, DRV_2, DRV_3, funcValue(), myFaceIndex, myNbIterations, myParam, myPoint, myTolerance, myValues, ShellPoint(), and SQUARE_DIST.
Referenced by Derivatives().
◆ VertexParameters()
bool SMESH_Block::VertexParameters | ( | const int | theVertexID, |
gp_XYZ & | theParams | ||
) |
References ID_V000, ID_V010, ID_V100, and ID_V110.
Referenced by ComputeParameters(), and EdgeParameters().
◆ VertexPoint()
bool SMESH_Block::VertexPoint | ( | const int | theVertexID, |
gp_XYZ & | thePoint | ||
) | const |
Referenced by StdMeshers_SMESHBlock::Point().
Member Data Documentation
◆ my3x3x3GridNodes
|
protected |
Referenced by ComputeParameters().
◆ myEdge
|
protected |
Referenced by ComputeParameters(), EdgeParameters(), StdMeshers_PrismAsBlock::Init(), LoadBlockShapes(), and LoadMeshBlock().
◆ myFace
|
protected |
Referenced by StdMeshers_PrismAsBlock::Init(), LoadFace(), LoadMeshBlock(), and refineParametersOnFace().
◆ myFaceIndex
|
protected |
Referenced by ComputeParameters(), computeParameters(), and Values().
◆ myFaceParam
|
protected |
Referenced by ComputeParameters(), and computeParameters().
◆ myGridComputed
|
protected |
Referenced by ComputeParameters(), and init().
◆ myNbIterations
|
protected |
Referenced by ComputeParameters(), computeParameters(), init(), and Values().
◆ myParam
|
protected |
Referenced by computeParameters(), Value(), and Values().
◆ myPnt
|
protected |
Referenced by StdMeshers_PrismAsBlock::Init(), LoadBlockShapes(), and LoadMeshBlock().
◆ myPoint
|
protected |
Referenced by computeParameters(), Value(), and Values().
◆ mySquareFunc
|
protected |
Referenced by computeParameters().
◆ mySumDist
|
protected |
Referenced by ComputeParameters(), computeParameters(), and init().
◆ myTolerance
|
protected |
Referenced by ComputeParameters(), computeParameters(), IsToleranceReached(), refineParametersOnFace(), saveBetterSolution(), SetTolerance(), and Values().
◆ myValues
|
protected |
Referenced by ComputeParameters(), computeParameters(), saveBetterSolution(), Value(), and Values().
The documentation for this class was generated from the following files:
- src/3rdParty/salomesmesh/inc/SMESH_Block.hxx
- src/3rdParty/salomesmesh/src/SMESH/SMESH_Block.cpp