col::Dop Struct Reference

A DOP is represented by NumOri (=k) many plane offsets. More...

Collaboration diagram for col::Dop:

Collaboration graph
[legend]
List of all members.

Access, Attributes

float & operator[] (const unsigned int k)
 Get k-th component of DOP.
float operator[] (const unsigned int k) const
 Get k-th component of DOP, result is const.
float max (unsigned int *k=NULL) const
 Get max component of a Dop.
bool isDegenerate (void) const
 Check whether DOP is degenerate.
static unsigned int mostParallelOri (const Vec3f &diag, Vec3f *ori=NULL)
 Find the orientation which is "most parallel" to a given vector.

Public Member Functions

Constructors
 Dop ()
 Default ctor.
 Dop (const Dop &source)
 Copy constructor.
 Dop (const Pnt3f &pnt)
 Initialize DOP from a single point.
 Dop (const Dop *source)
 Construct from pointer.
void setValues (float val[NumOri])
 Set coefficients of DOP explicitely.
Operators
void operator+= (const Dop &other)
 Increase DOP by extent of other DOP (if necessary).
void operator+= (const Pnt3f &pnt)
 Increase DOP to include point.
void operator+= (float delta)
 Increase DOP by a delta.
void operator-= (const Dop &other)
 Subtract DOP components.
Dop operator * (const DopTransform &tf) const
 Transform a DOP.
void extend (float delta)
 Increase DOP by a delta.
Assignment, Initialization
void operator= (const Pnt3f &pnt)
 Initialize DOP from a single point.
void operator= (const Dop &other)
 Initialize DOP from another DOP.
void operator= (float f)
 Initialize all components of the DOP with the same value.
Comparison
bool operator== (const Dop &other) const
 Check if all coefficients are (almost) the same.
bool operator!= (const Dop &other) const
 Check if some coefficient is unequal.
bool overlap (const Dop &other) const
 Check whether two DOPs overlap.
Debugging
void print (void) const
 Print all components of a Dop.
osg::NodePtr getGeom (void) const
 Create a polyhedron from a DOP.

Public Attributes

float d [NumOri]

Static Public Attributes

static const unsigned int NumOri = 24
 number of orientations of Dop's (= k)

Detailed Description

A DOP is represented by NumOri (=k) many plane offsets.

Author:
Gabriel Zachmann
Todo:


Constructor & Destructor Documentation

col::Dop::Dop (  ) 

Default ctor.

Components are not initialized!

col::Dop::Dop ( const Pnt3f &  pnt  ) 

Initialize DOP from a single point.

Parameters:
pnt The point
Each component of the DOP is the projection of pnt onto the corresponding orientation.

Todo:
Use OSG's dotprod(vec,pnt) when available.

col::Dop::Dop ( const Dop source  ) 

Construct from pointer.

Parameters:
source another DOP
If source==NULL, all components will be uninitialized (like default), if source!=NULL, all components will be copied from source. Needed for DopNode::check().


Member Function Documentation

void col::Dop::setValues ( float  val[NumOri]  ) 

Set coefficients of DOP explicitely.

For debugging.

Exceptions:
XDopTree If the DOP would be degenerate (i.e., coefficients of anti-parallel orientations are reversed).
Parameters:
val array of values

void col::Dop::operator+= ( const Dop other  ) 

Increase DOP by extent of other DOP (if necessary).

Parameters:
other another DOP
Warning:
The (left) Dop must have been initialized by Dop::Dop( const Dop &source ) or by Dop::operator= .

void col::Dop::operator+= ( const Pnt3f &  pnt  ) 

Increase DOP to include point.

Parameters:
pnt point
Warning:
The (left) Dop must have been initialized by Dop::Dop( const Dop &source ) or by Dop::operator= .

void col::Dop::operator+= ( float  delta  ) 

Increase DOP by a delta.

Warning:
The (left) Dop must have been initialized by Dop::Dop( const Dop &source ) or by Dop::operator= .

void col::Dop::operator-= ( const Dop other  ) 

Subtract DOP components.

Parameters:
other another DOP

void col::Dop::operator= ( const Pnt3f &  pnt  ) 

Initialize DOP from a single point.

See also:
Dop::Dop( const Pnt3f &pnt )

Dop col::Dop::operator * ( const DopTransform tf  )  const

Transform a DOP.

Parameters:
tf the transformation
See also:
DopTransform::operator*

bool col::Dop::operator== ( const Dop other  )  const

Check if all coefficients are (almost) the same.

Parameters:
other DOP
Returns:
True/false
Implementation:
Uses NearZero as epsilon.

bool col::Dop::operator!= ( const Dop other  )  const

Check if some coefficient is unequal.

Parameters:
other DOP
Returns:
False, if all coefficient are (almost) equal, true otherwise.
See also:
operator == .

float col::Dop::max ( unsigned int *  k = NULL  )  const

Get max component of a Dop.

Parameters:
k Index of max component (NULL = don't care)
Returns:
The maximum.

bool col::Dop::overlap ( const Dop other  )  const

Check whether two DOPs overlap.

Parameters:
other DOP
Returns:
True if the 2 DOPs overlap, false otherwise.
Implementation:
= ovrlpBVs in Y.

bool col::Dop::isDegenerate ( void   )  const

Check whether DOP is degenerate.

Returns:
True if it is degenerate, i.e., (d[k] < -d[NumOri/2+k]) or (-d[k] > d[NumOri/2+k]) for some k.

void col::Dop::extend ( float  delta  ) 

Increase DOP by a delta.

Warning:
The (left) Dop must have been initialized by Dop::Dop( const Dop &source ) or by Dop::operator= .

unsigned int col::Dop::mostParallelOri ( const Vec3f &  diag,
Vec3f *  ori = NULL 
) [static]

Find the orientation which is "most parallel" to a given vector.

Parameters:
diag Vector
ori The orientation found (out; NULL=ok)
Returns:
Index of the "most parallel" orientation (which is ori).
The "most parallel" orientation is the one with the largest dot product with diag.

osg::NodePtr col::Dop::getGeom ( void   )  const

Create a polyhedron from a DOP.

Returns:
The node.
Create a polyhedron which is the convex object described by the planes given by DopTree::m_Ori[], and d[]. The geometry will have no material.

Every time this method is called, a new geometry is created, even if it is the same Dop!

All Dop's share the same material.

Exceptions:
XColBug If there are too many points (NumPnts). (shouldn't happen)


The documentation for this struct was generated from the following files:
Generated on Tue Oct 16 18:12:48 2007 for CollDet by  doxygen 1.5.2