Eaagles::BasicGL::LcPolygon Class Reference

Inherits Eaagles::BasicGL::LcGraphic.

Inheritance diagram for Eaagles::BasicGL::LcPolygon:

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

Collaboration graph
[legend]
List of all members.

Public Types

enum  { A = 0, B = 1, C = 2, D = 3 }

Public Member Functions

 LcPolygon ()
const osg::Vec3 * getNormal () const
void setNormal (const osg::Vec3 &nn)
bool calcNormal ()
bool arePlaneCoeffValid () const
const osg::Vec4 * getPlaneCoeff () const
bool calcPlaneCoeff ()
LCreal calcZ (const osg::Vec2 &point) const
unsigned int getLayer () const
void setLayer (const unsigned int newLayer)
virtual void drawFunc ()

Static Public Member Functions

static bool calcNormal (osg::Vec3 &norm, const osg::Vec3 v[3])
static bool calcPlaneCoeff (osg::Vec4 &cc, const osg::Vec3 v[3])
static LCreal calcZ (const osg::Vec2 &point, const osg::Vec4 &coeff)

Private Attributes

osg::Vec4 coeff
bool coeffValid
osg::Vec3 norm
unsigned int layerValue

Detailed Description

General purpose polygon 


Member Enumeration Documentation

anonymous enum

Enumerator:
A 
B 
C 
D 


Constructor & Destructor Documentation

Eaagles::BasicGL::LcPolygon::LcPolygon (  ) 

Constructor. Initializes the coefficients of the plane equation (a vector of type osg::Vec4) to (0, 0, 0, 0); sets 'coeffValid' indicating if the coefficients are valid and sets the normal to the polygon 'norm' (type osg::Vec3) to (1, 0, 0).


Member Function Documentation

const osg::Vec3* Eaagles::BasicGL::LcPolygon::getNormal (  )  const [inline]

Returns the vector normal to this polygon. Calling calcNormal() will compute the normal vector for this polygon.

void Eaagles::BasicGL::LcPolygon::setNormal ( const osg::Vec3 &  nn  )  [inline]

Sets the normal to the polygon to nn.

bool Eaagles::BasicGL::LcPolygon::calcNormal (  ) 

Computes the vector normal to the polygon.

bool Eaagles::BasicGL::LcPolygon::calcNormal ( osg::Vec3 &  norm,
const osg::Vec3  v[3] 
) [static]

Computes the normal vector 'norm' for the plane defined by the three vertices 'v'. Returns true if norm is valid.

bool Eaagles::BasicGL::LcPolygon::arePlaneCoeffValid (  )  const [inline]

Returns true if the coefficients of the plane equation are valid.

const osg::Vec4* Eaagles::BasicGL::LcPolygon::getPlaneCoeff (  )  const [inline]

Returns the plane equation coefficients for the plane containing this polygon. Calling calcPlaneCoeff() will compute these coefficents for this polygon.

bool Eaagles::BasicGL::LcPolygon::calcPlaneCoeff (  ) 

Computes the plane equation coefficient for the polygon.

bool Eaagles::BasicGL::LcPolygon::calcPlaneCoeff ( osg::Vec4 &  cc,
const osg::Vec3  v[3] 
) [static]

Computes the plane equation coefficients for the plane defined by the three vertices v. This returns true if the coefficients are valid.

LCreal Eaagles::BasicGL::LcPolygon::calcZ ( const osg::Vec2 &  point  )  const

Compute the Z value of the polygon. The plane equation coefficients must be valid.

LCreal Eaagles::BasicGL::LcPolygon::calcZ ( const osg::Vec2 &  point,
const osg::Vec4 &  coeff 
) [static]

Computes the Z value for a point 'p', located on the plane defined by the coefficients 'coeff'.

unsigned int Eaagles::BasicGL::LcPolygon::getLayer (  )  const [inline]

Returns the layer value.

void Eaagles::BasicGL::LcPolygon::setLayer ( const unsigned int  newLayer  ) 

Sets the layer value to newLayer.

void Eaagles::BasicGL::LcPolygon::drawFunc (  )  [virtual]

LcGraphic Interface.

Reimplemented from Eaagles::BasicGL::LcGraphic.


Member Data Documentation

osg::Vec4 Eaagles::BasicGL::LcPolygon::coeff [private]

Coefficients of the plane equation.

bool Eaagles::BasicGL::LcPolygon::coeffValid [private]

'coeff' numbers are valid

osg::Vec3 Eaagles::BasicGL::LcPolygon::norm [private]

normal to the polygon

unsigned int Eaagles::BasicGL::LcPolygon::layerValue [private]

Layer value.


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