Added Locator::s/getTransformScaledByResolution(bool) to assist with VPB integration

This commit is contained in:
Robert Osfield 2007-12-13 17:51:43 +00:00
parent 3bfa74222b
commit f7e91fa28e
3 changed files with 20 additions and 3 deletions

View File

@ -106,6 +106,9 @@ class OSGTERRAIN_EXPORT Locator : public osg::Object
void setDefinedInFile(bool flag) { _definedInFile = flag; }
bool getDefinedInFile() const { return _definedInFile; }
void setTransformScaledByResolution(bool scaledByResolution) { _transformScaledByResolution = scaledByResolution; }
bool getTransformScaledByResolution() const { return _transformScaledByResolution; }
protected:
virtual ~Locator();
@ -120,6 +123,7 @@ class OSGTERRAIN_EXPORT Locator : public osg::Object
osg::Matrixd _inverse;
bool _definedInFile;
bool _transformScaledByResolution;
};

View File

@ -81,6 +81,8 @@ osgTerrain::Layer* readLayer(osgDB::Input& fr, bool& itrAdvanced)
}
if (fr.matchSequence("CoordinateSystem %w") || fr.matchSequence("CoordinateSystem %s") )
{
locator->setCoordinateSystem(fr[1].getStr());
@ -89,6 +91,13 @@ osgTerrain::Layer* readLayer(osgDB::Input& fr, bool& itrAdvanced)
localAdvanced = true;
}
if (fr.matchSequence("TransformScaledByResolution %w"))
{
locator->setTransformScaledByResolution(fr[1].matchWord("TRUE") || fr[1].matchWord("True") || fr[1].matchWord("true"));
fr += 2;
localAdvanced = true;
}
if (fr.matchSequence("Transform {"))
{
int tansform_entry = fr[0].getNoNestedBrackets();
@ -520,6 +529,8 @@ bool writeLocator(const osgTerrain::Locator& locator, osgDB::Output& fw)
}
}
fw.indent()<<"TransformScaledByResolution " << (locator.getTransformScaledByResolution() ? "TRUE":"FALSE") <<std::endl;
const osg::Matrixd& matrix = locator.getTransform();
fw.indent() << "Transform {" << std::endl;
fw.moveIn();

View File

@ -25,7 +25,8 @@ using namespace osgTerrain;
Locator::Locator():
_coordinateSystemType(PROJECTED),
_ellipsoidModel(new osg::EllipsoidModel()),
_definedInFile(false)
_definedInFile(false),
_transformScaledByResolution(false)
{
}
@ -36,7 +37,8 @@ Locator::Locator(const Locator& locator,const osg::CopyOp& copyop):
_format(locator._format),
_cs(locator._cs),
_transform(locator._transform),
_definedInFile(locator._definedInFile)
_definedInFile(locator._definedInFile),
_transformScaledByResolution(locator._transformScaledByResolution)
{
}