VTK  9.7.1
vtkTextActorInterfaceInternal.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 #ifndef vtkTextActorInterfaceInternal_h
4 #define vtkTextActorInterfaceInternal_h
5 
6 #include "vtkNew.h"
7 #include "vtkSmartPointer.h"
8 
9 #include <memory>
10 #include <string>
11 
12 VTK_ABI_NAMESPACE_BEGIN
13 
14 class vtkAxisActor;
15 class vtkAxisFollower;
16 class vtkCamera;
18 class vtkPolyDataMapper;
19 class vtkProp;
21 class vtkPropCollection;
22 class vtkProperty;
23 class vtkTextActor3D;
24 class vtkTextActor;
25 class vtkTextProperty;
26 class vtkVectorText;
27 
36 {
37 public:
40 
44  void SetInputText(const std::string& text);
46 
50  void SetCamera(vtkCamera* camera);
51 
55  void SetAxis(vtkAxisActor* axis);
56 
63  vtkProp* GetActiveProp(bool overlay, bool vector);
64 
68  void SetTextProperty(vtkTextProperty* textProp, vtkProperty* prop);
69 
73  void GetActors(vtkPropCollection* collection);
74 
79  void SetScale(double s);
80 
86  void AdjustScale();
87 
91  void GetBounds(double bounds[6]);
92 
96  void SetPosition(double pos[3]);
97 
101  void GetReferencePosition(double pos[3]);
102 
106  void SetDisplayPosition(double x, double y);
107 
112  void RotateActor2DFromAxisProjection(double p1[3], double p2[3]);
113 
115 
118  void SetScreenOffset(double offset);
119  void SetScreenOffsetVector(double offset[2]);
121 
126  // VTK_DEPRECATED_IN_9_6_0
128 
133  // VTK_DEPRECATED_IN_9_6_0
134  vtkAxisFollower* GetFollower() const;
135 
136 private:
137  void operator=(const vtkTextActorInterfaceInternal&) = delete;
139 
140  vtkNew<vtkVectorText> Vector;
141 
142  vtkNew<vtkTextActor> Raster2D;
143  vtkNew<vtkTextActor3D> Raster3D;
144  vtkNew<vtkProp3DAxisFollower> RasterFollower;
145  vtkNew<vtkAxisFollower> VectorFollower;
146 
148  std::unique_ptr<vtkFollowerTextPropertyAdaptor> FollowerAdaptor;
149 };
150 
151 VTK_ABI_NAMESPACE_END
152 #endif
vtkProp * GetActiveProp(bool overlay, bool vector)
Get the vtkProp to be used in the given mode: if overlay is true, return the vtkTextActor (rasterized...
void GetReferencePosition(double pos[3])
Get the reference position in 3D space.
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:49
void GetActors(vtkPropCollection *collection)
Fill the collection with all vtkProp members.
vtkAxisFollower * GetFollower() const
Return the internal follower.
void SetAxis(vtkAxisActor *axis)
Set the axis to follow.
void SetInputText(const std::string &text)
Set the text to be displayed.
void SetDisplayPosition(double x, double y)
Update internal screen space actors position.
represent surface properties of a geometric object
Definition: vtkProperty.h:59
void SetCamera(vtkCamera *camera)
Set the current camera.
void RotateActor2DFromAxisProjection(double p1[3], double p2[3])
Set orientation of the actor 2D to keep the axis orientation.
Create an axis with tick marks and labels.
Definition: vtkAxisActor.h:71
VTK Internal interface to manipulate text actors from vtkAxisActor.
vtkProp3DAxisFollower * GetFollower3D() const
Return the internal follower 3D.
void SetScreenOffsetVector(double offset[2])
Set Screen offset on axis followers.
an ordered list of Props
An actor that displays text.
Definition: vtkTextActor.h:48
void SetScreenOffset(double offset)
Set Screen offset on axis followers.
a virtual camera for 3D rendering
Definition: vtkCamera.h:41
void SetPosition(double pos[3])
Update internal 3D actors position.
An actor that displays text.
represent text properties.
a subclass of vtkFollower that ensures that data is always parallel to the axis defined by a vtkAxisA...
void GetBounds(double bounds[6])
Get the bounds of the text.
map vtkPolyData to graphics primitives
void AdjustScale()
Adjust the scale of Actor3D, based on Follower mapper bounds, so switching them provide consistent si...
a subclass of vtkProp3DFollower that ensures that data is always parallel to the axis defined by a vt...
void SetTextProperty(vtkTextProperty *textProp, vtkProperty *prop)
Update the actors from the given text property.
vtkFollowerTextPropertyAdaptor is a helper class to mimic vtkTextProperty behavior for a vtkAxisFollo...
void SetScale(double s)
Set scale on the Follower and Follower3D.
create polygonal text
Definition: vtkVectorText.h:36