154#include "vtkChartsCoreModule.h"
164VTK_ABI_NAMESPACE_BEGIN
193 TICK_WILKINSON_EXTENDED
206 vtkGetMacro(Position,
int);
221 vtkGetVector2Macro(Point1,
float);
237 vtkGetVector2Macro(Point2,
float);
251 vtkGetMacro(NumberOfTicks,
int);
258 vtkSetMacro(TickLength,
float);
259 vtkGetMacro(TickLength,
float);
283 vtkGetMacro(Minimum,
double);
299 vtkGetMacro(Maximum,
double);
313 vtkGetMacro(UnscaledMinimum,
double);
325 vtkGetMacro(UnscaledMaximum,
double);
338 virtual void SetRange(
double minimum,
double maximum);
365 vtkGetMacro(MinimumLimit,
double);
377 vtkGetMacro(MaximumLimit,
double);
389 vtkGetMacro(UnscaledMinimumLimit,
double);
401 vtkGetMacro(UnscaledMaximumLimit,
double);
408 vtkGetVector2Macro(Margins,
int);
415 vtkSetVector2Macro(Margins,
int);
446 vtkGetMacro(LogScaleActive,
bool);
456 vtkGetMacro(LogScale,
bool);
458 vtkBooleanMacro(LogScale,
bool);
465 vtkSetMacro(GridVisible,
bool);
466 vtkGetMacro(GridVisible,
bool);
473 vtkSetMacro(LabelsVisible,
bool);
474 vtkGetMacro(LabelsVisible,
bool);
481 vtkSetMacro(RangeLabelsVisible,
bool);
482 vtkGetMacro(RangeLabelsVisible,
bool);
489 vtkSetMacro(LabelOffset,
float);
490 vtkGetMacro(LabelOffset,
float);
497 vtkSetMacro(TicksVisible,
bool);
498 vtkGetMacro(TicksVisible,
bool);
505 vtkSetMacro(AxisVisible,
bool);
506 vtkGetMacro(AxisVisible,
bool);
513 vtkSetMacro(TitleVisible,
bool);
514 vtkGetMacro(TitleVisible,
bool);
523 vtkGetMacro(Precision,
int);
531 STANDARD_NOTATION = 0,
544 vtkGetMacro(LabelFormat, std::string);
553 vtkSetMacro(RangeLabelFormat, std::string);
554 vtkGetMacro(RangeLabelFormat, std::string);
564 vtkGetMacro(Notation,
int);
581 vtkSetMacro(Behavior,
int);
582 vtkGetMacro(Behavior,
int);
597 vtkSetSmartPointerMacro(GridPen,
vtkPen);
609 vtkSetMacro(TickLabelAlgorithm,
int);
610 vtkGetMacro(TickLabelAlgorithm,
int);
618 vtkSetMacro(ScalingFactor,
double);
619 vtkGetMacro(ScalingFactor,
double);
620 vtkSetMacro(Shift,
double);
621 vtkGetMacro(Shift,
double);
694 static double NiceMinMax(
double& min,
double&
max,
float pixelRange,
float tickPixelSpacing);
748 double CalculateNiceMinMax(
double& min,
double&
max);
759 double LogScaleTickMark(
double number,
bool roundUp,
bool& niceValue,
int& order);
772 virtual
void GenerateLogSpacedLinearTicks(
int order,
double min,
double max);
784 void GenerateLogScaleTickMarks(
785 int order,
double min = 1.0,
double max = 9.0,
bool detailLabels = true);
804 double UnscaledMinimum;
805 double UnscaledMaximum;
806 double UnscaledMinimumLimit;
807 double UnscaledMaximumLimit;
808 double NonLogUnscaledMinLimit;
809 double NonLogUnscaledMaxLimit;
817 bool RangeLabelsVisible;
825 std::
string RangeLabelFormat;
837 double ScalingFactor;
844 bool CustomTickLabels;
875 bool UsingNiceMinMax;
890 int TickLabelAlgorithm;
899 void operator=(const
vtkAxis&) = delete;
904 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 vtkStdString GenerateStdFormatLabel(double value, const std::string &format)
Generate label using a std::format style format string.
virtual void SetMinimum(double minimum)
Set the logical minimum value of the axis, in plot coordinates.
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.
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.
static vtkAxis * New()
Creates a 2D Chart object.
virtual void SetNotation(int notation)
Get/set the numerical notation, standard, scientific, fixed, or a std::format/printf style format str...
void Update() override
Update the geometry of the axis.
vtkRectf GetBoundingRect(vtkContext2D *painter)
Request the space the axes require to be drawn.
virtual vtkDoubleArray * GetTickPositions()
An array with the positions of the tick marks along the axis line.
virtual void SetNumberOfTicks(int numberOfTicks)
Set the number of tick marks for this axis.
virtual vtkStringArray * GetTickLabels()
A string array containing the tick labels for the axis.
bool Hit(const vtkContextMouseEvent &mouse) override
Return true if the supplied x, y coordinate is inside the item.
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.
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.
Notations
Enumeration of the axis notations available.
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 SetLabelFormat(const std::string &format)
Get/Set the std::format/printf style format style string used when TickLabelAlgorithm is TICK_SIMPLE ...
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.
virtual void SetMinimumLimit(double lowest)
Set the logical lowest possible value for Minimum, in plot coordinates.
virtual void RecalculateTickSpacing()
Recalculate the spacing of the tick marks - typically useful to do after scaling the axis.
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.
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.
virtual void GetUnscaledRange(double *range)
Get the logical range of the axis, in plot coordinates.
virtual void SetRange(double minimum, double maximum)
Set the logical range of the axis, in plot coordinates.
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.
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.
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
#define VTK_DEPRECATED_IN_9_6_0(reason)