#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] |
|
protected |
SMESH_Block::SMESH_Block | ( | ) |
|
protected |
References distance(), myFaceIndex, myFaceParam, myNbIterations, myParam, myPoint, mySquareFunc, mySumDist, myTolerance, myValues, refineParametersOnFace(), and SQUARE_DIST.
Referenced by 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().
Standard_Boolean SMESH_Block::Derivatives | ( | const math_Vector & | X, |
math_Matrix & | D | ||
) |
References Values().
|
protected |
double SMESH_Block::DistanceReached | ( | ) | const |
|
static |
References GetEdgeVertexIDs(), ID_Ex00, IsEdgeID(), myEdge, draftguitools.gui_annotationstyleeditor::param, and VertexParameters().
Referenced by StdMeshers_SMESHBlock::ComputeParameters(), and ComputeParameters().
bool SMESH_Block::EdgePoint | ( | const int | theEdgeID, |
const gp_XYZ & | theParams, | ||
gp_XYZ & | thePoint | ||
) | const |
Referenced by StdMeshers_SMESHBlock::Point(), StdMeshers_Penta_3D::SetHorizEdgeXYZ(), and ShellPoint().
bool SMESH_Block::FacePoint | ( | const int | theFaceID, |
const gp_XYZ & | theParams, | ||
gp_XYZ & | thePoint | ||
) | const |
Referenced by StdMeshers_SMESHBlock::Point(), and ShellPoint().
|
static |
References GetOrderedEdges().
Referenced by StdMeshers_Prism_3D::IsApplicable(), StdMeshers_Projection_3D::IsApplicable(), SMESH_MesherHelper::IsBlock(), and LoadBlockShapes().
|
protected |
Finds parameters corresponding to a given UV of a given face by searching around the starting solution.
[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 |
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().
|
protected |
Finds parameters corresponding to a given UV of a given face using half-division.
[in] | theUV | - the UV to locate |
[in] | tface | - the face |
[in,out] | theParams | - the starting parameters to improve |
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().
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().
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(), SMESH_Block::TFace::Set(), and StdMeshers_Penta_3D::SetHorizEdgeXYZ().
|
static |
Return number of wires and a list of oredered edges.
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. |
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().
|
static |
References ID_F1yz, and ID_Shell.
Referenced by ComputeParameters(), and ShellPoint().
|
static |
Referenced by StdMeshers_Penta_3D::FindNodeOnShape().
Standard_Integer SMESH_Block::GetStateNumber | ( | ) |
double SMESH_Block::GetTolerance | ( | ) | const |
|
protected |
Call it after geometry initialisation.
References myGridComputed, myNbIterations, and mySumDist.
Referenced by StdMeshers_PrismAsBlock::Init(), LoadBlockShapes(), LoadMeshBlock(), and DocumentObject.DocumentObject::onChanged().
|
static |
/ Insert theShape into theShapeIDMap with theShapeID
theShape | - shape to insert |
theShapeID | - shape in-block ID |
theShapeIDMap | - map of block sub-shapes |
Referenced by StdMeshers_PrismAsBlock::Init().
Referenced by ComputeParameters(), StdMeshers_Penta_3D::FindNodeOnShape(), LoadFace(), and StdMeshers_SMESHBlock::Point().
|
static |
Referenced by StdMeshers_SMESHBlock::IsForwadEdge(), SMESH_Pattern::Load(), LoadBlockShapes(), and LoadFace().
bool SMESH_Block::IsToleranceReached | ( | ) | const |
References distance(), and myTolerance.
bool SMESH_Block::LoadBlockShapes | ( | const TopoDS_Shell & | theShell, |
const TopoDS_Vertex & | theVertex000, | ||
const TopoDS_Vertex & | theVertex001, | ||
TopTools_IndexedMapOfOrientedShape & | theShapeIDMap | ||
) |
References FindBlockShapes(), and LoadBlockShapes().
Referenced by StdMeshers_Projection_3D::Compute(), StdMeshers_SMESHBlock::Load(), and LoadBlockShapes().
bool SMESH_Block::LoadBlockShapes | ( | const TopTools_IndexedMapOfOrientedShape & | theShapeIDMap | ) |
Initialize block geometry with shapes from theShapeIDMap.
theShapeIDMap | - map of block sub-shapes |
bool | - is a success |
References ID_FirstE, ID_V000, ID_V111, init(), IsEdgeID(), IsForwardEdge(), IsVertexID(), LoadFace(), myEdge, myPnt, and SMESH_Block::TEdge::Set().
bool SMESH_Block::LoadFace | ( | const TopoDS_Face & | theFace, |
const int | theFaceID, | ||
const TopTools_IndexedMapOfOrientedShape & | theShapeIDMap | ||
) |
Load face geometry.
theFace | - face |
theFaceID | - face in-block ID |
theShapeIDMap | - map of block sub-shapes |
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().
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(), SMESH_Block::TEdge::Set(), SMESH_Block::TFace::Set(), SMDS_VolumeTool::Set(), and SMDS_VolumeTool::SetExternalNormal().
|
static |
Referenced by LoadMeshBlock(), and StdMeshers_SMESHBlock::StdMeshers_SMESHBlock().
Standard_Integer SMESH_Block::NbEquations | ( | ) | const |
|
static |
Referenced by StdMeshers_Penta_3D::StdMeshers_Penta_3D().
|
static |
Referenced by StdMeshers_Penta_3D::StdMeshers_Penta_3D().
Standard_Integer SMESH_Block::NbVariables | ( | ) | const |
|
static |
|
protected |
Find more precise solution.
[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().
|
protected |
Store a solution if it's better than a previous one.
[in] | theNewParams | - a new solution |
[out] | theParams | - the parameters to store solution in |
[in] | sqDistance | - a square distance reached at theNewParams |
References distance(), myTolerance, myValues, and SQUARE_DIST.
Referenced by findUVAround(), and findUVByHalfDivision().
void SMESH_Block::SetTolerance | ( | const double | tol | ) |
References myTolerance.
|
static |
bool SMESH_Block::ShellPoint | ( | const gp_XYZ & | theParams, |
gp_XYZ & | thePoint | ||
) | const |
References EdgePoint(), FacePoint(), GetShapeCoef(), ID_Ex00, ID_Fxy0, ID_Shell, ID_V000, and VertexPoint().
Referenced by SMESH_MesherHelper::AddVolume(), StdMeshers_CompositeHexa_3D::Compute(), StdMeshers_Hexa_3D::Compute(), StdMeshers_Projection_3D::Compute(), StdMeshers_HexaFromSkin_3D::Compute(), ComputeParameters(), StdMeshers_Penta_3D::CreateNode(), SMESH_MesherHelper::FixQuadraticElements(), StdMeshers_SMESHBlock::Point(), Value(), and Values().
Standard_Boolean SMESH_Block::Value | ( | const math_Vector & | X, |
math_Vector & | F | ||
) |
References funcValue(), myParam, myPoint, myValues, ShellPoint(), and SQUARE_DIST.
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().
References ID_V000, ID_V010, ID_V100, and ID_V110.
Referenced by ComputeParameters(), and EdgeParameters().
Referenced by StdMeshers_SMESHBlock::Point(), and ShellPoint().
|
protected |
Referenced by ComputeParameters().
|
protected |
Referenced by ComputeParameters(), EdgeParameters(), StdMeshers_PrismAsBlock::Init(), LoadBlockShapes(), and LoadMeshBlock().
|
protected |
Referenced by StdMeshers_PrismAsBlock::Init(), LoadFace(), LoadMeshBlock(), and refineParametersOnFace().
|
protected |
Referenced by computeParameters(), ComputeParameters(), and Values().
|
protected |
Referenced by computeParameters(), and ComputeParameters().
|
protected |
Referenced by ComputeParameters(), and init().
|
protected |
Referenced by computeParameters(), ComputeParameters(), init(), and Values().
|
protected |
Referenced by computeParameters(), Value(), and Values().
|
protected |
Referenced by StdMeshers_PrismAsBlock::Init(), LoadBlockShapes(), and LoadMeshBlock().
|
protected |
Referenced by computeParameters(), Value(), and Values().
|
protected |
Referenced by computeParameters().
|
protected |
Referenced by computeParameters(), ComputeParameters(), and init().
|
protected |
Referenced by computeParameters(), ComputeParameters(), IsToleranceReached(), refineParametersOnFace(), saveBetterSolution(), SetTolerance(), and Values().
|
protected |
Referenced by computeParameters(), ComputeParameters(), saveBetterSolution(), Value(), and Values().