osgTerrain::Layer Class Reference

`#include <Layer>`

Inheritance diagram for osgTerrain::Layer:

## Public Member Functions

| Layer ()
| Layer (const Layer &, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
| META_Object (osgTerrain, Layer)
void | setSetName (const std::string &setname)
const std::string & | getSetName () const
virtual void | setFileName (const std::string &filename)
virtual const std::string & | getFileName () const
std::string | getCompoundName () const
void | setLocator (Locator *locator)
template<class T>
void | setLocator (const osg::ref_ptr< T > &locator)
Locator * | getLocator ()
const Locator * | getLocator () const
void | setMinLevel (unsigned int minLevel)
unsigned int | getMinLevel () const
void | setMaxLevel (unsigned int maxLevel)
unsigned int | getMaxLevel () const
void | setValidDataOperator (ValidDataOperator *validDataOp)
ValidDataOperator * | getValidDataOperator ()
const ValidDataOperator * | getValidDataOperator () const
virtual unsigned int | getNumColumns () const
virtual unsigned int | getNumRows () const
void | setDefaultValue (const osg::Vec4 &value)
const osg::Vec4 & | getDefaultValue () const
void | setMinFilter (osg::Texture::FilterMode filter)
osg::Texture::FilterMode | getMinFilter () const
void | setMagFilter (osg::Texture::FilterMode filter)
osg::Texture::FilterMode | getMagFilter () const
virtual osg::Image * | getImage ()
virtual const osg::Image * | getImage () const
virtual bool | transform (float, float)
virtual bool | getValue (unsigned int, unsigned int, float &) const
virtual bool | getValue (unsigned int, unsigned int, osg::Vec2 &) const
virtual bool | getValue (unsigned int, unsigned int, osg::Vec3 &) const
virtual bool | getValue (unsigned int, unsigned int, osg::Vec4 &) const
bool | getValidValue (unsigned int i, unsigned int j, float &value) const
bool | getValidValue (unsigned int i, unsigned int j, osg::Vec2 &value) const
bool | getValidValue (unsigned int i, unsigned int j, osg::Vec3 &value) const
bool | getValidValue (unsigned int i, unsigned int j, osg::Vec4 &value) const
void | computeIndices (double ndc_x, double ndc_y, unsigned int &i, unsigned int &j, double &ir, double &jr) const
bool | getInterpolatedValue (double ndc_x, double ndc_y, float &value) const
bool | getInterpolatedValidValue (double ndc_x, double ndc_y, float &value) const
virtual void | dirty ()
virtual void | setModifiedCount (unsigned int)
virtual unsigned int | getModifiedCount () const
virtual osg::BoundingSphere | computeBound (bool treatAsElevationLayer) const
Public Member Functions inherited from osg::Object
| Object ()
| Object (bool threadSafeRefUnref)
| Object (const Object &, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
virtual Object * | cloneType () const =0
virtual Object * | clone (const CopyOp &) const =0
virtual bool | isSameKindAs (const Object *) const
virtual const char * | libraryName () const =0
virtual const char * | className () const =0
std::string | getCompoundClassName () const
virtual Node * | asNode ()
virtual const Node * | asNode () const
virtual NodeVisitor * | asNodeVisitor ()
virtual const NodeVisitor * | asNodeVisitor () const
virtual StateSet * | asStateSet ()
virtual const StateSet * | asStateSet () const
virtual StateAttribute * | asStateAttribute ()
virtual const StateAttribute * | asStateAttribute () const
virtual Uniform * | asUniform ()
virtual const Uniform * | asUniform () const
virtual Camera * | asCamera ()
virtual const Camera * | asCamera () const
virtual Drawable * | asDrawable ()
virtual const Drawable * | asDrawable () const
virtual Callback * | asCallback ()
virtual const Callback * | asCallback () const
virtual CallbackObject * | asCallbackObject ()
virtual const CallbackObject * | asCallbackObject () const
virtual UserDataContainer * | asUserDataContainer ()
virtual const UserDataContainer * | asUserDataContainer () const
virtual ValueObject * | asValueObject ()
virtual const ValueObject * | asValueObject () const
virtual Image * | asImage ()
virtual const Image * | asImage () const
virtual void | setThreadSafeRefUnref (bool threadSafe)
virtual void | setName (const std::string &name)
void | setName (const char *name)
const std::string & | getName () const
void | setDataVariance (DataVariance dv)
DataVariance | getDataVariance () const
virtual void | computeDataVariance ()
void | setUserDataContainer (osg::UserDataContainer *udc)
template<class T>
void | setUserDataContainer (const ref_ptr< T > &udc)
osg::UserDataContainer * | getUserDataContainer ()
const osg::UserDataContainer * | getUserDataContainer () const
osg::UserDataContainer * | getOrCreateUserDataContainer ()
virtual void | setUserData (Referenced *obj)
template<class T>
void | setUserData (const ref_ptr< T > &ud)
virtual Referenced * | getUserData ()
virtual const Referenced * | getUserData () const
template<typename T>
bool | getUserValue (const std::string &name, T &value) const
template<typename T>
void | setUserValue (const std::string &name, const T &value)
virtual void | resizeGLObjectBuffers (unsigned int)
virtual void | releaseGLObjects (osg::State *=0) const
template<typename T>
BoolValueObject UCharValueObject UShortValueObject UIntValueObject DoubleValueObject Vec3fValueObject Vec2dValueObject Vec4dValueObject PlaneValueObject MatrixdValueObject BoundingBoxdValueObject BoundingSpheredValueObject bool | getUserValue (const std::string &name, T &value) const
Public Member Functions inherited from osg::Referenced
| Referenced ()
| Referenced (bool threadSafeRefUnref)
| Referenced (const Referenced &)
Referenced & | operator= (const Referenced &)
bool | getThreadSafeRefUnref () const
OpenThreads::Mutex * | getRefMutex () const
int | ref () const
int | unref () const
int | unref_nodelete () const
int | referenceCount () const
ObserverSet * | getObserverSet () const
ObserverSet * | getOrCreateObserverSet () const
void | addObserver (Observer *observer) const
void | removeObserver (Observer *observer) const

## Protected Member Functions

virtual | ~Layer ()
Protected Member Functions inherited from osg::Object
virtual | ~Object ()
Protected Member Functions inherited from osg::Referenced
virtual | ~Referenced ()
void | signalObserversAndDelete (bool signalDelete, bool doDelete) const
void | deleteUsingDeleteHandler () const

## Protected Attributes

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
Protected Attributes inherited from osg::Object
std::string | _name
DataVariance | _dataVariance
osg::UserDataContainer * | _userDataContainer
Protected Attributes inherited from osg::Referenced
OpenThreads::AtomicPtr | _observerSet
OpenThreads::Atomic | _refCount

## Additional Inherited Members

Public Types inherited from osg::Object
enum | DataVariance { DYNAMIC , STATIC , UNSPECIFIED }
Static Public Member Functions inherited from osg::Referenced
static OpenThreads::Mutex * | getGlobalReferencedMutex ()
static void | setDeleteHandler (DeleteHandler *handler)
static DeleteHandler * | getDeleteHandler ()

## Constructor & Destructor Documentation

## Layer() [1/2]

osgTerrain::Layer::Layer | ( |  | ) |

Referenced by osgTerrain::CompositeLayer::addLayer(), osgTerrain::CompositeLayer::CompoundNameLayer::CompoundNameLayer(), osgTerrain::ProxyLayer::getImplementation(), osgTerrain::ProxyLayer::getImplementation(), osgTerrain::CompositeLayer::getLayer(), osgTerrain::CompositeLayer::getLayer(), Layer(), META_Object(), osgTerrain::ProxyLayer::setImplementation(), and osgTerrain::CompositeLayer::setLayer().

## Layer() [2/2]

osgTerrain::Layer::Layer | ( | const Layer & | ,
|  | const osg::CopyOp & | copyop = osg::CopyOp::SHALLOW_COPY )

Copy constructor using CopyOp to manage deep vs shallow copy.

References Layer(), and osg::CopyOp::SHALLOW_COPY.

## ~Layer()

virtual osgTerrain::Layer::~Layer | ( |  | ) |

protected virtual

## Member Function Documentation

## computeBound()

virtual osg::BoundingSphere osgTerrain::Layer::computeBound | ( | bool | treatAsElevationLayer | ) | const

virtual

Reimplemented in osgTerrain::ProxyLayer.

## computeIndices()

void osgTerrain::Layer::computeIndices | ( | double | ndc_x,
|  | double | ndc_y,
|  | unsigned int & | i,
|  | unsigned int & | j,
|  | double & | ir,
|  | double & | jr ) const

inline

Compute column,row indices from normalized coordinates.

Parameters

  [in] | ndc_x | Normalized X-axis coordinate.
  [in] | ndc_y | Normalized Y-axis coordinate.
  [out] | i | Returned X-axis (or column) index.
  [out] | j | Returned Y-axis (or row) index.
  [out] | ir | Returned X-axis fraction.
  [out] | jr | Returned Y-axis fraction.

References getNumColumns(), and getNumRows().

Referenced by getInterpolatedValidValue(), and getInterpolatedValue().

## dirty()

virtual void osgTerrain::Layer::dirty | ( |  | ) |

inline virtual

increment the modified count."

Reimplemented in osgTerrain::ContourLayer, osgTerrain::HeightFieldLayer, osgTerrain::ImageLayer, and osgTerrain::ProxyLayer.

## getCompoundName()

std::string osgTerrain::Layer::getCompoundName | ( |  | ) | const

inline

Return the compound name of the layer in the form set::name::filename string.

References osgTerrain::createCompoundSetNameAndFileName(), getFileName(), and osg::Object::getName().

## getDefaultValue()

const osg::Vec4 & osgTerrain::Layer::getDefaultValue | ( |  | ) | const

inline

References _defaultValue.

## getFileName()

virtual const std::string & osgTerrain::Layer::getFileName | ( |  | ) | const

inline virtual

Get the file name of the layer.

Reimplemented in osgTerrain::HeightFieldLayer, osgTerrain::ImageLayer, and osgTerrain::ProxyLayer.

References _filename.

Referenced by osgTerrain::CompositeLayer::addLayer(), and getCompoundName().

## getImage() [1/2]

virtual osg::Image * osgTerrain::Layer::getImage | ( |  | ) |

inline virtual

Return image associated with layer if supported.

Reimplemented in osgTerrain::ContourLayer, osgTerrain::ImageLayer, osgTerrain::ProxyLayer, and osgTerrain::SwitchLayer.

## getImage() [2/2]

virtual const osg::Image * osgTerrain::Layer::getImage | ( |  | ) | const

inline virtual

Return const image associated with layer if supported.

Reimplemented in osgTerrain::ContourLayer, osgTerrain::ImageLayer, osgTerrain::ProxyLayer, and osgTerrain::SwitchLayer.

## getInterpolatedValidValue()

bool osgTerrain::Layer::getInterpolatedValidValue | ( | double | ndc_x,
|  | double | ndc_y,
|  | float & | value ) const

inline

References computeIndices(), and getValidValue().

## getInterpolatedValue()

bool osgTerrain::Layer::getInterpolatedValue | ( | double | ndc_x,
|  | double | ndc_y,
|  | float & | value ) const

inline

Calculate the interpolated layer value at the given normalized coordinates.

Parameters

  [in] | ndc_x | Normalized X-axis coordinate.
  [in] | ndc_y | Normalized Y-axis coordinate.
  [out] | value | Returned layer value.

Returns
  true if value is valid, else false

References computeIndices(), and getValue().

## getLocator() [1/2]

Locator * osgTerrain::Layer::getLocator | ( |  | ) |

inline

References _locator.

## getLocator() [2/2]

const Locator * osgTerrain::Layer::getLocator | ( |  | ) | const

inline

References _locator.

## getMagFilter()

osg::Texture::FilterMode osgTerrain::Layer::getMagFilter | ( |  | ) | const

inline

Get the magnification texture filter to use when a texture is associated with this layer.

References _magFilter.

## getMaxLevel()

unsigned int osgTerrain::Layer::getMaxLevel | ( |  | ) | const

inline

References _maxLevel.

## getMinFilter()

osg::Texture::FilterMode osgTerrain::Layer::getMinFilter | ( |  | ) | const

inline

Get the minification texture filter to use when a texture is associated with this layer.

References _minFilter.

## getMinLevel()

unsigned int osgTerrain::Layer::getMinLevel | ( |  | ) | const

inline

References _minLevel.

## getModifiedCount()

virtual unsigned int osgTerrain::Layer::getModifiedCount | ( |  | ) | const

inline virtual

Get modified count value.

Reimplemented in osgTerrain::ContourLayer, osgTerrain::HeightFieldLayer, osgTerrain::ImageLayer, and osgTerrain::ProxyLayer.

## getNumColumns()

virtual unsigned int osgTerrain::Layer::getNumColumns | ( |  | ) | const

inline virtual

Get the number of columns.

Reimplemented in osgTerrain::ContourLayer, osgTerrain::HeightFieldLayer, osgTerrain::ImageLayer, and osgTerrain::ProxyLayer.

Referenced by computeIndices().

## getNumRows()

virtual unsigned int osgTerrain::Layer::getNumRows | ( |  | ) | const

inline virtual

Get the number of rows.

Reimplemented in osgTerrain::ContourLayer, osgTerrain::HeightFieldLayer, osgTerrain::ImageLayer, and osgTerrain::ProxyLayer.

Referenced by computeIndices().

## getSetName()

const std::string & osgTerrain::Layer::getSetName | ( |  | ) | const

inline

Get the name of this layer.

References osg::Object::getName().

## getValidDataOperator() [1/2]

ValidDataOperator * osgTerrain::Layer::getValidDataOperator | ( |  | ) |

inline

Get the data validation operator.

References _validDataOperator.

## getValidDataOperator() [2/2]

const ValidDataOperator * osgTerrain::Layer::getValidDataOperator | ( |  | ) | const

inline

Get the const data validation operator.

References _validDataOperator.

## getValidValue() [1/4]

bool osgTerrain::Layer::getValidValue | ( | unsigned int | i,
|  | unsigned int | j,
|  | float & | value ) const

inline

References _validDataOperator, and getValue().

Referenced by getInterpolatedValidValue().

## getValidValue() [2/4]

bool osgTerrain::Layer::getValidValue | ( | unsigned int | i,
|  | unsigned int | j,
|  | osg::Vec2 & | value ) const

inline

References _validDataOperator, and getValue().

## getValidValue() [3/4]

bool osgTerrain::Layer::getValidValue | ( | unsigned int | i,
|  | unsigned int | j,
|  | osg::Vec3 & | value ) const

inline

References _validDataOperator, and getValue().

## getValidValue() [4/4]

bool osgTerrain::Layer::getValidValue | ( | unsigned int | i,
|  | unsigned int | j,
|  | osg::Vec4 & | value ) const

inline

References _validDataOperator, and getValue().

## getValue() [1/4]

virtual bool osgTerrain::Layer::getValue | ( | unsigned int | ,
|  | unsigned int | ,
|  | float & | ) const

inline virtual

Get the layer value at position i,j. param i X-axis (or column) index. param j Y-axis (or row) index. param value Returned layer value.

Returns
  true if value is valid, else false

Reimplemented in osgTerrain::ContourLayer, osgTerrain::HeightFieldLayer, osgTerrain::ImageLayer, and osgTerrain::ProxyLayer.

Referenced by getInterpolatedValue(), getValidValue(), getValidValue(), getValidValue(), and getValidValue().

## getValue() [2/4]

virtual bool osgTerrain::Layer::getValue | ( | unsigned int | ,
|  | unsigned int | ,
|  | osg::Vec2 & | ) const

inline virtual

Reimplemented in osgTerrain::ContourLayer, osgTerrain::HeightFieldLayer, osgTerrain::ImageLayer, and osgTerrain::ProxyLayer.

## getValue() [3/4]

virtual bool osgTerrain::Layer::getValue | ( | unsigned int | ,
|  | unsigned int | ,
|  | osg::Vec3 & | ) const

inline virtual

Reimplemented in osgTerrain::ContourLayer, osgTerrain::HeightFieldLayer, osgTerrain::ImageLayer, and osgTerrain::ProxyLayer.

## getValue() [4/4]

virtual bool osgTerrain::Layer::getValue | ( | unsigned int | ,
|  | unsigned int | ,
|  | osg::Vec4 & | ) const

inline virtual

Reimplemented in osgTerrain::ContourLayer, osgTerrain::HeightFieldLayer, osgTerrain::ImageLayer, and osgTerrain::ProxyLayer.

## META_Object()

osgTerrain::Layer::META_Object | ( | osgTerrain | ,
|  | Layer | )

References Layer().

## setDefaultValue()

void osgTerrain::Layer::setDefaultValue | ( | const osg::Vec4 & | value | ) |

inline

References _defaultValue.

## setFileName()

virtual void osgTerrain::Layer::setFileName | ( | const std::string & | filename | ) |

inline virtual

Set the file name of the data associated with this layer.

Reimplemented in osgTerrain::HeightFieldLayer, osgTerrain::ImageLayer, and osgTerrain::ProxyLayer.

References _filename.

## setLocator() [1/2]

template<class T>

void osgTerrain::Layer::setLocator | ( | const osg::ref_ptr< T > & | locator | ) |

inline

References osg::ref_ptr< T >::get(), and setLocator().

Referenced by setLocator().

## setLocator() [2/2]

void osgTerrain::Layer::setLocator | ( | Locator * | locator | ) |

inline

References _locator.

## setMagFilter()

void osgTerrain::Layer::setMagFilter | ( | osg::Texture::FilterMode | filter | ) |

inline

Set the magnification texture filter to use when a texture is associated with this layer.

References _magFilter.

## setMaxLevel()

void osgTerrain::Layer::setMaxLevel | ( | unsigned int | maxLevel | ) |

inline

References _maxLevel.

## setMinFilter()

void osgTerrain::Layer::setMinFilter | ( | osg::Texture::FilterMode | filter | ) |

inline

Set the minification texture filter to use when a texture is associated with this layer.

References _minFilter.

## setMinLevel()

void osgTerrain::Layer::setMinLevel | ( | unsigned int | minLevel | ) |

inline

References _minLevel.

## setModifiedCount()

virtual void osgTerrain::Layer::setModifiedCount | ( | unsigned int |  | ) |

inline virtual

Set the modified count value.

Reimplemented in osgTerrain::ContourLayer, osgTerrain::HeightFieldLayer, osgTerrain::ImageLayer, and osgTerrain::ProxyLayer.

## setSetName()

void osgTerrain::Layer::setSetName | ( | const std::string & | setname | ) |

inline

Set the name of this layer.

References osg::Object::setName().

## setValidDataOperator()

void osgTerrain::Layer::setValidDataOperator | ( | ValidDataOperator * | validDataOp | ) |

inline

Set the data validation operator.

References _validDataOperator.

## transform()

virtual bool osgTerrain::Layer::transform | ( | float | ,
|  | float | )

inline virtual

Reimplemented in osgTerrain::ContourLayer, osgTerrain::HeightFieldLayer, osgTerrain::ImageLayer, and osgTerrain::ProxyLayer.

## Member Data Documentation

## _defaultValue

osg::Vec4 osgTerrain::Layer::_defaultValue

protected

Referenced by getDefaultValue(), and setDefaultValue().

## _filename

std::string osgTerrain::Layer::_filename

protected

Referenced by osgTerrain::HeightFieldLayer::getFileName(), osgTerrain::ImageLayer::getFileName(), getFileName(), osgTerrain::ProxyLayer::getFileName(), osgTerrain::HeightFieldLayer::setFileName(), osgTerrain::ImageLayer::setFileName(), and setFileName().

## _locator

osg::ref_ptr<Locator> osgTerrain::Layer::_locator

protected

Referenced by getLocator(), getLocator(), and setLocator().

## _magFilter

osg::Texture::FilterMode osgTerrain::Layer::_magFilter

protected

Referenced by getMagFilter(), and setMagFilter().

## _maxLevel

unsigned int osgTerrain::Layer::_maxLevel

protected

Referenced by getMaxLevel(), and setMaxLevel().

## _minFilter

osg::Texture::FilterMode osgTerrain::Layer::_minFilter

protected

Referenced by getMinFilter(), and setMinFilter().

## _minLevel

unsigned int osgTerrain::Layer::_minLevel

protected

Referenced by getMinLevel(), and setMinLevel().

## _validDataOperator

osg::ref_ptr<ValidDataOperator> osgTerrain::Layer::_validDataOperator

protected

Referenced by getValidDataOperator(), getValidDataOperator(), getValidValue(), getValidValue(), getValidValue(), getValidValue(), and setValidDataOperator().

The documentation for this class was generated from the following file:

- osgTerrain/Layer