Renamed osg::CameraNode to osg::Camera, cleaned up osg::View.

Added beginnings of new osgViewer::Scene,View,Viewer,CompositeViewer and GraphicsWindowProxy files.
This commit is contained in:
Robert Osfield
2006-11-27 14:52:07 +00:00
parent b82e521444
commit fd2ffeb310
110 changed files with 2257 additions and 1466 deletions

View File

@@ -13,7 +13,7 @@
#include <osg/AnimationPath>
#include <osg/MatrixTransform>
#include <osg/PositionAttitudeTransform>
#include <osg/CameraNode>
#include <osg/Camera>
#include <osg/CameraView>
#include <osg/io_utils>
@@ -156,7 +156,7 @@ class AnimationPathCallbackVisitor : public NodeVisitor
_pivotPoint(pivotPoint),
_useInverseMatrix(useInverseMatrix) {}
virtual void apply(CameraNode& camera)
virtual void apply(Camera& camera)
{
Matrix matrix;
if (_useInverseMatrix)

View File

@@ -10,12 +10,12 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#include <osg/CameraNode>
#include <osg/Camera>
#include <osg/Notify>
using namespace osg;
CameraNode::CameraNode():
Camera::Camera():
_view(0),
_clearColor(osg::Vec4(0.0f,0.0f,0.0f,1.0f)),
_clearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT),
@@ -30,7 +30,7 @@ CameraNode::CameraNode():
setStateSet(new StateSet);
}
CameraNode::CameraNode(const CameraNode& camera,const CopyOp& copyop):
Camera::Camera(const Camera& camera,const CopyOp& copyop):
Transform(camera,copyop),
CullSettings(camera),
_view(camera._view),
@@ -53,23 +53,23 @@ CameraNode::CameraNode(const CameraNode& camera,const CopyOp& copyop):
}
CameraNode::~CameraNode()
Camera::~Camera()
{
}
bool CameraNode::isRenderToTextureCamera() const
bool Camera::isRenderToTextureCamera() const
{
return (!_bufferAttachmentMap.empty());
}
void CameraNode::setRenderTargetImplementation(RenderTargetImplementation impl)
void Camera::setRenderTargetImplementation(RenderTargetImplementation impl)
{
_renderTargetImplementation = impl;
if (impl<FRAME_BUFFER) _renderTargetFallback = (RenderTargetImplementation)(impl+1);
else _renderTargetFallback = impl;
}
void CameraNode::setRenderTargetImplementation(RenderTargetImplementation impl, RenderTargetImplementation fallback)
void Camera::setRenderTargetImplementation(RenderTargetImplementation impl, RenderTargetImplementation fallback)
{
if (impl<fallback || (impl==FRAME_BUFFER && fallback==FRAME_BUFFER))
{
@@ -78,12 +78,12 @@ void CameraNode::setRenderTargetImplementation(RenderTargetImplementation impl,
}
else
{
osg::notify(osg::NOTICE)<<"Warning: CameraNode::setRenderTargetImplementation(impl,fallback) must have a lower rated fallback than the main target implementation."<<std::endl;
osg::notify(osg::NOTICE)<<"Warning: Camera::setRenderTargetImplementation(impl,fallback) must have a lower rated fallback than the main target implementation."<<std::endl;
setRenderTargetImplementation(impl);
}
}
void CameraNode::setColorMask(osg::ColorMask* colorMask)
void Camera::setColorMask(osg::ColorMask* colorMask)
{
if (_colorMask == colorMask) return;
@@ -101,13 +101,13 @@ void CameraNode::setColorMask(osg::ColorMask* colorMask)
}
}
void CameraNode::setColorMask(bool red, bool green, bool blue, bool alpha)
void Camera::setColorMask(bool red, bool green, bool blue, bool alpha)
{
if (!_colorMask) setColorMask(new osg::ColorMask);
if (_colorMask.valid()) _colorMask->setMask(red,green,blue,alpha);
}
void CameraNode::setViewport(osg::Viewport* viewport)
void Camera::setViewport(osg::Viewport* viewport)
{
if (_viewport == viewport) return;
@@ -125,19 +125,19 @@ void CameraNode::setViewport(osg::Viewport* viewport)
}
}
void CameraNode::setViewport(int x,int y,int width,int height)
void Camera::setViewport(int x,int y,int width,int height)
{
if (!_viewport) setViewport(new osg::Viewport);
if (_viewport.valid()) _viewport->setViewport(x,y,width,height);
}
Matrixd CameraNode::getInverseViewMatrix() const
Matrixd Camera::getInverseViewMatrix() const
{
Matrixd inverse;
inverse.invert(_viewMatrix);
return inverse;
}
void CameraNode::setProjectionMatrixAsOrtho(double left, double right,
void Camera::setProjectionMatrixAsOrtho(double left, double right,
double bottom, double top,
double zNear, double zFar)
{
@@ -146,14 +146,14 @@ void CameraNode::setProjectionMatrixAsOrtho(double left, double right,
zNear, zFar));
}
void CameraNode::setProjectionMatrixAsOrtho2D(double left, double right,
void Camera::setProjectionMatrixAsOrtho2D(double left, double right,
double bottom, double top)
{
setProjectionMatrix(osg::Matrixd::ortho2D(left, right,
bottom, top));
}
void CameraNode::setProjectionMatrixAsFrustum(double left, double right,
void Camera::setProjectionMatrixAsFrustum(double left, double right,
double bottom, double top,
double zNear, double zFar)
{
@@ -162,14 +162,14 @@ void CameraNode::setProjectionMatrixAsFrustum(double left, double right,
zNear, zFar));
}
void CameraNode::setProjectionMatrixAsPerspective(double fovy,double aspectRatio,
void Camera::setProjectionMatrixAsPerspective(double fovy,double aspectRatio,
double zNear, double zFar)
{
setProjectionMatrix(osg::Matrixd::perspective(fovy,aspectRatio,
zNear, zFar));
}
bool CameraNode::getProjectionMatrixAsOrtho(double& left, double& right,
bool Camera::getProjectionMatrixAsOrtho(double& left, double& right,
double& bottom, double& top,
double& zNear, double& zFar)
{
@@ -178,7 +178,7 @@ bool CameraNode::getProjectionMatrixAsOrtho(double& left, double& right,
zNear, zFar);
}
bool CameraNode::getProjectionMatrixAsFrustum(double& left, double& right,
bool Camera::getProjectionMatrixAsFrustum(double& left, double& right,
double& bottom, double& top,
double& zNear, double& zFar)
{
@@ -187,29 +187,29 @@ bool CameraNode::getProjectionMatrixAsFrustum(double& left, double& right,
zNear, zFar);
}
bool CameraNode::getProjectionMatrixAsPerspective(double& fovy,double& aspectRatio,
bool Camera::getProjectionMatrixAsPerspective(double& fovy,double& aspectRatio,
double& zNear, double& zFar)
{
return _projectionMatrix.getPerspective(fovy, aspectRatio, zNear, zFar);
}
void CameraNode::setViewMatrixAsLookAt(const Vec3& eye,const Vec3& center,const Vec3& up)
void Camera::setViewMatrixAsLookAt(const Vec3& eye,const Vec3& center,const Vec3& up)
{
setViewMatrix(osg::Matrixd::lookAt(eye,center,up));
}
void CameraNode::getViewMatrixAsLookAt(Vec3& eye,Vec3& center,Vec3& up,float lookDistance)
void Camera::getViewMatrixAsLookAt(Vec3& eye,Vec3& center,Vec3& up,float lookDistance)
{
_viewMatrix.getLookAt(eye,center,up,lookDistance);
}
void CameraNode::attach(BufferComponent buffer, GLenum internalFormat)
void Camera::attach(BufferComponent buffer, GLenum internalFormat)
{
_bufferAttachmentMap[buffer]._internalFormat = internalFormat;
}
void CameraNode::attach(BufferComponent buffer, osg::Texture* texture, unsigned int level, unsigned int face, bool mipMapGeneration)
void Camera::attach(BufferComponent buffer, osg::Texture* texture, unsigned int level, unsigned int face, bool mipMapGeneration)
{
_bufferAttachmentMap[buffer]._texture = texture;
_bufferAttachmentMap[buffer]._level = level;
@@ -217,26 +217,26 @@ void CameraNode::attach(BufferComponent buffer, osg::Texture* texture, unsigned
_bufferAttachmentMap[buffer]._mipMapGeneration = mipMapGeneration;
}
void CameraNode::attach(BufferComponent buffer, osg::Image* image)
void Camera::attach(BufferComponent buffer, osg::Image* image)
{
_bufferAttachmentMap[buffer]._image = image;
}
void CameraNode::detach(BufferComponent buffer)
void Camera::detach(BufferComponent buffer)
{
_bufferAttachmentMap.erase(buffer);
}
void CameraNode::releaseGLObjects(osg::State* state) const
void Camera::releaseGLObjects(osg::State* state) const
{
if (state) const_cast<CameraNode*>(this)->_renderingCache[state->getContextID()] = 0;
else const_cast<CameraNode*>(this)->_renderingCache.setAllElementsTo(0);
if (state) const_cast<Camera*>(this)->_renderingCache[state->getContextID()] = 0;
else const_cast<Camera*>(this)->_renderingCache.setAllElementsTo(0);
Transform::releaseGLObjects(state);
}
bool CameraNode::computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const
bool Camera::computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const
{
if (_referenceFrame==RELATIVE_RF)
{
@@ -256,7 +256,7 @@ bool CameraNode::computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const
return true;
}
bool CameraNode::computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const
bool Camera::computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const
{
const Matrixd& inverse = getInverseViewMatrix();

View File

@@ -282,7 +282,7 @@ FrameBufferAttachment::FrameBufferAttachment(TextureRectangle* target)
_ximpl->textureTarget = target;
}
FrameBufferAttachment::FrameBufferAttachment(CameraNode::Attachment& attachment)
FrameBufferAttachment::FrameBufferAttachment(Camera::Attachment& attachment)
{
osg::Texture* texture = attachment._texture.get();
@@ -344,12 +344,12 @@ FrameBufferAttachment::FrameBufferAttachment(CameraNode::Attachment& attachment)
}
else
{
osg::notify(osg::WARN)<<"Error: FrameBufferAttachment::FrameBufferAttachment(CameraNode::Attachment&) passed an empty osg::Image, image must be allocated first."<<std::endl;
osg::notify(osg::WARN)<<"Error: FrameBufferAttachment::FrameBufferAttachment(Camera::Attachment&) passed an empty osg::Image, image must be allocated first."<<std::endl;
}
return;
}
osg::notify(osg::WARN)<<"Error: FrameBufferAttachment::FrameBufferAttachment(CameraNode::Attachment&) passed an unrecognised Texture type."<<std::endl;
osg::notify(osg::WARN)<<"Error: FrameBufferAttachment::FrameBufferAttachment(Camera::Attachment&) passed an unrecognised Texture type."<<std::endl;
}

View File

@@ -15,7 +15,7 @@ CXXFILES =\
BoundingBox.cpp\
BoundingSphere.cpp\
BufferObject.cpp\
CameraNode.cpp\
Camera.cpp\
CameraView.cpp\
ClearNode.cpp\
ClipNode.cpp\

View File

@@ -16,7 +16,7 @@
#include <osg/NodeVisitor>
#include <osg/Notify>
#include <osg/OccluderNode>
#include <osg/CameraNode>
#include <osg/Transform>
#include <algorithm>

View File

@@ -16,7 +16,7 @@
#include <osg/MatrixTransform>
#include <osg/PositionAttitudeTransform>
#include <osg/CameraView>
#include <osg/CameraNode>
#include <osg/Camera>
#include <osg/Notify>
using namespace osg;
@@ -28,7 +28,7 @@ class ApplyMatrixVisitor : public NodeVisitor
ApplyMatrixVisitor(const osg::Matrix& matrix):
_matrix(matrix) {}
virtual void apply(CameraNode& camera)
virtual void apply(Camera& camera)
{
camera.setViewMatrix(_matrix);
}

View File

@@ -11,7 +11,7 @@
* OpenSceneGraph Public License for more details.
*/
#include <osg/Transform>
#include <osg/CameraNode>
#include <osg/Camera>
#include <osg/Notify>
@@ -30,13 +30,13 @@ class TransformVisitor : public NodeVisitor
CoordMode _coordMode;
Matrix& _matrix;
bool _ignoreCameraNodes;
bool _ignoreCameras;
TransformVisitor(Matrix& matrix,CoordMode coordMode, bool ignoreCameraNodes):
TransformVisitor(Matrix& matrix,CoordMode coordMode, bool ignoreCameras):
NodeVisitor(),
_coordMode(coordMode),
_matrix(matrix),
_ignoreCameraNodes(ignoreCameraNodes)
_ignoreCameras(ignoreCameras)
{}
virtual void apply(Transform& transform)
@@ -56,9 +56,9 @@ class TransformVisitor : public NodeVisitor
if (nodePath.empty()) return;
unsigned int i = 0;
if (_ignoreCameraNodes)
if (_ignoreCameras)
{
// we need to found out the last absolute CameraNode in NodePath and
// we need to found out the last absolute Camera in NodePath and
// set the i index to after it so the final accumulation set ignores it.
i = nodePath.size();
NodePath::const_reverse_iterator ritr;
@@ -66,7 +66,7 @@ class TransformVisitor : public NodeVisitor
ritr != nodePath.rend();
++ritr, --i)
{
const osg::CameraNode* camera = dynamic_cast<const osg::CameraNode*>(*ritr);
const osg::Camera* camera = dynamic_cast<const osg::Camera*>(*ritr);
if (camera &&
(camera->getReferenceFrame()==osg::Transform::ABSOLUTE_RF || camera->getParents().empty()))
{
@@ -86,35 +86,35 @@ class TransformVisitor : public NodeVisitor
};
Matrix osg::computeLocalToWorld(const NodePath& nodePath, bool ignoreCameraNodes)
Matrix osg::computeLocalToWorld(const NodePath& nodePath, bool ignoreCameras)
{
Matrix matrix;
TransformVisitor tv(matrix,TransformVisitor::LOCAL_TO_WORLD,ignoreCameraNodes);
TransformVisitor tv(matrix,TransformVisitor::LOCAL_TO_WORLD,ignoreCameras);
tv.accumulate(nodePath);
return matrix;
}
Matrix osg::computeWorldToLocal(const NodePath& nodePath, bool ignoreCameraNodes)
Matrix osg::computeWorldToLocal(const NodePath& nodePath, bool ignoreCameras)
{
osg::Matrix matrix;
TransformVisitor tv(matrix,TransformVisitor::WORLD_TO_LOCAL,ignoreCameraNodes);
TransformVisitor tv(matrix,TransformVisitor::WORLD_TO_LOCAL,ignoreCameras);
tv.accumulate(nodePath);
return matrix;
}
Matrix osg::computeLocalToEye(const Matrix& modelview,const NodePath& nodePath, bool ignoreCameraNodes)
Matrix osg::computeLocalToEye(const Matrix& modelview,const NodePath& nodePath, bool ignoreCameras)
{
Matrix matrix(modelview);
TransformVisitor tv(matrix,TransformVisitor::LOCAL_TO_WORLD,ignoreCameraNodes);
TransformVisitor tv(matrix,TransformVisitor::LOCAL_TO_WORLD,ignoreCameras);
tv.accumulate(nodePath);
return matrix;
}
Matrix osg::computeEyeToLocal(const Matrix& modelview,const NodePath& nodePath, bool ignoreCameraNodes)
Matrix osg::computeEyeToLocal(const Matrix& modelview,const NodePath& nodePath, bool ignoreCameras)
{
Matrix matrix;
matrix.invert(modelview);
TransformVisitor tv(matrix,TransformVisitor::WORLD_TO_LOCAL,ignoreCameraNodes);
TransformVisitor tv(matrix,TransformVisitor::WORLD_TO_LOCAL,ignoreCameras);
tv.accumulate(nodePath);
return matrix;
}

View File

@@ -6,7 +6,7 @@
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* but WITHOUT ANY WARRA;NTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@@ -15,203 +15,69 @@
using namespace osg;
// use this cull callback to allow the camera to traverse the View's children without
// actuall having them assigned as children to the camea itself. This make the camera a
// decorator without ever directly being assigned to it.
class ViewCameraTraverseNodeCallback : public osg::NodeCallback
{
public:
ViewCameraTraverseNodeCallback(osg::View* view):_view(view) {}
virtual void operator()(osg::Node*, osg::NodeVisitor* nv)
{
_view->Group::traverse(*nv);
}
osg::View* _view;
};
View::View()
{
setReferenceFrame(osg::Transform::ABSOLUTE_RF);
}
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
View::View(const View& view,const CopyOp& copyop):
Transform(view,copyop),
CullSettings(view),
_projectionMatrix(view._projectionMatrix),
_viewMatrix(view._viewMatrix)
{
// need to clone the cameras.
for(unsigned int i=0; i<view.getNumCameras(); ++i)
{
const CameraData& cd = view.getCameraData(i);
addCamera(dynamic_cast<osg::CameraNode*>(cd._camera->clone(copyop)), cd._projectionOffset, cd._viewOffset);
}
}
View::~View()
{
// detatch the cameras from this View to prevent dangling pointers
for(CameraList::iterator itr = _cameras.begin();
itr != _cameras.end();
for(Slaves::iterator itr = _slaves.begin();
itr != _slaves.end();
++itr)
{
CameraData& cd = *itr;
Slave& cd = *itr;
cd._camera->setView(0);
cd._camera->setCullCallback(0);
}
}
Matrixd View::getInverseViewMatrix() const
void View::updateSlaves()
{
Matrixd inverse;
inverse.invert(_viewMatrix);
return inverse;
}
void View::setProjectionMatrixAsOrtho(double left, double right,
double bottom, double top,
double zNear, double zFar)
{
setProjectionMatrix(osg::Matrixd::ortho(left, right,
bottom, top,
zNear, zFar));
}
void View::setProjectionMatrixAsOrtho2D(double left, double right,
double bottom, double top)
{
setProjectionMatrix(osg::Matrixd::ortho2D(left, right,
bottom, top));
}
void View::setProjectionMatrixAsFrustum(double left, double right,
double bottom, double top,
double zNear, double zFar)
{
setProjectionMatrix(osg::Matrixd::frustum(left, right,
bottom, top,
zNear, zFar));
}
void View::setProjectionMatrixAsPerspective(double fovy,double aspectRatio,
double zNear, double zFar)
{
setProjectionMatrix(osg::Matrixd::perspective(fovy,aspectRatio,
zNear, zFar));
}
bool View::getProjectionMatrixAsOrtho(double& left, double& right,
double& bottom, double& top,
double& zNear, double& zFar)
{
return _projectionMatrix.getOrtho(left, right,
bottom, top,
zNear, zFar);
}
bool View::getProjectionMatrixAsFrustum(double& left, double& right,
double& bottom, double& top,
double& zNear, double& zFar)
{
return _projectionMatrix.getFrustum(left, right,
bottom, top,
zNear, zFar);
}
bool View::getProjectionMatrixAsPerspective(double& fovy,double& aspectRatio,
double& zNear, double& zFar)
{
return _projectionMatrix.getPerspective(fovy, aspectRatio, zNear, zFar);
}
void View::setViewMatrixAsLookAt(const Vec3& eye,const Vec3& center,const Vec3& up)
{
setViewMatrix(osg::Matrixd::lookAt(eye,center,up));
}
void View::getViewMatrixAsLookAt(Vec3& eye,Vec3& center,Vec3& up,float lookDistance)
{
_viewMatrix.getLookAt(eye,center,up,lookDistance);
}
bool View::computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const
{
if (_referenceFrame==RELATIVE_RF)
{
matrix.preMult(_viewMatrix);
}
else // absolute
{
matrix = _viewMatrix;
}
return true;
}
bool View::computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const
{
const Matrixd& inverse = getInverseViewMatrix();
if (_referenceFrame==RELATIVE_RF)
{
// note doing inverse so pre becomes post.
matrix.postMult(inverse);
}
else // absolute
{
matrix = inverse;
}
return true;
}
void View::updateCameras()
{
for(CameraList::iterator itr = _cameras.begin();
itr != _cameras.end();
if (!_camera) return;
for(Slaves::iterator itr = _slaves.begin();
itr != _slaves.end();
++itr)
{
CameraData& cd = *itr;
cd._camera->setProjectionMatrix(cd._projectionOffset * _projectionMatrix);
cd._camera->setViewMatrix(cd._viewOffset * _viewMatrix);
cd._camera->inheritCullSettings(*this);
Slave& cd = *itr;
cd._camera->setProjectionMatrix(cd._projectionOffset * _camera->getProjectionMatrix());
cd._camera->setViewMatrix(cd._viewOffset * _camera->getViewMatrix());
cd._camera->inheritCullSettings(*_camera);
}
}
bool View::addCamera(osg::CameraNode* camera, const osg::Matrix& projectionOffset, const osg::Matrix& viewOffset)
bool View::addSlave(osg::Camera* camera, const osg::Matrix& projectionOffset, const osg::Matrix& viewOffset)
{
if (!camera) return false;
ViewCameraTraverseNodeCallback* cb = new ViewCameraTraverseNodeCallback(this);
camera->setCullCallback(cb);
camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
camera->setProjectionMatrix(projectionOffset * _projectionMatrix);
camera->setViewMatrix(viewOffset * _viewMatrix);
camera->inheritCullSettings(*this);
_cameras.push_back(CameraData(camera, projectionOffset, viewOffset));
if (_camera.valid())
{
camera->setProjectionMatrix(projectionOffset * _camera->getProjectionMatrix());
camera->setViewMatrix(viewOffset * _camera->getViewMatrix());
camera->inheritCullSettings(*_camera);
}
_slaves.push_back(Slave(camera, projectionOffset, viewOffset));
// osg::notify(osg::NOTICE)<<"Added camera"<<std::endl;
return true;
}
bool View::removeCamera(unsigned int pos)
bool View::removeSlave(unsigned int pos)
{
if (pos >= _cameras.size()) return false;
if (pos >= _slaves.size()) return false;
_cameras[pos]._camera->setView(0);
_cameras[pos]._camera->setCullCallback(0);
_slaves[pos]._camera->setView(0);
_slaves[pos]._camera->setCullCallback(0);
_cameras.erase(_cameras.begin()+pos);
_slaves.erase(_slaves.begin()+pos);
osg::notify(osg::NOTICE)<<"Removed camera"<<std::endl;

View File

@@ -287,11 +287,9 @@ ConvertFromInventor::postShape(void* data, SoCallbackAction* action,
textureMat.set((float *) action->getTextureMatrix().getValue());
// Transform texture coordinates if texture matrix is not an identity mat
osg::Matrix identityMat;
identityMat.makeIdentity();
osg::Vec2Array* texCoords
= new osg::Vec2Array(thisPtr->textureCoords.size());
if (textureMat == identityMat)
if (textureMat.isIdentity())
{
// Set the texture coordinates
for (unsigned int i = 0; i < thisPtr->textureCoords.size(); i++)

View File

@@ -148,7 +148,7 @@ void daeWriter::apply( osg::LightSource &node )
}
//CAMERA
void daeWriter::apply( osg::CameraNode &node )
void daeWriter::apply( osg::Camera &node )
{
#ifdef _DEBUG
debugPrint( node );

View File

@@ -22,7 +22,7 @@
#include <osg/Geometry>
#include <osg/Group>
#include <osg/LightSource>
#include <osg/CameraNode>
#include <osg/Camera>
#include <osg/Material>
#include <osg/MatrixTransform>
#include <osg/PositionAttitudeTransform>
@@ -88,7 +88,7 @@ public:
virtual void apply( osg::Geode &node );
virtual void apply( osg::Group &node );
virtual void apply( osg::LightSource &node );
virtual void apply( osg::CameraNode &node );
virtual void apply( osg::Camera &node );
virtual void apply( osg::MatrixTransform &node );
virtual void apply( osg::PositionAttitudeTransform &node );
virtual void apply( osg::Switch &node );

View File

@@ -1,8 +1,8 @@
/**********************************************************************
*
* FILE: CameraNode.cpp
* FILE: Camera.cpp
*
* DESCRIPTION: Read/Write osg::CameraNode in binary format to disk.
* DESCRIPTION: Read/Write osg::Camera in binary format to disk.
*
* CREATED BY: Auto generated by iveGenerated
* and later modified by Rune Schmidt Jensen.
@@ -13,15 +13,15 @@
**********************************************************************/
#include "Exception.h"
#include "CameraNode.h"
#include "Camera.h"
#include "Transform.h"
#include "Image.h"
using namespace ive;
void CameraNode::write(DataOutputStream* out){
// Write CameraNode's identification.
out->writeInt(IVECAMERANODE);
void Camera::write(DataOutputStream* out){
// Write Camera's identification.
out->writeInt(IVECAMERA);
// If the osg class is inherited by any other class we should also write this to file.
osg::Transform* transform = dynamic_cast<osg::Transform*>(this);
@@ -29,7 +29,7 @@ void CameraNode::write(DataOutputStream* out){
((ive::Transform*)(transform))->write(out);
}
else
throw Exception("CameraNode::write(): Could not cast this osg::CameraNode to an osg::Group.");
throw Exception("Camera::write(): Could not cast this osg::Camera to an osg::Group.");
out->writeVec4(getClearColor());
@@ -49,7 +49,7 @@ void CameraNode::write(DataOutputStream* out){
out->writeInt(getTransformOrder());
// Write CameraNode's properties.
// Write Camera's properties.
out->writeMatrixd(getProjectionMatrix());
out->writeMatrixd(getViewMatrix());
@@ -88,13 +88,13 @@ void CameraNode::write(DataOutputStream* out){
}
void CameraNode::read(DataInputStream* in)
void Camera::read(DataInputStream* in)
{
// Read CameraNode's identification.
// Read Camera's identification.
int id = in->peekInt();
if(id == IVECAMERANODE)
if(id == IVECAMERA)
{
// Code to read CameraNode's properties.
// Code to read Camera's properties.
id = in->readInt();
// If the osg class is inherited by any other class we should also read this from file.
osg::Transform* transform = dynamic_cast<osg::Transform*>(this);
@@ -103,7 +103,7 @@ void CameraNode::read(DataInputStream* in)
((ive::Transform*)(transform))->read(in);
}
else
throw Exception("CameraNode::read(): Could not cast this osg::CameraNode to an osg::Group.");
throw Exception("Camera::read(): Could not cast this osg::Camera to an osg::Group.");
setClearColor(in->readVec4());
setClearMask(in->readUInt());
@@ -166,6 +166,6 @@ void CameraNode::read(DataInputStream* in)
}
}
else{
throw Exception("CameraNode::read(): Expected CameraNode identification");
throw Exception("Camera::read(): Expected Camera identification");
}
}

View File

@@ -50,7 +50,7 @@
#include "Group.h"
#include "MatrixTransform.h"
#include "CameraNode.h"
#include "Camera.h"
#include "CameraView.h"
#include "Geode.h"
#include "LightSource.h"
@@ -1207,9 +1207,9 @@ osg::Node* DataInputStream::readNode()
node = new osg::MatrixTransform();
((ive::MatrixTransform*)(node))->read(this);
}
else if(nodeTypeID== IVECAMERANODE){
node = new osg::CameraNode();
((ive::CameraNode*)(node))->read(this);
else if(nodeTypeID== IVECAMERA){
node = new osg::Camera();
((ive::Camera*)(node))->read(this);
}
else if(nodeTypeID== IVECAMERAVIEW){
node = new osg::CameraView();

View File

@@ -53,7 +53,7 @@
#include "Group.h"
#include "MatrixTransform.h"
#include "CameraNode.h"
#include "Camera.h"
#include "CameraView.h"
#include "Geode.h"
#include "LightSource.h"
@@ -927,8 +927,8 @@ void DataOutputStream::writeNode(const osg::Node* node)
if(dynamic_cast<const osg::MatrixTransform*>(node)){
((ive::MatrixTransform*)(node))->write(this);
}
else if(dynamic_cast<const osg::CameraNode*>(node)){
((ive::CameraNode*)(node))->write(this);
else if(dynamic_cast<const osg::Camera*>(node)){
((ive::Camera*)(node))->write(this);
}
else if(dynamic_cast<const osg::CameraView*>(node)){
((ive::CameraView*)(node))->write(this);

View File

@@ -14,7 +14,7 @@ CXXFILES =\
ClipNode.cpp\
ClipPlane.cpp\
ClusterCullingCallback.cpp\
CameraNode.cpp\
Camera.cpp\
CameraView.cpp\
ConeSector.cpp\
ConvexPlanarOccluder.cpp\

View File

@@ -34,7 +34,7 @@ namespace ive {
#define IVETEXGENNODE 0x00000025
#define IVECLIPNODE 0x00000026
#define IVEPROXYNODE 0x00000027
#define IVECAMERANODE 0x00000028
#define IVECAMERA 0x00000028
#define IVECAMERAVIEW 0x00000029
#define IVEAUTOTRANSFORM 0x00000030

View File

@@ -1,4 +1,4 @@
#include <osg/CameraNode>
#include <osg/Camera>
#include <osg/io_utils>
#include <osg/Notify>
@@ -12,29 +12,40 @@ using namespace osg;
using namespace osgDB;
// forward declare functions to use later.
bool CameraNode_readLocalData(Object& obj, Input& fr);
bool CameraNode_writeLocalData(const Object& obj, Output& fw);
bool Camera_readLocalData(Object& obj, Input& fr);
bool Camera_writeLocalData(const Object& obj, Output& fw);
bool CameraNode_matchBufferComponentStr(const char* str,CameraNode::BufferComponent& buffer);
const char* CameraNode_getBufferComponentStr(CameraNode::BufferComponent buffer);
bool Camera_matchBufferComponentStr(const char* str,Camera::BufferComponent& buffer);
const char* Camera_getBufferComponentStr(Camera::BufferComponent buffer);
// register the read and write functions with the osgDB::Registry.
RegisterDotOsgWrapperProxy g_CameraProxy
(
new osg::Camera,
"Camera",
"Object Node Transform Camera Group",
&Camera_readLocalData,
&Camera_writeLocalData,
DotOsgWrapper::READ_AND_WRITE
);
// register the read and write functions with the osgDB::Registry.
RegisterDotOsgWrapperProxy g_CameraNodeProxy
(
new osg::CameraNode,
new osg::Camera,
"CameraNode",
"Object Node Transform CameraNode Group",
&CameraNode_readLocalData,
&CameraNode_writeLocalData,
&Camera_readLocalData,
&Camera_writeLocalData,
DotOsgWrapper::READ_AND_WRITE
);
bool CameraNode_readLocalData(Object& obj, Input& fr)
bool Camera_readLocalData(Object& obj, Input& fr)
{
bool iteratorAdvanced = false;
CameraNode& camera = static_cast<CameraNode&>(obj);
Camera& camera = static_cast<Camera&>(obj);
if (fr.matchSequence("clearColor %f %f %f %f"))
{
@@ -71,11 +82,11 @@ bool CameraNode_readLocalData(Object& obj, Input& fr)
if (fr.matchSequence("transformOrder %w"))
{
if (fr[1].matchWord("PRE_MULTIPLY")) camera.setTransformOrder(osg::CameraNode::PRE_MULTIPLY);
else if (fr[1].matchWord("POST_MULTIPLY")) camera.setTransformOrder(osg::CameraNode::POST_MULTIPLY);
if (fr[1].matchWord("PRE_MULTIPLY")) camera.setTransformOrder(osg::Camera::PRE_MULTIPLY);
else if (fr[1].matchWord("POST_MULTIPLY")) camera.setTransformOrder(osg::Camera::POST_MULTIPLY);
// the following are for backwards compatibility.
else if (fr[1].matchWord("PRE_MULTIPLE")) camera.setTransformOrder(osg::CameraNode::PRE_MULTIPLY);
else if (fr[1].matchWord("POST_MULTIPLE")) camera.setTransformOrder(osg::CameraNode::POST_MULTIPLY);
else if (fr[1].matchWord("PRE_MULTIPLE")) camera.setTransformOrder(osg::Camera::PRE_MULTIPLY);
else if (fr[1].matchWord("POST_MULTIPLE")) camera.setTransformOrder(osg::Camera::POST_MULTIPLY);
fr += 2;
iteratorAdvanced = true;
@@ -96,9 +107,9 @@ bool CameraNode_readLocalData(Object& obj, Input& fr)
if (fr.matchSequence("renderOrder %w"))
{
if (fr[1].matchWord("PRE_RENDER")) camera.setRenderOrder(osg::CameraNode::PRE_RENDER);
else if (fr[1].matchWord("NESTED_RENDER")) camera.setRenderOrder(osg::CameraNode::NESTED_RENDER);
else if (fr[1].matchWord("POST_RENDER")) camera.setRenderOrder(osg::CameraNode::POST_RENDER);
if (fr[1].matchWord("PRE_RENDER")) camera.setRenderOrder(osg::Camera::PRE_RENDER);
else if (fr[1].matchWord("NESTED_RENDER")) camera.setRenderOrder(osg::Camera::NESTED_RENDER);
else if (fr[1].matchWord("POST_RENDER")) camera.setRenderOrder(osg::Camera::POST_RENDER);
fr += 2;
iteratorAdvanced = true;
@@ -106,13 +117,13 @@ bool CameraNode_readLocalData(Object& obj, Input& fr)
if (fr.matchSequence("renderTargetImplementation %w"))
{
osg::CameraNode::RenderTargetImplementation implementation = osg::CameraNode::FRAME_BUFFER;
osg::Camera::RenderTargetImplementation implementation = osg::Camera::FRAME_BUFFER;
if (fr[1].matchWord("FRAME_BUFFER_OBJECT")) implementation = osg::CameraNode::FRAME_BUFFER_OBJECT;
else if (fr[1].matchWord("PIXEL_BUFFER_RTT")) implementation = osg::CameraNode::PIXEL_BUFFER_RTT;
else if (fr[1].matchWord("PIXEL_BUFFER")) implementation = osg::CameraNode::PIXEL_BUFFER;
else if (fr[1].matchWord("FRAME_BUFFER")) implementation = osg::CameraNode::FRAME_BUFFER;
else if (fr[1].matchWord("SEPERATE_WINDOW")) implementation = osg::CameraNode::SEPERATE_WINDOW;
if (fr[1].matchWord("FRAME_BUFFER_OBJECT")) implementation = osg::Camera::FRAME_BUFFER_OBJECT;
else if (fr[1].matchWord("PIXEL_BUFFER_RTT")) implementation = osg::Camera::PIXEL_BUFFER_RTT;
else if (fr[1].matchWord("PIXEL_BUFFER")) implementation = osg::Camera::PIXEL_BUFFER;
else if (fr[1].matchWord("FRAME_BUFFER")) implementation = osg::Camera::FRAME_BUFFER;
else if (fr[1].matchWord("SEPERATE_WINDOW")) implementation = osg::Camera::SEPERATE_WINDOW;
camera.setRenderTargetImplementation(implementation);
@@ -122,13 +133,13 @@ bool CameraNode_readLocalData(Object& obj, Input& fr)
if (fr.matchSequence("renderTargetImplementation %w"))
{
osg::CameraNode::RenderTargetImplementation fallback = camera.getRenderTargetFallback();
osg::Camera::RenderTargetImplementation fallback = camera.getRenderTargetFallback();
if (fr[1].matchWord("FRAME_BUFFER_OBJECT")) fallback = osg::CameraNode::FRAME_BUFFER_OBJECT;
else if (fr[1].matchWord("PIXEL_BUFFER_RTT")) fallback = osg::CameraNode::PIXEL_BUFFER_RTT;
else if (fr[1].matchWord("PIXEL_BUFFER")) fallback = osg::CameraNode::PIXEL_BUFFER;
else if (fr[1].matchWord("FRAME_BUFFER")) fallback = osg::CameraNode::FRAME_BUFFER;
else if (fr[1].matchWord("SEPERATE_WINDOW")) fallback = osg::CameraNode::SEPERATE_WINDOW;
if (fr[1].matchWord("FRAME_BUFFER_OBJECT")) fallback = osg::Camera::FRAME_BUFFER_OBJECT;
else if (fr[1].matchWord("PIXEL_BUFFER_RTT")) fallback = osg::Camera::PIXEL_BUFFER_RTT;
else if (fr[1].matchWord("PIXEL_BUFFER")) fallback = osg::Camera::PIXEL_BUFFER;
else if (fr[1].matchWord("FRAME_BUFFER")) fallback = osg::Camera::FRAME_BUFFER;
else if (fr[1].matchWord("SEPERATE_WINDOW")) fallback = osg::Camera::SEPERATE_WINDOW;
camera.setRenderTargetImplementation(camera.getRenderTargetImplementation(), fallback);
@@ -141,12 +152,12 @@ bool CameraNode_readLocalData(Object& obj, Input& fr)
{
int entry = fr[1].getNoNestedBrackets();
CameraNode::BufferComponent buffer;
CameraNode_matchBufferComponentStr(fr[1].getStr(),buffer);
Camera::BufferComponent buffer;
Camera_matchBufferComponentStr(fr[1].getStr(),buffer);
fr += 3;
CameraNode::Attachment& attachment = camera.getBufferAttachmentMap()[buffer];
Camera::Attachment& attachment = camera.getBufferAttachmentMap()[buffer];
// read attachment data.
while (!fr.eof() && fr[0].getNoNestedBrackets()>entry)
@@ -218,9 +229,9 @@ bool CameraNode_readLocalData(Object& obj, Input& fr)
}
bool CameraNode_writeLocalData(const Object& obj, Output& fw)
bool Camera_writeLocalData(const Object& obj, Output& fw)
{
const CameraNode& camera = static_cast<const CameraNode&>(obj);
const Camera& camera = static_cast<const Camera&>(obj);
fw.indent()<<"clearColor "<<camera.getClearColor()<<std::endl;
fw.indent()<<"clearMask 0x"<<std::hex<<camera.getClearMask()<<std::endl;
@@ -238,8 +249,8 @@ bool CameraNode_writeLocalData(const Object& obj, Output& fw)
fw.indent()<<"transformOrder ";
switch(camera.getTransformOrder())
{
case(osg::CameraNode::PRE_MULTIPLY): fw <<"PRE_MULTIPLY"<<std::endl; break;
case(osg::CameraNode::POST_MULTIPLY): fw <<"POST_MULTIPLY"<<std::endl; break;
case(osg::Camera::PRE_MULTIPLY): fw <<"PRE_MULTIPLY"<<std::endl; break;
case(osg::Camera::POST_MULTIPLY): fw <<"POST_MULTIPLY"<<std::endl; break;
}
writeMatrix(camera.getProjectionMatrix(),fw,"ProjectionMatrix");
@@ -248,43 +259,43 @@ bool CameraNode_writeLocalData(const Object& obj, Output& fw)
fw.indent()<<"renderOrder ";
switch(camera.getRenderOrder())
{
case(osg::CameraNode::PRE_RENDER): fw <<"PRE_RENDER"<<std::endl; break;
case(osg::CameraNode::NESTED_RENDER): fw <<"NESTED_RENDER"<<std::endl; break;
case(osg::CameraNode::POST_RENDER): fw <<"POST_RENDER"<<std::endl; break;
case(osg::Camera::PRE_RENDER): fw <<"PRE_RENDER"<<std::endl; break;
case(osg::Camera::NESTED_RENDER): fw <<"NESTED_RENDER"<<std::endl; break;
case(osg::Camera::POST_RENDER): fw <<"POST_RENDER"<<std::endl; break;
}
fw.indent()<<"renderTargetImplementation ";
switch(camera.getRenderTargetImplementation())
{
case(osg::CameraNode::FRAME_BUFFER_OBJECT): fw <<"FRAME_BUFFER_OBJECT"<<std::endl; break;
case(osg::CameraNode::PIXEL_BUFFER_RTT): fw <<"PIXEL_BUFFER_RTT"<<std::endl; break;
case(osg::CameraNode::PIXEL_BUFFER): fw <<"PIXEL_BUFFER"<<std::endl; break;
case(osg::CameraNode::FRAME_BUFFER): fw <<"FRAME_BUFFER"<<std::endl; break;
case(osg::CameraNode::SEPERATE_WINDOW): fw <<"SEPERATE_WINDOW"<<std::endl; break;
case(osg::Camera::FRAME_BUFFER_OBJECT): fw <<"FRAME_BUFFER_OBJECT"<<std::endl; break;
case(osg::Camera::PIXEL_BUFFER_RTT): fw <<"PIXEL_BUFFER_RTT"<<std::endl; break;
case(osg::Camera::PIXEL_BUFFER): fw <<"PIXEL_BUFFER"<<std::endl; break;
case(osg::Camera::FRAME_BUFFER): fw <<"FRAME_BUFFER"<<std::endl; break;
case(osg::Camera::SEPERATE_WINDOW): fw <<"SEPERATE_WINDOW"<<std::endl; break;
}
fw.indent()<<"renderTargetFallback ";
switch(camera.getRenderTargetFallback())
{
case(osg::CameraNode::FRAME_BUFFER_OBJECT): fw <<"FRAME_BUFFER_OBJECT"<<std::endl; break;
case(osg::CameraNode::PIXEL_BUFFER_RTT): fw <<"PIXEL_BUFFER_RTT"<<std::endl; break;
case(osg::CameraNode::PIXEL_BUFFER): fw <<"PIXEL_BUFFER"<<std::endl; break;
case(osg::CameraNode::FRAME_BUFFER): fw <<"FRAME_BUFFER"<<std::endl; break;
case(osg::CameraNode::SEPERATE_WINDOW): fw <<"SEPERATE_WINDOW"<<std::endl; break;
case(osg::Camera::FRAME_BUFFER_OBJECT): fw <<"FRAME_BUFFER_OBJECT"<<std::endl; break;
case(osg::Camera::PIXEL_BUFFER_RTT): fw <<"PIXEL_BUFFER_RTT"<<std::endl; break;
case(osg::Camera::PIXEL_BUFFER): fw <<"PIXEL_BUFFER"<<std::endl; break;
case(osg::Camera::FRAME_BUFFER): fw <<"FRAME_BUFFER"<<std::endl; break;
case(osg::Camera::SEPERATE_WINDOW): fw <<"SEPERATE_WINDOW"<<std::endl; break;
}
fw.indent()<<"drawBuffer "<<std::hex<<camera.getDrawBuffer()<<std::endl;
fw.indent()<<"readBuffer "<<std::hex<<camera.getReadBuffer()<<std::endl;
const osg::CameraNode::BufferAttachmentMap& bam = camera.getBufferAttachmentMap();
const osg::Camera::BufferAttachmentMap& bam = camera.getBufferAttachmentMap();
if (!bam.empty())
{
for(osg::CameraNode::BufferAttachmentMap::const_iterator itr=bam.begin();
for(osg::Camera::BufferAttachmentMap::const_iterator itr=bam.begin();
itr!=bam.end();
++itr)
{
const osg::CameraNode::Attachment& attachment = itr->second;
fw.indent()<<"bufferComponent "<<CameraNode_getBufferComponentStr(itr->first)<<" {"<<std::endl;
const osg::Camera::Attachment& attachment = itr->second;
fw.indent()<<"bufferComponent "<<Camera_getBufferComponentStr(itr->first)<<" {"<<std::endl;
fw.moveIn();
fw.indent()<<"internalFormat "<<attachment._internalFormat<<std::endl;
@@ -304,73 +315,37 @@ bool CameraNode_writeLocalData(const Object& obj, Output& fw)
return true;
}
bool CameraNode_matchBufferComponentStr(const char* str,CameraNode::BufferComponent& buffer)
bool Camera_matchBufferComponentStr(const char* str,Camera::BufferComponent& buffer)
{
if (strcmp(str,"DEPTH_BUFFER")==0) buffer = osg::CameraNode::DEPTH_BUFFER;
else if (strcmp(str,"STENCIL_BUFFER")==0) buffer = osg::CameraNode::STENCIL_BUFFER;
else if (strcmp(str,"COLOR_BUFFER")==0) buffer = osg::CameraNode::COLOR_BUFFER;
else if (strcmp(str,"COLOR_BUFFER0")==0) buffer = osg::CameraNode::COLOR_BUFFER0;
else if (strcmp(str,"COLOR_BUFFER1")==0) buffer = osg::CameraNode::COLOR_BUFFER1;
else if (strcmp(str,"COLOR_BUFFER2")==0) buffer = osg::CameraNode::COLOR_BUFFER2;
else if (strcmp(str,"COLOR_BUFFER3")==0) buffer = osg::CameraNode::COLOR_BUFFER3;
else if (strcmp(str,"COLOR_BUFFER4")==0) buffer = osg::CameraNode::COLOR_BUFFER4;
else if (strcmp(str,"COLOR_BUFFER5")==0) buffer = osg::CameraNode::COLOR_BUFFER5;
else if (strcmp(str,"COLOR_BUFFER6")==0) buffer = osg::CameraNode::COLOR_BUFFER6;
else if (strcmp(str,"COLOR_BUFFER7")==0) buffer = osg::CameraNode::COLOR_BUFFER7;
if (strcmp(str,"DEPTH_BUFFER")==0) buffer = osg::Camera::DEPTH_BUFFER;
else if (strcmp(str,"STENCIL_BUFFER")==0) buffer = osg::Camera::STENCIL_BUFFER;
else if (strcmp(str,"COLOR_BUFFER")==0) buffer = osg::Camera::COLOR_BUFFER;
else if (strcmp(str,"COLOR_BUFFER0")==0) buffer = osg::Camera::COLOR_BUFFER0;
else if (strcmp(str,"COLOR_BUFFER1")==0) buffer = osg::Camera::COLOR_BUFFER1;
else if (strcmp(str,"COLOR_BUFFER2")==0) buffer = osg::Camera::COLOR_BUFFER2;
else if (strcmp(str,"COLOR_BUFFER3")==0) buffer = osg::Camera::COLOR_BUFFER3;
else if (strcmp(str,"COLOR_BUFFER4")==0) buffer = osg::Camera::COLOR_BUFFER4;
else if (strcmp(str,"COLOR_BUFFER5")==0) buffer = osg::Camera::COLOR_BUFFER5;
else if (strcmp(str,"COLOR_BUFFER6")==0) buffer = osg::Camera::COLOR_BUFFER6;
else if (strcmp(str,"COLOR_BUFFER7")==0) buffer = osg::Camera::COLOR_BUFFER7;
else return false;
return true;
}
const char* CameraNode_getBufferComponentStr(CameraNode::BufferComponent buffer)
const char* Camera_getBufferComponentStr(Camera::BufferComponent buffer)
{
switch(buffer)
{
case (osg::CameraNode::DEPTH_BUFFER) : return "DEPTH_BUFFER";
case (osg::CameraNode::STENCIL_BUFFER) : return "STENCIL_BUFFER";
case (osg::CameraNode::COLOR_BUFFER) : return "COLOR_BUFFER";
case (osg::CameraNode::COLOR_BUFFER1) : return "COLOR_BUFFER1";
case (osg::CameraNode::COLOR_BUFFER2) : return "COLOR_BUFFER2";
case (osg::CameraNode::COLOR_BUFFER3) : return "COLOR_BUFFER3";
case (osg::CameraNode::COLOR_BUFFER4) : return "COLOR_BUFFER4";
case (osg::CameraNode::COLOR_BUFFER5) : return "COLOR_BUFFER5";
case (osg::CameraNode::COLOR_BUFFER6) : return "COLOR_BUFFER6";
case (osg::CameraNode::COLOR_BUFFER7) : return "COLOR_BUFFER7";
case (osg::Camera::DEPTH_BUFFER) : return "DEPTH_BUFFER";
case (osg::Camera::STENCIL_BUFFER) : return "STENCIL_BUFFER";
case (osg::Camera::COLOR_BUFFER) : return "COLOR_BUFFER";
case (osg::Camera::COLOR_BUFFER1) : return "COLOR_BUFFER1";
case (osg::Camera::COLOR_BUFFER2) : return "COLOR_BUFFER2";
case (osg::Camera::COLOR_BUFFER3) : return "COLOR_BUFFER3";
case (osg::Camera::COLOR_BUFFER4) : return "COLOR_BUFFER4";
case (osg::Camera::COLOR_BUFFER5) : return "COLOR_BUFFER5";
case (osg::Camera::COLOR_BUFFER6) : return "COLOR_BUFFER6";
case (osg::Camera::COLOR_BUFFER7) : return "COLOR_BUFFER7";
default : return "UnknownBufferComponent";
}
}
/*
bool CameraNode_matchBufferComponentStr(const char* str,CameraNode::BufferComponent buffer)
{
if (strcmp(str,"")==0) mode = osg::CameraNode::;
else if (strcmp(str,"")==0) mode = osg::CameraNode::;
else if (strcmp(str,"")==0) mode = osg::CameraNode::;
else if (strcmp(str,"")==0) mode = osg::CameraNode::;
else if (strcmp(str,"")==0) mode = osg::CameraNode::;
else if (strcmp(str,"")==0) mode = osg::CameraNode::;
else if (strcmp(str,"")==0) mode = osg::CameraNode::;
else if (strcmp(str,"")==0) mode = osg::CameraNode::;
else if (strcmp(str,"")==0) mode = osg::CameraNode::;
else if (strcmp(str,"")==0) mode = osg::CameraNode::;
else if (strcmp(str,"")==0) mode = osg::CameraNode::;
else return false;
return true;
}
const char* CameraNode_getBufferComponentStr(CameraNode::BufferComponent buffer)
{
switch(mode)
{
case (osg::CameraNode::) : return "";
case (osg::CameraNode::) : return "";
case (osg::CameraNode::) : return "";
case (osg::CameraNode::) : return "";
case (osg::CameraNode::) : return "";
case (osg::CameraNode::) : return "";
case (osg::CameraNode::) : return "";
case (osg::CameraNode::) : return "";
case (osg::CameraNode::) : return "";
case (osg::CameraNode::) : return "";
case (osg::CameraNode::) : return "";
default : return "UnknownBufferComponent";
}
}
*/

View File

@@ -7,7 +7,7 @@ CXXFILES =\
AutoTransform.cpp\
Billboard.cpp\
BlendFunc.cpp\
CameraNode.cpp\
Camera.cpp\
CameraView.cpp\
ClearNode.cpp\
ClipNode.cpp\

View File

@@ -29,7 +29,6 @@
#define WGL_SAMPLES_ARB 0x2042
#endif
using namespace Producer;
using namespace osgProducer;
static osg::ApplicationUsageProxy OsgCameraGroup_e0(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE, "OSG_PROCESSOR_AFFINITY <mode>", "ON | OFF - Where supported, switch on or off the processor affinity." );
@@ -554,8 +553,8 @@ bool OsgCameraGroup::realize()
sv->setDefaults(_realizeSceneViewOptions);
// note, should really compute the projection and view offsets...
// but not critical as Producer controls the CameraNode matrices via SceneView.
_view->addCamera(sv->getCamera());
// but not critical as Producer controls the osg::Camera matrices via SceneView.
_view->addSlave(sv->getCamera());
sv->setView(_view.get());
if (_renderSurfaceStateMap.count(rs)==0)
@@ -693,7 +692,7 @@ bool OsgCameraGroup::realize()
// disable multi-threading of cameras.
if (_threadModel == Producer::CameraGroup::ThreadPerCamera)
{
std::set<RenderSurface*> renderSurfaceSet;
std::set<Producer::RenderSurface*> renderSurfaceSet;
for( unsigned int i = 0; i < _cfg->getNumberOfCameras(); i++ )
{
Producer::Camera *cam = _cfg->getCamera(i);
@@ -707,7 +706,7 @@ bool OsgCameraGroup::realize()
osg::notify(osg::INFO)<<" threading problems when camera's share a RenderSurface."<<std::endl;
_threadModel = Producer::CameraGroup::SingleThreaded;
}
else if (renderSurfaceSet.size()>1 && RenderSurface::allGLContextsAreShared())
else if (renderSurfaceSet.size()>1 && Producer::RenderSurface::allGLContextsAreShared())
{
// we have multiple RenderSurface, but with share contexts, which is dangerous for multi-threaded usage,
// so need to disable multi-threading to prevent problems.
@@ -811,16 +810,21 @@ void OsgCameraGroup::frame()
double left, right, bottom, top, nearClip, farClip;
getLensParams(left, right, bottom, top, nearClip, farClip);
if (getLensProjectionType()==Camera::Lens::Perspective)
if (!_view->getCamera())
{
_view->setProjectionMatrixAsFrustum(left, right, bottom, top, nearClip, farClip);
_view->setCamera(new osg::Camera);
}
if (getLensProjectionType()==Producer::Camera::Lens::Perspective)
{
_view->getCamera()->setProjectionMatrixAsFrustum(left, right, bottom, top, nearClip, farClip);
}
else
{
_view->setProjectionMatrixAsOrtho(left, right, bottom, top, nearClip, farClip);
_view->getCamera()->setProjectionMatrixAsOrtho(left, right, bottom, top, nearClip, farClip);
}
_view->setViewMatrix(getViewMatrix());
_view->getCamera()->setViewMatrix(getViewMatrix());
}
// the settings in sync.

View File

@@ -21,10 +21,7 @@
#include <stdio.h>
using namespace Producer;
using namespace osgProducer;
using namespace osg;
#ifdef __APPLE__
#define SINGLE_THREAD_KEYBOARDMOUSE
@@ -60,7 +57,7 @@ public:
traverse(node);
}
NodePath _pathToCoordinateSystemNode;
osg::NodePath _pathToCoordinateSystemNode;
};

View File

@@ -387,11 +387,11 @@ ImpostorSprite* Impostor::createImpostorSprite(osgUtil::CullVisitor* cv)
Vec3 center_world = bs.center()*matrix;
osg::CameraNode* camera = impostorSprite->getCameraNode();
osg::Camera* camera = impostorSprite->getCamera();
if (!camera)
{
camera = new osg::CameraNode;
impostorSprite->setCameraNode(camera);
camera = new osg::Camera;
impostorSprite->setCamera(camera);
}
camera->setCullCallback(new ImpostorTraverseNodeCallback(this));
@@ -456,13 +456,13 @@ ImpostorSprite* Impostor::createImpostorSprite(osgUtil::CullVisitor* cv)
camera->setViewport(0,0,new_s,new_t);
// tell the camera to use OpenGL frame buffer object where supported.
camera->setRenderTargetImplementation(osg::CameraNode::FRAME_BUFFER_OBJECT, osg::CameraNode::FRAME_BUFFER);
camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT, osg::Camera::FRAME_BUFFER);
// set the camera to render before the main camera.
camera->setRenderOrder(osg::CameraNode::PRE_RENDER);
camera->setRenderOrder(osg::Camera::PRE_RENDER);
// attach the texture and use it as the color buffer.
camera->attach(osg::CameraNode::COLOR_BUFFER, texture);
camera->attach(osg::Camera::COLOR_BUFFER, texture);
// do the cull traversal on the subgraph
camera->accept(*cv);

View File

@@ -68,7 +68,7 @@ void OverlayNode::init()
if (!_camera)
{
// create the camera
_camera = new osg::CameraNode;
_camera = new osg::Camera;
_camera->setClearColor(osg::Vec4(0.0f,0.0f,0.0f,0.0f));
@@ -76,13 +76,13 @@ void OverlayNode::init()
_camera->setViewport(0,0,tex_width,tex_height);
// set the camera to render before the main camera.
_camera->setRenderOrder(osg::CameraNode::PRE_RENDER);
_camera->setRenderOrder(osg::Camera::PRE_RENDER);
// tell the camera to use OpenGL frame buffer object where supported.
_camera->setRenderTargetImplementation(osg::CameraNode::FRAME_BUFFER_OBJECT);
_camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
// attach the texture and use it as the color buffer.
_camera->attach(osg::CameraNode::COLOR_BUFFER, _texture.get());
_camera->attach(osg::Camera::COLOR_BUFFER, _texture.get());
}
if (!_texgenNode) _texgenNode = new osg::TexGenNode;
@@ -122,7 +122,7 @@ void OverlayNode::traverse(osg::NodeVisitor& nv)
csn = dynamic_cast<osg::CoordinateSystemNode*>(*itr);
}
_camera->setReferenceFrame(osg::CameraNode::ABSOLUTE_RF);
_camera->setReferenceFrame(osg::Camera::ABSOLUTE_RF);
if (csn)
{

View File

@@ -401,11 +401,11 @@ void FadeText::drawImplementation(osg::RenderInfo& renderInfo) const
osg::Matrix lmv = atc._matrix;
lmv.postMult(state.getModelViewMatrix());
if (renderInfo.getView())
if (renderInfo.getView() && renderInfo.getView()->getCamera())
{
// move from camera into the view space.
lmv.postMult(state.getInitialInverseViewMatrix());
lmv.postMult(renderInfo.getView()->getViewMatrix());
lmv.postMult(renderInfo.getView()->getCamera()->getViewMatrix());
}
FadeTextData ftd(const_cast<osgText::FadeText*>(this));

View File

@@ -1065,7 +1065,7 @@ void CullVisitor::apply(osg::ClearNode& node)
}
void CullVisitor::apply(osg::CameraNode& camera)
void CullVisitor::apply(osg::Camera& camera)
{
// push the node's state.
StateSet* node_state = camera.getStateSet();
@@ -1074,7 +1074,7 @@ void CullVisitor::apply(osg::CameraNode& camera)
// Save current cull settings
CullSettings saved_cull_settings(*this);
// activate all active cull settings from this CameraNode
// activate all active cull settings from this Camera
inheritCullSettings(camera);
RefMatrix& originalModelView = getModelViewMatrix();
@@ -1084,7 +1084,7 @@ void CullVisitor::apply(osg::CameraNode& camera)
pushProjectionMatrix(createOrReuseMatrix(camera.getProjectionMatrix()));
pushModelViewMatrix(createOrReuseMatrix(camera.getViewMatrix()));
}
else if (camera.getTransformOrder()==osg::CameraNode::POST_MULTIPLY)
else if (camera.getTransformOrder()==osg::Camera::POST_MULTIPLY)
{
pushProjectionMatrix(createOrReuseMatrix(getProjectionMatrix()*camera.getProjectionMatrix()));
pushModelViewMatrix(createOrReuseMatrix(getModelViewMatrix()*camera.getViewMatrix()));
@@ -1096,7 +1096,7 @@ void CullVisitor::apply(osg::CameraNode& camera)
}
if (camera.getRenderOrder()==osg::CameraNode::NESTED_RENDER)
if (camera.getRenderOrder()==osg::Camera::NESTED_RENDER)
{
handle_cull_callbacks_and_traverse(camera);
}
@@ -1117,7 +1117,7 @@ void CullVisitor::apply(osg::CameraNode& camera)
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(*(camera.getDataChangeMutex()));
rtts = new osgUtil::RenderStage;
rtts->setCameraNode(&camera);
rtts->setCamera(&camera);
if (camera.getDrawBuffer() != GL_NONE)
{
@@ -1203,7 +1203,7 @@ void CullVisitor::apply(osg::CameraNode& camera)
// dependancy list.
switch(camera.getRenderOrder())
{
case osg::CameraNode::PRE_RENDER:
case osg::Camera::PRE_RENDER:
getCurrentRenderBin()->getStage()->addPreRenderStage(rtts.get(),camera.getRenderOrderNum());
break;
default:

View File

@@ -19,7 +19,7 @@
#include <osg/TriangleFunctor>
#include <osg/Geometry>
#include <osg/Projection>
#include <osg/CameraNode>
#include <osg/Camera>
#include <osg/io_utils>
#include <float.h>
@@ -800,11 +800,11 @@ void PickVisitor::apply(osg::Projection& projection)
_mx, _my );
}
void PickVisitor::apply(osg::CameraNode& camera)
void PickVisitor::apply(osg::Camera& camera)
{
if (!camera.isRenderToTextureCamera())
{
if (camera.getReferenceFrame()==osg::CameraNode::ABSOLUTE_RF)
if (camera.getReferenceFrame()==osg::Camera::ABSOLUTE_RF)
{
runNestedPickVisitor( camera,
camera.getViewport() ? camera.getViewport() : _lastViewport.get(),
@@ -812,7 +812,7 @@ void PickVisitor::apply(osg::CameraNode& camera)
camera.getViewMatrix(),
_mx, _my );
}
else if (camera.getTransformOrder()==osg::CameraNode::POST_MULTIPLY)
else if (camera.getTransformOrder()==osg::Camera::POST_MULTIPLY)
{
runNestedPickVisitor( camera,
camera.getViewport() ? camera.getViewport() : _lastViewport.get(),

View File

@@ -17,7 +17,7 @@
#include <osg/PagedLOD>
#include <osg/Transform>
#include <osg/Projection>
#include <osg/CameraNode>
#include <osg/Camera>
#include <osg/Geode>
#include <osg/Billboard>
#include <osg/Geometry>
@@ -915,14 +915,14 @@ void IntersectionVisitor::apply(osg::Projection& projection)
}
void IntersectionVisitor::apply(osg::CameraNode& camera)
void IntersectionVisitor::apply(osg::Camera& camera)
{
// osg::notify(osg::NOTICE)<<"apply(CameraNode&)"<<std::endl;
// osg::notify(osg::NOTICE)<<"apply(Camera&)"<<std::endl;
// note, commenting out right now because default CameraNode setup is with the culling active. Should this be changed?
// note, commenting out right now because default Camera setup is with the culling active. Should this be changed?
// if (!enter(camera)) return;
// osg::notify(osg::NOTICE)<<"inside apply(CameraNode&)"<<std::endl;
// osg::notify(osg::NOTICE)<<"inside apply(Camera&)"<<std::endl;
if (camera.getViewport()) pushWindowMatrix( camera.getViewport() );
pushProjectionMatrix( new osg::RefMatrix(camera.getProjectionMatrix()) );

View File

@@ -218,16 +218,16 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
osg::State& state = *renderInfo.getState();
osg::CameraNode::RenderTargetImplementation renderTargetImplemntation = _camera->getRenderTargetImplementation();
osg::CameraNode::RenderTargetImplementation renderTargetFallback = _camera->getRenderTargetFallback();
osg::Camera::RenderTargetImplementation renderTargetImplemntation = _camera->getRenderTargetImplementation();
osg::Camera::RenderTargetImplementation renderTargetFallback = _camera->getRenderTargetFallback();
osg::CameraNode::BufferAttachmentMap& bufferAttachements = _camera->getBufferAttachmentMap();
osg::Camera::BufferAttachmentMap& bufferAttachements = _camera->getBufferAttachmentMap();
// compute the required dimensions
int width = _viewport->x() + _viewport->width();
int height = _viewport->y() + _viewport->height();
int depth = 1;
osg::CameraNode::BufferAttachmentMap::iterator itr;
osg::Camera::BufferAttachmentMap::iterator itr;
for(itr = bufferAttachements.begin();
itr != bufferAttachements.end();
++itr)
@@ -315,14 +315,14 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
}
}
if (renderTargetImplemntation==osg::CameraNode::FRAME_BUFFER_OBJECT)
if (renderTargetImplemntation==osg::Camera::FRAME_BUFFER_OBJECT)
{
osg::FBOExtensions* fbo_ext = osg::FBOExtensions::instance(state.getContextID(),true);
bool fbo_supported = fbo_ext && fbo_ext->isSupported();
if (fbo_supported && !_fbo)
{
osg::notify(osg::INFO)<<"Setting up osg::CameraNode::FRAME_BUFFER_OBJECT"<<std::endl;
osg::notify(osg::INFO)<<"Setting up osg::Camera::FRAME_BUFFER_OBJECT"<<std::endl;
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(*(_camera->getDataChangeMutex()));
@@ -331,23 +331,23 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
bool colorAttached = false;
bool depthAttached = false;
bool stencilAttached = false;
for(osg::CameraNode::BufferAttachmentMap::iterator itr = bufferAttachements.begin();
for(osg::Camera::BufferAttachmentMap::iterator itr = bufferAttachements.begin();
itr != bufferAttachements.end();
++itr)
{
osg::CameraNode::BufferComponent buffer = itr->first;
osg::CameraNode::Attachment& attachment = itr->second;
osg::Camera::BufferComponent buffer = itr->first;
osg::Camera::Attachment& attachment = itr->second;
switch(buffer)
{
case(osg::CameraNode::DEPTH_BUFFER):
case(osg::Camera::DEPTH_BUFFER):
{
fbo->setAttachment(GL_DEPTH_ATTACHMENT_EXT, osg::FrameBufferAttachment(attachment));
depthAttached = true;
break;
}
case(osg::CameraNode::STENCIL_BUFFER):
case(osg::Camera::STENCIL_BUFFER):
{
fbo->setAttachment(GL_STENCIL_ATTACHMENT_EXT, osg::FrameBufferAttachment(attachment));
stencilAttached = true;
@@ -355,7 +355,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
}
default:
{
fbo->setAttachment(GL_COLOR_ATTACHMENT0_EXT+(buffer-osg::CameraNode::COLOR_BUFFER0), osg::FrameBufferAttachment(attachment));
fbo->setAttachment(GL_COLOR_ATTACHMENT0_EXT+(buffer-osg::Camera::COLOR_BUFFER0), osg::FrameBufferAttachment(attachment));
colorAttached = true;
break;
}
@@ -409,26 +409,26 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
if (renderTargetImplemntation<renderTargetFallback)
renderTargetImplemntation = renderTargetFallback;
else
renderTargetImplemntation = osg::CameraNode::PIXEL_BUFFER_RTT;
renderTargetImplemntation = osg::Camera::PIXEL_BUFFER_RTT;
}
}
// check whether PBuffer-RTT is supported or not
if (renderTargetImplemntation==osg::CameraNode::PIXEL_BUFFER_RTT &&
if (renderTargetImplemntation==osg::Camera::PIXEL_BUFFER_RTT &&
!osg::isGLExtensionSupported(state.getContextID(), "WGL_ARB_render_texture"))
{
if (renderTargetImplemntation<renderTargetFallback)
renderTargetImplemntation = renderTargetFallback;
else
renderTargetImplemntation = osg::CameraNode::PIXEL_BUFFER;
renderTargetImplemntation = osg::Camera::PIXEL_BUFFER;
}
// if any of the renderTargetImplementations require a seperate graphics context such as with pbuffer try in turn to
// set up, but if each level fails then resort to the next level down.
while (!getGraphicsContext() &&
(renderTargetImplemntation==osg::CameraNode::PIXEL_BUFFER_RTT ||
renderTargetImplemntation==osg::CameraNode::PIXEL_BUFFER ||
renderTargetImplemntation==osg::CameraNode::SEPERATE_WINDOW) )
(renderTargetImplemntation==osg::Camera::PIXEL_BUFFER_RTT ||
renderTargetImplemntation==osg::Camera::PIXEL_BUFFER ||
renderTargetImplemntation==osg::Camera::SEPERATE_WINDOW) )
{
osg::ref_ptr<osg::GraphicsContext> context = getGraphicsContext();
if (!context)
@@ -442,9 +442,9 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
// osg::notify(osg::NOTICE)<<"traits = "<<traits->_width<<" "<<traits->_height<<std::endl;
traits->_pbuffer = (renderTargetImplemntation==osg::CameraNode::PIXEL_BUFFER || renderTargetImplemntation==osg::CameraNode::PIXEL_BUFFER_RTT);
traits->_windowDecoration = (renderTargetImplemntation==osg::CameraNode::SEPERATE_WINDOW);
traits->_doubleBuffer = (renderTargetImplemntation==osg::CameraNode::SEPERATE_WINDOW);
traits->_pbuffer = (renderTargetImplemntation==osg::Camera::PIXEL_BUFFER || renderTargetImplemntation==osg::Camera::PIXEL_BUFFER_RTT);
traits->_windowDecoration = (renderTargetImplemntation==osg::Camera::SEPERATE_WINDOW);
traits->_doubleBuffer = (renderTargetImplemntation==osg::Camera::SEPERATE_WINDOW);
osg::Texture* pBufferTexture = 0;
GLenum bufferFormat = GL_NONE;
@@ -454,28 +454,28 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
bool colorAttached = false;
bool depthAttached = false;
bool stencilAttached = false;
for(osg::CameraNode::BufferAttachmentMap::iterator itr = bufferAttachements.begin();
for(osg::Camera::BufferAttachmentMap::iterator itr = bufferAttachements.begin();
itr != bufferAttachements.end();
++itr)
{
osg::CameraNode::BufferComponent buffer = itr->first;
osg::CameraNode::Attachment& attachment = itr->second;
osg::Camera::BufferComponent buffer = itr->first;
osg::Camera::Attachment& attachment = itr->second;
switch(buffer)
{
case(osg::CameraNode::DEPTH_BUFFER):
case(osg::Camera::DEPTH_BUFFER):
{
traits->_depth = 24;
depthAttached = true;
break;
}
case(osg::CameraNode::STENCIL_BUFFER):
case(osg::Camera::STENCIL_BUFFER):
{
traits->_stencil = 8;
stencilAttached = true;
break;
}
case(osg::CameraNode::COLOR_BUFFER):
case(osg::Camera::COLOR_BUFFER):
{
if (attachment._internalFormat!=GL_NONE)
{
@@ -501,7 +501,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
level = attachment._level;
face = attachment._face;
if (renderTargetImplemntation==osg::CameraNode::PIXEL_BUFFER_RTT)
if (renderTargetImplemntation==osg::Camera::PIXEL_BUFFER_RTT)
{
traits->_target = bufferFormat;
traits->_level = level;
@@ -512,7 +512,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
}
default:
{
if (renderTargetImplemntation==osg::CameraNode::SEPERATE_WINDOW)
if (renderTargetImplemntation==osg::Camera::SEPERATE_WINDOW)
osg::notify(osg::NOTICE)<<"Warning: RenderStage::runCameraSetUp(State&) Window ";
else
osg::notify(osg::NOTICE)<<"Warning: RenderStage::runCameraSetUp(State&) Pbuffer ";
@@ -570,7 +570,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
setDrawBuffer(GL_FRONT);
setReadBuffer(GL_FRONT);
if (pBufferTexture && renderTargetImplemntation==osg::CameraNode::PIXEL_BUFFER_RTT)
if (pBufferTexture && renderTargetImplemntation==osg::Camera::PIXEL_BUFFER_RTT)
{
osg::notify(osg::INFO)<<"RenderStage::runCameraSetUp(State&) Assign graphis context to Texture"<<std::endl;
pBufferTexture->setReadPBuffer(context.get());
@@ -585,17 +585,17 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
{
osg::notify(osg::INFO)<<"Failed to aquire Graphics Context"<<std::endl;
if (renderTargetImplemntation==osg::CameraNode::PIXEL_BUFFER_RTT)
if (renderTargetImplemntation==osg::Camera::PIXEL_BUFFER_RTT)
{
// fallback to using standard PBuffer, this will allow this while loop to continue
if (renderTargetImplemntation<renderTargetFallback)
renderTargetImplemntation = renderTargetFallback;
else
renderTargetImplemntation = osg::CameraNode::PIXEL_BUFFER;
renderTargetImplemntation = osg::Camera::PIXEL_BUFFER;
}
else
{
renderTargetImplemntation = osg::CameraNode::FRAME_BUFFER;
renderTargetImplemntation = osg::Camera::FRAME_BUFFER;
}
}
@@ -603,11 +603,11 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
}
// finally if all else has failed, then the frame buffer fallback will come in to play.
if (renderTargetImplemntation==osg::CameraNode::FRAME_BUFFER)
if (renderTargetImplemntation==osg::Camera::FRAME_BUFFER)
{
osg::notify(osg::INFO)<<"Setting up osg::CameraNode::FRAME_BUFFER"<<std::endl;
osg::notify(osg::INFO)<<"Setting up osg::Camera::FRAME_BUFFER"<<std::endl;
for(osg::CameraNode::BufferAttachmentMap::iterator itr = bufferAttachements.begin();
for(osg::Camera::BufferAttachmentMap::iterator itr = bufferAttachements.begin();
itr != bufferAttachements.end();
++itr)
{
@@ -734,7 +734,7 @@ void RenderStage::drawInner(osg::RenderInfo& renderInfo,RenderLeaf*& previous, b
{
copyTexture(renderInfo);
}
std::map< osg::CameraNode::BufferComponent, Attachment>::const_iterator itr;
std::map< osg::Camera::BufferComponent, Attachment>::const_iterator itr;
for(itr = _bufferAttachmentMap.begin(); itr != _bufferAttachmentMap.end(); ++itr){
if (itr->second._image.valid())
{
@@ -771,8 +771,8 @@ void RenderStage::drawInner(osg::RenderInfo& renderInfo,RenderLeaf*& previous, b
if (fbo_supported && _camera)
{
// now generate mipmaps if they are required.
const osg::CameraNode::BufferAttachmentMap& bufferAttachements = _camera->getBufferAttachmentMap();
for(osg::CameraNode::BufferAttachmentMap::const_iterator itr = bufferAttachements.begin();
const osg::Camera::BufferAttachmentMap& bufferAttachements = _camera->getBufferAttachmentMap();
for(osg::Camera::BufferAttachmentMap::const_iterator itr = bufferAttachements.begin();
itr != bufferAttachements.end();
++itr)
{
@@ -1014,7 +1014,7 @@ bool RenderStage::getStats(Statistics& stats) const
return statsCollected;
}
void RenderStage::attach(osg::CameraNode::BufferComponent buffer, osg::Image* image)
void RenderStage::attach(osg::Camera::BufferComponent buffer, osg::Image* image)
{
_bufferAttachmentMap[buffer]._image = image;
}

View File

@@ -99,7 +99,7 @@ SceneView::SceneView(DisplaySettings* ds)
_prioritizeTextures = false;
_camera = new CameraNode;
_camera = new Camera;
_camera->setViewport(new Viewport);
_camera->setClearColor(osg::Vec4(0.2f, 0.2f, 0.4f, 1.0f));
@@ -210,7 +210,7 @@ void SceneView::setDefaults(unsigned int options)
_camera->setClearColor(osg::Vec4(0.2f, 0.2f, 0.4f, 1.0f));
}
void SceneView::setCamera(osg::CameraNode* camera)
void SceneView::setCamera(osg::Camera* camera)
{
if (camera)
{

View File

@@ -0,0 +1,24 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#include <osgViewer/CompositeViewer>
using namespace osgViewer;
CompositeViewer::CompositeViewer():
{
}
CompositeViewer::~CompositeViewer()
{
}

View File

@@ -4,6 +4,8 @@ include $(TOPDIR)/Make/makedefs
CXXFILES = \
SimpleViewer.cpp\
Scene.cpp\
View.cpp\
Version.cpp\
DEF += -DOSGVIEWER_LIBRARY

122
src/osgViewer/Scene.cpp Normal file
View File

@@ -0,0 +1,122 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#include <osgViewer/Scene>
using namespace osgViewer;
Scene::Scene():
_firstFrame(true)
{
_startTick = osg::Timer::instance()->tick();
_frameStamp = new osg::FrameStamp;
_frameStamp->setFrameNumber(0);
_frameStamp->setReferenceTime(0);
_updateVisitor = new osgUtil::UpdateVisitor;
_eventQueue->setStartTick(_startTick);
_eventVisitor = new osgGA::EventVisitor;
setDatabasePager(new osgDB::DatabasePager);
}
Scene::~Scene()
{
}
void Scene::setSceneData(osg::Node* node)
{
_sceneData = node;
if (_databasePager.valid())
{
// register any PagedLOD that need to be tracked in the scene graph
_databasePager->registerPagedLODs(node);
}
}
osg::Node* Scene::getSceneData()
{
return _sceneData.get();
}
const osg::Node* Scene::getSceneData() const
{
return _sceneData.get();
}
void Scene::setDatabasePager(osgDB::DatabasePager* dp)
{
_databasePager = dp;
}
void Scene::frameAdvance()
{
osg::Timer_t currentTick = osg::Timer::instance()->tick();
_frameStamp->setReferenceTime(osg::Timer::instance()->delta_s(_startTick,currentTick));
_frameStamp->setFrameNumber(_frameStamp->getFrameNumber()+1);
}
void Scene::frameEventTraversal()
{
_eventQueue->frame( _frameStamp->getReferenceTime() );
osgGA::EventQueue::Events events;
_eventQueue->takeEvents(events);
if (_eventVisitor.valid())
{
_eventVisitor->setTraversalNumber(_frameStamp->getFrameNumber());
}
for(osgGA::EventQueue::Events::iterator itr = events.begin();
itr != events.end();
++itr)
{
osgGA::GUIEventAdapter* event = itr->get();
bool handled = false;
if (_eventVisitor.valid() && getSceneData())
{
_eventVisitor->reset();
_eventVisitor->addEvent( event );
getSceneData()->accept(*_eventVisitor);
if (_eventVisitor->getEventHandled()) handled = true;
}
for(EventHandlers::iterator hitr = _eventHandlers.begin();
hitr != _eventHandlers.end() && !handled;
++hitr)
{
// handled = (*hitr)->handle( *event, *this, 0, 0);
}
}
}
void Scene::frameUpdateTraversal()
{
if (_databasePager.valid())
{
// tell the DatabasePager the frame number of that the scene graph is being actively used to render a frame
_databasePager->signalBeginFrame(_frameStamp.get());
// syncronize changes required by the DatabasePager thread to the scene graph
_databasePager->updateSceneGraph(_frameStamp->getReferenceTime());
}
}

View File

@@ -69,12 +69,12 @@ const osg::Node* SimpleViewer::getSceneData() const
return _sceneView->getSceneData();
}
osg::CameraNode* SimpleViewer::getCamera()
osg::Camera* SimpleViewer::getCamera()
{
return _sceneView->getCamera();
}
const osg::CameraNode* SimpleViewer::getCamera() const
const osg::Camera* SimpleViewer::getCamera() const
{
return _sceneView->getCamera();
}

24
src/osgViewer/View.cpp Normal file
View File

@@ -0,0 +1,24 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#include <osgViewer/View>
using namespace osgViewer;
View::View()
{
}
View::~View()
{
}

24
src/osgViewer/Viewer.cpp Normal file
View File

@@ -0,0 +1,24 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#include <osgViewer/Viewer>
using namespace osgViewer;
Viewer::Viewer():
{
}
Viewer::~Viewer()
{
}

View File

@@ -10,7 +10,7 @@
#include <osgIntrospection/StaticMethodInfo>
#include <osgIntrospection/Attributes>
#include <osg/CameraNode>
#include <osg/Camera>
#include <osg/ColorMask>
#include <osg/CopyOp>
#include <osg/GraphicsContext>
@@ -35,49 +35,49 @@
#undef OUT
#endif
TYPE_NAME_ALIAS(std::map< osg::CameraNode::BufferComponent COMMA osg::CameraNode::Attachment >, osg::CameraNode::BufferAttachmentMap);
TYPE_NAME_ALIAS(std::map< osg::Camera::BufferComponent COMMA osg::Camera::Attachment >, osg::Camera::BufferAttachmentMap);
BEGIN_ENUM_REFLECTOR(osg::CameraNode::TransformOrder)
I_EnumLabel(osg::CameraNode::PRE_MULTIPLY);
I_EnumLabel(osg::CameraNode::POST_MULTIPLY);
BEGIN_ENUM_REFLECTOR(osg::Camera::TransformOrder)
I_EnumLabel(osg::Camera::PRE_MULTIPLY);
I_EnumLabel(osg::Camera::POST_MULTIPLY);
END_REFLECTOR
BEGIN_ENUM_REFLECTOR(osg::CameraNode::RenderOrder)
I_EnumLabel(osg::CameraNode::PRE_RENDER);
I_EnumLabel(osg::CameraNode::NESTED_RENDER);
I_EnumLabel(osg::CameraNode::POST_RENDER);
BEGIN_ENUM_REFLECTOR(osg::Camera::RenderOrder)
I_EnumLabel(osg::Camera::PRE_RENDER);
I_EnumLabel(osg::Camera::NESTED_RENDER);
I_EnumLabel(osg::Camera::POST_RENDER);
END_REFLECTOR
BEGIN_ENUM_REFLECTOR(osg::CameraNode::RenderTargetImplementation)
I_EnumLabel(osg::CameraNode::FRAME_BUFFER_OBJECT);
I_EnumLabel(osg::CameraNode::PIXEL_BUFFER_RTT);
I_EnumLabel(osg::CameraNode::PIXEL_BUFFER);
I_EnumLabel(osg::CameraNode::FRAME_BUFFER);
I_EnumLabel(osg::CameraNode::SEPERATE_WINDOW);
BEGIN_ENUM_REFLECTOR(osg::Camera::RenderTargetImplementation)
I_EnumLabel(osg::Camera::FRAME_BUFFER_OBJECT);
I_EnumLabel(osg::Camera::PIXEL_BUFFER_RTT);
I_EnumLabel(osg::Camera::PIXEL_BUFFER);
I_EnumLabel(osg::Camera::FRAME_BUFFER);
I_EnumLabel(osg::Camera::SEPERATE_WINDOW);
END_REFLECTOR
BEGIN_ENUM_REFLECTOR(osg::CameraNode::BufferComponent)
I_EnumLabel(osg::CameraNode::DEPTH_BUFFER);
I_EnumLabel(osg::CameraNode::STENCIL_BUFFER);
I_EnumLabel(osg::CameraNode::COLOR_BUFFER);
I_EnumLabel(osg::CameraNode::COLOR_BUFFER0);
I_EnumLabel(osg::CameraNode::COLOR_BUFFER1);
I_EnumLabel(osg::CameraNode::COLOR_BUFFER2);
I_EnumLabel(osg::CameraNode::COLOR_BUFFER3);
I_EnumLabel(osg::CameraNode::COLOR_BUFFER4);
I_EnumLabel(osg::CameraNode::COLOR_BUFFER5);
I_EnumLabel(osg::CameraNode::COLOR_BUFFER6);
I_EnumLabel(osg::CameraNode::COLOR_BUFFER7);
BEGIN_ENUM_REFLECTOR(osg::Camera::BufferComponent)
I_EnumLabel(osg::Camera::DEPTH_BUFFER);
I_EnumLabel(osg::Camera::STENCIL_BUFFER);
I_EnumLabel(osg::Camera::COLOR_BUFFER);
I_EnumLabel(osg::Camera::COLOR_BUFFER0);
I_EnumLabel(osg::Camera::COLOR_BUFFER1);
I_EnumLabel(osg::Camera::COLOR_BUFFER2);
I_EnumLabel(osg::Camera::COLOR_BUFFER3);
I_EnumLabel(osg::Camera::COLOR_BUFFER4);
I_EnumLabel(osg::Camera::COLOR_BUFFER5);
I_EnumLabel(osg::Camera::COLOR_BUFFER6);
I_EnumLabel(osg::Camera::COLOR_BUFFER7);
END_REFLECTOR
BEGIN_OBJECT_REFLECTOR(osg::CameraNode)
BEGIN_OBJECT_REFLECTOR(osg::Camera)
I_BaseType(osg::Transform);
I_BaseType(osg::CullSettings);
I_Constructor0(____CameraNode,
I_Constructor0(____Camera,
"",
"");
I_ConstructorWithDefaults2(IN, const osg::CameraNode &, x, , IN, const osg::CopyOp &, copyop, osg::CopyOp::SHALLOW_COPY,
____CameraNode__C5_CameraNode_R1__C5_CopyOp_R1,
I_ConstructorWithDefaults2(IN, const osg::Camera &, x, , IN, const osg::CopyOp &, copyop, osg::CopyOp::SHALLOW_COPY,
____Camera__C5_Camera_R1__C5_CopyOp_R1,
"Copy constructor using CopyOp to manage deep vs shallow copy. ",
"");
I_Method0(osg::Object *, cloneType,
@@ -164,11 +164,11 @@ BEGIN_OBJECT_REFLECTOR(osg::CameraNode)
__Viewport_P1__getViewport,
"Get the viewport. ",
"");
I_Method1(void, setTransformOrder, IN, osg::CameraNode::TransformOrder, order,
I_Method1(void, setTransformOrder, IN, osg::Camera::TransformOrder, order,
__void__setTransformOrder__TransformOrder,
"Set the transformation order for world-to-local and local-to-world transformation. ",
"");
I_Method0(osg::CameraNode::TransformOrder, getTransformOrder,
I_Method0(osg::Camera::TransformOrder, getTransformOrder,
__TransformOrder__getTransformOrder,
"Get the transformation order. ",
"");
@@ -244,11 +244,11 @@ BEGIN_OBJECT_REFLECTOR(osg::CameraNode)
__Matrixd__getInverseViewMatrix,
"Get the inverse view matrix. ",
"");
I_MethodWithDefaults2(void, setRenderOrder, IN, osg::CameraNode::RenderOrder, order, , IN, int, orderNum, 0,
I_MethodWithDefaults2(void, setRenderOrder, IN, osg::Camera::RenderOrder, order, , IN, int, orderNum, 0,
__void__setRenderOrder__RenderOrder__int,
"Set the rendering order of this camera's subgraph relative to any camera that this subgraph is nested within. ",
"For rendering to a texture, one typically uses PRE_RENDER. For Head Up Displays, one would typically use POST_RENDER. ");
I_Method0(osg::CameraNode::RenderOrder, getRenderOrder,
I_Method0(osg::Camera::RenderOrder, getRenderOrder,
__RenderOrder__getRenderOrder,
"Get the rendering order of this camera's subgraph relative to any camera that this subgraph is nested within. ",
"");
@@ -260,19 +260,19 @@ BEGIN_OBJECT_REFLECTOR(osg::CameraNode)
__bool__isRenderToTextureCamera,
"Return true if this Camera is set up as a render to texture camera, i.e. ",
"it has textures assigned to it. ");
I_Method1(void, setRenderTargetImplementation, IN, osg::CameraNode::RenderTargetImplementation, impl,
I_Method1(void, setRenderTargetImplementation, IN, osg::Camera::RenderTargetImplementation, impl,
__void__setRenderTargetImplementation__RenderTargetImplementation,
"Set the render target. ",
"");
I_Method2(void, setRenderTargetImplementation, IN, osg::CameraNode::RenderTargetImplementation, impl, IN, osg::CameraNode::RenderTargetImplementation, fallback,
I_Method2(void, setRenderTargetImplementation, IN, osg::Camera::RenderTargetImplementation, impl, IN, osg::Camera::RenderTargetImplementation, fallback,
__void__setRenderTargetImplementation__RenderTargetImplementation__RenderTargetImplementation,
"Set the render target and fall-back that's used if the former isn't available. ",
"");
I_Method0(osg::CameraNode::RenderTargetImplementation, getRenderTargetImplementation,
I_Method0(osg::Camera::RenderTargetImplementation, getRenderTargetImplementation,
__RenderTargetImplementation__getRenderTargetImplementation,
"Get the render target. ",
"");
I_Method0(osg::CameraNode::RenderTargetImplementation, getRenderTargetFallback,
I_Method0(osg::Camera::RenderTargetImplementation, getRenderTargetFallback,
__RenderTargetImplementation__getRenderTargetFallback,
"Get the render target fallback. ",
"");
@@ -292,27 +292,27 @@ BEGIN_OBJECT_REFLECTOR(osg::CameraNode)
__GLenum__getReadBuffer,
"Get the read buffer for any required copy operations to use. ",
"");
I_Method2(void, attach, IN, osg::CameraNode::BufferComponent, buffer, IN, GLenum, internalFormat,
I_Method2(void, attach, IN, osg::Camera::BufferComponent, buffer, IN, GLenum, internalFormat,
__void__attach__BufferComponent__GLenum,
"",
"");
I_MethodWithDefaults5(void, attach, IN, osg::CameraNode::BufferComponent, buffer, , IN, osg::Texture *, texture, , IN, unsigned int, level, 0, IN, unsigned int, face, 0, IN, bool, mipMapGeneration, false,
I_MethodWithDefaults5(void, attach, IN, osg::Camera::BufferComponent, buffer, , IN, osg::Texture *, texture, , IN, unsigned int, level, 0, IN, unsigned int, face, 0, IN, bool, mipMapGeneration, false,
__void__attach__BufferComponent__osg_Texture_P1__unsigned_int__unsigned_int__bool,
"",
"");
I_Method2(void, attach, IN, osg::CameraNode::BufferComponent, buffer, IN, osg::Image *, image,
I_Method2(void, attach, IN, osg::Camera::BufferComponent, buffer, IN, osg::Image *, image,
__void__attach__BufferComponent__osg_Image_P1,
"",
"");
I_Method1(void, detach, IN, osg::CameraNode::BufferComponent, buffer,
I_Method1(void, detach, IN, osg::Camera::BufferComponent, buffer,
__void__detach__BufferComponent,
"",
"");
I_Method0(osg::CameraNode::BufferAttachmentMap &, getBufferAttachmentMap,
I_Method0(osg::Camera::BufferAttachmentMap &, getBufferAttachmentMap,
__BufferAttachmentMap_R1__getBufferAttachmentMap,
"Get the BufferAttachmentMap, used to configure frame buffer objects, pbuffers and texture reads. ",
"");
I_Method0(const osg::CameraNode::BufferAttachmentMap &, getBufferAttachmentMap,
I_Method0(const osg::Camera::BufferAttachmentMap &, getBufferAttachmentMap,
__C5_BufferAttachmentMap_R1__getBufferAttachmentMap,
"Get the const BufferAttachmentMap, used to configure frame buffer objects, pbuffers and texture reads. ",
"");
@@ -340,15 +340,15 @@ BEGIN_OBJECT_REFLECTOR(osg::CameraNode)
__C5_osg_Object_P1__getRenderingCache__unsigned_int,
"Get the const Rendering object that is used to implement rendering of the subgraph. ",
"");
I_Method1(void, setPostDrawCallback, IN, osg::CameraNode::DrawCallback *, cb,
I_Method1(void, setPostDrawCallback, IN, osg::Camera::DrawCallback *, cb,
__void__setPostDrawCallback__DrawCallback_P1,
"Set the post draw callback for custom operations to do done after the drawing of the camera's subgraph has been completed. ",
"");
I_Method0(osg::CameraNode::DrawCallback *, getPostDrawCallback,
I_Method0(osg::Camera::DrawCallback *, getPostDrawCallback,
__DrawCallback_P1__getPostDrawCallback,
"Get the post draw callback. ",
"");
I_Method0(const osg::CameraNode::DrawCallback *, getPostDrawCallback,
I_Method0(const osg::Camera::DrawCallback *, getPostDrawCallback,
__C5_DrawCallback_P1__getPostDrawCallback,
"Get the const post draw callback. ",
"");
@@ -368,7 +368,7 @@ BEGIN_OBJECT_REFLECTOR(osg::CameraNode)
__bool__computeWorldToLocalMatrix__Matrix_R1__NodeVisitor_P1,
"Transform method that must be defined to provide generic interface for scene graph traversals. ",
"");
I_SimpleProperty(osg::CameraNode::BufferAttachmentMap &, BufferAttachmentMap,
I_SimpleProperty(osg::Camera::BufferAttachmentMap &, BufferAttachmentMap,
__BufferAttachmentMap_R1__getBufferAttachmentMap,
0);
I_SimpleProperty(const osg::Vec4 &, ClearColor,
@@ -392,7 +392,7 @@ BEGIN_OBJECT_REFLECTOR(osg::CameraNode)
I_SimpleProperty(osg::Matrixd, InverseViewMatrix,
__Matrixd__getInverseViewMatrix,
0);
I_SimpleProperty(osg::CameraNode::DrawCallback *, PostDrawCallback,
I_SimpleProperty(osg::Camera::DrawCallback *, PostDrawCallback,
__DrawCallback_P1__getPostDrawCallback,
__void__setPostDrawCallback__DrawCallback_P1);
I_SimpleProperty(const osg::Matrixd &, ProjectionMatrix,
@@ -401,23 +401,23 @@ BEGIN_OBJECT_REFLECTOR(osg::CameraNode)
I_SimpleProperty(GLenum, ReadBuffer,
__GLenum__getReadBuffer,
__void__setReadBuffer__GLenum);
I_SimpleProperty(osg::CameraNode::RenderOrder, RenderOrder,
I_SimpleProperty(osg::Camera::RenderOrder, RenderOrder,
__RenderOrder__getRenderOrder,
0);
I_SimpleProperty(int, RenderOrderNum,
__int__getRenderOrderNum,
0);
I_SimpleProperty(osg::CameraNode::RenderTargetImplementation, RenderTargetFallback,
I_SimpleProperty(osg::Camera::RenderTargetImplementation, RenderTargetFallback,
__RenderTargetImplementation__getRenderTargetFallback,
0);
I_SimpleProperty(osg::CameraNode::RenderTargetImplementation, RenderTargetImplementation,
I_SimpleProperty(osg::Camera::RenderTargetImplementation, RenderTargetImplementation,
__RenderTargetImplementation__getRenderTargetImplementation,
__void__setRenderTargetImplementation__RenderTargetImplementation);
I_IndexedProperty(osg::Object *, RenderingCache,
__osg_Object_P1__getRenderingCache__unsigned_int,
__void__setRenderingCache__unsigned_int__osg_Object_P1,
0);
I_SimpleProperty(osg::CameraNode::TransformOrder, TransformOrder,
I_SimpleProperty(osg::Camera::TransformOrder, TransformOrder,
__TransformOrder__getTransformOrder,
__void__setTransformOrder__TransformOrder);
I_SimpleProperty(osg::View *, View,
@@ -431,7 +431,7 @@ BEGIN_OBJECT_REFLECTOR(osg::CameraNode)
__void__setViewport__osg_Viewport_P1);
END_REFLECTOR
BEGIN_VALUE_REFLECTOR(osg::CameraNode::Attachment)
BEGIN_VALUE_REFLECTOR(osg::Camera::Attachment)
I_Constructor0(____Attachment,
"",
"");
@@ -455,12 +455,12 @@ BEGIN_VALUE_REFLECTOR(osg::CameraNode::Attachment)
I_PublicMemberProperty(bool, _mipMapGeneration);
END_REFLECTOR
BEGIN_OBJECT_REFLECTOR(osg::CameraNode::DrawCallback)
BEGIN_OBJECT_REFLECTOR(osg::Camera::DrawCallback)
I_VirtualBaseType(osg::Object);
I_Constructor0(____DrawCallback,
"",
"");
I_Constructor2(IN, const osg::CameraNode::DrawCallback &, x, IN, const osg::CopyOp &, x,
I_Constructor2(IN, const osg::Camera::DrawCallback &, x, IN, const osg::CopyOp &, x,
____DrawCallback__C5_DrawCallback_R1__C5_CopyOp_R1,
"",
"");
@@ -486,5 +486,5 @@ BEGIN_OBJECT_REFLECTOR(osg::CameraNode::DrawCallback)
"Must be defined by derived classes. ");
END_REFLECTOR
STD_MAP_REFLECTOR(std::map< osg::CameraNode::BufferComponent COMMA osg::CameraNode::Attachment >);
STD_MAP_REFLECTOR(std::map< osg::Camera::BufferComponent COMMA osg::Camera::Attachment >);

View File

@@ -10,7 +10,7 @@
#include <osgIntrospection/StaticMethodInfo>
#include <osgIntrospection/Attributes>
#include <osg/CameraNode>
#include <osg/Camera>
#include <osg/CopyOp>
#include <osg/FrameBufferObject>
#include <osg/Object>
@@ -113,8 +113,8 @@ BEGIN_VALUE_REFLECTOR(osg::FrameBufferAttachment)
____FrameBufferAttachment__TextureRectangle_P1,
"",
"");
I_Constructor1(IN, osg::CameraNode::Attachment &, attachment,
____FrameBufferAttachment__CameraNode_Attachment_R1,
I_Constructor1(IN, osg::Camera::Attachment &, attachment,
____FrameBufferAttachment__Camera_Attachment_R1,
"",
"");
I_Method2(void, createRequiredTexturesAndApplyGenerateMipMap, IN, osg::State &, state, IN, const osg::FBOExtensions *, ext,

View File

@@ -15,7 +15,7 @@ CXXFILES =\
BoundingBox.cpp\
BoundingSphere.cpp\
BufferObject.cpp\
CameraNode.cpp\
Camera.cpp\
CameraView.cpp\
ClampColor.cpp\
ClearNode.cpp\

View File

@@ -102,6 +102,10 @@ BEGIN_VALUE_REFLECTOR(osg::Matrixd)
__void__makeIdentity,
"",
"");
I_Method0(bool, isIdentity,
__bool__isIdentity,
"",
"");
I_Method1(void, makeScale, IN, const osg::Vec3f &, x,
__void__makeScale__C5_Vec3f_R1,
"",
@@ -246,14 +250,6 @@ BEGIN_VALUE_REFLECTOR(osg::Matrixd)
__Vec4d__postMult__C5_Vec4d_R1,
"",
"");
I_Method1(void, set, IN, const osg::Quat &, q,
__void__set__C5_Quat_R1,
"",
"");
I_Method1(void, get, IN, osg::Quat &, q,
__void__get__Quat_R1,
"",
"");
I_Method1(void, setRotate, IN, const osg::Quat &, q,
__void__setRotate__C5_Quat_R1,
"",

View File

@@ -98,6 +98,10 @@ BEGIN_VALUE_REFLECTOR(osg::Matrixf)
__C5_value_type_P1__ptr,
"",
"");
I_Method0(bool, isIdentity,
__bool__isIdentity,
"",
"");
I_Method0(void, makeIdentity,
__void__makeIdentity,
"",
@@ -246,14 +250,6 @@ BEGIN_VALUE_REFLECTOR(osg::Matrixf)
__Vec4d__postMult__C5_Vec4d_R1,
"",
"");
I_Method1(void, set, IN, const osg::Quat &, q,
__void__set__C5_Quat_R1,
"",
"");
I_Method1(void, get, IN, osg::Quat &, q,
__void__get__Quat_R1,
"",
"");
I_Method1(void, setRotate, IN, const osg::Quat &, q,
__void__setRotate__C5_Quat_R1,
"",

View File

@@ -82,7 +82,7 @@ BEGIN_OBJECT_REFLECTOR(osg::observer_ptr< osg::Node >)
____observer_ptr__C5_observer_ptr_R1,
"",
"");
I_Method1(void, objectDeleted, IN, void *, ptr,
I_Method1(void, objectDeleted, IN, void *, x,
__void__objectDeleted__void_P1,
"",
"");

View File

@@ -11,7 +11,7 @@
#include <osgIntrospection/Attributes>
#include <osg/Billboard>
#include <osg/CameraNode>
#include <osg/Camera>
#include <osg/CameraView>
#include <osg/ClearNode>
#include <osg/ClipNode>
@@ -35,7 +35,6 @@
#include <osg/TexGenNode>
#include <osg/Transform>
#include <osg/Vec3>
#include <osg/View>
// Must undefine IN and OUT macros defined in Windows headers
#ifdef IN
@@ -221,12 +220,8 @@ BEGIN_OBJECT_REFLECTOR(osg::NodeVisitor)
__void__apply__Transform_R1,
"",
"");
I_Method1(void, apply, IN, osg::View &, node,
__void__apply__View_R1,
"",
"");
I_Method1(void, apply, IN, osg::CameraNode &, node,
__void__apply__CameraNode_R1,
I_Method1(void, apply, IN, osg::Camera &, node,
__void__apply__Camera_R1,
"",
"");
I_Method1(void, apply, IN, osg::CameraView &, node,

View File

@@ -121,6 +121,10 @@ BEGIN_VALUE_REFLECTOR(osg::Plane)
__float__distance__C5_osg_Vec3_R1,
"calculate the distance between a point and the plane. ",
"");
I_Method1(float, dotProductNormal, IN, const osg::Vec3 &, v,
__float__dotProductNormal__C5_osg_Vec3_R1,
"calculate the dot product of the plane normal and a point. ",
"");
I_Method1(int, intersect, IN, const std::vector< osg::Vec3 > &, vertices,
__int__intersect__C5_std_vectorT1_Vec3__R1,
"intersection test between plane and vertex list return 1 if the bs is completely above plane, return 0 if the bs intersects the plane, return -1 if the bs is completely below the plane. ",

View File

@@ -10,14 +10,9 @@
#include <osgIntrospection/StaticMethodInfo>
#include <osgIntrospection/Attributes>
#include <osg/CameraNode>
#include <osg/CopyOp>
#include <osg/Camera>
#include <osg/Matrix>
#include <osg/Matrixd>
#include <osg/Matrixf>
#include <osg/NodeVisitor>
#include <osg/Object>
#include <osg/Vec3>
#include <osg/View>
// Must undefine IN and OUT macros defined in Windows headers
@@ -29,182 +24,71 @@
#endif
BEGIN_OBJECT_REFLECTOR(osg::View)
I_BaseType(osg::Transform);
I_BaseType(osg::CullSettings);
I_BaseType(osg::Referenced);
I_Constructor0(____View,
"",
"");
I_ConstructorWithDefaults2(IN, const osg::View &, x, , IN, const osg::CopyOp &, copyop, osg::CopyOp::SHALLOW_COPY,
____View__C5_View_R1__C5_CopyOp_R1,
"Copy constructor using CopyOp to manage deep vs shallow copy. ",
"");
I_Method0(osg::Object *, cloneType,
__osg_Object_P1__cloneType,
"clone an object of the same type as the node. ",
I_Method1(void, setCamera, IN, osg::Camera *, camera,
__void__setCamera__osg_Camera_P1,
"Set the master camera of the view. ",
"");
I_Method1(osg::Object *, clone, IN, const osg::CopyOp &, copyop,
__osg_Object_P1__clone__C5_osg_CopyOp_R1,
"return a clone of a node, with Object* return type. ",
I_Method0(osg::Camera *, getCamera,
__osg_Camera_P1__getCamera,
"Get the master camera of the view. ",
"");
I_Method1(bool, isSameKindAs, IN, const osg::Object *, obj,
__bool__isSameKindAs__C5_osg_Object_P1,
"return true if this and obj are of the same kind of object. ",
I_Method0(const osg::Camera *, getCamera,
__C5_osg_Camera_P1__getCamera,
"Get the const master camera of the view. ",
"");
I_Method0(const char *, className,
__C5_char_P1__className,
"return the name of the node's class type. ",
"");
I_Method0(const char *, libraryName,
__C5_char_P1__libraryName,
"return the name of the node's library. ",
"");
I_Method1(void, accept, IN, osg::NodeVisitor &, nv,
__void__accept__osg_NodeVisitor_R1,
"Visitor Pattern : calls the apply method of a NodeVisitor with this node's type. ",
"");
I_Method1(void, setProjectionMatrix, IN, const osg::Matrixf &, matrix,
__void__setProjectionMatrix__C5_osg_Matrixf_R1,
"Set the projection matrix. ",
"Can be thought of as setting the lens of a camera. ");
I_Method1(void, setProjectionMatrix, IN, const osg::Matrixd &, matrix,
__void__setProjectionMatrix__C5_osg_Matrixd_R1,
"Set the projection matrix. ",
"Can be thought of as setting the lens of a camera. ");
I_Method6(void, setProjectionMatrixAsOrtho, IN, double, left, IN, double, right, IN, double, bottom, IN, double, top, IN, double, zNear, IN, double, zFar,
__void__setProjectionMatrixAsOrtho__double__double__double__double__double__double,
"Set to an orthographic projection. ",
"See OpenGL glOrtho for documentation further details. ");
I_Method4(void, setProjectionMatrixAsOrtho2D, IN, double, left, IN, double, right, IN, double, bottom, IN, double, top,
__void__setProjectionMatrixAsOrtho2D__double__double__double__double,
"Set to a 2D orthographic projection. ",
"See OpenGL glOrtho2D documentation for further details. ");
I_Method6(void, setProjectionMatrixAsFrustum, IN, double, left, IN, double, right, IN, double, bottom, IN, double, top, IN, double, zNear, IN, double, zFar,
__void__setProjectionMatrixAsFrustum__double__double__double__double__double__double,
"Set to a perspective projection. ",
"See OpenGL glFrustum documentation for further details. ");
I_Method4(void, setProjectionMatrixAsPerspective, IN, double, fovy, IN, double, aspectRatio, IN, double, zNear, IN, double, zFar,
__void__setProjectionMatrixAsPerspective__double__double__double__double,
"Create a symmetrical perspective projection, See OpenGL gluPerspective documentation for further details. ",
"Aspect ratio is defined as width/height. ");
I_Method0(osg::Matrixd &, getProjectionMatrix,
__osg_Matrixd_R1__getProjectionMatrix,
"Get the projection matrix. ",
"");
I_Method0(const osg::Matrixd &, getProjectionMatrix,
__C5_osg_Matrixd_R1__getProjectionMatrix,
"Get the const projection matrix. ",
"");
I_Method6(bool, getProjectionMatrixAsOrtho, IN, double &, left, IN, double &, right, IN, double &, bottom, IN, double &, top, IN, double &, zNear, IN, double &, zFar,
__bool__getProjectionMatrixAsOrtho__double_R1__double_R1__double_R1__double_R1__double_R1__double_R1,
"Get the othographic settings of the orthographic projection matrix. ",
"Returns false if matrix is not an orthographic matrix, where parameter values are undefined. ");
I_Method6(bool, getProjectionMatrixAsFrustum, IN, double &, left, IN, double &, right, IN, double &, bottom, IN, double &, top, IN, double &, zNear, IN, double &, zFar,
__bool__getProjectionMatrixAsFrustum__double_R1__double_R1__double_R1__double_R1__double_R1__double_R1,
"Get the frustum setting of a perspective projection matrix. ",
"Returns false if matrix is not a perspective matrix, where parameter values are undefined. ");
I_Method4(bool, getProjectionMatrixAsPerspective, IN, double &, fovy, IN, double &, aspectRatio, IN, double &, zNear, IN, double &, zFar,
__bool__getProjectionMatrixAsPerspective__double_R1__double_R1__double_R1__double_R1,
"Get the frustum setting of a symmetric perspective projection matrix. ",
"Returns false if matrix is not a perspective matrix, where parameter values are undefined. Note, if matrix is not a symmetric perspective matrix then the shear will be lost. Asymmetric matrices occur when stereo, power walls, caves and reality center display are used. In these configurations one should use the 'getProjectionMatrixAsFrustum' method instead. ");
I_Method1(void, setViewMatrix, IN, const osg::Matrixf &, matrix,
__void__setViewMatrix__C5_osg_Matrixf_R1,
"Set the view matrix. ",
"Can be thought of as setting the position of the world relative to the camera in camera coordinates. ");
I_Method1(void, setViewMatrix, IN, const osg::Matrixd &, matrix,
__void__setViewMatrix__C5_osg_Matrixd_R1,
"Set the view matrix. ",
"Can be thought of as setting the position of the world relative to the camera in camera coordinates. ");
I_Method3(void, setViewMatrixAsLookAt, IN, const osg::Vec3 &, eye, IN, const osg::Vec3 &, center, IN, const osg::Vec3 &, up,
__void__setViewMatrixAsLookAt__C5_osg_Vec3_R1__C5_osg_Vec3_R1__C5_osg_Vec3_R1,
"Set to the position and orientation of view matrix, using the same convention as gluLookAt. ",
"");
I_Method0(osg::Matrixd &, getViewMatrix,
__osg_Matrixd_R1__getViewMatrix,
"Get the view matrix. ",
"");
I_Method0(const osg::Matrixd &, getViewMatrix,
__C5_osg_Matrixd_R1__getViewMatrix,
"Get the const view matrix. ",
"");
I_MethodWithDefaults4(void, getViewMatrixAsLookAt, IN, osg::Vec3 &, eye, , IN, osg::Vec3 &, center, , IN, osg::Vec3 &, up, , IN, float, lookDistance, 1.0f,
__void__getViewMatrixAsLookAt__osg_Vec3_R1__osg_Vec3_R1__osg_Vec3_R1__float,
"Get to the position and orientation of a modelview matrix, using the same convention as gluLookAt. ",
"");
I_Method0(osg::Matrixd, getInverseViewMatrix,
__Matrixd__getInverseViewMatrix,
"Get the inverse view matrix. ",
"");
I_Method1(bool, addCamera, IN, osg::CameraNode *, camera,
__bool__addCamera__osg_CameraNode_P1,
I_Method1(bool, addSlave, IN, osg::Camera *, camera,
__bool__addSlave__osg_Camera_P1,
"",
"");
I_Method3(bool, addCamera, IN, osg::CameraNode *, camera, IN, const osg::Matrix &, projectionOffset, IN, const osg::Matrix &, viewOffse,
__bool__addCamera__osg_CameraNode_P1__C5_osg_Matrix_R1__C5_osg_Matrix_R1,
I_Method3(bool, addSlave, IN, osg::Camera *, camera, IN, const osg::Matrix &, projectionOffset, IN, const osg::Matrix &, viewOffse,
__bool__addSlave__osg_Camera_P1__C5_osg_Matrix_R1__C5_osg_Matrix_R1,
"",
"");
I_Method1(bool, removeCamera, IN, unsigned int, pos,
__bool__removeCamera__unsigned_int,
I_Method1(bool, removeSlave, IN, unsigned int, pos,
__bool__removeSlave__unsigned_int,
"",
"");
I_Method0(unsigned int, getNumCameras,
__unsigned_int__getNumCameras,
I_Method0(unsigned int, getNumSlaves,
__unsigned_int__getNumSlaves,
"",
"");
I_Method1(osg::CameraNode *, getCamera, IN, unsigned int, pos,
__CameraNode_P1__getCamera__unsigned_int,
I_Method1(osg::View::Slave &, getSlave, IN, unsigned int, pos,
__Slave_R1__getSlave__unsigned_int,
"",
"");
I_Method1(const osg::CameraNode *, getCamera, IN, unsigned int, pos,
__C5_CameraNode_P1__getCamera__unsigned_int,
I_Method1(const osg::View::Slave &, getSlave, IN, unsigned int, pos,
__C5_Slave_R1__getSlave__unsigned_int,
"",
"");
I_Method1(osg::View::CameraData &, getCameraData, IN, unsigned int, pos,
__CameraData_R1__getCameraData__unsigned_int,
"",
"");
I_Method1(const osg::View::CameraData &, getCameraData, IN, unsigned int, pos,
__C5_CameraData_R1__getCameraData__unsigned_int,
"",
"");
I_Method2(bool, computeLocalToWorldMatrix, IN, osg::Matrix &, matrix, IN, osg::NodeVisitor *, x,
__bool__computeLocalToWorldMatrix__Matrix_R1__NodeVisitor_P1,
"Transform method that must be defined to provide generic interface for scene graph traversals. ",
"");
I_Method2(bool, computeWorldToLocalMatrix, IN, osg::Matrix &, matrix, IN, osg::NodeVisitor *, x,
__bool__computeWorldToLocalMatrix__Matrix_R1__NodeVisitor_P1,
"Transform method that must be defined to provide generic interface for scene graph traversals. ",
"");
I_ArrayProperty(osg::CameraNode *, Camera,
__CameraNode_P1__getCamera__unsigned_int,
I_SimpleProperty(osg::Camera *, Camera,
__osg_Camera_P1__getCamera,
__void__setCamera__osg_Camera_P1);
I_ArrayProperty(osg::View::Slave &, Slave,
__Slave_R1__getSlave__unsigned_int,
0,
__unsigned_int__getNumCameras,
__bool__addCamera__osg_CameraNode_P1,
__unsigned_int__getNumSlaves,
0,
__bool__removeCamera__unsigned_int);
I_SimpleProperty(osg::Matrixd, InverseViewMatrix,
__Matrixd__getInverseViewMatrix,
0);
I_SimpleProperty(const osg::Matrixd &, ProjectionMatrix,
__C5_osg_Matrixd_R1__getProjectionMatrix,
__void__setProjectionMatrix__C5_osg_Matrixd_R1);
I_SimpleProperty(const osg::Matrixd &, ViewMatrix,
__C5_osg_Matrixd_R1__getViewMatrix,
__void__setViewMatrix__C5_osg_Matrixd_R1);
0,
__bool__removeSlave__unsigned_int);
END_REFLECTOR
BEGIN_VALUE_REFLECTOR(osg::View::CameraData)
I_Constructor0(____CameraData,
BEGIN_VALUE_REFLECTOR(osg::View::Slave)
I_Constructor0(____Slave,
"",
"");
I_Constructor3(IN, osg::CameraNode *, camera, IN, const osg::Matrixd &, projectionOffset, IN, const osg::Matrixd &, viewOffset,
____CameraData__osg_CameraNode_P1__C5_osg_Matrixd_R1__C5_osg_Matrixd_R1,
I_Constructor3(IN, osg::Camera *, camera, IN, const osg::Matrixd &, projectionOffset, IN, const osg::Matrixd &, viewOffset,
____Slave__osg_Camera_P1__C5_osg_Matrixd_R1__C5_osg_Matrixd_R1,
"",
"");
I_Constructor1(IN, const osg::View::CameraData &, rhs,
____CameraData__C5_CameraData_R1,
I_Constructor1(IN, const osg::View::Slave &, rhs,
____Slave__C5_Slave_R1,
"",
"");
I_PublicMemberProperty(osg::ref_ptr< osg::CameraNode >, _camera);
I_PublicMemberProperty(osg::ref_ptr< osg::Camera >, _camera);
I_PublicMemberProperty(osg::Matrixd, _projectionOffset);
I_PublicMemberProperty(osg::Matrixd, _viewOffset);
END_REFLECTOR

View File

@@ -76,13 +76,3 @@ BEGIN_OBJECT_REFLECTOR(osgGA::GUIEventHandler)
"");
END_REFLECTOR
BEGIN_VALUE_REFLECTOR(osgGA::GUIEventHandlerVisitor)
I_Constructor0(____GUIEventHandlerVisitor,
"",
"");
I_Method1(void, visit, IN, osgGA::GUIEventHandler &, x,
__void__visit__GUIEventHandler_R1,
"",
"");
END_REFLECTOR

View File

@@ -10,7 +10,7 @@ CXXFILES =\
Viewer.cpp\
ViewerEventHandler.cpp\
LIBS += -losgProducer -losg -losgIntrospection -losgUtil -losgGA -losgDB -lProducer -losgGA -losgText $(GL_LIBS) $(OTHER_LIBS)
LIBS += -losgProducer -losg -losgIntrospection -losgUtil -losgDB -lProducer -losgGA -losgText $(GL_LIBS) $(OTHER_LIBS)
OPTF = -O

View File

@@ -16,7 +16,9 @@
#include <osg/Matrix>
#include <osg/Node>
#include <osg/Object>
#include <osg/Polytope>
#include <osg/RenderInfo>
#include <osg/Vec4>
#include <osgShadow/OccluderGeometry>
// Must undefine IN and OUT macros defined in Windows headers
@@ -31,8 +33,6 @@ TYPE_NAME_ALIAS(std::vector< osg::Vec3 >, osgShadow::OccluderGeometry::Vec3List)
TYPE_NAME_ALIAS(std::vector< GLuint >, osgShadow::OccluderGeometry::UIntList);
TYPE_NAME_ALIAS(std::vector< osgShadow::OccluderGeometry::Edge >, osgShadow::OccluderGeometry::EdgeList);
BEGIN_OBJECT_REFLECTOR(osgShadow::OccluderGeometry)
I_BaseType(osg::Drawable);
I_Constructor0(____OccluderGeometry,
@@ -70,6 +70,22 @@ BEGIN_OBJECT_REFLECTOR(osgShadow::OccluderGeometry)
__void__computeOccluderGeometry__osg_Drawable_P1__osg_Matrix_P1__float,
"Compute an occluder geometry containing the geometry in specified drawable. ",
"");
I_Method2(void, comptueShadowVolumeGeometry, IN, const osg::Vec4 &, lightpos, IN, osgShadow::ShadowVolumeGeometry &, svg,
__void__comptueShadowVolumeGeometry__C5_osg_Vec4_R1__ShadowVolumeGeometry_R1,
"Compute ShadowVolumeGeometry. ",
"");
I_Method1(void, setBoundingPolytope, IN, const osg::Polytope &, polytope,
__void__setBoundingPolytope__C5_osg_Polytope_R1,
"Set the bounding polytope of the OccluderGeometry. ",
"");
I_Method0(osg::Polytope &, getBoundingPolytope,
__osg_Polytope_R1__getBoundingPolytope,
"Get the bounding polytope of the OccluderGeometry. ",
"");
I_Method0(const osg::Polytope &, getBoundingPolytope,
__C5_osg_Polytope_R1__getBoundingPolytope,
"Get the const bounding polytope of the OccluderGeometry. ",
"");
I_Method1(void, drawImplementation, IN, osg::RenderInfo &, renderInfo,
__void__drawImplementation__osg_RenderInfo_R1,
"Render the occluder geometry. ",
@@ -78,23 +94,87 @@ BEGIN_OBJECT_REFLECTOR(osgShadow::OccluderGeometry)
__osg_BoundingBox__computeBound,
"Compute the bounding box around occluder geometry. ",
"");
I_MethodWithDefaults3(void, processGeometry, IN, osg::Drawable *, drawable, , IN, osg::Matrix *, matrix, 0, IN, float, sampleRatio, 1.0f,
__void__processGeometry__osg_Drawable_P1__osg_Matrix_P1__float,
"",
"");
I_SimpleProperty(const osg::Polytope &, BoundingPolytope,
__C5_osg_Polytope_R1__getBoundingPolytope,
__void__setBoundingPolytope__C5_osg_Polytope_R1);
END_REFLECTOR
BEGIN_VALUE_REFLECTOR(osgShadow::OccluderGeometry::Edge)
I_Constructor0(____Edge,
TYPE_NAME_ALIAS(std::vector< osg::Vec3 >, osgShadow::ShadowVolumeGeometry::Vec3List);
TYPE_NAME_ALIAS(std::vector< GLuint >, osgShadow::ShadowVolumeGeometry::UIntList);
BEGIN_OBJECT_REFLECTOR(osgShadow::ShadowVolumeGeometry)
I_BaseType(osg::Drawable);
I_Constructor0(____ShadowVolumeGeometry,
"",
"");
I_Constructor4(IN, unsigned int, p1, IN, unsigned int, p2, IN, unsigned int, t1, IN, unsigned int, t2,
____Edge__unsigned_int__unsigned_int__unsigned_int__unsigned_int,
"",
"");
I_PublicMemberProperty(unsigned int, _p1);
I_PublicMemberProperty(unsigned int, _p2);
I_PublicMemberProperty(unsigned int, _t1);
I_PublicMemberProperty(unsigned int, _t2);
I_ConstructorWithDefaults2(IN, const osgShadow::ShadowVolumeGeometry &, oc, , IN, const osg::CopyOp &, copyop, osg::CopyOp::SHALLOW_COPY,
____ShadowVolumeGeometry__C5_ShadowVolumeGeometry_R1__C5_osg_CopyOp_R1,
"",
"");
I_Method0(osg::Object *, cloneType,
__Object_P1__cloneType,
"Clone the type of an object, with Object* return type. ",
"Must be defined by derived classes. ");
I_Method1(osg::Object *, clone, IN, const osg::CopyOp &, copyop,
__Object_P1__clone__C5_osg_CopyOp_R1,
"Clone an object, with Object* return type. ",
"Must be defined by derived classes. ");
I_Method1(bool, isSameKindAs, IN, const osg::Object *, obj,
__bool__isSameKindAs__C5_osg_Object_P1,
"",
"");
I_Method0(const char *, libraryName,
__C5_char_P1__libraryName,
"return the name of the object's library. ",
"Must be defined by derived classes. The OpenSceneGraph convention is that the namespace of a library is the same as the library name. ");
I_Method0(const char *, className,
__C5_char_P1__className,
"return the name of the object's class type. ",
"Must be defined by derived classes. ");
I_Method1(void, setVertices, IN, const osgShadow::ShadowVolumeGeometry::Vec3List &, vertices,
__void__setVertices__C5_Vec3List_R1,
"",
"");
I_Method0(osgShadow::ShadowVolumeGeometry::Vec3List &, getVertices,
__Vec3List_R1__getVertices,
"",
"");
I_Method0(const osgShadow::ShadowVolumeGeometry::Vec3List &, getVertices,
__C5_Vec3List_R1__getVertices,
"",
"");
I_Method1(void, setNormals, IN, const osgShadow::ShadowVolumeGeometry::Vec3List &, normals,
__void__setNormals__C5_Vec3List_R1,
"",
"");
I_Method0(osgShadow::ShadowVolumeGeometry::Vec3List &, getNormals,
__Vec3List_R1__getNormals,
"",
"");
I_Method0(const osgShadow::ShadowVolumeGeometry::Vec3List &, getNormals,
__C5_Vec3List_R1__getNormals,
"",
"");
I_Method1(void, drawImplementation, IN, osg::RenderInfo &, renderInfo,
__void__drawImplementation__osg_RenderInfo_R1,
"Render the occluder geometry. ",
"");
I_Method0(osg::BoundingBox, computeBound,
__osg_BoundingBox__computeBound,
"Compute the bounding box around occluder geometry. ",
"");
I_SimpleProperty(const osgShadow::ShadowVolumeGeometry::Vec3List &, Normals,
__C5_Vec3List_R1__getNormals,
__void__setNormals__C5_Vec3List_R1);
I_SimpleProperty(const osgShadow::ShadowVolumeGeometry::Vec3List &, Vertices,
__C5_Vec3List_R1__getVertices,
__void__setVertices__C5_Vec3List_R1);
END_REFLECTOR
STD_VECTOR_REFLECTOR(std::vector< GLuint >);
STD_VECTOR_REFLECTOR(std::vector< osgShadow::OccluderGeometry::Edge >);

View File

@@ -11,7 +11,7 @@
#include <osgIntrospection/Attributes>
#include <osg/BoundingBox>
#include <osg/CameraNode>
#include <osg/Camera>
#include <osg/CopyOp>
#include <osg/Drawable>
#include <osg/Matrix>
@@ -166,21 +166,21 @@ BEGIN_OBJECT_REFLECTOR(osgSim::ImpostorSprite)
__osg_BoundingBox__computeBound,
"Compute the bounding box around Drawables's geometry. ",
"");
I_Method1(void, setCameraNode, IN, osg::CameraNode *, camera,
__void__setCameraNode__osg_CameraNode_P1,
I_Method1(void, setCamera, IN, osg::Camera *, camera,
__void__setCamera__osg_Camera_P1,
"Set the camera node to use for pre rendering the impostor sprite's texture. ",
"");
I_Method0(osg::CameraNode *, getCameraNode,
__osg_CameraNode_P1__getCameraNode,
I_Method0(osg::Camera *, getCamera,
__osg_Camera_P1__getCamera,
"Get the camera node to use for pre rendering the impostor sprite's texture. ",
"");
I_Method0(const osg::CameraNode *, getCameraNode,
__C5_osg_CameraNode_P1__getCameraNode,
I_Method0(const osg::Camera *, getCamera,
__C5_osg_Camera_P1__getCamera,
"Get the const camera node to use for pre rendering the impostor sprite's texture. ",
"");
I_SimpleProperty(osg::CameraNode *, CameraNode,
__osg_CameraNode_P1__getCameraNode,
__void__setCameraNode__osg_CameraNode_P1);
I_SimpleProperty(osg::Camera *, Camera,
__osg_Camera_P1__getCamera,
__void__setCamera__osg_Camera_P1);
I_SimpleProperty(osg::Vec3 *, ControlCoords,
__osg_Vec3_P1__getControlCoords,
0);

View File

@@ -10,7 +10,7 @@
#include <osgIntrospection/StaticMethodInfo>
#include <osgIntrospection/Attributes>
#include <osg/CameraNode>
#include <osg/Camera>
#include <osg/CopyOp>
#include <osg/Node>
#include <osg/NodeVisitor>
@@ -119,16 +119,16 @@ BEGIN_OBJECT_REFLECTOR(osgSim::OverlayNode)
__unsigned_int__getOverlayTextureSizeHint,
"Get the texture size hint. ",
"");
I_Method0(osg::CameraNode *, getCamera,
__osg_CameraNode_P1__getCamera,
I_Method0(osg::Camera *, getCamera,
__osg_Camera_P1__getCamera,
"Get the camera used to implement the render to texture of the overlay subgraph. ",
"");
I_Method0(const osg::CameraNode *, getCamera,
__C5_osg_CameraNode_P1__getCamera,
I_Method0(const osg::Camera *, getCamera,
__C5_osg_Camera_P1__getCamera,
"Get the const camera used to implement the render to texture of the overlay subgraph. ",
"");
I_SimpleProperty(osg::CameraNode *, Camera,
__osg_CameraNode_P1__getCamera,
I_SimpleProperty(osg::Camera *, Camera,
__osg_Camera_P1__getCamera,
0);
I_SimpleProperty(bool, ContinuousUpdate,
__bool__getContinuousUpdate,

View File

@@ -12,7 +12,7 @@
#include <osg/Billboard>
#include <osg/BoundingBox>
#include <osg/CameraNode>
#include <osg/Camera>
#include <osg/ClearNode>
#include <osg/ClipNode>
#include <osg/Drawable>
@@ -124,8 +124,8 @@ BEGIN_OBJECT_REFLECTOR(osgUtil::CullVisitor)
__void__apply__osg_ClearNode_R1,
"",
"");
I_Method1(void, apply, IN, osg::CameraNode &, node,
__void__apply__osg_CameraNode_R1,
I_Method1(void, apply, IN, osg::Camera &, node,
__void__apply__osg_Camera_R1,
"",
"");
I_Method1(void, apply, IN, osg::OccluderNode &, node,

View File

@@ -11,7 +11,7 @@
#include <osgIntrospection/Attributes>
#include <osg/Billboard>
#include <osg/CameraNode>
#include <osg/Camera>
#include <osg/Drawable>
#include <osg/Geode>
#include <osg/Group>
@@ -280,8 +280,8 @@ BEGIN_OBJECT_REFLECTOR(osgUtil::PickVisitor)
__void__apply__osg_Projection_R1,
"",
"");
I_Method1(void, apply, IN, osg::CameraNode &, camera,
__void__apply__osg_CameraNode_R1,
I_Method1(void, apply, IN, osg::Camera &, camera,
__void__apply__osg_Camera_R1,
"",
"");
END_REFLECTOR

View File

@@ -11,7 +11,7 @@
#include <osgIntrospection/Attributes>
#include <osg/Billboard>
#include <osg/CameraNode>
#include <osg/Camera>
#include <osg/Drawable>
#include <osg/Geode>
#include <osg/Group>
@@ -152,8 +152,8 @@ BEGIN_OBJECT_REFLECTOR(osgUtil::IntersectionVisitor)
__void__apply__osg_Projection_R1,
"",
"");
I_Method1(void, apply, IN, osg::CameraNode &, camera,
__void__apply__osg_CameraNode_R1,
I_Method1(void, apply, IN, osg::Camera &, camera,
__void__apply__osg_Camera_R1,
"",
"");
I_SimpleProperty(osgUtil::Intersector *, Intersector,

View File

@@ -442,6 +442,10 @@ BEGIN_OBJECT_REFLECTOR(osgUtil::Optimizer::RemoveRedundantNodesVisitor)
__void__apply__osg_Transform_R1,
"",
"");
I_Method1(bool, isOperationPermissible, IN, osg::Node &, node,
__bool__isOperationPermissible__osg_Node_R1,
"",
"");
I_Method0(void, removeRedundantNodes,
__void__removeRedundantNodes,
"",

View File

@@ -10,7 +10,7 @@
#include <osgIntrospection/StaticMethodInfo>
#include <osgIntrospection/Attributes>
#include <osg/CameraNode>
#include <osg/Camera>
#include <osg/ColorMask>
#include <osg/CopyOp>
#include <osg/FrameBufferObject>
@@ -150,16 +150,16 @@ BEGIN_OBJECT_REFLECTOR(osgUtil::RenderStage)
__int__getClearStencil,
"Get the clear color. ",
"");
I_Method1(void, setCameraNode, IN, osg::CameraNode *, camera,
__void__setCameraNode__osg_CameraNode_P1,
I_Method1(void, setCamera, IN, osg::Camera *, camera,
__void__setCamera__osg_Camera_P1,
"",
"");
I_Method0(osg::CameraNode *, getCameraNode,
__osg_CameraNode_P1__getCameraNode,
I_Method0(osg::Camera *, getCamera,
__osg_Camera_P1__getCamera,
"",
"");
I_Method0(const osg::CameraNode *, getCameraNode,
__C5_osg_CameraNode_P1__getCameraNode,
I_Method0(const osg::Camera *, getCamera,
__C5_osg_Camera_P1__getCamera,
"",
"");
I_Method1(void, setCameraRequiresSetUp, IN, bool, flag,
@@ -306,9 +306,13 @@ BEGIN_OBJECT_REFLECTOR(osgUtil::RenderStage)
__bool__getStats__Statistics_R1,
"Extract stats for current draw list. ",
"");
I_SimpleProperty(osg::CameraNode *, CameraNode,
__osg_CameraNode_P1__getCameraNode,
__void__setCameraNode__osg_CameraNode_P1);
I_Method2(void, attach, IN, osg::Camera::BufferComponent, buffer, IN, osg::Image *, image,
__void__attach__osg_Camera_BufferComponent__osg_Image_P1,
"",
"");
I_SimpleProperty(osg::Camera *, Camera,
__osg_Camera_P1__getCamera,
__void__setCamera__osg_Camera_P1);
I_SimpleProperty(bool, CameraRequiresSetUp,
__bool__getCameraRequiresSetUp,
__void__setCameraRequiresSetUp__bool);
@@ -368,3 +372,12 @@ BEGIN_OBJECT_REFLECTOR(osgUtil::RenderStage)
__void__setViewport__osg_Viewport_P1);
END_REFLECTOR
BEGIN_VALUE_REFLECTOR(osgUtil::RenderStage::Attachment)
I_Constructor0(____Attachment,
"",
"");
I_PublicMemberProperty(osg::ref_ptr< osg::Image >, _image);
I_PublicMemberProperty(GLenum, _imageReadPixelFormat);
I_PublicMemberProperty(GLenum, _imageReadPixelDataType);
END_REFLECTOR

View File

@@ -10,7 +10,7 @@
#include <osgIntrospection/StaticMethodInfo>
#include <osgIntrospection/Attributes>
#include <osg/CameraNode>
#include <osg/Camera>
#include <osg/CollectOccludersVisitor>
#include <osg/DisplaySettings>
#include <osg/FrameStamp>
@@ -76,16 +76,16 @@ BEGIN_OBJECT_REFLECTOR(osgUtil::SceneView)
__void__setDefaults__unsigned_int,
"Set scene view to use default global state, light, camera and render visitor. ",
"");
I_Method1(void, setCamera, IN, osg::CameraNode *, camera,
__void__setCamera__osg_CameraNode_P1,
I_Method1(void, setCamera, IN, osg::Camera *, camera,
__void__setCamera__osg_Camera_P1,
"Set the camera used to represent the camera view of this SceneView. ",
"");
I_Method0(osg::CameraNode *, getCamera,
__osg_CameraNode_P1__getCamera,
I_Method0(osg::Camera *, getCamera,
__osg_Camera_P1__getCamera,
"Get the camera used to represent the camera view of this SceneView. ",
"");
I_Method0(const osg::CameraNode *, getCamera,
__C5_osg_CameraNode_P1__getCamera,
I_Method0(const osg::Camera *, getCamera,
__C5_osg_Camera_P1__getCamera,
"Get the const camera used to represent the camera view of this SceneView. ",
"");
I_Method1(void, setSceneData, IN, osg::Node *, node,
@@ -583,9 +583,9 @@ BEGIN_OBJECT_REFLECTOR(osgUtil::SceneView)
I_SimpleProperty(int, ActiveUniforms,
__int__getActiveUniforms,
__void__setActiveUniforms__int);
I_SimpleProperty(osg::CameraNode *, Camera,
__osg_CameraNode_P1__getCamera,
__void__setCamera__osg_CameraNode_P1);
I_SimpleProperty(osg::Camera *, Camera,
__osg_Camera_P1__getCamera,
__void__setCamera__osg_Camera_P1);
I_SimpleProperty(const osg::Vec4 &, ClearColor,
__C5_osg_Vec4_R1__getClearColor,
__void__setClearColor__C5_osg_Vec4_R1);

View File

@@ -0,0 +1,88 @@
// ***************************************************************************
//
// Generated automatically by genwrapper.
// Please DO NOT EDIT this file!
//
// ***************************************************************************
#include <osgIntrospection/ReflectionMacros>
#include <osgIntrospection/TypedMethodInfo>
#include <osgIntrospection/StaticMethodInfo>
#include <osgIntrospection/Attributes>
#include <osgViewer/CompositeViewer>
// Must undefine IN and OUT macros defined in Windows headers
#ifdef IN
#undef IN
#endif
#ifdef OUT
#undef OUT
#endif
BEGIN_OBJECT_REFLECTOR(osgViewer::CompositeViewer)
I_BaseType(osg::Referenced);
I_Constructor0(____CompositeViewer,
"",
"");
I_Method1(void, addView, IN, osgViewer *, view,
__void__addView__osgViewer_P1,
"",
"");
I_Method1(osgViewer *, getView, IN, unsigned, i,
__osgViewer_P1__getView__unsigned,
"",
"");
I_Method1(const osgViewer *, getView, IN, unsigned, i,
__C5_osgViewer_P1__getView__unsigned,
"",
"");
I_Method0(void, getNumViews,
__void__getNumViews,
"",
"");
I_Method0(void, frame,
__void__frame,
"Render a complete new frame. ",
"Calls frameAdvance(), frameEventTraversal(), frameUpateTraversal(), frameCullTraversal() and frameDrawTraversal(). Note, no internal makeCurrent() is issued before, or swap buffers called after frame(), these operations are the responsibility of the calling code. ");
I_Method0(void, frameAdvance,
__void__frameAdvance,
"",
"");
I_Method0(void, frameEventTraversal,
__void__frameEventTraversal,
"",
"");
I_Method0(void, frameUpdateTraversal,
__void__frameUpdateTraversal,
"",
"");
I_Method0(void, frameCullTraversal,
__void__frameCullTraversal,
"",
"");
I_Method0(void, frameDrawTraversal,
__void__frameDrawTraversal,
"",
"");
I_Method0(void, releaseAllGLObjects,
__void__releaseAllGLObjects,
"Release all OpenGL objects associated with this viewer's scenegraph. ",
"Note, does not deleted the actual OpenGL objects, it just releases them to the pending GL object delete lists which will need flushing once a valid graphics context is obtained. ");
I_Method0(void, cleanup,
__void__cleanup,
"Clean up all OpenGL objects associated with this viewer's scenegraph. ",
"Note, must only be called from the graphics context associated with this viewer. ");
I_Method0(void, init,
__void__init,
"",
"");
I_ArrayProperty(osgViewer *, View,
__osgViewer_P1__getView__unsigned,
0,
__void__getNumViews,
__void__addView__osgViewer_P1,
0,
0);
END_REFLECTOR

View File

@@ -2,9 +2,13 @@ TOPDIR = ../../..
include $(TOPDIR)/Make/makedefs
CXXFILES =\
Export.cpp\
CompositeViewer.cpp\
GraphicsWindow.cpp\
GraphicsWindowProxy.cpp\
Scene.cpp\
SimpleViewer.cpp\
View.cpp\
Viewer.cpp\
LIBS += -losgViewer -losg -losgIntrospection $(GL_LIBS) $(OTHER_LIBS)

View File

@@ -0,0 +1,86 @@
// ***************************************************************************
//
// Generated automatically by genwrapper.
// Please DO NOT EDIT this file!
//
// ***************************************************************************
#include <osgIntrospection/ReflectionMacros>
#include <osgIntrospection/TypedMethodInfo>
#include <osgIntrospection/StaticMethodInfo>
#include <osgIntrospection/Attributes>
#include <osg/GraphicsContext>
#include <osgViewer/GraphicsWindow>
#include <osgViewer/GraphicsWindowProxy>
// Must undefine IN and OUT macros defined in Windows headers
#ifdef IN
#undef IN
#endif
#ifdef OUT
#undef OUT
#endif
BEGIN_OBJECT_REFLECTOR(osgViewer::GraphicsWindowProxy)
I_BaseType(osgViewer::GraphicsWindow);
I_Constructor0(____GraphicsWindowProxy,
"",
"");
I_Method1(void, setGraphicsWindowImplentation, IN, osgViewer::GraphicsWindow *, gw,
__void__setGraphicsWindowImplentation__osgViewer_GraphicsWindow_P1,
"",
"");
I_Method0(osgViewer::GraphicsWindow *, getGraphicsWindowImplentation,
__osgViewer_GraphicsWindow_P1__getGraphicsWindowImplentation,
"",
"");
I_Method0(const osgViewer::GraphicsWindow *, getGraphicsWindowImplentation,
__C5_osgViewer_GraphicsWindow_P1__getGraphicsWindowImplentation,
"",
"");
I_Method0(bool, realizeImplementation,
__bool__realizeImplementation,
"Realise the GraphicsContext implementation, Pure virtual - must be implemented by concrate implementations of GraphicsContext. ",
"");
I_Method0(bool, isRealizedImplementation,
__bool__isRealizedImplementation,
"Return true if the graphics context has been realised, and is ready to use, implementation. ",
"Pure virtual - must be implemented by concrate implementations of GraphicsContext. ");
I_Method0(void, closeImplementation,
__void__closeImplementation,
"Close the graphics context implementation. ",
"Pure virtual - must be implemented by concrate implementations of GraphicsContext. ");
I_Method0(void, makeCurrentImplementation,
__void__makeCurrentImplementation,
"Make this graphics context current implementation. ",
"Pure virtual - must be implemented by concrate implementations of GraphicsContext. ");
I_Method1(void, makeContextCurrentImplementation, IN, osg::GraphicsContext *, readContext,
__void__makeContextCurrentImplementation__GraphicsContext_P1,
"Make this graphics context current with specified read context implementation. ",
"Pure virtual - must be implemented by concrate implementations of GraphicsContext. ");
I_Method1(void, bindPBufferToTextureImplementation, IN, GLenum, buffer,
__void__bindPBufferToTextureImplementation__GLenum,
"Pure virtual, Bind the graphics context to associated texture implementation. ",
"Pure virtual - must be implemented by concrate implementations of GraphicsContext. ");
I_Method0(void, swapBuffersImplementation,
__void__swapBuffersImplementation,
"Swap the front and back buffers implementation. ",
"Pure virtual - must be implemented by Concrate implementations of GraphicsContext. ");
I_Method0(void, requestRedraw,
__void__requestRedraw,
"requestRedraw() requests a single redraw. ",
"");
I_MethodWithDefaults1(void, requestContinuousUpdate, IN, bool, needed, true,
__void__requestContinuousUpdate__bool,
"requestContinousUpdate(bool) is for en/disabling a throw or idle callback to be requested by a GUIEventHandler (typically a MatrixManipulator, though other GUIEventHandler's may also provide functionality). ",
"GUI toolkits can respond to this immediately by registering an idle/timed callback, or can delay setting the callback and update at their own leisure.");
I_Method2(void, requestWarpPointer, IN, float, x, IN, float, y,
__void__requestWarpPointer__float__float,
"requestWarpPointer(int,int) is requesting a repositioning of the mouse pointer to a specified x,y location on the window. ",
"This is used by some camera manipulators to initialise the mouse pointer when mouse position relative to a controls neutral mouse position is required, i.e when mimicking a aircrafts joystick.");
I_SimpleProperty(osgViewer::GraphicsWindow *, GraphicsWindowImplentation,
__osgViewer_GraphicsWindow_P1__getGraphicsWindowImplentation,
__void__setGraphicsWindowImplentation__osgViewer_GraphicsWindow_P1);
END_REFLECTOR

View File

@@ -0,0 +1,111 @@
// ***************************************************************************
//
// Generated automatically by genwrapper.
// Please DO NOT EDIT this file!
//
// ***************************************************************************
#include <osgIntrospection/ReflectionMacros>
#include <osgIntrospection/TypedMethodInfo>
#include <osgIntrospection/StaticMethodInfo>
#include <osgIntrospection/Attributes>
#include <osg/Node>
#include <osgDB/DatabasePager>
#include <osgGA/EventQueue>
#include <osgGA/GUIEventHandler>
#include <osgViewer/Scene>
// Must undefine IN and OUT macros defined in Windows headers
#ifdef IN
#undef IN
#endif
#ifdef OUT
#undef OUT
#endif
TYPE_NAME_ALIAS(std::list< osg::ref_ptr< osgGA::GUIEventHandler > >, osgViewer::Scene::EventHandlers);
BEGIN_OBJECT_REFLECTOR(osgViewer::Scene)
I_VirtualBaseType(osg::Referenced);
I_Constructor0(____Scene,
"",
"");
I_Method1(void, setSceneData, IN, osg::Node *, node,
__void__setSceneData__osg_Node_P1,
"",
"");
I_Method0(osg::Node *, getSceneData,
__osg_Node_P1__getSceneData,
"",
"");
I_Method0(const osg::Node *, getSceneData,
__C5_osg_Node_P1__getSceneData,
"",
"");
I_Method1(void, setEventQueue, IN, osgGA::EventQueue *, eventQueue,
__void__setEventQueue__osgGA_EventQueue_P1,
"",
"");
I_Method0(osgGA::EventQueue *, getEventQueue,
__osgGA_EventQueue_P1__getEventQueue,
"",
"");
I_Method0(const osgGA::EventQueue *, getEventQueue,
__C5_osgGA_EventQueue_P1__getEventQueue,
"",
"");
I_Method1(void, addEventHandler, IN, osgGA::GUIEventHandler *, eventHandler,
__void__addEventHandler__osgGA_GUIEventHandler_P1,
"",
"");
I_Method0(osgViewer::Scene::EventHandlers &, getEventHandlers,
__EventHandlers_R1__getEventHandlers,
"",
"");
I_Method0(const osgViewer::Scene::EventHandlers &, getEventHandlers,
__C5_EventHandlers_R1__getEventHandlers,
"",
"");
I_Method1(void, setDatabasePager, IN, osgDB::DatabasePager *, dp,
__void__setDatabasePager__osgDB_DatabasePager_P1,
"",
"");
I_Method0(osgDB::DatabasePager *, getDatabasePager,
__osgDB_DatabasePager_P1__getDatabasePager,
"",
"");
I_Method0(const osgDB::DatabasePager *, getDatabasePager,
__C5_osgDB_DatabasePager_P1__getDatabasePager,
"",
"");
I_Method0(void, frameAdvance,
__void__frameAdvance,
"",
"");
I_Method0(void, frameEventTraversal,
__void__frameEventTraversal,
"",
"");
I_Method0(void, frameUpdateTraversal,
__void__frameUpdateTraversal,
"",
"");
I_Method0(void, init,
__void__init,
"",
"");
I_SimpleProperty(osgDB::DatabasePager *, DatabasePager,
__osgDB_DatabasePager_P1__getDatabasePager,
__void__setDatabasePager__osgDB_DatabasePager_P1);
I_SimpleProperty(osgViewer::Scene::EventHandlers &, EventHandlers,
__EventHandlers_R1__getEventHandlers,
0);
I_SimpleProperty(osgGA::EventQueue *, EventQueue,
__osgGA_EventQueue_P1__getEventQueue,
__void__setEventQueue__osgGA_EventQueue_P1);
I_SimpleProperty(osg::Node *, SceneData,
__osg_Node_P1__getSceneData,
__void__setSceneData__osg_Node_P1);
END_REFLECTOR

View File

@@ -10,7 +10,7 @@
#include <osgIntrospection/StaticMethodInfo>
#include <osgIntrospection/Attributes>
#include <osg/CameraNode>
#include <osg/Camera>
#include <osg/Node>
#include <osgDB/DatabasePager>
#include <osgGA/GUIEventHandler>
@@ -45,12 +45,24 @@ BEGIN_OBJECT_REFLECTOR(osgViewer::SimpleViewer)
__C5_osg_Node_P1__getSceneData,
"",
"");
I_Method0(osg::CameraNode *, getCamera,
__osg_CameraNode_P1__getCamera,
I_Method1(void, setDatabasePager, IN, osgDB::DatabasePager *, dp,
__void__setDatabasePager__osgDB_DatabasePager_P1,
"",
"");
I_Method0(const osg::CameraNode *, getCamera,
__C5_osg_CameraNode_P1__getCamera,
I_Method0(osgDB::DatabasePager *, getDatabasePager,
__osgDB_DatabasePager_P1__getDatabasePager,
"",
"");
I_Method0(const osgDB::DatabasePager *, getDatabasePager,
__C5_osgDB_DatabasePager_P1__getDatabasePager,
"",
"");
I_Method0(osg::Camera *, getCamera,
__osg_Camera_P1__getCamera,
"",
"");
I_Method0(const osg::Camera *, getCamera,
__C5_osg_Camera_P1__getCamera,
"",
"");
I_Method1(void, setCameraManipulator, IN, osgGA::MatrixManipulator *, manipulator,
@@ -77,18 +89,6 @@ BEGIN_OBJECT_REFLECTOR(osgViewer::SimpleViewer)
__C5_EventHandlers_R1__getEventHandlers,
"",
"");
I_Method1(void, setDatabasePager, IN, osgDB::DatabasePager *, dp,
__void__setDatabasePager__osgDB_DatabasePager_P1,
"",
"");
I_Method0(osgDB::DatabasePager *, getDatabasePager,
__osgDB_DatabasePager_P1__getDatabasePager,
"",
"");
I_Method0(const osgDB::DatabasePager *, getDatabasePager,
__C5_osgDB_DatabasePager_P1__getDatabasePager,
"",
"");
I_Method0(void, frame,
__void__frame,
"Render a complete new frame. ",
@@ -133,8 +133,8 @@ BEGIN_OBJECT_REFLECTOR(osgViewer::SimpleViewer)
__void__init,
"",
"");
I_SimpleProperty(osg::CameraNode *, Camera,
__osg_CameraNode_P1__getCamera,
I_SimpleProperty(osg::Camera *, Camera,
__osg_Camera_P1__getCamera,
0);
I_SimpleProperty(osgGA::MatrixManipulator *, CameraManipulator,
__osgGA_MatrixManipulator_P1__getCameraManipulator,

View File

@@ -0,0 +1,84 @@
// ***************************************************************************
//
// Generated automatically by genwrapper.
// Please DO NOT EDIT this file!
//
// ***************************************************************************
#include <osgIntrospection/ReflectionMacros>
#include <osgIntrospection/TypedMethodInfo>
#include <osgIntrospection/StaticMethodInfo>
#include <osgIntrospection/Attributes>
#include <osg/Node>
#include <osgGA/GUIEventHandler>
#include <osgGA/MatrixManipulator>
#include <osgViewer/View>
// Must undefine IN and OUT macros defined in Windows headers
#ifdef IN
#undef IN
#endif
#ifdef OUT
#undef OUT
#endif
TYPE_NAME_ALIAS(std::list< osg::ref_ptr< osgGA::GUIEventHandler > >, View::EventHandlers);
BEGIN_OBJECT_REFLECTOR(View)
I_VirtualBaseType(osg::View);
I_BaseType(osgViewer::Scene);
I_Constructor0(____View,
"",
"");
I_Method1(void, setSceneData, IN, osg::Node *, node,
__void__setSceneData__osg_Node_P1,
"",
"");
I_Method0(osg::Node *, getSceneData,
__osg_Node_P1__getSceneData,
"",
"");
I_Method0(const osg::Node *, getSceneData,
__C5_osg_Node_P1__getSceneData,
"",
"");
I_Method1(void, setCameraManipulator, IN, osgGA::MatrixManipulator *, manipulator,
__void__setCameraManipulator__osgGA_MatrixManipulator_P1,
"",
"");
I_Method0(osgGA::MatrixManipulator *, getCameraManipulator,
__osgGA_MatrixManipulator_P1__getCameraManipulator,
"",
"");
I_Method0(const osgGA::MatrixManipulator *, getCameraManipulator,
__C5_osgGA_MatrixManipulator_P1__getCameraManipulator,
"",
"");
I_Method1(void, addEventHandler, IN, osgGA::GUIEventHandler *, eventHandler,
__void__addEventHandler__osgGA_GUIEventHandler_P1,
"",
"");
I_Method0(View::EventHandlers &, getEventHandlers,
__EventHandlers_R1__getEventHandlers,
"",
"");
I_Method0(const View::EventHandlers &, getEventHandlers,
__C5_EventHandlers_R1__getEventHandlers,
"",
"");
I_Method0(void, init,
__void__init,
"",
"");
I_SimpleProperty(osgGA::MatrixManipulator *, CameraManipulator,
__osgGA_MatrixManipulator_P1__getCameraManipulator,
__void__setCameraManipulator__osgGA_MatrixManipulator_P1);
I_SimpleProperty(View::EventHandlers &, EventHandlers,
__EventHandlers_R1__getEventHandlers,
0);
I_SimpleProperty(osg::Node *, SceneData,
__osg_Node_P1__getSceneData,
__void__setSceneData__osg_Node_P1);
END_REFLECTOR

View File

@@ -0,0 +1,64 @@
// ***************************************************************************
//
// Generated automatically by genwrapper.
// Please DO NOT EDIT this file!
//
// ***************************************************************************
#include <osgIntrospection/ReflectionMacros>
#include <osgIntrospection/TypedMethodInfo>
#include <osgIntrospection/StaticMethodInfo>
#include <osgIntrospection/Attributes>
#include <osgViewer/Viewer>
// Must undefine IN and OUT macros defined in Windows headers
#ifdef IN
#undef IN
#endif
#ifdef OUT
#undef OUT
#endif
BEGIN_VALUE_REFLECTOR(osgViewer::Viewer)
I_Constructor0(____Viewer,
"",
"");
I_Method0(void, frame,
__void__frame,
"Render a complete new frame. ",
"Calls frameAdvance(), frameEventTraversal(), frameUpateTraversal(), frameCullTraversal() and frameDrawTraversal(). Note, no internal makeCurrent() is issued before, or swap buffers called after frame(), these operations are the responsibility of the calling code. ");
I_Method0(void, frameAdvance,
__void__frameAdvance,
"",
"");
I_Method0(void, frameEventTraversal,
__void__frameEventTraversal,
"",
"");
I_Method0(void, frameUpdateTraversal,
__void__frameUpdateTraversal,
"",
"");
I_Method0(void, frameCullTraversal,
__void__frameCullTraversal,
"",
"");
I_Method0(void, frameDrawTraversal,
__void__frameDrawTraversal,
"",
"");
I_Method0(void, releaseAllGLObjects,
__void__releaseAllGLObjects,
"Release all OpenGL objects associated with this viewer's scenegraph. ",
"Note, does not deleted the actual OpenGL objects, it just releases them to the pending GL object delete lists which will need flushing once a valid graphics context is obtained. ");
I_Method0(void, cleanup,
__void__cleanup,
"Clean up all OpenGL objects associated with this viewer's scenegraph. ",
"Note, must only be called from the graphics context associated with this viewer. ");
I_Method0(void, init,
__void__init,
"",
"");
END_REFLECTOR