root/OpenSceneGraph/trunk/src/osgVolume/VolumeTechnique.cpp @ 13041

Revision 13041, 2.4 kB (checked in by robert, 2 years ago)

Ran script to remove trailing spaces and tabs

  • Property svn:eol-style set to native
Line 
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#include <osgVolume/VolumeTechnique>
15#include <osgVolume/VolumeTile>
16
17using namespace osgVolume;
18
19VolumeTechnique::VolumeTechnique():
20    _volumeTile(0)
21{
22    setThreadSafeRefUnref(true);
23}
24
25VolumeTechnique::VolumeTechnique(const VolumeTechnique& rhs,const osg::CopyOp& copyop):
26    osg::Object(rhs,copyop),
27    _volumeTile(0)
28{
29}
30
31VolumeTechnique::~VolumeTechnique()
32{
33}
34
35void VolumeTechnique::init()
36{
37    OSG_NOTICE<<className()<<"::initialize(..) not implementated yet"<<std::endl;
38}
39
40void 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
46void 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
52void VolumeTechnique::cleanSceneGraph()
53{
54    OSG_NOTICE<<className()<<"::cleanSceneGraph(..) not implementated yet"<<std::endl;
55}
56
57void VolumeTechnique::traverse(osg::NodeVisitor& nv)
58{
59    if (!_volumeTile) return;
60
61    // if app traversal update the frame count.
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    // otherwise fallback to the Group::traverse()
87    _volumeTile->osg::Group::traverse(nv);
88}
Note: See TracBrowser for help on using the browser.