VTK
|
draw the chart legend More...
#include <vtkChartLegend.h>
Public Types | |
enum | { LEFT = 0, CENTER, RIGHT, TOP, BOTTOM, CUSTOM } |
typedef vtkContextItem | Superclass |
Public Types inherited from vtkContextItem | |
typedef vtkAbstractContextItem | Superclass |
Public Types inherited from vtkAbstractContextItem | |
typedef vtkObject | Superclass |
Public Types inherited from vtkObject | |
typedef vtkObjectBase | Superclass |
Public Member Functions | |
virtual int | IsA (const char *type) |
vtkChartLegend * | NewInstance () const |
virtual void | PrintSelf (ostream &os, vtkIndent indent) |
void | SetPoint (const vtkVector2f &point) |
const vtkVector2f & | GetPointVector () |
virtual void | SetLabelSize (int size) |
virtual int | GetLabelSize () |
void | SetChart (vtkChart *chart) |
vtkChart * | GetChart () |
virtual void | Update () |
virtual bool | Paint (vtkContext2D *painter) |
virtual vtkRectf | GetBoundingRect (vtkContext2D *painter) |
vtkPen * | GetPen () |
vtkBrush * | GetBrush () |
vtkTextProperty * | GetLabelProperties () |
virtual bool | Hit (const vtkContextMouseEvent &mouse) |
virtual bool | MouseMoveEvent (const vtkContextMouseEvent &mouse) |
virtual bool | MouseButtonPressEvent (const vtkContextMouseEvent &mouse) |
virtual bool | MouseButtonReleaseEvent (const vtkContextMouseEvent &mouse) |
virtual void | SetPoint (float, float) |
void | SetPoint (float[2]) |
virtual float * | GetPoint () |
virtual void | GetPoint (float &, float &) |
virtual void | GetPoint (float[2]) |
virtual void | SetHorizontalAlignment (int) |
virtual int | GetHorizontalAlignment () |
virtual void | SetVerticalAlignment (int) |
virtual int | GetVerticalAlignment () |
virtual void | SetPadding (int) |
virtual int | GetPadding () |
virtual void | SetSymbolWidth (int) |
virtual int | GetSymbolWidth () |
virtual void | SetInline (bool) |
virtual bool | GetInline () |
virtual void | SetDragEnabled (bool) |
virtual bool | GetDragEnabled () |
virtual void | SetCacheBounds (bool) |
virtual bool | GetCacheBounds () |
virtual void | CacheBoundsOn () |
virtual void | CacheBoundsOff () |
Public Member Functions inherited from vtkContextItem | |
vtkContextItem * | NewInstance () const |
virtual double | GetOpacity () |
virtual void | SetOpacity (double) |
Public Member Functions inherited from vtkAbstractContextItem | |
vtkAbstractContextItem * | NewInstance () const |
virtual bool | PaintChildren (vtkContext2D *painter) |
virtual void | ReleaseGraphicsResources () |
unsigned int | AddItem (vtkAbstractContextItem *item) |
bool | RemoveItem (vtkAbstractContextItem *item) |
bool | RemoveItem (unsigned int index) |
vtkAbstractContextItem * | GetItem (unsigned int index) |
unsigned int | GetItemIndex (vtkAbstractContextItem *item) |
unsigned int | GetNumberOfItems () |
void | ClearItems () |
unsigned int | Raise (unsigned int index) |
unsigned int | Lower (unsigned int index) |
virtual vtkAbstractContextItem * | GetPickedItem (const vtkContextMouseEvent &mouse) |
virtual bool | MouseEnterEvent (const vtkContextMouseEvent &mouse) |
virtual bool | MouseLeaveEvent (const vtkContextMouseEvent &mouse) |
virtual bool | MouseDoubleClickEvent (const vtkContextMouseEvent &mouse) |
virtual bool | MouseWheelEvent (const vtkContextMouseEvent &mouse, int delta) |
virtual bool | KeyPressEvent (const vtkContextKeyEvent &key) |
virtual void | SetScene (vtkContextScene *scene) |
virtual void | SetParent (vtkAbstractContextItem *parent) |
virtual vtkVector2f | MapToParent (const vtkVector2f &point) |
virtual vtkVector2f | MapFromParent (const vtkVector2f &point) |
virtual vtkVector2f | MapToScene (const vtkVector2f &point) |
virtual vtkVector2f | MapFromScene (const vtkVector2f &point) |
virtual unsigned int | StackAbove (unsigned int index, unsigned int under) |
virtual unsigned int | StackUnder (unsigned int child, unsigned int above) |
virtual bool | KeyReleaseEvent (const vtkContextKeyEvent &key) |
vtkContextScene * | GetScene () |
vtkAbstractContextItem * | GetParent () |
virtual bool | GetVisible () |
virtual void | SetVisible (bool) |
virtual bool | GetInteractive () |
virtual void | SetInteractive (bool) |
Public Member Functions inherited from vtkObject | |
vtkObject * | NewInstance () const |
virtual void | DebugOn () |
virtual void | DebugOff () |
bool | GetDebug () |
void | SetDebug (bool debugFlag) |
virtual void | Modified () |
virtual unsigned long | GetMTime () |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
vtkCommand * | GetCommand (unsigned long tag) |
void | RemoveObserver (vtkCommand *) |
void | RemoveObservers (unsigned long event, vtkCommand *) |
void | RemoveObservers (const char *event, vtkCommand *) |
int | HasObserver (unsigned long event, vtkCommand *) |
int | HasObserver (const char *event, vtkCommand *) |
void | RemoveObserver (unsigned long tag) |
void | RemoveObservers (unsigned long event) |
void | RemoveObservers (const char *event) |
void | RemoveAllObservers () |
int | HasObserver (unsigned long event) |
int | HasObserver (const char *event) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
int | InvokeEvent (unsigned long event, void *callData) |
int | InvokeEvent (const char *event, void *callData) |
int | InvokeEvent (unsigned long event) |
int | InvokeEvent (const char *event) |
Public Member Functions inherited from vtkObjectBase | |
const char * | GetClassName () const |
virtual void | Delete () |
virtual void | FastDelete () |
void | Print (ostream &os) |
virtual void | Register (vtkObjectBase *o) |
virtual void | UnRegister (vtkObjectBase *o) |
void | SetReferenceCount (int) |
void | PrintRevisions (ostream &) |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
int | GetReferenceCount () |
Static Public Member Functions | |
static int | IsTypeOf (const char *type) |
static vtkChartLegend * | SafeDownCast (vtkObjectBase *o) |
static vtkChartLegend * | New () |
Static Public Member Functions inherited from vtkContextItem | |
static int | IsTypeOf (const char *type) |
static vtkContextItem * | SafeDownCast (vtkObjectBase *o) |
Static Public Member Functions inherited from vtkAbstractContextItem | |
static int | IsTypeOf (const char *type) |
static vtkAbstractContextItem * | SafeDownCast (vtkObjectBase *o) |
Static Public Member Functions inherited from vtkObject | |
static int | IsTypeOf (const char *type) |
static vtkObject * | SafeDownCast (vtkObjectBase *o) |
static vtkObject * | New () |
static void | BreakOnError () |
static void | SetGlobalWarningDisplay (int val) |
static void | GlobalWarningDisplayOn () |
static void | GlobalWarningDisplayOff () |
static int | GetGlobalWarningDisplay () |
Static Public Member Functions inherited from vtkObjectBase | |
static int | IsTypeOf (const char *name) |
static vtkObjectBase * | New () |
Protected Member Functions | |
virtual vtkObjectBase * | NewInstanceInternal () const |
vtkChartLegend () | |
~vtkChartLegend () | |
Protected Member Functions inherited from vtkContextItem | |
vtkContextItem () | |
~vtkContextItem () | |
Protected Member Functions inherited from vtkAbstractContextItem | |
vtkAbstractContextItem () | |
~vtkAbstractContextItem () | |
Protected Member Functions inherited from vtkObject | |
vtkObject () | |
virtual | ~vtkObject () |
virtual void | RegisterInternal (vtkObjectBase *, int check) |
virtual void | UnRegisterInternal (vtkObjectBase *, int check) |
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL) |
void | InternalReleaseFocus () |
Protected Member Functions inherited from vtkObjectBase | |
vtkObjectBase () | |
virtual | ~vtkObjectBase () |
virtual void | CollectRevisions (ostream &) |
virtual void | ReportReferences (vtkGarbageCollector *) |
vtkObjectBase (const vtkObjectBase &) | |
void | operator= (const vtkObjectBase &) |
Protected Attributes | |
float * | Point |
int | HorizontalAlignment |
int | VerticalAlignment |
vtkNew< vtkPen > | Pen |
vtkNew< vtkBrush > | Brush |
vtkNew< vtkTextProperty > | LabelProperties |
bool | DragEnabled |
bool | CacheBounds |
int | Button |
vtkTimeStamp | PlotTime |
vtkTimeStamp | RectTime |
vtkRectf | Rect |
int | Padding |
int | SymbolWidth |
bool | Inline |
Private * | Storage |
Protected Attributes inherited from vtkContextItem | |
double | Opacity |
Protected Attributes inherited from vtkAbstractContextItem | |
vtkContextScene * | Scene |
vtkAbstractContextItem * | Parent |
vtkContextScenePrivate * | Children |
bool | Visible |
bool | Interactive |
Protected Attributes inherited from vtkObject | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
Protected Attributes inherited from vtkObjectBase | |
vtkAtomicInt32 | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
draw the chart legend
The vtkChartLegend is drawn in screen coordinates. It is usually one of the last elements of a chart to be drawn. It renders the the mark/line for each plot, and the plot labels.
Definition at line 41 of file vtkChartLegend.h.
Definition at line 44 of file vtkChartLegend.h.
anonymous enum |
Enumerator | |
---|---|
LEFT | |
CENTER | |
RIGHT | |
TOP | |
BOTTOM | |
CUSTOM |
Definition at line 60 of file vtkChartLegend.h.
|
protected |
|
protected |
|
static |
|
virtual |
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkContextItem.
Reimplemented in vtkCategoryLegend, and vtkColorLegend.
|
static |
|
protectedvirtual |
Reimplemented from vtkContextItem.
Reimplemented in vtkCategoryLegend, and vtkColorLegend.
vtkChartLegend* vtkChartLegend::NewInstance | ( | ) | const |
|
virtual |
Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from vtkContextItem.
Reimplemented in vtkColorLegend.
|
static |
Creates a 2D Chart object.
Set point the legend box is anchored to.
Reimplemented in vtkColorLegend.
void vtkChartLegend::SetPoint | ( | float | [2] | ) |
Set point the legend box is anchored to.
|
virtual |
Get point the legend box is anchored to.
Get point the legend box is anchored to.
|
virtual |
Get point the legend box is anchored to.
void vtkChartLegend::SetPoint | ( | const vtkVector2f & | point | ) |
Set point the legend box is anchored to.
const vtkVector2f& vtkChartLegend::GetPointVector | ( | ) |
Get point the legend box is anchored to.
|
virtual |
Set the horizontal alignment of the legend to the point specified. Valid values are LEFT, CENTER and RIGHT.
|
virtual |
Get the horizontal alignment of the legend to the point specified.
|
virtual |
Set the vertical alignment of the legend to the point specified. Valid values are TOP, CENTER and BOTTOM.
|
virtual |
Get the vertical alignment of the legend to the point specified.
|
virtual |
Set the padding between legend marks, default is 5.
|
virtual |
Get the padding between legend marks.
|
virtual |
Set the symbol width, default is 15.
|
virtual |
Get the legend symbol width.
|
virtual |
Set the point size of the label text.
|
virtual |
Get the point size of the label text.
|
virtual |
Get/set if the legend should be drawn inline (inside the chart), or not. True would generally request that the chart draws it inside the chart, false would adjust the chart axes and make space to draw the axes outside.
|
virtual |
Get/set if the legend should be drawn inline (inside the chart), or not. True would generally request that the chart draws it inside the chart, false would adjust the chart axes and make space to draw the axes outside.
|
virtual |
Get/set if the legend can be dragged with the mouse button, or not. True results in left click and drag causing the legend to move around the scene. False disables response to mouse events. The default is true.
|
virtual |
Get/set if the legend can be dragged with the mouse button, or not. True results in left click and drag causing the legend to move around the scene. False disables response to mouse events. The default is true.
void vtkChartLegend::SetChart | ( | vtkChart * | chart | ) |
Set the chart that the legend belongs to and will draw the legend for.
vtkChart* vtkChartLegend::GetChart | ( | ) |
Get the chart that the legend belongs to and will draw the legend for.
|
virtual |
Update the geometry of the axis. Takes care of setting up the tick mark locations etc. Should be called by the scene before rendering.
Reimplemented from vtkAbstractContextItem.
Reimplemented in vtkColorLegend.
|
virtual |
Paint event for the axis, called whenever the axis needs to be drawn.
Reimplemented from vtkAbstractContextItem.
Reimplemented in vtkColorLegend, and vtkCategoryLegend.
|
virtual |
Request the space the legend requires to be drawn. This is returned as a vtkRect4f, with the corner being the offset from Point, and the width/ height being the total width/height required by the axis. In order to ensure the numbers are correct, Update() should be called first.
Reimplemented in vtkColorLegend, and vtkCategoryLegend.
vtkPen* vtkChartLegend::GetPen | ( | ) |
Get the pen used to draw the legend outline.
vtkBrush* vtkChartLegend::GetBrush | ( | ) |
Get the brush used to draw the legend background.
vtkTextProperty* vtkChartLegend::GetLabelProperties | ( | ) |
Get the vtkTextProperty for the legend's labels.
|
virtual |
Toggle whether or not this legend should attempt to cache its position and size. The default value is true. If this value is set to false, the legend will recalculate its position and bounds every time it is drawn. If users will be able to zoom in or out on your legend, you may want to set this to false. Otherwise, the border around the legend may not resize appropriately.
|
virtual |
Toggle whether or not this legend should attempt to cache its position and size. The default value is true. If this value is set to false, the legend will recalculate its position and bounds every time it is drawn. If users will be able to zoom in or out on your legend, you may want to set this to false. Otherwise, the border around the legend may not resize appropriately.
|
virtual |
Toggle whether or not this legend should attempt to cache its position and size. The default value is true. If this value is set to false, the legend will recalculate its position and bounds every time it is drawn. If users will be able to zoom in or out on your legend, you may want to set this to false. Otherwise, the border around the legend may not resize appropriately.
|
virtual |
Toggle whether or not this legend should attempt to cache its position and size. The default value is true. If this value is set to false, the legend will recalculate its position and bounds every time it is drawn. If users will be able to zoom in or out on your legend, you may want to set this to false. Otherwise, the border around the legend may not resize appropriately.
|
virtual |
Return true if the supplied x, y coordinate is inside the item.
Reimplemented from vtkAbstractContextItem.
|
virtual |
|
virtual |
Mouse button down event
Reimplemented from vtkAbstractContextItem.
|
virtual |
Mouse button release event.
Reimplemented from vtkAbstractContextItem.
|
protected |
Definition at line 200 of file vtkChartLegend.h.
|
protected |
Definition at line 201 of file vtkChartLegend.h.
|
protected |
Definition at line 202 of file vtkChartLegend.h.
The pen used to draw the legend box.
Definition at line 205 of file vtkChartLegend.h.
The brush used to render the background of the legend.
Definition at line 208 of file vtkChartLegend.h.
|
protected |
The text properties of the labels used in the legend.
Definition at line 211 of file vtkChartLegend.h.
|
protected |
Should we move the legend box around in response to the mouse drag?
Definition at line 214 of file vtkChartLegend.h.
|
protected |
Should the legend attempt to avoid recalculating its position & bounds unnecessarily?
Definition at line 218 of file vtkChartLegend.h.
|
protected |
Last button to be pressed.
Definition at line 221 of file vtkChartLegend.h.
|
protected |
Definition at line 223 of file vtkChartLegend.h.
|
protected |
Definition at line 224 of file vtkChartLegend.h.
|
protected |
Definition at line 226 of file vtkChartLegend.h.
|
protected |
Padding between symbol and text.
Definition at line 229 of file vtkChartLegend.h.
|
protected |
Width of the symbols in pixels in the legend.
Definition at line 232 of file vtkChartLegend.h.
|
protected |
Should the legend be drawn inline in its chart?
Definition at line 235 of file vtkChartLegend.h.
|
protected |
Definition at line 238 of file vtkChartLegend.h.