Added supoort for transforming layers by an offset and scale

This commit is contained in:
Robert Osfield
2007-05-10 18:07:54 +00:00
parent c1332f6893
commit 8c7b5b5865
3 changed files with 127 additions and 0 deletions

View File

@@ -43,6 +43,8 @@ class OSGTERRAIN_EXPORT Layer : public osg::Object
void setDefaultValue(const osg::Vec4& value) { _defaultValue = value; }
const osg::Vec4& getDefaultValue() const { return _defaultValue; }
virtual bool transform(float offset, float scale) { return false; }
virtual bool getValue(unsigned int /*i*/, unsigned int /*j*/, float& /*value*/) const { return false; }
virtual bool getValue(unsigned int /*i*/, unsigned int /*j*/, osg::Vec2& /*value*/) const { return false; }
@@ -127,6 +129,7 @@ class OSGTERRAIN_EXPORT ImageLayer : public Layer
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
ImageLayer(const ImageLayer& imageLayer,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
virtual bool transform(float offset, float scale);
void setImage(osg::Image* image);
osg::Image* getImage() { return _image.get(); }
@@ -157,6 +160,7 @@ class OSGTERRAIN_EXPORT HeightFieldLayer : public Layer
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
HeightFieldLayer(const HeightFieldLayer& hfLayer,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
virtual bool transform(float offset, float scale);
void setHeightField(osg::HeightField* hf);
osg::HeightField* getHeightField() { return _heightField.get(); }