OSG::DrawEnv Class Reference

#include <OSGDrawEnv.h>

List of all members.


Public Types

typedef RenderTraversalActionBase RTAction
typedef DrawActionBase RAction

Public Member Functions

Statistic


void setAction (RAction *pAction)
void setAction (RTAction *pAction)
void setViewport (Viewport *pViewport)
void setWindow (Window *pWindow)
void setupProjection (const Matrixr &projection, const Matrixr &translation)
void setupViewing (const Matrixr &matrix)
void setObjectToWorld (const Matrixr &matrix)
void setCameraNear (const Real &camNear)
void setCameraFar (const Real &camFar)
void setActiveTexTarget (UInt32 uiSlot, GLenum uiTarget)
Access


const MatrixrgetCameraFullProjection (void) const
const MatrixrgetCameraProjection (void) const
const MatrixrgetCameraProjectionTrans (void) const
const MatrixrgetCameraViewing (void) const
const MatrixrgetCameraToWorld (void) const
const MatrixrgetObjectToWorld (void) const
const MatrixrgetWorldToScreen (void) const
Real getCameraNear (void) const
Real getCameraFar (void) const
RActiongetRAction (void) const
RTActiongetRTAction (void) const
ViewportgetViewport (void) const
WindowgetWindow (void) const
GLenum getActiveTexTarget (UInt32 uiSlot) const
Access


void setStatCollector (StatCollector *pStatCollector)
StatCollectorgetStatCollector (void)
Access


const MatrixrgetVPCameraFullProjection (void) const
const MatrixrgetVPCameraProjection (void) const
const MatrixrgetVPCameraProjectionTrans (void) const
const MatrixrgetVPCameraViewing (void) const
const MatrixrgetVPCameraToWorld (void) const
const MatrixrgetVPWorldToScreen (void) const
Access


void setVPCameraMatrices (const Matrixr &mFullprojection, const Matrixr &mProjection, const Matrixr &mProjectionTrans, const Matrixr &mViewing, const Matrixr &mToWorld, const Matrixr &mWorldToScreen)
void initVPMatricesFromCamera (void)
Constructors


UInt32 getNumStateChanges (void) const
UInt32 getNumShaderChanges (void) const
UInt32 getNumShaderParamChanges (void) const
void incNumShaderChanges (void)
void incNumShaderParamChanges (void)
Constructors


void clearState (void)
void activateState (State *pNewState, StateOverride *pNewStateOverride)
void deactivateState (void)
Constructors


 DrawEnv (void)
Destructor


virtual ~DrawEnv (void)

Protected Member Functions

Destructor


void activate (State *pState)
void activate (State *pState, StateOverride *pOverride)
void changeTo (State *pState, State *old)
void changeTo (State *pState, State *old, StateOverride *oldOverride)
void changeTo (State *pState, StateOverride *pOverride, State *old)
void changeTo (State *pState, StateOverride *pOverride, State *old, StateOverride *oldOverride)
void deactivate (State *pState)
void deactivate (State *pState, StateOverride *pOverride)

Protected Attributes

Member


RAction_pRAction
RTAction_pRTAction
Matrixr _cameraFullProjection
Matrixr _cameraProjection
Matrixr _cameraProjectionTrans
Matrixr _cameraViewing
Matrixr _cameraToWorld
Matrixr _objectToWorld
Matrixr _worldToScreen
Matrixr _vpCameraFullProjection
Matrixr _vpCameraProjection
Matrixr _vpCameraProjectionTrans
Matrixr _vpCameraViewing
Matrixr _vpCameraToWorld
Matrixr _vpWorldToScreen
Real _cameraNear
Real _cameraFar
Window_pWindow
Viewport_pViewport
State_pActiveState
StateOverride_pActiveStateOverride
UInt32 _uiNumStateChanges
UInt32 _uiNumShaderChanges
UInt32 _uiNumShaderParamChanges
StatCollector_pStatCollector
GLenum _aActiveTexTargets [osgMaxTexImages]

Private Member Functions

 DrawEnv (const DrawEnv &source)
 prohibit default function (move to 'public' if needed)
void operator= (const DrawEnv &source)
 prohibit default function (move to 'public' if needed)

Friends

class DrawEnvFactory

Detailed Description

Definition at line 65 of file OSGDrawEnv.h.


Member Typedef Documentation

Definition at line 71 of file OSGDrawEnv.h.

Definition at line 72 of file OSGDrawEnv.h.


Constructor & Destructor Documentation

DrawEnv::DrawEnv ( void   ) 

Definition at line 58 of file OSGDrawEnv.cpp.

References _cameraFullProjection, _cameraProjection, _cameraProjectionTrans, _cameraToWorld, _cameraViewing, _objectToWorld, _vpCameraFullProjection, _vpCameraProjection, _vpCameraProjectionTrans, _vpCameraToWorld, _vpCameraViewing, _vpWorldToScreen, and OSG::TransformationMatrix< ValueTypeT >::setIdentity().

00058                      :
00059     _pRAction               (NULL ),
00060     _pRTAction              (NULL ),
00061     _cameraFullProjection   (     ),
00062     _cameraProjection       (     ),
00063     _cameraProjectionTrans  (     ),
00064     _cameraViewing          (     ),
00065     _cameraToWorld          (     ),
00066     _objectToWorld          (     ),
00067 
00068     _vpCameraFullProjection (     ),
00069     _vpCameraProjection     (     ),
00070     _vpCameraProjectionTrans(     ),
00071     _vpCameraViewing        (     ),
00072     _vpCameraToWorld        (     ),
00073     _vpWorldToScreen        (     ),
00074 
00075     _cameraNear             (1.f  ),
00076     _cameraFar              (100.f),
00077 
00078     _pWindow                (NULL ),
00079     _pViewport              (NULL ),
00080     _pActiveState           (NULL ),
00081     _pActiveStateOverride   (NULL ),
00082     _uiNumStateChanges      (0    ),
00083     _uiNumShaderChanges     (0    ),
00084     _uiNumShaderParamChanges(0    ),
00085     _pStatCollector         (NULL )
00086 {
00087     _cameraFullProjection   .setIdentity();
00088     _cameraProjection       .setIdentity();
00089     _cameraProjectionTrans  .setIdentity();
00090     _cameraViewing          .setIdentity();
00091     _cameraToWorld          .setIdentity();
00092     _objectToWorld          .setIdentity();
00093 
00094     _vpCameraFullProjection .setIdentity();
00095     _vpCameraProjection     .setIdentity();
00096     _vpCameraProjectionTrans.setIdentity();
00097     _vpCameraViewing        .setIdentity();
00098     _vpCameraToWorld        .setIdentity();
00099     _vpWorldToScreen        .setIdentity();
00100 }

DrawEnv::~DrawEnv ( void   )  [virtual]

Definition at line 105 of file OSGDrawEnv.cpp.

00106 {
00107 }

OSG::DrawEnv::DrawEnv ( const DrawEnv source  )  [private]


Member Function Documentation

void OSG::DrawEnv::setAction ( RAction pAction  )  [inline]

Definition at line 43 of file OSGDrawEnv.inl.

References _pRAction.

00044 {
00045     _pRAction = pAction;
00046 }

void OSG::DrawEnv::setAction ( RTAction pAction  )  [inline]

Definition at line 49 of file OSGDrawEnv.inl.

References _pRTAction.

00050 {
00051     _pRTAction = pAction;
00052 }

void OSG::DrawEnv::setViewport ( Viewport pViewport  )  [inline]

Definition at line 55 of file OSGDrawEnv.inl.

References _pViewport.

Referenced by OSG::RenderPartition::setViewport(), and OSG::RenderAction::start().

00056 {
00057     _pViewport = pViewport;
00058 }

void OSG::DrawEnv::setWindow ( Window pWindow  )  [inline]

Definition at line 61 of file OSGDrawEnv.inl.

References _pWindow.

Referenced by OSG::Window::frameExit(), OSG::FBOViewport::render(), OSG::RenderPartition::setWindow(), and OSG::RenderAction::start().

00062 {
00063     _pWindow = pWindow;
00064 }

void OSG::DrawEnv::setupProjection ( const Matrixr projection,
const Matrixr translation 
) [inline]

Definition at line 67 of file OSGDrawEnv.inl.

References _cameraFullProjection, _cameraProjection, _cameraProjectionTrans, and OSG::TransformationMatrix< ValueTypeT >::mult().

Referenced by OSG::RenderPartition::setupProjection(), and OSG::RenderAction::start().

00069 {
00070     _cameraProjection      = projection;
00071     _cameraProjectionTrans = translation;
00072 
00073     _cameraFullProjection  = projection;
00074     _cameraFullProjection.mult(translation);
00075 }

void OSG::DrawEnv::setupViewing ( const Matrixr matrix  )  [inline]

void OSG::DrawEnv::setObjectToWorld ( const Matrixr matrix  )  [inline]

Definition at line 88 of file OSGDrawEnv.inl.

References _objectToWorld.

Referenced by OSG::RenderAction::draw().

00089 {
00090     _objectToWorld = matrix;
00091 }

void OSG::DrawEnv::setCameraNear ( const Real camNear  )  [inline]

Definition at line 94 of file OSGDrawEnv.inl.

References _cameraNear.

Referenced by OSG::RenderPartition::setNear(), and OSG::RenderAction::start().

00095 {
00096     _cameraNear = camNear;
00097 }

void OSG::DrawEnv::setCameraFar ( const Real camFar  )  [inline]

Definition at line 100 of file OSGDrawEnv.inl.

References _cameraFar.

Referenced by OSG::RenderPartition::setFar(), and OSG::RenderAction::start().

00101 {
00102     _cameraFar = camFar;
00103 }

void OSG::DrawEnv::setActiveTexTarget ( UInt32  uiSlot,
GLenum  uiTarget 
) [inline]

const Matrixr & OSG::DrawEnv::getCameraFullProjection ( void   )  const [inline]

Definition at line 119 of file OSGDrawEnv.inl.

References _cameraFullProjection.

Referenced by OSG::RenderPartition::getFullProjection().

00120 {
00121     return _cameraFullProjection;
00122 }

const Matrixr & OSG::DrawEnv::getCameraProjection ( void   )  const [inline]

Definition at line 125 of file OSGDrawEnv.inl.

References _cameraProjection.

Referenced by OSG::SkyBackground::clear(), and OSG::RenderPartition::getProjection().

00126 {
00127     return _cameraProjection;
00128 }

const Matrixr & OSG::DrawEnv::getCameraProjectionTrans ( void   )  const [inline]

Definition at line 131 of file OSGDrawEnv.inl.

References _cameraProjectionTrans.

Referenced by OSG::SkyBackground::clear(), and OSG::RenderPartition::getProjectionTrans().

00132 {
00133     return _cameraProjectionTrans;
00134 }

const Matrixr & OSG::DrawEnv::getCameraViewing ( void   )  const [inline]

const Matrixr & OSG::DrawEnv::getCameraToWorld ( void   )  const [inline]

const Matrixr & OSG::DrawEnv::getObjectToWorld ( void   )  const [inline]

Definition at line 149 of file OSGDrawEnv.inl.

References _objectToWorld.

Referenced by OSG::Particles::drawPrimitives().

00150 {
00151     return _objectToWorld;
00152 }

const Matrixr & OSG::DrawEnv::getWorldToScreen ( void   )  const [inline]

Definition at line 113 of file OSGDrawEnv.inl.

References _worldToScreen.

Referenced by OSG::ScreenLOD::renderEnter().

00114 {
00115     return _worldToScreen;
00116 }

Real OSG::DrawEnv::getCameraNear ( void   )  const [inline]

Definition at line 155 of file OSGDrawEnv.inl.

References _cameraNear.

Referenced by OSG::RenderPartition::getNear().

00156 {
00157     return _cameraNear;
00158 }

Real OSG::DrawEnv::getCameraFar ( void   )  const [inline]

Definition at line 161 of file OSGDrawEnv.inl.

References _cameraFar.

Referenced by OSG::RenderPartition::getFar().

00162 {
00163     return _cameraFar;
00164 }

DrawEnv::RAction * OSG::DrawEnv::getRAction ( void   )  const [inline]

Definition at line 167 of file OSGDrawEnv.inl.

References _pRAction.

00168 {
00169     return _pRAction;
00170 }

DrawEnv::RTAction * OSG::DrawEnv::getRTAction ( void   )  const [inline]

Definition at line 173 of file OSGDrawEnv.inl.

References _pRTAction.

Referenced by OSG::HDRStage::postProcess().

00174 {
00175     return _pRTAction;
00176 }

Viewport * OSG::DrawEnv::getViewport ( void   )  const [inline]

Window * OSG::DrawEnv::getWindow ( void   )  const [inline]

Definition at line 185 of file OSGDrawEnv.inl.

References _pWindow.

Referenced by OSG::TextureTransformChunk::activate(), OSG::TextureObjRefChunk::activate(), OSG::TextureObjChunk::activate(), OSG::TextureEnvChunk::activate(), OSG::TextureChunk::activate(), OSG::TexGenChunk::activate(), OSG::SHLParameterChunk::activate(), OSG::SHLChunk::activate(), OSG::RegisterCombinersChunk::activate(), OSG::ProgramChunk::activate(), OSG::PointChunk::activate(), OSG::GeoVectorProperty::activate(), OSG::GeoMultiProperty::activate(), OSG::GeoIntegralProperty::activate(), OSG::FrameBufferObject::activate(), OSG::CubeTextureObjChunk::activate(), OSG::CubeTextureChunk::activate(), OSG::BlendChunk::activate(), OSG::TextureBuffer::bind(), OSG::RenderBuffer::bind(), OSG::TextureTransformChunk::changeFrom(), OSG::TextureObjRefChunk::changeFrom(), OSG::TextureObjChunk::changeFrom(), OSG::TextureEnvChunk::changeFrom(), OSG::TextureChunk::changeFrom(), OSG::TexGenChunk::changeFrom(), OSG::SHLParameterChunk::changeFrom(), OSG::SHLChunk::changeFrom(), OSG::ProgramChunk::changeFrom(), OSG::PointChunk::changeFrom(), OSG::GeoIntegralProperty::changeFrom(), OSG::CubeTextureObjChunk::changeFrom(), OSG::CubeTextureChunk::changeFrom(), OSG::BlendChunk::changeFrom(), OSG::TextureGrabBackground::clear(), OSG::TextureTransformChunk::deactivate(), OSG::TextureObjRefChunk::deactivate(), OSG::TextureObjChunk::deactivate(), OSG::TextureEnvChunk::deactivate(), OSG::TextureChunk::deactivate(), OSG::TexGenChunk::deactivate(), OSG::SHLChunk::deactivate(), OSG::ProgramChunk::deactivate(), OSG::PointChunk::deactivate(), OSG::GeoVectorProperty::deactivate(), OSG::GeoIntegralProperty::deactivate(), OSG::FrameBufferObject::deactivate(), OSG::CubeTextureObjChunk::deactivate(), OSG::CubeTextureChunk::deactivate(), OSG::BlendChunk::deactivate(), OSG::TextureGrabForeground::draw(), OSG::Geometry::drawPrimitives(), OSG::GeoPumpGroup::findGeoPump(), OSG::GeoVertexArrayPumpGroup::getGeoPump(), OSG::GeoImmediatePumpGroup::getGeoPump(), OSG::RenderPartition::getWindow(), OSG::Geometry::handleAttDestroyGL(), OSG::Geometry::handleAttGL(), OSG::Geometry::handleClassicDestroyGL(), OSG::Geometry::handleClassicGL(), OSG::TextureObjChunk::handleDestroyGL(), OSG::TextureChunk::handleDestroyGL(), OSG::SHLChunk::handleDestroyGL(), OSG::RenderBuffer::handleDestroyGL(), OSG::ProgramChunk::handleDestroyGL(), OSG::GeoMultiPropertyData::handleDestroyGL(), OSG::FrameBufferObject::handleDestroyGL(), OSG::CubeTextureObjChunk::handleDestroyGL(), OSG::CubeTextureChunk::handleDestroyGL(), OSG::TextureObjChunk::handleGL(), OSG::TextureChunk::handleGL(), OSG::SHLChunk::handleGL(), OSG::RenderBuffer::handleGL(), OSG::ProgramChunk::handleGL(), OSG::GeoMultiPropertyData::handleGL(), OSG::FrameBufferObject::handleGL(), OSG::CubeTextureObjChunk::handleGL(), OSG::CubeTextureChunk::handleGL(), OSG::GeoIntegralProperty::isInVBO(), OSG::GeoVertexArrayPumpGroup::masterAttribGeoPump(), OSG::GeoImmediatePumpGroup::masterAttribGeoPump(), OSG::GeoVertexArrayPumpGroup::masterClassicGeoPump(), OSG::GeoImmediatePumpGroup::masterClassicGeoPump(), OSG::GeoVertexArrayPumpGroup::masterGeoPump(), OSG::GeoImmediatePumpGroup::masterGeoPump(), OSG::HDRStage::postProcess(), OSG::SHLChunk::update(), OSG::SHLChunk::updateCameraOrientation(), OSG::SHLChunk::updateCameraPosition(), OSG::SHLChunk::updateClusterId(), OSG::SHLChunk::updateInvViewMatrix(), OSG::SHLChunk::updateOSGParameters(), OSG::SHLChunk::updateViewMatrix(), OSG::TextureBuffer::validate(), and OSG::RenderBuffer::validate().

00186 {
00187     return _pWindow;
00188 }

GLenum OSG::DrawEnv::getActiveTexTarget ( UInt32  uiSlot  )  const [inline]

Definition at line 191 of file OSGDrawEnv.inl.

References _aActiveTexTargets.

Referenced by OSG::TextureEnvChunk::activate(), and OSG::TextureEnvChunk::changeFrom().

00192 {
00193     return _aActiveTexTargets[uiSlot];
00194 }

void OSG::DrawEnv::setStatCollector ( StatCollector pStatCollector  )  [inline]

Definition at line 293 of file OSGDrawEnv.inl.

References _pStatCollector, and OSG::setRefd().

Referenced by OSG::RenderPartition::setStatCollector().

00294 {
00295     OSG::setRefd(_pStatCollector, pStatCollector);
00296 }

StatCollector * OSG::DrawEnv::getStatCollector ( void   )  [inline]

const Matrixr & OSG::DrawEnv::getVPCameraFullProjection ( void   )  const [inline]

Definition at line 197 of file OSGDrawEnv.inl.

References _vpCameraFullProjection.

Referenced by OSG::RenderPartition::getVPFullProjection().

00198 {
00199     return _vpCameraFullProjection;
00200 }

const Matrixr & OSG::DrawEnv::getVPCameraProjection ( void   )  const [inline]

Definition at line 203 of file OSGDrawEnv.inl.

References _vpCameraProjection.

Referenced by OSG::RenderPartition::getVPProjection().

00204 {
00205     return _vpCameraProjection;
00206 }

const Matrixr & OSG::DrawEnv::getVPCameraProjectionTrans ( void   )  const [inline]

Definition at line 210 of file OSGDrawEnv.inl.

References _vpCameraProjectionTrans.

Referenced by OSG::RenderPartition::getVPProjectionTrans().

00211 {
00212     return _vpCameraProjectionTrans;
00213 }

const Matrixr & OSG::DrawEnv::getVPCameraViewing ( void   )  const [inline]

Definition at line 217 of file OSGDrawEnv.inl.

References _vpCameraViewing.

Referenced by OSG::RenderPartition::getVPViewing().

00218 {
00219     return _vpCameraViewing;
00220 }

const Matrixr & OSG::DrawEnv::getVPCameraToWorld ( void   )  const [inline]

Definition at line 223 of file OSGDrawEnv.inl.

References _vpCameraToWorld.

00224 {
00225     return _vpCameraToWorld;
00226 }

const Matrixr & OSG::DrawEnv::getVPWorldToScreen ( void   )  const [inline]

Definition at line 229 of file OSGDrawEnv.inl.

References _vpWorldToScreen.

00230 {
00231     return _vpWorldToScreen;
00232 }

void OSG::DrawEnv::setVPCameraMatrices ( const Matrixr mFullprojection,
const Matrixr mProjection,
const Matrixr mProjectionTrans,
const Matrixr mViewing,
const Matrixr mToWorld,
const Matrixr mWorldToScreen 
) [inline]

Definition at line 235 of file OSGDrawEnv.inl.

References _vpCameraFullProjection, _vpCameraProjection, _vpCameraProjectionTrans, _vpCameraToWorld, _vpCameraViewing, and _vpWorldToScreen.

00241 {
00242     _vpCameraFullProjection  = mFullprojection;
00243     _vpCameraProjection      = mProjection;
00244     _vpCameraProjectionTrans = mProjectionTrans;
00245     _vpCameraViewing         = mViewing;
00246     _vpCameraToWorld         = mToWorld;
00247     _vpWorldToScreen         = mWorldToScreen;
00248 }

void OSG::DrawEnv::initVPMatricesFromCamera ( void   )  [inline]

UInt32 OSG::DrawEnv::getNumStateChanges ( void   )  const [inline]

Definition at line 263 of file OSGDrawEnv.inl.

References _uiNumStateChanges.

Referenced by OSG::RenderPartition::getNumStateChanges().

00264 {
00265     return _uiNumStateChanges;
00266 }

UInt32 OSG::DrawEnv::getNumShaderChanges ( void   )  const [inline]

Definition at line 269 of file OSGDrawEnv.inl.

References _uiNumShaderChanges.

Referenced by OSG::RenderPartition::getNumShaderChanges().

00270 {
00271     return _uiNumShaderChanges;
00272 }

UInt32 OSG::DrawEnv::getNumShaderParamChanges ( void   )  const [inline]

Definition at line 275 of file OSGDrawEnv.inl.

References _uiNumShaderParamChanges.

Referenced by OSG::RenderPartition::getNumShaderParamChanges().

00276 {
00277     return _uiNumShaderParamChanges;
00278 }

void OSG::DrawEnv::incNumShaderChanges ( void   )  [inline]

Definition at line 281 of file OSGDrawEnv.inl.

References _uiNumShaderChanges.

Referenced by OSG::SHLChunk::activate(), and OSG::SHLChunk::changeFrom().

00282 {
00283     ++_uiNumShaderChanges;
00284 }

void OSG::DrawEnv::incNumShaderParamChanges ( void   )  [inline]

Definition at line 287 of file OSGDrawEnv.inl.

References _uiNumShaderParamChanges.

00288 {
00289     ++_uiNumShaderParamChanges;
00290 }

void OSG::DrawEnv::clearState ( void   )  [inline]

void OSG::DrawEnv::activateState ( State pNewState,
StateOverride pNewStateOverride 
) [inline]

Definition at line 321 of file OSGDrawEnv.inl.

References _pActiveState, _pActiveStateOverride, activate(), and changeTo().

Referenced by OSG::HDRStage::postProcess().

00323 {
00324     if(pNewState != NULL)
00325     {
00326         if(_pActiveState != NULL)
00327         {
00328             if(pNewState         != _pActiveState        ||
00329                pNewStateOverride != _pActiveStateOverride )
00330             {
00331                 changeTo( pNewState,
00332                           pNewStateOverride,
00333                          _pActiveState,
00334                          _pActiveStateOverride);
00335 
00336                 _pActiveState         = pNewState;
00337                 _pActiveStateOverride = pNewStateOverride;
00338             }
00339         }
00340         else
00341         {
00342             activate(pNewState, pNewStateOverride);
00343 
00344             _pActiveState         = pNewState;
00345             _pActiveStateOverride = pNewStateOverride;
00346         }
00347     }
00348 }

void OSG::DrawEnv::deactivateState ( void   )  [inline]

Definition at line 315 of file OSGDrawEnv.inl.

References _pActiveState, _pActiveStateOverride, and deactivate().

Referenced by OSG::HDRStage::postProcess().

void DrawEnv::activate ( State pState  )  [protected]

Definition at line 109 of file OSGDrawEnv.cpp.

References _uiNumStateChanges, and OSG::State::activate().

Referenced by activate(), and activateState().

00110 {
00111     pState->activate(this);
00112 
00113     ++_uiNumStateChanges;
00114 }

void DrawEnv::activate ( State pState,