Version: 8.3.0
StdMeshers_FaceSide Class Reference

Represents a side of a quasi quadrilateral face. More...

#include <StdMeshers_FaceSide.hxx>

Public Types

enum  { ALL_EDGES = -1, LAST_EDGE = -1 }
 

Public Member Functions

 StdMeshers_FaceSide (const TopoDS_Face &theFace, const TopoDS_Edge &theEdge, SMESH_Mesh *theMesh, const bool theIsForward, const bool theIgnoreMediumNodes, SMESH_MesherHelper *theFaceHelper=NULL, SMESH_ProxyMesh::Ptr theProxyMesh=SMESH_ProxyMesh::Ptr())
 Wrap one edge. More...
 
 StdMeshers_FaceSide (const TopoDS_Face &theFace, std::list< TopoDS_Edge > &theEdges, SMESH_Mesh *theMesh, const bool theIsForward, const bool theIgnoreMediumNodes, SMESH_MesherHelper *theFaceHelper=NULL, SMESH_ProxyMesh::Ptr theProxyMesh=SMESH_ProxyMesh::Ptr())
 Wrap several edges. More...
 
 StdMeshers_FaceSide (const StdMeshers_FaceSide *theSide, const SMDS_MeshNode *theNode, const gp_Pnt2d *thePnt2d1, const gp_Pnt2d *thePnt2d2=NULL, const Handle(Geom2d_Curve)&theC2d=NULL, const double theUFirst=0., const double theULast=1.)
 Simulate a side from a vertex using data from other FaceSide. More...
 
 StdMeshers_FaceSide (UVPtStructVec &theSideNodes, const TopoDS_Face &theFace=TopoDS_Face(), const TopoDS_Edge &theEdge=TopoDS_Edge(), SMESH_Mesh *theMesh=0)
 Create a side from an UVPtStructVec. More...
 
 ~StdMeshers_FaceSide ()
 Destructor. More...
 
void Reverse ()
 Change orientation of side geometry. More...
 
void SetIgnoreMediumNodes (bool toIgnore)
 Make ignore medium nodes. More...
 
int NbPoints (const bool update=false) const
 Return nb nodes on edges and vertices (+1 to be == GetUVPtStruct().size() ). More...
 
int NbSegments (const bool update=false) const
 Return nb edges Call it with update == true if mesh of this side can be recomputed since creation of this side. More...
 
SMESH_MeshGetMesh () const
 Return mesh. More...
 
bool MissVertexNode () const
 Return true if there are vertices without nodes. More...
 
const UVPtStructVecGetUVPtStruct (bool isXConst=0, double constValue=0) const
 Return detailed data on nodes. More...
 
const UVPtStructVecSimulateUVPtStruct (int nbSeg, bool isXConst=0, double constValue=0) const
 Simulates detailed data on nodes. More...
 
std::vector< const
SMDS_MeshNode * > 
GetOrderedNodes (int iE=ALL_EDGES) const
 Return nodes in the order they encounter while walking along the while side or a specified EDGE. More...
 
bool GetEdgeNodes (const size_t i, std::vector< const SMDS_MeshNode * > &nodes, bool inlude1stVertex=true, bool inludeLastVertex=true) const
 Return nodes of the i-th EDGE. More...
 
const SMDS_MeshNodeVertexNode (std::size_t i, bool *isMoved=0) const
 Return a node from the i-th VERTEX (count starts from zero) Nodes moved to other geometry by MergeNodes() are also returned. More...
 
double Parameter (double U, TopoDS_Edge &edge) const
 Return an edge and parameter on the edge by a normalized parameter. More...
 
double Parameter (double U, int &edgeID) const
 Return an edge ID and parameter on the edge by a normalized parameter. More...
 
gp_Pnt2d Value2d (double U) const
 Return UV by normalized parameter. More...
 
gp_Pnt Value3d (double U) const
 Return XYZ by normalized parameter. More...
 
Adaptor2d_Curve2dGetCurve2d () const
 Creates a Adaptor2d_Curve2d to be used in SMESH_Block. More...
 
BRepAdaptor_CompCurve * GetCurve3d () const
 Creates a fully functional Adaptor_Curve. More...
 
int NbEdges () const
 Return nb of wrapped edges. More...
 
const TopoDS_Edge & Edge (int i) const
 Return i-th edge (count starts from zero) More...
 
const std::vector< TopoDS_Edge > & Edges () const
 Return all edges. More...
 
const TopoDS_Face & Face () const
 Return the FACE. More...
 
TopoDS_Vertex FirstVertex (int i=0) const
 Return 1st vertex of the i-th edge (count starts from zero) More...
 
TopoDS_Vertex LastVertex (int i=LAST_EDGE) const
 Return last vertex of the i-th edge (count starts from zero) More...
 
bool IsClosed () const
 Return true if the chain of EDGEs is closed. More...
 
double Length () const
 Return side length. More...
 
int EdgeIndex (double U) const
 Return edge index corresponding to normalized parameter. More...
 
void dump (const char *msg=0) const
 Show side features. More...
 
int EdgeID (int i) const
 Return ID of i-th wrapped edge (count starts from zero) More...
 
 Handle (Geom2d_Curve) Curve2d(int i) const
 Return p-curve of i-th wrapped edge (count starts from zero) More...
 
double FirstParameter (int i) const
 Return first normalized parameter of the i-th edge (count starts from zero) More...
 
double LastParameter (int i) const
 Return last normalized parameter of the i-th edge (count starts from zero) More...
 
double FirstU (int i) const
 Return first parameter of the i-th edge (count starts from zero). More...
 
double LastU (int i) const
 Return last parameter of the i-th edge (count starts from zero). More...
 
double EdgeLength (int i) const
 Return length of i-th wrapped edge (count starts from zero) More...
 
bool IsReversed (int i) const
 Return orientation of i-th wrapped edge (count starts from zero) More...
 
SMESH_MesherHelperFaceHelper () const
 Return a helper initialized with the FACE. More...
 

Static Public Member Functions

static StdMeshers_FaceSidePtr New (const TopoDS_Face &Face, const TopoDS_Edge &Edge, SMESH_Mesh *Mesh, const bool IsForward, const bool IgnoreMediumNodes, SMESH_MesherHelper *FaceHelper=NULL, SMESH_ProxyMesh::Ptr ProxyMesh=SMESH_ProxyMesh::Ptr())
 
static StdMeshers_FaceSidePtr New (const TopoDS_Face &Face, std::list< TopoDS_Edge > &Edges, SMESH_Mesh *Mesh, const bool IsForward, const bool IgnoreMediumNodes, SMESH_MesherHelper *FaceHelper=NULL, SMESH_ProxyMesh::Ptr ProxyMesh=SMESH_ProxyMesh::Ptr())
 
static StdMeshers_FaceSidePtr New (const StdMeshers_FaceSide *Side, const SMDS_MeshNode *Node, const gp_Pnt2d *Pnt2d1, const gp_Pnt2d *Pnt2d2=NULL, const Handle(Geom2d_Curve)&C2d=NULL, const double UFirst=0., const double ULast=1.)
 
static StdMeshers_FaceSidePtr New (UVPtStructVec &theSideNodes, const TopoDS_Face &theFace=TopoDS_Face())
 
static TSideVector GetFaceWires (const TopoDS_Face &theFace, SMESH_Mesh &theMesh, const bool theIgnoreMediumNodes, TError &theError, SMESH_MesherHelper *theFaceHelper=NULL, SMESH_ProxyMesh::Ptr theProxyMesh=SMESH_ProxyMesh::Ptr(), const bool theCheckVertexNodes=true)
 Return wires of a face as StdMeshers_FaceSide's. More...
 

Protected Member Functions

void reverseProxySubmesh (const TopoDS_Edge &E)
 Reverse UVPtStructVec if a proxy sub-mesh of E. More...
 

Protected Attributes

TopoDS_Face myFace
 
std::vector< uvPtStructmyPoints
 
std::vector< uvPtStructmyFalsePoints
 
std::vector< TopoDS_Edge > myEdge
 
std::vector< intmyEdgeID
 
std::vector< Handle(Geom2d_Curve)> myC2d
 
std::vector< GeomAdaptor_Curve > myC3dAdaptor
 
std::vector< double > myFirst
 
std::vector< double > myLast
 
std::vector< double > myNormPar
 
std::vector< double > myEdgeLength
 
std::vector< intmyIsUniform
 
double myLength
 
int myNbPonits
 
int myNbSegments
 
SMESH_ProxyMesh::Ptr myProxyMesh
 
bool myMissingVertexNodes
 
bool myIgnoreMediumNodes
 
gp_Pnt2d myDefaultPnt2d
 
SMESH_MesherHelpermyHelper
 

Detailed Description

Represents a side of a quasi quadrilateral face.

It can be composed of several edges. Gives access to geometry and 1D mesh of a side.

Member Enumeration Documentation

anonymous enum
Enumerator
ALL_EDGES 
LAST_EDGE 

Constructor & Destructor Documentation

StdMeshers_FaceSide::StdMeshers_FaceSide ( const TopoDS_Face &  theFace,
const TopoDS_Edge &  theEdge,
SMESH_Mesh theMesh,
const bool  theIsForward,
const bool  theIgnoreMediumNodes,
SMESH_MesherHelper theFaceHelper = NULL,
SMESH_ProxyMesh::Ptr  theProxyMesh = SMESH_ProxyMesh::Ptr() 
)

Wrap one edge.

Constructor of a side of one edge.

Parameters
theFace- the face
theEdge- the edge

References myHelper.

StdMeshers_FaceSide::StdMeshers_FaceSide ( const TopoDS_Face &  theFace,
std::list< TopoDS_Edge > &  theEdges,
SMESH_Mesh theMesh,
const bool  theIsForward,
const bool  theIgnoreMediumNodes,
SMESH_MesherHelper theFaceHelper = NULL,
SMESH_ProxyMesh::Ptr  theProxyMesh = SMESH_ProxyMesh::Ptr() 
)

Wrap several edges.

Constructor of a side of several edges.

Edges must be properly ordered and oriented.

References SMESH_MesherHelper::CopySubShapeInfo(), SMESH_Algo::EdgeLength(), SMESH_MesherHelper::GetSubShape(), Handle(), SMESH_MesherHelper::IthVertex(), and SMESHDS_Mesh::ShapeToIndex().

StdMeshers_FaceSide::StdMeshers_FaceSide ( const StdMeshers_FaceSide theSide,
const SMDS_MeshNode theNode,
const gp_Pnt2d *  thePnt2d1,
const gp_Pnt2d *  thePnt2d2 = NULL,
const Handle(Geom2d_Curve)&  theC2d = NULL,
const double  theUFirst = 0.,
const double  theULast = 1. 
)

Simulate a side from a vertex using data from other FaceSide.

Constructor of a side for vertex using data from other FaceSide.

References GetUVPtStruct(), myNbSegments, myProxyMesh, and SMDS_MeshNode::X().

StdMeshers_FaceSide::StdMeshers_FaceSide ( UVPtStructVec theSideNodes,
const TopoDS_Face &  theFace = TopoDS_Face(),
const TopoDS_Edge &  theEdge = TopoDS_Edge(),
SMESH_Mesh theMesh = 0 
)

Create a side from an UVPtStructVec.

References Handle().

StdMeshers_FaceSide::~StdMeshers_FaceSide ( )

Destructor.

Member Function Documentation

void StdMeshers_FaceSide::dump ( const char *  msg = 0) const

Show side features.

References MESSAGE, and MED::Print().

const TopoDS_Edge& StdMeshers_FaceSide::Edge ( int  i) const
int StdMeshers_FaceSide::EdgeID ( int  i) const
int StdMeshers_FaceSide::EdgeIndex ( double  U) const

Return edge index corresponding to normalized parameter.

Parameters
U- the parameter
Return values
int- index
double StdMeshers_FaceSide::EdgeLength ( int  i) const

Return length of i-th wrapped edge (count starts from zero)

Referenced by VISCOUS_2D::_ViscousBuilder2D::shrink().

const std::vector<TopoDS_Edge>& StdMeshers_FaceSide::Edges ( ) const

Return all edges.

const TopoDS_Face& StdMeshers_FaceSide::Face ( ) const

Return the FACE.

Referenced by StdMeshers_ViscousLayers2D::SetProxyMeshOfEdge().

SMESH_MesherHelper * StdMeshers_FaceSide::FaceHelper ( ) const

Return a helper initialized with the FACE.

References me, myHelper, and SMESH_MesherHelper::SetSubShape().

double StdMeshers_FaceSide::FirstParameter ( int  i) const

Return first normalized parameter of the i-th edge (count starts from zero)

Return first normalized parameter of the i-th edge.

Referenced by VISCOUS_2D::_ViscousBuilder2D::refine().

double StdMeshers_FaceSide::FirstU ( int  i) const

Return first parameter of the i-th edge (count starts from zero).

Return first parameter of the i-th edge.

EDGE orientation is taken into account

Referenced by VISCOUS_2D::_ViscousBuilder2D::refine(), and VISCOUS_2D::_ViscousBuilder2D::shrink().

TopoDS_Vertex StdMeshers_FaceSide::FirstVertex ( int  i = 0) const

Return 1st vertex of the i-th edge (count starts from zero)

Return 1st vertex of the i-the edge.

Referenced by StdMeshers_CompositeSegment_1D::Compute(), VISCOUS_2D::_ViscousBuilder2D::refine(), and VISCOUS_2D::_ViscousBuilder2D::shrink().

Adaptor2d_Curve2d * StdMeshers_FaceSide::GetCurve2d ( ) const

Creates a Adaptor2d_Curve2d to be used in SMESH_Block.

BRepAdaptor_CompCurve * StdMeshers_FaceSide::GetCurve3d ( ) const

Creates a fully functional Adaptor_Curve.

Referenced by StdMeshers_CompositeSegment_1D::Compute().

bool StdMeshers_FaceSide::GetEdgeNodes ( const size_t  i,
std::vector< const SMDS_MeshNode * > &  nodes,
bool  inlude1stVertex = true,
bool  inludeLastVertex = true 
) const

Return nodes of the i-th EDGE.

Return (unsorted) nodes of the i-th EDGE.

   Nodes moved to other geometry by MergeNodes() are also returned.
Return values
bool- is OK

References SMESHDS_SubMesh::GetElements(), SMDS_MeshElement::GetNode(), SMESHDS_SubMesh::GetNodes(), SMDS_MeshElement::GetType(), SMESH_MeshEditor::IsMedium(), SMESHDS_Mesh::MeshElements(), SMESHDS_SubMesh::NbElements(), SMESHDS_SubMesh::NbNodes(), and SMDSAbs_Edge.

SMESH_Mesh* StdMeshers_FaceSide::GetMesh ( ) const
std::vector< const SMDS_MeshNode * > StdMeshers_FaceSide::GetOrderedNodes ( int  iE = ALL_EDGES) const

Return nodes in the order they encounter while walking along the while side or a specified EDGE.

For a closed side, the 1st point repeats at end.

Parameters
iE- index of the EDGE. Default is "all EDGEs".

References SMESH::GetEdgeNodes(), SMDS_MeshElement::getshapeId(), and SMESH_ProxyMesh::SubMesh::GetUVPtStructVec().

const std::vector< UVPtStruct > & StdMeshers_FaceSide::GetUVPtStruct ( bool  isXConst = 0,
double  constValue = 0 
) const

Return detailed data on nodes.

Parameters
isXConst- true if normalized parameter X is constant
constValue- constant parameter value

Missing nodes are allowed only on internal vertices. For a closed side, the 1st point repeats at end

References SMESH::GetEdgeNodes(), SMDS_MeshNode::GetPosition(), SMDS_MeshElement::getshapeId(), SMDS_EdgePosition::GetUParameter(), me, myC3dAdaptor, myPoints, uvPtStruct::node, uvPtStruct::normParam, uvPtStruct::param, reverse(), uvPtStruct::u, uvPtStruct::v, uvPtStruct::x, and uvPtStruct::y.

Referenced by VISCOUS_2D::_ViscousBuilder2D::adjustCommonEdge(), VISCOUS_2D::_ViscousBuilder2D::refine(), StdMeshers_ViscousLayers2D::SetProxyMeshOfEdge(), VISCOUS_2D::_ViscousBuilder2D::shrink(), and StdMeshers_FaceSide().

StdMeshers_FaceSide::Handle ( Geom2d_Curve  ) const

Return p-curve of i-th wrapped edge (count starts from zero)

bool StdMeshers_FaceSide::IsClosed ( ) const

Return true if the chain of EDGEs is closed.

bool StdMeshers_FaceSide::IsReversed ( int  i) const

Return orientation of i-th wrapped edge (count starts from zero)

double StdMeshers_FaceSide::LastParameter ( int  i) const

Return last normalized parameter of the i-th edge (count starts from zero)

Return ast normalized parameter of the i-th edge.

Referenced by VISCOUS_2D::_ViscousBuilder2D::refine().

double StdMeshers_FaceSide::LastU ( int  i) const

Return last parameter of the i-th edge (count starts from zero).

Return last parameter of the i-th edge.

EDGE orientation is taken into account

Referenced by VISCOUS_2D::_ViscousBuilder2D::refine(), and VISCOUS_2D::_ViscousBuilder2D::shrink().

TopoDS_Vertex StdMeshers_FaceSide::LastVertex ( int  i = LAST_EDGE) const

Return last vertex of the i-th edge (count starts from zero)

Return last vertex of the i-the edge.

Referenced by StdMeshers_CompositeSegment_1D::Compute(), VISCOUS_2D::_ViscousBuilder2D::refine(), and VISCOUS_2D::_ViscousBuilder2D::shrink().

double StdMeshers_FaceSide::Length ( ) const

Return side length.

Referenced by StdMeshers_CompositeSegment_1D::Compute().

bool StdMeshers_FaceSide::MissVertexNode ( ) const

Return true if there are vertices without nodes.

int StdMeshers_FaceSide::NbEdges ( ) const
int StdMeshers_FaceSide::NbPoints ( const bool  update = false) const

Return nb nodes on edges and vertices (+1 to be == GetUVPtStruct().size() ).

Call it with update == true if mesh of this side can be recomputed since creation of this side

References Edge, SMESH::GetEdgeNodes(), SMESH_MesherHelper::IsDegenShape(), SMESH_MesherHelper::IsRealSeam(), me, myMissingVertexNodes, myNbPonits, and myNbSegments.

Referenced by StdMeshers_Quadrangle_2D::getCorners().

int StdMeshers_FaceSide::NbSegments ( const bool  update = false) const

Return nb edges Call it with update == true if mesh of this side can be recomputed since creation of this side.

Referenced by StdMeshers_Quadrangle_2D::getCorners().

static StdMeshers_FaceSidePtr StdMeshers_FaceSide::New ( const TopoDS_Face &  Face,
std::list< TopoDS_Edge > &  Edges,
SMESH_Mesh Mesh,
const bool  IsForward,
const bool  IgnoreMediumNodes,
SMESH_MesherHelper FaceHelper = NULL,
SMESH_ProxyMesh::Ptr  ProxyMesh = SMESH_ProxyMesh::Ptr() 
)
static
static StdMeshers_FaceSidePtr StdMeshers_FaceSide::New ( const StdMeshers_FaceSide Side,
const SMDS_MeshNode Node,
const gp_Pnt2d *  Pnt2d1,
const gp_Pnt2d *  Pnt2d2 = NULL,
const Handle(Geom2d_Curve)&  C2d = NULL,
const double  UFirst = 0.,
const double  ULast = 1. 
)
static
static StdMeshers_FaceSidePtr StdMeshers_FaceSide::New ( UVPtStructVec theSideNodes,
const TopoDS_Face &  theFace = TopoDS_Face() 
)
static
double StdMeshers_FaceSide::Parameter ( double  U,
TopoDS_Edge &  edge 
) const

Return an edge and parameter on the edge by a normalized parameter.

Parameters
U- normalized parameter
Return values
double- pameter on a curve \ warning The returned parameter can be inaccurate if the edge is non-uniformly parametrized. Use Value2d() to get a precise point on the edge
double StdMeshers_FaceSide::Parameter ( double  U,
int edgeID 
) const

Return an edge ID and parameter on the edge by a normalized parameter.

Parameters
U- normalized parameter
Return values
double- pameter on a curve \ warning The returned parameter can be inaccurate if the edge is non-uniformly parametrized. Use Value2d() to get a precise point on the edge
void StdMeshers_FaceSide::Reverse ( )

Change orientation of side geometry.

References Handle(), uvPtStruct::normParam, reverse(), uvPtStruct::x, and uvPtStruct::y.

void StdMeshers_FaceSide::reverseProxySubmesh ( const TopoDS_Edge &  E)
protected

Reverse UVPtStructVec if a proxy sub-mesh of E.

References uvPtStruct::normParam, reverse(), uvPtStruct::x, and uvPtStruct::y.

void StdMeshers_FaceSide::SetIgnoreMediumNodes ( bool  toIgnore)

Make ignore medium nodes.

const vector< UVPtStruct > & StdMeshers_FaceSide::SimulateUVPtStruct ( int  nbSeg,
bool  isXConst = 0,
double  constValue = 0 
) const

Simulates detailed data on nodes.

Falsificate info on nodes.

Parameters
isXConst- true if normalized parameter X is constant
constValue- constant parameter value
nbSeg- nb of segments on the side
Return values
UVPtStruct*- array of data structures

References uvPtStruct::node, uvPtStruct::normParam, uvPtStruct::param, uvPtStruct::u, uvPtStruct::v, uvPtStruct::x, and uvPtStruct::y.

gp_Pnt2d StdMeshers_FaceSide::Value2d ( double  U) const

Return UV by normalized parameter.

Return 2D point by normalized parameter.

Parameters
U- normalized parameter value
Return values
gp_Pnt2d- point
gp_Pnt StdMeshers_FaceSide::Value3d ( double  U) const

Return XYZ by normalized parameter.

Parameters
U- normalized parameter value
Return values
gp_Pnt- point
const SMDS_MeshNode * StdMeshers_FaceSide::VertexNode ( std::size_t  i,
bool isMoved = 0 
) const

Return a node from the i-th VERTEX (count starts from zero) Nodes moved to other geometry by MergeNodes() are also returned.

Parameters
[in]i- the VERTEX index
[out]isMoved- returns true if the found node is moved by MergeNodes()
Returns
const SMDS_MeshNode* - the found node

References SMDS_Position::GetDim(), SMDS_MeshNode::GetPosition(), SMESH_MesherHelper::GetSubShapeByNode(), SMESH_MesherHelper::IsSubShape(), SMESH_Algo::VertexNode(), and SMESH_MesherHelper::WrapIndex().

Referenced by StdMeshers_Quadrangle_2D::getCorners().

Field Documentation

std::vector<Handle(Geom2d_Curve)> StdMeshers_FaceSide::myC2d
protected
std::vector<GeomAdaptor_Curve> StdMeshers_FaceSide::myC3dAdaptor
protected

Referenced by GetUVPtStruct().

gp_Pnt2d StdMeshers_FaceSide::myDefaultPnt2d
protected
std::vector<TopoDS_Edge> StdMeshers_FaceSide::myEdge
protected
std::vector<int> StdMeshers_FaceSide::myEdgeID
protected
std::vector<double> StdMeshers_FaceSide::myEdgeLength
protected
TopoDS_Face StdMeshers_FaceSide::myFace
protected
std::vector<uvPtStruct> StdMeshers_FaceSide::myFalsePoints
protected
std::vector<double> StdMeshers_FaceSide::myFirst
protected
SMESH_MesherHelper* StdMeshers_FaceSide::myHelper
protected

Referenced by FaceHelper(), and StdMeshers_FaceSide().

bool StdMeshers_FaceSide::myIgnoreMediumNodes
protected
std::vector<int> StdMeshers_FaceSide::myIsUniform
protected
std::vector<double> StdMeshers_FaceSide::myLast
protected
double StdMeshers_FaceSide::myLength
protected
bool StdMeshers_FaceSide::myMissingVertexNodes
protected

Referenced by NbPoints().

int StdMeshers_FaceSide::myNbPonits
protected

Referenced by NbPoints().

int StdMeshers_FaceSide::myNbSegments
protected

Referenced by NbPoints(), and StdMeshers_FaceSide().

std::vector<double> StdMeshers_FaceSide::myNormPar
protected
std::vector<uvPtStruct> StdMeshers_FaceSide::myPoints
protected

Referenced by GetUVPtStruct().

SMESH_ProxyMesh::Ptr StdMeshers_FaceSide::myProxyMesh
protected

Referenced by StdMeshers_FaceSide().