Version: 8.3.0
VISCOUS_3D::_LayerEdge Struct Reference

Edge normal to surface, connecting a node on solid surface (_nodes[0]) and a node of the most internal layer (_nodes.back()) More...

Public Types

enum  EFlags {
  TO_SMOOTH = 0x0000001, MOVED = 0x0000002, SMOOTHED = 0x0000004, DIFFICULT = 0x0000008,
  ON_CONCAVE_FACE = 0x0000010, BLOCKED = 0x0000020, INTERSECTED = 0x0000040, NORMAL_UPDATED = 0x0000080,
  MARKED = 0x0000100, MULTI_NORMAL = 0x0000200, NEAR_BOUNDARY = 0x0000400, SMOOTHED_C1 = 0x0000800,
  DISTORTED = 0x0001000, RISKY_SWOL = 0x0002000, SHRUNK = 0x0004000, UNUSED_FLAG = 0x0100000
}
 
enum  {
  FUN_LAPLACIAN, FUN_LENWEIGHTED, FUN_CENTROIDAL, FUN_NEFPOLY,
  FUN_ANGULAR, FUN_NB
}
 
typedef gp_XYZ(_LayerEdge::* PSmooFun )()
 

Public Member Functions

bool Is (int flag) const
 
void Set (int flag)
 
void Unset (int flag)
 
std::string DumpFlags () const
 Print flags. More...
 
void SetNewLength (double len, _EdgesOnShape &eos, SMESH_MesherHelper &helper)
 Add a new segment to _LayerEdge during inflation. More...
 
bool SetNewLength2d (Handle(Geom_Surface)&surface, const TopoDS_Face &F, _EdgesOnShape &eos, SMESH_MesherHelper &helper)
 Move target node to it's final position on the FACE during shrinking. More...
 
void SetDataByNeighbors (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const _EdgesOnShape &eos, SMESH_MesherHelper &helper)
 Set _curvature and _2neibors->_plnNorm by 2 neigbor nodes residing the same EDGE. More...
 
void Block (_SolidData &data)
 Set BLOCKED flag and propagate limited _maxLen to _neibors. More...
 
void InvalidateStep (size_t curStep, const _EdgesOnShape &eos, bool restoreLength=false)
 Remove last inflation step. More...
 
void ChooseSmooFunction (const set< TGeomID > &concaveVertices, const TNode2Edge &n2eMap)
 Chooses a smoothing technic giving a position most close to an initial one. More...
 
void SmoothPos (const vector< double > &segLen, const double tol)
 Smooth a path formed by _pos of a _LayerEdge smoothed on FACE. More...
 
int GetSmoothedPos (const double tol)
 Return index of a _pos distant from _normal. More...
 
int Smooth (const int step, const bool isConcaveFace, bool findBest)
 Perform 'smart' 3D smooth of nodes inflated from FACE. More...
 
int Smooth (const int step, bool findBest, vector< _LayerEdge * > &toSmooth)
 Perform 'smart' 3D smooth of nodes inflated from FACE. More...
 
int CheckNeiborsOnBoundary (vector< _LayerEdge * > *badNeibors=0, bool *needSmooth=0)
 Checks validity of _neibors on EDGEs and VERTEXes. More...
 
void SmoothWoCheck ()
 Perform 3D smooth of nodes inflated from FACE. More...
 
bool SmoothOnEdge (Handle(ShapeAnalysis_Surface)&surface, const TopoDS_Face &F, SMESH_MesherHelper &helper)
 Perform smooth of _LayerEdge's based on EDGE's. More...
 
void MoveNearConcaVer (const _EdgesOnShape *eov, const _EdgesOnShape *eos, const int step, vector< _LayerEdge * > &badSmooEdges)
 _LayerEdge, located at a concave VERTEX of a FACE, moves target nodes of neighbor _LayerEdge's by it's own inflation vector. More...
 
bool FindIntersection (SMESH_ElementSearcher &searcher, double &distance, const double &epsilon, _EdgesOnShape &eos, const SMDS_MeshElement **face=0)
 Looks for intersection of it's last segment with faces. More...
 
bool SegTriaInter (const gp_Ax1 &lastSegment, const gp_XYZ &p0, const gp_XYZ &p1, const gp_XYZ &p2, double &dist, const double &epsilon) const
 Test intersection of the last segment with a given triangle using Moller-Trumbore algorithm Intersection is detected if distance to intersection is less than _LayerEdge._len. More...
 
bool SegTriaInter (const gp_Ax1 &lastSegment, const SMDS_MeshNode *n0, const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, double &dist, const double &epsilon) const
 
const gp_XYZ & PrevPos () const
 
gp_XYZ PrevCheckPos (_EdgesOnShape *eos=0) const
 Returns a point used to check orientation of _simplices. More...
 
gp_Ax1 LastSegment (double &segLen, _EdgesOnShape &eos) const
 Returns size and direction of the last segment. More...
 
gp_XY LastUV (const TopoDS_Face &F, _EdgesOnShape &eos) const
 Return the last position of the target node on a FACE. More...
 
bool IsOnEdge () const
 
gp_XYZ Copy (_LayerEdge &other, _EdgesOnShape &eos, SMESH_MesherHelper &helper)
 Copy data from a _LayerEdge of other SOLID and based on the same node; this and the other _LayerEdge are inflated along a FACE or an EDGE. More...
 
void SetCosin (double cosin)
 Set _cosin and _lenFactor. More...
 
void SetNormal (const gp_XYZ &n)
 
int NbSteps () const
 
bool IsNeiborOnEdge (const _LayerEdge *edge) const
 Check if another _LayerEdge is a neighbor on EDGE. More...
 
void SetSmooLen (double len)
 
double GetSmooLen ()
 
gp_XYZ smoothLaplacian ()
 Computes a new node position using Laplacian smoothing. More...
 
gp_XYZ smoothAngular ()
 Computes a new node position using angular-based smoothing. More...
 
gp_XYZ smoothLengthWeighted ()
 Computes a new node position using weigthed node positions. More...
 
gp_XYZ smoothCentroidal ()
 Computes a new node position using angular-based smoothing. More...
 
gp_XYZ smoothNefPolygon ()
 Computes a new node position located inside a Nef polygon. More...
 
int smooFunID (PSmooFun fun=0) const
 Returns a name of _SmooFunction. More...
 

Data Fields

vector< const SMDS_MeshNode * > _nodes
 
gp_XYZ _normal
 
vector< gp_XYZ > _pos
 
double _len
 
double _maxLen
 
double _cosin
 
double _minAngle
 
double _lenFactor
 
int _flags
 
vector< _Simplex_simplices
 
vector< _LayerEdge * > _neibors
 
PSmooFun _smooFunction
 
_Curvature_curvature
 
_2NearEdges_2neibors
 

Static Public Attributes

static const int theNbSmooFuns = FUN_NB
 
static PSmooFun _funs [theNbSmooFuns]
 
static const char * _funNames [theNbSmooFuns+1]
 

Detailed Description

Edge normal to surface, connecting a node on solid surface (_nodes[0]) and a node of the most internal layer (_nodes.back())

Member Typedef Documentation

typedef gp_XYZ(_LayerEdge::* VISCOUS_3D::_LayerEdge::PSmooFun)()

Member Enumeration Documentation

anonymous enum
Enumerator
FUN_LAPLACIAN 
FUN_LENWEIGHTED 
FUN_CENTROIDAL 
FUN_NEFPOLY 
FUN_ANGULAR 
FUN_NB 
Enumerator
TO_SMOOTH 
MOVED 
SMOOTHED 
DIFFICULT 
ON_CONCAVE_FACE 
BLOCKED 
INTERSECTED 
NORMAL_UPDATED 
MARKED 
MULTI_NORMAL 
NEAR_BOUNDARY 
SMOOTHED_C1 
DISTORTED 
RISKY_SWOL 
SHRUNK 
UNUSED_FLAG 

Member Function Documentation

int _LayerEdge::CheckNeiborsOnBoundary ( vector< _LayerEdge * > *  badNeibors = 0,
bool needSmooth = 0 
)

Checks validity of _neibors on EDGEs and VERTEXes.

References _neibors, _nodes, _pos, _simplices, BLOCKED, debugMsg, Is(), NEAR_BOUNDARY, and NORMAL_UPDATED.

Referenced by Smooth(), and VISCOUS_3D::_ViscousBuilder::smoothAndCheck().

void _LayerEdge::ChooseSmooFunction ( const set< TGeomID > &  concaveVertices,
const TNode2Edge n2eMap 
)

Chooses a smoothing technic giving a position most close to an initial one.

For a correct result, _simplices must contain nodes lying on geometry.

References _funs, _neibors, _nodes, _simplices, _smooFunction, FUN_CENTROIDAL, FUN_LAPLACIAN, FUN_NEFPOLY, ON_CONCAVE_FACE, and Set().

Referenced by VISCOUS_3D::_SolidData::PrepareEdgesToSmoothOnFace().

gp_XYZ _LayerEdge::Copy ( _LayerEdge other,
_EdgesOnShape eos,
SMESH_MesherHelper helper 
)

Copy data from a _LayerEdge of other SOLID and based on the same node; this and the other _LayerEdge are inflated along a FACE or an EDGE.

References _2neibors, _cosin, _curvature, _len, _lenFactor, _nodes, _normal, _pos, VISCOUS_3D::_EdgesOnShape::_sWOL, Edge, Face, SMESH_MesherHelper::GetNodeU(), SMESH_MesherHelper::GetNodeUV(), and VISCOUS_3D::_EdgesOnShape::SWOLType().

Referenced by VISCOUS_3D::_ViscousBuilder::makeLayer().

bool _LayerEdge::FindIntersection ( SMESH_ElementSearcher searcher,
double &  distance,
const double &  epsilon,
_EdgesOnShape eos,
const SMDS_MeshElement **  intFace = 0 
)

Looks for intersection of it's last segment with faces.

Parameters
distance- returns shortest distance from the last node to intersection

References _len, _lenFactor, _nodes, SMDS_MeshElement::begin_nodes(), SMESH_ElementSearcher::GetElementsNearLine(), SMDS_MeshElement::GetNodeIndex(), LastSegment(), SMDS_MeshElement::NbCornerNodes(), SegTriaInter(), and SMDSAbs_Face.

double VISCOUS_3D::_LayerEdge::GetSmooLen ( )
int _LayerEdge::GetSmoothedPos ( const double  tol)

Return index of a _pos distant from _normal.

References _normal, and _pos.

Referenced by VISCOUS_3D::_ViscousBuilder::refine(), and SmoothPos().

bool _LayerEdge::IsNeiborOnEdge ( const _LayerEdge edge) const

Check if another _LayerEdge is a neighbor on EDGE.

References _2neibors, and VISCOUS_3D::_2NearEdges::include().

gp_Ax1 _LayerEdge::LastSegment ( double &  segLen,
_EdgesOnShape eos 
) const
gp_XY _LayerEdge::LastUV ( const TopoDS_Face &  F,
_EdgesOnShape eos 
) const

Return the last position of the target node on a FACE.

Parameters
[in]F- the FACE this _LayerEdge is inflated along
Returns
gp_XY - result UV

References _pos, VISCOUS_3D::_EdgesOnShape::_sWOL, Edge, Handle(), and VISCOUS_3D::_EdgesOnShape::SWOLType().

Referenced by VISCOUS_3D::_ViscousBuilder::prepareEdgeToShrink(), and VISCOUS_3D::_Smoother1D::smoothAnalyticEdge().

void _LayerEdge::MoveNearConcaVer ( const _EdgesOnShape eov,
const _EdgesOnShape eos,
const int  step,
vector< _LayerEdge * > &  badSmooEdges 
)

_LayerEdge, located at a concave VERTEX of a FACE, moves target nodes of neighbor _LayerEdge's by it's own inflation vector.

Parameters
[in]eov- EOS of the VERTEX
[in]eos- EOS of the FACE
[in]step- inflation step
[in,out]badSmooEdges- not untangled _LayerEdge's

References _curvature, VISCOUS_3D::_Curvature::_h2lenRatio, VISCOUS_3D::_Curvature::_k, _neibors, _nodes, _pos, VISCOUS_3D::_Curvature::_r, VISCOUS_3D::_EdgesOnShape::_shapeID, VISCOUS_3D::_EdgesOnShape::_sWOL, VISCOUS_3D::_Curvature::_uv, dumpMoveComm, Edge, Face, SMDS_FacePosition::GetUParameter(), SMDS_FacePosition::GetVParameter(), Max(), PrevPos(), SMDS_MeshNode::setXYZ(), Smooth(), SMOOTHED, VISCOUS_3D::_EdgesOnShape::SWOLType(), and Unset().

int VISCOUS_3D::_LayerEdge::NbSteps ( ) const
const gp_XYZ& VISCOUS_3D::_LayerEdge::PrevPos ( ) const
bool _LayerEdge::SegTriaInter ( const gp_Ax1 &  lastSegment,
const gp_XYZ &  p0,
const gp_XYZ &  p1,
const gp_XYZ &  p2,
double &  dist,
const double &  epsilon 
) const

Test intersection of the last segment with a given triangle using Moller-Trumbore algorithm Intersection is detected if distance to intersection is less than _LayerEdge._len.

Referenced by VISCOUS_3D::_ViscousBuilder::findCollisionEdges(), FindIntersection(), and VISCOUS_3D::_ViscousBuilder::updateNormals().

bool VISCOUS_3D::_LayerEdge::SegTriaInter ( const gp_Ax1 &  lastSegment,
const SMDS_MeshNode n0,
const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
double &  dist,
const double &  epsilon 
) const

References SegTriaInter().

Referenced by SegTriaInter().

void _LayerEdge::SetCosin ( double  cosin)
void VISCOUS_3D::_LayerEdge::SetNormal ( const gp_XYZ &  n)
void VISCOUS_3D::_LayerEdge::SetSmooLen ( double  len)
int _LayerEdge::smooFunID ( _LayerEdge::PSmooFun  fun = 0) const

Returns a name of _SmooFunction.

References _funs, _smooFunction, and theNbSmooFuns.

Referenced by Smooth(), and SmoothWoCheck().

int _LayerEdge::Smooth ( const int  step,
const bool  isConcaveFace,
bool  findBest 
)
int _LayerEdge::Smooth ( const int  step,
bool  findBest,
vector< _LayerEdge * > &  toSmooth 
)
gp_XYZ _LayerEdge::smoothAngular ( )

Computes a new node position using angular-based smoothing.

References _simplices.

gp_XYZ _LayerEdge::smoothCentroidal ( )

Computes a new node position using angular-based smoothing.

References _nodes, and _simplices.

gp_XYZ _LayerEdge::smoothLaplacian ( )

Computes a new node position using Laplacian smoothing.

References _simplices.

gp_XYZ _LayerEdge::smoothLengthWeighted ( )

Computes a new node position using weigthed node positions.

References _simplices.

gp_XYZ _LayerEdge::smoothNefPolygon ( )

Computes a new node position located inside a Nef polygon.

References SMESH_MeshAlgos::IsOut(), and SMESH_MesherHelper::WrapIndex().

bool _LayerEdge::SmoothOnEdge ( Handle(ShapeAnalysis_Surface)&  surface,
const TopoDS_Face &  F,
SMESH_MesherHelper helper 
)
void _LayerEdge::SmoothPos ( const vector< double > &  segLen,
const double  tol 
)

Smooth a path formed by _pos of a _LayerEdge smoothed on FACE.

References _normal, _pos, GetSmoothedPos(), Is(), Max(), Min(), and NORMAL_UPDATED.

Referenced by VISCOUS_3D::_ViscousBuilder::refine().

void _LayerEdge::SmoothWoCheck ( )

Perform 3D smooth of nodes inflated from FACE.

No check of validity

References _funNames, _neibors, _nodes, _pos, _smooFunction, DIFFICULT, dumpMoveComm, Is(), SMDS_MeshNode::setXYZ(), smooFunID(), and SMOOTHED.

Field Documentation

const char * VISCOUS_3D::_LayerEdge::_funNames
static
Initial value:
= { "Laplacian",
"LengthWeighted",
"Centroidal",
"NefPolygon",
"Angular",
"None"}

Referenced by Smooth(), and SmoothWoCheck().

double VISCOUS_3D::_LayerEdge::_minAngle
vector< const SMDS_MeshNode*> VISCOUS_3D::_LayerEdge::_nodes

Referenced by VISCOUS_3D::_ViscousBuilder::addBoundaryElements(), VISCOUS_3D::_Shrinker1D::AddEdge(), Block(), CheckNeiborsOnBoundary(), VISCOUS_3D::_ConvexFace::CheckPrisms(), ChooseSmooFunction(), Copy(), VISCOUS_3D::_ViscousBuilder::findCollisionEdges(), FindIntersection(), VISCOUS_3D::_ViscousBuilder::findNeiborsOnEdge(), VISCOUS_3D::_ConvexFace::GetCenterOfCurvature(), VISCOUS_3D::_TmpMeshFaceOnEdge::GetDir(), VISCOUS_3D::_ViscousBuilder::getNormalByOffset(), VISCOUS_3D::_SolidData::GetShapeEdges(), VISCOUS_3D::_ViscousBuilder::getWeigthedNormal(), VISCOUS_3D::_ViscousBuilder::invalidateBadSmooth(), InvalidateStep(), VISCOUS_3D::_ViscousBuilder::isNewNormalOk(), LastSegment(), VISCOUS_3D::_ViscousBuilder::limitMaxLenByCurvature(), VISCOUS_3D::_ViscousBuilder::limitStepSizeByCurvature(), VISCOUS_3D::_ViscousBuilder::makeGroupOfLE(), VISCOUS_3D::_ViscousBuilder::makeLayer(), VISCOUS_3D::_ViscousBuilder::makeOffsetSurface(), MoveNearConcaVer(), VISCOUS_3D::_LayerEdgeCmp::operator()(), VISCOUS_3D::_Smoother1D::prepare(), VISCOUS_3D::_SolidData::PrepareEdgesToSmoothOnFace(), VISCOUS_3D::_ViscousBuilder::prepareEdgeToShrink(), VISCOUS_3D::_ViscousBuilder::putOnOffsetSurface(), VISCOUS_3D::_ViscousBuilder::refine(), VISCOUS_3D::_ViscousBuilder::restoreNoShrink(), SetDataByNeighbors(), VISCOUS_3D::_ViscousBuilder::setEdgeData(), SetNewLength(), SetNewLength2d(), VISCOUS_3D::_ViscousBuilder::shrink(), Smooth(), VISCOUS_3D::_Smoother1D::smoothAnalyticEdge(), VISCOUS_3D::_ViscousBuilder::smoothAndCheck(), smoothCentroidal(), SmoothOnEdge(), SmoothWoCheck(), VISCOUS_3D::_Shrinker1D::SwapSrcTgtNodes(), VISCOUS_3D::_ViscousBuilder::updateNormals(), and VISCOUS_3D::_ViscousBuilder::updateNormalsOfConvexFaces().

PSmooFun VISCOUS_3D::_LayerEdge::_smooFunction
const int VISCOUS_3D::_LayerEdge::theNbSmooFuns = FUN_NB
static

Referenced by smooFunID(), and Smooth().