Changeset 13041 for OpenSceneGraph/trunk/src/osgVolume/VolumeTile.cpp
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgVolume/VolumeTile.cpp
r12292 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield 2 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 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 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 61 61 _layer(volumeTile._layer) 62 62 { 63 setNumChildrenRequiringUpdateTraversal(getNumChildrenRequiringUpdateTraversal()+1); 63 setNumChildrenRequiringUpdateTraversal(getNumChildrenRequiringUpdateTraversal()+1); 64 64 65 65 if (volumeTile.getVolumeTechnique()) … … 73 73 if (_volume) setVolume(0); 74 74 } 75 75 76 76 void VolumeTile::setVolume(Volume* volume) 77 77 { 78 78 if (_volume == volume) return; 79 79 80 80 if (_volume) _volume->unregisterVolumeTile(this); 81 81 82 82 _volume = volume; 83 83 … … 111 111 { 112 112 osgVolume::Volume* volume = dynamic_cast<Volume*>(*itr); 113 if (volume) 113 if (volume) 114 114 { 115 OSG_INFO<<"Assigning volume system "<<volume<<std::endl; 115 OSG_INFO<<"Assigning volume system "<<volume<<std::endl; 116 116 setVolume(volume); 117 117 } … … 119 119 } 120 120 } 121 121 122 122 _hasBeenTraversal = true; 123 123 } 124 124 125 125 if (nv.getVisitorType()==osg::NodeVisitor::UPDATE_VISITOR && 126 126 _layer->requiresUpdateTraversal()) … … 144 144 { 145 145 _volumeTechnique->init(); 146 146 147 147 setDirty(false); 148 } 148 } 149 149 } 150 150 … … 156 156 void VolumeTile::setVolumeTechnique(VolumeTechnique* volumeTechnique) 157 157 { 158 if (_volumeTechnique == volumeTechnique) return; 158 if (_volumeTechnique == volumeTechnique) return; 159 159 160 160 int dirtyDelta = _dirty ? -1 : 0; 161 161 162 if (_volumeTechnique.valid()) 162 if (_volumeTechnique.valid()) 163 163 { 164 164 _volumeTechnique->_volumeTile = 0; … … 166 166 167 167 _volumeTechnique = volumeTechnique; 168 169 if (_volumeTechnique.valid()) 168 169 if (_volumeTechnique.valid()) 170 170 { 171 171 _volumeTechnique->_volumeTile = this; 172 ++dirtyDelta; 173 } 174 172 ++dirtyDelta; 173 } 174 175 175 if (dirtyDelta>0) setDirty(true); 176 176 else if (dirtyDelta<0) setDirty(false); … … 187 187 setNumChildrenRequiringUpdateTraversal(getNumChildrenRequiringUpdateTraversal()+1); 188 188 } 189 else if (getNumChildrenRequiringUpdateTraversal()>0) 189 else if (getNumChildrenRequiringUpdateTraversal()>0) 190 190 { 191 191 setNumChildrenRequiringUpdateTraversal(getNumChildrenRequiringUpdateTraversal()-1); … … 196 196 { 197 197 const Locator* masterLocator = getLocator(); 198 if (_layer.valid() && !masterLocator) 198 if (_layer.valid() && !masterLocator) 199 199 { 200 200 masterLocator = _layer->getLocator();
