| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | #include <osgVolume/VolumeTechnique> |
|---|
| 15 | #include <osgVolume/VolumeTile> |
|---|
| 16 | |
|---|
| 17 | using namespace osgVolume; |
|---|
| 18 | |
|---|
| 19 | VolumeTechnique::VolumeTechnique(): |
|---|
| 20 | _volumeTile(0) |
|---|
| 21 | { |
|---|
| 22 | setThreadSafeRefUnref(true); |
|---|
| 23 | } |
|---|
| 24 | |
|---|
| 25 | VolumeTechnique::VolumeTechnique(const VolumeTechnique& rhs,const osg::CopyOp& copyop): |
|---|
| 26 | osg::Object(rhs,copyop), |
|---|
| 27 | _volumeTile(0) |
|---|
| 28 | { |
|---|
| 29 | } |
|---|
| 30 | |
|---|
| 31 | VolumeTechnique::~VolumeTechnique() |
|---|
| 32 | { |
|---|
| 33 | } |
|---|
| 34 | |
|---|
| 35 | void VolumeTechnique::init() |
|---|
| 36 | { |
|---|
| 37 | OSG_NOTICE<<className()<<"::initialize(..) not implementated yet"<<std::endl; |
|---|
| 38 | } |
|---|
| 39 | |
|---|
| 40 | void VolumeTechnique::update(osgUtil::UpdateVisitor* uv) |
|---|
| 41 | { |
|---|
| 42 | OSG_NOTICE<<className()<<"::update(..) not implementated yet"<<std::endl; |
|---|
| 43 | if (_volumeTile) _volumeTile->osg::Group::traverse(*uv); |
|---|
| 44 | } |
|---|
| 45 | |
|---|
| 46 | void VolumeTechnique::cull(osgUtil::CullVisitor* cv) |
|---|
| 47 | { |
|---|
| 48 | OSG_NOTICE<<className()<<"::cull(..) not implementated yet"<<std::endl; |
|---|
| 49 | if (_volumeTile) _volumeTile->osg::Group::traverse(*cv); |
|---|
| 50 | } |
|---|
| 51 | |
|---|
| 52 | void VolumeTechnique::cleanSceneGraph() |
|---|
| 53 | { |
|---|
| 54 | OSG_NOTICE<<className()<<"::cleanSceneGraph(..) not implementated yet"<<std::endl; |
|---|
| 55 | } |
|---|
| 56 | |
|---|
| 57 | void VolumeTechnique::traverse(osg::NodeVisitor& nv) |
|---|
| 58 | { |
|---|
| 59 | if (!_volumeTile) return; |
|---|
| 60 | |
|---|
| 61 | |
|---|
| 62 | if (nv.getVisitorType()==osg::NodeVisitor::UPDATE_VISITOR) |
|---|
| 63 | { |
|---|
| 64 | if (_volumeTile->getDirty()) _volumeTile->init(); |
|---|
| 65 | |
|---|
| 66 | osgUtil::UpdateVisitor* uv = dynamic_cast<osgUtil::UpdateVisitor*>(&nv); |
|---|
| 67 | if (uv) |
|---|
| 68 | { |
|---|
| 69 | update(uv); |
|---|
| 70 | return; |
|---|
| 71 | } |
|---|
| 72 | |
|---|
| 73 | } |
|---|
| 74 | else if (nv.getVisitorType()==osg::NodeVisitor::CULL_VISITOR) |
|---|
| 75 | { |
|---|
| 76 | osgUtil::CullVisitor* cv = dynamic_cast<osgUtil::CullVisitor*>(&nv); |
|---|
| 77 | if (cv) |
|---|
| 78 | { |
|---|
| 79 | cull(cv); |
|---|
| 80 | return; |
|---|
| 81 | } |
|---|
| 82 | } |
|---|
| 83 | |
|---|
| 84 | if (_volumeTile->getDirty()) _volumeTile->init(); |
|---|
| 85 | |
|---|
| 86 | |
|---|
| 87 | _volumeTile->osg::Group::traverse(nv); |
|---|
| 88 | } |
|---|