26 #ifndef __SMESH_MAT2d_HXX__
27 #define __SMESH_MAT2d_HXX__
31 #include <TopoDS_Face.hxx>
32 #include <TopoDS_Edge.hxx>
37 #include <boost/polygon/polygon.hpp>
38 #include <boost/polygon/voronoi.hpp>
51 typedef boost::polygon::voronoi_diagram<double>
TVD;
86 _branch(b), _iEdge(e), _edgeParam(u) {}
98 bool getBoundaryPoints(std::size_t iMAEdge,
double maEdgeParam,
102 bool getParameter(
const BranchPoint& p,
double & u )
const;
104 std::size_t
nbEdges()
const {
return _maEdges.size(); }
106 const BranchEnd*
getEnd(
bool the2nd)
const {
return & ( the2nd ? _endPoint2 : _endPoint1 ); }
110 void getPoints( std::vector< gp_XY >& points,
const double scale[2])
const;
112 void getGeomEdges( std::vector< std::size_t >& edgeIDs1,
113 std::vector< std::size_t >& edgeIDs2 )
const;
115 void getOppositeGeomEdges( std::vector< std::size_t >& edgeIDs1,
116 std::vector< std::size_t >& edgeIDs2,
117 std::vector< BranchPoint >& divPoints)
const;
123 void init( std::vector<const TVDEdge*>& maEdges,
125 std::map< const TVDVertex*, BranchEndType >& endType);
126 void setBranchesToEnds(
const std::vector< Branch >& branches);
130 static void setGeomEdge ( std::size_t geomIndex,
const TVDEdge* maEdge );
131 static std::size_t getGeomEdge (
const TVDEdge* maEdge );
132 static void setBndSegment( std::size_t segIndex,
const TVDEdge* maEdge );
133 static std::size_t getBndSegment(
const TVDEdge* maEdge );
137 bool addDivPntForConcaVertex( std::vector< std::size_t >& edgeIDs1,
138 std::vector< std::size_t >& edgeIDs2,
139 std::vector< BranchPoint >& divPoints,
140 const std::vector<const TVDEdge*>& maEdges,
141 const std::vector<const TVDEdge*>& maEdgesTwin,
162 std::vector< std::pair< const Branch*, int > >
_maEdges;
176 Boundary( std::size_t nbEdges ): _pointsPerEdge( nbEdges ) {}
178 std::size_t
nbEdges()
const {
return _pointsPerEdge.size(); }
180 bool getPoint( std::size_t iEdge, std::size_t iSeg,
double u,
BoundaryPoint& bp )
const;
182 bool getBranchPoint(
const std::size_t iEdge,
double u,
BranchPoint& p )
const;
186 bool isConcaveSegment( std::size_t iEdge, std::size_t iSeg )
const;
213 const std::vector< TopoDS_Edge >& edges,
214 const double minSegLen,
215 const bool ignoreCorners =
false );
217 const Branch* getBranch(
size_t i)
const;
221 void getPoints(
const Branch* branch, std::vector< gp_XY >& points)
const;