|
Public Types |
typedef std::map< Material *,
DrawTreeNode * > | MaterialMap |
typedef std::pair< LightChunk *,
Matrix > | LightStore |
typedef std::map< Light *,
UInt32 > | LightsMap |
| typedef std::stack< Light * > | LightsStack |
| typedef std::stack< LightEnv * > | LightEnvsStack |
typedef std::map< LightEnv *,
UInt32 > | LightEnvsMap |
| typedef ArgsCollector< Action * > | FunctorArgs |
typedef TypedFunctor2Base<
ResultE, CPtrRefCallArg<
CNodePtr >, FunctorArgs > | Functor |
| enum | ResultE { Continue,
Skip,
Quit
} |
Public Member Functions |
| virtual | ~RenderAction (void) |
| | Destructor.
|
| virtual Action::ResultE | start (void) |
| virtual Action::ResultE | stop (ResultE res) |
| void | push_matrix (const Matrix &matrix) |
| void | pop_matrix (void) |
| const Matrix & | top_matrix (void) |
| void | dropGeometry (Geometry *pGeo) |
| void | dropFunctor (Material::DrawFunctor &func, Material *mat) |
| void | dropLight (Light *pLight) |
| void | undropLight (Light *pLight) |
| void | dropLightEnv (LightEnv *pLightEnv) |
| void | undropLightEnv (LightEnv *pLightEnv) |
| void | setStateSorting (bool s) |
| bool | getStateSorting (void) |
| std::vector< Light * > | getActiveLights (void) |
| UInt32 | getActiveLightsMask (void) |
| void | setSortTrans (bool bVal) |
| bool | getSortTrans (void) |
| void | setZWriteTrans (bool bVal) |
| bool | getZWriteTrans (void) |
| void | setLocalLights (bool bVal) |
| bool | getLocalLights (void) |
| void | setCorrectTwoSidedLighting (bool bVal) |
| bool | getCorrectTwoSidedLighting (void) |
| bool | isVisible (Node *node) |
| bool | pushVisibility (void) |
| | enter a new level for visibility Return false if node is not visible, true
|
| void | popVisibility (void) |
| Viewport * | getViewport (void) const |
| void | setViewport (Viewport *viewport) |
| Camera * | getCamera (void) const |
| void | setCamera (Camera *cam) |
| const Matrix & | getCameraToWorld (void) |
| Background * | getBackground (void) const |
| void | setBackground (Background *background) |
| Window * | getWindow (void) const |
| void | setWindow (Window *window) |
| StatCollector * | getStatistics (void) |
| void | setStatistics (StatCollector *stat) |
| bool | getFrustumCulling (void) const |
| void | setFrustumCulling (bool val=true) |
| bool | getVolumeDrawing (void) const |
| void | setVolumeDrawing (bool val=false) |
| bool | getAutoFrustum (void) const |
| void | setAutoFrustum (bool val=true) |
| const FrustumVolume & | getFrustum (void) const |
| void | setFrustum (FrustumVolume &frust) |
| UInt32 | selectVisibles (void) |
| Material * | getMaterial (void) const |
| NodePtr | getMaterialNode (void) const |
| void | setMaterial (Material *pMaterial, NodePtr node) |
| virtual Action::ResultE | stop (Action::ResultE res) |
| void | registerEnterFunction (const FieldContainerType &type, const Functor &func) |
| void | registerLeaveFunction (const FieldContainerType &type, const Functor &func) |
| virtual ResultE | apply (std::vector< NodePtr >::iterator begin, std::vector< NodePtr >::iterator end) |
| virtual ResultE | apply (NodePtr node) |
| NodePtr | getActNode (void) |
| UInt32 | getNNodes (void) const |
| const NodePtr | getNode (int index) |
| void | addNode (NodePtr node) |
| void | useNodeList (void) |
| void | printTable (void) |
| UInt32 | getTravMask (void) const |
| void | setTravMask (UInt32 val) |
| bool | operator< (const Action &other) |
| | assignment
|
| bool | operator== (const Action &other) |
| | equal
|
| bool | operator!= (const Action &other) |
| | unequal
|
Static Public Member Functions |
| static RenderAction * | create (void) |
| | create a new DrawAction by cloning the prototype
|
| static void | setPrototype (RenderAction *pPrototype) |
| | prototype access after setting the prototype all new DrawActions are clones of it
|
| static RenderAction * | getPrototype (void) |
| static void | registerEnterDefault (const FieldContainerType &type, const Action::Functor &func) |
| | Default registration. static, so it can be called during static init.
|
| static void | registerLeaveDefault (const FieldContainerType &type, const Action::Functor &func) |
| static const char * | getClassname (void) |
| static void | setPrototype (Action *proto) |
Static Public Attributes |
| static StatElemDesc< StatTimeElem > | statDrawTime |
| static StatElemDesc< StatIntElem > | statNMaterials |
| static StatElemDesc< StatIntElem > | statNMatrices |
| static StatElemDesc< StatIntElem > | statNGeometries |
| static StatElemDesc< StatIntElem > | statNTransGeometries |
| static StatElemDesc< StatIntOnceElem > | statNTextures |
| static StatElemDesc< StatIntOnceElem > | statNTexBytes |
| static StatElemDesc< StatTimeElem > | statTravTime |
| static StatElemDesc< StatIntElem > | statCullTestedNodes |
| static StatElemDesc< StatIntElem > | statCulledNodes |
Protected Types |
| typedef RenderActionBase | Inherited |
| typedef std::map< Int32, DrawTreeNode * > | SortKeyMap |
Protected Member Functions |
| | RenderAction (void) |
| | Constructor.
|
| | RenderAction (const RenderAction &source) |
| | Copy-Constructor.
|
| void | operator= (const RenderAction &source) |
| virtual std::vector< Functor > * | getDefaultEnterFunctors (void) |
| | assignment
|
| virtual std::vector< Functor > * | getDefaultLeaveFunctors (void) |
| void | dump (DrawTreeNode *pRoot, UInt32 uiIndent) |
| virtual void | draw (DrawTreeNode *pRoot) |
| void | updateTopMatrix (void) |
| | Constructor Destructor.
|
| void | activateLocalLights (DrawTreeNode *pRoot) |
| ResultE | callEnter (NodePtr node) |
| ResultE | callLeave (NodePtr node) |
| ResultE | recurse (NodePtr node) |
| ResultE | callNewList (void) |
| void | setActNode (NodePtr node) |
Static Protected Member Functions |
| static ResultE | _defaultEnterFunction (CNodePtr &node, Action *action) |
| static ResultE | _defaultLeaveFunction (CNodePtr &node, Action *action) |
Protected Attributes |
| DrawTreeNodeFactory * | _pNodeFactory |
| UInt32 | _uiMatrixId |
| MatrixStore | _currMatrix |
| Matrix | _camInverse |
| std::vector< MatrixStore > | _vMatrixStack |
| MaterialMap | _mMatMap |
| SortKeyMap | _pMatRoots |
| SortKeyMap | _pTransMatRoots |
| DrawTreeNode * | _pNoStateSortRoot |
| DrawTreeNode * | _pNoStateSortTransRoot |
| UInt32 | _uiActiveMatrix |
| State * | _pActiveState |
| UInt32 | _uiNumMaterialChanges |
| UInt32 | _uiNumMatrixChanges |
| UInt32 | _uiNumGeometries |
| UInt32 | _uiNumTransGeometries |
| bool | _bSortTrans |
| bool | _bZWriteTrans |
| bool | _bLocalLights |
| bool | _bCorrectTwoSidedLighting |
| std::vector< LightStore > | _vLights |
| LightsMap | _lightsMap |
| UInt64 | _lightsState |
| UInt64 | _activeLightsState |
| UInt32 | _activeLightsCount |
| UInt32 | _activeLightsMask |
| LightsStack | _lightsStack |
| LightEnvsStack | _lightEnvsStack |
| LightEnvsMap | _lightEnvsMap |
| bool | _stateSorting |
| std::vector< FrustumVolume::PlaneSet > | _visibilityStack |
| Camera * | _camera |
| Background * | _background |
| Window * | _window |
| Viewport * | _viewport |
| StatCollector * | _statistics |
| bool | _ownStat |
| Material * | _pMaterial |
| NodePtr | _pMaterialNode |
| bool | _frustumCulling |
| bool | _volumeDrawing |
| bool | _autoFrustum |
| FrustumVolume | _frustum |
| Matrix | _mCameraToWorld |
| std::vector< Functor > | _enterFunctors |
| std::vector< Functor > | _leaveFunctors |
Static Protected Attributes |
| static RenderAction * | _pPrototype = NULL |
| | the prototype which is copied to create new actions
|
| static std::vector< Functor > * | _vDefaultEnterFunctors = NULL |
| | Default functors for instantiation.
|
| static std::vector< Functor > * | _vDefaultLeaveFunctors = NULL |
Static Private Attributes |
| static char | cvsid [] = "@(#)$Id: $" |
Classes |
| struct | MatrixStore |
|
|
Reimplemented from osg::DrawActionBase.
Definition at line 1344 of file OSGRenderAction.cpp.
References _activeLightsCount, _activeLightsMask, _activeLightsState, osg::DrawActionBase::_background, osg::DrawActionBase::_camera, _camInverse, _currMatrix, osg::DrawTreeNode::_iCreateCount, osg::DrawTreeNode::_iDeleteCount, _lightEnvsMap, _lightEnvsStack, _lightsMap, _lightsStack, _lightsState, _mMatMap, _pActiveState, _pMatRoots, _pNodeFactory, _pNoStateSortRoot, _pNoStateSortTransRoot, _pTransMatRoots, _stateSorting, _uiActiveMatrix, _uiMatrixId, _uiNumGeometries, _uiNumMaterialChanges, _uiNumMatrixChanges, _uiNumTransGeometries, osg::DrawActionBase::_viewport, _visibilityStack, _vLights, osg::DrawActionBase::_window, osg::Background::clear(), osg::Action::Continue, osg::RenderAction::MatrixStore::first, osg::DrawTreeNodeFactory::freeAll(), osg::Viewport::getPixelBottom(), osg::Viewport::getPixelHeight(), osg::Viewport::getPixelLeft(), osg::Viewport::getPixelRight(), osg::Viewport::getPixelTop(), osg::Viewport::getPixelWidth(), osg::DrawActionBase::getStatistics(), osg::Camera::getViewing(), glErr, osg::TransformationMatrix< ValueTypeT >::invertFrom(), osg::Viewport::isFullWindow(), osg::FrustumVolume::P_NONE, osg::StatCollector::reset(), osg::Window::resizeGL(), osg::RenderAction::MatrixStore::second, osg::TransformationMatrix< ValueTypeT >::setIdentity(), osg::Camera::setupProjection(), start, and updateTopMatrix(). 01345 {
01346 glErr("RenderAction: precheck");
01347
01348 Inherited::start();
01349
01350 if(_window != NULL)
01351 {
01352 _window->resizeGL();
01353 }
01354
01355 _uiMatrixId = 1;
01356
01357 _currMatrix.first = 1;
01358 _currMatrix.second.setIdentity();
01359
01360 _visibilityStack.clear();
01361 _visibilityStack.push_back(FrustumVolume::P_NONE);
01362
01363 bool full = false;
01364
01365 if(_viewport != NULL)
01366 {
01367 GLint pl = _viewport->getPixelLeft();
01368 GLint pr = _viewport->getPixelRight();
01369 GLint pb = _viewport->getPixelBottom();
01370 GLint pt = _viewport->getPixelTop();
01371 GLint pw = pr - pl + 1;
01372 GLint ph = pt - pb + 1;
01373
01374 full = _viewport->isFullWindow();
01375
01376 glViewport(pl, pb, pw, ph);
01377
01378 if (full == false)
01379 {
01380 glScissor (pl, pb, pw, ph);
01381 glEnable(GL_SCISSOR_TEST);
01382 }
01383
01384 if(_camera != NULL)
01385 {
01386 _camera->setupProjection(this, *_viewport);
01387
01388
01389
01390 _camera->getViewing(_currMatrix.second,
01391 _viewport->getPixelWidth (),
01392 _viewport->getPixelHeight());
01393
01394 _camInverse.invertFrom(_currMatrix.second);
01395
01396 glMatrixMode(GL_MODELVIEW);
01397 }
01398
01399 if(_background != NULL)
01400 {
01401 _background->clear(this, _viewport);
01402 }
01403 }
01404
01405 updateTopMatrix();
01406
01407 _mMatMap.clear();
01408
01409 _pNodeFactory->freeAll();
01410
01411
01412
01413
01414
01415
01416
01417
01418
01419
01420
01421 DrawTreeNode::_iCreateCount = 0;
01422 DrawTreeNode::_iDeleteCount = 0;
01423
01424 _pMatRoots.clear();
01425 _pTransMatRoots.clear();
01426 _pNoStateSortRoot = NULL;
01427 _pNoStateSortTransRoot = NULL;
01428
01429 _pActiveState = NULL;
01430
01431 _uiActiveMatrix = 0;
01432
01433 _uiNumMaterialChanges = 0;
01434 _uiNumMatrixChanges = 0;
01435 _uiNumGeometries = 0;
01436 _uiNumTransGeometries = 0;
01437
01438 getStatistics()->reset();
01439
01440 _vLights.clear();
01441 _lightsMap.clear();
01442 _lightsState = 0;
01443 _activeLightsState = 0;
01444 _activeLightsCount = 0;
01445 _activeLightsMask = 0;
01446
01447 while(!_lightsStack.empty())
01448 _lightsStack.pop();
01449 while(!_lightEnvsStack.empty())
01450 _lightEnvsStack.pop();
01451 _lightEnvsMap.clear();
01452
01453 _stateSorting = true;
01454
01455 if(_viewport != NULL && full == false)
01456 {
01457 glDisable(GL_SCISSOR_TEST);
01458 }
01459
01460 return Action::Continue;
01461 }
|