Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

sglUnScale Class Reference

#include <sglUnScale.hpp>

Inheritance diagram for sglUnScale::

sglGroup sglNode sglObject List of all members.

Public Methods

 sglUnScale (bool fixedPixelScale=false)
virtual ~sglUnScale ()
void setFixedPixelScale (bool on)
bool getFixedPixelScale () const
virtual sglBound::IntersectResultEnum intersect (sglIntersectf &isector) const
virtual sglBound::IntersectResultEnum intersect (sglIntersectd &isector) const
virtual void pick (sglPickf &pick_state, unsigned int cull_flags) const
virtual void pick (sglPickd &pick_state, unsigned int cull_flags) const
virtual sglNodeclone (unsigned int mode) const
virtual void printInfo (ostream &ostrm, const char *indent_string) const

Protected Methods

virtual void cull (sglCull< float > &trav_state, unsigned int cull_flags) const
virtual void cull (sglCull< double > &trav_state, unsigned int cull_flags) const
void copyTo (sglUnScale *dst, unsigned int mode) const

Detailed Description

This node modifies the traversal's view matrix such that geometry is scaled to appear the same size no matter how far away it is viewed. If getFixedPixelScale() is true, a unit length of one is equal to one pixel; otherwise, a unit length of one is equal to the height of the viewport.

Note: Due to the way culling is performed (with pre-computed bounding volumes), this node may exhibit non-intuitive culling behavior. The dynamically generate bounding-volume for this node will reflect the size of its children in world-space, not the transformed screen space. Thus, by default, the bounding volume is likely to be much smaller than the drawn object. It is recommended that you set a static bound of appropriate size for this node (and its children).

Example:

   sglGeode geode = new sglGeode;
   sglUnScale *unscale = new sglUnScale; // default: fixed pixel scale is false
   unscale->addChild(geode);

Definition at line 57 of file sglUnScale.hpp.


Constructor & Destructor Documentation

sglUnScale::sglUnScale ( bool fixedPixelScale = false )
 

Constructor

Parameters:
fixedPixelScale   boolean flag that sets whether fixed pixel scale mode is to be used or not (defaults to false).

sglUnScale::~sglUnScale ( ) [virtual]
 

virtual destructor.


Member Function Documentation

void sglUnScale::setFixedPixelScale ( bool on ) [inline]
 

Set whether geometry is scaled in units of pixels.

Parameters:
on   If true then fixed pixel scale is to be used.

Definition at line 72 of file sglUnScale.hpp.

bool sglUnScale::getFixedPixelScale ( ) const [inline]
 

Query the fixed pixel scale mode.

Returns:
true if fixed pixel scale mode is being used; otherwise, false.

Definition at line 77 of file sglUnScale.hpp.

virtual sglBound::IntersectResultEnum sglUnScale::intersect ( sglIntersectf & isector ) const [virtual]
 

The single precision intersection traversal function which returns the closest object (bounding volume and/or triangle) that intersects with the given intersect segment.

Parameters:
isector   A reference to a single precision intersection state

Reimplemented from sglGroup.

virtual sglBound::IntersectResultEnum sglUnScale::intersect ( sglIntersectd & isector ) const [virtual]
 

The double precision intersection traversal function which returns the closest object (bounding volume and/or triangle) that intersects with the given intersect segment.

Parameters:
isector   A reference to a double precision intersection state

Reimplemented from sglGroup.

virtual void sglUnScale::pick ( sglPickf & pick_state,
unsigned int cull_flags ) const [virtual]
 

The single precision pick traversal function which returns all objects that fall within the pick frustum.

Parameters:
pick_state   A reference to a single precision pick state.
cull_flags   Bit flags that indicate which planes of the pick frustum (polytope) still need to be tested to determine if bounding spheres and boxes lie within the frustum. Cull-free picking can be accomplished by setting this to 0.

Reimplemented from sglGroup.

virtual void sglUnScale::pick ( sglPickd & pick_state,
unsigned int cull_flags ) const [virtual]
 

The double precision pick traversal function which returns all objects that fall within the pick frustum.

Parameters:
pick_state   A reference to a double precision pick state.
cull_flags   Bit flags that indicate which planes of the pick frustum (polytope) still need to be tested to determine if bounding spheres and boxes lie within the frustum. Cull-free picking can be accomplished by setting this to 0.

Reimplemented from sglGroup.

virtual sglNode* sglUnScale::clone ( unsigned int mode ) const [virtual]
 

Make a copy of the scenegraph rooted at this node.

Parameters:
mode   Bit masks to control the behaviour of the clone. These are OR-ed together from the mode values in sglObject::CloneModeEnum.
Returns:
Pointer to root of cloned scene graph.

Reimplemented from sglGroup.

virtual void sglUnScale::printInfo ( ostream & ostrm,
const char * indent_string ) const [virtual]
 

Output the state of this node to the specified ostream.

Parameters:
ostrm   the ostream to which the output is sent
indent_string   the string (usually spaces) that is output at the beginning of every line of output

Reimplemented from sglGroup.

virtual void sglUnScale::cull ( sglCull< float > & trav_state,
unsigned int cull_flags ) const [protected, virtual]
 

The single precision cull traversal function that culls out subgraphs that do not lie in the view frustum (stored in the sglCull parameter). Subclasses must implement this function. The entry point for user-friendly culling is in the sglScene class.

Parameters:
trav_state   The single precision traversal state that collects all the state and geometry information that passes the cull.
cull_flags   Bit flags that indicate which planes of the view frustum (polytope) still need to be tested to determine if bounding spheres and boxes lie within the frustum. Cull-free drawing can be accomplished with cull_flags = 0.

Reimplemented from sglGroup.

virtual void sglUnScale::cull ( sglCull< double > & trav_state,
unsigned int cull_flags ) const [protected, virtual]
 

The double precision cull traversal function that culls out subgraphs that do not lie in the view frustum (stored in the sglCull parameter). Subclasses must implement this function. The entry point for user-friendly culling is in the sglScene class.

Parameters:
trav_state   The single precision traversal state that collects all the state and geometry information that passes the cull.
cull_flags   Bit flags that indicate which planes of the view frustum (polytope) still need to be tested to determine if bounding spheres and boxes lie within the frustum. Cull-free drawing can be accomplished with cull_flags = 0.

Reimplemented from sglGroup.


The documentation for this class was generated from the following file:
Generated at Mon Jul 1 18:00:11 2002 for SGL by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001