#include <OSGDrawAction.h>
Inheritance diagram for osg::DrawAction:

Public Types | |
| typedef ArgsCollector< Action * > | FunctorArgs |
| typedef TypedFunctor2Base< ResultE, CPtrRefCallArg< CNodePtr >, FunctorArgs > | Functor |
| enum | ResultE { Continue, Skip, Quit } |
Public Member Functions | |
| virtual | ~DrawAction (void) |
| Destructor. | |
| UInt32 | getLightCount (void) const |
| Constructor Destructor. | |
| void | incLightCount (void) |
| void | decLightCount (void) |
| virtual Action::ResultE | start (void) |
| bool | isVisible (Node *node) |
| bool | operator< (const DrawAction &other) const |
| assignment assignment | |
| bool | operator== (const DrawAction &other) const |
| equal | |
| bool | operator!= (const DrawAction &other) const |
| unequal | |
| 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 const char * | getClassname (void) |
| static DrawAction * | create (void) |
| create a new action | |
| static void | setPrototype (DrawAction *proto) |
| static DrawAction * | getPrototype (void) |
| static void | registerEnterDefault (const FieldContainerType &type, const Action::Functor &func) |
| static void | registerLeaveDefault (const FieldContainerType &type, const Action::Functor &func) |
| static void | setPrototype (Action *proto) |
Static Public Attributes | |
| static StatElemDesc< StatTimeElem > | statTravTime |
| static StatElemDesc< StatIntElem > | statCullTestedNodes |
| static StatElemDesc< StatIntElem > | statCulledNodes |
Protected Member Functions | |
| DrawAction (void) | |
| Constructor. | |
| DrawAction (const DrawAction &source) | |
| Copy-Constructor. | |
| virtual std::vector< Functor > * | getDefaultEnterFunctors (void) |
| virtual std::vector< Functor > * | getDefaultLeaveFunctors (void) |
| virtual ResultE | stop (ResultE res) |
| 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 | |
| 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 |
Private Types | |
| typedef DrawActionBase | Inherited |
Private Member Functions | |
| DrawAction & | operator= (const DrawAction &source) |
Private Attributes | |
| UInt32 | _lightCount |
Static Private Attributes | |
| static char | cvsid [] = "@(#)$Id: $" |
| static DrawAction * | _prototype = NULL |
| static std::vector< Functor > * | _defaultEnterFunctors = NULL |
| static std::vector< Functor > * | _defaultLeaveFunctors = NULL |
Definition at line 74 of file OSGDrawAction.h.
|
|
Reimplemented from osg::DrawActionBase. Definition at line 182 of file OSGDrawAction.h. |
|
|
Definition at line 95 of file OSGAction.h. |
|
|
Definition at line 99 of file OSGAction.h. |
|
|
Definition at line 87 of file OSGAction.h. 00088 { 00089 Continue, // continue with my children 00090 Skip, // skip my children 00091 // really needed? Cancel, // skip my brothers, go one step up 00092 Quit // forget it, you're done 00093 };
|
|
|
Definition at line 208 of file OSGDrawAction.cpp.
|
|
|
Definition at line 168 of file OSGDrawAction.cpp. References _defaultEnterFunctors, _defaultLeaveFunctors, osg::Action::_enterFunctors, and osg::Action::_leaveFunctors. Referenced by create(). 00168 : 00169 Inherited (), 00170 _lightCount(0) 00171 { 00172 if ( _defaultEnterFunctors ) 00173 _enterFunctors = *_defaultEnterFunctors; 00174 00175 if ( _defaultLeaveFunctors ) 00176 _leaveFunctors = *_defaultLeaveFunctors; 00177 }
|
|
|
Definition at line 183 of file OSGDrawAction.cpp. 00183 : 00184 Inherited (source), 00185 _lightCount(source._lightCount) 00186 { 00187 }
|
|
|
Reimplemented from osg::Action. Definition at line 90 of file OSGDrawAction.h.
|
|
|
Reimplemented from osg::Action. Definition at line 192 of file OSGDrawAction.cpp. References _prototype, and DrawAction(). 00193 { 00194 DrawAction * act; 00195 00196 if ( _prototype ) 00197 act = new DrawAction( *_prototype ); 00198 else 00199 act = new DrawAction(); 00200 00201 return act; 00202 }
|
|
|
Definition at line 134 of file OSGDrawAction.cpp. References _prototype. 00135 { 00136 _prototype = proto; 00137 }
|
|
|
Reimplemented from osg::Action. Definition at line 139 of file OSGDrawAction.cpp. References _prototype. 00140 { 00141 return _prototype; 00142 }
|
|
||||||||||||
|
||||||||||||
|
|
Definition at line 105 of file OSGDrawAction.inl. References _lightCount. Referenced by osg::SpotLight::drawEnter(), osg::PointLight::drawEnter(), osg::Light::drawEnter(), osg::DirectionalLight::drawEnter(), and osg::Light::drawLeave(). 00106 { 00107 return _lightCount; 00108 }
|
|
|
Definition at line 111 of file OSGDrawAction.inl. References _lightCount. Referenced by osg::Light::drawEnter(). 00112 { 00113 ++_lightCount; 00114 }
|
|
|
Definition at line 117 of file OSGDrawAction.inl. References _lightCount. Referenced by osg::Light::drawLeave(). 00118 { 00119 --_lightCount; 00120 }
|
|
|
Reimplemented from osg::DrawActionBase. Definition at line 217 of file OSGDrawAction.cpp. References _lightCount, osg::Action::Continue, and start. 00218 { 00219 Inherited::start(); 00220 00221 _lightCount = 0; 00222 00223 return Continue; 00224 }
|
|
|
Implements osg::DrawActionBase. Definition at line 226 of file OSGDrawAction.cpp. References osg::DrawActionBase::_frustum, osg::StatCollector::getElem(), osg::DrawActionBase::getFrustumCulling(), osg::DrawActionBase::getStatistics(), osg::Node::getWorldVolume(), osg::FrustumVolume::intersect(), osg::DrawActionBase::statCulledNodes, and osg::DrawActionBase::statCullTestedNodes. 00227 { 00228 if ( getFrustumCulling() == false ) 00229 return true; 00230 00231 getStatistics()->getElem(statCullTestedNodes)->inc(); 00232 00233 DynamicVolume vol; 00234 node->getWorldVolume( vol ); 00235 00236 if ( _frustum.intersect( vol ) ) 00237 { 00238 // fprintf(stderr,"%p: node 0x%p vis\n", Thread::getCurrent(), node); 00239 return true; 00240 } 00241 00242 getStatistics()->getElem(statCulledNodes)->inc(); 00243 00244 // fprintf(stderr,"%p: node 0x%p invis\n", Thread::getCurrent(), node); 00245 // _frustum.dump(); 00246 return false; 00247 }
|
|
|
Definition at line 278 of file OSGDrawAction.cpp.
|
|
|
Definition at line 286 of file OSGDrawAction.cpp.
|
|
|
Definition at line 294 of file OSGDrawAction.cpp.
|
|
|
Implements osg::DrawActionBase. Definition at line 305 of file OSGDrawAction.cpp. References _defaultEnterFunctors. 00306 { 00307 return _defaultEnterFunctors; 00308 }
|
|
|
Implements osg::DrawActionBase. Definition at line 310 of file OSGDrawAction.cpp. References _defaultLeaveFunctors. 00311 { 00312 return _defaultLeaveFunctors; 00313 }
|
|
|
|
|
|
|
Definition at line 267 of file OSGDrawActionBase.cpp. References osg::DrawActionBase::_viewport. Referenced by osg::Viewport::draw(), osg::PassiveViewport::draw(), osg::Viewport::render(), and osg::PassiveViewport::render(). 00268 { 00269 _viewport = viewport; 00270 }
|
|
|
|
Definition at line 272 of file OSGDrawActionBase.cpp. References osg::DrawActionBase::_camera. Referenced by osg::Viewport::draw(), osg::PassiveViewport::draw(), osg::Viewport::render(), and osg::PassiveViewport::render(). 00273 { 00274 _camera = cam; 00275 }
|
|
|
|
Definition at line 107 of file OSGDrawActionBase.inl. References osg::DrawActionBase::_background. 00108 { 00109 return _background; 00110 }
|
|
|
Definition at line 277 of file OSGDrawActionBase.cpp. References osg::DrawActionBase::_background. Referenced by osg::Viewport::draw(), osg::PassiveViewport::draw(), osg::Viewport::render(), and osg::PassiveViewport::render(). 00278 { 00279 _background = background; 00280 }
|
|
|
|
Definition at line 282 of file OSGDrawActionBase.cpp. References osg::DrawActionBase::_window. Referenced by osg::Window::drawAllViewports(), osg::Window::renderAllViewports(), and osg::SortFirstWindow::serverRender(). 00283 { 00284 _window = window; 00285 }
|
|
|
Definition at line 149 of file OSGDrawActionBase.inl. References osg::DrawActionBase::_ownStat, osg::DrawActionBase::_statistics, and osg::StatCollector::create(). Referenced by osg::TextureChunk::activate(), osg::TextureChunk::changeFrom(), osg::SpotLight::drawEnter(), osg::PointLight::drawEnter(), osg::DirectionalLight::drawEnter(), osg::Slices::drawPrimitives(), osg::Geometry::drawPrimitives(), osg::RenderAction::isVisible(), isVisible(), osg::RenderAction::pushVisibility(), osg::SpotLight::renderEnter(), osg::PointLight::renderEnter(), osg::DirectionalLight::renderEnter(), osg::RenderAction::start(), osg::DrawActionBase::start(), osg::RenderAction::stop(), and osg::DrawActionBase::stop(). 00150 { 00151 if(_statistics == NULL) 00152 { 00153 _statistics = StatCollector::create(); 00154 _ownStat = true; 00155 } 00156 00157 return _statistics; 00158 }
|
|
|
Definition at line 287 of file OSGDrawActionBase.cpp. References osg::DrawActionBase::_ownStat, and osg::DrawActionBase::_statistics. Referenced by osg::SimpleSceneManager::setStatistics(). 00288 { 00289 #if 0 // Altered for last frame time 00290 _statistics = statistics; 00291 _ownStat = false; 00292 #else 00293 if (_ownStat) { 00294 delete _statistics; 00295 } 00296 _statistics = statistics; 00297 _ownStat = false; 00298 #endif 00299 }
|
|
|
Definition at line 125 of file OSGDrawActionBase.inl. References osg::DrawActionBase::_frustumCulling. Referenced by osg::RenderAction::isVisible(), isVisible(), osg::RenderAction::popVisibility(), osg::RenderAction::pushVisibility(), osg::DrawActionBase::selectVisibles(), and osg::DrawActionBase::start(). 00126 { 00127 return _frustumCulling; 00128 }
|
|
|
Definition at line 305 of file OSGDrawActionBase.cpp. References osg::DrawActionBase::_frustumCulling. 00306 { 00307 _frustumCulling = frustumCulling; 00308 }
|
|
|
Definition at line 131 of file OSGDrawActionBase.inl. References osg::DrawActionBase::_volumeDrawing. Referenced by osg::RenderAction::pushVisibility(), osg::DrawActionBase::selectVisibles(), and osg::DrawActionBase::stop(). 00132 { 00133 return _volumeDrawing; 00134 }
|
|
|
Definition at line 321 of file OSGDrawActionBase.cpp. References osg::DrawActionBase::_volumeDrawing. 00322 { 00323 _volumeDrawing = volumeDrawing; 00324 }
|
|
|
Definition at line 137 of file OSGDrawActionBase.inl. References osg::DrawActionBase::_autoFrustum. Referenced by osg::DrawActionBase::start(). 00138 { 00139 return _autoFrustum; 00140 }
|
|
|
Definition at line 313 of file OSGDrawActionBase.cpp. References osg::DrawActionBase::_autoFrustum. 00314 { 00315 _autoFrustum = autoFrustum; 00316 }
|
|
|
Definition at line 143 of file OSGDrawActionBase.inl. References osg::DrawActionBase::_frustum. 00144 { 00145 return _frustum; 00146 }
|
|
|
Definition at line 328 of file OSGDrawActionBase.cpp. References osg::DrawActionBase::_frustum. 00329 { 00330 _frustum = frustum; 00331 }
|