OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VolumeTechnique.h
Go to the documentation of this file.
1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
2  *
3  * This library is open source and may be redistributed and/or modified under
4  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5  * (at your option) any later version. The full license is in LICENSE file
6  * included with this distribution, and on the openscenegraph.org website.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * OpenSceneGraph Public License for more details.
12 */
13 
14 #ifndef OSGVOLUME_VOLUMETECHNIQUE
15 #define OSGVOLUME_VOLUMETECHNIQUE 1
16 
17 #include <osg/Object>
18 
19 #include <osgUtil/UpdateVisitor>
20 #include <osgUtil/CullVisitor>
21 
22 #include <osgVolume/Export>
23 
24 namespace osgVolume {
25 
26 class VolumeTile;
27 
29 struct TileData : public osg::Referenced
30 {
31  TileData() : active(false) {}
32 
33  virtual void update(osgUtil::CullVisitor* cv) = 0;
34 
35  bool active;
36 
40 
42 };
43 
44 
46 {
47  public:
48 
50 
53 
55 
56  VolumeTile* getVolumeTile() { return _volumeTile; }
57  const VolumeTile* getVolumeTile() const { return _volumeTile; }
58 
59  virtual void init();
60 
61  virtual void update(osgUtil::UpdateVisitor* nv);
62 
63  virtual bool isMoving(osgUtil::CullVisitor* nv);
64 
65  virtual void cull(osgUtil::CullVisitor* nv);
66 
68  virtual void cleanSceneGraph();
69 
71  virtual void traverse(osg::NodeVisitor& nv);
72 
75  virtual TileData* createTileData(osgUtil::CullVisitor* /*cv*/) { return 0; }
76 
77  protected:
78 
79  void setDirty(bool dirty);
80 
81  virtual ~VolumeTechnique();
82 
83  friend class osgVolume::VolumeTile;
84 
86 
87  typedef std::map<osgUtil::CullVisitor::Identifier*, osg::Matrix> ModelViewMatrixMap;
89  ModelViewMatrixMap _modelViewMatrixMap;
90 };
91 
92 }
93 
94 #endif
osg::ref_ptr< osg::RefMatrix > modelviewMatrix
osg::ref_ptr< osg::StateSet > stateset
osg::ref_ptr< osg::RefMatrix > projectionMatrix
This class provides an object-oriented thread mutex interface.
Definition: Mutex.h:31
std::map< osgUtil::CullVisitor::Identifier *, osg::Matrix > ModelViewMatrixMap
osg::NodePath nodePath
#define OSGVOLUME_EXPORT
Definition: Export.h:39
#define META_Object(library, name)
Definition: Object.h:42
ModelViewMatrixMap _modelViewMatrixMap
virtual void update(osgUtil::CullVisitor *cv)=0
const VolumeTile * getVolumeTile() const
OpenThreads::Mutex _mutex
std::vector< Node * > NodePath
Definition: Node.h:44
virtual TileData * createTileData(osgUtil::CullVisitor *)