67 #ifndef vtkAxisActor2D_h
68 #define vtkAxisActor2D_h
71 #include "vtkRenderingAnnotationModule.h"
77 VTK_ABI_NAMESPACE_BEGIN
126 vtkSetVector2Macro(
Range,
double);
127 vtkGetVectorMacro(
Range,
double, 2);
150 vtkGetMacro(RulerDistance,
double);
156 "VTK_MAX_LABELS has been removed. Labels are now dynamically allocated. Do not use.") = 25
165 vtkSetMacro(NumberOfLabels,
int);
166 vtkGetMacro(NumberOfLabels,
int);
175 vtkGetMacro(Precision,
int);
186 vtkSetClampMacro(Notation,
int, 0, 2);
187 vtkGetMacro(Notation,
int);
195 vtkSetStringMacro(LabelFormat);
196 vtkGetStringMacro(LabelFormat);
215 vtkSetMacro(SnapLabelsToGrid,
bool);
216 vtkGetMacro(SnapLabelsToGrid,
bool);
217 vtkBooleanMacro(SnapLabelsToGrid,
bool);
247 vtkSetMacro(SkipFirstTick,
bool);
248 vtkGetMacro(SkipFirstTick,
bool);
249 vtkBooleanMacro(SkipFirstTick,
bool);
259 this->UpdateAdjustedRange();
260 return this->AdjustedRange;
264 this->UpdateAdjustedRange();
265 _arg1 = this->AdjustedRange[0];
266 _arg2 = this->AdjustedRange[1];
276 this->UpdateAdjustedRange();
277 return this->AdjustedNumberOfLabels;
289 vtkSetStringMacro(Title);
290 vtkGetStringMacro(Title);
314 vtkSetClampMacro(TickLength,
int, 0, 100);
315 vtkGetMacro(TickLength,
int);
323 vtkSetClampMacro(NumberOfMinorTicks,
int, 0, 20);
324 vtkGetMacro(NumberOfMinorTicks,
int);
332 vtkSetClampMacro(MinorTickLength,
int, 0, 100);
333 vtkGetMacro(MinorTickLength,
int);
342 vtkSetClampMacro(TickOffset,
int, 0, 100);
343 vtkGetMacro(TickOffset,
int);
387 vtkSetMacro(TitlePosition,
double);
388 vtkGetMacro(TitlePosition,
double);
397 vtkSetClampMacro(FontFactor,
double, 0.1, 2.0);
398 vtkGetMacro(FontFactor,
double);
406 vtkSetClampMacro(LabelFactor,
double, 0.1, 2.0);
407 vtkGetMacro(LabelFactor,
double);
415 return this->LabelMappers;
421 virtual std::vector<vtkSmartPointer<vtkActor2D>>
GetLabelActors() {
return this->LabelActors; }
429 int UpdateGeometryAndRenderOpaqueGeometry(
vtkViewport* viewport,
bool render);
465 static void ComputeRange(
466 double inRange[2],
double outRange[2],
int inNumTicks,
int& outNumTicks,
double& interval);
477 int nbOfMappers,
int* targetSize,
double factor,
int* stringSize);
486 vtkBooleanMacro(SizeFontRelativeToAxis,
vtkTypeBool);
497 vtkBooleanMacro(UseFontSizeFromProperty,
vtkTypeBool);
512 double TitlePosition = 0.5;
514 double RulerDistance = 1.;
515 int NumberOfLabels = 5;
517 double FontFactor = 1.;
518 double LabelFactor = 0.75;
520 int MinorTickLength = 3;
522 int NumberOfMinorTicks = 0;
524 double AdjustedRange[2];
525 int AdjustedNumberOfLabels = 5;
526 int NumberOfLabelsBuilt = 0;
537 int LastPosition[2] = { 0, 0 };
538 int LastPosition2[2] = { 0, 0 };
540 int LastSize[2] = { 0, 0 };
541 int LastMaxLabelSize[2] = { 0, 0 };
543 int SizeFontRelativeToAxis = 0;
547 static double ComputeStringOffset(
double width,
double height,
double theta);
552 static void SetOffsetPosition(
double xTick[3],
double theta,
int stringWidth,
int stringHeight,
562 void ShiftPosition(
double start[3],
double textAngle,
int stringWidth,
int stringHeight,
563 int offset,
int finalPos[2]);
565 virtual void UpdateAdjustedRange();
584 bool PositionsChangedOrViewportResized(
vtkViewport* viewport);
598 void UpdateTicksValueAndPosition(
vtkViewport* viewport);
623 void UpdateCachedInformations(
vtkViewport* viewport);
628 double GetViewportRulerDistance(
vtkViewport* viewport);
633 double GetViewportAxisLength(
vtkViewport* viewport);
639 void SetTitleFontSize(
vtkViewport* viewport,
int box[2]);
642 std::vector<double> NormalizedTickPositions;
643 std::vector<double> TickValues;
645 bool SnapLabelsToGrid =
false;
647 bool SkipFirstTick =
false;
649 std::vector<vtkSmartPointer<vtkTextMapper>> LabelMappers;
650 std::vector<vtkSmartPointer<vtkActor2D>> LabelActors;
656 VTK_ABI_NAMESPACE_END
abstract superclass for all actors, volumes and annotations
virtual void GetAdjustedRange(double _arg[2])
Get the axis range adjusted for nice tick values.
virtual void SetPosition(float x[2])
Get the PositionCoordinate instance of vtkCoordinate.
int RenderOverlay(vtkViewport *viewport) override
Support the standard render methods.
abstract specification for Viewports
vtkNew< vtkPoints > TicksStartPos
virtual double * GetPoint1()
Specify the position of the first point defining the axis.
a actor that draws 2D data
record modification and/or execution time
virtual vtkCoordinate * GetPositionCoordinate()
Get the PositionCoordinate instance of vtkCoordinate.
Create an axis with tick marks and labels.
virtual void SetPoint1(double x, double y)
Specify the position of the first point defining the axis.
concrete dataset represents vertices, lines, polygons, and triangle strips
void ShallowCopy(vtkProp *prop) override
Shallow copy of this vtkActor2D.
virtual void SetPoint2(double x, double y)
Specify the position of the second point defining the axis.
virtual float * GetPosition2()
Access the Position2 instance variable.
virtual vtkCoordinate * GetPoint2Coordinate()
Specify the position of the second point defining the axis.
virtual void GetAdjustedRange(double &_arg1, double &_arg2)
Get the axis range adjusted for nice tick values.
virtual vtkCoordinate * GetPoint1Coordinate()
Specify the position of the first point defining the axis.
window superclass for vtkRenderWindow
auto Range(IterablePtr iterable, Options &&...opts) -> typename detail::IterableTraits< typename detail::StripPointers< IterablePtr >::type >::RangeType
Generate an iterable STL proxy object for a VTK container.
virtual double * GetAdjustedRange()
Get the axis range adjusted for nice tick values.
vtkTimeStamp AdjustedRangeBuildTime
#define VTK_DEPRECATED_IN_9_6_0(reason)
virtual double * GetPoint2()
Specify the position of the second point defining the axis.
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
vtkNew< vtkActor2D > AxisActor
a simple class to control print indentation
vtkTextMapper * TitleMapper
static vtkActor2D * New()
Creates an actor2D with the following defaults: position (0,0) (coordinate system is viewport); at la...
virtual void SetPosition2(float x[2])
Access the Position2 instance variable.
virtual float * GetPosition()
Get the PositionCoordinate instance of vtkCoordinate.
virtual void SetPoint2(double x[2])
Specify the position of the second point defining the axis.
virtual vtkCoordinate * GetPosition2Coordinate()
Access the Position2 instance variable.
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
Draw the axis.
represent text properties.
virtual std::vector< vtkSmartPointer< vtkActor2D > > GetLabelActors()
Get the label actors.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
virtual void SetPoint1(double x[2])
Specify the position of the first point defining the axis.
vtkTypeBool HasTranslucentPolygonalGeometry() override
Does this prop have some translucent polygonal geometry?
vtkNew< vtkPolyData > Axis
vtkNew< vtkPolyDataMapper2D > AxisMapper
int RenderOpaqueGeometry(vtkViewport *viewport) override
Support the standard render methods.
virtual int GetAdjustedNumberOfLabels()
Get the number of labels.
virtual std::vector< vtkSmartPointer< vtkTextMapper > > GetLabelMappers()
Get the label mappers.
draw vtkPolyData onto the image plane
represent and manipulate 3D points
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.