Made the LineSegment destructor protected to force users to create segments

on the stack thus ensure that they arn't created locally and have their
memory deleted incorrectly.

Also updated the IntersectVisitor so that it no used osg::ref_ptr<> internally
for storing all data. Have also move the IntersectState helper class to inside the
IntersectVisitor which simplifies the external interface to the class.
This commit is contained in:
Robert Osfield
2002-01-30 12:09:18 +00:00
parent c72efc1059
commit 7b370fcb57
6 changed files with 171 additions and 327 deletions

View File

@@ -19,7 +19,6 @@ class SG_EXPORT LineSegment : public Referenced
LineSegment() {};
LineSegment(const LineSegment& seg) : Referenced(),_s(seg._s),_e(seg._e) {}
LineSegment(const Vec3& s,const Vec3& e) : _s(s),_e(e) {}
virtual ~LineSegment() {}
LineSegment& operator = (const LineSegment& seg) { _s = seg._s; _e = seg._e; return *this; }
@@ -55,6 +54,8 @@ class SG_EXPORT LineSegment : public Referenced
protected:
virtual ~LineSegment() {}
static const bool intersectAndClip(Vec3& s,Vec3& e,const BoundingBox& bb);
Vec3 _s;