Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
MoLegend Class Reference

MeshViz Rendering node that displays a legend. More...

#include <MeshVizXLM/mapping/nodes/MoLegend.h>

+ Inheritance diagram for MoLegend:

Public Types

enum  Position {
  POS_BOTTOM ,
  POS_TOP ,
  POS_RIGHT ,
  POS_LEFT
}
 Position of the title. More...
 
enum  Notation {
  NOTATION_DEFAULT ,
  NOTATION_FIXED ,
  NOTATION_SCIENTIFIC
}
 Notation type of the values. More...
 

Public Member Functions

virtual SoType getTypeId () const
 Returns the type identifier for this specific instance.
 
 MoLegend ()
 Constructor.
 
- Public Member Functions inherited from MoMeshBaseRepresentation
virtual SbBool affectsState () const
 Returns TRUE if a node has an effect on the state during traversal.
 
- Public Member Functions inherited from SoNode
virtual void setOverride (const SbBool state)
 Turns the override flag on or off.
 
virtual SbBool isOverride () const
 Returns the state of the override flag.
 
virtual SoNodecopy (SbBool copyConnections=FALSE) const
 Creates and returns an exact copy of the node.
 
virtual void touch ()
 Marks an instance as modified, simulating a change to it.
 
- Public Member Functions inherited from SoFieldContainer
void setToDefaults ()
 Sets all fields in this object to their default values.
 
SbBool hasDefaultValues () const
 Returns TRUE if all of the object's fields have their default values.
 
SbBool fieldsAreEqual (const SoFieldContainer *fc) const
 Returns TRUE if this object's fields are exactly equal to fc's fields.
 
void copyFieldValues (const SoFieldContainer *fc, SbBool copyConnections=FALSE)
 Copies the contents of fc's fields into this object's fields.
 
SoNONUNICODE SbBool set (const char *fieldDataString)
 Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format.
 
SbBool set (const SbString &fieldDataString)
 Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format.
 
void get (SbString &fieldDataString)
 Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string.
 
virtual int getFields (SoFieldList &list) const
 Appends references to all of this object's fields to resultList, and returns the number of fields appended.
 
virtual int getAllFields (SoFieldList &list) const
 Returns a list of fields, including the eventIn's and eventOut's.
 
virtual SoFieldgetField (const SbName &fieldName) const
 Returns a the field of this object whose name is fieldName.
 
virtual SoFieldgetEventIn (const SbName &fieldName) const
 Returns a the eventIn with the given name.
 
virtual SoFieldgetEventOut (const SbName &fieldName) const
 Returns the eventOut with the given name.
 
SbBool getFieldName (const SoField *field, SbName &fieldName) const
 Returns the name of the given field in the fieldName argument.
 
SbBool enableNotify (SbBool flag)
 Notification at this Field Container is enabled (if flag == TRUE) or disabled (if flag == FALSE).
 
SbBool isNotifyEnabled () const
 Notification is the process of telling interested objects that this object has changed.
 
virtual void setUserData (void *data)
 Sets application data.
 
void * getUserData (void) const
 Gets user application data.
 
- Public Member Functions inherited from SoBase
virtual SbName getName () const
 Returns the name of an instance.
 
virtual void setName (const SbName &name)
 Sets the name of an instance.
 
void setSynchronizable (const bool b)
 Sets this to be a ScaleViz synchronizable object.
 
bool isSynchronizable () const
 Gets the ScaleViz synchronizable state of this object.
 
- Public Member Functions inherited from SoRefCounter
void ref () const
 Adds a reference to an instance.
 
void unref () const
 Removes a reference from an instance.
 
void unrefNoDelete () const
 unrefNoDelete() should be called when it is desired to decrement the reference count, but not delete the instance if this brings the reference count to zero.
 
int getRefCount () const
 Returns current reference count.
 
void lock () const
 lock this instance.
 
void unlock () const
 unlock this instance.
 
- Public Member Functions inherited from SoTypedObject
SbBool isOfType (const SoType &type) const
 Returns TRUE if this object is of the type specified in type or is derived from that type.
 
template<typename TypedObjectClass >
SbBool isOfType () const
 Returns TRUE if this object is of the type of class TypedObjectClass or is derived from that class.
 

Static Public Member Functions

static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
- Static Public Member Functions inherited from MoMeshBaseRepresentation
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
- Static Public Member Functions inherited from MoActionNode
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
- Static Public Member Functions inherited from SoNode
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static SoNodegetByName (const SbName &name)
 A node's name can be set using SoBase::setName().
 
static int getByName (const SbName &name, SoNodeList &list)
 A node's name can be set using SoBase::setName().
 
- Static Public Member Functions inherited from SoFieldContainer
static SoType getClassTypeId ()
 Returns the type of this class.
 
- Static Public Member Functions inherited from SoBase
static SoType getClassTypeId ()
 Returns type identifier for this class.
 
- Static Public Member Functions inherited from SoTypedObject
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 

Public Attributes

SoSFVec2f bottomLeft
 Bottom left corner of the rectangle in which the legend will be drawn.
 
SoSFVec2f topRight
 Top-right corner of the rectangle in which the legend will be drawn.
 
SoSFDouble minValue
 The minimum value defining the range of data to display in the legend.
 
SoSFDouble maxValue
 The maximum value defining the range of data to display in the legend.
 
SoSFBool vertical
 If TRUE, the legend is vertical.
 
SoSFString title
 The title of the legend.
 
SoSFFloat titleFontSize
 The size of the font for the title of the legend.
 
SoSFColor titleColor
 Color for the title of the legend.
 
SoSFEnum titlePosition
 The position of the title relative to the legend box.
 
SoSFBool displayValues
 If TRUE, display numValues values starting from the minimal to the maximal values of the colormap.
 
SoSFInt32 numValues
 The number of values displayed near the colorbar.
 
SoSFColor valuesColor
 Color for the values of the legend.
 
SoSFFloat valuesFontSize
 The size of the font for the values of the legend.
 
SoSFEnum valueNotation
 Defines the notation type (fixed or scientific) used to display the values of this legend.
 
SoSFUInt32 valuePrecision
 Defines the maximum number of significant digits to display, or the maximum number of digits after the decimal point depending on the value of the field valueNotation.
 

Detailed Description

MeshViz Rendering node that displays a legend.

Displays a legend representing the current colormap. A colormap is specified using the MoColorMapping derived nodes. However, the legend does not take into account the MoCombineColorMapping node.

The legend is drawn in a rectangle defined by the bottomLeft and topRight 2D points given in Normalized Device Coordinates [0..1].

FILE FORMAT/DEFAULT

    Legend {
    bottomLeft SbVec3f(0,0)
    topRight SbVec3f(0,1)
    minValue 0
    maxValue 0
    vertical FALSE
    title ""
    titleColor 0.8 0.8 0.8
    titleFontSize 10
    titlePosition POS_BOTTOM
    displayValues FALSE
    valuesColor 0.8 0.8 0.8
    valuesFontSize 10
    valueNotation; NOTATION_DEFAULT
    valuePrecision 0
    }

SEE ALSO

MoColorMapping

Definition at line 91 of file MoLegend.h.

Member Enumeration Documentation

◆ Notation

Notation type of the values.

Enumerator
NOTATION_DEFAULT 
NOTATION_FIXED 
NOTATION_SCIENTIFIC 

Definition at line 193 of file MoLegend.h.

◆ Position

Position of the title.

Enumerator
POS_BOTTOM 

Bottom.

POS_TOP 

Top.


POS_RIGHT 

Right.


POS_LEFT 

Left.


Definition at line 152 of file MoLegend.h.

Constructor & Destructor Documentation

◆ MoLegend()

MoLegend::MoLegend ( )

Constructor.

Member Function Documentation

◆ getClassTypeId()

static SoType MoLegend::getClassTypeId ( )
static

Returns the type identifier for this class.


◆ getTypeId()

virtual SoType MoLegend::getTypeId ( ) const
virtual

Returns the type identifier for this specific instance.

Reimplemented from MoMeshBaseRepresentation.

Member Data Documentation

◆ bottomLeft

SoSFVec2f MoLegend::bottomLeft

Bottom left corner of the rectangle in which the legend will be drawn.

In NDC units [0..1]. Default is (0,0).

Definition at line 106 of file MoLegend.h.

◆ displayValues

SoSFBool MoLegend::displayValues

If TRUE, display numValues values starting from the minimal to the maximal values of the colormap.

Default FALSE.

Definition at line 170 of file MoLegend.h.

◆ maxValue

SoSFDouble MoLegend::maxValue

The maximum value defining the range of data to display in the legend.

Default 0.

Note
If not set, the min and max values are retrieved from the colormap.

Definition at line 126 of file MoLegend.h.

◆ minValue

SoSFDouble MoLegend::minValue

The minimum value defining the range of data to display in the legend.

Default 0.

Note
If not set, the min and max values are retrieved from the colormap.

Definition at line 119 of file MoLegend.h.

◆ numValues

SoSFInt32 MoLegend::numValues

The number of values displayed near the colorbar.

This field is ignored if displayValues is FALSE. Default 2.

Definition at line 178 of file MoLegend.h.

◆ title

SoSFString MoLegend::title

The title of the legend.

Definition at line 137 of file MoLegend.h.

◆ titleColor

SoSFColor MoLegend::titleColor

Color for the title of the legend.

Definition at line 147 of file MoLegend.h.

◆ titleFontSize

SoSFFloat MoLegend::titleFontSize

The size of the font for the title of the legend.

Default 10 pixels.

Definition at line 142 of file MoLegend.h.

◆ titlePosition

SoSFEnum MoLegend::titlePosition

The position of the title relative to the legend box.

Use enum Position. Default is POS_BOTTOM.

Definition at line 163 of file MoLegend.h.

◆ topRight

SoSFVec2f MoLegend::topRight

Top-right corner of the rectangle in which the legend will be drawn.

In NDC units [0..1]. Default is (0,1).

Definition at line 112 of file MoLegend.h.

◆ valueNotation

SoSFEnum MoLegend::valueNotation

Defines the notation type (fixed or scientific) used to display the values of this legend.

Use enum Notation. Default is NOTATION_DEFAULT.

Note: The field valuePrecision is interpreted according to valueNotation.

NOTE: field available since Open Inventor 9.6

Definition at line 208 of file MoLegend.h.

◆ valuePrecision

SoSFUInt32 MoLegend::valuePrecision

Defines the maximum number of significant digits to display, or the maximum number of digits after the decimal point depending on the value of the field valueNotation.

Default value is 0.

When using NOTATION_DEFAULT the valuePrecision field specifies the maximum number of meaningful digits to display in total counting both those before and those after the decimal point. Notice that it is not a minimum, and therefore it does not pad the displayed number with trailing zeros if the number can be displayed with less digits than the precision.

When using NOTATION_FIXED or NOTATION_SCIENTIFIC, the precision field specifies exactly how many digits to display after the decimal point, even if this includes trailing decimal zeros. The digits before the decimal point are not relevant for the precision in this case.

NOTE: field available since Open Inventor 9.6

Definition at line 229 of file MoLegend.h.

◆ valuesColor

SoSFColor MoLegend::valuesColor

Color for the values of the legend.

Definition at line 183 of file MoLegend.h.

◆ valuesFontSize

SoSFFloat MoLegend::valuesFontSize

The size of the font for the values of the legend.

Default 10 pixels.

Definition at line 188 of file MoLegend.h.

◆ vertical

SoSFBool MoLegend::vertical

If TRUE, the legend is vertical.

Otherwise it is horizontal. Default FALSE (horizontal)

Definition at line 132 of file MoLegend.h.


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