VTK
9.1.0
|
takes care of drawing 2D axes More...
#include <vtkAxis.h>
Public Types | |
enum | Location { LEFT = 0 , BOTTOM , RIGHT , TOP , PARALLEL } |
Enumeration of the axis locations in a conventional XY chart. More... | |
enum | { TICK_SIMPLE = 0 , TICK_WILKINSON_EXTENDED } |
enum | { STANDARD_NOTATION = 0 , SCIENTIFIC_NOTATION , FIXED_NOTATION , PRINTF_NOTATION } |
Enumeration of the axis notations available. More... | |
enum | { AUTO = 0 , FIXED , CUSTOM } |
Enumeration of the axis behaviors. More... | |
typedef vtkContextItem | Superclass |
Public Types inherited from vtkContextItem | |
typedef vtkAbstractContextItem | Superclass |
Public Types inherited from vtkAbstractContextItem | |
typedef vtkObject | Superclass |
Public Member Functions | |
virtual vtkTypeBool | IsA (const char *type) |
Return 1 if this class is the same type of (or a subclass of) the named class. | |
vtkAxis * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) override |
Methods invoked by print to print information about the object including superclasses. | |
virtual void | SetNumberOfTicks (int numberOfTicks) |
Set the number of tick marks for this axis. | |
virtual void | SetMinimum (double minimum) |
Set the logical minimum value of the axis, in plot coordinates. | |
virtual void | SetMaximum (double maximum) |
Set the logical maximum value of the axis, in plot coordinates. | |
virtual void | SetUnscaledMinimum (double minimum) |
Set the logical, unscaled minimum value of the axis, in plot coordinates. | |
virtual void | SetUnscaledMaximum (double maximum) |
Set the logical maximum value of the axis, in plot coordinates. | |
virtual void | SetMinimumLimit (double lowest) |
Set the logical lowest possible value for Minimum, in plot coordinates. | |
virtual void | SetMaximumLimit (double highest) |
Set the logical highest possible value for Maximum, in plot coordinates. | |
virtual void | SetUnscaledMinimumLimit (double lowest) |
Set the logical lowest possible value for Minimum, in plot coordinates. | |
virtual void | SetUnscaledMaximumLimit (double highest) |
Set the logical highest possible value for Maximum, in plot coordinates. | |
void | Update () override |
Update the geometry of the axis. | |
bool | Paint (vtkContext2D *painter) override |
Paint event for the axis, called whenever the axis needs to be drawn. | |
virtual void | AutoScale () |
Use this function to autoscale the axes after setting the minimum and maximum values. | |
virtual void | RecalculateTickSpacing () |
Recalculate the spacing of the tick marks - typically useful to do after scaling the axis. | |
virtual vtkDoubleArray * | GetTickPositions () |
An array with the positions of the tick marks along the axis line. | |
virtual vtkFloatArray * | GetTickScenePositions () |
An array with the positions of the tick marks along the axis line. | |
virtual vtkStringArray * | GetTickLabels () |
A string array containing the tick labels for the axis. | |
virtual bool | SetCustomTickPositions (vtkDoubleArray *positions, vtkStringArray *labels=nullptr) |
Set the tick positions, and optionally custom tick labels. | |
vtkRectf | GetBoundingRect (vtkContext2D *painter) |
Request the space the axes require to be drawn. | |
virtual vtkStdString | GenerateSimpleLabel (double val) |
Generate a single label using the current settings when TickLabelAlgorithm is TICK_SIMPLE. | |
bool | Hit (const vtkContextMouseEvent &mouse) override |
Return true if the supplied x, y coordinate is inside the item. | |
virtual void | SetPosition (int position) |
Get/set the position of the axis (LEFT, BOTTOM, RIGHT, TOP, PARALLEL). | |
virtual int | GetPosition () |
Get/set the position of the axis (LEFT, BOTTOM, RIGHT, TOP, PARALLEL). | |
void | SetPoint1 (const vtkVector2f &pos) |
Set point 1 of the axis (in pixels), this is usually the origin. | |
void | SetPoint1 (float x, float y) |
Set point 1 of the axis (in pixels), this is usually the origin. | |
virtual float * | GetPoint1 () |
Get point 1 of the axis (in pixels), this is usually the origin. | |
virtual void | GetPoint1 (float &, float &) |
Get point 1 of the axis (in pixels), this is usually the origin. | |
virtual void | GetPoint1 (float[2]) |
Get point 1 of the axis (in pixels), this is usually the origin. | |
vtkVector2f | GetPosition1 () |
Get point 1 of the axis (in pixels), this is usually the origin. | |
void | SetPoint2 (const vtkVector2f &pos) |
Set point 2 of the axis (in pixels), this is usually the terminus. | |
void | SetPoint2 (float x, float y) |
Set point 2 of the axis (in pixels), this is usually the terminus. | |
virtual float * | GetPoint2 () |
Get point 2 of the axis (in pixels), this is usually the terminus. | |
virtual void | GetPoint2 (float &, float &) |
Get point 2 of the axis (in pixels), this is usually the terminus. | |
virtual void | GetPoint2 (float[2]) |
Get point 2 of the axis (in pixels), this is usually the terminus. | |
vtkVector2f | GetPosition2 () |
Get point 2 of the axis (in pixels), this is usually the terminus. | |
virtual int | GetNumberOfTicks () |
Get the number of tick marks for this axis. | |
virtual void | SetTickLength (float) |
Get/set the length of tick marks (in pixels). | |
virtual float | GetTickLength () |
Get/set the length of tick marks (in pixels). | |
virtual vtkTextProperty * | GetLabelProperties () |
Get the vtkTextProperty that governs how the axis labels are displayed. | |
virtual double | GetMinimum () |
Get the logical minimum value of the axis, in plot coordinates. | |
virtual double | GetMaximum () |
Get the logical maximum value of the axis, in plot coordinates. | |
virtual double | GetUnscaledMinimum () |
Get the logical minimum value of the axis, in plot coordinates. | |
virtual double | GetUnscaledMaximum () |
Get the logical maximum value of the axis, in plot coordinates. | |
virtual void | SetRange (double minimum, double maximum) |
Set the logical range of the axis, in plot coordinates. | |
virtual void | SetRange (double range[2]) |
Set the logical range of the axis, in plot coordinates. | |
virtual void | SetUnscaledRange (double minimum, double maximum) |
Set the logical range of the axis, in plot coordinates. | |
virtual void | SetUnscaledRange (double range[2]) |
Set the logical range of the axis, in plot coordinates. | |
virtual void | GetRange (double *range) |
Get the logical range of the axis, in plot coordinates. | |
virtual void | GetUnscaledRange (double *range) |
Get the logical range of the axis, in plot coordinates. | |
virtual double | GetMinimumLimit () |
Get the logical lowest possible value for Minimum, in plot coordinates. | |
virtual double | GetMaximumLimit () |
Get the logical highest possible value for Maximum, in plot coordinates. | |
virtual double | GetUnscaledMinimumLimit () |
Get the logical lowest possible value for Minimum, in plot coordinates. | |
virtual double | GetUnscaledMaximumLimit () |
Get the logical highest possible value for Maximum, in plot coordinates. | |
virtual int * | GetMargins () |
Get the margins of the axis, in pixels. | |
virtual void | GetMargins (int &, int &) |
Get the margins of the axis, in pixels. | |
virtual void | GetMargins (int[2]) |
Get the margins of the axis, in pixels. | |
virtual void | SetMargins (int, int) |
Set the margins of the axis, in pixels. | |
void | SetMargins (int[2]) |
Set the margins of the axis, in pixels. | |
virtual void | SetTitle (const vtkStdString &title) |
Get/set the title text of the axis. | |
virtual vtkStdString | GetTitle () |
Get/set the title text of the axis. | |
virtual vtkTextProperty * | GetTitleProperties () |
Get the vtkTextProperty that governs how the axis title is displayed. | |
virtual bool | GetLogScaleActive () |
Get whether the axis is using a log scale. | |
virtual bool | GetLogScale () |
Get/set whether the axis should attempt to use a log scale. | |
virtual void | SetLogScale (bool logScale) |
Get/set whether the axis should attempt to use a log scale. | |
virtual void | LogScaleOn () |
Get/set whether the axis should attempt to use a log scale. | |
virtual void | LogScaleOff () |
Get/set whether the axis should attempt to use a log scale. | |
virtual void | SetGridVisible (bool) |
Get/set whether the axis grid lines should be drawn, default is true. | |
virtual bool | GetGridVisible () |
Get/set whether the axis grid lines should be drawn, default is true. | |
virtual void | SetLabelsVisible (bool) |
Get/set whether the axis labels should be visible. | |
virtual bool | GetLabelsVisible () |
Get/set whether the axis labels should be visible. | |
virtual void | SetRangeLabelsVisible (bool) |
Get/set whether the labels for the range should be visible. | |
virtual bool | GetRangeLabelsVisible () |
Get/set whether the labels for the range should be visible. | |
virtual void | SetLabelOffset (float) |
Get/set the offset (in pixels) of the label text position from the axis. | |
virtual float | GetLabelOffset () |
Get/set the offset (in pixels) of the label text position from the axis. | |
virtual void | SetTicksVisible (bool) |
Get/set whether the tick marks should be visible. | |
virtual bool | GetTicksVisible () |
Get/set whether the tick marks should be visible. | |
virtual void | SetAxisVisible (bool) |
Get/set whether the axis line should be visible. | |
virtual bool | GetAxisVisible () |
Get/set whether the axis line should be visible. | |
virtual void | SetTitleVisible (bool) |
Get/set whether the axis title should be visible. | |
virtual bool | GetTitleVisible () |
Get/set whether the axis title should be visible. | |
virtual void | SetPrecision (int precision) |
Get/set the numerical precision to use, default is 2. | |
virtual int | GetPrecision () |
Get/set the numerical precision to use, default is 2. | |
virtual void | SetLabelFormat (const std::string &fmt) |
Get/Set the printf-style format string used when TickLabelAlgorithm is TICK_SIMPLE and Notation is PRINTF_NOTATION. | |
virtual std::string | GetLabelFormat () |
Get/Set the printf-style format string used when TickLabelAlgorithm is TICK_SIMPLE and Notation is PRINTF_NOTATION. | |
virtual void | SetRangeLabelFormat (std::string) |
Get/Set the printf-style format string used for range labels. | |
virtual std::string | GetRangeLabelFormat () |
Get/Set the printf-style format string used for range labels. | |
virtual void | SetNotation (int notation) |
Get/set the numerical notation, standard, scientific, fixed, or a printf-style format string. | |
virtual int | GetNotation () |
Get/set the numerical notation, standard, scientific, fixed, or a printf-style format string. | |
virtual void | SetBehavior (int) |
Get/set the behavior of the axis (auto or fixed). | |
virtual int | GetBehavior () |
Get/set the behavior of the axis (auto or fixed). | |
virtual vtkPen * | GetPen () |
Get a pointer to the vtkPen object that controls the way this axis is drawn. | |
virtual vtkPen * | GetGridPen () |
Get a pointer to the vtkPen object that controls the way this axis is drawn. | |
virtual void | SetTickLabelAlgorithm (int) |
Get/set the tick label algorithm that is used to calculate the min, max and tick spacing. | |
virtual int | GetTickLabelAlgorithm () |
Get/set the tick label algorithm that is used to calculate the min, max and tick spacing. | |
virtual void | SetScalingFactor (double) |
Get/set the scaling factor used for the axis, this defaults to 1.0 (no scaling), and is used to coordinate scaling with the plots, charts, etc. | |
virtual double | GetScalingFactor () |
Get/set the scaling factor used for the axis, this defaults to 1.0 (no scaling), and is used to coordinate scaling with the plots, charts, etc. | |
virtual void | SetShift (double) |
Get/set the scaling factor used for the axis, this defaults to 1.0 (no scaling), and is used to coordinate scaling with the plots, charts, etc. | |
virtual double | GetShift () |
Get/set the scaling factor used for the axis, this defaults to 1.0 (no scaling), and is used to coordinate scaling with the plots, charts, etc. | |
Public Member Functions inherited from vtkContextItem | |
virtual vtkTypeBool | IsA (const char *type) |
Return 1 if this class is the same type of (or a subclass of) the named class. | |
vtkContextItem * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) override |
Methods invoked by print to print information about the object including superclasses. | |
virtual void | SetTransform (vtkContextTransform *) |
Set the transform of the item. | |
virtual double | GetOpacity () |
Get the opacity of the item. | |
virtual void | SetOpacity (double) |
Set the opacity of the item. | |
Public Member Functions inherited from vtkAbstractContextItem | |
virtual vtkTypeBool | IsA (const char *type) |
Return 1 if this class is the same type of (or a subclass of) the named class. | |
vtkAbstractContextItem * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) override |
Methods invoked by print to print information about the object including superclasses. | |
virtual void | Update () |
Perform any updates to the item that may be necessary before rendering. | |
virtual bool | Paint (vtkContext2D *painter) |
Paint event for the item, called whenever the item needs to be drawn. | |
virtual bool | PaintChildren (vtkContext2D *painter) |
Paint the children of the item, should be called whenever the children need to be rendered. | |
virtual void | ReleaseGraphicsResources () |
Release graphics resources hold by the item. | |
vtkIdType | AddItem (vtkAbstractContextItem *item) |
Add child items to this item. | |
bool | RemoveItem (vtkAbstractContextItem *item) |
Remove child item from this item. | |
bool | RemoveItem (vtkIdType index) |
Remove child item from this item. | |
vtkAbstractContextItem * | GetItem (vtkIdType index) |
Get the item at the specified index. | |
vtkIdType | GetItemIndex (vtkAbstractContextItem *item) |
Get the index of the specified item in itemIndex. | |
vtkIdType | GetNumberOfItems () |
Get the number of child items. | |
void | ClearItems () |
Remove all child items from this item. | |
vtkIdType | Raise (vtkIdType index) |
Raises the child to the top of the item's stack. | |
virtual vtkIdType | StackAbove (vtkIdType index, vtkIdType under) |
Raises the child above the under sibling. | |
vtkIdType | Lower (vtkIdType index) |
Lowers the child to the bottom of the item's stack. | |
virtual vtkIdType | StackUnder (vtkIdType child, vtkIdType above) |
Lowers the child under the above sibling. | |
virtual bool | Hit (const vtkContextMouseEvent &mouse) |
Return true if the supplied x, y coordinate is inside the item. | |
virtual vtkAbstractContextItem * | GetPickedItem (const vtkContextMouseEvent &mouse) |
Return the item under the mouse. | |
virtual bool | MouseEnterEvent (const vtkContextMouseEvent &mouse) |
Mouse enter event. | |
virtual bool | MouseMoveEvent (const vtkContextMouseEvent &mouse) |
Mouse move event. | |
virtual bool | MouseLeaveEvent (const vtkContextMouseEvent &mouse) |
Mouse leave event. | |
virtual bool | MouseButtonPressEvent (const vtkContextMouseEvent &mouse) |
Mouse button down event Return true if the item holds the event, false if the event can be propagated to other items. | |
virtual bool | MouseButtonReleaseEvent (const vtkContextMouseEvent &mouse) |
Mouse button release event. | |
virtual bool | MouseDoubleClickEvent (const vtkContextMouseEvent &mouse) |
Mouse button double click event. | |
virtual bool | MouseWheelEvent (const vtkContextMouseEvent &mouse, int delta) |
Mouse wheel event, positive delta indicates forward movement of the wheel. | |
virtual bool | KeyPressEvent (const vtkContextKeyEvent &key) |
Key press event. | |
virtual bool | KeyReleaseEvent (const vtkContextKeyEvent &key) |
Key release event. | |
virtual void | SetScene (vtkContextScene *scene) |
Set the vtkContextScene for the item, always set for an item in a scene. | |
vtkContextScene * | GetScene () |
Get the vtkContextScene for the item, always set for an item in a scene. | |
virtual void | SetParent (vtkAbstractContextItem *parent) |
Set the parent item. | |
vtkAbstractContextItem * | GetParent () |
Get the parent item. | |
virtual vtkVector2f | MapToParent (const vtkVector2f &point) |
Maps the point to the parent coordinate system. | |
virtual vtkVector2f | MapFromParent (const vtkVector2f &point) |
Maps the point from the parent coordinate system. | |
virtual vtkVector2f | MapToScene (const vtkVector2f &point) |
Maps the point to the scene coordinate system. | |
virtual vtkVector2f | MapFromScene (const vtkVector2f &point) |
Maps the point from the scene coordinate system. | |
virtual bool | GetVisible () |
Get the visibility of the item (should it be drawn). | |
virtual void | SetVisible (bool) |
Set the visibility of the item (should it be drawn). | |
virtual bool | GetInteractive () |
Get if the item is interactive (should respond to mouse events). | |
virtual void | SetInteractive (bool) |
Set if the item is interactive (should respond to mouse events). | |
Public Member Functions inherited from vtkObject | |
vtkBaseTypeMacro (vtkObject, vtkObjectBase) | |
virtual void | DebugOn () |
Turn debugging output on. | |
virtual void | DebugOff () |
Turn debugging output off. | |
bool | GetDebug () |
Get the value of the debug flag. | |
void | SetDebug (bool debugFlag) |
Set the value of the debug flag. | |
virtual void | Modified () |
Update the modification time for this object. | |
virtual vtkMTimeType | GetMTime () |
Return this object's modified time. | |
void | PrintSelf (ostream &os, vtkIndent indent) override |
Methods invoked by print to print information about the object including superclasses. | |
void | RemoveObserver (unsigned long tag) |
void | RemoveObservers (unsigned long event) |
void | RemoveObservers (const char *event) |
void | RemoveAllObservers () |
vtkTypeBool | HasObserver (unsigned long event) |
vtkTypeBool | HasObserver (const char *event) |
int | InvokeEvent (unsigned long event) |
int | InvokeEvent (const char *event) |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
vtkCommand * | GetCommand (unsigned long tag) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
void | RemoveObserver (vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
void | RemoveObservers (unsigned long event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
void | RemoveObservers (const char *event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
vtkTypeBool | HasObserver (unsigned long event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
vtkTypeBool | HasObserver (const char *event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
Overloads to AddObserver that allow developers to add class member functions as callbacks for events. | |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
Overloads to AddObserver that allow developers to add class member functions as callbacks for events. | |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
Allow user to set the AbortFlagOn() with the return value of the callback method. | |
int | InvokeEvent (unsigned long event, void *callData) |
This method invokes an event and return whether the event was aborted or not. | |
int | InvokeEvent (const char *event, void *callData) |
This method invokes an event and return whether the event was aborted or not. | |
Public Member Functions inherited from vtkObjectBase | |
const char * | GetClassName () const |
Return the class name as a string. | |
virtual vtkTypeBool | IsA (const char *name) |
Return 1 if this class is the same type of (or a subclass of) the named class. | |
virtual vtkIdType | GetNumberOfGenerationsFromBase (const char *name) |
Given the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class). | |
virtual void | Delete () |
Delete a VTK object. | |
virtual void | FastDelete () |
Delete a reference to this object. | |
void | InitializeObjectBase () |
void | Print (ostream &os) |
Print an object to an ostream. | |
virtual void | Register (vtkObjectBase *o) |
Increase the reference count (mark as used by another object). | |
virtual void | UnRegister (vtkObjectBase *o) |
Decrease the reference count (release by another object). | |
int | GetReferenceCount () |
Return the current reference count of this object. | |
void | SetReferenceCount (int) |
Sets the reference count. | |
bool | GetIsInMemkind () const |
A local state flag that remembers whether this object lives in the normal or extended memory space. | |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
Methods invoked by print to print information about the object including superclasses. | |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
Methods invoked by print to print information about the object including superclasses. | |
Static Public Member Functions | |
static vtkTypeBool | IsTypeOf (const char *type) |
static vtkAxis * | SafeDownCast (vtkObjectBase *o) |
static vtkAxis * | New () |
Creates a 2D Chart object. | |
static double | NiceNumber (double number, bool roundUp) |
Return a "nice number", often defined as 1, 2 or 5. | |
static double | NiceMinMax (double &min, double &max, float pixelRange, float tickPixelSpacing) |
Static function to calculate "nice" minimum, maximum, and tick spacing values. | |
Static Public Member Functions inherited from vtkContextItem | |
static vtkTypeBool | IsTypeOf (const char *type) |
static vtkContextItem * | SafeDownCast (vtkObjectBase *o) |
Static Public Member Functions inherited from vtkAbstractContextItem | |
static vtkTypeBool | IsTypeOf (const char *type) |
static vtkAbstractContextItem * | SafeDownCast (vtkObjectBase *o) |
Static Public Member Functions inherited from vtkObject | |
static vtkObject * | New () |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on. | |
static void | BreakOnError () |
This method is called when vtkErrorMacro executes. | |
static void | SetGlobalWarningDisplay (int val) |
This is a global flag that controls whether any debug, warning or error messages are displayed. | |
static void | GlobalWarningDisplayOn () |
This is a global flag that controls whether any debug, warning or error messages are displayed. | |
static void | GlobalWarningDisplayOff () |
This is a global flag that controls whether any debug, warning or error messages are displayed. | |
static int | GetGlobalWarningDisplay () |
This is a global flag that controls whether any debug, warning or error messages are displayed. | |
Static Public Member Functions inherited from vtkObjectBase | |
static vtkTypeBool | IsTypeOf (const char *name) |
Return 1 if this class type is the same type of (or a subclass of) the named class. | |
static vtkIdType | GetNumberOfGenerationsFromBaseType (const char *name) |
Given a the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class). | |
static vtkObjectBase * | New () |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on. | |
static void | SetMemkindDirectory (const char *directoryname) |
The name of a directory, ideally mounted -o dax, to memory map an extended memory space within. | |
static bool | GetUsingMemkind () |
A global state flag that controls whether vtkObjects are constructed in the usual way (the default) or within the extended memory space. | |
Protected Member Functions | |
virtual vtkObjectBase * | NewInstanceInternal () const |
vtkAxis () | |
~vtkAxis () override | |
void | UpdateLogScaleActive (bool updateMinMaxFromUnscaled) |
Update whether log scaling will be used for layout and rendering. | |
virtual void | GenerateTickLabels (double min, double max) |
Calculate and assign nice labels/logical label positions. | |
virtual void | GenerateTickLabels () |
Generate tick labels from the supplied double array of tick positions. | |
virtual void | GenerateLabelFormat (int notation, double n) |
virtual vtkStdString | GenerateSprintfLabel (double value, const std::string &format) |
Generate label using a printf-style format string. | |
double | CalculateNiceMinMax (double &min, double &max) |
Calculate the next "nicest" numbers above and below the current minimum. | |
double | LogScaleTickMark (double number, bool roundUp, bool &niceValue, int &order) |
Return a tick mark for a logarithmic axis. | |
virtual void | GenerateLogSpacedLinearTicks (int order, double min, double max) |
Generate logarithmically-spaced tick marks with linear-style labels. | |
void | GenerateLogScaleTickMarks (int order, double min=1.0, double max=9.0, bool detailLabels=true) |
Generate tick marks for logarithmic scale for specific order of magnitude. | |
void | CalculateTitlePosition (vtkVector2f &out) |
Calculate the position where the title of the axis would be drawn. | |
Protected Member Functions inherited from vtkContextItem | |
virtual vtkObjectBase * | NewInstanceInternal () const |
vtkContextItem ()=default | |
~vtkContextItem () override=default | |
Protected Member Functions inherited from vtkAbstractContextItem | |
virtual vtkObjectBase * | NewInstanceInternal () const |
vtkAbstractContextItem () | |
~vtkAbstractContextItem () override | |
Protected Member Functions inherited from vtkObject | |
vtkObject () | |
~vtkObject () override | |
void | RegisterInternal (vtkObjectBase *, vtkTypeBool check) override |
void | UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override |
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr) |
These methods allow a command to exclusively grab all events. | |
void | InternalReleaseFocus () |
These methods allow a command to exclusively grab all events. | |
Protected Member Functions inherited from vtkObjectBase | |
vtkObjectBase () | |
virtual | ~vtkObjectBase () |
virtual void | RegisterInternal (vtkObjectBase *, vtkTypeBool check) |
virtual void | UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) |
virtual void | ReportReferences (vtkGarbageCollector *) |
vtkObjectBase (const vtkObjectBase &) | |
void | operator= (const vtkObjectBase &) |
Protected Attributes | |
int | Position |
float * | Point1 |
float * | Point2 |
vtkVector2f | Position1 |
vtkVector2f | Position2 |
double | TickInterval |
int | NumberOfTicks |
float | TickLength |
vtkTextProperty * | LabelProperties |
double | Minimum |
double | Maximum |
double | MinimumLimit |
double | MaximumLimit |
double | UnscaledMinimum |
double | UnscaledMaximum |
double | UnscaledMinimumLimit |
double | UnscaledMaximumLimit |
double | NonLogUnscaledMinLimit |
double | NonLogUnscaledMaxLimit |
int | Margins [2] |
vtkStdString | Title |
vtkTextProperty * | TitleProperties |
bool | LogScale |
bool | LogScaleActive |
bool | GridVisible |
bool | LabelsVisible |
bool | RangeLabelsVisible |
float | LabelOffset |
bool | TicksVisible |
bool | AxisVisible |
bool | TitleVisible |
int | Precision |
int | Notation |
std::string | LabelFormat |
std::string | RangeLabelFormat |
int | Behavior |
float | MaxLabel [2] |
bool | TitleAppended |
bool | CustomTickLabels |
Are we using custom tick labels, or should the axis generate them? | |
vtkPen * | Pen |
This object stores the vtkPen that controls how the axis is drawn. | |
vtkPen * | GridPen |
This object stores the vtkPen that controls how the grid lines are drawn. | |
vtkSmartPointer< vtkDoubleArray > | TickPositions |
Position of tick marks in screen coordinates. | |
vtkSmartPointer< vtkFloatArray > | TickScenePositions |
Position of tick marks in screen coordinates. | |
vtkSmartPointer< vtkStringArray > | TickLabels |
The labels for the tick marks. | |
bool | UsingNiceMinMax |
Hint as to whether a nice min/max was set, otherwise labels may not be present at the top/bottom of the axis. | |
bool | TickMarksDirty |
Mark the tick labels as dirty when the min/max value is changed. | |
bool | Resized |
Flag to indicate that the axis has been resized. | |
int | TickLabelAlgorithm |
The algorithm being used to tick label placement. | |
vtkTimeStamp | BuildTime |
The point cache is marked dirty until it has been initialized. | |
double | ScalingFactor |
Scaling factor used on this axis, this is used to accurately render very small/large numbers accurately by converting the underlying range by the scaling factor. | |
double | Shift |
Scaling factor used on this axis, this is used to accurately render very small/large numbers accurately by converting the underlying range by the scaling factor. | |
Protected Attributes inherited from vtkContextItem | |
double | Opacity = 1.0 |
vtkContextTransform * | Transform = nullptr |
Protected Attributes inherited from vtkAbstractContextItem | |
vtkContextScene * | Scene |
Point to the scene the item is on - can be null. | |
vtkAbstractContextItem * | Parent |
Point to the parent item - can be null. | |
vtkContextScenePrivate * | Children |
This structure provides a list of children, along with convenience functions to paint the children etc. | |
bool | Visible |
Store the visibility of the item (default is true). | |
bool | Interactive |
Store whether the item should respond to interactions (default is true). | |
Protected Attributes inherited from vtkObject | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
Protected Attributes inherited from vtkObjectBase | |
std::atomic< int32_t > | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
Additional Inherited Members | |
Static Protected Member Functions inherited from vtkObjectBase | |
static vtkMallocingFunction | GetCurrentMallocFunction () |
static vtkReallocingFunction | GetCurrentReallocFunction () |
static vtkFreeingFunction | GetCurrentFreeFunction () |
static vtkFreeingFunction | GetAlternateFreeFunction () |
takes care of drawing 2D axes
The vtkAxis is drawn in screen coordinates. It is usually one of the last elements of a chart to be drawn. It renders the axis label, tick marks and tick labels. The tick marks and labels span the range of values between Minimum and Maximum. The Minimum and Maximum values are not allowed to extend beyond the MinimumLimit and MaximumLimit values, respectively.
Note that many other chart elements (e.g., vtkPlotPoints) refer to vtkAxis instances to determine how to scale raw data for presentation. In particular, care must be taken with logarithmic scaling. The axis Minimum, Maximum, and Limit values are stored both unscaled and scaled (with log(x) applied when GetLogScaleActive() returns true). User interfaces will most likely present the unscaled values as they represent the values provided by the user. Other chart elements may need the scaled values in order to draw in the same coordinate system.
Just because LogScale is set to true does not guarantee that the axis will use logarithmic scaling – the Minimum and Maximum values for the axis must both lie to the same side of origin (and not include the origin). Also, this switch from linear- to log-scaling may occur during a rendering pass if autoscaling is enabled. Because the log and pow functions are not invertible and the axis itself decides when to switch between them without offering any external class managing the axis a chance to save the old values, it saves old Limit values in NonLogUnscaled{Min,Max}Limit so that behavior is consistent when LogScale is changed from false to true and back again.
typedef vtkContextItem vtkAxis::Superclass |
enum vtkAxis::Location |
anonymous enum |
anonymous enum |
anonymous enum |
|
protected |
|
overrideprotected |
|
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.
|
static |
|
protectedvirtual |
Reimplemented from vtkContextItem.
vtkAxis * vtkAxis::NewInstance | ( | ) | const |
|
overridevirtual |
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 vtkObjectBase.
|
static |
Creates a 2D Chart object.
|
virtual |
Get/set the position of the axis (LEFT, BOTTOM, RIGHT, TOP, PARALLEL).
|
virtual |
Get/set the position of the axis (LEFT, BOTTOM, RIGHT, TOP, PARALLEL).
void vtkAxis::SetPoint1 | ( | const vtkVector2f & | pos | ) |
Set point 1 of the axis (in pixels), this is usually the origin.
void vtkAxis::SetPoint1 | ( | float | x, |
float | y | ||
) |
Set point 1 of the axis (in pixels), this is usually the origin.
|
virtual |
Get point 1 of the axis (in pixels), this is usually the origin.
|
virtual |
Get point 1 of the axis (in pixels), this is usually the origin.
|
virtual |
Get point 1 of the axis (in pixels), this is usually the origin.
vtkVector2f vtkAxis::GetPosition1 | ( | ) |
Get point 1 of the axis (in pixels), this is usually the origin.
void vtkAxis::SetPoint2 | ( | const vtkVector2f & | pos | ) |
Set point 2 of the axis (in pixels), this is usually the terminus.
void vtkAxis::SetPoint2 | ( | float | x, |
float | y | ||
) |
Set point 2 of the axis (in pixels), this is usually the terminus.
|
virtual |
Get point 2 of the axis (in pixels), this is usually the terminus.
|
virtual |
Get point 2 of the axis (in pixels), this is usually the terminus.
|
virtual |
Get point 2 of the axis (in pixels), this is usually the terminus.
vtkVector2f vtkAxis::GetPosition2 | ( | ) |
Get point 2 of the axis (in pixels), this is usually the terminus.
|
virtual |
Set the number of tick marks for this axis.
Default is -1, which leads to automatic calculation of nicely spaced tick marks.
|
virtual |
Get the number of tick marks for this axis.
|
virtual |
Get/set the length of tick marks (in pixels).
|
virtual |
Get/set the length of tick marks (in pixels).
|
virtual |
Get the vtkTextProperty that governs how the axis labels are displayed.
Note that the alignment properties are not used.
|
virtual |
Set the logical minimum value of the axis, in plot coordinates.
If LogScaleActive is true (not just LogScale), then this sets the minimum base-10 exponent.
|
virtual |
Get the logical minimum value of the axis, in plot coordinates.
If LogScaleActive is true (not just LogScale), then this returns the minimum base-10 exponent.
|
virtual |
Set the logical maximum value of the axis, in plot coordinates.
If LogScaleActive is true (not just LogScale), then this sets the maximum base-10 exponent.
|
virtual |
Get the logical maximum value of the axis, in plot coordinates.
If LogScaleActive is true (not just LogScale), then this returns the maximum base-10 exponent.
|
virtual |
Set the logical, unscaled minimum value of the axis, in plot coordinates.
Use this instead of SetMinimum() if you wish to provide the actual minimum instead of log10(the minimum) as part of the axis scale.
|
virtual |
Get the logical minimum value of the axis, in plot coordinates.
|
virtual |
Set the logical maximum value of the axis, in plot coordinates.
|
virtual |
Get the logical maximum value of the axis, in plot coordinates.
|
virtual |
Set the logical range of the axis, in plot coordinates.
The unscaled range will always be in the same coordinate system of the data being plotted, regardless of whether LogScale is true or false. When calling SetRange() and LogScale is true, the range must be specified in logarithmic coordinates. Using SetUnscaledRange(), you may ignore the value of LogScale.
|
virtual |
Set the logical range of the axis, in plot coordinates.
The unscaled range will always be in the same coordinate system of the data being plotted, regardless of whether LogScale is true or false. When calling SetRange() and LogScale is true, the range must be specified in logarithmic coordinates. Using SetUnscaledRange(), you may ignore the value of LogScale.
|
virtual |
Set the logical range of the axis, in plot coordinates.
The unscaled range will always be in the same coordinate system of the data being plotted, regardless of whether LogScale is true or false. When calling SetRange() and LogScale is true, the range must be specified in logarithmic coordinates. Using SetUnscaledRange(), you may ignore the value of LogScale.
|
virtual |
Set the logical range of the axis, in plot coordinates.
The unscaled range will always be in the same coordinate system of the data being plotted, regardless of whether LogScale is true or false. When calling SetRange() and LogScale is true, the range must be specified in logarithmic coordinates. Using SetUnscaledRange(), you may ignore the value of LogScale.
|
virtual |
Get the logical range of the axis, in plot coordinates.
The unscaled range will always be in the same coordinate system of the data being plotted, regardless of whether LogScale is true or false. Calling GetRange() when LogScale is true will return the log10({min, max}).
|
virtual |
Get the logical range of the axis, in plot coordinates.
The unscaled range will always be in the same coordinate system of the data being plotted, regardless of whether LogScale is true or false. Calling GetRange() when LogScale is true will return the log10({min, max}).
|
virtual |
Set the logical lowest possible value for Minimum, in plot coordinates.
|
virtual |
Get the logical lowest possible value for Minimum, in plot coordinates.
|
virtual |
Set the logical highest possible value for Maximum, in plot coordinates.
|
virtual |
Get the logical highest possible value for Maximum, in plot coordinates.
|
virtual |
Set the logical lowest possible value for Minimum, in plot coordinates.
|
virtual |
Get the logical lowest possible value for Minimum, in plot coordinates.
|
virtual |
Set the logical highest possible value for Maximum, in plot coordinates.
|
virtual |
Get the logical highest possible value for Maximum, in plot coordinates.
|
virtual |
Get the margins of the axis, in pixels.
|
virtual |
Get the margins of the axis, in pixels.
|
virtual |
Get the margins of the axis, in pixels.
|
virtual |
Set the margins of the axis, in pixels.
void vtkAxis::SetMargins | ( | int | [2] | ) |
Set the margins of the axis, in pixels.
|
virtual |
Get/set the title text of the axis.
|
virtual |
Get/set the title text of the axis.
|
virtual |
Get the vtkTextProperty that governs how the axis title is displayed.
|
virtual |
Get whether the axis is using a log scale.
This will always be false when LogScale is false. It is only true when LogScale is true and the UnscaledRange does not cross or include the origin (zero).
The limits (MinimumLimit, MaximumLimit, and their unscaled counterparts) do not prevent LogScaleActive from becoming true; they are adjusted if they cross or include the origin and the original limits are preserved for when LogScaleActive becomes false again.
|
virtual |
Get/set whether the axis should attempt to use a log scale.
The default is false.
|
virtual |
Get/set whether the axis should attempt to use a log scale.
The default is false.
|
virtual |
Get/set whether the axis should attempt to use a log scale.
The default is false.
|
virtual |
Get/set whether the axis should attempt to use a log scale.
The default is false.
|
virtual |
Get/set whether the axis grid lines should be drawn, default is true.
|
virtual |
Get/set whether the axis grid lines should be drawn, default is true.
|
virtual |
Get/set whether the axis labels should be visible.
|
virtual |
Get/set whether the axis labels should be visible.
|
virtual |
Get/set whether the labels for the range should be visible.
|
virtual |
Get/set whether the labels for the range should be visible.
|
virtual |
Get/set the offset (in pixels) of the label text position from the axis.
|
virtual |
Get/set the offset (in pixels) of the label text position from the axis.
|
virtual |
Get/set whether the tick marks should be visible.
|
virtual |
Get/set whether the tick marks should be visible.
|
virtual |
Get/set whether the axis line should be visible.
|
virtual |
Get/set whether the axis line should be visible.
|
virtual |
Get/set whether the axis title should be visible.
|
virtual |
Get/set whether the axis title should be visible.
|
virtual |
Get/set the numerical precision to use, default is 2.
This is ignored when Notation is STANDARD_NOTATION or PRINTF_NOTATION.
|
virtual |
Get/set the numerical precision to use, default is 2.
This is ignored when Notation is STANDARD_NOTATION or PRINTF_NOTATION.
|
virtual |
Get/Set the printf-style format string used when TickLabelAlgorithm is TICK_SIMPLE and Notation is PRINTF_NOTATION.
The default is "%g".
|
virtual |
Get/Set the printf-style format string used when TickLabelAlgorithm is TICK_SIMPLE and Notation is PRINTF_NOTATION.
The default is "%g".
|
virtual |
Get/Set the printf-style format string used for range labels.
This format is always used regardless of TickLabelAlgorithm and Notation. Default is "%g".
|
virtual |
Get/Set the printf-style format string used for range labels.
This format is always used regardless of TickLabelAlgorithm and Notation. Default is "%g".
|
virtual |
Get/set the numerical notation, standard, scientific, fixed, or a printf-style format string.
|
virtual |
Get/set the numerical notation, standard, scientific, fixed, or a printf-style format string.
|
virtual |
Get/set the behavior of the axis (auto or fixed).
The default is 0 (auto).
|
virtual |
Get/set the behavior of the axis (auto or fixed).
The default is 0 (auto).
|
virtual |
Get a pointer to the vtkPen object that controls the way this axis is drawn.
|
virtual |
Get a pointer to the vtkPen object that controls the way this axis is drawn.
|
virtual |
Get/set the tick label algorithm that is used to calculate the min, max and tick spacing.
There are currently two algoriths, vtkAxis::TICK_SIMPLE is the default and uses a simple algorithm. The second option is vtkAxis::TICK_WILKINSON which uses an extended Wilkinson algorithm to find the optimal range, spacing and font parameters.
|
virtual |
Get/set the tick label algorithm that is used to calculate the min, max and tick spacing.
There are currently two algoriths, vtkAxis::TICK_SIMPLE is the default and uses a simple algorithm. The second option is vtkAxis::TICK_WILKINSON which uses an extended Wilkinson algorithm to find the optimal range, spacing and font parameters.
|
virtual |
Get/set the scaling factor used for the axis, this defaults to 1.0 (no scaling), and is used to coordinate scaling with the plots, charts, etc.
|
virtual |
Get/set the scaling factor used for the axis, this defaults to 1.0 (no scaling), and is used to coordinate scaling with the plots, charts, etc.
|
virtual |
Get/set the scaling factor used for the axis, this defaults to 1.0 (no scaling), and is used to coordinate scaling with the plots, charts, etc.
|
virtual |
Get/set the scaling factor used for the axis, this defaults to 1.0 (no scaling), and is used to coordinate scaling with the plots, charts, etc.
|
overridevirtual |
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.
|
overridevirtual |
Paint event for the axis, called whenever the axis needs to be drawn.
Reimplemented from vtkAbstractContextItem.
|
virtual |
Use this function to autoscale the axes after setting the minimum and maximum values.
This will cause the axes to select the nicest numbers that enclose the minimum and maximum values, and to select an appropriate number of tick marks.
|
virtual |
Recalculate the spacing of the tick marks - typically useful to do after scaling the axis.
|
virtual |
An array with the positions of the tick marks along the axis line.
The positions are specified in the plot coordinates of the axis.
|
virtual |
An array with the positions of the tick marks along the axis line.
The positions are specified in scene coordinates.
|
virtual |
A string array containing the tick labels for the axis.
|
virtual |
Set the tick positions, and optionally custom tick labels.
If the labels and positions are null then automatic tick labels will be assigned. If only positions are supplied then appropriate labels will be generated according to the axis settings. If positions and labels are supplied they must be of the same length. Returns true on success, false on failure.
vtkRectf vtkAxis::GetBoundingRect | ( | vtkContext2D * | painter | ) |
|
static |
Return a "nice number", often defined as 1, 2 or 5.
If roundUp is true then the nice number will be rounded up, false it is rounded down. The supplied number should be between 0.0 and 9.9.
|
static |
Static function to calculate "nice" minimum, maximum, and tick spacing values.
|
virtual |
Generate a single label using the current settings when TickLabelAlgorithm is TICK_SIMPLE.
|
overridevirtual |
Return true if the supplied x, y coordinate is inside the item.
Reimplemented from vtkAbstractContextItem.
|
protected |
Update whether log scaling will be used for layout and rendering.
Log scaling is only active when LogScaling is true and the closed, unscaled range does not contain the origin. The boolean parameter determines whether the minimum and maximum values are set from their unscaled counterparts.
|
protectedvirtual |
Calculate and assign nice labels/logical label positions.
|
protectedvirtual |
Generate tick labels from the supplied double array of tick positions.
|
protectedvirtual |
|
protectedvirtual |
Generate label using a printf-style format string.
|
protected |
Calculate the next "nicest" numbers above and below the current minimum.
|
protected |
Return a tick mark for a logarithmic axis.
If roundUp is true then the upper tick mark is returned. Otherwise the lower tick mark is returned. Tick marks will be: ... 0.1 0.2 .. 0.9 1 2 .. 9 10 20 .. 90 100 ... Parameter nicevalue will be set to true if tick mark is in: ... 0.1 0.2 0.5 1 2 5 10 20 50 100 ... Parameter order is set to the detected order of magnitude of the number.
|
protectedvirtual |
Generate logarithmically-spaced tick marks with linear-style labels.
This is for the case when log scaling is active, but the axis min and max span less than an order of magnitude. In this case, the most significant digit that varies is identified and ticks generated for each value that digit may take on. If that results in only 2 tick marks, the next-most-significant digit is varied. If more than 20 tick marks would result, the stride for the varying digit is increased.
|
protected |
Generate tick marks for logarithmic scale for specific order of magnitude.
Mark generation is limited by parameters min and max. Tick marks will be: ... 0.1 0.2 .. 0.9 1 2 .. 9 10 20 .. 90 100 ... Tick labels will be: ... 0.1 0.2 0.5 1 2 5 10 20 50 100 ... If Parameter detaillabels is disabled tick labels will be: ... 0.1 1 10 100 ... If min/max is not in between 1.0 and 9.0 defaults will be used. If min and max do not differ 1 defaults will be used.
|
protected |
Calculate the position where the title of the axis would be drawn.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |