|
AGX Dynamics 2.42.3.1
|
Class that represents a linear scalar color map that converts a scalar interval to a specified color range. More...
#include <ScalarColorMap.h>
Inheritance diagram for agxOSG::ScalarColorMap:Public Types | |
| enum | ColorRangePreset { RAINBOW , COOLWARM , VIRIDIS , INFERNO , PLASMA , GRAYSCALE , BLUE_WHITE_RED , CIVIDIS , BONE , COPPER , AFMHOT } |
| Enum representation of predefined color ranges than can be set in the class. More... | |
Public Member Functions | |
| ScalarColorMap () | |
| Default constructor. | |
| ScalarColorMap (ColorRangePreset preset, agx::Real minScalar, agx::Real maxScalar) | |
| Constructor. | |
| ScalarColorMap (const agxRender::ColorVector &colorVector, agx::Real minScalar, agx::Real maxScalar) | |
| Constructor. | |
| agx::Vec4f | getColor (agx::Real scalar, bool modifyAlpha=false) const |
| Get an agx representation of a color value in the map given a scalar inside the interval. | |
| osg::Vec4 | getColorOSG (agx::Real scalar, bool modifyAlpha=false) const |
| Get an osg representation of a color value in the map given a scalar inside the interval. | |
| agxRender::ColorVector | getColors () const |
| agx::Real | getMaxScalar () const |
| agx::Real | getMinScalar () const |
| osg::ref_ptr< osgSim::ColorRange > | getOsgColorRange () const |
| void | setColors (const agxRender::ColorVector &colorVector) |
| void | setColorsFromPreset (ColorRangePreset colorRangePreset) |
| Set a range of colors from an available color range preset in the class. | |
| void | setMaxScalar (agx::Real maxScalar) |
| Set the maximum scalar of the interval. | |
| void | setMinScalar (agx::Real minScalar) |
| Set the min scalar of the interval. | |
| void | setScalarInterval (agx::Real minScalar, agx::Real maxScalar) |
| Set the scalars of the interval used in the color interpolation. | |
Public Member Functions inherited from agx::Referenced | |
| Referenced () | |
| Default constructor. | |
| Referenced (const Referenced &) | |
| template<typename T > | |
| T * | as () |
| Subclass casting. | |
| template<typename T > | |
| const T * | as () const |
| template<typename T > | |
| T * | asSafe () |
| Safe subclass casting, return nullptr if template type does not match. | |
| template<typename T > | |
| const T * | asSafe () const |
| int | getReferenceCount () const |
| template<typename T > | |
| bool | is () const |
| Subclass test. | |
| Referenced & | operator= (const Referenced &) |
| Assignment operator. Will increment the number of references to the referenced object. | |
| void | reference (void *ptr=nullptr) const |
| Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. | |
| void | unreference (void *ptr=nullptr) const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
| void | unreference_nodelete () const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
Protected Member Functions | |
| virtual | ~ScalarColorMap () |
| void | correctScalarInterval () |
| agxRender::ColorVector | getColorsFromPreset (ColorRangePreset preset) |
| void | initColorRange (const std::vector< osg::Vec4 > &osgColors) |
| void | updateColorRange () |
Protected Member Functions inherited from agx::Referenced | |
| virtual | ~Referenced () |
| Destructor. | |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
Protected Attributes | |
| osg::ref_ptr< osgSim::ColorRange > | m_colorRange |
| agx::Real | m_maxScalar |
| agx::Real | m_minScalar |
| float | m_rScaling |
Protected Attributes inherited from agx::Referenced | |
| Mutex | m_mutex |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
Additional Inherited Members | |
Static Public Member Functions inherited from agx::Referenced | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Static Protected Member Functions inherited from agx::Referenced | |
| static DeleteHandler * | getDeleteHandler () |
| static void | setDeleteHandler (DeleteHandler *handler) |
| Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. | |
Class that represents a linear scalar color map that converts a scalar interval to a specified color range.
This wraps the osgSim::ColorRange object with a layer of convenience functionality.
Definition at line 37 of file ScalarColorMap.h.
Enum representation of predefined color ranges than can be set in the class.
| Enumerator | |
|---|---|
| RAINBOW | |
| COOLWARM | |
| VIRIDIS | |
| INFERNO | |
| PLASMA | |
| GRAYSCALE | |
| BLUE_WHITE_RED | |
| CIVIDIS | |
| BONE | |
| COPPER | |
| AFMHOT | |
Definition at line 44 of file ScalarColorMap.h.
| agxOSG::ScalarColorMap::ScalarColorMap | ( | ) |
Default constructor.
| agxOSG::ScalarColorMap::ScalarColorMap | ( | const agxRender::ColorVector & | colorVector, |
| agx::Real | minScalar, | ||
| agx::Real | maxScalar | ||
| ) |
Constructor.
| colorVector | - the specific color range to be used in scalar map, which is mapped to the scalar interval. |
| minScalar | - The minimum value of the scalar interval that is mapped to the color range. |
| maxScalar | - The maximum value of the scalar interval that is mapped to the color range. |
| agxOSG::ScalarColorMap::ScalarColorMap | ( | ColorRangePreset | preset, |
| agx::Real | minScalar, | ||
| agx::Real | maxScalar | ||
| ) |
Constructor.
| preset | - preset enum for one of the predefined color ranges that exist in the class that can be chosen to initialize the colors in the map. |
| minScalar | - The minimum value of the scalar interval that is mapped to the color range. |
| maxScalar | - The maximum value of the scalar interval that is mapped to the color range. |
|
protectedvirtual |
|
protected |
| agx::Vec4f agxOSG::ScalarColorMap::getColor | ( | agx::Real | scalar, |
| bool | modifyAlpha = false |
||
| ) | const |
Get an agx representation of a color value in the map given a scalar inside the interval.
| scalar | - a specified scalar that is used to interpolate a color in the given range. |
| modifyAlpha | - true if the alpha value of the color should be modified, false otherwise. |
| osg::Vec4 agxOSG::ScalarColorMap::getColorOSG | ( | agx::Real | scalar, |
| bool | modifyAlpha = false |
||
| ) | const |
Get an osg representation of a color value in the map given a scalar inside the interval.
| scalar | - a specified scalar that is used to interpolate a color in the given range. |
| modifyAlpha | - true if the alpha value of the color should be modified, false otherwise. |
| agxRender::ColorVector agxOSG::ScalarColorMap::getColors | ( | ) | const |
|
protected |
| agx::Real agxOSG::ScalarColorMap::getMaxScalar | ( | ) | const |
| agx::Real agxOSG::ScalarColorMap::getMinScalar | ( | ) | const |
| osg::ref_ptr< osgSim::ColorRange > agxOSG::ScalarColorMap::getOsgColorRange | ( | ) | const |
|
protected |
| void agxOSG::ScalarColorMap::setColors | ( | const agxRender::ColorVector & | colorVector | ) |
| void agxOSG::ScalarColorMap::setColorsFromPreset | ( | ColorRangePreset | colorRangePreset | ) |
Set a range of colors from an available color range preset in the class.
| colorRangePreset | - the specified preset enum that is used to construct the color range. |
| void agxOSG::ScalarColorMap::setMaxScalar | ( | agx::Real | maxScalar | ) |
Set the maximum scalar of the interval.
| maxScalar | - the maximum scalar value in the interval. |
| void agxOSG::ScalarColorMap::setMinScalar | ( | agx::Real | minScalar | ) |
Set the min scalar of the interval.
| minScalar | - the minimum scalar value in the interval. |
Set the scalars of the interval used in the color interpolation.
| minScalar | - the minimum scalar value in the interval. |
| maxScalar | - the maximum scalar value in the interval. |
|
protected |
|
protected |
Definition at line 175 of file ScalarColorMap.h.
|
protected |
Definition at line 173 of file ScalarColorMap.h.
|
protected |
Definition at line 172 of file ScalarColorMap.h.
|
protected |
Definition at line 174 of file ScalarColorMap.h.