154#include "vtkChartsCoreModule.h"
163VTK_ABI_NAMESPACE_BEGIN
192 TICK_WILKINSON_EXTENDED
205 vtkGetMacro(Position,
int);
220 vtkGetVector2Macro(Point1,
float);
236 vtkGetVector2Macro(Point2,
float);
250 vtkGetMacro(NumberOfTicks,
int);
257 vtkSetMacro(TickLength,
float);
258 vtkGetMacro(TickLength,
float);
282 vtkGetMacro(Minimum,
double);
298 vtkGetMacro(Maximum,
double);
312 vtkGetMacro(UnscaledMinimum,
double);
324 vtkGetMacro(UnscaledMaximum,
double);
337 virtual void SetRange(
double minimum,
double maximum);
364 vtkGetMacro(MinimumLimit,
double);
376 vtkGetMacro(MaximumLimit,
double);
388 vtkGetMacro(UnscaledMinimumLimit,
double);
400 vtkGetMacro(UnscaledMaximumLimit,
double);
407 vtkGetVector2Macro(Margins,
int);
414 vtkSetVector2Macro(Margins,
int);
445 vtkGetMacro(LogScaleActive,
bool);
455 vtkGetMacro(LogScale,
bool);
457 vtkBooleanMacro(LogScale,
bool);
464 vtkSetMacro(GridVisible,
bool);
465 vtkGetMacro(GridVisible,
bool);
472 vtkSetMacro(LabelsVisible,
bool);
473 vtkGetMacro(LabelsVisible,
bool);
480 vtkSetMacro(RangeLabelsVisible,
bool);
481 vtkGetMacro(RangeLabelsVisible,
bool);
488 vtkSetMacro(LabelOffset,
float);
489 vtkGetMacro(LabelOffset,
float);
496 vtkSetMacro(TicksVisible,
bool);
497 vtkGetMacro(TicksVisible,
bool);
504 vtkSetMacro(AxisVisible,
bool);
505 vtkGetMacro(AxisVisible,
bool);
512 vtkSetMacro(TitleVisible,
bool);
513 vtkGetMacro(TitleVisible,
bool);
522 vtkGetMacro(Precision,
int);
530 STANDARD_NOTATION = 0,
542 vtkGetMacro(LabelFormat, std::string);
551 vtkSetMacro(RangeLabelFormat, std::string);
552 vtkGetMacro(RangeLabelFormat, std::string);
562 vtkGetMacro(Notation,
int);
579 vtkSetMacro(Behavior,
int);
580 vtkGetMacro(Behavior,
int);
595 vtkSetSmartPointerMacro(GridPen,
vtkPen);
607 vtkSetMacro(TickLabelAlgorithm,
int);
608 vtkGetMacro(TickLabelAlgorithm,
int);
616 vtkSetMacro(ScalingFactor,
double);
617 vtkGetMacro(ScalingFactor,
double);
618 vtkSetMacro(Shift,
double);
619 vtkGetMacro(Shift,
double);
692 static double NiceMinMax(
double& min,
double&
max,
float pixelRange,
float tickPixelSpacing);
777 int order,
double min = 1.0,
double max = 9.0,
bool detailLabels =
true);
891 void operator=(
const vtkAxis&) =
delete;
896 bool InRange(
double value);
takes care of drawing 2D axes
virtual void SetUnscaledMaximumLimit(double highest)
Set the logical highest possible value for Maximum, in plot coordinates.
bool Paint(vtkContext2D *painter) override
Paint event for the axis, called whenever the axis needs to be drawn.
virtual void SetMinimum(double minimum)
Set the logical minimum value of the axis, in plot coordinates.
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.
virtual void SetUnscaledMinimumLimit(double lowest)
Set the logical lowest possible value for Minimum, in plot coordinates.
virtual void GenerateTickLabels()
Generate tick labels from the supplied double array of tick positions.
void SetPoint1(float x, float y)
Set point 1 of the axis (in pixels), this is usually the origin.
double UnscaledMaximumLimit
static double NiceNumber(double number, bool roundUp)
Return a "nice number", often defined as 1, 2 or 5.
void SetPoint2(const vtkVector2f &pos)
Set 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.
std::string RangeLabelFormat
static vtkAxis * New()
Creates a 2D Chart object.
virtual void SetNotation(int notation)
Get/set the numerical notation, standard, scientific, fixed, or a printf-style format string.
void Update() override
Update the geometry of the axis.
vtkRectf GetBoundingRect(vtkContext2D *painter)
Request the space the axes require to be drawn.
double NonLogUnscaledMinLimit
virtual vtkDoubleArray * GetTickPositions()
An array with the positions of the tick marks along the axis line.
bool UsingNiceMinMax
Hint as to whether a nice min/max was set, otherwise labels may not be present at the top/bottom of t...
virtual void SetNumberOfTicks(int numberOfTicks)
Set the number of tick marks for this axis.
virtual void SetLabelFormat(const std::string &fmt)
Get/Set the printf-style format string used when TickLabelAlgorithm is TICK_SIMPLE and Notation is PR...
virtual vtkStringArray * GetTickLabels()
A string array containing the tick labels for the axis.
virtual void GenerateLogSpacedLinearTicks(int order, double min, double max)
Generate logarithmically-spaced tick marks with linear-style labels.
bool Hit(const vtkContextMouseEvent &mouse) override
Return true if the supplied x, y coordinate is inside the item.
double CalculateNiceMinMax(double &min, double &max)
Calculate the next "nicest" numbers above and below the current minimum.
int TickLabelAlgorithm
The algorithm being used to tick label placement.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void SetTitle(const vtkStdString &title)
Get/set the title text of the axis.
double Shift
Scaling factor used on this axis, this is used to accurately render very small/large numbers accurate...
double UnscaledMinimumLimit
vtkTextProperty * LabelProperties
static double NiceMinMax(double &min, double &max, float pixelRange, float tickPixelSpacing)
Static function to calculate "nice" minimum, maximum, and tick spacing values.
virtual void SetUnscaledRange(double range[2])
Set the logical range of the axis, in plot coordinates.
void SetPoint1(const vtkVector2f &pos)
Set point 1 of the axis (in pixels), this is usually the origin.
bool Resized
Flag to indicate that the axis has been resized.
virtual void SetPosition(int position)
Get/set the position of the axis (LEFT, BOTTOM, RIGHT, TOP, PARALLEL).
virtual void GetRange(double *range)
Get the logical range of the axis, in plot coordinates.
vtkVector2f GetPosition1()
Get point 1 of the axis (in pixels), this is usually the origin.
virtual void SetMaximumLimit(double highest)
Set the logical highest possible value for Maximum, in plot coordinates.
void SetPoint2(float x, float y)
Set point 2 of the axis (in pixels), this is usually the terminus.
virtual void SetPrecision(int precision)
Get/set the numerical precision to use, default is 2.
vtkSmartPointer< vtkFloatArray > TickScenePositions
Position of tick marks in screen coordinates.
virtual void SetMinimumLimit(double lowest)
Set the logical lowest possible value for Minimum, in plot coordinates.
virtual vtkStdString GenerateSprintfLabel(double value, const std::string &format)
Generate label using a printf-style format string.
virtual void RecalculateTickSpacing()
Recalculate the spacing of the tick marks - typically useful to do after scaling the axis.
vtkSmartPointer< vtkPen > Pen
This object stores the vtkPen that controls how the axis is drawn.
virtual void SetUnscaledMinimum(double minimum)
Set the logical, unscaled minimum value of the axis, in plot coordinates.
virtual void SetRange(double range[2])
Set the logical range of the axis, in plot coordinates.
void CalculateTitlePosition(vtkVector2f &out)
Calculate the position where the title of the axis would be drawn.
Location
Enumeration of the axis locations in a conventional XY chart.
virtual vtkStdString GenerateSimpleLabel(double val)
Generate a single label using the current settings when TickLabelAlgorithm is TICK_SIMPLE.
virtual void GenerateTickLabels(double min, double max)
Calculate and assign nice labels/logical label positions.
virtual bool SetCustomTickPositions(vtkDoubleArray *positions, vtkStringArray *labels=nullptr)
Set the tick positions, and optionally custom tick labels.
virtual void GenerateLabelFormat(int notation, double n)
virtual void AutoScale()
Use this function to autoscale the axes after setting the minimum and maximum values.
virtual vtkFloatArray * GetTickScenePositions()
An array with the positions of the tick marks along the axis line.
virtual void SetUnscaledMaximum(double maximum)
Set the logical maximum value of the axis, in plot coordinates.
double ScalingFactor
Scaling factor used on this axis, this is used to accurately render very small/large numbers accurate...
vtkSmartPointer< vtkPen > GridPen
This object stores the vtkPen that controls how the grid lines are drawn.
double NonLogUnscaledMaxLimit
virtual void GetUnscaledRange(double *range)
Get the logical range of the axis, in plot coordinates.
vtkTextProperty * TitleProperties
virtual void SetRange(double minimum, double maximum)
Set the logical range of the axis, in plot coordinates.
bool CustomTickLabels
Are we using custom tick labels, or should the axis generate them?
void UpdateLogScaleActive(bool updateMinMaxFromUnscaled)
Update whether log scaling will be used for layout and rendering.
virtual vtkStdString GetTitle()
Get/set the title text of the axis.
double LogScaleTickMark(double number, bool roundUp, bool &niceValue, int &order)
Return a tick mark for a logarithmic axis.
bool TickMarksDirty
Mark the tick labels as dirty when the min/max value is changed.
vtkSmartPointer< vtkStringArray > TickLabels
The labels for the tick marks.
virtual void SetUnscaledRange(double minimum, double maximum)
Set the logical range of the axis, in plot coordinates.
virtual void SetMaximum(double maximum)
Set the logical maximum value of the axis, in plot coordinates.
virtual void SetLogScale(bool logScale)
Get/set whether the axis should attempt to use a log scale.
vtkTimeStamp BuildTime
The point cache is marked dirty until it has been initialized.
vtkSmartPointer< vtkDoubleArray > TickPositions
Position of tick marks in screen coordinates.
Class for drawing 2D primitives to a graphical context.
base class for items that are part of a vtkContextScene.
data structure to represent mouse events.
dynamic, self-adjusting array of double
dynamic, self-adjusting array of float
a simple class to control print indentation
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Hold a reference to a vtkObjectBase instance.
Wrapper around std::string to keep symbols short.
a vtkAbstractArray subclass for strings
represent text properties.
record modification and/or execution time