ANSYS::Nexus::GLTFWriter::Legend Class Reference
Last update: 17.04.2023Legends are colored bars with numbers at intervals along bar. More...
#include <GLTFWriter.h>
Inheritance diagram for ANSYS::Nexus::GLTFWriter::Legend:
Public Types | |
enum | LegendOrientation { LO_VERTICAL , LO_HORIZONTAL } |
enum | LegendAttachment { LA_X_Y = 0 , LA_X_YBOTTOM = 1 , LA_X_YTOP = 2 , LA_X_YCENTER = 3 , LA_XLEFT_Y = 4 , LA_XLEFT_YBOTTOM = 5 , LA_XLEFT_YTOP = 6 , LA_XLEFT_YCENTER = 7 , LA_XRIGHT_Y = 8 , LA_XRIGHT_YBOTTOM = 9 , LA_XRIGHT_YTOP = 10 , LA_XRIGHT_YCENTER = 11 , LA_XCENTER_Y = 12 , LA_XCENTER_YBOTTOM = 13 , LA_XCENTER_YTOP = 14 , LA_XCENTER_YCENTER = 15 } |
Static Public Member Functions | |
static Legend * | Create (GLTF *gltf, LegendOrientation orientation, float size, Texture *texture, float mn, float mx, LegendAttachment attachment=LA_XLEFT_YCENTER, const char *title=0, const char *units=0, const char *other=0, unsigned int numTicks=0, const float *valueLocations=0, bool border=false, bool logarithmic=false, float x=0, float y=0, float foregroundR=0, float foregroundG=0, float foregroundB=0, float backgroundR=1, float backgroundG=1, float backgroundB=1, float backgroundA=0) |
Detailed Description
Legends are colored bars with numbers at intervals along bar.
Definition at line 26 of file GLTFLegend.h.
Member Enumeration Documentation
◆ LegendAttachment
Legend attachment position
Definition at line 36 of file GLTFLegend.h.
◆ LegendOrientation
Type of orientation.
Enumerator | |
---|---|
LO_VERTICAL | Top to bottom. |
LO_HORIZONTAL | Left to right. |
Definition at line 30 of file GLTFLegend.h.
Member Function Documentation
◆ Create()
|
static |
Creates a legend.
- Returns
- Legend object. Do not delete this pointer.
- Parameters
-
[in] gltf GLTF object. [in] orientation Legend::LegendOrientation defining type of orientation. [in] size Height or width of legend (excluding other text) as a fraction of minimum screen dimension. [in] texture Texture object that would be used to color object to which this legend refers. [in] mn Numeric value associated with first tick mark at bottom/left of legend. [in] mx Numeric value associated with last tick mark at top.right of legend. [in] attachment Optional, Legend::LegendAttachment defining location of legend. [in] title Optional, title for legend. The title can span up to 2 lines with a '\n' char. [in] units Optional, units for legend. Located immediately after the color bar. [in] other Optional, other text for legend. Other text spans multiple lines with '\n' char. [in] numTicks Optional, number of tick marks on legend. For non-banded legends, this number can be left 0 for auto-generated tick marks. For a banded legend, this number should be 1 more than the number of bands in the specified texture. If valueLocations is specified, this number must be the number of entry pairs in valueLocations. In any case, this number cannot be 1. [in] valueLocations Optional, pairs of tick values as a fraction of mn to mx and tick locations as a fraction of size. The first tick location should be 0 and the last should be 1. [in] border Optional, flag that indicates to draw a border around legend. [in] logarithmic Optional, flag that indicates generated values at tick marks follow logarithmic progression. If valueLocations are specfied this is taken as false. [in] x Optional, x location of legend. [in] y Optional, y location of legend. [in] foregroundR Optional, red component of foreground color of legend (text, border, ticks, ..). [in] foregroundG Optional, green component of foreground color of legend. [in] foregroundB Optional, blue component of foreground color of legend. [in] backgroundR Optional, red component of background color of legend. [in] backgroundG Optional, green component of background color of legend. [in] backgroundB Optional, blue component of background color of legend. [in] backgroundA Optional, alpha component of background color of legend.
- Examples
- Test013.cpp.
The documentation for this class was generated from the following file:
- D:/ANSYSDev/NoBackup/branches/EnSight-Second-Coming/webgl_viewer/gltfwriterlib/include/GLTFLegend.h