14#ifndef OSGUTIL_EDGECOLLECTOR
15#define OSGUTIL_EDGECOLLECTOR 1
35 template<
class T,
class U>
45 if (lhs==rhs)
return false;
46 if (!lhs)
return true;
47 if (!rhs)
return false;
56 T& non_const_t =
const_cast<T&
>(t);
81 typedef std::vector<osg::ref_ptr<Edge> >
EdgeList;
84 typedef std::vector< osg::ref_ptr<Point> >
PointList;
91 Point(): _protected(false), _index(0) {}
100 void clear() { _triangles.clear(); }
102 bool operator < (
const Point& rhs)
const {
return _vertex < rhs.
_vertex; }
120 bool operator < (
const Edge& rhs)
const;
122 bool operator == (
const Edge& rhs)
const;
124 bool operator != (
const Edge& rhs)
const;
132 bool isAdjacentToBoundary()
const {
return isBoundaryEdge() || _p1->isBoundaryPoint() || _p2->isBoundaryPoint(); }
152 {
return (_e1->isBoundaryEdge() || _e2->isBoundaryEdge() || _e3->isBoundaryEdge()); }
174 bool isClosed() {
return (_edgeList.back()->endConnected(*_edgeList.front().get())); }
Definition EdgeCollector:63
std::list< osg::ref_ptr< Edgeloop > > EdgeloopList
Definition EdgeCollector:82
std::set< osg::ref_ptr< Point >, dereference_less > PointSet
Definition EdgeCollector:83
osg::Geometry * getGeometry()
Definition EdgeCollector:76
std::list< osg::ref_ptr< osg::UIntArray > > IndexArrayList
Definition EdgeCollector:71
std::map< osg::ref_ptr< Triangle >, unsigned int, dereference_less > TriangleMap
Definition EdgeCollector:87
osg::Geometry * _geometry
Definition EdgeCollector:199
bool extractBoundaryEdgeloop(EdgeList &el, Edgeloop &edgeloop)
std::vector< osg::ref_ptr< Edge > > EdgeList
Definition EdgeCollector:81
PointSet _pointSet
Definition EdgeCollector:203
Triangle * addTriangle(Point *p1, Point *p2, Point *p3)
std::set< osg::ref_ptr< Triangle > > TriangleSet
Definition EdgeCollector:86
std::set< osg::ref_ptr< Edge >, dereference_less > EdgeSet
Definition EdgeCollector:80
void setGeometry(osg::Geometry *geometry)
Point * addPoint(Triangle *triangle, unsigned int p1)
Definition EdgeCollector:188
void getBoundaryEdgeList(EdgeList &el)
unsigned int getNumOfTriangles()
Definition EdgeCollector:78
Point * addPoint(Triangle *triangle, Point *point)
EdgeSet _edgeSet
Definition EdgeCollector:201
bool extractBoundaryEdgeloopList(EdgeList &el, EdgeloopList &edgeloopList)
Triangle * addTriangle(unsigned int p1, unsigned int p2, unsigned int p3)
PointList _originalPointList
Definition EdgeCollector:204
std::list< osg::ref_ptr< Triangle > > TriangleList
Definition EdgeCollector:85
void getEdgeloopIndexList(IndexArrayList &ial)
std::vector< osg::ref_ptr< Point > > PointList
Definition EdgeCollector:84
TriangleSet _triangleSet
Definition EdgeCollector:202
Edge * addEdge(Triangle *triangle, Point *p1, Point *p2)
A plane class. It can be used to represent an infinite plane.
Definition Plane:34
Shader generator framework.
Definition NodeVisitor:25
bool dereference_check_less(const T &lhs, const T &rhs)
Definition EdgeCollector:43
#define OSGUTIL_EXPORT
Definition osgUtil/Export:40
Definition EdgeCollector:108
osg::ref_ptr< Point > _op1
Definition EdgeCollector:114
osg::ref_ptr< Point > _op2
Definition EdgeCollector:115
bool isBoundaryEdge() const
Definition EdgeCollector:130
osg::ref_ptr< Point > _p2
Definition EdgeCollector:112
void setOrderedPoints(Point *p1, Point *p2)
TriangleSet _triangles
Definition EdgeCollector:117
void addTriangle(Triangle *triangle)
Definition EdgeCollector:128
bool beginConnected(const Edge &rhs) const
Definition EdgeCollector:136
osg::ref_ptr< Point > _p1
Definition EdgeCollector:111
bool endConnected(const Edge &rhs) const
Definition EdgeCollector:134
bool isAdjacentToBoundary() const
Definition EdgeCollector:132
Definition EdgeCollector:171
osg::UIntArray * toIndexArray() const
EdgeList _edgeList
Definition EdgeCollector:178
std::vector< osg::ref_ptr< Edge > > EdgeList
Definition EdgeCollector:172
bool isClosed()
Definition EdgeCollector:174
Definition EdgeCollector:90
Point()
Definition EdgeCollector:91
TriangleSet _triangles
Definition EdgeCollector:98
void clear()
Definition EdgeCollector:100
bool isBoundaryPoint() const
unsigned int _index
Definition EdgeCollector:95
osg::Vec3d _vertex
Definition EdgeCollector:97
bool _protected
Definition EdgeCollector:93
Definition EdgeCollector:140
void setOrderedPoints(Point *p1, Point *p2, Point *p3)
osg::ref_ptr< Point > _op2
Definition EdgeCollector:160
osg::ref_ptr< Point > _op1
Definition EdgeCollector:159
osg::ref_ptr< Point > _p2
Definition EdgeCollector:156
osg::ref_ptr< Edge > _e1
Definition EdgeCollector:163
float distance(const osg::Vec3 &vertex) const
Definition EdgeCollector:149
osg::ref_ptr< Edge > _e2
Definition EdgeCollector:164
Triangle()
Definition EdgeCollector:141
bool isBoundaryTriangle() const
Definition EdgeCollector:151
osg::ref_ptr< Point > _p3
Definition EdgeCollector:157
osg::Plane _plane
Definition EdgeCollector:167
osg::ref_ptr< Edge > _e3
Definition EdgeCollector:165
osg::ref_ptr< Point > _p1
Definition EdgeCollector:155
osg::ref_ptr< Point > _op3
Definition EdgeCollector:161
Definition EdgeCollector:52
void operator()(const T &t)
Definition EdgeCollector:54
Definition EdgeCollector:34
bool operator()(const T &lhs, const U &rhs) const
Definition EdgeCollector:36