Ran script to remove trailing spaces and tabs

This commit is contained in:
Robert Osfield
2012-03-21 17:36:20 +00:00
parent 1e35f8975d
commit 14a563dc9f
1495 changed files with 21873 additions and 21873 deletions

View File

@@ -32,8 +32,8 @@ bool AnimationPath_readLocalData(osg::Object &obj, osgDB::Input &fr)
{
osg::AnimationPath *ap = dynamic_cast<osg::AnimationPath*>(&obj);
if (!ap) return false;
bool itAdvanced = false;
if (fr[0].matchWord("LoopMode"))
@@ -42,20 +42,20 @@ bool AnimationPath_readLocalData(osg::Object &obj, osgDB::Input &fr)
{
ap->setLoopMode(AnimationPath::SWING);
fr += 2;
itAdvanced = true;
itAdvanced = true;
}
else if (fr[1].matchWord("LOOP"))
{
ap->setLoopMode(AnimationPath::LOOP);
fr += 2;
itAdvanced = true;
}
itAdvanced = true;
}
else if (fr[1].matchWord("NO_LOOPING"))
{
ap->setLoopMode(AnimationPath::NO_LOOPING);
fr += 2;
itAdvanced = true;
}
itAdvanced = true;
}
}
@@ -65,24 +65,24 @@ bool AnimationPath_readLocalData(osg::Object &obj, osgDB::Input &fr)
int entry = fr[0].getNoNestedBrackets();
fr += 2;
double time;
Vec3d position,scale;
Quat rotation;
while (!fr.eof() && fr[0].getNoNestedBrackets()>entry)
{
if (fr[0].getFloat(time) &&
fr[1].getFloat(position[0]) &&
fr[2].getFloat(position[1]) &&
fr[1].getFloat(position[0]) &&
fr[2].getFloat(position[1]) &&
fr[3].getFloat(position[2]) &&
fr[4].getFloat(rotation[0]) &&
fr[5].getFloat(rotation[1]) &&
fr[4].getFloat(rotation[0]) &&
fr[5].getFloat(rotation[1]) &&
fr[6].getFloat(rotation[2]) &&
fr[7].getFloat(rotation[3]) &&
fr[8].getFloat(scale[0]) &&
fr[9].getFloat(scale[1]) &&
fr[8].getFloat(scale[0]) &&
fr[9].getFloat(scale[1]) &&
fr[10].getFloat(scale[2]))
{
@@ -90,8 +90,8 @@ bool AnimationPath_readLocalData(osg::Object &obj, osgDB::Input &fr)
osg::AnimationPath::ControlPoint ctrlPoint(position,rotation,scale);
ap->insert(time, ctrlPoint);
fr+=11;
}
fr+=11;
}
else fr.advanceOverCurrentFieldOrBlock();
}
@@ -99,7 +99,7 @@ bool AnimationPath_readLocalData(osg::Object &obj, osgDB::Input &fr)
itAdvanced = true;
}
return itAdvanced;
}
@@ -132,7 +132,7 @@ bool AnimationPath_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
fw.precision(15);
for (AnimationPath::TimeControlPointMap::const_iterator itr=tcpm.begin();
itr!=tcpm.end();
itr!=tcpm.end();
++itr)
{
fw.indent() << itr->first << " " << itr->second.getPosition() << " " << itr->second.getRotation() << " " <<itr->second.getScale() << std::endl;
@@ -170,27 +170,27 @@ bool AnimationPathCallback_readLocalData(osg::Object &obj, osgDB::Input &fr)
if (!apc) return false;
bool iteratorAdvanced = false;
if (fr.matchSequence("pivotPoint %f %f %f"))
{
osg::Vec3 pivot;
fr[1].getFloat(pivot[0]);
fr[2].getFloat(pivot[1]);
fr[3].getFloat(pivot[2]);
apc->setPivotPoint(pivot);
fr += 4;
iteratorAdvanced = true;
}
if (fr.matchSequence("timeOffset %f"))
{
fr[1].getFloat(apc->_timeOffset);
fr+=2;
iteratorAdvanced = true;
}
else if(fr.matchSequence("timeMultiplier %f"))
{
fr[1].getFloat(apc->_timeMultiplier);
@@ -206,7 +206,7 @@ bool AnimationPathCallback_readLocalData(osg::Object &obj, osgDB::Input &fr)
if (animpath) apc->setAnimationPath(animpath);
iteratorAdvanced = true;
}
return iteratorAdvanced;
}

View File

@@ -35,7 +35,7 @@ bool AutoTransform_readLocalData(Object& obj, Input& fr)
fr[1].getFloat(pos[0]);
fr[2].getFloat(pos[1]);
fr[3].getFloat(pos[2]);
transform.setPosition(pos);
fr += 4;
@@ -49,9 +49,9 @@ bool AutoTransform_readLocalData(Object& obj, Input& fr)
fr[2].getFloat(att[1]);
fr[3].getFloat(att[2]);
fr[4].getFloat(att[3]);
transform.setRotation(att);
fr += 5;
iteratorAdvanced = true;
}
@@ -62,7 +62,7 @@ bool AutoTransform_readLocalData(Object& obj, Input& fr)
fr[1].getFloat(scale[0]);
fr[2].getFloat(scale[1]);
fr[3].getFloat(scale[2]);
transform.setScale(scale);
fr += 4;
@@ -73,7 +73,7 @@ bool AutoTransform_readLocalData(Object& obj, Input& fr)
{
float scale;
fr[1].getFloat(scale);
transform.setMinimumScale(scale);
fr += 2;
@@ -84,7 +84,7 @@ bool AutoTransform_readLocalData(Object& obj, Input& fr)
{
float scale;
fr[1].getFloat(scale);
transform.setMaximumScale(scale);
fr += 2;
@@ -97,9 +97,9 @@ bool AutoTransform_readLocalData(Object& obj, Input& fr)
fr[1].getFloat(pivot[0]);
fr[2].getFloat(pivot[1]);
fr[3].getFloat(pivot[2]);
transform.setPivotPoint(pivot);
fr += 4;
iteratorAdvanced = true;
}
@@ -127,7 +127,7 @@ bool AutoTransform_readLocalData(Object& obj, Input& fr)
if (w=="ROTATE_TO_SCREEN") transform.setAutoRotateMode(osg::AutoTransform::ROTATE_TO_SCREEN);
else if (w=="ROTATE_TO_CAMERA") transform.setAutoRotateMode(osg::AutoTransform::ROTATE_TO_CAMERA);
else if (w=="NO_ROTATION") transform.setAutoRotateMode(osg::AutoTransform::NO_ROTATION);
fr += 2;
iteratorAdvanced = true;
}
@@ -140,12 +140,12 @@ bool AutoTransform_readLocalData(Object& obj, Input& fr)
iteratorAdvanced = true;
}
if (fr.matchSequence("autoScaleTransistionWidthRatio %f") ||
if (fr.matchSequence("autoScaleTransistionWidthRatio %f") ||
fr.matchSequence("autoScaleTransitionWidthRatio %f"))
{
float ratio;
fr[1].getFloat(ratio);
transform.setAutoScaleTransitionWidthRatio(ratio);
fr += 2;
@@ -167,8 +167,8 @@ bool AutoTransform_writeLocalData(const Object& obj, Output& fw)
if (transform.getMinimumScale()>0.0) fw.indent()<<"minimumScale "<<transform.getMinimumScale()<<std::endl;
if (transform.getMaximumScale()<FLT_MAX) fw.indent()<<"maximumScale "<<transform.getMaximumScale()<<std::endl;
fw.indent()<<"pivotPoint "<<transform.getPivotPoint()<<std::endl;
fw.indent()<<"autoUpdateEyeMovementTolerance "<<transform.getAutoUpdateEyeMovementTolerance()<<std::endl;
fw.indent()<<"autoRotateMode ";
@@ -181,11 +181,11 @@ bool AutoTransform_writeLocalData(const Object& obj, Output& fw)
}
fw.indent()<<"autoScaleToScreen "<<(transform.getAutoScaleToScreen()?"TRUE":"FALSE")<<std::endl;
if (transform.getAutoScaleTransitionWidthRatio()!=0.25)
if (transform.getAutoScaleTransitionWidthRatio()!=0.25)
{
fw.indent()<<"autoScaleTransitionWidthRatio "<<transform.getAutoScaleTransitionWidthRatio()<<std::endl;
}
return true;
}

View File

@@ -82,7 +82,7 @@ bool Billboard_readLocalData(Object& obj, Input& fr)
Billboard::PositionList& positionList = billboard.getPositionList();
positionList.clear();
if (matchFirst)
{
fr += 2;

View File

@@ -60,7 +60,7 @@ bool Camera_readLocalData(Object& obj, Input& fr)
fr +=5 ;
iteratorAdvanced = true;
};
if (fr.matchSequence("clearMask %i"))
{
unsigned int value;
@@ -94,7 +94,7 @@ bool Camera_readLocalData(Object& obj, Input& fr)
iteratorAdvanced = true;
}
Matrix matrix;
Matrix matrix;
if (readMatrix(matrix,fr,"ProjectionMatrix"))
{
camera.setProjectionMatrix(matrix);
@@ -148,7 +148,7 @@ bool Camera_readLocalData(Object& obj, Input& fr)
fr += 2;
iteratorAdvanced = true;
}
if (fr.matchSequence("bufferComponent %w {"))
{
@@ -156,17 +156,17 @@ bool Camera_readLocalData(Object& obj, Input& fr)
Camera::BufferComponent buffer;
Camera_matchBufferComponentStr(fr[1].getStr(),buffer);
fr += 3;
Camera::Attachment& attachment = camera.getBufferAttachmentMap()[buffer];
// read attachment data.
while (!fr.eof() && fr[0].getNoNestedBrackets()>entry)
{
bool localAdvance = false;
if (fr.matchSequence("internalFormat %i"))
if (fr.matchSequence("internalFormat %i"))
{
// In their infinite wisdom, the Apple engineers changed the type
// of GLenum from 'unsigned int' to 'unsigned long', thus breaking
@@ -190,31 +190,31 @@ bool Camera_readLocalData(Object& obj, Input& fr)
osg::Image* image = dynamic_cast<osg::Image*>(attribute.get());
attachment._image = image;
}
}
if (fr.matchSequence("level %i"))
if (fr.matchSequence("level %i"))
{
fr[1].getUInt(attachment._level);
fr += 2;
localAdvance = true;
}
if (fr.matchSequence("face %i"))
if (fr.matchSequence("face %i"))
{
fr[1].getUInt(attachment._face);
fr += 2;
localAdvance = true;
}
if (fr.matchSequence("mipMapGeneration TRUE"))
if (fr.matchSequence("mipMapGeneration TRUE"))
{
attachment._mipMapGeneration = true;
fr += 2;
localAdvance = true;
}
if (fr.matchSequence("mipMapGeneration FALSE"))
if (fr.matchSequence("mipMapGeneration FALSE"))
{
attachment._mipMapGeneration = false;
fr += 2;
@@ -223,7 +223,7 @@ bool Camera_readLocalData(Object& obj, Input& fr)
if (!localAdvance) ++fr;
}
iteratorAdvanced = true;
}

View File

@@ -36,7 +36,7 @@ bool CameraView_readLocalData(Object& obj, Input& fr)
fr[1].getFloat(pos[0]);
fr[2].getFloat(pos[1]);
fr[3].getFloat(pos[2]);
cameraview.setPosition(pos);
fr += 4;
@@ -50,9 +50,9 @@ bool CameraView_readLocalData(Object& obj, Input& fr)
fr[2].getFloat(att[1]);
fr[3].getFloat(att[2]);
fr[4].getFloat(att[3]);
cameraview.setAttitude(att);
fr += 5;
iteratorAdvanced = true;
}
@@ -96,10 +96,10 @@ bool CameraView_readLocalData(Object& obj, Input& fr)
bool CameraView_writeLocalData(const Object& obj, Output& fw)
{
const CameraView& cameraview = static_cast<const CameraView&>(obj);
fw.indent()<<"position "<<cameraview.getPosition()<<std::endl;
fw.indent()<<"attitude "<<cameraview.getAttitude()<<std::endl;
fw.indent()<<"fieldOfView "<<cameraview.getFieldOfView()<<std::endl;
fw.indent()<<"fieldOfViewMode ";
switch(cameraview.getFieldOfViewMode())
@@ -108,7 +108,7 @@ bool CameraView_writeLocalData(const Object& obj, Output& fw)
case(osg::CameraView::HORIZONTAL): fw <<"HORIZONTAL"<<std::endl; break;
case(osg::CameraView::VERTICAL): fw <<"VERTICAL"<<std::endl; break;
}
fw.indent()<<"focalLength "<<cameraview.getFocalLength()<<std::endl;
return true;

View File

@@ -42,7 +42,7 @@ bool Capsule_readLocalData(Object& obj, Input& fr)
fr+=4;
iteratorAdvanced = true;
}
if (fr.matchSequence("Radius %f"))
{
float radius;

View File

@@ -55,8 +55,8 @@ bool ClearNode_readLocalData(Object& obj, Input& fr)
}
osg::Vec4 vec4(0.0f,0.0f,0.0f,1.0f);
if (fr[0].matchWord("clearColor") &&
if (fr[0].matchWord("clearColor") &&
fr[1].getFloat(vec4[0]) &&
fr[2].getFloat(vec4[1]) &&
fr[3].getFloat(vec4[2]) &&
@@ -96,7 +96,7 @@ bool ClearNode_writeLocalData(const Object& obj, Output& fw)
{
fw<<"FALSE"<< std::endl;
}
fw.indent() << "clearColor "<<es.getClearColor()<< std::endl;
fw.indent() << "clearMask "<<static_cast<unsigned int>(es.getClearMask())<< std::endl;

View File

@@ -23,13 +23,13 @@ REGISTER_DOTOSGWRAPPER(ClusterCullingCallback)
bool ClusterCullingCallback_readLocalData(osg::Object &obj, osgDB::Input &fr)
{
ClusterCullingCallback* ccc = dynamic_cast<ClusterCullingCallback*>(&obj);
if (!ccc) return false;
if (!ccc) return false;
bool iteratorAdvanced = false;
osg::Vec3 vec;
if (fr[0].matchWord("controlPoint") &&
fr[1].getFloat(vec[0]) && fr[2].getFloat(vec[1]) && fr[3].getFloat(vec[2]))
fr[1].getFloat(vec[0]) && fr[2].getFloat(vec[1]) && fr[3].getFloat(vec[2]))
{
ccc->setControlPoint(vec);
fr += 4;
@@ -37,7 +37,7 @@ bool ClusterCullingCallback_readLocalData(osg::Object &obj, osgDB::Input &fr)
}
if (fr[0].matchWord("normal") &&
fr[1].getFloat(vec[0]) && fr[2].getFloat(vec[1]) && fr[3].getFloat(vec[2]))
fr[1].getFloat(vec[0]) && fr[2].getFloat(vec[1]) && fr[3].getFloat(vec[2]))
{
ccc->setNormal(vec);
fr += 4;
@@ -45,14 +45,14 @@ bool ClusterCullingCallback_readLocalData(osg::Object &obj, osgDB::Input &fr)
}
float value;
if (fr[0].matchWord("radius") && fr[1].getFloat(value))
if (fr[0].matchWord("radius") && fr[1].getFloat(value))
{
ccc->setRadius(value);
fr += 2;
iteratorAdvanced = true;
}
if (fr[0].matchWord("deviation") && fr[1].getFloat(value))
if (fr[0].matchWord("deviation") && fr[1].getFloat(value))
{
ccc->setDeviation(value);
fr += 2;
@@ -65,7 +65,7 @@ bool ClusterCullingCallback_readLocalData(osg::Object &obj, osgDB::Input &fr)
bool ClusterCullingCallback_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
{
const ClusterCullingCallback* ccc = dynamic_cast<const ClusterCullingCallback*>(&obj);
if (!ccc) return false;
if (!ccc) return false;
int prec = fw.precision();
fw.precision(15);
@@ -74,7 +74,7 @@ bool ClusterCullingCallback_writeLocalData(const osg::Object &obj, osgDB::Output
fw.indent() << "normal " << ccc->getNormal() << std::endl;
fw.indent() << "radius " << ccc->getRadius() << std::endl;
fw.indent() << "deviation " << ccc->getDeviation() << std::endl;
fw.precision(prec);
return true;

View File

@@ -44,14 +44,14 @@ bool CompositeShape_readLocalData(Object& obj, Input& fr)
iteratorAdvanced = true;
}
}
while((readObject=fr.readObjectOfType(type_wrapper<osg::Shape>())).valid())
{
osg::Shape* shape = static_cast<osg::Shape*>(readObject.get());
composite.addChild(shape);
iteratorAdvanced = true;
}
return iteratorAdvanced;
}
@@ -64,7 +64,7 @@ bool CompositeShape_writeLocalData(const Object& obj, Output& fw)
fw.indent() << "Shape ";
fw.writeObject(*composite.getShape());
}
for(unsigned int i=0;i<composite.getNumChildren();++i)
{
fw.writeObject(*composite.getChild(i));

View File

@@ -42,7 +42,7 @@ bool Cone_readLocalData(Object& obj, Input& fr)
fr+=4;
iteratorAdvanced = true;
}
if (fr.matchSequence("Radius %f"))
{
float radius;

View File

@@ -52,9 +52,9 @@ bool ConvexPlanarOccluder_readLocalData(Object& obj, Input& fr)
{
int capacity;
fr[1].getInt(capacity);
vertexList.reserve(capacity);
fr += 3;
}
@@ -81,7 +81,7 @@ bool ConvexPlanarOccluder_readLocalData(Object& obj, Input& fr)
while ((matchFirst=fr.matchSequence("Hole {")) || fr.matchSequence("Hole %i {"))
{
holeList.push_back(ConvexPlanarPolygon());
ConvexPlanarPolygon& cpp = holeList.back();
ConvexPlanarPolygon::VertexList& vertexList = cpp.getVertexList();
@@ -96,9 +96,9 @@ bool ConvexPlanarOccluder_readLocalData(Object& obj, Input& fr)
{
int capacity;
fr[1].getInt(capacity);
vertexList.reserve(capacity);
fr += 3;
}
@@ -141,11 +141,11 @@ bool ConvexPlanarOccluder_writeLocalData(const Object& obj, Output& fw)
{
fw.indent() << (*itr)[0] << ' ' << (*itr)[1] << ' ' << (*itr)[2] << std::endl;
}
fw.moveOut();
fw.indent()<<"}"<< std::endl;
}
// write out any holes.
const ConvexPlanarOccluder::HoleList& holeList = cpo.getHoleList();
for(ConvexPlanarOccluder::HoleList::const_iterator holeItr=holeList.begin();
@@ -156,18 +156,18 @@ bool ConvexPlanarOccluder_writeLocalData(const Object& obj, Output& fw)
fw.indent() << "Hole " << vertexList.size() << "{"<< std::endl;
fw.moveIn();
for(ConvexPlanarPolygon::VertexList::const_iterator itr=vertexList.begin();
itr!=vertexList.end();
++itr)
{
fw.indent() << (*itr)[0] << ' ' << (*itr)[1] << ' ' << (*itr)[2] << std::endl;
}
fw.moveOut();
fw.indent()<<"}"<< std::endl;
}
return true;
}

View File

@@ -46,7 +46,7 @@ bool CoordinateSystemNode_readLocalData(Object& obj, Input& fr)
}
static ref_ptr<EllipsoidModel> s_ellipsoidModel = new EllipsoidModel;
EllipsoidModel* em = static_cast<EllipsoidModel*>(fr.readObjectOfType(*s_ellipsoidModel));
if (em) csn.setEllipsoidModel(em);
@@ -60,8 +60,8 @@ bool CoordinateSystemNode_writeLocalData(const Object& obj, Output& fw)
fw.indent()<<"Format "<<fw.wrapString(csn.getFormat())<<std::endl;
fw.indent()<<"CoordinateSystem "<<fw.wrapString(csn.getCoordinateSystem())<<std::endl;
if (csn.getEllipsoidModel())
if (csn.getEllipsoidModel())
{
fw.writeObject(*csn.getEllipsoidModel());
}

View File

@@ -42,7 +42,7 @@ bool Cylinder_readLocalData(Object& obj, Input& fr)
fr+=4;
iteratorAdvanced = true;
}
if (fr.matchSequence("Radius %f"))
{
float radius;

View File

@@ -35,7 +35,7 @@ bool Depth_readLocalData(Object& obj, Input& fr)
bool iteratorAdvanced = false;
Depth& depth = static_cast<Depth&>(obj);
Depth::Function func;
if (fr[0].matchWord("function") && Depth_matchFuncStr(fr[1].getStr(),func))
{
@@ -77,11 +77,11 @@ bool Depth_writeLocalData(const Object& obj,Output& fw)
const Depth& depth = static_cast<const Depth&>(obj);
fw.indent() << "function " << Depth_getFuncStr(depth.getFunction()) << std::endl;
fw.indent() << "writeMask ";
if (depth.getWriteMask()) fw << "TRUE" << std::endl;
else fw << "FALSE" << std::endl;
fw.indent() << "range " << depth.getZNear() << " " << depth.getZFar() << std::endl;
return true;

View File

@@ -114,7 +114,7 @@ bool Drawable_readLocalData(Object& obj, Input& fr)
iteratorAdvanced = true;
}
}
if (fr[0].matchWord("useVertexBufferObjects"))
{
if (fr[1].matchWord("TRUE"))
@@ -143,7 +143,7 @@ bool Drawable_writeLocalData(const Object& obj, Output& fw)
{
fw.writeObject(*drawable.getStateSet());
}
if (drawable.getShape())
{
fw.writeObject(*drawable.getShape());
@@ -168,20 +168,20 @@ bool Drawable_writeLocalData(const Object& obj, Output& fw)
{
fw.writeObject(*drawable.getDrawCallback());
}
if (drawable.getInitialBound().valid())
{
const osg::BoundingBox& bb = drawable.getInitialBound();
fw.indent()<<"initialBound "<<bb.xMin()<<" "<<bb.yMin()<<" "<<bb.zMin()<<" "
<<bb.xMax()<<" "<<bb.yMax()<<" "<<bb.zMax()<<std::endl;
}
if (drawable.getComputeBoundingBoxCallback())
{
fw.writeObject(*drawable.getComputeBoundingBoxCallback());
}
if (!drawable.getSupportsDisplayList())
{
@@ -197,6 +197,6 @@ bool Drawable_writeLocalData(const Object& obj, Output& fw)
fw.indent()<<"useVertexBufferObjects ";
if (drawable.getUseVertexBufferObjects()) fw << "TRUE" << std::endl;
else fw << "FALSE" << std::endl;
return true;
}

View File

@@ -96,7 +96,7 @@ bool FragmentProgram_readLocalData(Object& obj, Input& fr)
fragmentProgram.setFragmentProgram( vstream.str() );
}
}
return iteratorAdvanced;
}

View File

@@ -35,7 +35,7 @@ bool Geode_readLocalData(Object& obj, Input& fr)
fr+=2;
iteratorAdvanced = true;
}
Drawable* drawable = NULL;
while((drawable=fr.readDrawable())!=NULL)
{
@@ -52,7 +52,7 @@ bool Geode_writeLocalData(const osg::Object& obj, Output& fw)
const Geode& geode = static_cast<const Geode&>(obj);
fw.indent() << "num_drawables " << geode.getNumDrawables() << std::endl;
for(unsigned int i=0;i<geode.getNumDrawables();++i)
{
fw.writeObject(*geode.getDrawable(i));

View File

@@ -48,13 +48,13 @@ bool Geometry_readLocalData(Object& obj, Input& fr)
int capacity;
fr[1].getInt(capacity);
Geometry::PrimitiveSetList& primitives = geom.getPrimitiveSetList();
if (capacity>0) primitives.reserve(capacity);
fr += 3;
while (!fr.eof() && fr[0].getNoNestedBrackets()>entry)
{
@@ -62,7 +62,7 @@ bool Geometry_readLocalData(Object& obj, Input& fr)
}
++fr;
iteratorAdvanced = true;
}
@@ -114,7 +114,7 @@ bool Geometry_readLocalData(Object& obj, Input& fr)
iteratorAdvanced = true;
}
}
if (fr[0].matchWord("VertexIndices"))
{
++fr;
@@ -291,7 +291,7 @@ bool Geometry_readLocalData(Object& obj, Input& fr)
{
int unit=0;
fr[1].getInt(unit);
fr+=2;
Array* texcoords = Array_readLocalData(fr);
if (texcoords)
@@ -299,14 +299,14 @@ bool Geometry_readLocalData(Object& obj, Input& fr)
geom.setTexCoordArray(unit,texcoords);
}
iteratorAdvanced = true;
}
if (fr.matchSequence("TexCoordIndices %i"))
{
int unit=0;
fr[1].getInt(unit);
fr+=2;
IndexArray* indices = dynamic_cast<IndexArray*>(Array_readLocalData(fr));
if (indices)
@@ -330,12 +330,12 @@ bool Geometry_readLocalData(Object& obj, Input& fr)
{
int unit=0;
fr[1].getInt(unit);
if (fr[2].matchString("TRUE"))
if (fr[2].matchString("TRUE"))
geom.setVertexAttribNormalize(unit,GL_TRUE);
else
geom.setVertexAttribNormalize(unit,GL_FALSE);
fr+=3;
iteratorAdvanced = true;
}
@@ -344,7 +344,7 @@ bool Geometry_readLocalData(Object& obj, Input& fr)
{
int unit=0;
fr[1].getInt(unit);
fr+=2;
Array* vertexattrib = Array_readLocalData(fr);
if (vertexattrib)
@@ -352,14 +352,14 @@ bool Geometry_readLocalData(Object& obj, Input& fr)
geom.setVertexAttribArray(unit,vertexattrib);
}
iteratorAdvanced = true;
}
if (fr.matchSequence("VertexAttribIndices %i"))
{
int unit=0;
fr[1].getInt(unit);
fr+=2;
IndexArray* indices = dynamic_cast<IndexArray*>(Array_readLocalData(fr));
if (indices)
@@ -785,12 +785,12 @@ Array* Array_readLocalData(Input& fr)
++fr;
return_array = array;
}
if (return_array)
if (return_array)
{
if (!uniqueID.empty()) fr.registerUniqueIDForObject(uniqueID.c_str(),return_array);
}
return return_array;
}
@@ -1004,16 +1004,16 @@ bool Primitive_readLocalData(Input& fr,osg::Geometry& geom)
{
bool iteratorAdvanced = false;
bool firstMatched = false;
if ((firstMatched = fr.matchSequence("DrawArrays %w %i %i %i")) ||
if ((firstMatched = fr.matchSequence("DrawArrays %w %i %i %i")) ||
fr.matchSequence("DrawArrays %w %i %i") )
{
GLenum mode;
Geometry_matchPrimitiveModeStr(fr[1].getStr(),mode);
int first;
fr[2].getInt(first);
int count;
fr[3].getInt(count);
@@ -1030,11 +1030,11 @@ bool Primitive_readLocalData(Input& fr,osg::Geometry& geom)
geom.addPrimitiveSet(new DrawArrays(mode, first, count, numInstances));
iteratorAdvanced = true;
}
else if ((firstMatched = fr.matchSequence("DrawArrayLengths %w %i %i %i {")) ||
else if ((firstMatched = fr.matchSequence("DrawArrayLengths %w %i %i %i {")) ||
fr.matchSequence("DrawArrayLengths %w %i %i {") )
{
int entry = fr[1].getNoNestedBrackets();
@@ -1047,7 +1047,7 @@ bool Primitive_readLocalData(Input& fr,osg::Geometry& geom)
int capacity;
fr[3].getInt(capacity);
int numInstances = 0;
if (firstMatched)
{
@@ -1075,12 +1075,12 @@ bool Primitive_readLocalData(Input& fr,osg::Geometry& geom)
}
}
++fr;
geom.addPrimitiveSet(prim);
iteratorAdvanced = true;
}
else if ((firstMatched = fr.matchSequence("DrawElementsUByte %w %i %i {")) ||
else if ((firstMatched = fr.matchSequence("DrawElementsUByte %w %i %i {")) ||
fr.matchSequence("DrawElementsUByte %w %i {"))
{
int entry = fr[1].getNoNestedBrackets();
@@ -1090,7 +1090,7 @@ bool Primitive_readLocalData(Input& fr,osg::Geometry& geom)
int capacity;
fr[2].getInt(capacity);
int numInstances = 0;
if (firstMatched)
{
@@ -1117,12 +1117,12 @@ bool Primitive_readLocalData(Input& fr,osg::Geometry& geom)
}
}
++fr;
geom.addPrimitiveSet(prim);
iteratorAdvanced = true;
}
else if ((firstMatched = fr.matchSequence("DrawElementsUShort %w %i %i {")) ||
else if ((firstMatched = fr.matchSequence("DrawElementsUShort %w %i %i {")) ||
fr.matchSequence("DrawElementsUShort %w %i {"))
{
int entry = fr[1].getNoNestedBrackets();
@@ -1132,7 +1132,7 @@ bool Primitive_readLocalData(Input& fr,osg::Geometry& geom)
int capacity;
fr[2].getInt(capacity);
int numInstances = 0;
if (firstMatched)
{
@@ -1143,7 +1143,7 @@ bool Primitive_readLocalData(Input& fr,osg::Geometry& geom)
{
fr += 4;
}
DrawElementsUShort* prim = new DrawElementsUShort;
prim->setMode(mode);
prim->setNumInstances(numInstances);
@@ -1159,12 +1159,12 @@ bool Primitive_readLocalData(Input& fr,osg::Geometry& geom)
}
}
++fr;
geom.addPrimitiveSet(prim);
iteratorAdvanced = true;
}
else if ((firstMatched = fr.matchSequence("DrawElementsUInt %w %i %i {")) ||
else if ((firstMatched = fr.matchSequence("DrawElementsUInt %w %i %i {")) ||
fr.matchSequence("DrawElementsUInt %w %i {"))
{
int entry = fr[1].getNoNestedBrackets();
@@ -1174,7 +1174,7 @@ bool Primitive_readLocalData(Input& fr,osg::Geometry& geom)
int capacity;
fr[2].getInt(capacity);
int numInstances = 0;
if (firstMatched)
{
@@ -1185,7 +1185,7 @@ bool Primitive_readLocalData(Input& fr,osg::Geometry& geom)
{
fr += 4;
}
DrawElementsUInt* prim = new DrawElementsUInt;
prim->setMode(mode);
prim->setNumInstances(numInstances);
@@ -1201,9 +1201,9 @@ bool Primitive_readLocalData(Input& fr,osg::Geometry& geom)
}
}
++fr;
geom.addPrimitiveSet(prim);
iteratorAdvanced = true;
}
@@ -1298,31 +1298,31 @@ bool Geometry_writeLocalData(const Object& obj, Output& fw)
fw.indent()<<"VertexArray ";
Array_writeLocalData(*geom.getVertexArray(),fw);
}
if (geom.getVertexIndices())
{
fw.indent()<<"VertexIndices ";
Array_writeLocalData(*geom.getVertexIndices(),fw);
Array_writeLocalData(*geom.getVertexIndices(),fw);
}
if (geom.getNormalArray())
{
fw.indent()<<"NormalBinding "<<Geometry_getBindingTypeStr(geom.getNormalBinding())<<std::endl;
// const Vec3Array& normals = *geom.getNormalArray();
// fw.indent()<<"NormalArray "<<normals.size()<<std::endl;
// Array_writeLocalData(fw,normals.begin(),normals.end(),1);
fw.indent()<<"NormalArray ";
Array_writeLocalData(*geom.getNormalArray(),fw);
Array_writeLocalData(*geom.getNormalArray(),fw);
}
if (geom.getNormalIndices())
{
fw.indent()<<"NormalIndices ";
Array_writeLocalData(*geom.getNormalIndices(),fw);
Array_writeLocalData(*geom.getNormalIndices(),fw);
}
if (geom.getColorArray())
@@ -1334,7 +1334,7 @@ bool Geometry_writeLocalData(const Object& obj, Output& fw)
if (geom.getColorIndices())
{
fw.indent()<<"ColorIndices ";
Array_writeLocalData(*geom.getColorIndices(),fw);
Array_writeLocalData(*geom.getColorIndices(),fw);
}
if (geom.getSecondaryColorArray())
@@ -1346,7 +1346,7 @@ bool Geometry_writeLocalData(const Object& obj, Output& fw)
if (geom.getSecondaryColorIndices())
{
fw.indent()<<"SecondayColorIndices ";
Array_writeLocalData(*geom.getSecondaryColorIndices(),fw);
Array_writeLocalData(*geom.getSecondaryColorIndices(),fw);
}
if (geom.getFogCoordArray())
@@ -1358,7 +1358,7 @@ bool Geometry_writeLocalData(const Object& obj, Output& fw)
if (geom.getFogCoordIndices())
{
fw.indent()<<"FogCoordIndices ";
Array_writeLocalData(*geom.getFogCoordIndices(),fw);
Array_writeLocalData(*geom.getFogCoordIndices(),fw);
}
const Geometry::ArrayDataList& tcal=geom.getTexCoordArrayList();
@@ -1376,21 +1376,21 @@ bool Geometry_writeLocalData(const Object& obj, Output& fw)
Array_writeLocalData(*(tcal[i].indices),fw);
}
}
const Geometry::ArrayDataList& vaal=geom.getVertexAttribArrayList();
for(i=0;i<vaal.size();++i)
{
const osg::Geometry::ArrayData& arrayData = vaal[i];
if (arrayData.array.valid())
{
fw.indent()<<"VertexAttribBinding "<<i<<" "<<Geometry_getBindingTypeStr(arrayData.binding)<<std::endl;
if (arrayData.normalize)
fw.indent()<<"VertexAttribNormalize "<<i<<" TRUE"<<std::endl;
else
fw.indent()<<"VertexAttribNormalize "<<i<<" FALSE"<<std::endl;
fw.indent()<<"VertexAttribArray "<<i<<" ";
Array_writeLocalData(*(arrayData.array),fw);
}

View File

@@ -52,7 +52,7 @@ bool HeightField_readLocalData(Object& obj, Input& fr)
heightfield.setOrigin(origin);
fr+=4;
}
if (fr.matchSequence("XInterval %f"))
{
float interval;
@@ -165,14 +165,14 @@ bool HeightField_writeLocalData(const Object& obj, Output& fw)
fw.indent()<<"NumColumnsAndRows "<<heightfield.getNumColumns()<<" "<<heightfield.getNumRows()<<std::endl;
fw.indent()<<"Heights"<<std::endl;
ParameterOutput po(fw);
po.begin();
for(unsigned int row=0;row<heightfield.getNumRows();++row)
{
for(unsigned int column=0;column<heightfield.getNumColumns();++column)
{
po.write(heightfield.getHeight(column,row));
po.write(heightfield.getHeight(column,row));
}
po.newLine();
}

View File

@@ -27,7 +27,7 @@ bool Image_readLocalData(Object& /*obj*/, Input& /*fr*/)
// Image& image = static_cast<Image&>(obj);
// no current image reading code
// no current image reading code
// as it is all handled by osg::Registry::readImage() via plugins.
return iteratorAdvanced;
@@ -38,7 +38,7 @@ bool Image_writeLocalData(const Object& /*obj*/, Output& /*fw*/)
{
// const Image& image = static_cast<const Image&>(obj);
// no current image writing code here
// no current image writing code here
// as it is all handled by osg::Registry::writeImage() via plugins.
return true;

View File

@@ -30,7 +30,7 @@ bool ImageSequence_readLocalData(Object& obj, Input& fr)
std::string modeStr;
if (fr.read("Mode",modeStr))
{
if (modeStr=="PRE_LOAD_ALL_IMAGES")
if (modeStr=="PRE_LOAD_ALL_IMAGES")
{
is.setMode(osg::ImageSequence::PRE_LOAD_ALL_IMAGES);
}
@@ -43,13 +43,13 @@ bool ImageSequence_readLocalData(Object& obj, Input& fr)
is.setMode(osg::ImageSequence::PAGE_AND_DISCARD_USED_IMAGES);
}
}
double length;
if (fr.read("Duration", length) || fr.read("Length", length) )
{
is.setLength(length);
}
if (fr.matchSequence("FileNames {"))
{
fr += 2;
@@ -89,24 +89,24 @@ bool ImageSequence_writeLocalData(const Object& obj, Output& fw)
{
const ImageSequence& is = static_cast<const ImageSequence&>(obj);
// no current image writing code here
// no current image writing code here
// as it is all handled by osg::Registry::writeImage() via plugins.
switch(is.getMode())
{
case(osg::ImageSequence::PRE_LOAD_ALL_IMAGES):
fw.indent()<<"Mode PRE_LOAD_ALL_IMAGES"<<std::endl;
{
case(osg::ImageSequence::PRE_LOAD_ALL_IMAGES):
fw.indent()<<"Mode PRE_LOAD_ALL_IMAGES"<<std::endl;
break;
case(osg::ImageSequence::PAGE_AND_RETAIN_IMAGES):
fw.indent()<<"Mode PAGE_AND_RETAIN_IMAGES"<<std::endl;
fw.indent()<<"Mode PAGE_AND_RETAIN_IMAGES"<<std::endl;
break;
case(osg::ImageSequence::PAGE_AND_DISCARD_USED_IMAGES):
fw.indent()<<"Mode PAGE_AND_DISCARD_USED_IMAGES"<<std::endl;
fw.indent()<<"Mode PAGE_AND_DISCARD_USED_IMAGES"<<std::endl;
break;
}
fw.indent()<<"Length "<<is.getLength()<<std::endl;
if (!is.getFileNames().empty())
{
fw.indent()<<"FileNames {"<<std::endl;
@@ -119,15 +119,15 @@ bool ImageSequence_writeLocalData(const Object& obj, Output& fw)
{
fw.indent()<<fw.wrapString(*itr)<<std::endl;
}
fw.moveOut();
fw.indent()<<"}"<<std::endl;
}
else
else
{
fw.indent()<<"Images {"<<std::endl;
fw.moveIn();
const osg::ImageSequence::Images& images = is.getImages();
for(osg::ImageSequence::Images::const_iterator itr = images.begin();
itr != images.end();
@@ -135,10 +135,10 @@ bool ImageSequence_writeLocalData(const Object& obj, Output& fw)
{
if (!(*itr)->getFileName().empty()) fw.indent()<<fw.wrapString((*itr)->getFileName())<<std::endl;
}
fw.moveOut();
fw.indent()<<"}"<<std::endl;
}
}
return true;
}

View File

@@ -59,8 +59,8 @@ bool LOD_readLocalData(Object& obj, Input& fr)
fr+=2;
iteratorAdvanced = true;
}
// For backwards compatibility with old style LOD's (pre October 2002).
bool matchFirst = false;
@@ -154,10 +154,10 @@ bool LOD_writeLocalData(const Object& obj, Output& fw)
else {
fw.indent() << "RangeMode PIXEL_SIZE_ON_SCREEN"<<std::endl;
}
fw.indent() << "RangeList "<<lod.getNumRanges()<<" {"<< std::endl;
fw.moveIn();
for(unsigned int i=0; i<lod.getNumRanges();++i)
{
fw.indent() << lod.getMinRange(i) << " "<<lod.getMaxRange(i)<<std::endl;

View File

@@ -55,7 +55,7 @@ bool Light_readLocalData(Object& obj, Input& fr)
fr+=5; \
iteratorAdvanced = true; \
} \
}
}
#define ReadVec3(A,B) { \
if (fr[0].matchWord(B) && \
@@ -67,7 +67,7 @@ bool Light_readLocalData(Object& obj, Input& fr)
fr+=4; \
iteratorAdvanced = true; \
} \
}
}
#define ReadFloat(A,B) { \
if (fr[0].matchWord(B) && \
@@ -77,17 +77,17 @@ bool Light_readLocalData(Object& obj, Input& fr)
fr+=2; \
iteratorAdvanced = true; \
} \
}
}
Vec4 vec4;
ReadVec4(setAmbient,"ambient")
ReadVec4(setDiffuse,"diffuse")
ReadVec4(setSpecular,"specular")
ReadVec4(setPosition,"position")
Vec3 vec3;
ReadVec3(setDirection,"direction")
float value;
ReadFloat(setConstantAttenuation,"constant_attenuation")
ReadFloat(setLinearAttenuation,"linear_attenuation")

View File

@@ -29,7 +29,7 @@ bool LightModel_readLocalData(Object& obj, Input& fr)
bool iteratorAdvanced = false;
LightModel& lightmodel = static_cast<LightModel&>(obj);
osg::Vec4 ambient;
if (fr[0].matchWord("ambientIntensity") &&
fr[1].getFloat(ambient[0]) &&
@@ -86,7 +86,7 @@ bool LightModel_readLocalData(Object& obj, Input& fr)
iteratorAdvanced = true;
}
}
return iteratorAdvanced;
}
@@ -95,7 +95,7 @@ bool LightModel_writeLocalData(const Object& obj,Output& fw)
const LightModel& lightmodel = static_cast<const LightModel&>(obj);
fw.indent() << "ambientIntensity " << lightmodel.getAmbientIntensity() << std::endl;
if (lightmodel.getColorControl()==osg::LightModel::SEPARATE_SPECULAR_COLOR)
fw.indent() << "colorControl SEPARATE_SPECULAR_COLOR" << std::endl;
else
@@ -105,7 +105,7 @@ bool LightModel_writeLocalData(const Object& obj,Output& fw)
fw.indent() << "localViewer TRUE"<< std::endl;
else
fw.indent() << "localViewer FALSE"<< std::endl;
if (lightmodel.getTwoSided())
fw.indent() << "twoSided TRUE"<< std::endl;
else

View File

@@ -30,7 +30,7 @@ bool LightSource_readLocalData(Object& obj, Input& fr)
if (fr[0].matchWord("referenceFrame"))
{
bool cullingActiveBefore = lightsource.getCullingActive();
if (fr[1].matchWord("RELATIVE_TO_ABSOLUTE") || fr[1].matchWord("ABSOLUTE"))
{
lightsource.setReferenceFrame(LightSource::ABSOLUTE_RF);
@@ -43,7 +43,7 @@ bool LightSource_readLocalData(Object& obj, Input& fr)
fr += 2;
iteratorAdvanced = true;
}
// if culling wasn't before reset it to off.
if (!cullingActiveBefore && lightsource.getCullingActive())
{

View File

@@ -29,7 +29,7 @@ bool LineStipple_readLocalData(Object& obj, Input& fr)
bool iteratorAdvanced = false;
LineStipple& linestipple = static_cast<LineStipple&>(obj);
int ref = linestipple.getFactor();
if (fr[0].matchWord("factor") && fr[1].getInt(ref))
{

View File

@@ -141,7 +141,7 @@ bool Material_readLocalData(Object& obj, Input& fr)
{
material.setTransparency(Material::FRONT_AND_BACK,transparency);
fr+=2;
iteratorAdvanced = true;
}

View File

@@ -4,7 +4,7 @@
bool readMatrix(osg::Matrix& matrix, osgDB::Input& fr, const char* keyword)
{
bool iteratorAdvanced = false;
if (fr[0].matchWord(keyword) && fr[1].isOpenBracket())
{
int entry = fr[0].getNoNestedBrackets();
@@ -30,8 +30,8 @@ bool readMatrix(osg::Matrix& matrix, osgDB::Input& fr, const char* keyword)
else fr.advanceOverCurrentFieldOrBlock();
}
iteratorAdvanced = true;
}
}
return iteratorAdvanced;
}

View File

@@ -55,10 +55,10 @@ bool MatrixTransform_readLocalData(Object& obj, Input& fr)
fr +=2 ;
iteratorAdvanced = true;
}
}
Matrix matrix;
}
Matrix matrix;
if (readMatrix(matrix,fr))
{
transform.setMatrix(matrix);

View File

@@ -215,7 +215,7 @@ bool Node_writeLocalData(const Object& obj, Output& fw)
{
fw.writeObject(*node.getStateSet());
}
if (node.getUpdateCallback())
{
fw.indent() << "UpdateCallbacks {" << std::endl;
@@ -248,7 +248,7 @@ bool Node_writeLocalData(const Object& obj, Output& fw)
const osg::BoundingSphere& bs = node.getInitialBound();
fw.indent()<<"initialBound "<<bs.center()<<" "<<bs.radius()<<std::endl;
}
if (node.getComputeBoundingSphereCallback())
{
fw.indent() << "ComputeBoundingSphereCallback {" << std::endl;

View File

@@ -47,7 +47,7 @@ bool Object_readLocalData(Object& obj, Input& fr)
fr +=2 ;
iteratorAdvanced = true;
}
}
}
if (fr.matchSequence("name %s"))
{

View File

@@ -26,11 +26,11 @@ bool OccluderNode_readLocalData(Object& obj, Input& fr)
bool iteratorAdvanced = false;
OccluderNode& occludernode = static_cast<OccluderNode&>(obj);
static ref_ptr<ConvexPlanarOccluder> s_occluder = new ConvexPlanarOccluder;
ConvexPlanarOccluder* tmpOccluder = static_cast<ConvexPlanarOccluder*>(fr.readObjectOfType(*s_occluder));
if (tmpOccluder)
{
occludernode.setOccluder(tmpOccluder);

View File

@@ -1,14 +1,14 @@
//
// Copyright (C) 2007 Skew Matrix Software LLC (http://www.skew-matrix.com)
//
// 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.
//

View File

@@ -27,7 +27,7 @@ bool PagedLOD_readLocalData(Object& obj, Input& fr)
bool iteratorAdvanced = false;
PagedLOD& lod = static_cast<PagedLOD&>(obj);
std::string path;
if (fr.read("DatabasePath",path))
{
@@ -38,13 +38,13 @@ bool PagedLOD_readLocalData(Object& obj, Input& fr)
if (lod.getDatabasePath().empty() && fr.getOptions() && !fr.getOptions()->getDatabasePathList().empty())
{
const std::string& path = fr.getOptions()->getDatabasePathList().front();
if (!path.empty())
if (!path.empty())
{
lod.setDatabasePath(path);
}
}
}
}
unsigned int num;
if (fr[0].matchWord("NumChildrenThatCannotBeExpired") && fr[1].getUInt(num))
{
@@ -52,7 +52,7 @@ bool PagedLOD_readLocalData(Object& obj, Input& fr)
fr+=2;
iteratorAdvanced = true;
}
bool flag;
if (fr.read("DisableExternalChildrenPaging", flag))
{
@@ -82,7 +82,7 @@ bool PagedLOD_readLocalData(Object& obj, Input& fr)
{
if (fr[0].getStr()) lod.setFileName(i,fr[0].getStr());
else lod.setFileName(i,"");
++fr;
++i;
}
@@ -134,9 +134,9 @@ bool PagedLOD_writeLocalData(const Object& obj, Output& fw)
fw.indent() << "FileNameList "<<lod.getNumFileNames()<<" {"<< std::endl;
fw.moveIn();
unsigned int numChildrenToWriteOut = 0;
for(unsigned int i=0; i<lod.getNumFileNames();++i)
{
if (lod.getFileName(i).empty())
@@ -144,7 +144,7 @@ bool PagedLOD_writeLocalData(const Object& obj, Output& fw)
fw.indent() << "\"\"" << std::endl;
++numChildrenToWriteOut;
}
else
else
{
fw.indent() << lod.getFileName(i) << std::endl;
}

View File

@@ -35,7 +35,7 @@ bool PositionAttitudeTransform_readLocalData(Object& obj, Input& fr)
fr[1].getFloat(pos[0]);
fr[2].getFloat(pos[1]);
fr[3].getFloat(pos[2]);
transform.setPosition(pos);
fr += 4;
@@ -49,9 +49,9 @@ bool PositionAttitudeTransform_readLocalData(Object& obj, Input& fr)
fr[2].getFloat(att[1]);
fr[3].getFloat(att[2]);
fr[4].getFloat(att[3]);
transform.setAttitude(att);
fr += 5;
iteratorAdvanced = true;
}
@@ -62,7 +62,7 @@ bool PositionAttitudeTransform_readLocalData(Object& obj, Input& fr)
fr[1].getFloat(scale[0]);
fr[2].getFloat(scale[1]);
fr[3].getFloat(scale[2]);
transform.setScale(scale);
fr += 4;
@@ -75,9 +75,9 @@ bool PositionAttitudeTransform_readLocalData(Object& obj, Input& fr)
fr[1].getFloat(pivot[0]);
fr[2].getFloat(pivot[1]);
fr[3].getFloat(pivot[2]);
transform.setPivotPoint(pivot);
fr += 4;
iteratorAdvanced = true;
}
@@ -89,7 +89,7 @@ bool PositionAttitudeTransform_readLocalData(Object& obj, Input& fr)
bool PositionAttitudeTransform_writeLocalData(const Object& obj, Output& fw)
{
const PositionAttitudeTransform& transform = static_cast<const PositionAttitudeTransform&>(obj);
fw.indent()<<"position "<<transform.getPosition()<<std::endl;
fw.indent()<<"attitude "<<transform.getAttitude()<<std::endl;
fw.indent()<<"scale "<<transform.getScale()<<std::endl;

View File

@@ -32,8 +32,8 @@ bool Program_readLocalData(Object& obj, Input& fr)
bool iteratorAdvanced = false;
Program& program = static_cast<Program&>(obj);
if(fr.matchSequence("GeometryVerticesOut %i"))
if(fr.matchSequence("GeometryVerticesOut %i"))
{
unsigned int verticesOut;
fr[1].getUInt(verticesOut);
@@ -41,8 +41,8 @@ bool Program_readLocalData(Object& obj, Input& fr)
fr += 2;
iteratorAdvanced = true;
}
if(fr.matchSequence("GeometryInputType %w"))
if(fr.matchSequence("GeometryInputType %w"))
{
std::string primitiveMode = fr[1].getStr();
GLenum mode;
@@ -51,8 +51,8 @@ bool Program_readLocalData(Object& obj, Input& fr)
fr += 2;
iteratorAdvanced = true;
}
if(fr.matchSequence("GeometryOutputType %w"))
if(fr.matchSequence("GeometryOutputType %w"))
{
std::string primitiveMode = fr[1].getStr();
GLenum mode;
@@ -104,7 +104,7 @@ bool Program_readLocalData(Object& obj, Input& fr)
bool Program_writeLocalData(const Object& obj,Output& fw)
{
const Program& program = static_cast<const Program&>(obj);
fw.indent() << "GeometryVerticesOut " << program.getParameter(GL_GEOMETRY_VERTICES_OUT_EXT) << std::endl;
fw.indent() << "GeometryInputType " << Geometry_getPrimitiveModeStr(program.getParameter(GL_GEOMETRY_INPUT_TYPE_EXT)) << std::endl;
fw.indent() << "GeometryOutputType " << Geometry_getPrimitiveModeStr(program.getParameter(GL_GEOMETRY_OUTPUT_TYPE_EXT)) << std::endl;

View File

@@ -27,12 +27,12 @@ REGISTER_DOTOSGWRAPPER(Projection)
bool Projection_readLocalData(Object& obj, Input& fr)
{
Projection &myobj = static_cast<Projection &>(obj);
bool iteratorAdvanced = false;
bool iteratorAdvanced = false;
Matrix matrix;
if (readMatrix(matrix,fr))
{
myobj.setMatrix(matrix);
myobj.setMatrix(matrix);
iteratorAdvanced = true;
}

View File

@@ -55,7 +55,7 @@ bool ProxyNode_readLocalData(Object& obj, Input& fr)
proxyNode.setLoadingExternalReferenceMode(ProxyNode::DEFER_LOADING_TO_DATABASE_PAGER);
else if (fr[1].matchWord("NO_AUTOMATIC_LOADING"))
proxyNode.setLoadingExternalReferenceMode(ProxyNode::NO_AUTOMATIC_LOADING);
fr+=2;
iteratorAdvanced = true;
}
@@ -71,11 +71,11 @@ bool ProxyNode_readLocalData(Object& obj, Input& fr)
if (fr.getOptions() && !fr.getOptions()->getDatabasePathList().empty())
{
const std::string& path = fr.getOptions()->getDatabasePathList().front();
if (!path.empty())
if (!path.empty())
{
proxyNode.setDatabasePath(path);
}
}
}
bool matchFirst;
if ((matchFirst=fr.matchSequence("FileNameList {")) || fr.matchSequence("FileNameList %i {"))
@@ -99,7 +99,7 @@ bool ProxyNode_readLocalData(Object& obj, Input& fr)
{
if (fr[0].getStr()) proxyNode.setFileName(i,fr[0].getStr());
else proxyNode.setFileName(i,"");
++fr;
++i;
}
@@ -169,18 +169,18 @@ bool ProxyNode_writeLocalData(const Object& obj, Output& fw)
std::string optionsString = fw.getOptions()->getOptionString();
includeExternalReferences = optionsString.find("includeExternalReferences")!=std::string::npos;
bool newExternals = optionsString.find("writeExternalReferenceFiles")!=std::string::npos;
if (newExternals)
if (newExternals)
{
useOriginalExternalReferences = false;
writeExternalReferenceFiles = true;
}
}
}
const ProxyNode& proxyNode = static_cast<const ProxyNode&>(obj);
if (proxyNode.getCenterMode()==osg::ProxyNode::USER_DEFINED_CENTER) fw.indent() << "Center "<< proxyNode.getCenter() << std::endl;
fw.indent() << "ExtRefMode ";
switch(proxyNode.getLoadingExternalReferenceMode())
{
case ProxyNode::LOAD_IMMEDIATELY:
@@ -198,9 +198,9 @@ bool ProxyNode_writeLocalData(const Object& obj, Output& fw)
fw.indent() << "FileNameList "<<proxyNode.getNumFileNames()<<" {"<< std::endl;
fw.moveIn();
unsigned int numChildrenToWriteOut = 0;
for(unsigned int i=0; i<proxyNode.getNumFileNames();++i)
{
if (proxyNode.getFileName(i).empty())
@@ -208,7 +208,7 @@ bool ProxyNode_writeLocalData(const Object& obj, Output& fw)
fw.indent() << "\"\"" << std::endl;
++numChildrenToWriteOut;
}
else
else
{
if(useOriginalExternalReferences)
{

View File

@@ -89,9 +89,9 @@ bool Sequence_readLocalData(Object& obj, Input& fr)
Sequence& sw = static_cast<Sequence&>(obj);
if (fr.matchSequence("defaultTime"))
if (fr.matchSequence("defaultTime"))
{
if (fr[1].isFloat())
if (fr[1].isFloat())
{
float t;
fr[1].getFloat(t) ;
@@ -100,29 +100,29 @@ bool Sequence_readLocalData(Object& obj, Input& fr)
fr += 2;
}
}
else if (fr.matchSequence("frameTime {"))
else if (fr.matchSequence("frameTime {"))
{
int entry = fr[0].getNoNestedBrackets();
fr += 2;
int i = 0;
while (!fr.eof() && fr[0].getNoNestedBrackets() > entry)
while (!fr.eof() && fr[0].getNoNestedBrackets() > entry)
{
float t;
if (fr[0].getFloat(t))
if (fr[0].getFloat(t))
{
sw.setTime(i, t);
++fr;
i++;
}
}
iteratorAdvanced = true;
++fr;
}
else if (fr.matchSequence("lastFrameTime"))
else if (fr.matchSequence("lastFrameTime"))
{
if (fr[1].isFloat())
if (fr[1].isFloat())
{
float t;
fr[1].getFloat(t) ;
@@ -131,21 +131,21 @@ bool Sequence_readLocalData(Object& obj, Input& fr)
fr += 2;
}
}
else if (fr.matchSequence("interval"))
else if (fr.matchSequence("interval"))
{
Sequence::LoopMode mode;
int begin, end;
if (Sequence_matchLoopMode(fr[1].getStr(), mode) &&
fr[2].getInt(begin) && fr[3].getInt(end))
fr[2].getInt(begin) && fr[3].getInt(end))
{
sw.setInterval(mode, begin, end);
iteratorAdvanced = true;
fr += 4;
}
}
else if (fr.matchSequence("duration"))
else if (fr.matchSequence("duration"))
{
if (fr[1].isFloat() && fr[2].isInt())
if (fr[1].isFloat() && fr[2].isInt())
{
float speed;
int nreps;
@@ -156,19 +156,19 @@ bool Sequence_readLocalData(Object& obj, Input& fr)
fr += 3;
}
}
else if (fr.matchSequence("mode"))
else if (fr.matchSequence("mode"))
{
Sequence::SequenceMode mode;
if (Sequence_matchSeqMode(fr[1].getStr(), mode))
if (Sequence_matchSeqMode(fr[1].getStr(), mode))
{
sw.setMode(mode);
iteratorAdvanced = true;
fr += 2;
}
}
else if (fr.matchSequence("sync"))
else if (fr.matchSequence("sync"))
{
if (fr[1].isInt())
if (fr[1].isInt())
{
int sync ;
fr[1].getInt(sync) ;
@@ -177,9 +177,9 @@ bool Sequence_readLocalData(Object& obj, Input& fr)
fr += 2;
}
}
else if (fr.matchSequence("clearOnStop"))
else if (fr.matchSequence("clearOnStop"))
{
if (fr[1].isInt())
if (fr[1].isInt())
{
int clearOnStop ;
fr[1].getInt(clearOnStop) ;
@@ -188,7 +188,7 @@ bool Sequence_readLocalData(Object& obj, Input& fr)
fr += 2;
}
}
return iteratorAdvanced;
}
@@ -202,7 +202,7 @@ bool Sequence_writeLocalData(const Object& obj, Output& fw)
// frame times
fw.indent() << "frameTime {" << std::endl;
fw.moveIn();
for (unsigned int i = 0; i < sw.getNumChildren(); i++)
for (unsigned int i = 0; i < sw.getNumChildren(); i++)
{
fw.indent() << sw.getTime(i) << std::endl;
}

View File

@@ -42,7 +42,7 @@ bool Shader_readLocalData(Object& obj, Input& fr)
fr+=2;
iteratorAdvanced = true;
}
if (fr.matchSequence("file %w") || fr.matchSequence("file %s") )
{
@@ -51,7 +51,7 @@ bool Shader_readLocalData(Object& obj, Input& fr)
shader.setShaderSource(s->getShaderSource());
else
shader.loadShaderSourceFromFile( osgDB::findDataFile(fr[1].getStr()) );
fr += 2;
iteratorAdvanced = true;
}
@@ -94,18 +94,18 @@ bool Shader_writeLocalData(const Object& obj,Output& fw)
{
fileName = fw.getShaderFileNameForOutput();
}
osgDB::writeShaderFile(shader, fileName);
if (!fileName.empty())
{
{
fw.indent() << "file "<<fw.wrapString(fw.getFileNameForOutput(fileName))<< std::endl;
}
}
else // no need to write shaders to external files, hence embed it
else // no need to write shaders to external files, hence embed it
{
// split source text into individual lines
std::vector<std::string> lines;
std::istringstream iss(shader.getShaderSource());
@@ -116,12 +116,12 @@ bool Shader_writeLocalData(const Object& obj,Output& fw)
fw.indent() << "code {\n";
fw.moveIn();
std::vector<std::string>::const_iterator j;
for (j=lines.begin(); j!=lines.end(); ++j) {
fw.indent() << fw.wrapString(*j) << "\n";
}
fw.moveOut();
fw.indent() << "}\n";
}

View File

@@ -36,9 +36,9 @@ bool ShapeDrawable_readLocalData(Object& obj, Input& fr)
fr[2].getFloat(color[1]);
fr[3].getFloat(color[2]);
fr[4].getFloat(color[3]);
geom.setColor(color);
fr+=5;
iteratorAdvanced = true;
}

View File

@@ -43,7 +43,7 @@ bool Sphere_readLocalData(Object& obj, Input& fr)
fr+=4;
iteratorAdvanced = true;
}
if (fr.matchSequence("Radius %f"))
{
float radius;
@@ -52,7 +52,7 @@ bool Sphere_readLocalData(Object& obj, Input& fr)
fr+=2;
iteratorAdvanced = true;
}
return iteratorAdvanced;
}
@@ -60,7 +60,7 @@ bool Sphere_readLocalData(Object& obj, Input& fr)
bool Sphere_writeLocalData(const Object& obj, Output& fw)
{
const Sphere& sphere = static_cast<const Sphere&>(obj);
fw.indent()<<"Center "<<sphere.getCenter()<<std::endl;
fw.indent()<<"Radius "<<sphere.getRadius()<<std::endl;

View File

@@ -13,7 +13,7 @@ bool StateAttribute_readLocalData(Object& obj, Input& fr);
bool StateAttribute_writeLocalData(const Object& obj, Output& fw);
// register the read and write functions with the osgDB::Registry.
osg::StateAttribute* g_stateAttribute = 0;
osg::StateAttribute* g_stateAttribute = 0;
REGISTER_DOTOSGWRAPPER(StateAttribute)
(
g_stateAttribute, // no instance, osg::StateAttribute is an abstract class.

View File

@@ -84,7 +84,7 @@ void initGLNames()
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(s_initGLNames);
if (!first_time) return;
ADD_NAME("GL_ALPHA_TEST",GL_ALPHA_TEST)
ADD_NAME("GL_BLEND",GL_BLEND)
ADD_NAME("GL_COLOR_MATERIAL",GL_COLOR_MATERIAL)
@@ -100,21 +100,21 @@ void initGLNames()
ADD_NAME("GL_COLOR_SUM",GL_COLOR_SUM);
ADD_NAME("GL_NORMALIZE",GL_NORMALIZE);
ADD_NAME("GL_RESCALE_NORMAL",GL_RESCALE_NORMAL);
ADD_NAME("GL_TEXTURE_1D",GL_TEXTURE_1D)
ADD_NAME("GL_TEXTURE_2D",GL_TEXTURE_2D)
ADD_NAME("GL_TEXTURE_3D",GL_TEXTURE_3D)
ADD_NAME("GL_TEXTURE_CUBE_MAP",GL_TEXTURE_CUBE_MAP);
ADD_NAME("GL_TEXTURE_RECTANGLE",GL_TEXTURE_RECTANGLE);
ADD_NAME("GL_TEXTURE_GEN_Q",GL_TEXTURE_GEN_Q)
ADD_NAME("GL_TEXTURE_GEN_R",GL_TEXTURE_GEN_R)
ADD_NAME("GL_TEXTURE_GEN_S",GL_TEXTURE_GEN_S)
ADD_NAME("GL_TEXTURE_GEN_T",GL_TEXTURE_GEN_T)
ADD_NAME("GL_STENCIL_TEST",GL_STENCIL_TEST)
ADD_NAME("GL_CLIP_PLANE0",GL_CLIP_PLANE0);
ADD_NAME("GL_CLIP_PLANE1",GL_CLIP_PLANE1);
ADD_NAME("GL_CLIP_PLANE2",GL_CLIP_PLANE2);
@@ -137,19 +137,19 @@ void initGLNames()
#endif
ADD_NAME("GL_VERTEX_PROGRAM_POINT_SIZE", GL_VERTEX_PROGRAM_POINT_SIZE)
ADD_NAME("GL_VERTEX_PROGRAM_TWO_SIDE", GL_VERTEX_PROGRAM_TWO_SIDE)
s_TextureGLModeSet.insert(GL_TEXTURE_1D);
s_TextureGLModeSet.insert(GL_TEXTURE_2D);
s_TextureGLModeSet.insert(GL_TEXTURE_3D);
s_TextureGLModeSet.insert(GL_TEXTURE_CUBE_MAP);
s_TextureGLModeSet.insert(GL_TEXTURE_RECTANGLE);
s_TextureGLModeSet.insert(GL_TEXTURE_GEN_Q);
s_TextureGLModeSet.insert(GL_TEXTURE_GEN_R);
s_TextureGLModeSet.insert(GL_TEXTURE_GEN_S);
s_TextureGLModeSet.insert(GL_TEXTURE_GEN_T);
// for(GLNameToGLModeMap::iterator itr=s_GLNameToGLModeMap.begin();
// itr!=s_GLNameToGLModeMap.end();
@@ -157,7 +157,7 @@ void initGLNames()
// {
// cout << "Name ["<<itr->first<<","<<itr->second<<"]"<< std::endl;
// }
first_time = false;
}
@@ -277,10 +277,10 @@ bool GeoState_readLocalData(Object& obj, Input& fr)
{
statset.setAttribute(attribute);
}
if (attribute->getType()==StateAttribute::TEXGEN)
if (attribute->getType()==StateAttribute::TEXGEN)
statset.setAssociatedModes(attribute,texgening);
iteratorAdvanced = true;
}
@@ -295,8 +295,8 @@ bool StateSet_readLocalData(Object& obj, Input& fr)
StateSet& stateset = static_cast<StateSet&>(obj);
initGLNames();
// read the rendering hint value.
// read the rendering hint value.
if (fr[0].matchWord("rendering_hint"))
{
if (fr[1].matchWord("DEFAULT_BIN"))
@@ -349,7 +349,7 @@ bool StateSet_readLocalData(Object& obj, Input& fr)
{
setRenderBinDetails=true;
binName = fr[1].getStr();
fr+=2;
iteratorAdvanced = true;
}
@@ -394,7 +394,7 @@ bool StateSet_readLocalData(Object& obj, Input& fr)
{
int mode;
fr[0].getInt(mode);
if (s_TextureGLModeSet.find(mode)!=s_TextureGLModeSet.end())
{
// remap to a texture unit.
@@ -432,7 +432,7 @@ bool StateSet_readLocalData(Object& obj, Input& fr)
readingMode=true;
}
}
}
}
}
// new code using osg::Registry's list of prototypes to loaded attributes.
@@ -459,7 +459,7 @@ bool StateSet_readLocalData(Object& obj, Input& fr)
}
iteratorAdvanced = true;
}
while(fr.matchSequence("textureUnit %i {"))
{
int entry = fr[0].getNoNestedBrackets();
@@ -467,11 +467,11 @@ bool StateSet_readLocalData(Object& obj, Input& fr)
unsigned int unit=0;
fr[1].getUInt(unit);
fr+=3;
while (!fr.eof() && fr[0].getNoNestedBrackets()>entry)
{
bool localIteratorAdvanced = false;
bool readingMode = true;
StateAttribute::GLModeValue value;
while (readingMode)
@@ -504,34 +504,34 @@ bool StateSet_readLocalData(Object& obj, Input& fr)
readingMode=true;
}
}
}
}
}
StateAttribute* attribute = NULL;
while((attribute=fr.readStateAttribute())!=NULL)
{
stateset.setTextureAttribute(unit,attribute);
localIteratorAdvanced = true;
}
if (!localIteratorAdvanced)
fr.advanceOverCurrentFieldOrBlock();
}
// skip over trailing '}'
++fr;
iteratorAdvanced = true;
}
return iteratorAdvanced;
}
// visual studio 6.0 doesn't appear to define std::max?!? So do our own here..
// visual studio 6.0 doesn't appear to define std::max?!? So do our own here..
template<class T>
T mymax(const T& a,const T& b)
{
@@ -545,22 +545,22 @@ bool StateSet_writeLocalData(const Object& obj, Output& fw)
initGLNames();
// write the rendering hint value.
// write the rendering hint value.
fw.indent()<<"rendering_hint ";
switch(stateset.getRenderingHint())
{
case(StateSet::DEFAULT_BIN):
fw<<"DEFAULT_BIN"<< std::endl;
break;
break;
case(StateSet::OPAQUE_BIN):
fw<<"OPAQUE_BIN"<< std::endl;
break;
break;
case(StateSet::TRANSPARENT_BIN):
fw<<"TRANSPARENT_BIN"<< std::endl;
break;
break;
default:
fw<<stateset.getRenderingHint()<< std::endl;
break;
break;
}
fw.indent()<<"renderBinMode "<<StateSet_getRenderBinModeStr(stateset.getRenderBinMode())<< std::endl;
@@ -587,7 +587,7 @@ bool StateSet_writeLocalData(const Object& obj, Output& fw)
fw.indent() << "0x" << hex << (unsigned int)mitr->first << dec <<" " << StateSet_getModeStr(mitr->second) << std::endl;
}
}
const StateSet::UniformList& ul = stateset.getUniformList();
for(StateSet::UniformList::const_iterator uitr=ul.begin();
uitr!=ul.end();
@@ -604,15 +604,15 @@ bool StateSet_writeLocalData(const Object& obj, Output& fw)
fw.writeObject(*(sitr->second.first));
}
const StateSet::TextureModeList& tml = stateset.getTextureModeList();
const StateSet::TextureModeList& tml = stateset.getTextureModeList();
const StateSet::TextureAttributeList& tal = stateset.getTextureAttributeList();
unsigned int maxUnit = mymax(tml.size(),tal.size());
for(unsigned int unit=0;unit<maxUnit;++unit)
{
fw.indent()<<"textureUnit "<<unit<<" {"<< std::endl;
fw.moveIn();
if (unit<tml.size())
{
const StateSet::ModeList& ml = tml[unit];
@@ -632,7 +632,7 @@ bool StateSet_writeLocalData(const Object& obj, Output& fw)
}
}
}
if (unit<tal.size())
{
const StateSet::AttributeList& sl = tal[unit];
@@ -643,11 +643,11 @@ bool StateSet_writeLocalData(const Object& obj, Output& fw)
fw.writeObject(*(sitr->second.first));
}
}
fw.moveOut();
fw.indent()<<"}"<< std::endl;
}
if (stateset.getUpdateCallback())
{
fw.indent() << "UpdateCallback {" << std::endl;

View File

@@ -36,7 +36,7 @@ bool Stencil_readLocalData(Object& obj, Input& fr)
bool iteratorAdvanced = false;
Stencil& stencil = static_cast<Stencil&>(obj);
bool setFunction = false;
Stencil::Function func = stencil.getFunction();
if (fr[0].matchWord("function") && Stencil_matchFuncStr(fr[1].getStr(),func))
@@ -110,11 +110,11 @@ bool Stencil_writeLocalData(const Object& obj,Output& fw)
fw.indent() << "function " << Stencil_getFuncStr(stencil.getFunction()) << std::endl;
fw.indent() << "functionRef " << stencil.getFunctionRef() << std::endl;
fw.indent() << "functionMask 0x" << hex << stencil.getFunctionMask() << dec << std::endl;
fw.indent() << "stencilFailOperation " << Stencil_getOperationStr(stencil.getStencilFailOperation()) << std::endl;
fw.indent() << "stencilPassAndDepthFailOperation " << Stencil_getOperationStr(stencil.getStencilPassAndDepthFailOperation()) << std::endl;
fw.indent() << "stencilPassAndDepthPassOperation " << Stencil_getOperationStr(stencil.getStencilPassAndDepthPassOperation()) << std::endl;
fw.indent() << "writeMask 0x" << hex << stencil.getWriteMask() << dec << std::endl;
return true;

View File

@@ -53,7 +53,7 @@ bool Switch_readLocalData(Object& obj, Input& fr)
if (fr[0].matchWord("NewChildDefaultValue"))
{
if (fr[1].matchWord("TRUE"))
if (fr[1].matchWord("TRUE"))
{
sw.setNewChildDefaultValue(true);
iteratorAdvanced = true;
@@ -95,9 +95,9 @@ bool Switch_readLocalData(Object& obj, Input& fr)
}
++fr;
iteratorAdvanced = true;
}
return iteratorAdvanced;

View File

@@ -48,9 +48,9 @@ bool TexEnv_readLocalData(Object& obj, Input& fr)
fr[2].getFloat(color[1]);
fr[3].getFloat(color[2]);
fr[4].getFloat(color[3]);
texenv.setColor(color);
fr+=5;
iteratorAdvanced = true;
}
@@ -63,7 +63,7 @@ bool TexEnv_writeLocalData(const Object& obj, Output& fw)
const TexEnv& texenv = static_cast<const TexEnv&>(obj);
fw.indent() << "mode " << TexEnv_getModeStr(texenv.getMode()) << std::endl;
switch(texenv.getMode())
{
case(TexEnv::DECAL):

View File

@@ -155,9 +155,9 @@ bool TexEnvCombine_readLocalData(Object& obj, Input& fr)
fr[2].getFloat(color[1]);
fr[3].getFloat(color[2]);
fr[4].getFloat(color[3]);
texenv.setConstantColor(color);
fr+=5;
iteratorAdvanced = true;
}
@@ -171,7 +171,7 @@ bool TexEnvCombine_writeLocalData(const Object& obj, Output& fw)
fw.indent() << "combine_RGB " << TexEnvCombine_getCombineParamStr(texenv.getCombine_RGB()) << std::endl;
fw.indent() << "combine_Alpha " << TexEnvCombine_getCombineParamStr(texenv.getCombine_Alpha()) << std::endl;
fw.indent() << "source0_RGB " << TexEnvCombine_getSourceParamStr(texenv.getSource0_RGB()) << std::endl;
fw.indent() << "source1_RGB " << TexEnvCombine_getSourceParamStr(texenv.getSource1_RGB()) << std::endl;
fw.indent() << "source2_RGB " << TexEnvCombine_getSourceParamStr(texenv.getSource2_RGB()) << std::endl;
@@ -190,7 +190,7 @@ bool TexEnvCombine_writeLocalData(const Object& obj, Output& fw)
fw.indent() << "scale_RGB " << texenv.getScale_RGB() << std::endl;
fw.indent() << "scale_Alpha " << texenv.getScale_Alpha() << std::endl;
fw.indent() << "constantColor " << texenv.getConstantColor() << std::endl;
return true;

View File

@@ -44,6 +44,6 @@ bool TexEnvFilter_writeLocalData(const Object& obj, Output& fw)
const TexEnvFilter& texenvfilter = static_cast<const TexEnvFilter&>(obj);
fw.indent() << "lodBias " << texenvfilter.getLodBias() << std::endl;
return true;
}

View File

@@ -45,7 +45,7 @@ bool TexGen_readLocalData(Object& obj, Input& fr)
fr+=2;
iteratorAdvanced = true;
}
osg::Plane plane;
if (fr[0].matchWord("plane_s"))
{

View File

@@ -32,7 +32,7 @@ bool TexGenNode_readLocalData(Object& obj, Input& fr)
{
texGenNode.setTextureUnit(textureUnit);
fr+=2;
iteratorAdvanced = true;
}

View File

@@ -35,9 +35,9 @@ bool TexMat_readLocalData(Object& obj, Input& fr)
}
if (matched)
{
Matrix& matrix = texmat.getMatrix();
int k=0;
double v;
for(int i=0;i<4;++i)
@@ -55,13 +55,13 @@ bool TexMat_readLocalData(Object& obj, Input& fr)
if (fr[0].matchWord("scaleByTextureRectangleSize"))
{
if (fr[1].matchWord("TRUE"))
if (fr[1].matchWord("TRUE"))
{
texmat.setScaleByTextureRectangleSize(true);
fr +=2 ;
iteratorAdvanced = true;
}
else if (fr[1].matchWord("FALSE"))
else if (fr[1].matchWord("FALSE"))
{
texmat.setScaleByTextureRectangleSize(false);
fr +=2 ;
@@ -81,11 +81,11 @@ bool TexMat_writeLocalData(const Object& obj, Output& fw)
fw.indent() << matrix(1,0) << " " << matrix(1,1) << " " << matrix(1,2) << " " << matrix(1,3) << std::endl;
fw.indent() << matrix(2,0) << " " << matrix(2,1) << " " << matrix(2,2) << " " << matrix(2,3) << std::endl;
fw.indent() << matrix(3,0) << " " << matrix(3,1) << " " << matrix(3,2) << " " << matrix(3,3) << std::endl;
if (texmat.getScaleByTextureRectangleSize())
{
fw.indent() << "scaleByTextureRectangleSize TRUE"<<std::endl;
}
}
return true;
}

View File

@@ -117,13 +117,13 @@ bool Texture_readLocalData(Object& obj, Input& fr)
if (fr[0].matchWord("useHardwareMipMapGeneration"))
{
if (fr[1].matchWord("TRUE"))
if (fr[1].matchWord("TRUE"))
{
texture.setUseHardwareMipMapGeneration(true);
fr +=2 ;
iteratorAdvanced = true;
}
else if (fr[1].matchWord("FALSE"))
else if (fr[1].matchWord("FALSE"))
{
texture.setUseHardwareMipMapGeneration(false);
fr +=2 ;
@@ -133,13 +133,13 @@ bool Texture_readLocalData(Object& obj, Input& fr)
if (fr[0].matchWord("unRefImageDataAfterApply"))
{
if (fr[1].matchWord("TRUE"))
if (fr[1].matchWord("TRUE"))
{
texture.setUnRefImageDataAfterApply(true);
fr +=2 ;
iteratorAdvanced = true;
}
else if (fr[1].matchWord("FALSE"))
else if (fr[1].matchWord("FALSE"))
{
texture.setUnRefImageDataAfterApply(false);
fr +=2 ;
@@ -191,13 +191,13 @@ bool Texture_readLocalData(Object& obj, Input& fr)
if (fr[0].matchWord("resizeNonPowerOfTwo"))
{
if (fr[1].matchWord("TRUE"))
if (fr[1].matchWord("TRUE"))
{
texture.setResizeNonPowerOfTwoHint(true);
fr +=2 ;
iteratorAdvanced = true;
}
else if (fr[1].matchWord("FALSE"))
else if (fr[1].matchWord("FALSE"))
{
texture.setResizeNonPowerOfTwoHint(false);
fr +=2 ;
@@ -207,13 +207,13 @@ bool Texture_readLocalData(Object& obj, Input& fr)
if (fr[0].matchWord("shadowComparison"))
{
if (fr[1].matchWord("TRUE"))
if (fr[1].matchWord("TRUE"))
{
texture.setShadowComparison(true);
fr +=2 ;
iteratorAdvanced = true;
}
else if (fr[1].matchWord("FALSE"))
else if (fr[1].matchWord("FALSE"))
{
texture.setShadowComparison(false);
fr +=2 ;
@@ -258,13 +258,13 @@ bool Texture_writeLocalData(const Object& obj, Output& fw)
fw.indent() << "min_filter " << Texture_getFilterStr(texture.getFilter(Texture::MIN_FILTER)) << std::endl;
fw.indent() << "mag_filter " << Texture_getFilterStr(texture.getFilter(Texture::MAG_FILTER)) << std::endl;
fw.indent() << "maxAnisotropy " << texture.getMaxAnisotropy() << std::endl;
fw.indent() << "borderColor " << texture.getBorderColor() << std::endl;
fw.indent() << "borderWidth " << texture.getBorderWidth() << std::endl;
fw.indent() << "useHardwareMipMapGeneration "<< (texture.getUseHardwareMipMapGeneration()?"TRUE":"FALSE") << std::endl;
fw.indent() << "unRefImageDataAfterApply "<< (texture.getUnRefImageDataAfterApply()?"TRUE":"FALSE") << std::endl;
fw.indent() << "internalFormatMode " << Texture_getInternalFormatModeStr(texture.getInternalFormatMode()) << std::endl;
if (texture.getInternalFormatMode()==Texture::USE_USER_DEFINED_FORMAT)
{
@@ -275,14 +275,14 @@ bool Texture_writeLocalData(const Object& obj, Output& fw)
else fw.indent() << "internalFormat " << texture.getInternalFormat() << std::endl;
}
if (texture.getSourceFormat())
{
const char* str = Texture_getInternalFormatStr(texture.getSourceFormat());
if (str) fw.indent() << "sourceFormat " << str << std::endl;
else fw.indent() << "sourceFormat " << texture.getSourceFormat() << std::endl;
}
if (texture.getSourceType())
@@ -291,7 +291,7 @@ bool Texture_writeLocalData(const Object& obj, Output& fw)
if (str) fw.indent() << "sourceType " << str << std::endl;
else fw.indent() << "sourceType " << texture.getSourceType() << std::endl;
}
fw.indent() << "resizeNonPowerOfTwo "<< (texture.getResizeNonPowerOfTwoHint()?"TRUE":"FALSE") << std::endl;

View File

@@ -45,12 +45,12 @@ bool Texture1D_readLocalData(Object& obj, Input& fr)
if (image)
{
// name will have already been set by the image plugin,
// but it will have absolute path, so will override it
// but it will have absolute path, so will override it
// here to keep the original name intact.
//image->setFileName(filename);
texture.setImage(image);
}
fr += 2;
iteratorAdvanced = true;
}
@@ -89,7 +89,7 @@ bool Texture1D_writeLocalData(const Object& obj, Output& fw)
}
if (!fileName.empty())
{
{
fw.indent() << "file "<<fw.wrapString(fw.getFileNameForOutput(fileName))<< std::endl;
}
}

View File

@@ -54,16 +54,16 @@ bool Texture2D_readLocalData(Object& obj, Input& fr)
if (image)
{
// name will have already been set by the image plugin,
// but it will have absolute path, so will override it
// but it will have absolute path, so will override it
// here to keep the original name intact.
//image->setFileName(filename);
texture.setImage(image);
}
fr += 2;
iteratorAdvanced = true;
}
if (fr[0].matchWord("ImageSequence") || fr[0].matchWord("Image"))
{
osg::Image* image = fr.readImage();
@@ -97,7 +97,7 @@ bool Texture2D_writeLocalData(const Object& obj, Output& fw)
}
if (!fileName.empty())
{
{
fw.indent() << "file "<<fw.wrapString(fw.getFileNameForOutput(fileName))<< std::endl;
}
}

View File

@@ -45,16 +45,16 @@ bool Texture3D_readLocalData(Object& obj, Input& fr)
if (image)
{
// name will have already been set by the image plugin,
// but it will have absolute path, so will override it
// but it will have absolute path, so will override it
// here to keep the original name intact.
//image->setFileName(filename);
texture.setImage(image);
}
fr += 2;
iteratorAdvanced = true;
}
if (fr[0].matchWord("ImageSequence") || fr[0].matchWord("Image"))
{
osg::Image* image = fr.readImage();
@@ -88,7 +88,7 @@ bool Texture3D_writeLocalData(const Object& obj, Output& fw)
}
if (!fileName.empty())
{
{
fw.indent() << "file "<<fw.wrapString(fw.getFileNameForOutput(fileName))<< std::endl;
}
}

View File

@@ -60,7 +60,7 @@ bool TextureCubeMap_readLocalData(Object& obj, Input& fr)
else READ_IMAGE(POSITIVE_Y)
else READ_IMAGE(NEGATIVE_Y)
else READ_IMAGE(POSITIVE_Z)
else READ_IMAGE(NEGATIVE_Z)
else READ_IMAGE(NEGATIVE_Z)
}
return iteratorAdvanced;

View File

@@ -45,16 +45,16 @@ bool TextureRectangle_readLocalData(Object& obj, Input& fr)
if (image)
{
// name will have already been set by the image plugin,
// but it will have absolute path, so will override it
// but it will have absolute path, so will override it
// here to keep the original name intact.
//image->setFileName(filename);
texture.setImage(image);
}
fr += 2;
iteratorAdvanced = true;
}
if (fr[0].matchWord("ImageSequence") || fr[0].matchWord("Image"))
{
osg::Image* image = fr.readImage();
@@ -89,7 +89,7 @@ bool TextureRectangle_writeLocalData(const Object& obj, Output& fw)
}
if (!fileName.empty())
{
{
fw.indent() << "file "<<fw.wrapString(fw.getFileNameForOutput(fileName))<< std::endl;
}
}

View File

@@ -38,7 +38,7 @@ bool TransferFunction1D_readLocalData(osg::Object& obj, osgDB::Input &fr)
tf.allocate(numCells);
itrAdvanced = true;
}
if (fr.matchSequence("Colours {"))
{
int entry = fr[0].getNoNestedBrackets();
@@ -60,7 +60,7 @@ bool TransferFunction1D_readLocalData(osg::Object& obj, osgDB::Input &fr)
++fr;
}
}
tf.assign(colorMap);
itrAdvanced = true;
@@ -74,7 +74,7 @@ bool TransferFunction1D_writeLocalData(const osg::Object& obj, osgDB::Output& fw
{
const osg::TransferFunction1D& tf = static_cast<const osg::TransferFunction1D&>(obj);
const osg::TransferFunction1D::ColorMap& colorMap = tf.getColorMap();
fw.indent()<<"NumberImageCells "<<tf.getNumberImageCells()<<std::endl;
fw.indent()<<"Colours {"<<std::endl;
@@ -85,7 +85,7 @@ bool TransferFunction1D_writeLocalData(const osg::Object& obj, osgDB::Output& fw
{
const osg::Vec4& c = itr->second;
fw.indent()<<itr->first<<" "<<c.r()<<" "<<c.g()<<" "<<c.b()<<" "<<c.a()<<std::endl;
}
}
fw.moveOut();
fw.indent()<<"}"<<std::endl;

View File

@@ -44,18 +44,18 @@ bool Uniform_readLocalData(Object& obj, Input& fr)
// post-May 2006 format (OSG versions > 1.0)
++fr;
if (fr.matchSequence("unsigned int"))
{
uniform.setType( Uniform::getTypeId( "unsigned int" ) );
fr += 2;
}
else
{
{
uniform.setType( Uniform::getTypeId( fr[0].getStr() ) );
++fr;
}
unsigned int numElements;
fr[0].getUInt(numElements);
uniform.setNumElements( numElements );
@@ -83,7 +83,7 @@ bool Uniform_readLocalData(Object& obj, Input& fr)
case(osg::Uniform::FLOAT):
{
float value;
if (fr[0].getFloat(value))
if (fr[0].getFloat(value))
{
uniform.set(value);
fr+=1;
@@ -94,7 +94,7 @@ bool Uniform_readLocalData(Object& obj, Input& fr)
case(osg::Uniform::FLOAT_VEC2):
{
osg::Vec2 value;
if (fr[0].getFloat(value[0]) && fr[1].getFloat(value[1]))
if (fr[0].getFloat(value[0]) && fr[1].getFloat(value[1]))
{
uniform.set(value);
fr+=2;
@@ -105,7 +105,7 @@ bool Uniform_readLocalData(Object& obj, Input& fr)
case(osg::Uniform::FLOAT_VEC3):
{
osg::Vec3 value;
if (fr[0].getFloat(value[0]) && fr[1].getFloat(value[1]) && fr[2].getFloat(value[2]))
if (fr[0].getFloat(value[0]) && fr[1].getFloat(value[1]) && fr[2].getFloat(value[2]))
{
uniform.set(value);
fr+=3;
@@ -116,7 +116,7 @@ bool Uniform_readLocalData(Object& obj, Input& fr)
case(osg::Uniform::FLOAT_VEC4):
{
osg::Vec4 value;
if (fr[0].getFloat(value[0]) && fr[1].getFloat(value[1]) && fr[2].getFloat(value[2]) && fr[3].getFloat(value[3]))
if (fr[0].getFloat(value[0]) && fr[1].getFloat(value[1]) && fr[2].getFloat(value[2]) && fr[3].getFloat(value[3]))
{
uniform.set(value);
fr+=4;
@@ -127,7 +127,7 @@ bool Uniform_readLocalData(Object& obj, Input& fr)
case(osg::Uniform::INT):
{
int value;
if (fr[0].getInt(value))
if (fr[0].getInt(value))
{
uniform.set(value);
fr+=1;
@@ -172,7 +172,7 @@ bool Uniform_readLocalData(Object& obj, Input& fr)
{
osg::Matrix2 value;
if (fr[0].getFloat(value[0]) && fr[1].getFloat(value[1]) &&
fr[2].getFloat(value[2]) && fr[3].getFloat(value[3]))
fr[2].getFloat(value[2]) && fr[3].getFloat(value[3]))
{
uniform.set(value);
fr+=4;

View File

@@ -4,7 +4,7 @@
bool readMatrix(osg::Matrix& matrix, osgDB::Input& fr, const char* keyword)
{
bool iteratorAdvanced = false;
if (fr[0].matchWord(keyword) && fr[1].isOpenBracket())
{
int entry = fr[0].getNoNestedBrackets();
@@ -30,8 +30,8 @@ bool readMatrix(osg::Matrix& matrix, osgDB::Input& fr, const char* keyword)
else fr.advanceOverCurrentFieldOrBlock();
}
iteratorAdvanced = true;
}
}
return iteratorAdvanced;
}

View File

@@ -1,14 +1,14 @@
/* -*-c++-*-
/* -*-c++-*-
* Copyright (C) 2008 Cedric Pinson <cedric.pinson@plopbyte.net>
*
* 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.
*/
@@ -54,7 +54,7 @@ bool Bone_readLocalData(Object& obj, Input& fr)
fr[2].getFloat(att[1]);
fr[3].getFloat(att[2]);
fr[4].getFloat(att[3]);
fr += 5;
iteratorAdvanced = true;
osg::notify(osg::WARN) << "Old osgAnimation file format update your data file" << std::endl;
@@ -66,7 +66,7 @@ bool Bone_readLocalData(Object& obj, Input& fr)
fr[1].getFloat(pos[0]);
fr[2].getFloat(pos[1]);
fr[3].getFloat(pos[2]);
fr += 4;
iteratorAdvanced = true;
osg::notify(osg::WARN) << "Old osgAnimation file format update your data file" << std::endl;
@@ -78,7 +78,7 @@ bool Bone_readLocalData(Object& obj, Input& fr)
fr[1].getFloat(scale[0]);
fr[2].getFloat(scale[1]);
fr[3].getFloat(scale[2]);
fr += 4;
iteratorAdvanced = true;
osg::notify(osg::WARN) << "Old osgAnimation file format update your data file" << std::endl;
@@ -86,7 +86,7 @@ bool Bone_readLocalData(Object& obj, Input& fr)
if (fr.matchSequence("InvBindMatrixInSkeletonSpace {"))
{
Matrix matrix;
Matrix matrix;
if (readMatrix(matrix,fr, "InvBindMatrixInSkeletonSpace"))
{
bone.setInvBindMatrixInSkeletonSpace(matrix);
@@ -95,7 +95,7 @@ bool Bone_readLocalData(Object& obj, Input& fr)
}
if (fr.matchSequence("MatrixInSkeletonSpace {"))
{
Matrix matrix;
Matrix matrix;
if (readMatrix(matrix,fr, "MatrixInSkeletonSpace"))
{
bone.setMatrixInSkeletonSpace(matrix);
@@ -126,13 +126,13 @@ RegisterDotOsgWrapperProxy g_BoneProxy
bool Skeleton_readLocalData(Object& obj, Input& fr)
{
bool Skeleton_readLocalData(Object& obj, Input& fr)
{
return false;
}
bool Skeleton_writeLocalData(const Object& obj, Output& fr)
bool Skeleton_writeLocalData(const Object& obj, Output& fr)
{
return true;
return true;
}
RegisterDotOsgWrapperProxy g_SkeletonProxy
(
@@ -149,7 +149,7 @@ bool Animation_readChannel(osgAnimation::Channel* pChannel, Input& fr)
{
bool iteratorAdvanced = false;
std::string name = "unknown";
if (fr.matchSequence("name %s"))
if (fr.matchSequence("name %s"))
{
if (fr[1].getStr())
name = fr[1].getStr();
@@ -159,7 +159,7 @@ bool Animation_readChannel(osgAnimation::Channel* pChannel, Input& fr)
pChannel->setName(name);
std::string target = "unknown";
if (fr.matchSequence("target %s"))
if (fr.matchSequence("target %s"))
{
if (fr[1].getStr())
target = fr[1].getStr();
@@ -170,7 +170,7 @@ bool Animation_readChannel(osgAnimation::Channel* pChannel, Input& fr)
// we dont need this info
float weight = 1.0;
if (fr.matchSequence("weight %f"))
if (fr.matchSequence("weight %f"))
{
fr[1].getFloat(weight);
fr += 2;
@@ -195,7 +195,7 @@ bool Animation_readLocalData(Object& obj, Input& fr)
iteratorAdvanced = true;
}
if (fr.matchSequence("weight %f"))
if (fr.matchSequence("weight %f"))
{
float weight;
fr[1].getFloat(weight);
@@ -203,8 +203,8 @@ bool Animation_readLocalData(Object& obj, Input& fr)
iteratorAdvanced = true;
anim.setWeight(weight);
}
if (fr.matchSequence("duration %f"))
if (fr.matchSequence("duration %f"))
{
float duration;
fr[1].getFloat(duration);
@@ -213,7 +213,7 @@ bool Animation_readLocalData(Object& obj, Input& fr)
anim.setDuration(duration);
}
if (fr.matchSequence("starttime %f"))
if (fr.matchSequence("starttime %f"))
{
float starttime;
fr[1].getFloat(starttime);
@@ -223,16 +223,16 @@ bool Animation_readLocalData(Object& obj, Input& fr)
}
int nbChannels = 0;
if (fr.matchSequence("num_channels %i"))
if (fr.matchSequence("num_channels %i"))
{
fr[1].getInt(nbChannels);
fr += 2;
iteratorAdvanced = true;
}
for (int i = 0; i < nbChannels; i++)
for (int i = 0; i < nbChannels; i++)
{
if (fr.matchSequence("DoubleLinearChannel {"))
if (fr.matchSequence("DoubleLinearChannel {"))
{
fr += 2;
@@ -240,15 +240,15 @@ bool Animation_readLocalData(Object& obj, Input& fr)
if (Animation_readChannel(channel, fr))
iteratorAdvanced = true;
int nbKeys;
if (fr.matchSequence("Keyframes %i {"))
if (fr.matchSequence("Keyframes %i {"))
{
fr[1].getInt(nbKeys);
fr += 3;
iteratorAdvanced = true;
for (int k = 0; k < nbKeys; k++)
for (int k = 0; k < nbKeys; k++)
{
double v;
float time;
@@ -269,7 +269,7 @@ bool Animation_readLocalData(Object& obj, Input& fr)
if (fr.matchSequence("}")) // channel
fr += 1;
}
else if (fr.matchSequence("FloatLinearChannel {"))
else if (fr.matchSequence("FloatLinearChannel {"))
{
fr += 2;
@@ -277,15 +277,15 @@ bool Animation_readLocalData(Object& obj, Input& fr)
if (Animation_readChannel(channel, fr))
iteratorAdvanced = true;
int nbKeys;
if (fr.matchSequence("Keyframes %i {"))
if (fr.matchSequence("Keyframes %i {"))
{
fr[1].getInt(nbKeys);
fr += 3;
iteratorAdvanced = true;
for (int k = 0; k < nbKeys; k++)
for (int k = 0; k < nbKeys; k++)
{
float v;
float time;
@@ -306,7 +306,7 @@ bool Animation_readLocalData(Object& obj, Input& fr)
if (fr.matchSequence("}")) // channel
fr += 1;
}
else if (fr.matchSequence("Vec2LinearChannel {"))
else if (fr.matchSequence("Vec2LinearChannel {"))
{
fr += 2;
@@ -314,15 +314,15 @@ bool Animation_readLocalData(Object& obj, Input& fr)
if (Animation_readChannel(channel, fr))
iteratorAdvanced = true;
int nbKeys;
if (fr.matchSequence("Keyframes %i {"))
if (fr.matchSequence("Keyframes %i {"))
{
fr[1].getInt(nbKeys);
fr += 3;
iteratorAdvanced = true;
for (int k = 0; k < nbKeys; k++)
for (int k = 0; k < nbKeys; k++)
{
osg::Vec2 v;
float time;
@@ -344,7 +344,7 @@ bool Animation_readLocalData(Object& obj, Input& fr)
if (fr.matchSequence("}")) // channel
fr += 1;
}
else if (fr.matchSequence("Vec3LinearChannel {"))
else if (fr.matchSequence("Vec3LinearChannel {"))
{
fr += 2;
@@ -352,15 +352,15 @@ bool Animation_readLocalData(Object& obj, Input& fr)
if (Animation_readChannel(channel, fr))
iteratorAdvanced = true;
int nbKeys;
if (fr.matchSequence("Keyframes %i {"))
if (fr.matchSequence("Keyframes %i {"))
{
fr[1].getInt(nbKeys);
fr += 3;
iteratorAdvanced = true;
for (int k = 0; k < nbKeys; k++)
for (int k = 0; k < nbKeys; k++)
{
osg::Vec3 v;
float time;
@@ -383,7 +383,7 @@ bool Animation_readLocalData(Object& obj, Input& fr)
if (fr.matchSequence("}")) // channel
fr += 1;
}
else if (fr.matchSequence("Vec4LinearChannel {"))
else if (fr.matchSequence("Vec4LinearChannel {"))
{
fr += 2;
@@ -391,15 +391,15 @@ bool Animation_readLocalData(Object& obj, Input& fr)
if (Animation_readChannel(channel, fr))
iteratorAdvanced = true;
int nbKeys;
if (fr.matchSequence("Keyframes %i {"))
if (fr.matchSequence("Keyframes %i {"))
{
fr[1].getInt(nbKeys);
fr += 3;
iteratorAdvanced = true;
for (int k = 0; k < nbKeys; k++)
for (int k = 0; k < nbKeys; k++)
{
osg::Vec4 v;
float time;
@@ -423,7 +423,7 @@ bool Animation_readLocalData(Object& obj, Input& fr)
if (fr.matchSequence("}")) // channel
fr += 1;
}
else if (fr.matchSequence("QuatSphericalLinearChannel {"))
else if (fr.matchSequence("QuatSphericalLinearChannel {"))
{
fr += 2;
@@ -431,15 +431,15 @@ bool Animation_readLocalData(Object& obj, Input& fr)
if (Animation_readChannel(channel, fr))
iteratorAdvanced = true;
int nbKeys;
if (fr.matchSequence("Keyframes %i {"))
if (fr.matchSequence("Keyframes %i {"))
{
fr[1].getInt(nbKeys);
fr += 3;
iteratorAdvanced = true;
for (int k = 0; k < nbKeys; k++)
for (int k = 0; k < nbKeys; k++)
{
osg::Quat q;
float time;
@@ -464,14 +464,14 @@ bool Animation_readLocalData(Object& obj, Input& fr)
fr += 1;
}
// Deprecated
// Reading of old channel info
// Reading of old channel info
// Kept here for easy conversion of old .osg data to new format
else if (fr.matchSequence("Channel {"))
else if (fr.matchSequence("Channel {"))
{
fr += 2;
std::string name = "unknown";
if (fr.matchSequence("name %s"))
if (fr.matchSequence("name %s"))
{
if (fr[1].getStr())
name = fr[1].getStr();
@@ -479,7 +479,7 @@ bool Animation_readLocalData(Object& obj, Input& fr)
iteratorAdvanced = true;
}
std::string target = "unknown";
if (fr.matchSequence("target %s"))
if (fr.matchSequence("target %s"))
{
if (fr[1].getStr())
target = fr[1].getStr();
@@ -489,7 +489,7 @@ bool Animation_readLocalData(Object& obj, Input& fr)
std::string type = "unknown";
int nbKeys;
if (fr.matchSequence("Keyframes %s %i {"))
if (fr.matchSequence("Keyframes %s %i {"))
{
if (fr[1].getStr())
type = fr[1].getStr();
@@ -498,24 +498,24 @@ bool Animation_readLocalData(Object& obj, Input& fr)
iteratorAdvanced = true;
osgAnimation::Channel* channel = 0;
if (type == "Quat")
if (type == "Quat")
{
osgAnimation::QuatSphericalLinearChannel* c = new osgAnimation::QuatSphericalLinearChannel;
c->getOrCreateSampler()->getOrCreateKeyframeContainer();
channel = c;
}
else if (type == "Vec3")
else if (type == "Vec3")
{
osgAnimation::Vec3LinearChannel* c = new osgAnimation::Vec3LinearChannel;
c->getOrCreateSampler()->getOrCreateKeyframeContainer();
channel = c;
}
if (channel)
if (channel)
{
for (int k = 0; k < nbKeys; k++)
for (int k = 0; k < nbKeys; k++)
{
if (type == "Quat")
if (type == "Quat")
{
osg::Quat q;
float time;
@@ -530,7 +530,7 @@ bool Animation_readLocalData(Object& obj, Input& fr)
c->getOrCreateSampler()->getOrCreateKeyframeContainer()->push_back(osgAnimation::QuatKeyframe(time, q));
iteratorAdvanced = true;
}
else if (type == "Vec3")
else if (type == "Vec3")
{
osg::Vec3 v;
float time;
@@ -576,7 +576,7 @@ void Animation_writeChannel(const std::string& channelString, ChannelType* pChan
{
fw.indent() << "Keyframes " << kfc->size() << " {" << std::endl;
fw.moveIn();
for (unsigned int k = 0; k < kfc->size(); k++)
for (unsigned int k = 0; k < kfc->size(); k++)
{
fw.indent() << "key " << (*kfc)[k].getTime() << " " << (*kfc)[k].getValue() << std::endl;
}
@@ -591,7 +591,7 @@ bool Animation_writeLocalData(const Object& obj, Output& fw)
{
const osgAnimation::Animation& anim = dynamic_cast<const osgAnimation::Animation&>(obj);
switch (anim.getPlayMode())
switch (anim.getPlayMode())
{
case osgAnimation::Animation::ONCE:
fw.indent() << "playmode ONCE" << std::endl;
@@ -602,7 +602,7 @@ bool Animation_writeLocalData(const Object& obj, Output& fw)
case osgAnimation::Animation::LOOP:
fw.indent() << "playmode LOOP" << std::endl;
break;
case osgAnimation::Animation::PPONG:
case osgAnimation::Animation::PPONG:
fw.indent() << "playmode PPONG" << std::endl;
break;
default:
@@ -614,7 +614,7 @@ bool Animation_writeLocalData(const Object& obj, Output& fw)
fw.indent() << "starttime " << anim.getStartTime() << std::endl;
fw.indent() << "num_channels " << anim.getChannels().size() << std::endl;
for (unsigned int i = 0; i < anim.getChannels().size(); i++)
for (unsigned int i = 0; i < anim.getChannels().size(); i++)
{
osgAnimation::Channel* pChannel = anim.getChannels()[i].get();
@@ -698,12 +698,12 @@ RegisterDotOsgWrapperProxy g_atkAnimationProxy
bool AnimationManagerBase_readLocalData(osgAnimation::AnimationManagerBase& manager, Input& fr)
bool AnimationManagerBase_readLocalData(osgAnimation::AnimationManagerBase& manager, Input& fr)
{
int nbAnims = 0;
bool iteratorAdvanced = false;
if (fr.matchSequence("num_animations %i"))
if (fr.matchSequence("num_animations %i"))
{
fr[1].getInt(nbAnims);
fr += 2;
@@ -714,26 +714,26 @@ bool AnimationManagerBase_readLocalData(osgAnimation::AnimationManagerBase& mana
{
Object* o = fr.readObject();
osgAnimation::Animation* a = dynamic_cast<osgAnimation::Animation*>(o);
if (a)
if (a)
{
manager.registerAnimation(a);
iteratorAdvanced = true;
}
}
else
osg::notify(osg::WARN)<<"Warning: can't read an animation object"<< std::endl;
osg::notify(osg::WARN)<<"Warning: can't read an animation object"<< std::endl;
}
return iteratorAdvanced;
}
bool BasicAnimationManager_readLocalData(Object& obj, Input& fr)
bool BasicAnimationManager_readLocalData(Object& obj, Input& fr)
{
osgAnimation::BasicAnimationManager& manager = dynamic_cast<osgAnimation::BasicAnimationManager&>(obj);
return AnimationManagerBase_readLocalData(manager, fr);
}
bool TimelineAnimationManager_readLocalData(Object& obj, Input& fr)
bool TimelineAnimationManager_readLocalData(Object& obj, Input& fr)
{
osgAnimation::TimelineAnimationManager& manager = dynamic_cast<osgAnimation::TimelineAnimationManager&>(obj);
return AnimationManagerBase_readLocalData(manager, fr);
@@ -748,7 +748,7 @@ bool AnimationManagerBase_writeLocalData(const osgAnimation::AnimationManagerBas
for (osgAnimation::AnimationList::const_iterator it = animList.begin(); it != animList.end(); ++it)
{
if (!fw.writeObject(**it))
osg::notify(osg::WARN)<<"Warning: can't write an animation object"<< std::endl;
osg::notify(osg::WARN)<<"Warning: can't write an animation object"<< std::endl;
}
return true;
}
@@ -787,25 +787,25 @@ RegisterDotOsgWrapperProxy g_TimelineAnimationManagerProxy
);
bool RigGeometry_readLocalData(Object& obj, Input& fr)
bool RigGeometry_readLocalData(Object& obj, Input& fr)
{
osgAnimation::RigGeometry& geom = dynamic_cast<osgAnimation::RigGeometry&>(obj);
osg::ref_ptr<osgAnimation::VertexInfluenceMap> vmap = new osgAnimation::VertexInfluenceMap;
int nbGroups = 0;
bool iteratorAdvanced = false;
if (fr.matchSequence("num_influences %i"))
if (fr.matchSequence("num_influences %i"))
{
fr[1].getInt(nbGroups);
fr += 2;
iteratorAdvanced = true;
}
for (int i = 0; i < nbGroups; i++)
for (int i = 0; i < nbGroups; i++)
{
int nbVertexes = 0;
std::string name;
if (fr.matchSequence("osgAnimation::VertexInfluence %s %i {"))
if (fr.matchSequence("osgAnimation::VertexInfluence %s %i {"))
{
name = fr[1].getStr();
fr[2].getInt(nbVertexes);
@@ -816,11 +816,11 @@ bool RigGeometry_readLocalData(Object& obj, Input& fr)
osgAnimation::VertexInfluence vi;
vi.setName(name);
vi.reserve(nbVertexes);
for (int j = 0; j < nbVertexes; j++)
for (int j = 0; j < nbVertexes; j++)
{
int index = -1;
float weight = 1;
if (fr.matchSequence("%i %f"))
if (fr.matchSequence("%i %f"))
{
fr[0].getInt(index);
fr[1].getFloat(weight);
@@ -829,7 +829,7 @@ bool RigGeometry_readLocalData(Object& obj, Input& fr)
}
vi.push_back(osgAnimation::VertexIndexWeight(index, weight));
}
if (fr.matchSequence("}"))
if (fr.matchSequence("}"))
{
fr+=1;
}
@@ -848,7 +848,7 @@ bool RigGeometry_readLocalData(Object& obj, Input& fr)
return iteratorAdvanced;
}
bool RigGeometry_writeLocalData(const Object& obj, Output& fw)
bool RigGeometry_writeLocalData(const Object& obj, Output& fw)
{
const osgAnimation::RigGeometry& geom = dynamic_cast<const osgAnimation::RigGeometry&>(obj);
const osgAnimation::VertexInfluenceMap* vm = geom.getInfluenceMap();
@@ -856,7 +856,7 @@ bool RigGeometry_writeLocalData(const Object& obj, Output& fw)
return true;
fw.indent() << "num_influences " << vm->size() << std::endl;
fw.moveIn();
for (osgAnimation::VertexInfluenceMap::const_iterator it = vm->begin(); it != vm->end(); ++it)
for (osgAnimation::VertexInfluenceMap::const_iterator it = vm->begin(); it != vm->end(); ++it)
{
std::string name = it->first;
if (name.empty())
@@ -864,7 +864,7 @@ bool RigGeometry_writeLocalData(const Object& obj, Output& fw)
fw.indent() << "osgAnimation::VertexInfluence \"" << name << "\" " << it->second.size() << " {" << std::endl;
fw.moveIn();
const osgAnimation::VertexInfluence& vi = it->second;
for (osgAnimation::VertexInfluence::const_iterator itv = vi.begin(); itv != vi.end(); itv++)
for (osgAnimation::VertexInfluence::const_iterator itv = vi.begin(); itv != vi.end(); itv++)
{
fw.indent() << itv->first << " " << itv->second << std::endl;
}
@@ -888,7 +888,7 @@ RegisterDotOsgWrapperProxy g_atkRigGeometryProxy
);
bool MorphGeometry_readLocalData(Object& obj, Input& fr)
bool MorphGeometry_readLocalData(Object& obj, Input& fr)
{
osgAnimation::MorphGeometry& geom = dynamic_cast<osgAnimation::MorphGeometry&>(obj);
@@ -946,7 +946,7 @@ bool MorphGeometry_readLocalData(Object& obj, Input& fr)
{
float weight = 1.0;
if (fr.matchSequence("weight %f"))
if (fr.matchSequence("weight %f"))
{
fr[1].getFloat(weight);
fr += 2;
@@ -965,7 +965,7 @@ bool MorphGeometry_readLocalData(Object& obj, Input& fr)
return iteratorAdvanced;
}
bool MorphGeometry_writeLocalData(const Object& obj, Output& fw)
bool MorphGeometry_writeLocalData(const Object& obj, Output& fw)
{
const osgAnimation::MorphGeometry& geom = dynamic_cast<const osgAnimation::MorphGeometry&>(obj);
@@ -976,9 +976,9 @@ bool MorphGeometry_writeLocalData(const Object& obj, Output& fw)
}
fw.indent() << "morphNormals ";
if (geom.getMorphNormals())
if (geom.getMorphNormals())
fw << "TRUE" << std::endl;
else
else
fw << "FALSE" << std::endl;
const osgAnimation::MorphGeometry::MorphTargetList& morphTargets = geom.getMorphTargetList();
@@ -1032,7 +1032,7 @@ RegisterDotOsgWrapperProxy g_UpdateBoneProxy
bool UpdateSkeleton_readLocalData(Object& obj, Input& fr)
bool UpdateSkeleton_readLocalData(Object& obj, Input& fr)
{
bool iteratorAdvanced = false;
return iteratorAdvanced;
@@ -1054,7 +1054,7 @@ RegisterDotOsgWrapperProxy g_UpdateSkeletonProxy
);
bool UpdateMorph_readLocalData(Object& obj, Input& fr)
bool UpdateMorph_readLocalData(Object& obj, Input& fr)
{
bool iteratorAdvanced = false;
return iteratorAdvanced;

View File

@@ -1,14 +1,14 @@
/* -*-c++-*-
/* -*-c++-*-
* Copyright (C) 2009 Cedric Pinson <cedric.pinson@plopbyte.net>
*
* 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.
*/

View File

@@ -1,14 +1,14 @@
/* -*-c++-*-
/* -*-c++-*-
* Copyright (C) 2009 Cedric Pinson <cedric.pinson@plopbyte.net>
*
* 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.
*/
@@ -25,7 +25,7 @@ using namespace osg;
using namespace osgDB;
bool UpdateMaterial_readLocalData(Object& obj, Input& fr)
bool UpdateMaterial_readLocalData(Object& obj, Input& fr)
{
bool iteratorAdvanced = false;
return iteratorAdvanced;

View File

@@ -1,14 +1,14 @@
/* -*-c++-*-
/* -*-c++-*-
* Copyright (C) 2009 Cedric Pinson <cedric.pinson@plopbyte.net>
*
* 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.
*/

View File

@@ -47,7 +47,7 @@ bool AnisotropicLighting_writeLocalData(const osg::Object &obj, osgDB::Output &f
const osgFX::AnisotropicLighting &myobj = static_cast<const osgFX::AnisotropicLighting &>(obj);
fw.indent() << "lightNumber " << myobj.getLightNumber() << "\n";
const osg::Image *lmap = myobj.getLightingMap();
if (lmap) {
if (!lmap->getFileName().empty()) {

View File

@@ -78,6 +78,6 @@ bool BumpMapping_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
if (myobj.getOverrideNormalMapTexture()) {
fw.writeObject(*myobj.getOverrideNormalMapTexture());
}
return true;
}

View File

@@ -33,7 +33,7 @@ bool Cartoon_readLocalData(osg::Object &obj, osgDB::Input &fr)
if (fr[0].matchWord("outlineColor")) {
osg::Vec4 w;
if (fr[1].getFloat(w.x()) && fr[2].getFloat(w.y()) &&
if (fr[1].getFloat(w.x()) && fr[2].getFloat(w.y()) &&
fr[3].getFloat(w.z()) && fr[4].getFloat(w.w())) {
myobj.setOutlineColor(w);
fr += 5;

View File

@@ -66,7 +66,7 @@ bool MultiTextureControl_writeLocalData(const osg::Object &obj, osgDB::Output &f
fw.indent() << "TextureWeights "<<mtc.getNumTextureWeights()<<" {"<< std::endl;
fw.moveIn();
for(unsigned int i=0; i<mtc.getNumTextureWeights();++i)
{
fw.indent() << mtc.getTextureWeight(i)<<std::endl;

View File

@@ -24,7 +24,7 @@ bool Scribe_readLocalData(osg::Object &obj, osgDB::Input &fr)
if (fr[0].matchWord("wireframeColor")) {
osg::Vec4 w;
if (fr[1].getFloat(w.x()) && fr[2].getFloat(w.y()) &&
if (fr[1].getFloat(w.x()) && fr[2].getFloat(w.y()) &&
fr[3].getFloat(w.z()) && fr[4].getFloat(w.w())) {
myobj.setWireframeColor(w);
fr += 5;

View File

@@ -42,7 +42,7 @@ bool SpecularHighlights_readLocalData(osg::Object &obj, osgDB::Input &fr)
if (fr[0].matchWord("specularColor")) {
osg::Vec4 w;
if (fr[1].getFloat(w.x()) && fr[2].getFloat(w.y()) &&
if (fr[1].getFloat(w.x()) && fr[2].getFloat(w.y()) &&
fr[3].getFloat(w.z()) && fr[4].getFloat(w.w())) {
myobj.setSpecularColor(w);
fr += 5;

View File

@@ -34,7 +34,7 @@ bool AngularDampingOperator_readLocalData(osg::Object &obj, osgDB::Input &fr)
itAdvanced = true;
}
}
float low = 0.0f, high = FLT_MAX;
if (fr[0].matchWord("cutoff")) {
if (fr[1].getFloat(low) && fr[2].getFloat(high)) {
@@ -52,7 +52,7 @@ bool AngularDampingOperator_writeLocalData(const osg::Object &obj, osgDB::Output
const osgParticle::AngularDampingOperator &adp = static_cast<const osgParticle::AngularDampingOperator &>(obj);
osg::Vec3 a = adp.getDamping();
fw.indent() << "damping " << a.x() << " " << a.y() << " " << a.z() << std::endl;
float low = adp.getCutoffLow(), high = adp.getCutoffHigh();
fw.indent() << "cutoff " << low << " " << high << std::endl;
return true;

View File

@@ -34,7 +34,7 @@ bool BounceOperator_readLocalData(osg::Object &obj, osgDB::Input &fr)
itAdvanced = true;
}
}
if (fr[0].matchWord("resilience")) {
if (fr[1].getFloat(value)) {
bp.setResilience(value);
@@ -42,7 +42,7 @@ bool BounceOperator_readLocalData(osg::Object &obj, osgDB::Input &fr)
itAdvanced = true;
}
}
if (fr[0].matchWord("cutoff")) {
if (fr[1].getFloat(value)) {
bp.setCutoff(value);

View File

@@ -57,7 +57,7 @@ bool BoxPlacer_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
const osgParticle::BoxPlacer &myobj = static_cast<const osgParticle::BoxPlacer &>(obj);
osgParticle::rangef r;
r = myobj.getXRange();
fw.indent() << "xRange " << r.minimum << " " << r.maximum << std::endl;
r = myobj.getYRange();

View File

@@ -50,6 +50,6 @@ bool ConstantRateCounter_writeLocalData(const osg::Object &obj, osgDB::Output &f
fw.indent() << "minimumNumberOfParticlesToCreate " << myobj.getMinimumNumberOfParticlesToCreate() << std::endl;
fw.indent() << "numberOfParticlesPerSecondToCreate " << myobj.getNumberOfParticlesPerSecondToCreate() << std::endl;
return true;
}

View File

@@ -34,7 +34,7 @@ bool DampingOperator_readLocalData(osg::Object &obj, osgDB::Input &fr)
itAdvanced = true;
}
}
float low = 0.0f, high = FLT_MAX;
if (fr[0].matchWord("cutoff")) {
if (fr[1].getFloat(low) && fr[2].getFloat(high)) {
@@ -52,7 +52,7 @@ bool DampingOperator_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
const osgParticle::DampingOperator &dp = static_cast<const osgParticle::DampingOperator &>(obj);
osg::Vec3 a = dp.getDamping();
fw.indent() << "damping " << a.x() << " " << a.y() << " " << a.z() << std::endl;
float low = dp.getCutoffLow(), high = dp.getCutoffHigh();
fw.indent() << "cutoff " << low << " " << high << std::endl;
return true;

View File

@@ -31,7 +31,7 @@ bool DomainOperator_readLocalData(osg::Object &obj, osgDB::Input &fr)
{
if (fr[1].getStr()) typeName = fr[1].getStr();
fr += 3;
osgParticle::DomainOperator::Domain::Type type = osgParticle::DomainOperator::Domain::UNDEFINED_DOMAIN;
if (typeName == "point") type = osgParticle::DomainOperator::Domain::POINT_DOMAIN;
else if (typeName == "line") type = osgParticle::DomainOperator::Domain::LINE_DOMAIN;
@@ -41,7 +41,7 @@ bool DomainOperator_readLocalData(osg::Object &obj, osgDB::Input &fr)
else if (typeName == "sphere") type = osgParticle::DomainOperator::Domain::SPHERE_DOMAIN;
else if (typeName == "box") type = osgParticle::DomainOperator::Domain::BOX_DOMAIN;
else if (typeName == "disk") type = osgParticle::DomainOperator::Domain::DISK_DOMAIN;
osgParticle::DomainOperator::Domain domain(type);
if (fr[0].matchWord("plane")) {
if (fr[1].getFloat(domain.plane[0]) && fr[2].getFloat(domain.plane[1]) &&
@@ -50,42 +50,42 @@ bool DomainOperator_readLocalData(osg::Object &obj, osgDB::Input &fr)
fr += 5;
}
}
if (fr[0].matchWord("vertices1")) {
if (fr[1].getFloat(domain.v1[0]) && fr[2].getFloat(domain.v1[1]) && fr[3].getFloat(domain.v1[2]))
{
fr += 4;
}
}
if (fr[0].matchWord("vertices2")) {
if (fr[1].getFloat(domain.v2[0]) && fr[2].getFloat(domain.v2[1]) && fr[3].getFloat(domain.v2[2]))
{
fr += 4;
}
}
if (fr[0].matchWord("vertices3")) {
if (fr[1].getFloat(domain.v3[0]) && fr[2].getFloat(domain.v3[1]) && fr[3].getFloat(domain.v3[2]))
{
fr += 4;
}
}
if (fr[0].matchWord("basis1")) {
if (fr[1].getFloat(domain.s1[0]) && fr[2].getFloat(domain.s1[1]) && fr[3].getFloat(domain.s1[2]))
{
fr += 4;
}
}
if (fr[0].matchWord("basis2")) {
if (fr[1].getFloat(domain.s2[0]) && fr[2].getFloat(domain.s2[1]) && fr[3].getFloat(domain.s2[2]))
{
fr += 4;
}
}
if (fr[0].matchWord("factors")) {
if (fr[1].getFloat(domain.r1) && fr[2].getFloat(domain.r2))
{
@@ -93,7 +93,7 @@ bool DomainOperator_readLocalData(osg::Object &obj, osgDB::Input &fr)
}
}
dp.addDomain(domain);
++fr;
itAdvanced = true;
}
@@ -103,11 +103,11 @@ bool DomainOperator_readLocalData(osg::Object &obj, osgDB::Input &fr)
bool DomainOperator_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
{
const osgParticle::DomainOperator &dp = static_cast<const osgParticle::DomainOperator &>(obj);
for(unsigned int i=0;i<dp.getNumDomains();++i)
{
const osgParticle::DomainOperator::Domain& domain = dp.getDomain(i);
switch (domain.type)
{
case osgParticle::DomainOperator::Domain::POINT_DOMAIN:
@@ -129,7 +129,7 @@ bool DomainOperator_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
default:
fw.indent() << "domain undefined {" << std::endl; break;
}
fw.moveIn();
fw.indent() << "plane " << domain.plane << std::endl;
fw.indent() << "vertices1 " << domain.v1 << std::endl;
@@ -138,7 +138,7 @@ bool DomainOperator_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
fw.indent() << "basis1 " << domain.s1 << std::endl;
fw.indent() << "basis2 " << domain.s2 << std::endl;
fw.indent() << "factors " << domain.r1 << " " << domain.r2 << std::endl;
fw.moveOut();
fw.indent() << "}" << std::endl;
}

View File

@@ -46,7 +46,7 @@ bool Emitter_readLocalData(osg::Object &obj, osgDB::Input &fr)
osgParticle::Particle P;
if (read_particle(fr, P)) {
myobj.setParticleTemplate(P);
}
}
}
return itAdvanced;

View File

@@ -34,7 +34,7 @@ bool ExplosionOperator_readLocalData(osg::Object &obj, osgDB::Input &fr)
itAdvanced = true;
}
}
float value = 0.0f;
if (fr[0].matchWord("radius")) {
if (fr[1].getFloat(value)) {
@@ -43,7 +43,7 @@ bool ExplosionOperator_readLocalData(osg::Object &obj, osgDB::Input &fr)
itAdvanced = true;
}
}
if (fr[0].matchWord("magnitude")) {
if (fr[1].getFloat(value)) {
ep.setMagnitude(value);
@@ -51,7 +51,7 @@ bool ExplosionOperator_readLocalData(osg::Object &obj, osgDB::Input &fr)
itAdvanced = true;
}
}
if (fr[0].matchWord("epsilon")) {
if (fr[1].getFloat(value)) {
ep.setEpsilon(value);
@@ -59,7 +59,7 @@ bool ExplosionOperator_readLocalData(osg::Object &obj, osgDB::Input &fr)
itAdvanced = true;
}
}
if (fr[0].matchWord("sigma")) {
if (fr[1].getFloat(value)) {
ep.setSigma(value);
@@ -76,7 +76,7 @@ bool ExplosionOperator_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
const osgParticle::ExplosionOperator &ep = static_cast<const osgParticle::ExplosionOperator &>(obj);
osg::Vec3 a = ep.getCenter();
fw.indent() << "center " << a.x() << " " << a.y() << " " << a.z() << std::endl;
fw.indent() << "radius " << ep.getRadius() << std::endl;
fw.indent() << "magnitude " << ep.getMagnitude() << std::endl;
fw.indent() << "epsilon " << ep.getEpsilon() << std::endl;

View File

@@ -70,7 +70,7 @@ bool FluidFrictionOperator_writeLocalData(const osg::Object &obj, osgDB::Output
fw.indent() << "fluidDensity " << aop.getFluidDensity() << std::endl;
fw.indent() << "fluidViscosity " << aop.getFluidViscosity() << std::endl;
fw.indent() << "overrideRadius " << aop.getOverrideRadius() << std::endl;
osg::Vec3 w = aop.getWind();
fw.indent() << "wind " << w << std::endl;
return true;

View File

@@ -38,7 +38,7 @@ bool FluidProgram_readLocalData(osg::Object &obj, osgDB::Input &fr)
itAdvanced = true;
}
}
if (fr[0].matchWord("viscosity")) {
if (fr[1].getFloat(f)) {
myobj.setFluidViscosity(f);
@@ -46,7 +46,7 @@ bool FluidProgram_readLocalData(osg::Object &obj, osgDB::Input &fr)
itAdvanced = true;
}
}
if (fr[0].matchWord("density")) {
if (fr[1].getFloat(f)) {
myobj.setFluidDensity(f);
@@ -72,16 +72,16 @@ bool FluidProgram_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
osg::Vec3 vec;
float f;
vec = myobj.getAcceleration();
fw.indent() << "acceleration " << vec << std::endl;
f = myobj.getFluidViscosity();
fw.indent() << "viscosity " << f << std::endl;
f = myobj.getFluidDensity();
fw.indent() << "density " << f << std::endl;
vec = myobj.getWind();
fw.indent() << "wind " << vec << std::endl;

View File

@@ -30,7 +30,7 @@ bool ModularEmitter_readLocalData(osg::Object &obj, osgDB::Input &fr)
myobj.setCounter(counter);
itAdvanced = true;
}
osgParticle::Placer *placer = static_cast<osgParticle::Placer *>(fr.readObjectOfType(osgDB::type_wrapper<osgParticle::Placer>()));
if (placer) {
myobj.setPlacer(placer);

View File

@@ -28,7 +28,7 @@ bool MultiSegmentPlacer_readLocalData(osg::Object &obj, osgDB::Input &fr)
osg::Vec3 v;
if (fr[0].matchWord("vertex")) {
if (fr[0].matchWord("vertex")) {
if (fr[1].getFloat(v.x()) && fr[2].getFloat(v.y()) && fr[3].getFloat(v.z())) {
myobj.addVertex(v);
fr += 4;

View File

@@ -34,7 +34,7 @@ bool OrbitOperator_readLocalData(osg::Object &obj, osgDB::Input &fr)
itAdvanced = true;
}
}
float value = 0.0f;
if (fr[0].matchWord("magnitude")) {
if (fr[1].getFloat(value)) {
@@ -43,7 +43,7 @@ bool OrbitOperator_readLocalData(osg::Object &obj, osgDB::Input &fr)
itAdvanced = true;
}
}
if (fr[0].matchWord("epsilon")) {
if (fr[1].getFloat(value)) {
op.setEpsilon(value);
@@ -51,7 +51,7 @@ bool OrbitOperator_readLocalData(osg::Object &obj, osgDB::Input &fr)
itAdvanced = true;
}
}
if (fr[0].matchWord("maxRadius")) {
if (fr[1].getFloat(value)) {
op.setMaxRadius(value);
@@ -68,7 +68,7 @@ bool OrbitOperator_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
const osgParticle::OrbitOperator &op = static_cast<const osgParticle::OrbitOperator &>(obj);
osg::Vec3 a = op.getCenter();
fw.indent() << "center " << a.x() << " " << a.y() << " " << a.z() << std::endl;
fw.indent() << "magnitude " << op.getMagnitude() << std::endl;
fw.indent() << "epsilon " << op.getEpsilon() << std::endl;
fw.indent() << "maxRadius " << op.getMaxRadius() << std::endl;

View File

@@ -134,7 +134,7 @@ bool read_particle(osgDB::Input &fr, osgParticle::Particle &P)
itAdvanced = true;
}
}
// interpolators

View File

@@ -23,7 +23,7 @@ bool ParticleEffect_readLocalData(osg::Object& object, osgDB::Input& fr)
{
osgParticle::ParticleEffect& effect = static_cast<osgParticle::ParticleEffect&>(object);
bool itrAdvanced = false;
if (fr.matchSequence("textFileName %s"))
{
effect.setTextureFileName(fr[1].getStr());
@@ -37,7 +37,7 @@ bool ParticleEffect_readLocalData(osg::Object& object, osgDB::Input& fr)
fr[1].getFloat(position[0]);
fr[2].getFloat(position[1]);
fr[3].getFloat(position[2]);
effect.setPosition(position);
fr += 4;
@@ -49,17 +49,17 @@ bool ParticleEffect_readLocalData(osg::Object& object, osgDB::Input& fr)
float scale;
fr[1].getFloat(scale);
effect.setScale(scale);
fr += 2;
itrAdvanced = true;
}
if (fr.matchSequence("intensity %f"))
{
float intensity;
fr[1].getFloat(intensity);
effect.setIntensity(intensity);
fr += 2;
itrAdvanced = true;
}
@@ -69,7 +69,7 @@ bool ParticleEffect_readLocalData(osg::Object& object, osgDB::Input& fr)
float startTime;
fr[1].getFloat(startTime);
effect.setStartTime(startTime);
fr += 2;
itrAdvanced = true;
}
@@ -79,7 +79,7 @@ bool ParticleEffect_readLocalData(osg::Object& object, osgDB::Input& fr)
float emitterDuration;
fr[1].getFloat(emitterDuration);
effect.setEmitterDuration(emitterDuration);
fr += 2;
itrAdvanced = true;
}
@@ -96,7 +96,7 @@ bool ParticleEffect_readLocalData(osg::Object& object, osgDB::Input& fr)
fr += 2;
itrAdvanced = true;
}
if (fr[0].matchWord("particleSizeRange"))
{
osgParticle::rangef r;
@@ -131,12 +131,12 @@ bool ParticleEffect_readLocalData(osg::Object& object, osgDB::Input& fr)
itrAdvanced = true;
}
}
if (particleSet)
{
effect.setDefaultParticleTemplate(particle);
}
if (fr.matchSequence("wind %f %f %f"))
{
@@ -144,13 +144,13 @@ bool ParticleEffect_readLocalData(osg::Object& object, osgDB::Input& fr)
fr[1].getFloat(wind[0]);
fr[2].getFloat(wind[1]);
fr[3].getFloat(wind[2]);
effect.setWind(wind);
fr += 4;
itrAdvanced = true;
}
if (fr[0].matchWord("useLocalParticleSystem"))
{
if (fr[1].matchWord("FALSE"))
@@ -215,7 +215,7 @@ bool ParticleEffect_writeLocalData(const osg::Object& object, osgDB::Output& fw)
fw.indent()<<"useLocalParticleSystem ";
if (effect.getUseLocalParticleSystem()) fw<<"TRUE"<<std::endl;
else
else
{
fw<<"FALSE"<<std::endl;
fw.writeObject(*effect.getParticleSystem());

View File

@@ -31,12 +31,12 @@ bool ParticleProcessor_readLocalData(osg::Object &obj, osgDB::Input &fr)
bool itAdvanced = false;
osg::ref_ptr<osgParticle::ParticleSystem> ps_proto = new osgParticle::ParticleSystem;
osgParticle::ParticleSystem *ps = static_cast<osgParticle::ParticleSystem *>(fr.readObjectOfType(*ps_proto));
if (ps) {
myobj.setParticleSystem(ps);
itAdvanced = true;
}
}
if (fr[0].matchWord("enabled")) {
if (fr[1].matchWord("TRUE")) {
@@ -121,7 +121,7 @@ bool ParticleProcessor_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
if (myobj.getParticleSystem()) fw.writeObject(*myobj.getParticleSystem());
fw.indent() << "enabled ";
if (myobj.isEnabled())
if (myobj.isEnabled())
fw << "TRUE" << std::endl;
else
fw << "FALSE" << std::endl;

View File

@@ -85,7 +85,7 @@ bool ParticleSystem_readLocalData(osg::Object &obj, osgDB::Input &fr)
itAdvanced = true;
}
}
if (fr[0].matchWord("useShaders")) {
if (fr[1].matchWord("TRUE")) {
myobj.setUseShaders(true);
@@ -133,7 +133,7 @@ bool ParticleSystem_readLocalData(osg::Object &obj, osgDB::Input &fr)
itAdvanced = true;
}
}
if (fr[0].matchWord("defaultBoundingBox")) {
osg::BoundingBox bbox;
if ( fr[1].getFloat(bbox.xMin()) &&
@@ -147,7 +147,7 @@ bool ParticleSystem_readLocalData(osg::Object &obj, osgDB::Input &fr)
itAdvanced = true;
}
}
if (fr[0].matchWord("sortMode")) {
if (fr[1].matchWord("NO_SORT")) {
myobj.setSortMode(osgParticle::ParticleSystem::NO_SORT);
@@ -165,7 +165,7 @@ bool ParticleSystem_readLocalData(osg::Object &obj, osgDB::Input &fr)
itAdvanced = true;
}
}
if (fr[0].matchWord("visibilityDistance")) {
double distance;
if (fr[1].getFloat(distance)) {
@@ -174,15 +174,15 @@ bool ParticleSystem_readLocalData(osg::Object &obj, osgDB::Input &fr)
itAdvanced = true;
}
}
if (fr[0].matchWord("particleTemplate")) {
if (fr[0].matchWord("particleTemplate")) {
++fr;
itAdvanced = true;
osgParticle::Particle P;
if (read_particle(fr, P)) {
myobj.setDefaultParticleTemplate(P);
}
}
}
return itAdvanced;
}
@@ -229,15 +229,15 @@ bool ParticleSystem_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
fw << "TRUE" << std::endl;
else
fw << "FALSE" << std::endl;
fw.indent() << "doublePassRendering ";
if (myobj.getDoublePassRendering())
fw << "TRUE" << std::endl;
else
fw << "FALSE" << std::endl;
fw.indent() << "frozen ";
if (myobj.isFrozen())
if (myobj.isFrozen())
fw << "TRUE" << std::endl;
else
fw << "FALSE" << std::endl;
@@ -248,7 +248,7 @@ bool ParticleSystem_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
else
fw << "FALSE" << std::endl;
osg::BoundingBox bbox = myobj.getDefaultBoundingBox();
osg::BoundingBox bbox = myobj.getDefaultBoundingBox();
fw.indent() << "defaultBoundingBox ";
fw << bbox.xMin() << " " << bbox.yMin() << " " << bbox.zMin() << " ";
fw << bbox.xMax() << " " << bbox.yMax() << " " << bbox.zMax() << std::endl;
@@ -266,7 +266,7 @@ bool ParticleSystem_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
fw << "SORT_BACK_TO_FRONT" << std::endl;
break;
}
fw.indent() << "visibilityDistance " << myobj.getVisibilityDistance() << std::endl;
fw.indent() << "particleTemplate ";

View File

@@ -20,7 +20,7 @@ REGISTER_DOTOSGWRAPPER(PSU_Proxy)
bool PSU_readLocalData(osg::Object &obj, osgDB::Input &fr)
{
osgParticle::ParticleSystemUpdater &myobj = static_cast<osgParticle::ParticleSystemUpdater &>(obj);
osgParticle::ParticleSystemUpdater &myobj = static_cast<osgParticle::ParticleSystemUpdater &>(obj);
bool itAdvanced = false;
osg::ref_ptr<osgParticle::ParticleSystem> proto = new osgParticle::ParticleSystem;
@@ -35,7 +35,7 @@ bool PSU_readLocalData(osg::Object &obj, osgDB::Input &fr)
bool PSU_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
{
const osgParticle::ParticleSystemUpdater &myobj = static_cast<const osgParticle::ParticleSystemUpdater &>(obj);
const osgParticle::ParticleSystemUpdater &myobj = static_cast<const osgParticle::ParticleSystemUpdater &>(obj);
for (unsigned int i=0; i<myobj.getNumParticleSystems(); ++i) {
fw.writeObject(*myobj.getParticleSystem(i));

View File

@@ -74,7 +74,7 @@ bool RadialShooter_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
fw.indent() << "phiRange " << r.minimum << " " << r.maximum << std::endl;
r = myobj.getInitialSpeedRange();
fw.indent() << "initialSpeedRange " << r.minimum << " " << r.maximum << std::endl;
osgParticle::rangev3 rv = myobj.getInitialRotationalSpeedRange();
osg::Vec3 v1 = rv.minimum;
osg::Vec3 v2 = rv.maximum;

View File

@@ -49,7 +49,7 @@ bool SectorPlacer_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
const osgParticle::SectorPlacer &myobj = static_cast<const osgParticle::SectorPlacer &>(obj);
osgParticle::rangef r;
r = myobj.getRadiusRange();
fw.indent() << "radiusRange " << r.minimum << " " << r.maximum << std::endl;
r = myobj.getPhiRange();

View File

@@ -36,12 +36,12 @@ bool SinkOperator_readLocalData(osg::Object &obj, osgDB::Input &fr)
sp.setSinkTarget(osgParticle::SinkOperator::SINK_VELOCITY);
else if (str == "angular_velocity")
sp.setSinkTarget(osgParticle::SinkOperator::SINK_ANGULAR_VELOCITY);
fr += 2;
itAdvanced = true;
}
}
if (fr[0].matchWord("sinkStrategy")) {
const char *ptstr = fr[1].getStr();
if (ptstr) {
@@ -50,19 +50,19 @@ bool SinkOperator_readLocalData(osg::Object &obj, osgDB::Input &fr)
sp.setSinkStrategy(osgParticle::SinkOperator::SINK_INSIDE);
else if (str == "outside")
sp.setSinkStrategy(osgParticle::SinkOperator::SINK_OUTSIDE);
fr += 2;
itAdvanced = true;
}
}
return itAdvanced;
}
bool SinkOperator_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
{
const osgParticle::SinkOperator &sp = static_cast<const osgParticle::SinkOperator &>(obj);
fw.indent() << "sinkTarget ";
switch (sp.getSinkTarget())
{
@@ -75,7 +75,7 @@ bool SinkOperator_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
default:
fw << "undefined" << std::endl; break;
}
fw.indent() << "sinkStrategy ";
switch (sp.getSinkStrategy())
{
@@ -86,6 +86,6 @@ bool SinkOperator_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
default:
fw << "undefined" << std::endl; break;
}
return true;
}

View File

@@ -32,7 +32,7 @@ bool VariableRateCounter_readLocalData(osg::Object &obj, osgDB::Input &fr)
itAdvanced = true;
}
}
return itAdvanced;
}
@@ -42,6 +42,6 @@ bool VariableRateCounter_writeLocalData(const osg::Object &obj, osgDB::Output &f
osgParticle::rangef r = myobj.getRateRange();
fw.indent() << "rateRange " << r.minimum << " " << r.maximum << std::endl;
return true;
}

View File

@@ -43,7 +43,7 @@ bool ShadowedScene_readLocalData(osg::Object& obj, osgDB::Input &fr)
bool ShadowedScene_writeLocalData(const osg::Object& obj, osgDB::Output& fw)
{
const osgShadow::ShadowedScene& ss = static_cast<const osgShadow::ShadowedScene &>(obj);
if (ss.getShadowTechnique())
{
fw.writeObject(*ss.getShadowTechnique());

View File

@@ -35,7 +35,7 @@ bool DOFTransform_readLocalData(Object& obj, Input& fr)
{
fr += 2; // skip over "putMatrix {"
iteratorAdvanced = true;
bool matched = true;
for(int k=0;k<16 && matched;++k)
{
@@ -55,11 +55,11 @@ bool DOFTransform_readLocalData(Object& obj, Input& fr)
k++;
}
}
dof.setPutMatrix(matrix);
dof.setInversePutMatrix(Matrix::inverse(matrix));
}
fr.advanceToEndOfCurrentBlock();
}
@@ -74,20 +74,20 @@ bool DOFTransform_readLocalData(Object& obj, Input& fr)
fr+=4; \
iteratorAdvanced = true; \
} \
}
}
Vec3 vec3;
ReadVec3(setMinHPR,"minHPR")
ReadVec3(setMaxHPR,"maxHPR")
ReadVec3(setIncrementHPR,"incrementHPR")
ReadVec3(setCurrentHPR,"currentHPR")
ReadVec3(setMinTranslate,"minTranslate")
ReadVec3(setMaxTranslate,"maxTranslate")
ReadVec3(setIncrementTranslate,"incrementTranslate")
ReadVec3(setCurrentTranslate,"currentTranslate")
ReadVec3(setMinScale,"minScale")
ReadVec3(setMaxScale,"maxScale")
ReadVec3(setIncrementScale,"incrementScale")
@@ -102,30 +102,30 @@ bool DOFTransform_readLocalData(Object& obj, Input& fr)
else if(fr[1].matchWord("RHP")) dof.setHPRMultOrder(DOFTransform::RHP);
else if(fr[1].matchWord("RPH")) dof.setHPRMultOrder(DOFTransform::RPH);
}
if (fr.matchSequence("limitationFlags %i"))
{
unsigned int flags;
fr[1].getUInt(flags);
dof.setLimitationFlags(flags);
fr += 2;
iteratorAdvanced = true;
}
if (fr[0].matchWord("animationOn"))
{
if (fr[1].matchWord("TRUE")) dof.setAnimationOn(true);
else if (fr[1].matchWord("FALSE")) dof.setAnimationOn(false);
fr += 2;
iteratorAdvanced = true;
}
#undef ReadVec3
return iteratorAdvanced;

View File

@@ -30,7 +30,7 @@ bool MultiSwitch_readLocalData(Object& obj, Input& fr)
if (fr[0].matchWord("NewChildDefaultValue"))
{
if (fr[1].matchWord("TRUE"))
if (fr[1].matchWord("TRUE"))
{
sw.setNewChildDefaultValue(true);
iteratorAdvanced = true;
@@ -57,7 +57,7 @@ bool MultiSwitch_readLocalData(Object& obj, Input& fr)
unsigned int switchSet;
fr[1].getUInt(switchSet);
fr+=2;
sw.setActiveSwitchSet(switchSet);
}
@@ -85,9 +85,9 @@ bool MultiSwitch_readLocalData(Object& obj, Input& fr)
}
++fr;
iteratorAdvanced = true;
}
return iteratorAdvanced;

View File

@@ -77,7 +77,7 @@ bool ElevationSector_readLocalData(osg::Object &obj, osgDB::Input &fr)
float minElevation;
float maxElevation;
float fadeAngle;
fr[1].getFloat(minElevation);
fr[2].getFloat(maxElevation);
fr[3].getFloat(fadeAngle);
@@ -138,7 +138,7 @@ bool AzimElevationSector_readLocalData(osg::Object &obj, osgDB::Input &fr)
float minElevation;
float maxElevation;
float fadeAngle;
fr[1].getFloat(minElevation);
fr[2].getFloat(maxElevation);
fr[3].getFloat(fadeAngle);

View File

@@ -28,9 +28,9 @@ bool ShapeAttributeList_readLocalData(osg::Object &obj, osgDB::Input &fr)
bool iteratorAdvanced = false;
ShapeAttributeList &sal = static_cast<ShapeAttributeList &>(obj);
int entry = fr[0].getNoNestedBrackets();
while (!fr.eof() && fr[0].getNoNestedBrackets()>=entry)
{
if (fr.matchSequence("string %s %s"))
@@ -61,7 +61,7 @@ bool ShapeAttributeList_readLocalData(osg::Object &obj, osgDB::Input &fr)
return iteratorAdvanced;
}
bool ShapeAttributeList_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
{
const ShapeAttributeList &sal = static_cast<const ShapeAttributeList &>(obj);

View File

@@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 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.
*/
@@ -43,7 +43,7 @@ bool CompositeLayer_readLocalData(osg::Object& obj, osgDB::Input &fr)
osgTerrain::CompositeLayer& layer = static_cast<osgTerrain::CompositeLayer&>(obj);
bool itrAdvanced = false;
osg::ref_ptr<osgTerrain::Locator> locator = 0;
do
@@ -87,11 +87,11 @@ bool CompositeLayer_readLocalData(osg::Object& obj, osgDB::Input &fr)
if (locator.valid()) proxyLayer->setLocator(locator.get());
if (minLevel!=0) proxyLayer->setMinLevel(minLevel);
if (maxLevel!=MAXIMUM_NUMBER_OF_LEVELS) proxyLayer->setMaxLevel(maxLevel);
layer.addLayer(proxyLayer);
}
fr += 2;
itrAdvanced = true;
@@ -116,9 +116,9 @@ bool CompositeLayer_readLocalData(osg::Object& obj, osgDB::Input &fr)
if (readObject.valid()) itrAdvanced = true;
}
} while (itrAdvanced);
if (locator.valid()) layer.setLocator(locator.get());
return itrAdvanced;
@@ -142,22 +142,22 @@ bool CompositeLayer_writeLocalData(const osg::Object& obj, osgDB::Output& fw)
{
fw.writeObject(*locator);
}
if (proxyLayer->getMinLevel()!=0)
{
fw.indent()<<"MinLevel "<<proxyLayer->getMinLevel()<<std::endl;
}
}
if (proxyLayer->getMaxLevel()!=MAXIMUM_NUMBER_OF_LEVELS)
{
fw.indent()<<"MaxLevel "<<proxyLayer->getMaxLevel()<<std::endl;
}
}
fw.indent()<<"ProxyLayer "<<proxyLayer->getCompoundName()<<std::endl;
}
}
else
{
{
fw.writeObject(*(layer.getLayer(i)));
}
}

View File

@@ -30,7 +30,7 @@ bool HeightFieldLayer_readLocalData(osg::Object& obj, osgDB::Input &fr)
osgTerrain::HeightFieldLayer& layer = static_cast<osgTerrain::HeightFieldLayer&>(obj);
bool itrAdvanced = false;
if (fr.matchSequence("file %w") || fr.matchSequence("file %s"))
{
std::string setname;
@@ -43,7 +43,7 @@ bool HeightFieldLayer_readLocalData(osg::Object& obj, osgDB::Input &fr)
{
layer.setName(setname);
layer.setFileName(filename);
layer.setHeightField(hf.get());
layer.setHeightField(hf.get());
}
}
fr += 2;
@@ -58,14 +58,14 @@ bool HeightFieldLayer_readLocalData(osg::Object& obj, osgDB::Input &fr)
{
layer.setHeightField(hf);
}
return itrAdvanced;
}
bool HeightFieldLayer_writeLocalData(const osg::Object& obj, osgDB::Output& fw)
{
const osgTerrain::HeightFieldLayer& layer = static_cast<const osgTerrain::HeightFieldLayer&>(obj);
if (!layer.getFileName().empty())
{
std::string str = osgTerrain::createCompoundSetNameAndFileName(layer.getName(), layer.getFileName());

Some files were not shown because too many files have changed in this diff Show More