From 228fd04a19b810dfe077755cd1db6ff042429daa Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 21 Feb 2007 13:48:01 +0000 Subject: [PATCH] Removed the exclusion of CullSettings from the genwrapper.conf, and then changed the CullStack RefMatrix& methods to RefMatrix* as the RefMatrix& versions caused the wrappers to fail. --- .../osgdepthpartition/DepthPartitionNode.cpp | 4 +- .../osgprerendercubemap.cpp | 2 +- .../osgvertexprogram/osgvertexprogram.cpp | 2 +- genwrapper.conf | 2 +- include/osg/CullStack | 28 +- src/osg/AutoTransform.cpp | 4 +- src/osg/CollectOccludersVisitor.cpp | 2 +- src/osg/CullStack.cpp | 2 +- src/osg/ShadowVolumeOccluder.cpp | 4 +- src/osgParticle/PrecipitationEffect.cpp | 16 +- src/osgPlugins/txp/TXPNode.cpp | 4 +- src/osgShadow/ShadowMap.cpp | 4 +- src/osgShadow/ShadowTexture.cpp | 4 +- src/osgShadow/ShadowVolume.cpp | 2 +- src/osgSim/Impostor.cpp | 10 +- src/osgSim/LightPointNode.cpp | 4 +- src/osgSim/OverlayNode.cpp | 2 +- src/osgUtil/CullVisitor.cpp | 24 +- src/osgViewer/View.cpp | 2 + src/osgViewer/Viewer.cpp | 2 +- src/osgWrappers/osg/CullStack.cpp | 255 ++++++++++++++++++ src/osgWrappers/osgViewer/Scene.cpp | 19 ++ 22 files changed, 337 insertions(+), 61 deletions(-) diff --git a/examples/osgdepthpartition/DepthPartitionNode.cpp b/examples/osgdepthpartition/DepthPartitionNode.cpp index 559ce09cd..fd9b9b6cb 100644 --- a/examples/osgdepthpartition/DepthPartitionNode.cpp +++ b/examples/osgdepthpartition/DepthPartitionNode.cpp @@ -88,8 +88,8 @@ void CURRENT_CLASS::traverse(osg::NodeVisitor &nv) // We are in the cull traversal, so first collect information on the // current modelview and projection matrices and viewport. - osg::RefMatrix& modelview = cv->getModelViewMatrix(); - osg::RefMatrix& projection = cv->getProjectionMatrix(); + osg::RefMatrix& modelview = *(cv->getModelViewMatrix()); + osg::RefMatrix& projection = *(cv->getProjectionMatrix()); osg::Viewport* viewport = cv->getViewport(); // Prepare for scene traversal. diff --git a/examples/osgprerendercubemap/osgprerendercubemap.cpp b/examples/osgprerendercubemap/osgprerendercubemap.cpp index 1039fa52b..e351fbcf1 100644 --- a/examples/osgprerendercubemap/osgprerendercubemap.cpp +++ b/examples/osgprerendercubemap/osgprerendercubemap.cpp @@ -183,7 +183,7 @@ class TexMatCullCallback : public osg::NodeCallback osgUtil::CullVisitor* cv = dynamic_cast(nv); if (cv) { - osg::Quat quat = cv->getModelViewMatrix().getRotate(); + osg::Quat quat = cv->getModelViewMatrix()->getRotate(); _texmat->setMatrix(osg::Matrix::rotate(quat.inverse())); } } diff --git a/examples/osgvertexprogram/osgvertexprogram.cpp b/examples/osgvertexprogram/osgvertexprogram.cpp index aef95ed4e..1fe90c94e 100644 --- a/examples/osgvertexprogram/osgvertexprogram.cpp +++ b/examples/osgvertexprogram/osgvertexprogram.cpp @@ -181,7 +181,7 @@ public: osgUtil::CullVisitor* cv = dynamic_cast(nv); if (cv) { - const osg::Matrix& MV = cv->getModelViewMatrix(); + const osg::Matrix& MV = *(cv->getModelViewMatrix()); const osg::Matrix R = osg::Matrix::rotate( osg::DegreesToRadians(112.0f), 0.0f,0.0f,1.0f)* osg::Matrix::rotate( osg::DegreesToRadians(90.0f), 1.0f,0.0f,0.0f); diff --git a/genwrapper.conf b/genwrapper.conf index ff18a70c1..25a29aa6c 100644 --- a/genwrapper.conf +++ b/genwrapper.conf @@ -44,7 +44,7 @@ end ############################################################################# -suppress reflector "osg::CullStack" +# suppress reflector "osg::CullStack" ignore file "osgViewer/GraphicsWindowX11" ignore file "osgViewer/GraphicsWindowWin32" diff --git a/include/osg/CullStack b/include/osg/CullStack index bb8764c4d..637af1f92 100644 --- a/include/osg/CullStack +++ b/include/osg/CullStack @@ -131,10 +131,10 @@ class OSG_EXPORT CullStack : public osg::CullSettings inline const CullingSet& getCurrentCullingSet() const { return *_back_modelviewCullingStack; } inline osg::Viewport* getViewport(); - inline osg::RefMatrix& getModelViewMatrix(); - inline osg::RefMatrix& getProjectionMatrix(); + inline osg::RefMatrix* getModelViewMatrix(); + inline osg::RefMatrix* getProjectionMatrix(); inline osg::Matrix getWindowMatrix(); - inline const osg::RefMatrix& getMVPW(); + inline const osg::RefMatrix* getMVPW(); inline const osg::Vec3& getReferenceViewPoint() const { return _referenceViewPoints.back(); } inline void pushReferenceViewPoint(const osg::Vec3& viewPoint) { _referenceViewPoints.push_back(viewPoint); } @@ -217,27 +217,27 @@ inline osg::Viewport* CullStack::getViewport() } } -inline osg::RefMatrix& CullStack::getModelViewMatrix() +inline osg::RefMatrix* CullStack::getModelViewMatrix() { if (!_modelviewStack.empty()) { - return *_modelviewStack.back(); + return _modelviewStack.back().get(); } else { - return *_identity; + return _identity.get(); } } -inline osg::RefMatrix& CullStack::getProjectionMatrix() +inline osg::RefMatrix* CullStack::getProjectionMatrix() { if (!_projectionStack.empty()) { - return *_projectionStack.back(); + return _projectionStack.back().get(); } else { - return *_identity; + return _identity.get(); } } @@ -254,21 +254,21 @@ inline osg::Matrix CullStack::getWindowMatrix() } } -inline const osg::RefMatrix& CullStack::getMVPW() +inline const osg::RefMatrix* CullStack::getMVPW() { if (!_MVPW_Stack.empty()) { if (!_MVPW_Stack.back()) { - _MVPW_Stack.back() = createOrReuseMatrix(getModelViewMatrix()); - (*_MVPW_Stack.back()) *= getProjectionMatrix(); + _MVPW_Stack.back() = createOrReuseMatrix(*getModelViewMatrix()); + (*_MVPW_Stack.back()) *= *(getProjectionMatrix()); (*_MVPW_Stack.back()) *= getWindowMatrix(); } - return *_MVPW_Stack.back(); + return _MVPW_Stack.back().get(); } else { - return *_identity; + return _identity.get(); } } diff --git a/src/osg/AutoTransform.cpp b/src/osg/AutoTransform.cpp index d01d1d73f..58746a153 100644 --- a/src/osg/AutoTransform.cpp +++ b/src/osg/AutoTransform.cpp @@ -118,7 +118,7 @@ void AutoTransform::accept(NodeVisitor& nv) osg::Vec3 localUp = cs->getUpLocal(); osg::Vec3 position = getPosition(); - const osg::Matrix& projection = cs->getProjectionMatrix(); + const osg::Matrix& projection = *(cs->getProjectionMatrix()); bool doUpdate = _firstTimeToInitEyePoint; if (!_firstTimeToInitEyePoint) @@ -161,7 +161,7 @@ void AutoTransform::accept(NodeVisitor& nv) if (_autoRotateMode==ROTATE_TO_SCREEN) { - osg::Quat rotation = cs->getModelViewMatrix().getRotate(); + osg::Quat rotation = cs->getModelViewMatrix()->getRotate(); setRotation(rotation.inverse()); } else if (_autoRotateMode==ROTATE_TO_CAMERA) diff --git a/src/osg/CollectOccludersVisitor.cpp b/src/osg/CollectOccludersVisitor.cpp index 573c6345c..0d9626d57 100644 --- a/src/osg/CollectOccludersVisitor.cpp +++ b/src/osg/CollectOccludersVisitor.cpp @@ -87,7 +87,7 @@ void CollectOccludersVisitor::apply(osg::Transform& node) // push the culling mode. pushCurrentMask(); - ref_ptr matrix = createOrReuseMatrix(getModelViewMatrix()); + ref_ptr matrix = createOrReuseMatrix(*getModelViewMatrix()); node.computeLocalToWorldMatrix(*matrix,this); pushModelViewMatrix(matrix.get(), node.getReferenceFrame()); diff --git a/src/osg/CullStack.cpp b/src/osg/CullStack.cpp index 71648ab0e..e92876e01 100644 --- a/src/osg/CullStack.cpp +++ b/src/osg/CullStack.cpp @@ -270,7 +270,7 @@ void CullStack::popModelViewMatrix() void CullStack::computeFrustumVolume() { osg::Matrix invP; - invP.invert(getProjectionMatrix()); + invP.invert(*getProjectionMatrix()); osg::Vec3 f1(-1,-1,-1); f1 = f1*invP; osg::Vec3 f2(-1, 1,-1); f2 = f2*invP; diff --git a/src/osg/ShadowVolumeOccluder.cpp b/src/osg/ShadowVolumeOccluder.cpp index 35248a773..95ef8a1ae 100644 --- a/src/osg/ShadowVolumeOccluder.cpp +++ b/src/osg/ShadowVolumeOccluder.cpp @@ -182,8 +182,8 @@ bool ShadowVolumeOccluder::computeOccluder(const NodePath& nodePath,const Convex CullingSet& cullingset = cullStack.getCurrentCullingSet(); - const RefMatrix& MV = cullStack.getModelViewMatrix(); - const RefMatrix& P = cullStack.getProjectionMatrix(); + const RefMatrix& MV = *cullStack.getModelViewMatrix(); + const RefMatrix& P = *cullStack.getProjectionMatrix(); // take a reference to the NodePath to this occluder. _nodePath = nodePath; diff --git a/src/osgParticle/PrecipitationEffect.cpp b/src/osgParticle/PrecipitationEffect.cpp index 03355d8e2..b5de3e6fe 100644 --- a/src/osgParticle/PrecipitationEffect.cpp +++ b/src/osgParticle/PrecipitationEffect.cpp @@ -275,21 +275,21 @@ void PrecipitationEffect::traverse(osg::NodeVisitor& nv) if (!precipitationDrawableSet->_quadPrecipitationDrawable->getCurrentCellMatrixMap().empty()) { cv->pushStateSet(precipitationDrawableSet->_quadPrecipitationDrawable->getStateSet()); - cv->addDrawableAndDepth(precipitationDrawableSet->_quadPrecipitationDrawable.get(),&cv->getModelViewMatrix(),depth); + cv->addDrawableAndDepth(precipitationDrawableSet->_quadPrecipitationDrawable.get(),cv->getModelViewMatrix(),depth); cv->popStateSet(); } if (!precipitationDrawableSet->_linePrecipitationDrawable->getCurrentCellMatrixMap().empty()) { cv->pushStateSet(precipitationDrawableSet->_linePrecipitationDrawable->getStateSet()); - cv->addDrawableAndDepth(precipitationDrawableSet->_linePrecipitationDrawable.get(),&cv->getModelViewMatrix(),depth); + cv->addDrawableAndDepth(precipitationDrawableSet->_linePrecipitationDrawable.get(),cv->getModelViewMatrix(),depth); cv->popStateSet(); } if (!precipitationDrawableSet->_pointPrecipitationDrawable->getCurrentCellMatrixMap().empty()) { cv->pushStateSet(precipitationDrawableSet->_pointPrecipitationDrawable->getStateSet()); - cv->addDrawableAndDepth(precipitationDrawableSet->_pointPrecipitationDrawable.get(),&cv->getModelViewMatrix(),depth); + cv->addDrawableAndDepth(precipitationDrawableSet->_pointPrecipitationDrawable.get(),cv->getModelViewMatrix(),depth); cv->popStateSet(); } @@ -731,7 +731,7 @@ void PrecipitationEffect::cull(PrecipitationDrawableSet& pds, osgUtil::CullVisit pds._pointPrecipitationDrawable->newFrame(); osg::Matrix inverse_modelview; - inverse_modelview.invert(cv->getModelViewMatrix()); + inverse_modelview.invert(*(cv->getModelViewMatrix())); osg::Vec3 eyeLocal = osg::Vec3(0.0f,0.0f,0.0f) * inverse_modelview; //osg::notify(osg::NOTICE)<<" eyeLocal "<getProjectionMatrix()); - frustum.transformProvidingInverse(cv->getModelViewMatrix()); + frustum.transformProvidingInverse(*(cv->getProjectionMatrix())); + frustum.transformProvidingInverse(*(cv->getModelViewMatrix())); float i_delta = _farTransition * _inverse_du.x(); float j_delta = _farTransition * _inverse_dv.y(); @@ -836,11 +836,11 @@ bool PrecipitationEffect::build(const osg::Vec3 eyeLocal, int i, int j, int k, f return false; } - *mymodelview = cv->getModelViewMatrix(); + *mymodelview = *(cv->getModelViewMatrix()); mymodelview->preMult(osg::Matrix::translate(position)); mymodelview->preMult(osg::Matrix::scale(scale)); - cv->updateCalculatedNearFar(cv->getModelViewMatrix(),bb); + cv->updateCalculatedNearFar(*(cv->getModelViewMatrix()),bb); return true; } diff --git a/src/osgPlugins/txp/TXPNode.cpp b/src/osgPlugins/txp/TXPNode.cpp index b082b61da..0f458c50f 100644 --- a/src/osgPlugins/txp/TXPNode.cpp +++ b/src/osgPlugins/txp/TXPNode.cpp @@ -105,8 +105,8 @@ void TXPNode::traverse(osg::NodeVisitor& nv) tileMapper->setLODScale(cv->getLODScale()); tileMapper->pushReferenceViewPoint(cv->getReferenceViewPoint()); tileMapper->pushViewport(cv->getViewport()); - tileMapper->pushProjectionMatrix(&(cv->getProjectionMatrix())); - tileMapper->pushModelViewMatrix(&(cv->getModelViewMatrix()), osg::Transform::RELATIVE_RF); + tileMapper->pushProjectionMatrix((cv->getProjectionMatrix())); + tileMapper->pushModelViewMatrix((cv->getModelViewMatrix()), osg::Transform::RELATIVE_RF); // traverse the scene graph to search for valid tiles accept(*tileMapper); diff --git a/src/osgShadow/ShadowMap.cpp b/src/osgShadow/ShadowMap.cpp index f78cddfac..a9d36a3a0 100644 --- a/src/osgShadow/ShadowMap.cpp +++ b/src/osgShadow/ShadowMap.cpp @@ -213,7 +213,7 @@ void ShadowMap::cull(osgUtil::CullVisitor& cv) } osg::Matrix eyeToWorld; - eyeToWorld.invert(cv.getModelViewMatrix()); + eyeToWorld.invert(*cv.getModelViewMatrix()); lightpos = lightpos * eyeToWorld; @@ -265,7 +265,7 @@ void ShadowMap::cull(osgUtil::CullVisitor& cv) // do RTT camera traversal _camera->accept(cv); - orig_rs->getPositionalStateContainer()->addPositionedTextureAttribute(_textureUnit, &cv.getModelViewMatrix(), _texgen.get()); + orig_rs->getPositionalStateContainer()->addPositionedTextureAttribute(_textureUnit, cv.getModelViewMatrix(), _texgen.get()); } diff --git a/src/osgShadow/ShadowTexture.cpp b/src/osgShadow/ShadowTexture.cpp index 8ff892cf2..915f35699 100644 --- a/src/osgShadow/ShadowTexture.cpp +++ b/src/osgShadow/ShadowTexture.cpp @@ -157,7 +157,7 @@ void ShadowTexture::cull(osgUtil::CullVisitor& cv) } osg::Matrix eyeToWorld; - eyeToWorld.invert(cv.getModelViewMatrix()); + eyeToWorld.invert(*cv.getModelViewMatrix()); lightpos = lightpos * eyeToWorld; @@ -209,7 +209,7 @@ void ShadowTexture::cull(osgUtil::CullVisitor& cv) // do RTT camera traversal _camera->accept(cv); - orig_rs->getPositionalStateContainer()->addPositionedTextureAttribute(_textureUnit, &cv.getModelViewMatrix(), _texgen.get()); + orig_rs->getPositionalStateContainer()->addPositionedTextureAttribute(_textureUnit, cv.getModelViewMatrix(), _texgen.get()); } diff --git a/src/osgShadow/ShadowVolume.cpp b/src/osgShadow/ShadowVolume.cpp index 0e7251551..4c3a8d6e3 100644 --- a/src/osgShadow/ShadowVolume.cpp +++ b/src/osgShadow/ShadowVolume.cpp @@ -326,7 +326,7 @@ void ShadowVolume::cull(osgUtil::CullVisitor& cv) _lightpos = lightpos; osg::Matrix eyeToWorld; - eyeToWorld.invert(cv.getModelViewMatrix()); + eyeToWorld.invert(*cv.getModelViewMatrix()); _occluder->computeShadowVolumeGeometry(lightpos * eyeToWorld, *_shadowVolume); } diff --git a/src/osgSim/Impostor.cpp b/src/osgSim/Impostor.cpp index c3849a63e..5622cf400 100644 --- a/src/osgSim/Impostor.cpp +++ b/src/osgSim/Impostor.cpp @@ -142,7 +142,7 @@ void Impostor::traverse(osg::NodeVisitor& nv) // within the impostor distance threshold therefore attempt // to use impostor instead. - RefMatrix& matrix = cv->getModelViewMatrix(); + RefMatrix& matrix = *cv->getModelViewMatrix(); // search for the best fit ImpostorSprite; ImpostorSprite* impostorSprite = findBestImpostorSprite(contextID,eyeLocal); @@ -150,7 +150,7 @@ void Impostor::traverse(osg::NodeVisitor& nv) if (impostorSprite) { // impostor found, now check to see if it is good enough to use - float error = impostorSprite->calcPixelError(cv->getMVPW()); + float error = impostorSprite->calcPixelError(*(cv->getMVPW())); if (error>cv->getImpostorPixelErrorThreshold()) { @@ -220,7 +220,7 @@ ImpostorSprite* Impostor::createImpostorSprite(osgUtil::CullVisitor* cv) // projection matrix... bool isPerspectiveProjection = true; - const Matrix& matrix = cv->getModelViewMatrix(); + const Matrix& matrix = *(cv->getModelViewMatrix()); const BoundingSphere& bs = getBound(); osg::Vec3 eye_local = cv->getEyeLocal(); @@ -264,7 +264,7 @@ ImpostorSprite* Impostor::createImpostorSprite(osgUtil::CullVisitor* cv) // convert the corners of the sprite (in world coords) into their // equivilant window coordinates by using the camera's project method. - const osg::Matrix& MVPW = cv->getMVPW(); + const osg::Matrix& MVPW = *(cv->getMVPW()); Vec3 c00_win = c00 * MVPW; Vec3 c11_win = c11 * MVPW; @@ -448,7 +448,7 @@ ImpostorSprite* Impostor::createImpostorSprite(osgUtil::CullVisitor* cv) osg::Matrix::translate(-eye_local)* osg::Matrix::rotate(rotate_from,rotate_to)* osg::Matrix::translate(eye_local)* - cv->getModelViewMatrix(); + *cv->getModelViewMatrix(); camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF); camera->setViewMatrix(rotate_matrix); diff --git a/src/osgSim/LightPointNode.cpp b/src/osgSim/LightPointNode.cpp index 4b9a7365c..572c7d217 100644 --- a/src/osgSim/LightPointNode.cpp +++ b/src/osgSim/LightPointNode.cpp @@ -155,8 +155,8 @@ void LightPointNode::traverse(osg::NodeVisitor& nv) if (cv /*&& !cv->isCulled(_bbox)*/) { - osg::Matrix matrix = cv->getModelViewMatrix(); - osg::RefMatrix& projection = cv->getProjectionMatrix(); + osg::Matrix matrix = *(cv->getModelViewMatrix()); + osg::RefMatrix& projection = *(cv->getProjectionMatrix()); osgUtil::StateGraph* rg = cv->getCurrentStateGraph(); if (rg->leaves_empty()) diff --git a/src/osgSim/OverlayNode.cpp b/src/osgSim/OverlayNode.cpp index 34887fd75..01d649148 100644 --- a/src/osgSim/OverlayNode.cpp +++ b/src/osgSim/OverlayNode.cpp @@ -257,7 +257,7 @@ void OverlayNode::traverse(osg::NodeVisitor& nv) _texgenNode->accept(*cv); - const osg::Matrix modelView = (cv->getModelViewMatrix()); + const osg::Matrix modelView = *(cv->getModelViewMatrix()); osg::Polytope viewTextureFrustum; viewTextureFrustum.setAndTransformProvidingInverse(_textureFrustum, osg::Matrix::inverse(modelView)); diff --git a/src/osgUtil/CullVisitor.cpp b/src/osgUtil/CullVisitor.cpp index da889bc18..ff44faa6c 100644 --- a/src/osgUtil/CullVisitor.cpp +++ b/src/osgUtil/CullVisitor.cpp @@ -735,7 +735,7 @@ void CullVisitor::apply(Geode& node) // traverse any call callbacks and traverse any children. handle_cull_callbacks_and_traverse(node); - RefMatrix& matrix = getModelViewMatrix(); + RefMatrix& matrix = *getModelViewMatrix(); for(unsigned int i=0;i matrix = createOrReuseMatrix(getModelViewMatrix()); + ref_ptr matrix = createOrReuseMatrix(*getModelViewMatrix()); node.computeLocalToWorldMatrix(*matrix,this); pushModelViewMatrix(matrix.get(), node.getReferenceFrame()); @@ -1112,7 +1112,7 @@ void CullVisitor::apply(osg::Camera& camera) // activate all active cull settings from this Camera inheritCullSettings(camera); - RefMatrix& originalModelView = getModelViewMatrix(); + RefMatrix& originalModelView = *getModelViewMatrix(); osg::RefMatrix* projection = 0; osg::RefMatrix* modelview = 0; @@ -1121,13 +1121,13 @@ void CullVisitor::apply(osg::Camera& camera) { if (camera.getTransformOrder()==osg::Camera::POST_MULTIPLY) { - projection = createOrReuseMatrix(getProjectionMatrix()*camera.getProjectionMatrix()); - modelview = createOrReuseMatrix(getModelViewMatrix()*camera.getViewMatrix()); + projection = createOrReuseMatrix(*getProjectionMatrix()*camera.getProjectionMatrix()); + modelview = createOrReuseMatrix(*getModelViewMatrix()*camera.getViewMatrix()); } else // pre multiply { - projection = createOrReuseMatrix(camera.getProjectionMatrix()*getProjectionMatrix()); - modelview = createOrReuseMatrix(camera.getViewMatrix()*getModelViewMatrix()); + projection = createOrReuseMatrix(camera.getProjectionMatrix()*(*getProjectionMatrix())); + modelview = createOrReuseMatrix(camera.getViewMatrix()*(*getModelViewMatrix())); } } else @@ -1228,7 +1228,7 @@ void CullVisitor::apply(osg::Camera& camera) // set up to charge the same PositionalStateContainer is the parent previous stage. osg::Matrix inhertiedMVtolocalMV; inhertiedMVtolocalMV.invert(originalModelView); - inhertiedMVtolocalMV.postMult(getModelViewMatrix()); + inhertiedMVtolocalMV.postMult(*getModelViewMatrix()); rtts->setInheritedPositionalStateContainerMatrix(inhertiedMVtolocalMV); rtts->setInheritedPositionalStateContainer(previous_stage->getPositionalStateContainer()); diff --git a/src/osgViewer/View.cpp b/src/osgViewer/View.cpp index 9356d725f..ab125d17e 100644 --- a/src/osgViewer/View.cpp +++ b/src/osgViewer/View.cpp @@ -259,6 +259,8 @@ void View::setUpViewOnSingleScreen(unsigned int screenNum) void View::assignSceneDataToCameras() { + osg::notify(osg::NOTICE)<<"View::assignSceneDataToCameras()"<getSceneData() : 0; if (_cameraManipulator.valid()) diff --git a/src/osgViewer/Viewer.cpp b/src/osgViewer/Viewer.cpp index 99cbf5241..92e0b3e01 100644 --- a/src/osgViewer/Viewer.cpp +++ b/src/osgViewer/Viewer.cpp @@ -1480,7 +1480,7 @@ void Viewer::setUpRenderingSupport() } - // osg::notify(osg::NOTICE)<<"localCamera"<getName()<add(vdbro); ++numViewerDoubleBufferedRenderingOperation; diff --git a/src/osgWrappers/osg/CullStack.cpp b/src/osgWrappers/osg/CullStack.cpp index dd8d0500f..0256f3525 100644 --- a/src/osgWrappers/osg/CullStack.cpp +++ b/src/osgWrappers/osg/CullStack.cpp @@ -33,6 +33,261 @@ TYPE_NAME_ALIAS(std::vector< osg::ShadowVolumeOccluder >, osg::CullStack::Occlud TYPE_NAME_ALIAS(std::vector< osg::CullingSet >, osg::CullStack::CullingStack); +BEGIN_OBJECT_REFLECTOR(osg::CullStack) + I_BaseType(osg::CullSettings); + I_Constructor0(____CullStack, + "", + ""); + I_Method0(void, reset, + Properties::NON_VIRTUAL, + __void__reset, + "", + ""); + I_Method1(void, setOccluderList, IN, const osg::ShadowVolumeOccluderList &, svol, + Properties::NON_VIRTUAL, + __void__setOccluderList__C5_ShadowVolumeOccluderList_R1, + "", + ""); + I_Method0(osg::ShadowVolumeOccluderList &, getOccluderList, + Properties::NON_VIRTUAL, + __ShadowVolumeOccluderList_R1__getOccluderList, + "", + ""); + I_Method0(const osg::ShadowVolumeOccluderList &, getOccluderList, + Properties::NON_VIRTUAL, + __C5_ShadowVolumeOccluderList_R1__getOccluderList, + "", + ""); + I_Method1(void, pushViewport, IN, osg::Viewport *, viewport, + Properties::NON_VIRTUAL, + __void__pushViewport__osg_Viewport_P1, + "", + ""); + I_Method0(void, popViewport, + Properties::NON_VIRTUAL, + __void__popViewport, + "", + ""); + I_Method1(void, pushProjectionMatrix, IN, osg::RefMatrix *, matrix, + Properties::NON_VIRTUAL, + __void__pushProjectionMatrix__osg_RefMatrix_P1, + "", + ""); + I_Method0(void, popProjectionMatrix, + Properties::NON_VIRTUAL, + __void__popProjectionMatrix, + "", + ""); + I_Method2(void, pushModelViewMatrix, IN, osg::RefMatrix *, matrix, IN, osg::Transform::ReferenceFrame, referenceFrame, + Properties::NON_VIRTUAL, + __void__pushModelViewMatrix__osg_RefMatrix_P1__Transform_ReferenceFrame, + "", + ""); + I_Method0(void, popModelViewMatrix, + Properties::NON_VIRTUAL, + __void__popModelViewMatrix, + "", + ""); + I_Method0(float, getFrustumVolume, + Properties::NON_VIRTUAL, + __float__getFrustumVolume, + "", + ""); + I_Method2(float, pixelSize, IN, const osg::Vec3 &, v, IN, float, radius, + Properties::NON_VIRTUAL, + __float__pixelSize__C5_Vec3_R1__float, + "Compute the pixel size of an object at position v, with specified radius. ", + ""); + I_Method1(float, pixelSize, IN, const osg::BoundingSphere &, bs, + Properties::NON_VIRTUAL, + __float__pixelSize__C5_BoundingSphere_R1, + "Compute the pixel size of the bounding sphere. ", + ""); + I_Method2(float, clampedPixelSize, IN, const osg::Vec3 &, v, IN, float, radius, + Properties::NON_VIRTUAL, + __float__clampedPixelSize__C5_Vec3_R1__float, + "Compute the pixel size of an object at position v, with specified radius. ", + "fabs()ed to always be positive. "); + I_Method1(float, clampedPixelSize, IN, const osg::BoundingSphere &, bs, + Properties::NON_VIRTUAL, + __float__clampedPixelSize__C5_BoundingSphere_R1, + "Compute the pixel size of the bounding sphere. ", + "fabs()ed to always be positive. "); + I_Method1(void, disableAndPushOccludersCurrentMask, IN, osg::NodePath &, nodePath, + Properties::NON_VIRTUAL, + __void__disableAndPushOccludersCurrentMask__NodePath_R1, + "", + ""); + I_Method1(void, popOccludersCurrentMask, IN, osg::NodePath &, nodePath, + Properties::NON_VIRTUAL, + __void__popOccludersCurrentMask__NodePath_R1, + "", + ""); + I_Method1(bool, isCulled, IN, const std::vector< osg::Vec3 > &, vertices, + Properties::NON_VIRTUAL, + __bool__isCulled__C5_std_vectorT1_Vec3__R1, + "", + ""); + I_Method1(bool, isCulled, IN, const osg::BoundingBox &, bb, + Properties::NON_VIRTUAL, + __bool__isCulled__C5_BoundingBox_R1, + "", + ""); + I_Method1(bool, isCulled, IN, const osg::BoundingSphere &, bs, + Properties::NON_VIRTUAL, + __bool__isCulled__C5_BoundingSphere_R1, + "", + ""); + I_Method1(bool, isCulled, IN, const osg::Node &, node, + Properties::NON_VIRTUAL, + __bool__isCulled__C5_osg_Node_R1, + "", + ""); + I_Method0(void, pushCurrentMask, + Properties::NON_VIRTUAL, + __void__pushCurrentMask, + "", + ""); + I_Method0(void, popCurrentMask, + Properties::NON_VIRTUAL, + __void__popCurrentMask, + "", + ""); + I_Method0(osg::CullStack::CullingStack &, getClipSpaceCullingStack, + Properties::NON_VIRTUAL, + __CullingStack_R1__getClipSpaceCullingStack, + "", + ""); + I_Method0(osg::CullStack::CullingStack &, getProjectionCullingStack, + Properties::NON_VIRTUAL, + __CullingStack_R1__getProjectionCullingStack, + "", + ""); + I_Method0(osg::CullStack::CullingStack &, getModelViewCullingStack, + Properties::NON_VIRTUAL, + __CullingStack_R1__getModelViewCullingStack, + "", + ""); + I_Method0(osg::CullingSet &, getCurrentCullingSet, + Properties::NON_VIRTUAL, + __CullingSet_R1__getCurrentCullingSet, + "", + ""); + I_Method0(const osg::CullingSet &, getCurrentCullingSet, + Properties::NON_VIRTUAL, + __C5_CullingSet_R1__getCurrentCullingSet, + "", + ""); + I_Method0(osg::Viewport *, getViewport, + Properties::NON_VIRTUAL, + __osg_Viewport_P1__getViewport, + "", + ""); + I_Method0(osg::RefMatrix *, getModelViewMatrix, + Properties::NON_VIRTUAL, + __osg_RefMatrix_P1__getModelViewMatrix, + "", + ""); + I_Method0(osg::RefMatrix *, getProjectionMatrix, + Properties::NON_VIRTUAL, + __osg_RefMatrix_P1__getProjectionMatrix, + "", + ""); + I_Method0(osg::Matrix, getWindowMatrix, + Properties::NON_VIRTUAL, + __osg_Matrix__getWindowMatrix, + "", + ""); + I_Method0(const osg::RefMatrix *, getMVPW, + Properties::NON_VIRTUAL, + __C5_osg_RefMatrix_P1__getMVPW, + "", + ""); + I_Method0(const osg::Vec3 &, getReferenceViewPoint, + Properties::NON_VIRTUAL, + __C5_osg_Vec3_R1__getReferenceViewPoint, + "", + ""); + I_Method1(void, pushReferenceViewPoint, IN, const osg::Vec3 &, viewPoint, + Properties::NON_VIRTUAL, + __void__pushReferenceViewPoint__C5_osg_Vec3_R1, + "", + ""); + I_Method0(void, popReferenceViewPoint, + Properties::NON_VIRTUAL, + __void__popReferenceViewPoint, + "", + ""); + I_Method0(const osg::Vec3 &, getEyeLocal, + Properties::NON_VIRTUAL, + __C5_osg_Vec3_R1__getEyeLocal, + "", + ""); + I_Method0(const osg::Vec3 &, getViewPointLocal, + Properties::NON_VIRTUAL, + __C5_osg_Vec3_R1__getViewPointLocal, + "", + ""); + I_Method0(const osg::Vec3, getUpLocal, + Properties::NON_VIRTUAL, + __C5_osg_Vec3__getUpLocal, + "", + ""); + I_Method0(const osg::Vec3, getLookVectorLocal, + Properties::NON_VIRTUAL, + __C5_osg_Vec3__getLookVectorLocal, + "", + ""); + I_SimpleProperty(osg::CullStack::CullingStack &, ClipSpaceCullingStack, + __CullingStack_R1__getClipSpaceCullingStack, + 0); + I_SimpleProperty(osg::CullingSet &, CurrentCullingSet, + __CullingSet_R1__getCurrentCullingSet, + 0); + I_SimpleProperty(const osg::Vec3 &, EyeLocal, + __C5_osg_Vec3_R1__getEyeLocal, + 0); + I_SimpleProperty(float, FrustumVolume, + __float__getFrustumVolume, + 0); + I_SimpleProperty(const osg::Vec3, LookVectorLocal, + __C5_osg_Vec3__getLookVectorLocal, + 0); + I_SimpleProperty(const osg::RefMatrix *, MVPW, + __C5_osg_RefMatrix_P1__getMVPW, + 0); + I_SimpleProperty(osg::CullStack::CullingStack &, ModelViewCullingStack, + __CullingStack_R1__getModelViewCullingStack, + 0); + I_SimpleProperty(osg::RefMatrix *, ModelViewMatrix, + __osg_RefMatrix_P1__getModelViewMatrix, + 0); + I_SimpleProperty(const osg::ShadowVolumeOccluderList &, OccluderList, + __C5_ShadowVolumeOccluderList_R1__getOccluderList, + __void__setOccluderList__C5_ShadowVolumeOccluderList_R1); + I_SimpleProperty(osg::CullStack::CullingStack &, ProjectionCullingStack, + __CullingStack_R1__getProjectionCullingStack, + 0); + I_SimpleProperty(osg::RefMatrix *, ProjectionMatrix, + __osg_RefMatrix_P1__getProjectionMatrix, + 0); + I_SimpleProperty(const osg::Vec3 &, ReferenceViewPoint, + __C5_osg_Vec3_R1__getReferenceViewPoint, + 0); + I_SimpleProperty(const osg::Vec3, UpLocal, + __C5_osg_Vec3__getUpLocal, + 0); + I_SimpleProperty(const osg::Vec3 &, ViewPointLocal, + __C5_osg_Vec3_R1__getViewPointLocal, + 0); + I_SimpleProperty(osg::Viewport *, Viewport, + __osg_Viewport_P1__getViewport, + 0); + I_SimpleProperty(osg::Matrix, WindowMatrix, + __osg_Matrix__getWindowMatrix, + 0); +END_REFLECTOR + STD_VECTOR_REFLECTOR(std::vector< osg::CullingSet >); STD_VECTOR_REFLECTOR(std::vector< osg::ShadowVolumeOccluder >); diff --git a/src/osgWrappers/osgViewer/Scene.cpp b/src/osgWrappers/osgViewer/Scene.cpp index c53b07017..854c9384b 100644 --- a/src/osgWrappers/osgViewer/Scene.cpp +++ b/src/osgWrappers/osgViewer/Scene.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include // Must undefine IN and OUT macros defined in Windows headers @@ -73,6 +74,21 @@ BEGIN_OBJECT_REFLECTOR(osgViewer::Scene) __C5_osgDB_DatabasePager_P1__getDatabasePager, "", ""); + I_Method1(void, setUpdateVisitor, IN, osgUtil::UpdateVisitor *, uv, + Properties::NON_VIRTUAL, + __void__setUpdateVisitor__osgUtil_UpdateVisitor_P1, + "", + ""); + I_Method0(osgUtil::UpdateVisitor *, getUpdateVisitor, + Properties::NON_VIRTUAL, + __osgUtil_UpdateVisitor_P1__getUpdateVisitor, + "", + ""); + I_Method0(const osgUtil::UpdateVisitor *, getUpdateVisitor, + Properties::NON_VIRTUAL, + __C5_osgUtil_UpdateVisitor_P1__getUpdateVisitor, + "", + ""); I_Method0(void, frameAdvance, Properties::VIRTUAL, __void__frameAdvance, @@ -97,5 +113,8 @@ BEGIN_OBJECT_REFLECTOR(osgViewer::Scene) I_SimpleProperty(osg::Node *, SceneData, __osg_Node_P1__getSceneData, __void__setSceneData__osg_Node_P1); + I_SimpleProperty(osgUtil::UpdateVisitor *, UpdateVisitor, + __osgUtil_UpdateVisitor_P1__getUpdateVisitor, + __void__setUpdateVisitor__osgUtil_UpdateVisitor_P1); END_REFLECTOR