2012-03-22 01:36:20 +08:00
|
|
|
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
|
2009-01-14 01:20:32 +08:00
|
|
|
*
|
2012-03-22 01:36:20 +08:00
|
|
|
* 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
|
2009-01-14 01:20:32 +08:00
|
|
|
* (at your option) any later version. The full license is in LICENSE file
|
|
|
|
* included with this distribution, and on the openscenegraph.org website.
|
2012-03-22 01:36:20 +08:00
|
|
|
*
|
2009-01-14 01:20:32 +08:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2012-03-22 01:36:20 +08:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2009-01-14 01:20:32 +08:00
|
|
|
* OpenSceneGraph Public License for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef OSGVOLUME_FIXEDFUNCTIONTECHNIQUE
|
|
|
|
#define OSGVOLUME_FIXEDFUNCTIONTECHNIQUE 1
|
|
|
|
|
|
|
|
#include <osgVolume/VolumeTechnique>
|
|
|
|
|
|
|
|
namespace osgVolume {
|
|
|
|
|
|
|
|
class OSGVOLUME_EXPORT FixedFunctionTechnique : public VolumeTechnique
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
FixedFunctionTechnique();
|
|
|
|
|
|
|
|
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
|
|
|
FixedFunctionTechnique(const FixedFunctionTechnique&,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2009-01-14 01:20:32 +08:00
|
|
|
META_Object(osgVolume, FixedFunctionTechnique);
|
|
|
|
|
|
|
|
virtual void init();
|
|
|
|
|
|
|
|
virtual void update(osgUtil::UpdateVisitor* nv);
|
|
|
|
|
|
|
|
virtual void cull(osgUtil::CullVisitor* nv);
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2009-01-17 00:21:54 +08:00
|
|
|
void setNumSlices(unsigned int numSlices);
|
|
|
|
|
|
|
|
unsigned int getNumSlices() const { return _numSlices; }
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2009-01-14 01:20:32 +08:00
|
|
|
|
|
|
|
/** Clean scene graph from any terrain technique specific nodes.*/
|
|
|
|
virtual void cleanSceneGraph();
|
|
|
|
|
|
|
|
/** Traverse the terrain subgraph.*/
|
|
|
|
virtual void traverse(osg::NodeVisitor& nv);
|
|
|
|
|
|
|
|
protected:
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2009-01-14 01:20:32 +08:00
|
|
|
virtual ~FixedFunctionTechnique();
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2009-01-16 19:27:20 +08:00
|
|
|
osg::ref_ptr<osg::Node> _node;
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2009-01-17 00:21:54 +08:00
|
|
|
unsigned int _numSlices;
|
2009-01-14 01:20:32 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|