osgTerrain/Layer
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 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
* (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
* OpenSceneGraph Public License for more details.
*/
#ifndef OSGTERRAIN_LAYER
#define OSGTERRAIN_LAYER 1
#include <osg/Image>
#include <osg/Shape>
#include <osg/Array>
#include <osg/TransferFunction>
#include <osgTerrain/Locator>
#include <osgTerrain/ValidDataOperator>
namespace osgTerrain {
#define MAXIMUM_NUMBER_OF_LEVELS 30
extern OSGTERRAIN_EXPORT void extractSetNameAndFileName(const std::string& compoundstring, std::string& setname, std::string& filename);
extern OSGTERRAIN_EXPORT std::string createCompoundSetNameAndFileName(const std::string& setname, const std::string& filename);
class OSGTERRAIN_EXPORT Layer : public osg::Object
{
public:
Layer();
Layer(const Layer&,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
META_Object(osgTerrain, Layer);
void setSetName(const std::string& setname) { setName(setname); }
const std::string& getSetName() const { return getName(); }
virtual void setFileName(const std::string& filename) { _filename = filename; }
virtual const std::string& getFileName() const { return _filename; }
std::string getCompoundName() const { return createCompoundSetNameAndFileName(getName(), getFileName()); }
void setLocator(Locator* locator) { _locator = locator; }
template<class T> void setLocator(const osg::ref_ptr<T>& locator) { setLocator(locator.get()); }
Locator* getLocator() { return _locator.get(); }
const Locator* getLocator() const { return _locator.get(); }
void setMinLevel(unsigned int minLevel) { _minLevel = minLevel; }
unsigned int getMinLevel() const { return _minLevel; }
void setMaxLevel(unsigned int maxLevel) { _maxLevel = maxLevel; }
unsigned int getMaxLevel() const { return _maxLevel; }
void setValidDataOperator(ValidDataOperator* validDataOp) { _validDataOperator = validDataOp; }
ValidDataOperator* getValidDataOperator() { return _validDataOperator.get(); }
const ValidDataOperator* getValidDataOperator() const { return _validDataOperator.get(); }
virtual unsigned int getNumColumns() const { return 0; }
virtual unsigned int getNumRows() const { return 0; }
void setDefaultValue(const osg::Vec4& value) { _defaultValue = value; }
const osg::Vec4& getDefaultValue() const { return _defaultValue; }
void setMinFilter(osg::Texture::FilterMode filter) { _minFilter = filter; }
osg::Texture::FilterMode getMinFilter() const { return _minFilter; }
void setMagFilter(osg::Texture::FilterMode filter) { _magFilter = filter; }
osg::Texture::FilterMode getMagFilter() const { return _magFilter; }
virtual osg::Image* getImage() { return 0; }
virtual const osg::Image* getImage() const { return 0; }
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; }
virtual bool getValue(unsigned int /*i*/, unsigned int /*j*/, osg::Vec3& /*value*/) const { return false; }
virtual bool getValue(unsigned int /*i*/, unsigned int /*j*/, osg::Vec4& /*value*/) const { return false; }
inline bool getValidValue(unsigned int i, unsigned int j, float& value) const
{
if (getValue(i,j,value)) return _validDataOperator.valid() ? (*_validDataOperator)(value) : true;
return false;
}
inline bool getValidValue(unsigned int i, unsigned int j, osg::Vec2& value) const
{
if (getValue(i,j,value)) return _validDataOperator.valid() ? (*_validDataOperator)(value) : true;
return false;
}
inline bool getValidValue(unsigned int i, unsigned int j, osg::Vec3& value) const
{
if (getValue(i,j,value)) return _validDataOperator.valid() ? (*_validDataOperator)(value) : true;
return false;
}
inline bool getValidValue(unsigned int i, unsigned int j, osg::Vec4& value) const
{
if (getValue(i,j,value)) return _validDataOperator.valid() ? (*_validDataOperator)(value) : true;
return false;
}
inline void computeIndices(double ndc_x, double ndc_y, unsigned int& i, unsigned int& j, double& ir, double& jr) const
{
ndc_x *= double(getNumColumns()-1);
ndc_y *= double(getNumRows()-1);
i = (unsigned int)(ndc_x);
j = (unsigned int)(ndc_y);
ir = ndc_x - double(i);
jr = ndc_y - double(j);
}
inline bool getInterpolatedValue(double ndc_x, double ndc_y, float& value) const
{
unsigned int i,j;
double ir, jr;
computeIndices(ndc_x, ndc_y, i, j, ir, jr);
value = 0.0f;
double div = 0.0f;
float v,r;
r = (1.0f-ir)*(1.0f-jr);
if (r>0.0 && getValue(i,j,v))
{
value += v*r;
div += r;
}
r = (ir)*(1.0f-jr);
if (r>0.0 && getValue(i+1,j,v))
{
value += v*r;
div += r;
}
r = (ir)*(jr);
if (r>0.0 && getValue(i+1,j+1,v))
{
value += v*r;
div += r;
}
r = (1.0f-ir)*(jr);
if (r>0.0 && getValue(i,j+1,v))
{
value += v*r;
div += r;
}
if (div != 0.0)
{
value /= div;
return true;
}
value = 0.0;
return false;
}
inline bool getInterpolatedValidValue(double ndc_x, double ndc_y, float& value) const
{
unsigned int i,j;
double ir, jr;
computeIndices(ndc_x, ndc_y, i, j, ir, jr);
value = 0.0f;
double div = 0.0f;
float v,r;
r = (1.0f-ir)*(1.0f-jr);
if (r>0.0 && getValidValue(i,j,v))
{
value += v*r;
div += r;
}
r = (ir)*(1.0f-jr);
if (r>0.0 && getValidValue(i+1,j,v))
{
value += v*r;
div += r;
}
r = (ir)*(jr);
if (r>0.0 && getValidValue(i+1,j+1,v))
{
value += v*r;
div += r;
}
r = (1.0f-ir)*(jr);
if (r>0.0 && getValidValue(i,j+1,v))
{
value += v*r;
div += r;
}
if (div != 0.0)
{
value /= div;
return true;
}
value = 0.0;
return false;
}
virtual void dirty() {}
virtual void setModifiedCount(unsigned int /*value*/) {}
virtual unsigned int getModifiedCount() const { return 0; }
virtual osg::BoundingSphere computeBound(bool treatAsElevationLayer) const;
protected:
virtual ~Layer();
std::string _filename;
osg::ref_ptr<Locator> _locator;
unsigned int _minLevel;
unsigned int _maxLevel;
osg::ref_ptr<ValidDataOperator> _validDataOperator;
osg::Vec4 _defaultValue;
osg::Texture::FilterMode _minFilter;
osg::Texture::FilterMode _magFilter;
};
class OSGTERRAIN_EXPORT ImageLayer : public Layer
{
public:
ImageLayer(osg::Image* image=0);
ImageLayer(const ImageLayer& imageLayer,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
META_Object(osgTerrain, ImageLayer);
void setFileName(const std::string& filename) { _filename = filename; if (_image.valid()) _image->setFileName(filename); }
virtual const std::string& getFileName() const { return _image.get() ? _image->getFileName() : _filename; }
virtual bool transform(float offset, float scale);
void setImage(osg::Image* image);
template<class T> void setImage(const osg::ref_ptr<T>& image) { return setImage(image.get()); }
virtual osg::Image* getImage() { return _image.get(); }
virtual const osg::Image* getImage() const { return _image.get(); }
virtual unsigned int getNumColumns() const { return _image.valid() ? _image->s() : 0; }
virtual unsigned int getNumRows() const { return _image.valid() ? _image->t() : 0; }
virtual bool getValue(unsigned int i, unsigned int j, float& value) const;
virtual bool getValue(unsigned int i, unsigned int j, osg::Vec2& value) const;
virtual bool getValue(unsigned int i, unsigned int j, osg::Vec3& value) const;
virtual bool getValue(unsigned int i, unsigned int j, osg::Vec4& value) const;
virtual void dirty();
virtual void setModifiedCount(unsigned int value);
virtual unsigned int getModifiedCount() const;
protected:
virtual ~ImageLayer() {}
osg::ref_ptr<osg::Image> _image;
};
class OSGTERRAIN_EXPORT ContourLayer : public Layer
{
public:
ContourLayer(osg::TransferFunction1D* tf=0);
ContourLayer(const ContourLayer& tfLayer,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
META_Object(osgTerrain, ContourLayer);
virtual bool transform(float offset, float scale);
void setTransferFunction(osg::TransferFunction1D* tf);
template<class T> void setTransferFunction(const osg::ref_ptr<T>& tf) { return setTransferFunction(tf.get()); }
osg::TransferFunction1D* getTransferFunction() { return _tf.get(); }
const osg::TransferFunction1D* getTransferFunction() const { return _tf.get(); }
virtual osg::Image* getImage() { return _tf.valid() ? _tf->getImage() : 0; }
virtual const osg::Image* getImage() const { return _tf.valid() ? _tf->getImage() : 0; }
virtual unsigned int getNumColumns() const { return _tf.valid() ? _tf->getNumberImageCells() : 0; }
virtual unsigned int getNumRows() const { return _tf.valid() ? 1 : 0; }
virtual bool getValue(unsigned int i, unsigned int j, float& value) const;
virtual bool getValue(unsigned int i, unsigned int j, osg::Vec2& value) const;
virtual bool getValue(unsigned int i, unsigned int j, osg::Vec3& value) const;
virtual bool getValue(unsigned int i, unsigned int j, osg::Vec4& value) const;
virtual void dirty();
virtual void setModifiedCount(unsigned int value);
virtual unsigned int getModifiedCount() const;
protected:
virtual ~ContourLayer() {}
osg::ref_ptr<osg::TransferFunction1D> _tf;
};
class OSGTERRAIN_EXPORT HeightFieldLayer : public Layer
{
public:
HeightFieldLayer(osg::HeightField* hf=0);
HeightFieldLayer(const HeightFieldLayer& hfLayer,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
META_Object(osgTerrain, HeightFieldLayer);
void setFileName(const std::string& filename) { _filename = filename; }
virtual const std::string& getFileName() const { return _filename; }
virtual bool transform(float offset, float scale);
void setHeightField(osg::HeightField* hf);
template<class T> void setHeightField(const osg::ref_ptr<T>& hf) { return setHeightField(hf.get()); }
osg::HeightField* getHeightField() { return _heightField.get(); }
const osg::HeightField* getHeightField() const { return _heightField.get(); }
virtual unsigned int getNumColumns() const { return _heightField.valid() ? _heightField->getNumColumns() : 0; }
virtual unsigned int getNumRows() const { return _heightField.valid() ? _heightField->getNumRows() : 0; }
virtual bool getValue(unsigned int i, unsigned int j, float& value) const;
virtual bool getValue(unsigned int i, unsigned int j, osg::Vec2& value) const;
virtual bool getValue(unsigned int i, unsigned int j, osg::Vec3& value) const;
virtual bool getValue(unsigned int i, unsigned int j, osg::Vec4& value) const;
virtual void dirty();
virtual void setModifiedCount(unsigned int value);
virtual unsigned int getModifiedCount() const;
protected:
virtual ~HeightFieldLayer() {}
unsigned int _modifiedCount;
osg::ref_ptr<osg::HeightField> _heightField;
};
class OSGTERRAIN_EXPORT ProxyLayer : public Layer
{
public:
ProxyLayer();
ProxyLayer(const ProxyLayer& proxyLayer,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
META_Object(osgTerrain, ProxyLayer);
virtual osg::Image* getImage()
{
return _implementation.valid() ? _implementation->getImage() : 0;
}
virtual const osg::Image* getImage() const
{
return _implementation.valid() ? _implementation->getImage() : 0;
}
void setImplementation(Layer* layer) { _implementation = layer; }
Layer* getImplementation() { return _implementation.get(); }
const Layer* getImplementation() const { return _implementation.get(); }
virtual void setFileName(const std::string& filename);
virtual const std::string& getFileName() const { return _filename; }
virtual unsigned int getNumColumns() const;
virtual unsigned int getNumRows() const;
virtual bool transform(float offset, float scale);
virtual bool getValue(unsigned int i, unsigned int j, float& value) const;
virtual bool getValue(unsigned int i, unsigned int j, osg::Vec2& value) const;
virtual bool getValue(unsigned int i, unsigned int j, osg::Vec3& value) const;
virtual bool getValue(unsigned int i, unsigned int j, osg::Vec4& value) const;
virtual void dirty();
virtual void setModifiedCount(unsigned int value);
virtual unsigned int getModifiedCount() const;
virtual osg::BoundingSphere computeBound(bool treatAsElevationLayer) const;
protected:
virtual ~ProxyLayer();
osg::ref_ptr<Layer> _implementation;
};
class OSGTERRAIN_EXPORT CompositeLayer : public Layer
{
public:
CompositeLayer();
CompositeLayer(const CompositeLayer& compositeLayer,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
META_Object(osgTerrain, CompositeLayer);
void clear();
void setSetName(unsigned int i, const std::string& setname) { _layers[i].setname = setname; if (_layers[i].layer.valid()) _layers[i].layer->setName(setname); }
const std::string& getSetName(unsigned int i) const { return _layers[i].layer.valid() ? _layers[i].layer->getName() : _layers[i].setname; }
void setFileName(unsigned int i, const std::string& filename) { _layers[i].filename = filename; if (_layers[i].layer.valid()) _layers[i].layer->setFileName(filename); }
const std::string& getFileName(unsigned int i) const { return _layers[i].layer.valid() ? _layers[i].layer->getFileName() : _layers[i].filename; }
void setCompoundName(unsigned int i, const std::string& compoundname);
std::string getCompoundName(unsigned int i) const;
void setLayer(unsigned int i, Layer* layer) { if (i>=_layers.size()) _layers.resize(i+1); _layers[i].layer = layer; }
template<class T> void setLayer(unsigned int i, const osg::ref_ptr<T>& layer) { setLayer(i, layer.get()); }
Layer* getLayer(unsigned int i) { return i<_layers.size() ? _layers[i].layer.get() : 0; }
const Layer* getLayer(unsigned int i) const { return i<_layers.size() ? _layers[i].layer.get() : 0; }
void addLayer(const std::string& compoundname);
void addLayer(const std::string& setname, const std::string& filename);
void addLayer(Layer* layer) { _layers.push_back(CompoundNameLayer(layer->getName(),layer->getFileName(),layer)); }
template<class T> void addLayer(const osg::ref_ptr<T>& layer) { return addLayer(layer.get()); }
void removeLayer(unsigned int i) { _layers.erase(_layers.begin()+i); }
unsigned int getNumLayers() const { return static_cast<unsigned int>(_layers.size()); }
protected:
virtual ~CompositeLayer() {}
struct CompoundNameLayer
{
CompoundNameLayer() {}
CompoundNameLayer(const CompoundNameLayer& cnl):
setname(cnl.setname),
filename(cnl.filename),
layer(cnl.layer) {}
CompoundNameLayer(const std::string& sn, const std::string& fn, Layer* l):
setname(sn),
filename(fn),
layer(l) {}
CompoundNameLayer& operator = (const CompoundNameLayer& cnl)
{
if (&cnl==this) return *this;
setname = cnl.setname;
filename = cnl.filename;
layer = cnl.layer;
return *this;
}
std::string setname;
std::string filename;
osg::ref_ptr<Layer> layer;
};
typedef std::vector< CompoundNameLayer > Layers;
Layers _layers;
};
class OSGTERRAIN_EXPORT SwitchLayer : public CompositeLayer
{
public:
SwitchLayer();
SwitchLayer(const SwitchLayer& switchLayer,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
META_Object(osgTerrain, SwitchLayer);
void setActiveLayer(int i) { _activeLayer = i; }
int getActiveLayer() const { return _activeLayer; }
virtual osg::Image* getImage()
{
if (_activeLayer < 0) return 0;
if (_activeLayer >= static_cast<int>(getNumLayers())) return 0;
return _layers[_activeLayer].layer->getImage();
}
virtual const osg::Image* getImage() const
{
if (_activeLayer < 0) return 0;
if (_activeLayer >= static_cast<int>(getNumLayers())) return 0;
return _layers[_activeLayer].layer->getImage();
}
protected:
virtual ~SwitchLayer() {}
int _activeLayer;
};
}
#endif
Array
Image
Shape
TransferFunction
ValidDataOperator
osgTerrain::CompositeLayer::CompositeLayer
CompositeLayer()
osgTerrain::CompositeLayer::clear
void clear()
osgTerrain::CompositeLayer::getLayer
Layer * getLayer(unsigned int i)
Definition osgTerrain/Layer:533
osgTerrain::CompositeLayer::META_Object
META_Object(osgTerrain, CompositeLayer)
osgTerrain::CompositeLayer::getFileName
const std::string & getFileName(unsigned int i) const
Definition osgTerrain/Layer:523
osgTerrain::CompositeLayer::Layers
std::vector< CompoundNameLayer > Layers
Definition osgTerrain/Layer:582
osgTerrain::CompositeLayer::addLayer
void addLayer(const std::string &compoundname)
osgTerrain::CompositeLayer::CompositeLayer
CompositeLayer(const CompositeLayer &compositeLayer, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osgTerrain::CompositeLayer::setSetName
void setSetName(unsigned int i, const std::string &setname)
Definition osgTerrain/Layer:514
osgTerrain::CompositeLayer::setCompoundName
void setCompoundName(unsigned int i, const std::string &compoundname)
osgTerrain::CompositeLayer::~CompositeLayer
virtual ~CompositeLayer()
Definition osgTerrain/Layer:551
osgTerrain::CompositeLayer::getSetName
const std::string & getSetName(unsigned int i) const
Definition osgTerrain/Layer:517
osgTerrain::CompositeLayer::_layers
Layers _layers
Definition osgTerrain/Layer:584
osgTerrain::CompositeLayer::getNumLayers
unsigned int getNumLayers() const
Definition osgTerrain/Layer:547
osgTerrain::CompositeLayer::setLayer
void setLayer(unsigned int i, Layer *layer)
Definition osgTerrain/Layer:529
osgTerrain::CompositeLayer::removeLayer
void removeLayer(unsigned int i)
Definition osgTerrain/Layer:545
osgTerrain::CompositeLayer::getCompoundName
std::string getCompoundName(unsigned int i) const
osgTerrain::CompositeLayer::addLayer
void addLayer(Layer *layer)
Definition osgTerrain/Layer:541
osgTerrain::CompositeLayer::setLayer
void setLayer(unsigned int i, const osg::ref_ptr< T > &layer)
Definition osgTerrain/Layer:531
osgTerrain::CompositeLayer::getLayer
const Layer * getLayer(unsigned int i) const
Definition osgTerrain/Layer:535
osgTerrain::CompositeLayer::setFileName
void setFileName(unsigned int i, const std::string &filename)
Definition osgTerrain/Layer:520
osgTerrain::CompositeLayer::addLayer
void addLayer(const std::string &setname, const std::string &filename)
osgTerrain::CompositeLayer::addLayer
void addLayer(const osg::ref_ptr< T > &layer)
Definition osgTerrain/Layer:543
osgTerrain::ContourLayer::getValue
virtual bool getValue(unsigned int i, unsigned int j, osg::Vec3 &value) const
osgTerrain::ContourLayer::getNumColumns
virtual unsigned int getNumColumns() const
Definition osgTerrain/Layer:375
osgTerrain::ContourLayer::getTransferFunction
const osg::TransferFunction1D * getTransferFunction() const
Definition osgTerrain/Layer:366
osgTerrain::ContourLayer::getModifiedCount
virtual unsigned int getModifiedCount() const
osgTerrain::ContourLayer::getTransferFunction
osg::TransferFunction1D * getTransferFunction()
Definition osgTerrain/Layer:365
osgTerrain::ContourLayer::dirty
virtual void dirty()
osgTerrain::ContourLayer::setTransferFunction
void setTransferFunction(osg::TransferFunction1D *tf)
osgTerrain::ContourLayer::ContourLayer
ContourLayer(const ContourLayer &tfLayer, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osgTerrain::ContourLayer::getImage
virtual osg::Image * getImage()
Definition osgTerrain/Layer:369
osgTerrain::ContourLayer::getNumRows
virtual unsigned int getNumRows() const
Definition osgTerrain/Layer:376
osgTerrain::ContourLayer::getValue
virtual bool getValue(unsigned int i, unsigned int j, float &value) const
osgTerrain::ContourLayer::transform
virtual bool transform(float offset, float scale)
osgTerrain::ContourLayer::setModifiedCount
virtual void setModifiedCount(unsigned int value)
osgTerrain::ContourLayer::ContourLayer
ContourLayer(osg::TransferFunction1D *tf=0)
osgTerrain::ContourLayer::~ContourLayer
virtual ~ContourLayer()
Definition osgTerrain/Layer:389
osgTerrain::ContourLayer::setTransferFunction
void setTransferFunction(const osg::ref_ptr< T > &tf)
Definition osgTerrain/Layer:363
osgTerrain::ContourLayer::getValue
virtual bool getValue(unsigned int i, unsigned int j, osg::Vec4 &value) const
osgTerrain::ContourLayer::getValue
virtual bool getValue(unsigned int i, unsigned int j, osg::Vec2 &value) const
osgTerrain::ContourLayer::getImage
virtual const osg::Image * getImage() const
Definition osgTerrain/Layer:372
osgTerrain::ContourLayer::META_Object
META_Object(osgTerrain, ContourLayer)
osgTerrain::ContourLayer::_tf
osg::ref_ptr< osg::TransferFunction1D > _tf
Definition osgTerrain/Layer:391
osgTerrain::HeightFieldLayer::dirty
virtual void dirty()
osgTerrain::HeightFieldLayer::setHeightField
void setHeightField(osg::HeightField *hf)
osgTerrain::HeightFieldLayer::getNumRows
virtual unsigned int getNumRows() const
Definition osgTerrain/Layer:419
osgTerrain::HeightFieldLayer::getNumColumns
virtual unsigned int getNumColumns() const
Definition osgTerrain/Layer:418
osgTerrain::HeightFieldLayer::setFileName
void setFileName(const std::string &filename)
Definition osgTerrain/Layer:406
osgTerrain::HeightFieldLayer::~HeightFieldLayer
virtual ~HeightFieldLayer()
Definition osgTerrain/Layer:432
osgTerrain::HeightFieldLayer::getValue
virtual bool getValue(unsigned int i, unsigned int j, osg::Vec3 &value) const
osgTerrain::HeightFieldLayer::setModifiedCount
virtual void setModifiedCount(unsigned int value)
osgTerrain::HeightFieldLayer::getModifiedCount
virtual unsigned int getModifiedCount() const
osgTerrain::HeightFieldLayer::getHeightField
osg::HeightField * getHeightField()
Definition osgTerrain/Layer:415
osgTerrain::HeightFieldLayer::_heightField
osg::ref_ptr< osg::HeightField > _heightField
Definition osgTerrain/Layer:435
osgTerrain::HeightFieldLayer::getFileName
virtual const std::string & getFileName() const
Definition osgTerrain/Layer:407
osgTerrain::HeightFieldLayer::META_Object
META_Object(osgTerrain, HeightFieldLayer)
osgTerrain::HeightFieldLayer::transform
virtual bool transform(float offset, float scale)
osgTerrain::HeightFieldLayer::HeightFieldLayer
HeightFieldLayer(const HeightFieldLayer &hfLayer, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osgTerrain::HeightFieldLayer::_modifiedCount
unsigned int _modifiedCount
Definition osgTerrain/Layer:434
osgTerrain::HeightFieldLayer::getHeightField
const osg::HeightField * getHeightField() const
Definition osgTerrain/Layer:416
osgTerrain::HeightFieldLayer::HeightFieldLayer
HeightFieldLayer(osg::HeightField *hf=0)
osgTerrain::HeightFieldLayer::getValue
virtual bool getValue(unsigned int i, unsigned int j, osg::Vec4 &value) const
osgTerrain::HeightFieldLayer::getValue
virtual bool getValue(unsigned int i, unsigned int j, osg::Vec2 &value) const
osgTerrain::HeightFieldLayer::setHeightField
void setHeightField(const osg::ref_ptr< T > &hf)
Definition osgTerrain/Layer:413
osgTerrain::HeightFieldLayer::getValue
virtual bool getValue(unsigned int i, unsigned int j, float &value) const
osgTerrain::ImageLayer::setImage
void setImage(const osg::ref_ptr< T > &image)
Definition osgTerrain/Layer:320
osgTerrain::ImageLayer::getNumRows
virtual unsigned int getNumRows() const
Definition osgTerrain/Layer:329
osgTerrain::ImageLayer::getImage
virtual const osg::Image * getImage() const
Definition osgTerrain/Layer:326
osgTerrain::ImageLayer::ImageLayer
ImageLayer(const ImageLayer &imageLayer, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osgTerrain::ImageLayer::getNumColumns
virtual unsigned int getNumColumns() const
Definition osgTerrain/Layer:328
osgTerrain::ImageLayer::getValue
virtual bool getValue(unsigned int i, unsigned int j, osg::Vec4 &value) const
osgTerrain::ImageLayer::transform
virtual bool transform(float offset, float scale)
osgTerrain::ImageLayer::dirty
virtual void dirty()
osgTerrain::ImageLayer::getValue
virtual bool getValue(unsigned int i, unsigned int j, osg::Vec2 &value) const
osgTerrain::ImageLayer::getValue
virtual bool getValue(unsigned int i, unsigned int j, osg::Vec3 &value) const
osgTerrain::ImageLayer::~ImageLayer
virtual ~ImageLayer()
Definition osgTerrain/Layer:342
osgTerrain::ImageLayer::getValue
virtual bool getValue(unsigned int i, unsigned int j, float &value) const
osgTerrain::ImageLayer::setImage
void setImage(osg::Image *image)
osgTerrain::ImageLayer::META_Object
META_Object(osgTerrain, ImageLayer)
osgTerrain::ImageLayer::setFileName
void setFileName(const std::string &filename)
Definition osgTerrain/Layer:313
osgTerrain::ImageLayer::_image
osg::ref_ptr< osg::Image > _image
Definition osgTerrain/Layer:344
osgTerrain::ImageLayer::ImageLayer
ImageLayer(osg::Image *image=0)
osgTerrain::ImageLayer::getModifiedCount
virtual unsigned int getModifiedCount() const
osgTerrain::ImageLayer::setModifiedCount
virtual void setModifiedCount(unsigned int value)
osgTerrain::ImageLayer::getImage
virtual osg::Image * getImage()
Definition osgTerrain/Layer:323
osgTerrain::ImageLayer::getFileName
virtual const std::string & getFileName() const
Definition osgTerrain/Layer:314
osgTerrain::Layer::getDefaultValue
const osg::Vec4 & getDefaultValue() const
Definition osgTerrain/Layer:92
osgTerrain::Layer::getValidDataOperator
const ValidDataOperator * getValidDataOperator() const
Definition osgTerrain/Layer:82
osgTerrain::Layer::getMaxLevel
unsigned int getMaxLevel() const
Definition osgTerrain/Layer:73
osgTerrain::Layer::getInterpolatedValidValue
bool getInterpolatedValidValue(double ndc_x, double ndc_y, float &value) const
Definition osgTerrain/Layer:229
osgTerrain::Layer::getLocator
const Locator * getLocator() const
Definition osgTerrain/Layer:67
osgTerrain::Layer::getModifiedCount
virtual unsigned int getModifiedCount() const
Definition osgTerrain/Layer:283
osgTerrain::Layer::setSetName
void setSetName(const std::string &setname)
Definition osgTerrain/Layer:48
osgTerrain::Layer::transform
virtual bool transform(float, float)
Definition osgTerrain/Layer:117
osgTerrain::Layer::getNumRows
virtual unsigned int getNumRows() const
Definition osgTerrain/Layer:89
osgTerrain::Layer::_minLevel
unsigned int _minLevel
Definition osgTerrain/Layer:293
osgTerrain::Layer::getImage
virtual osg::Image * getImage()
Definition osgTerrain/Layer:111
osgTerrain::Layer::getValue
virtual bool getValue(unsigned int, unsigned int, osg::Vec2 &) const
Definition osgTerrain/Layer:127
osgTerrain::Layer::Layer
Layer(const Layer &, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osgTerrain::Layer::setMagFilter
void setMagFilter(osg::Texture::FilterMode filter)
Definition osgTerrain/Layer:103
osgTerrain::Layer::getValue
virtual bool getValue(unsigned int, unsigned int, osg::Vec3 &) const
Definition osgTerrain/Layer:128
osgTerrain::Layer::getMinLevel
unsigned int getMinLevel() const
Definition osgTerrain/Layer:70
osgTerrain::Layer::dirty
virtual void dirty()
Definition osgTerrain/Layer:277
osgTerrain::Layer::setModifiedCount
virtual void setModifiedCount(unsigned int)
Definition osgTerrain/Layer:280
osgTerrain::Layer::Layer
Layer()
osgTerrain::Layer::META_Object
META_Object(osgTerrain, Layer)
osgTerrain::Layer::_validDataOperator
osg::ref_ptr< ValidDataOperator > _validDataOperator
Definition osgTerrain/Layer:295
osgTerrain::Layer::setMinLevel
void setMinLevel(unsigned int minLevel)
Definition osgTerrain/Layer:69
osgTerrain::Layer::getCompoundName
std::string getCompoundName() const
Definition osgTerrain/Layer:60
osgTerrain::Layer::_maxLevel
unsigned int _maxLevel
Definition osgTerrain/Layer:294
osgTerrain::Layer::getValidValue
bool getValidValue(unsigned int i, unsigned int j, osg::Vec3 &value) const
Definition osgTerrain/Layer:143
osgTerrain::Layer::setFileName
virtual void setFileName(const std::string &filename)
Definition osgTerrain/Layer:54
osgTerrain::Layer::setMinFilter
void setMinFilter(osg::Texture::FilterMode filter)
Definition osgTerrain/Layer:96
osgTerrain::Layer::getValidValue
bool getValidValue(unsigned int i, unsigned int j, osg::Vec2 &value) const
Definition osgTerrain/Layer:137
osgTerrain::Layer::setMaxLevel
void setMaxLevel(unsigned int maxLevel)
Definition osgTerrain/Layer:72
osgTerrain::Layer::getInterpolatedValue
bool getInterpolatedValue(double ndc_x, double ndc_y, float &value) const
Definition osgTerrain/Layer:182
osgTerrain::Layer::getValidValue
bool getValidValue(unsigned int i, unsigned int j, float &value) const
Definition osgTerrain/Layer:131
osgTerrain::Layer::setValidDataOperator
void setValidDataOperator(ValidDataOperator *validDataOp)
Definition osgTerrain/Layer:76
osgTerrain::Layer::getSetName
const std::string & getSetName() const
Definition osgTerrain/Layer:51
osgTerrain::Layer::getValue
virtual bool getValue(unsigned int, unsigned int, osg::Vec4 &) const
Definition osgTerrain/Layer:129
osgTerrain::Layer::getMagFilter
osg::Texture::FilterMode getMagFilter() const
Definition osgTerrain/Layer:106
osgTerrain::Layer::_minFilter
osg::Texture::FilterMode _minFilter
Definition osgTerrain/Layer:297
osgTerrain::Layer::computeBound
virtual osg::BoundingSphere computeBound(bool treatAsElevationLayer) const
osgTerrain::Layer::getMinFilter
osg::Texture::FilterMode getMinFilter() const
Definition osgTerrain/Layer:99
osgTerrain::Layer::setDefaultValue
void setDefaultValue(const osg::Vec4 &value)
Definition osgTerrain/Layer:91
osgTerrain::Layer::getValidDataOperator
ValidDataOperator * getValidDataOperator()
Definition osgTerrain/Layer:79
osgTerrain::Layer::_filename
std::string _filename
Definition osgTerrain/Layer:291
osgTerrain::Layer::computeIndices
void computeIndices(double ndc_x, double ndc_y, unsigned int &i, unsigned int &j, double &ir, double &jr) const
Definition osgTerrain/Layer:165
osgTerrain::Layer::getImage
virtual const osg::Image * getImage() const
Definition osgTerrain/Layer:114
osgTerrain::Layer::getFileName
virtual const std::string & getFileName() const
Definition osgTerrain/Layer:57
osgTerrain::Layer::getValue
virtual bool getValue(unsigned int, unsigned int, float &) const
Definition osgTerrain/Layer:126
osgTerrain::Layer::getNumColumns
virtual unsigned int getNumColumns() const
Definition osgTerrain/Layer:86
osgTerrain::Layer::setLocator
void setLocator(const osg::ref_ptr< T > &locator)
Definition osgTerrain/Layer:64
osgTerrain::Layer::_magFilter
osg::Texture::FilterMode _magFilter
Definition osgTerrain/Layer:298
osgTerrain::Layer::getValidValue
bool getValidValue(unsigned int i, unsigned int j, osg::Vec4 &value) const
Definition osgTerrain/Layer:149
osgTerrain::Layer::getLocator
Locator * getLocator()
Definition osgTerrain/Layer:66
osgTerrain::Layer::_defaultValue
osg::Vec4 _defaultValue
Definition osgTerrain/Layer:296
osgTerrain::Layer::setLocator
void setLocator(Locator *locator)
Definition osgTerrain/Layer:62
osgTerrain::Layer::~Layer
virtual ~Layer()
osgTerrain::Layer::_locator
osg::ref_ptr< Locator > _locator
Definition osgTerrain/Layer:292
osgTerrain::Locator
Definition osgTerrain/Locator:26
osgTerrain::ProxyLayer::getValue
virtual bool getValue(unsigned int i, unsigned int j, float &value) const
osgTerrain::ProxyLayer::~ProxyLayer
virtual ~ProxyLayer()
osgTerrain::ProxyLayer::dirty
virtual void dirty()
osgTerrain::ProxyLayer::ProxyLayer
ProxyLayer()
osgTerrain::ProxyLayer::getFileName
virtual const std::string & getFileName() const
Definition osgTerrain/Layer:473
osgTerrain::ProxyLayer::getValue
virtual bool getValue(unsigned int i, unsigned int j, osg::Vec3 &value) const
osgTerrain::ProxyLayer::getNumRows
virtual unsigned int getNumRows() const
osgTerrain::ProxyLayer::META_Object
META_Object(osgTerrain, ProxyLayer)
osgTerrain::ProxyLayer::getNumColumns
virtual unsigned int getNumColumns() const
osgTerrain::ProxyLayer::setImplementation
void setImplementation(Layer *layer)
Definition osgTerrain/Layer:464
osgTerrain::ProxyLayer::transform
virtual bool transform(float offset, float scale)
osgTerrain::ProxyLayer::getImplementation
Layer * getImplementation()
Definition osgTerrain/Layer:467
osgTerrain::ProxyLayer::computeBound
virtual osg::BoundingSphere computeBound(bool treatAsElevationLayer) const
osgTerrain::ProxyLayer::ProxyLayer
ProxyLayer(const ProxyLayer &proxyLayer, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osgTerrain::ProxyLayer::getImplementation
const Layer * getImplementation() const
Definition osgTerrain/Layer:470
osgTerrain::ProxyLayer::getModifiedCount
virtual unsigned int getModifiedCount() const
osgTerrain::ProxyLayer::getValue
virtual bool getValue(unsigned int i, unsigned int j, osg::Vec2 &value) const
osgTerrain::ProxyLayer::getImage
virtual osg::Image * getImage()
Definition osgTerrain/Layer:452
osgTerrain::ProxyLayer::setModifiedCount
virtual void setModifiedCount(unsigned int value)
osgTerrain::ProxyLayer::setFileName
virtual void setFileName(const std::string &filename)
osgTerrain::ProxyLayer::getValue
virtual bool getValue(unsigned int i, unsigned int j, osg::Vec4 &value) const
osgTerrain::ProxyLayer::_implementation
osg::ref_ptr< Layer > _implementation
Definition osgTerrain/Layer:495
osgTerrain::ProxyLayer::getImage
virtual const osg::Image * getImage() const
Definition osgTerrain/Layer:458
osgTerrain::SwitchLayer::getImage
virtual osg::Image * getImage()
Definition osgTerrain/Layer:603
osgTerrain::SwitchLayer::getActiveLayer
int getActiveLayer() const
Definition osgTerrain/Layer:600
osgTerrain::SwitchLayer::setActiveLayer
void setActiveLayer(int i)
Definition osgTerrain/Layer:599
osgTerrain::SwitchLayer::SwitchLayer
SwitchLayer(const SwitchLayer &switchLayer, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osgTerrain::SwitchLayer::SwitchLayer
SwitchLayer()
osgTerrain::SwitchLayer::META_Object
META_Object(osgTerrain, SwitchLayer)
osgTerrain::SwitchLayer::_activeLayer
int _activeLayer
Definition osgTerrain/Layer:622
osgTerrain::SwitchLayer::~SwitchLayer
virtual ~SwitchLayer()
Definition osgTerrain/Layer:620
osgTerrain::SwitchLayer::getImage
virtual const osg::Image * getImage() const
Definition osgTerrain/Layer:611
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::HeightField
Definition Shape:483
osg::Image
Definition Image:179
osg::Object
Definition Object:61
osg::Object::setName
virtual void setName(const std::string &name)
Definition Object:203
osg::Object::getName
const std::string & getName() const
Definition Object:213
osg::Texture::FilterMode
FilterMode
Definition Texture:499
osg::TransferFunction1D
Definition TransferFunction:56
osg::ref_ptr
Definition ref_ptr:32
osg::ref_ptr::get
T * get() const
Definition ref_ptr:117
osgTerrain
Definition Node:29
osgTerrain::extractSetNameAndFileName
OSGTERRAIN_EXPORT void extractSetNameAndFileName(const std::string &compoundstring, std::string &setname, std::string &filename)
osgTerrain::createCompoundSetNameAndFileName
OSGTERRAIN_EXPORT std::string createCompoundSetNameAndFileName(const std::string &setname, const std::string &filename)
osg::Vec2
Vec2f Vec2
Definition Vec2:21
osg::Vec3
Vec3f Vec3
Definition Vec3:21
osg::BoundingSphere
BoundingSphered BoundingSphere
Definition BoundingSphere:314
osg::Vec4
Vec4f Vec4
Definition Vec4:21
OSGTERRAIN_EXPORT
#define OSGTERRAIN_EXPORT
Definition osgTerrain/Export:39
Locator
osgTerrain::CompositeLayer::CompoundNameLayer
Definition osgTerrain/Layer:554
osgTerrain::CompositeLayer::CompoundNameLayer::CompoundNameLayer
CompoundNameLayer()
Definition osgTerrain/Layer:555
osgTerrain::CompositeLayer::CompoundNameLayer::CompoundNameLayer
CompoundNameLayer(const std::string &sn, const std::string &fn, Layer *l)
Definition osgTerrain/Layer:562
osgTerrain::CompositeLayer::CompoundNameLayer::layer
osg::ref_ptr< Layer > layer
Definition osgTerrain/Layer:579
osgTerrain::CompositeLayer::CompoundNameLayer::setname
std::string setname
Definition osgTerrain/Layer:577
osgTerrain::CompositeLayer::CompoundNameLayer::filename
std::string filename
Definition osgTerrain/Layer:578
osgTerrain::CompositeLayer::CompoundNameLayer::CompoundNameLayer
CompoundNameLayer(const CompoundNameLayer &cnl)
Definition osgTerrain/Layer:557
osgTerrain::ValidDataOperator
Definition ValidDataOperator:26