VolumeTile
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_tile
#define OSGVOLUME_tile 1
#include <osg/Group>
#include <osg/Image>
#include <osgDB/ReaderWriter>
#include <osgVolume/Layer>
#include <osgVolume/VolumeTechnique>
namespace osgVolume {
class Volume;
class OSGVOLUME_EXPORT TileID
{
public:
TileID();
TileID(int in_level, int in_x, int in_y, int in_z);
bool operator == (const TileID& rhs) const
{
return (level==rhs.level) && (x==rhs.x) && (y==rhs.y) && (z==rhs.z);
}
bool operator != (const TileID& rhs) const
{
return (level!=rhs.level) || (x!=rhs.x) || (y!=rhs.y) || (z!=rhs.z);
}
bool operator < (const TileID& rhs) const
{
if (level<rhs.level) return true;
if (level>rhs.level) return false;
if (x<rhs.x) return true;
if (x>rhs.x) return false;
if (y<rhs.y) return true;
if (y>rhs.y) return false;
return z<rhs.z;
}
bool valid() const { return level>=0; }
int level;
int x;
int y;
int z;
};
class OSGVOLUME_EXPORT VolumeTile : public osg::Group
{
public:
VolumeTile();
VolumeTile(const VolumeTile&,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
META_Node(osgVolume, VolumeTile);
virtual void traverse(osg::NodeVisitor& nv);
void init();
void setVolume(Volume* ts);
Volume* getVolume() { return _volume; }
const Volume* getVolume() const { return _volume; }
void setTileID(const TileID& tileID);
const TileID& getTileID() const { return _tileID; }
void setLocator(Locator* locator) { _locator = locator; }
Locator* getLocator() { return _locator.get(); }
const Locator* getLocator() const { return _locator.get(); }
void setLayer(Layer* layer);
Layer* getLayer() { return _layer.get(); }
const Layer* getLayer() const { return _layer.get(); }
void setVolumeTechnique(VolumeTechnique* VolumeTechnique);
VolumeTechnique* getVolumeTechnique() { return _volumeTechnique.get(); }
const VolumeTechnique* getVolumeTechnique() const { return _volumeTechnique.get(); }
void setDirty(bool dirty);
bool getDirty() const { return _dirty; }
virtual osg::BoundingSphere computeBound() const;
protected:
virtual ~VolumeTile();
friend class Volume;
Volume* _volume;
bool _dirty;
bool _hasBeenTraversal;
TileID _tileID;
osg::ref_ptr<VolumeTechnique> _volumeTechnique;
osg::ref_ptr<Locator> _locator;
osg::ref_ptr<Layer> _layer;
};
}
#endif
Group
Image
ReaderWriter
VolumeTechnique
osgVolume::Layer
Definition osgVolume/Layer:57
osgVolume::Locator
Definition osgVolume/Locator:30
osgVolume::TileID
Definition VolumeTile:30
osgVolume::TileID::level
int level
Definition VolumeTile:60
osgVolume::TileID::valid
bool valid() const
Definition VolumeTile:58
osgVolume::TileID::TileID
TileID(int in_level, int in_x, int in_y, int in_z)
osgVolume::TileID::y
int y
Definition VolumeTile:62
osgVolume::TileID::z
int z
Definition VolumeTile:63
osgVolume::TileID::TileID
TileID()
osgVolume::TileID::x
int x
Definition VolumeTile:61
osgVolume::VolumeTechnique
Definition VolumeTechnique:46
osgVolume::VolumeTile::META_Node
META_Node(osgVolume, VolumeTile)
osgVolume::VolumeTile::getVolumeTechnique
VolumeTechnique * getVolumeTechnique()
Definition VolumeTile:120
osgVolume::VolumeTile::setLocator
void setLocator(Locator *locator)
Definition VolumeTile:105
osgVolume::VolumeTile::VolumeTile
VolumeTile(const VolumeTile &, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osgVolume::VolumeTile::getDirty
bool getDirty() const
Definition VolumeTile:130
osgVolume::VolumeTile::getLocator
Locator * getLocator()
Definition VolumeTile:106
osgVolume::VolumeTile::_volumeTechnique
osg::ref_ptr< VolumeTechnique > _volumeTechnique
Definition VolumeTile:148
osgVolume::VolumeTile::getVolume
Volume * getVolume()
Definition VolumeTile:90
osgVolume::VolumeTile::_tileID
TileID _tileID
Definition VolumeTile:146
osgVolume::VolumeTile::getLocator
const Locator * getLocator() const
Definition VolumeTile:107
osgVolume::VolumeTile::getVolume
const Volume * getVolume() const
Definition VolumeTile:93
osgVolume::VolumeTile::setTileID
void setTileID(const TileID &tileID)
osgVolume::VolumeTile::setVolume
void setVolume(Volume *ts)
osgVolume::VolumeTile::_dirty
bool _dirty
Definition VolumeTile:143
osgVolume::VolumeTile::_volume
Volume * _volume
Definition VolumeTile:141
osgVolume::VolumeTile::_hasBeenTraversal
bool _hasBeenTraversal
Definition VolumeTile:144
osgVolume::VolumeTile::setLayer
void setLayer(Layer *layer)
osgVolume::VolumeTile::_locator
osg::ref_ptr< Locator > _locator
Definition VolumeTile:150
osgVolume::VolumeTile::~VolumeTile
virtual ~VolumeTile()
osgVolume::VolumeTile::setVolumeTechnique
void setVolumeTechnique(VolumeTechnique *VolumeTechnique)
osgVolume::VolumeTile::Volume
friend class Volume
Definition VolumeTile:139
osgVolume::VolumeTile::_layer
osg::ref_ptr< Layer > _layer
Definition VolumeTile:152
osgVolume::VolumeTile::init
void init()
osgVolume::VolumeTile::VolumeTile
VolumeTile()
osgVolume::VolumeTile::getLayer
const Layer * getLayer() const
Definition VolumeTile:112
osgVolume::VolumeTile::getLayer
Layer * getLayer()
Definition VolumeTile:111
osgVolume::VolumeTile::getTileID
const TileID & getTileID() const
Definition VolumeTile:102
osgVolume::VolumeTile::traverse
virtual void traverse(osg::NodeVisitor &nv)
osgVolume::VolumeTile::getVolumeTechnique
const VolumeTechnique * getVolumeTechnique() const
Definition VolumeTile:123
osgVolume::VolumeTile::setDirty
void setDirty(bool dirty)
osgVolume::VolumeTile::computeBound
virtual osg::BoundingSphere computeBound() const
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::Group
Definition Group:29
osg::NodeVisitor
Definition NodeVisitor:82
osg::ref_ptr
Definition ref_ptr:32
osgVolume
osg::BoundingSphere
BoundingSphered BoundingSphere
Definition BoundingSphere:314
OSGVOLUME_EXPORT
#define OSGVOLUME_EXPORT
Definition osgVolume/Export:39
Layer