Ran script to remove trailing spaces and tabs
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
@@ -46,12 +46,12 @@ FixedFunctionTechnique::~FixedFunctionTechnique()
|
||||
void FixedFunctionTechnique::setNumSlices(unsigned int numSlices)
|
||||
{
|
||||
if (_numSlices==numSlices) return;
|
||||
|
||||
|
||||
_numSlices = numSlices;
|
||||
|
||||
|
||||
if (_volumeTile) _volumeTile->setDirty(true);
|
||||
}
|
||||
|
||||
|
||||
osg::Node* createCube(const osg::Vec3& center, float size, unsigned int numSlices)
|
||||
{
|
||||
|
||||
@@ -74,7 +74,7 @@ osg::Node* createCube(const osg::Vec3& center, float size, unsigned int numSlice
|
||||
(*coords)[i*4+2].set(halfSize,y,-halfSize);
|
||||
(*coords)[i*4+3].set(halfSize,y,halfSize);
|
||||
}
|
||||
|
||||
|
||||
osg::Vec3Array* normals = new osg::Vec3Array(1);
|
||||
(*normals)[0].set(0.0f,-1.0f,0.0f);
|
||||
geom->setNormalArray(normals);
|
||||
@@ -91,7 +91,7 @@ osg::Node* createCube(const osg::Vec3& center, float size, unsigned int numSlice
|
||||
billboard->setMode(osg::Billboard::POINT_ROT_WORLD);
|
||||
billboard->addDrawable(geom);
|
||||
billboard->setPosition(0,center);
|
||||
|
||||
|
||||
return billboard;
|
||||
}
|
||||
|
||||
@@ -119,13 +119,13 @@ void FixedFunctionTechnique::init()
|
||||
}
|
||||
|
||||
float alphaFuncValue = 0.1;
|
||||
|
||||
|
||||
osg::Image* image_3d = 0;
|
||||
osgVolume::Locator* masterLocator = _volumeTile->getLocator();
|
||||
osg::Texture::InternalFormatMode internalFormatMode = osg::Texture::USE_IMAGE_DATA_FORMAT;
|
||||
osg::Texture::InternalFormatMode internalFormatMode = osg::Texture::USE_IMAGE_DATA_FORMAT;
|
||||
|
||||
image_3d = _volumeTile->getLayer()->getImage();
|
||||
|
||||
|
||||
CollectPropertiesVisitor cpv;
|
||||
if (_volumeTile->getLayer()->getProperty())
|
||||
{
|
||||
@@ -154,7 +154,7 @@ void FixedFunctionTechnique::init()
|
||||
{
|
||||
matrix = masterLocator->getTransform();
|
||||
}
|
||||
|
||||
|
||||
OSG_NOTICE<<"Matrix = "<<matrix<<std::endl;
|
||||
|
||||
osg::Texture::FilterMode minFilter = osg::Texture::NEAREST;
|
||||
@@ -164,12 +164,12 @@ void FixedFunctionTechnique::init()
|
||||
osg::Vec3d v100 = osg::Vec3d(1.0,0.0,0.0) * matrix;
|
||||
osg::Vec3d v010 = osg::Vec3d(0.0,1.0,0.0) * matrix;
|
||||
osg::Vec3d v110 = osg::Vec3d(1.0,1.0,0.0) * matrix;
|
||||
|
||||
|
||||
osg::Vec3d v001 = osg::Vec3d(0.0,0.0,1.0) * matrix;
|
||||
osg::Vec3d v101 = osg::Vec3d(1.0,0.0,1.0) * matrix;
|
||||
osg::Vec3d v011 = osg::Vec3d(0.0,1.0,1.0) * matrix;
|
||||
osg::Vec3d v111 = osg::Vec3d(1.0,1.0,1.0) * matrix;
|
||||
|
||||
|
||||
double cubeSize = (v111-v000).length();
|
||||
osg::Vec3d center = (v000+v111)*0.5;
|
||||
|
||||
@@ -185,15 +185,15 @@ void FixedFunctionTechnique::init()
|
||||
|
||||
osg::TexGenNode* texgenNode_0 = new osg::TexGenNode;
|
||||
texgenNode_0->addChild(clipnode);
|
||||
texgenNode_0->setTextureUnit(0);
|
||||
texgenNode_0->getTexGen()->setMode(osg::TexGen::EYE_LINEAR);
|
||||
texgenNode_0->getTexGen()->setPlanesFromMatrix(osg::Matrix::inverse(matrix));
|
||||
texgenNode_0->setTextureUnit(0);
|
||||
texgenNode_0->getTexGen()->setMode(osg::TexGen::EYE_LINEAR);
|
||||
texgenNode_0->getTexGen()->setPlanesFromMatrix(osg::Matrix::inverse(matrix));
|
||||
|
||||
osg::StateSet* stateset = texgenNode_0->getOrCreateStateSet();
|
||||
|
||||
stateset->setMode(GL_LIGHTING,osg::StateAttribute::ON);
|
||||
stateset->setMode(GL_BLEND,osg::StateAttribute::ON);
|
||||
|
||||
|
||||
if (cpv._afProperty.valid())
|
||||
{
|
||||
stateset->setAttributeAndModes(cpv._afProperty->getAlphaFunc(), osg::StateAttribute::ON);
|
||||
@@ -202,11 +202,11 @@ void FixedFunctionTechnique::init()
|
||||
{
|
||||
stateset->setAttributeAndModes(new osg::AlphaFunc(osg::AlphaFunc::GREATER,alphaFuncValue), osg::StateAttribute::ON);
|
||||
}
|
||||
|
||||
|
||||
osg::Material* material = new osg::Material;
|
||||
material->setDiffuse(osg::Material::FRONT_AND_BACK,osg::Vec4(1.0f,1.0f,1.0f,1.0f));
|
||||
stateset->setAttributeAndModes(material);
|
||||
|
||||
|
||||
if (cpv._mipProperty.valid())
|
||||
{
|
||||
stateset->setAttribute(new osg::BlendFunc(osg::BlendFunc::ONE, osg::BlendFunc::ONE));
|
||||
@@ -225,7 +225,7 @@ void FixedFunctionTechnique::init()
|
||||
texture3D->setWrap(osg::Texture3D::WRAP_R,osg::Texture3D::CLAMP_TO_EDGE);
|
||||
texture3D->setWrap(osg::Texture3D::WRAP_S,osg::Texture3D::CLAMP_TO_EDGE);
|
||||
texture3D->setWrap(osg::Texture3D::WRAP_T,osg::Texture3D::CLAMP_TO_EDGE);
|
||||
if (image_3d->getPixelFormat()==GL_ALPHA ||
|
||||
if (image_3d->getPixelFormat()==GL_ALPHA ||
|
||||
image_3d->getPixelFormat()==GL_LUMINANCE)
|
||||
{
|
||||
texture3D->setInternalFormatMode(osg::Texture3D::USE_USER_DEFINED_FORMAT);
|
||||
@@ -245,7 +245,7 @@ void FixedFunctionTechnique::init()
|
||||
stateset->setTextureMode(0,GL_TEXTURE_GEN_R,osg::StateAttribute::ON);
|
||||
|
||||
stateset->setTextureAttributeAndModes(0,new osg::TexEnv(),osg::StateAttribute::ON);
|
||||
|
||||
|
||||
_node = texgenNode_0;
|
||||
}
|
||||
|
||||
@@ -256,7 +256,7 @@ void FixedFunctionTechnique::update(osgUtil::UpdateVisitor* uv)
|
||||
|
||||
void FixedFunctionTechnique::cull(osgUtil::CullVisitor* cv)
|
||||
{
|
||||
//OSG_NOTICE<<"FixedFunctionTechnique::cull(osgUtil::CullVisitor* nv)"<<std::endl;
|
||||
//OSG_NOTICE<<"FixedFunctionTechnique::cull(osgUtil::CullVisitor* nv)"<<std::endl;
|
||||
if (_node.valid())
|
||||
{
|
||||
_node->accept(*cv);
|
||||
@@ -283,8 +283,8 @@ void FixedFunctionTechnique::traverse(osg::NodeVisitor& nv)
|
||||
{
|
||||
update(uv);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else if (nv.getVisitorType()==osg::NodeVisitor::CULL_VISITOR)
|
||||
{
|
||||
@@ -297,10 +297,10 @@ void FixedFunctionTechnique::traverse(osg::NodeVisitor& nv)
|
||||
}
|
||||
|
||||
|
||||
if (_volumeTile->getDirty())
|
||||
if (_volumeTile->getDirty())
|
||||
{
|
||||
OSG_INFO<<"******* Doing init ***********"<<std::endl;
|
||||
_volumeTile->init();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
@@ -24,7 +24,7 @@ void Locator::setTransformAsExtents(double minX, double minY, double maxX, doubl
|
||||
_transform.set(maxX-minX, 0.0, 0.0, 0.0,
|
||||
0.0, maxY-minY, 0.0, 0.0,
|
||||
0.0, 0.0, maxZ-minZ, 0.0,
|
||||
minX, minY, minZ, 1.0);
|
||||
minX, minY, minZ, 1.0);
|
||||
|
||||
_inverse.invert(_transform);
|
||||
|
||||
@@ -103,7 +103,7 @@ bool Locator::computeLocalBounds(Locator& source, osg::Vec3d& bottomLeft, osg::V
|
||||
topRight.y() = osg::maximum( topRight.y(), itr->y());
|
||||
topRight.z() = osg::maximum( topRight.z(), itr->z());
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ bool Locator::computeLocalBounds(osg::Vec3d& bottomLeft, osg::Vec3d& topRight) c
|
||||
topRight.y() = osg::maximum( topRight.y(), itr->y());
|
||||
topRight.z() = osg::maximum( topRight.z(), itr->z());
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
@@ -133,7 +133,7 @@ AlphaFuncProperty::AlphaFuncProperty(const AlphaFuncProperty& afp,const osg::Cop
|
||||
|
||||
void AlphaFuncProperty::setValue(float v)
|
||||
{
|
||||
_uniform->set(v);
|
||||
_uniform->set(v);
|
||||
_alphaFunc->setReferenceValue(v);
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ PropertyVisitor::PropertyVisitor(bool traverseOnlyActiveChildren):
|
||||
}
|
||||
|
||||
void PropertyVisitor::apply(CompositeProperty& cp)
|
||||
{
|
||||
{
|
||||
for(unsigned int i=0; i<cp.getNumProperties(); ++i)
|
||||
{
|
||||
cp.getProperty(i)->accept(*this);
|
||||
@@ -226,7 +226,7 @@ void PropertyVisitor::apply(CompositeProperty& cp)
|
||||
}
|
||||
|
||||
void PropertyVisitor::apply(SwitchProperty& sp)
|
||||
{
|
||||
{
|
||||
if (_traverseOnlyActiveChildren)
|
||||
{
|
||||
if (sp.getActiveProperty()>=0 && sp.getActiveProperty()<static_cast<int>(sp.getNumProperties()))
|
||||
@@ -268,12 +268,12 @@ void CollectPropertiesVisitor::apply(TransparencyProperty& tp) { _transparencyPr
|
||||
class CycleSwitchVisitor : public osgVolume::PropertyVisitor
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
CycleSwitchVisitor(int delta):
|
||||
PropertyVisitor(false),
|
||||
_delta(delta),
|
||||
_switchModified(true) {}
|
||||
|
||||
|
||||
virtual void apply(SwitchProperty& sp)
|
||||
{
|
||||
if (sp.getNumProperties()>=2)
|
||||
@@ -289,7 +289,7 @@ class CycleSwitchVisitor : public osgVolume::PropertyVisitor
|
||||
{
|
||||
sp.setActiveProperty(0);
|
||||
}
|
||||
|
||||
|
||||
_switchModified = true;
|
||||
}
|
||||
else // _delta<0
|
||||
@@ -307,10 +307,10 @@ class CycleSwitchVisitor : public osgVolume::PropertyVisitor
|
||||
_switchModified = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PropertyVisitor::apply(sp);
|
||||
}
|
||||
|
||||
|
||||
int _delta;
|
||||
bool _switchModified;
|
||||
};
|
||||
@@ -354,7 +354,7 @@ bool PropertyAdjustmentCallback::handle(const osgGA::GUIEventAdapter& ea,osgGA::
|
||||
property->accept(cpv);
|
||||
|
||||
bool passOnUpdates = false;
|
||||
|
||||
|
||||
switch(ea.getEventType())
|
||||
{
|
||||
case(osgGA::GUIEventAdapter::MOVE):
|
||||
@@ -394,7 +394,7 @@ bool PropertyAdjustmentCallback::handle(const osgGA::GUIEventAdapter& ea,osgGA::
|
||||
{
|
||||
float v = (ea.getY()-ea.getYmin())/(ea.getYmax()-ea.getYmin());
|
||||
if (ea.getMouseYOrientation()==osgGA::GUIEventAdapter::Y_INCREASING_DOWNWARDS) v = 1.0f-v;
|
||||
|
||||
|
||||
float v2 = v*v;
|
||||
float v4 = v2*v2;
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
@@ -229,7 +229,7 @@ void RayTracedTechnique::init()
|
||||
texture3D->setWrap(osg::Texture3D::WRAP_S,osg::Texture3D::CLAMP_TO_BORDER);
|
||||
texture3D->setWrap(osg::Texture3D::WRAP_T,osg::Texture3D::CLAMP_TO_BORDER);
|
||||
texture3D->setBorderColor(osg::Vec4(0.0,0.0,0.0,0.0));
|
||||
if (image_3d->getPixelFormat()==GL_ALPHA ||
|
||||
if (image_3d->getPixelFormat()==GL_ALPHA ||
|
||||
image_3d->getPixelFormat()==GL_LUMINANCE)
|
||||
{
|
||||
texture3D->setInternalFormatMode(osg::Texture3D::USE_USER_DEFINED_FORMAT);
|
||||
@@ -303,7 +303,7 @@ void RayTracedTechnique::init()
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
osg::Shader* fragmentShader = osgDB::readShaderFile(osg::Shader::FRAGMENT, "shaders/volume_mip.frag");
|
||||
if (fragmentShader)
|
||||
{
|
||||
@@ -337,12 +337,12 @@ void RayTracedTechnique::init()
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
osg::Shader* fragmentShader = osgDB::readShaderFile(osg::Shader::FRAGMENT, "shaders/volume_iso.frag");
|
||||
if (fragmentShader)
|
||||
{
|
||||
OSG_INFO<<"Shader found"<<std::endl;
|
||||
|
||||
|
||||
program->addShader(fragmentShader);
|
||||
}
|
||||
else
|
||||
@@ -353,7 +353,7 @@ void RayTracedTechnique::init()
|
||||
program->addShader(new osg::Shader(osg::Shader::FRAGMENT, volume_iso_frag));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (shadingModel==Light)
|
||||
{
|
||||
enableBlending = true;
|
||||
@@ -373,7 +373,7 @@ void RayTracedTechnique::init()
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
osg::Shader* fragmentShader = osgDB::readShaderFile(osg::Shader::FRAGMENT, "shaders/volume_lit.frag");
|
||||
if (fragmentShader)
|
||||
{
|
||||
@@ -489,7 +489,7 @@ void RayTracedTechnique::init()
|
||||
drawElements->push_back(1);
|
||||
drawElements->push_back(2);
|
||||
drawElements->push_back(3);
|
||||
|
||||
|
||||
// bottom
|
||||
drawElements->push_back(3);
|
||||
drawElements->push_back(2);
|
||||
@@ -524,7 +524,7 @@ void RayTracedTechnique::init()
|
||||
|
||||
geode->addDrawable(geom);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (cpv._sampleDensityWhenMovingProperty.valid())
|
||||
{
|
||||
@@ -599,8 +599,8 @@ void RayTracedTechnique::traverse(osg::NodeVisitor& nv)
|
||||
{
|
||||
update(uv);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else if (nv.getVisitorType()==osg::NodeVisitor::CULL_VISITOR)
|
||||
{
|
||||
@@ -613,12 +613,12 @@ void RayTracedTechnique::traverse(osg::NodeVisitor& nv)
|
||||
}
|
||||
|
||||
|
||||
if (_volumeTile->getDirty())
|
||||
if (_volumeTile->getDirty())
|
||||
{
|
||||
OSG_INFO<<"******* Doing init ***********"<<std::endl;
|
||||
_volumeTile->init();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // end of osgVolume namespace
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
@@ -36,7 +36,7 @@ Volume::~Volume()
|
||||
{
|
||||
const_cast<VolumeTile*>(*itr)->_volume = 0;
|
||||
}
|
||||
|
||||
|
||||
_volumeTileSet.clear();
|
||||
_volumeTileMap.clear();
|
||||
}
|
||||
@@ -52,7 +52,7 @@ VolumeTile* Volume::getVolumeTile(const TileID& tileID)
|
||||
|
||||
VolumeTileMap::iterator itr = _volumeTileMap.find(tileID);
|
||||
if (itr != _volumeTileMap.end()) return 0;
|
||||
|
||||
|
||||
return itr->second;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ const VolumeTile* Volume::getVolumeTile(const TileID& tileID) const
|
||||
|
||||
VolumeTileMap::const_iterator itr = _volumeTileMap.find(tileID);
|
||||
if (itr != _volumeTileMap.end()) return 0;
|
||||
|
||||
|
||||
return itr->second;
|
||||
}
|
||||
|
||||
@@ -84,12 +84,12 @@ void Volume::registerVolumeTile(VolumeTile* volumeTile)
|
||||
if (!volumeTile) return;
|
||||
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
|
||||
|
||||
|
||||
if (volumeTile->getTileID().valid())
|
||||
{
|
||||
_volumeTileMap[volumeTile->getTileID()] = volumeTile;
|
||||
}
|
||||
|
||||
|
||||
_volumeTileSet.insert(volumeTile);
|
||||
|
||||
if (_volumeTileSet.size() > s_maxNumVolumeTiles) s_maxNumVolumeTiles = _volumeTileSet.size();
|
||||
@@ -107,7 +107,7 @@ void Volume::unregisterVolumeTile(VolumeTile* volumeTile)
|
||||
{
|
||||
_volumeTileMap.erase(volumeTile->getTileID());
|
||||
}
|
||||
|
||||
|
||||
_volumeTileSet.erase(volumeTile);
|
||||
|
||||
// OSG_NOTICE<<"Volume::unregisterVolumeTile "<<volumeTile<<" total number of VolumeTile "<<_volumeTileSet.size()<<" max = "<<s_maxNumVolumeTiles<<std::endl;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
@@ -68,8 +68,8 @@ void VolumeTechnique::traverse(osg::NodeVisitor& nv)
|
||||
{
|
||||
update(uv);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else if (nv.getVisitorType()==osg::NodeVisitor::CULL_VISITOR)
|
||||
{
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
@@ -60,7 +60,7 @@ VolumeTile::VolumeTile(const VolumeTile& volumeTile,const osg::CopyOp& copyop):
|
||||
_hasBeenTraversal(false),
|
||||
_layer(volumeTile._layer)
|
||||
{
|
||||
setNumChildrenRequiringUpdateTraversal(getNumChildrenRequiringUpdateTraversal()+1);
|
||||
setNumChildrenRequiringUpdateTraversal(getNumChildrenRequiringUpdateTraversal()+1);
|
||||
|
||||
if (volumeTile.getVolumeTechnique())
|
||||
{
|
||||
@@ -72,13 +72,13 @@ VolumeTile::~VolumeTile()
|
||||
{
|
||||
if (_volume) setVolume(0);
|
||||
}
|
||||
|
||||
|
||||
void VolumeTile::setVolume(Volume* volume)
|
||||
{
|
||||
if (_volume == volume) return;
|
||||
|
||||
|
||||
if (_volume) _volume->unregisterVolumeTile(this);
|
||||
|
||||
|
||||
_volume = volume;
|
||||
|
||||
if (_volume) _volume->registerVolumeTile(this);
|
||||
@@ -110,18 +110,18 @@ void VolumeTile::traverse(osg::NodeVisitor& nv)
|
||||
++itr)
|
||||
{
|
||||
osgVolume::Volume* volume = dynamic_cast<Volume*>(*itr);
|
||||
if (volume)
|
||||
if (volume)
|
||||
{
|
||||
OSG_INFO<<"Assigning volume system "<<volume<<std::endl;
|
||||
OSG_INFO<<"Assigning volume system "<<volume<<std::endl;
|
||||
setVolume(volume);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_hasBeenTraversal = true;
|
||||
}
|
||||
|
||||
|
||||
if (nv.getVisitorType()==osg::NodeVisitor::UPDATE_VISITOR &&
|
||||
_layer->requiresUpdateTraversal())
|
||||
{
|
||||
@@ -143,9 +143,9 @@ void VolumeTile::init()
|
||||
if (_volumeTechnique.valid() && getDirty())
|
||||
{
|
||||
_volumeTechnique->init();
|
||||
|
||||
|
||||
setDirty(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VolumeTile::setLayer(Layer* layer)
|
||||
@@ -155,23 +155,23 @@ void VolumeTile::setLayer(Layer* layer)
|
||||
|
||||
void VolumeTile::setVolumeTechnique(VolumeTechnique* volumeTechnique)
|
||||
{
|
||||
if (_volumeTechnique == volumeTechnique) return;
|
||||
if (_volumeTechnique == volumeTechnique) return;
|
||||
|
||||
int dirtyDelta = _dirty ? -1 : 0;
|
||||
|
||||
if (_volumeTechnique.valid())
|
||||
if (_volumeTechnique.valid())
|
||||
{
|
||||
_volumeTechnique->_volumeTile = 0;
|
||||
}
|
||||
|
||||
_volumeTechnique = volumeTechnique;
|
||||
|
||||
if (_volumeTechnique.valid())
|
||||
|
||||
if (_volumeTechnique.valid())
|
||||
{
|
||||
_volumeTechnique->_volumeTile = this;
|
||||
++dirtyDelta;
|
||||
++dirtyDelta;
|
||||
}
|
||||
|
||||
|
||||
if (dirtyDelta>0) setDirty(true);
|
||||
else if (dirtyDelta<0) setDirty(false);
|
||||
}
|
||||
@@ -186,7 +186,7 @@ void VolumeTile::setDirty(bool dirty)
|
||||
{
|
||||
setNumChildrenRequiringUpdateTraversal(getNumChildrenRequiringUpdateTraversal()+1);
|
||||
}
|
||||
else if (getNumChildrenRequiringUpdateTraversal()>0)
|
||||
else if (getNumChildrenRequiringUpdateTraversal()>0)
|
||||
{
|
||||
setNumChildrenRequiringUpdateTraversal(getNumChildrenRequiringUpdateTraversal()-1);
|
||||
}
|
||||
@@ -195,7 +195,7 @@ void VolumeTile::setDirty(bool dirty)
|
||||
osg::BoundingSphere VolumeTile::computeBound() const
|
||||
{
|
||||
const Locator* masterLocator = getLocator();
|
||||
if (_layer.valid() && !masterLocator)
|
||||
if (_layer.valid() && !masterLocator)
|
||||
{
|
||||
masterLocator = _layer->getLocator();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user