VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
makVrv::DtModelScaler Class Reference

The DtModelScaler prepares the data from the osg camera, osg node, and cull visitor parameters and then passes it to the DtScalingAlgorithm provided to the model scaler. An instance of this class is created each frame for each DtOsgChannel and given to the DtOsgCullVisitorParameters to make it available to the DtOsgCullVisitor and to the DtInstanceManager.

Inheritance diagram for makVrv::DtModelScaler:
Inheritance graph
[legend]

Public Member Functions

 DtModelScaler (DtDe &de, DtScalingAlgorithm *scalingAlgorithm)
 
virtual double calculateScale (const DtOsgCullVisitorParameters &info, const osg::Camera &camera, const osg::Vec3d &position, double modelRadius, DtUniqueID objectElementId) const
 
double calculateScale (const DtOsgCullVisitorParameters &info, const osg::Camera &camera, const osg::Node &node) const
 
const DtScalingAlgorithm & scalingAlgorithm () const
 

Protected Member Functions

virtual ~DtModelScaler ()
 

Protected Attributes

DtScalingAlgorithm * myAlgorithm
 
DtDe & myDe
 

Private Member Functions

 DtModelScaler ()
 
 DtModelScaler (const DtModelScaler &orig)
 
DtModelScaler & operator= (const DtModelScaler &rhs)
 

Constructor & Destructor Documentation

makVrv::DtModelScaler::DtModelScaler ( DtDe &  de,
DtScalingAlgorithm *  scalingAlgorithm 
)

CTOR.

Create a model scaler with the desired scaling algorithm

virtual makVrv::DtModelScaler::~DtModelScaler ( )
protectedvirtual

DTOR - Called from osg::Referenced. This is protected to prevent the accidental creation of the scaler on the stack.

makVrv::DtModelScaler::DtModelScaler ( )
private
makVrv::DtModelScaler::DtModelScaler ( const DtModelScaler &  orig)
private

Member Function Documentation

virtual double makVrv::DtModelScaler::calculateScale ( const DtOsgCullVisitorParameters &  info,
const osg::Camera &  camera,
const osg::Vec3d &  position,
double  modelRadius,
DtUniqueID  objectElementId 
) const
virtual

Calculate the scale factor. Override the implementation of this method by registering a custom DtScalingAlgorithm implementation.

Parameters
[in]infois the cull visitor parameters object, which contains the current scale factor setting, as well as other potentially useful information for a scaling algorithm.
[in]camerais the current cull or intersector camera, from which the eyepoint can be found, as well as the viewport, model view and projection matrices, if desired.
[in]positionis the position of the object to be scaled
[in]modelRadiusis the bounding radius of the object to be scaled
[in]objectElementIdis the element ID of the object being scaled, if it exists - check first for (DtUniqueID)0.
Returns
the amount to scale the object
double makVrv::DtModelScaler::calculateScale ( const DtOsgCullVisitorParameters &  info,
const osg::Camera &  camera,
const osg::Node &  node 
) const

Calculate the scale factor. This is the method called by visitors to determine the scale factor. It extracts the position, modelRadius, and elementID (if any) from the osg::Node and then calls the overridable calculateScale with those values.

const DtScalingAlgorithm& makVrv::DtModelScaler::scalingAlgorithm ( ) const

Accessor for this model scaler's scaling algorithm.

DtModelScaler& makVrv::DtModelScaler::operator= ( const DtModelScaler &  rhs)
private

Member Data Documentation

DtScalingAlgorithm* makVrv::DtModelScaler::myAlgorithm
protected
DtDe& makVrv::DtModelScaler::myDe
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)