28 #ifndef StdMeshers_FaceSide_HeaderFile 29 #define StdMeshers_FaceSide_HeaderFile 31 #include <gp_Pnt2d.hxx> 32 #include <TopoDS_Edge.hxx> 33 #include <TopoDS_Vertex.hxx> 34 #include <Geom2d_Curve.hxx> 42 #include <boost/shared_ptr.hpp> 48 class BRepAdaptor_CompCurve;
68 typedef boost::shared_ptr< SMESH_ComputeError >
TError;
84 const TopoDS_Edge& theEdge,
86 const bool theIsForward,
87 const bool theIgnoreMediumNodes);
92 std::list<TopoDS_Edge>& theEdges,
94 const bool theIsForward,
95 const bool theIgnoreMediumNodes);
100 const gp_Pnt2d thePnt2d,
105 static TSideVector GetFaceWires(
const TopoDS_Face& theFace,
107 const bool theIgnoreMediumNodes,
137 const std::vector<UVPtStruct>& GetUVPtStruct(
bool isXConst =0,
double constValue =0)
const;
143 const std::vector<UVPtStruct>& SimulateUVPtStruct(
int nbSeg,
145 double constValue = 0)
const;
149 inline double Parameter(
double U, TopoDS_Edge & edge)
const;
153 gp_Pnt2d Value2d(
double U)
const;
161 BRepAdaptor_CompCurve* GetCurve3d()
const;
169 const TopoDS_Edge&
Edge(
int i)
const {
return myEdge[i]; }
173 inline TopoDS_Vertex FirstVertex(
int i=0)
const;
177 inline TopoDS_Vertex LastVertex(
int i=-1)
const;
181 inline double FirstParameter(
int i)
const;
185 inline double LastParameter(
int i)
const;
189 double Length()
const {
return myLength; }
193 inline int EdgeIndex(
double U )
const;
197 void dump(
const char* msg=0)
const;
203 std::vector<Handle(Geom2d_Curve)>
myC2d;
224 int i = myNormPar.size() - 1;
225 while ( i > 0 && U < myNormPar[ i-1 ] ) --i;
239 int i = EdgeIndex( U );
241 double prevU = i ? myNormPar[ i-1 ] : 0;
242 double r = ( U - prevU )/ ( myNormPar[ i ] - prevU );
243 return myFirst[i] * ( 1 - r ) + myLast[i] * r;
254 return i < myEdge.size() ? TopExp::FirstVertex( myEdge[i], 1 ) : TopoDS_Vertex();
265 return i<0 ? TopExp::LastVertex( myEdge.back(), 1) : i<myEdge.size() ? TopExp::LastVertex( myEdge[i], 1 ) : TopoDS_Vertex();
276 return i==0 ? 0. : i<myNormPar.size() ? myNormPar[i-1] : 1.;
287 return i<myNormPar.size() ? myNormPar[i] : 1;
int NbEdges() const
Return nb of wrapped edges.
const TopoDS_Edge & Edge(int i) const
Return i-th wrapped edge (count starts from zero)
int NbSegments() const
Return nb edges.
TopoDS_Vertex LastVertex(int i=-1) const
Return last vertex of the i-the edge (count starts from zero)
double Parameter(double U, TopoDS_Edge &edge) const
Return edge and parameter on edge by normalized parameter.
double FirstParameter(int i) const
Return first normalized parameter of the i-the edge (count starts from zero)
std::vector< uvPtStruct > myPoints
int EdgeIndex(double U) const
Return edge index corresponding to normalized parameter.
boost::shared_ptr< StdMeshers_FaceSide > StdMeshers_FaceSidePtr
boost::shared_ptr< uvPtStruct > UVPtStructPtr
const SMDS_MeshNode * node
double LastParameter(int i) const
Return ast normalized parameter of the i-the edge (count starts from zero)
boost::shared_ptr< SMESH_ComputeError > TError
#define STDMESHERS_EXPORT
TopoDS_Vertex FirstVertex(int i=0) const
Return 1st vertex of the i-the edge (count starts from zero)
struct uvPtStruct UVPtStruct
bool MissVertexNode() const
Return true if there vertices without nodes.
Contains algorithm and description of occured error.
std::vector< Handle(Geom2d_Curve)> myC2d
int NbPoints() const
Return nb nodes on edges and vertices (+1 to be == GetUVPtStruct().size() )
std::vector< double > myLast
std::vector< double > myNormPar
std::vector< TopoDS_Edge > myEdge
SMESH_Mesh * GetMesh() const
Return mesh.
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.
bool myMissingVertexNodes
std::vector< StdMeshers_FaceSidePtr > TSideVector
double Length() const
Return side length.