Eaagles::BasicGL::Clip3D Class Reference

Inherits Eaagles::Basic::LcObject.

Inheritance diagram for Eaagles::BasicGL::Clip3D:

Inheritance graph
[legend]
Collaboration diagram for Eaagles::BasicGL::Clip3D:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Clip3D ()
void setClippingBox (const float xmin, const float xmax, const float ymin, const float ymax, const LCreal zmin=-FLT_MAX, const float LCreal=FLT_MAX)
LcPolygonclip (const LcPolygon &inPoly) const
unsigned int clip (osg::Vec3 *const out, osg::Vec3 *const outNorm, osg::Vec2 *const outTCoord, const osg::Vec3 *const in, const osg::Vec3 *const inNorm, const osg::Vec2 *const inTCoord, const unsigned int num) const

Static Public Member Functions

static unsigned int polyClip2Halfspace (osg::Vec3 *const q, osg::Vec3 *const qn, osg::Vec2 *const qt, const osg::Vec3 *const p, const osg::Vec3 *const pn, const osg::Vec2 *const pt, const unsigned int n, const unsigned int index, const LCreal k, const bool clipUpperPlane)

Private Attributes

LCreal x0
LCreal x1
LCreal y0
LCreal y1
LCreal z0
LCreal z1

Detailed Description

3D polygon clipping


Constructor & Destructor Documentation

Eaagles::BasicGL::Clip3D::Clip3D (  ) 


Member Function Documentation

void Eaagles::BasicGL::Clip3D::setClippingBox ( const float  xmin,
const float  xmax,
const float  ymin,
const float  ymax,
const LCreal  zmin = -FLT_MAX,
const float  LCreal = FLT_MAX 
)

Sets the limits of the clipping box.

LcPolygon * Eaagles::BasicGL::Clip3D::clip ( const LcPolygon inPoly  )  const

clip() -- Clips the convex polygon 'inPoly' to the clipping box defined by setClippingBox(). The function returns a pointer to a new, clipped polygon, which has been pre-ref()'d, or zero if the whole 'inPoly' polygon is outside of the clipping box.

unsigned int Eaagles::BasicGL::Clip3D::clip ( osg::Vec3 *const  out,
osg::Vec3 *const  outNorm,
osg::Vec2 *const  outTCoord,
const osg::Vec3 *const   in,
const osg::Vec3 *const   inNorm,
const osg::Vec2 *const   inTCoord,
const unsigned int  num 
) const

clip() -- Clips the convex polygon 'in', which contains 'num' vertices, to the clipping box defined by setBox(). The function returns the number of vertices in the clipped polygon or zero if the whole polygon is outside of the clipping box. The vertices of the clipped polygon are returned in the user provided output arrays, which must be of at least size 'num'.

unsigned int Eaagles::BasicGL::Clip3D::polyClip2Halfspace ( osg::Vec3 *const  q,
osg::Vec3 *const  qn,
osg::Vec2 *const  qt,
const osg::Vec3 *const   p,
const osg::Vec3 *const   pn,
const osg::Vec2 *const   pt,
const unsigned int  n,
const unsigned int  index,
const LCreal  k,
const bool  clipUpperPlane 
) [static]

polyClip2Halfspace() -- clips one coordinate of a convex polygon p against an upper or lower plane. The clipped polygon is returned in q. The number of vertices in the clipped polygon is returned by the function.


Member Data Documentation

LCreal Eaagles::BasicGL::Clip3D::x0 [private]

left and right

LCreal Eaagles::BasicGL::Clip3D::x1 [private]

LCreal Eaagles::BasicGL::Clip3D::y0 [private]

top and bottom

LCreal Eaagles::BasicGL::Clip3D::y1 [private]

LCreal Eaagles::BasicGL::Clip3D::z0 [private]

near and far

LCreal Eaagles::BasicGL::Clip3D::z1 [private]


Generated on Tue Dec 19 16:26:36 2006 for Eaagles by  doxygen 1.5.0