21#include <Inventor/fields/SoFields.h>
145 void parseString(
const SbString &
string);
148 void drawLegend(
View2DSlice* slice,
const float dx1,
const float dy1,
const float dx2,
const float dy2,
const int width,
const int height,
152 int getFontSize(
const int fontGroup)
const;
155 std::vector<LegendItem>_legendVector;
160 long _lastEventUSecs;
View2DEventPhase
event phase for simple extensions that grab the focus, do something (motion) and are released afterwa...
#define SOVIEW2D_API
File to resolve system dependencies in View2D library.
class holds legend item information
const LegendItem & operator=(const LegendItem &li)
assignemt operator
unsigned short stipple
line stipple
LegendItem()
defaut constructor
float line_width
line width
LegendItem(const LegendItem &li)
copy constructor
SbString text
text as a string
SoCommandAction is the base class for instantaneous actions.
SoView2DExtension Base class for all View2DExtensions used for drawing and event handling on the View...
SoView2DLegend allows to draw legends on SoView2D.
SoSFBool drawTheBox
draw the box?
SoSFEnum legendAlignment
set the alignment
SoSFEnum legendFormat
text <-> line
SoSFString legendString
the string to be parsed the format for one entry (item) is: $(item rr gg bb line_width line_stipple "...
bool evalEvent(SoView2D *view2d, View2DSliceList *slicelist, View2DEvent *ec, View2DEventPhase phase) override
Called by the SoView2D for each event that happens on the viewer.
SoSFEnum legendFontSize
set the font size (or set it to 'automatic')
SoSFColor boxColor
the color of the box
SoSFFloat margin
the margin of the legend relative to the nearest border
void editingOnChanged(SoField *field) override
called when editingOn field is touched:
SoSFBool showLegend
show legend?
LegendFormat
text/line format.. draw a line or the text first?
LegendAlignPosition
enumeration for alignment
virtual bool implementsManagedInteraction() const
also implements managed interactions
bool implementsManagedInteractionAndClassicEventHandling() const override
this node is a hybrid module providing managed interaction and classic event handling
SoSFBool textShadow
text shadow?
void draw(View2DSliceList *dsl, View2DSlice *dslice, int slice) override
inherited draw method.. parses the string and draws the legend
SoView2D is a 2D viewer for image data.
View2DEvent stores all information on an event on a SoView2D.
Abstract GL font drawing using FTGL.
a list that holds all View2DSlice objects (lazily created) of a SoView2D
a single slice that is stored in a View2DSliceList, typically created by a View2DSliceList
Target mlrange_cast(Source arg)
Generic version of checked ML casts.