From Mike Wittman, C# build fixes
This commit is contained in:
parent
307a9a9a78
commit
9b5bbe862d
@ -52,7 +52,7 @@ public:
|
|||||||
* The delaunay triangles inside the DelaunayConstraint area can be used to fill
|
* The delaunay triangles inside the DelaunayConstraint area can be used to fill
|
||||||
* the area or generate geometry that terrain follows the area in some way.
|
* the area or generate geometry that terrain follows the area in some way.
|
||||||
* These triangles can form a canopy or a field. */
|
* These triangles can form a canopy or a field. */
|
||||||
void addtriangle(const int i1,const int i2, const int i3);
|
void addtriangle(int i1, int i2, int i3);
|
||||||
|
|
||||||
/** Get the filling primitive. One:
|
/** Get the filling primitive. One:
|
||||||
* triangulate must have bneen called and
|
* triangulate must have bneen called and
|
||||||
@ -83,11 +83,11 @@ public:
|
|||||||
|
|
||||||
/** return winding number as a float of loop around testpoint; may use multiple loops
|
/** return winding number as a float of loop around testpoint; may use multiple loops
|
||||||
* does not reject points on the edge or very very close to the edge */
|
* does not reject points on the edge or very very close to the edge */
|
||||||
float windingNumber(const osg::Vec3 testpoint) const ;
|
float windingNumber(const osg::Vec3 &testpoint) const ;
|
||||||
|
|
||||||
/** true if testpoint is internal (or external) to constraint. */
|
/** true if testpoint is internal (or external) to constraint. */
|
||||||
virtual bool contains(const osg::Vec3 testpoint) const;
|
virtual bool contains(const osg::Vec3 &testpoint) const;
|
||||||
virtual bool outside(const osg::Vec3 testpoint) const;
|
virtual bool outside(const osg::Vec3 &testpoint) const;
|
||||||
|
|
||||||
/** Tessellate the constraint loops so that the crossing points are interpolated
|
/** Tessellate the constraint loops so that the crossing points are interpolated
|
||||||
* and added to the contraints for the triangulation. */
|
* and added to the contraints for the triangulation. */
|
||||||
@ -158,7 +158,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
virtual ~DelaunayTriangulator();
|
virtual ~DelaunayTriangulator();
|
||||||
DelaunayTriangulator &operator=(const DelaunayTriangulator &) { return *this; }
|
DelaunayTriangulator &operator=(const DelaunayTriangulator &) { return *this; }
|
||||||
int getindex(const osg::Vec3 pt,const osg::Vec3Array *points);
|
int getindex(const osg::Vec3 &pt,const osg::Vec3Array *points);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
osg::ref_ptr<osg::Vec3Array> points_;
|
osg::ref_ptr<osg::Vec3Array> points_;
|
||||||
|
@ -406,7 +406,7 @@ const Triangle * getTriangleWithEdge(const unsigned int ip1,const unsigned int i
|
|||||||
return NULL; //-1;
|
return NULL; //-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DelaunayTriangulator::getindex(const osg::Vec3 pt,const osg::Vec3Array *points)
|
int DelaunayTriangulator::getindex(const osg::Vec3 &pt,const osg::Vec3Array *points)
|
||||||
{
|
{
|
||||||
// return index of pt in points (or -1)
|
// return index of pt in points (or -1)
|
||||||
for (unsigned int i=0; i<points->size(); i++)
|
for (unsigned int i=0; i<points->size(); i++)
|
||||||
@ -1173,7 +1173,7 @@ void DelaunayTriangulator::removeInternalTriangles(DelaunayConstraint *dc )
|
|||||||
}
|
}
|
||||||
//=== DelaunayConstraint functions
|
//=== DelaunayConstraint functions
|
||||||
|
|
||||||
float DelaunayConstraint::windingNumber(const osg::Vec3 testpoint) const
|
float DelaunayConstraint::windingNumber(const osg::Vec3 &testpoint) const
|
||||||
{
|
{
|
||||||
// return winding number of loop around testpoint. Only in 2D, x-y coordinates assumed!
|
// return winding number of loop around testpoint. Only in 2D, x-y coordinates assumed!
|
||||||
float theta=0; // sum of angles subtended by the line array - the winding number
|
float theta=0; // sum of angles subtended by the line array - the winding number
|
||||||
@ -1240,13 +1240,13 @@ osg::DrawElementsUInt *DelaunayConstraint::makeDrawable()
|
|||||||
|
|
||||||
return prim_tris_.get();
|
return prim_tris_.get();
|
||||||
}
|
}
|
||||||
bool DelaunayConstraint::contains(const osg::Vec3 testpoint) const
|
bool DelaunayConstraint::contains(const osg::Vec3 &testpoint) const
|
||||||
{
|
{
|
||||||
// true if point is internal to the loop.
|
// true if point is internal to the loop.
|
||||||
float theta=windingNumber(testpoint); // sum of angles subtended by the line array - the winding number
|
float theta=windingNumber(testpoint); // sum of angles subtended by the line array - the winding number
|
||||||
return fabs(theta)>0.9; // should be 0 or 1 (or 2,3,4 for very complex not permitted loops).
|
return fabs(theta)>0.9; // should be 0 or 1 (or 2,3,4 for very complex not permitted loops).
|
||||||
}
|
}
|
||||||
bool DelaunayConstraint::outside(const osg::Vec3 testpoint) const
|
bool DelaunayConstraint::outside(const osg::Vec3 &testpoint) const
|
||||||
{
|
{
|
||||||
// true if point is outside the loop.
|
// true if point is outside the loop.
|
||||||
float theta=windingNumber(testpoint); // sum of angles subtended by the line array - the winding number
|
float theta=windingNumber(testpoint); // sum of angles subtended by the line array - the winding number
|
||||||
@ -1254,7 +1254,7 @@ bool DelaunayConstraint::outside(const osg::Vec3 testpoint) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DelaunayConstraint::addtriangle(const int i1,const int i2, const int i3)
|
void DelaunayConstraint::addtriangle(int i1, int i2, int i3)
|
||||||
{
|
{
|
||||||
// a triangle joins vertices i1,i2,i3 in the points of the delaunay triangles.
|
// a triangle joins vertices i1,i2,i3 in the points of the delaunay triangles.
|
||||||
// points is the array of poitns in the triangulator;
|
// points is the array of poitns in the triangulator;
|
||||||
|
Loading…
Reference in New Issue
Block a user