VolumeTechnique
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 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.
*/
#ifndef OSGVOLUME_VOLUMETECHNIQUE
#define OSGVOLUME_VOLUMETECHNIQUE 1
#include <osg/Object>
#include <osgUtil/UpdateVisitor>
#include <osgUtil/CullVisitor>
#include <osgVolume/Export>
namespace osgVolume {
class VolumeTile;
struct TileData : public osg::Referenced
{
TileData() : active(false) {}
virtual void update(osgUtil::CullVisitor* cv) = 0;
bool active;
osg::NodePath nodePath;
osg::ref_ptr<osg::RefMatrix> projectionMatrix;
osg::ref_ptr<osg::RefMatrix> modelviewMatrix;
osg::ref_ptr<osg::StateSet> stateset;
};
class OSGVOLUME_EXPORT VolumeTechnique : public osg::Object
{
public:
VolumeTechnique();
VolumeTechnique(const VolumeTechnique&,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
META_Object(osgVolume, VolumeTechnique);
VolumeTile* getVolumeTile() { return _volumeTile; }
const VolumeTile* getVolumeTile() const { return _volumeTile; }
virtual void init();
virtual void update(osgUtil::UpdateVisitor* nv);
virtual bool isMoving(osgUtil::CullVisitor* nv);
virtual void cull(osgUtil::CullVisitor* nv);
virtual void cleanSceneGraph();
virtual void traverse(osg::NodeVisitor& nv);
virtual TileData* createTileData(osgUtil::CullVisitor* /*cv*/) { return 0; }
protected:
void setDirty(bool dirty);
virtual ~VolumeTechnique();
friend class osgVolume::VolumeTile;
VolumeTile* _volumeTile;
typedef std::map<osgUtil::CullVisitor::Identifier*, osg::Matrix> ModelViewMatrixMap;
OpenThreads::Mutex _mutex;
ModelViewMatrixMap _modelViewMatrixMap;
};
}
#endif
CullVisitor
Object
UpdateVisitor
OpenThreads::Mutex
This class provides an object-oriented thread mutex interface.
Definition Mutex:31
osgUtil::CullVisitor
Definition CullVisitor:49
osgUtil::UpdateVisitor
Definition UpdateVisitor:38
osgVolume::VolumeTechnique::traverse
virtual void traverse(osg::NodeVisitor &nv)
osgVolume::VolumeTechnique::_mutex
OpenThreads::Mutex _mutex
Definition VolumeTechnique:88
osgVolume::VolumeTechnique::update
virtual void update(osgUtil::UpdateVisitor *nv)
osgVolume::VolumeTechnique::ModelViewMatrixMap
std::map< osgUtil::CullVisitor::Identifier *, osg::Matrix > ModelViewMatrixMap
Definition VolumeTechnique:87
osgVolume::VolumeTechnique::_volumeTile
VolumeTile * _volumeTile
Definition VolumeTechnique:85
osgVolume::VolumeTechnique::_modelViewMatrixMap
ModelViewMatrixMap _modelViewMatrixMap
Definition VolumeTechnique:89
osgVolume::VolumeTechnique::createTileData
virtual TileData * createTileData(osgUtil::CullVisitor *)
Definition VolumeTechnique:75
osgVolume::VolumeTechnique::cull
virtual void cull(osgUtil::CullVisitor *nv)
osgVolume::VolumeTechnique::VolumeTechnique
VolumeTechnique(const VolumeTechnique &, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osgVolume::VolumeTechnique::isMoving
virtual bool isMoving(osgUtil::CullVisitor *nv)
osgVolume::VolumeTechnique::init
virtual void init()
osgVolume::VolumeTechnique::getVolumeTile
VolumeTile * getVolumeTile()
Definition VolumeTechnique:56
osgVolume::VolumeTechnique::setDirty
void setDirty(bool dirty)
osgVolume::VolumeTechnique::VolumeTechnique
VolumeTechnique()
osgVolume::VolumeTechnique::META_Object
META_Object(osgVolume, VolumeTechnique)
osgVolume::VolumeTechnique::cleanSceneGraph
virtual void cleanSceneGraph()
osgVolume::VolumeTechnique::getVolumeTile
const VolumeTile * getVolumeTile() const
Definition VolumeTechnique:57
osgVolume::VolumeTechnique::~VolumeTechnique
virtual ~VolumeTechnique()
osgVolume::VolumeTechnique::VolumeTile
friend class osgVolume::VolumeTile
Definition VolumeTechnique:83
osgVolume::VolumeTile
Definition VolumeTile:70
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::NodeVisitor
Definition NodeVisitor:82
osg::Object
Definition Object:61
osg::Referenced
Definition Referenced:44
osg::ref_ptr
Definition ref_ptr:32
osgVolume
osg::NodePath
std::vector< Node * > NodePath
Definition Node:47
Export
OSGVOLUME_EXPORT
#define OSGVOLUME_EXPORT
Definition osgVolume/Export:39
osgVolume::TileData
Definition VolumeTechnique:30
osgVolume::TileData::modelviewMatrix
osg::ref_ptr< osg::RefMatrix > modelviewMatrix
Definition VolumeTechnique:39
osgVolume::TileData::projectionMatrix
osg::ref_ptr< osg::RefMatrix > projectionMatrix
Definition VolumeTechnique:38
osgVolume::TileData::nodePath
osg::NodePath nodePath
Definition VolumeTechnique:37
osgVolume::TileData::stateset
osg::ref_ptr< osg::StateSet > stateset
Definition VolumeTechnique:41
osgVolume::TileData::TileData
TileData()
Definition VolumeTechnique:31
osgVolume::TileData::update
virtual void update(osgUtil::CullVisitor *cv)=0
osgVolume::TileData::active
bool active
Definition VolumeTechnique:35