27#ifndef _SMESH_QUADRANGLE_2D_HXX_
28#define _SMESH_QUADRANGLE_2D_HXX_
36#include <TopoDS_Face.hxx>
67 Side& operator=(
const Side& otherSide);
70 void AddContact(
int ip,
Side* side,
int iop );
71 int ToSideIndex(
int quadNodeIndex )
const;
72 int ToQuadIndex(
int sideNodeIndex )
const;
73 bool IsForced(
int nodeIndex )
const;
74 bool IsReversed()
const {
return nbNodeOut ? false : to < from; }
75 bool Reverse(
bool keepGrid);
76 int NbPoints()
const {
return Abs( to - from ); }
77 double Param(
int nodeIndex )
const;
78 double Length(
int from=-1,
int to=-1)
const;
79 gp_XY Value2d(
double x )
const;
82 return GetUVPtStruct()[ to-nbNodeOut-(IsReversed() ? -1 : +1)];
85 const std::vector<UVPtStruct>&
GetUVPtStruct(
bool isXConst=0,
double constValue=0)
const
87 grid->SimulateUVPtStruct( NbPoints()-nbNodeOut-1, isXConst, constValue ) :
88 grid->GetUVPtStruct( isXConst, constValue );
100 uvPtr = & side.
First();
101 uvEnd = & side.
Last();
102 dPtr = ( uvEnd > uvPtr ) ? +1 : -1;
106 bool More()
const {
return uvPtr != uvEnd; }
107 void Next() { uvPtr += dPtr; ++counter; }
110 int Count()
const {
return counter; }
120 FaceQuadStruct (
const TopoDS_Face& F = TopoDS_Face(),
const std::string& nm=
"main" );
122 double&
U(
int i,
int j ) {
return UVPt( i, j ).u; }
123 double&
V(
int i,
int j ) {
return UVPt( i, j ).v; }
124 void shift (
size_t nb,
bool keepUnitOri,
bool keepGrid=
false );
125 int &
nbNodeOut(
int iSide ) {
return side[ iSide ].nbNodeOut; }
126 bool findCell (
const gp_XY& uv,
int & i,
int & j );
127 bool isNear (
const gp_XY& uv,
int & i,
int & j,
int nbLoops=1 );
128 bool isEqual (
const gp_XY& uv,
int i,
int j );
129 void normPa2IJ(
double x,
double y,
int & i,
int & j );
130 void updateUV (
const gp_XY& uv,
int i,
int j,
bool isVertical );
132 typedef boost::shared_ptr<FaceQuadStruct>
Ptr;
141 virtual bool CheckHypothesis(
SMESH_Mesh& aMesh,
142 const TopoDS_Shape& aShape,
146 const TopoDS_Shape& aShape);
149 const TopoDS_Shape & aShape,
153 const TopoDS_Shape& aShape,
154 const bool CreateQuadratic);
157 const TopoDS_Shape& aShape,
158 const bool considerMesh =
false,
165 static bool IsApplicable(
const TopoDS_Shape & aShape,
bool toCheckAll);
169 bool checkNbEdgesForEvaluate(
SMESH_Mesh& aMesh,
170 const TopoDS_Shape & aShape,
172 std::vector<int>& aNbNodes,
185 const TopoDS_Face& aFace);
188 const TopoDS_Face& aFace,
192 const TopoDS_Face& aFace,
196 const TopoDS_Face& aFace,
200 const TopoDS_Shape& aShape,
201 std::vector<int>& aNbNodes,
206 const TopoDS_Face& aFace,
215 int getCorners(
const TopoDS_Face& theFace,
217 std::list<TopoDS_Edge>& theWire,
218 std::vector<TopoDS_Vertex>& theVertices,
219 int & theNbDegenEdges,
220 const bool considerMesh);
222 bool getEnforcedUV();
224 bool addEnforcedNodes();
230 typedef std::map< StdMeshers_FaceSidePtr, std::vector< FaceQuadStruct::Ptr > >
TQuadsBySide;
257 double U()
const {
return uv.X(); }
258 double V()
const {
return uv.Y(); }
259 operator const gp_XY& () {
return uv; }
std::map< SMESH_subMesh *, std::vector< smIdType > > MapShapeNbElems
Definition: SMESH_Algo.hxx:63
static bool isEqual(const Quantity_Color &theColor1, const Quantity_Color &theColor2)
Definition: SMESH_Controls.cxx:3079
#define STDMESHERS_EXPORT
Definition: SMESH_StdMeshers.hxx:38
boost::shared_ptr< StdMeshers_FaceSide > StdMeshers_FaceSidePtr
Definition: StdMeshers_FaceSide.hxx:56
StdMeshers_QuadType
Definition: StdMeshers_QuadrangleParams.hxx:35
uvPtStruct UVPtStruct
Definition: StdMeshers_Quadrangle_2D.hxx:48
TSideID
Definition: StdMeshers_Quadrangle_2D.hxx:46
@ NB_QUAD_SIDES
Definition: StdMeshers_Quadrangle_2D.hxx:46
@ QUAD_LEFT_SIDE
Definition: StdMeshers_Quadrangle_2D.hxx:46
@ QUAD_TOP_SIDE
Definition: StdMeshers_Quadrangle_2D.hxx:46
@ QUAD_BOTTOM_SIDE
Definition: StdMeshers_Quadrangle_2D.hxx:46
@ QUAD_RIGHT_SIDE
Definition: StdMeshers_Quadrangle_2D.hxx:46
Definition: SMDS_MeshNode.hxx:36
Definition: SMESHDS_Mesh.hxx:98
Definition: SMESH_Algo.hxx:490
Definition: SMESH_Gen.hxx:68
Hypothesis_Status
Definition: SMESH_Hypothesis.hxx:51
Definition: SMESH_Mesh.hxx:80
It helps meshers to add elements and provides other utilities.
Definition: SMESH_MesherHelper.hxx:84
Container of xD mesh elements substituting other ones in the input mesh of an (x+1)D algorithm.
Definition: SMESH_ProxyMesh.hxx:51
boost::shared_ptr< SMESH_ProxyMesh > Ptr
Definition: SMESH_ProxyMesh.hxx:54
Definition: StdMeshers_QuadrangleParams.hxx:45
Definition: StdMeshers_Quadrangle_2D.hxx:136
SMESH_ProxyMesh::Ptr myProxyMesh
Definition: StdMeshers_Quadrangle_2D.hxx:247
virtual bool IsApplicableToShape(const TopoDS_Shape &shape, bool toCheckAll) const
Return true if the algorithm can mesh a given shape.
Definition: StdMeshers_Quadrangle_2D.hxx:161
int myTriaVertexID
Definition: StdMeshers_Quadrangle_2D.hxx:241
bool myTrianglePreference
Definition: StdMeshers_Quadrangle_2D.hxx:240
SMESH_MesherHelper * myHelper
Definition: StdMeshers_Quadrangle_2D.hxx:246
StdMeshers_QuadType myQuadType
Definition: StdMeshers_Quadrangle_2D.hxx:244
std::map< StdMeshers_FaceSidePtr, std::vector< FaceQuadStruct::Ptr > > TQuadsBySide
Definition: StdMeshers_Quadrangle_2D.hxx:230
const StdMeshers_QuadrangleParams * myParams
Definition: StdMeshers_Quadrangle_2D.hxx:243
bool myCheckOri
Definition: StdMeshers_Quadrangle_2D.hxx:242
std::list< FaceQuadStruct::Ptr > myQuadList
Definition: StdMeshers_Quadrangle_2D.hxx:248
std::vector< ForcedPoint > myForcedPnts
Definition: StdMeshers_Quadrangle_2D.hxx:261
bool myQuadranglePreference
Definition: StdMeshers_Quadrangle_2D.hxx:239
bool IsApplicable(const QString &aHypType, GEOM::GEOM_Object_ptr theGeomObject, const bool toCheckAll)
Definition: SMESHGUI_HypothesesUtils.cxx:617
Definition: StdMeshers_Quadrangle_2D.hxx:92
void Next()
Definition: StdMeshers_Quadrangle_2D.hxx:107
bool More() const
Definition: StdMeshers_Quadrangle_2D.hxx:106
UVPtStruct & operator[](int i)
Definition: StdMeshers_Quadrangle_2D.hxx:109
SideIterator()
Definition: StdMeshers_Quadrangle_2D.hxx:95
int Count() const
Definition: StdMeshers_Quadrangle_2D.hxx:110
UVPtStruct & UVPt() const
Definition: StdMeshers_Quadrangle_2D.hxx:108
const UVPtStruct * uvEnd
Definition: StdMeshers_Quadrangle_2D.hxx:93
int counter
Definition: StdMeshers_Quadrangle_2D.hxx:94
void Init(const Side &side)
Definition: StdMeshers_Quadrangle_2D.hxx:96
Definition: StdMeshers_Quadrangle_2D.hxx:52
const UVPtStruct & First() const
Definition: StdMeshers_Quadrangle_2D.hxx:80
std::set< int > forced_nodes
Definition: StdMeshers_Quadrangle_2D.hxx:62
StdMeshers_FaceSidePtr grid
Definition: StdMeshers_Quadrangle_2D.hxx:59
std::vector< Contact > contacts
Definition: StdMeshers_Quadrangle_2D.hxx:63
int di
Definition: StdMeshers_Quadrangle_2D.hxx:61
int nbNodeOut
Definition: StdMeshers_Quadrangle_2D.hxx:64
int NbPoints() const
Definition: StdMeshers_Quadrangle_2D.hxx:76
int from
Definition: StdMeshers_Quadrangle_2D.hxx:60
bool IsReversed() const
Definition: StdMeshers_Quadrangle_2D.hxx:74
const UVPtStruct & Last() const
Definition: StdMeshers_Quadrangle_2D.hxx:81
const std::vector< UVPtStruct > & GetUVPtStruct(bool isXConst=0, double constValue=0) const
Definition: StdMeshers_Quadrangle_2D.hxx:85
Definition: StdMeshers_Quadrangle_2D.hxx:50
double & V(int i, int j)
Definition: StdMeshers_Quadrangle_2D.hxx:123
UVPtStruct & UVPt(int i, int j)
Definition: StdMeshers_Quadrangle_2D.hxx:121
int iSize
Definition: StdMeshers_Quadrangle_2D.hxx:115
TopoDS_Face face
Definition: StdMeshers_Quadrangle_2D.hxx:116
std::string name
Definition: StdMeshers_Quadrangle_2D.hxx:118
double & U(int i, int j)
Definition: StdMeshers_Quadrangle_2D.hxx:122
Bnd_B2d uv_box
Definition: StdMeshers_Quadrangle_2D.hxx:117
std::vector< UVPtStruct > uv_grid
Definition: StdMeshers_Quadrangle_2D.hxx:114
std::vector< Side > side
Definition: StdMeshers_Quadrangle_2D.hxx:113
boost::shared_ptr< FaceQuadStruct > Ptr
Definition: StdMeshers_Quadrangle_2D.hxx:132
int & nbNodeOut(int iSide)
Definition: StdMeshers_Quadrangle_2D.hxx:125
Definition: StdMeshers_Quadrangle_2D.hxx:251
const SMDS_MeshNode * node
Definition: StdMeshers_Quadrangle_2D.hxx:255
double U() const
Definition: StdMeshers_Quadrangle_2D.hxx:257
double V() const
Definition: StdMeshers_Quadrangle_2D.hxx:258
gp_XYZ xyz
Definition: StdMeshers_Quadrangle_2D.hxx:253
gp_XY uv
Definition: StdMeshers_Quadrangle_2D.hxx:252
TopoDS_Vertex vertex
Definition: StdMeshers_Quadrangle_2D.hxx:254
Data of a node generated on FACE boundary.
Definition: SMESH_TypeDefs.hxx:275