67 #ifndef vtkAxisActor2D_h
68 #define vtkAxisActor2D_h
71 #include "vtkRenderingAnnotationModule.h"
76 VTK_ABI_NAMESPACE_BEGIN
126 vtkGetVectorMacro(
Range,
double, 2);
149 vtkGetMacro(RulerDistance,
double);
163 vtkSetClampMacro(NumberOfLabels,
int, 2, VTK_MAX_LABELS);
164 vtkGetMacro(NumberOfLabels,
int);
173 vtkGetMacro(Precision,
int);
184 vtkSetClampMacro(Notation,
int, 0, 2);
185 vtkGetMacro(Notation,
int);
193 vtkSetStringMacro(LabelFormat);
194 vtkGetStringMacro(LabelFormat);
213 vtkSetMacro(SnapLabelsToGrid,
bool);
214 vtkGetMacro(SnapLabelsToGrid,
bool);
215 vtkBooleanMacro(SnapLabelsToGrid,
bool);
246 this->UpdateAdjustedRange();
247 return this->AdjustedRange;
251 this->UpdateAdjustedRange();
252 _arg1 = this->AdjustedRange[0];
253 _arg2 = this->AdjustedRange[1];
263 this->UpdateAdjustedRange();
264 return this->AdjustedNumberOfLabels;
276 vtkSetStringMacro(Title);
277 vtkGetStringMacro(Title);
301 vtkSetClampMacro(TickLength,
int, 0, 100);
302 vtkGetMacro(TickLength,
int);
310 vtkSetClampMacro(NumberOfMinorTicks,
int, 0, 20);
311 vtkGetMacro(NumberOfMinorTicks,
int);
319 vtkSetClampMacro(MinorTickLength,
int, 0, 100);
320 vtkGetMacro(MinorTickLength,
int);
329 vtkSetClampMacro(TickOffset,
int, 0, 100);
330 vtkGetMacro(TickOffset,
int);
374 vtkSetMacro(TitlePosition,
double);
375 vtkGetMacro(TitlePosition,
double);
384 vtkSetClampMacro(FontFactor,
double, 0.1, 2.0);
385 vtkGetMacro(FontFactor,
double);
393 vtkSetClampMacro(LabelFactor,
double, 0.1, 2.0);
394 vtkGetMacro(LabelFactor,
double);
440 double inRange[2],
double outRange[2],
int inNumTicks,
int& outNumTicks,
double& interval);
451 int nbOfMappers,
int* targetSize,
double factor,
int* stringSize);
489 double TitlePosition = 0.5;
491 double RulerDistance = 1.;
492 int NumberOfLabels = 5;
494 double FontFactor = 1.;
495 double LabelFactor = 0.75;
497 int MinorTickLength = 3;
499 int NumberOfMinorTicks = 0;
501 double AdjustedRange[2];
502 int AdjustedNumberOfLabels = 5;
503 int NumberOfLabelsBuilt = 0;
514 int LastPosition[2] = { 0, 0 };
515 int LastPosition2[2] = { 0, 0 };
517 int LastSize[2] = { 0, 0 };
518 int LastMaxLabelSize[2] = { 0, 0 };
520 int SizeFontRelativeToAxis = 0;
549 bool PositionsChangedOrViewportResized(
vtkViewport* viewport);
563 void UpdateTicksValueAndPosition(
vtkViewport* viewport);
588 void UpdateCachedInformations(
vtkViewport* viewport);
593 double GetViewportRulerDistance(
vtkViewport* viewport);
598 double GetViewportAxisLength(
vtkViewport* viewport);
601 std::vector<double> NormalizedTickPositions;
602 std::vector<double> TickValues;
604 bool SnapLabelsToGrid =
false;
607 VTK_ABI_NAMESPACE_END
a actor that draws 2D data
virtual vtkCoordinate * GetPositionCoordinate()
Get the PositionCoordinate instance of vtkCoordinate.
virtual void SetPosition2(float x[2])
Access the Position2 instance variable.
virtual vtkCoordinate * GetPosition2Coordinate()
Access the Position2 instance variable.
virtual float * GetPosition2()
Access the Position2 instance variable.
virtual void SetPosition(float x[2])
Get the PositionCoordinate instance of vtkCoordinate.
virtual float * GetPosition()
Get the PositionCoordinate instance of vtkCoordinate.
Create an axis with tick marks and labels.
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
Draw the axis.
virtual void SetPoint1(double x[2])
Specify the position of the first point defining the axis.
vtkNew< vtkPoints > TicksStartPos
vtkTextMapper * TitleMapper
vtkNew< vtkPolyDataMapper2D > AxisMapper
vtkTypeBool HasTranslucentPolygonalGeometry() override
Does this prop have some translucent polygonal geometry?
virtual void SetTitleTextProperty(vtkTextProperty *p)
Set/Get the title text property.
virtual double * GetPoint2()
Specify the position of the second point defining the axis.
vtkActor2D ** LabelActors
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkNew< vtkActor2D > AxisActor
vtkNew< vtkPolyData > Axis
static void SetOffsetPosition(double xTick[3], double theta, int stringWidth, int stringHeight, int offset, vtkActor2D *actor)
virtual void BuildAxis(vtkViewport *viewport)
static int SetMultipleFontSize(vtkViewport *viewport, vtkTextMapper **textMappers, int nbOfMappers, int *targetSize, double factor, int *stringSize)
General method to computes font size from a representative size on the viewport (given by size[2]).
vtkTextProperty * TitleTextProperty
virtual void SetPoint1(double x, double y)
Specify the position of the first point defining the axis.
int UpdateGeometryAndRenderOpaqueGeometry(vtkViewport *viewport, bool render)
Rebuild the geometry using the provided viewport, and trigger opaque geometry render only if render p...
static vtkAxisActor2D * New()
Instantiate object.
static void ComputeRange(double inRange[2], double outRange[2], int inNumTicks, int &outNumTicks, double &interval)
This method computes the range of the axis given an input range.
virtual vtkCoordinate * GetPoint1Coordinate()
Specify the position of the first point defining the axis.
virtual double * GetPoint1()
Specify the position of the first point defining the axis.
int RenderOpaqueGeometry(vtkViewport *viewport) override
Draw the axis.
vtkPoints * GetTickPositions()
Return the positions of ticks along the axis.
vtkTimeStamp AdjustedRangeBuildTime
virtual void GetAdjustedRange(double _arg[2])
Get the axis range adjusted for nice tick values.
virtual double * GetAdjustedRange()
Get the axis range adjusted for nice tick values.
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
vtkTextMapper ** LabelMappers
static double ComputeStringOffset(double width, double height, double theta)
int RenderOverlay(vtkViewport *viewport) override
Draw the axis.
void ShallowCopy(vtkProp *prop) override
Shallow copy of an axis actor.
virtual void SetPoint2(double x[2])
Specify the position of the second point defining the axis.
virtual void SetLabelTextProperty(vtkTextProperty *p)
Set/Get the labels text property.
virtual vtkCoordinate * GetPoint2Coordinate()
Specify the position of the second point defining the axis.
vtkTextProperty * LabelTextProperty
virtual int GetAdjustedNumberOfLabels()
Get the number of labels.
virtual void GetAdjustedRange(double &_arg1, double &_arg2)
Get the axis range adjusted for nice tick values.
~vtkAxisActor2D() override
virtual void SetPoint2(double x, double y)
Specify the position of the second point defining the axis.
virtual void UpdateAdjustedRange()
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
a simple class to control print indentation
represent and manipulate 3D points
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
abstract superclass for all actors, volumes and annotations
represent text properties.
record modification and/or execution time
abstract specification for Viewports
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.