Thanks to visit codestin.com
Credit goes to vtk.org

VTK  9.5.20250921
vtkTextActor.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
138#ifndef vtkTextActor_h
139#define vtkTextActor_h
140
141#include "vtkRenderingCoreModule.h" // For export macro
142#include "vtkTexturedActor2D.h"
143#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
144
145#include "vtkDeprecation.h" // For deprecation macro
146
147VTK_ABI_NAMESPACE_BEGIN
148class vtkImageData;
149class vtkPoints;
150class vtkPolyData;
152class vtkProperty2D;
153class vtkTextProperty;
154class vtkTextRenderer;
155class vtkTransform;
156
157class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkTextActor : public vtkTexturedActor2D
158{
159public:
161 void PrintSelf(ostream& os, vtkIndent indent) override;
162
167 static vtkTextActor* New();
168
173 void ShallowCopy(vtkProp* prop) override;
174
176
182 void SetInput(const char* inputString);
183 char* GetInput();
185
187
192 vtkSetVector2Macro(MinimumSize, int);
193 vtkGetVector2Macro(MinimumSize, int);
195
197
203 vtkSetMacro(MaximumLineHeight, float);
204 vtkGetMacro(MaximumLineHeight, float);
206
208
217 vtkSetClampMacro(TextScaleMode, int, TEXT_SCALE_MODE_NONE, TEXT_SCALE_MODE_VIEWPORT);
218 vtkGetMacro(TextScaleMode, int);
219 void SetTextScaleModeToNone() { this->SetTextScaleMode(TEXT_SCALE_MODE_NONE); }
220 void SetTextScaleModeToProp() { this->SetTextScaleMode(TEXT_SCALE_MODE_PROP); }
221 void SetTextScaleModeToViewport() { this->SetTextScaleMode(TEXT_SCALE_MODE_VIEWPORT); }
223
224 enum
225 {
226 TEXT_SCALE_MODE_NONE = 0,
228 TEXT_SCALE_MODE_VIEWPORT
229 };
230
232
237 vtkSetMacro(UseBorderAlign, vtkTypeBool);
238 vtkGetMacro(UseBorderAlign, vtkTypeBool);
239 vtkBooleanMacro(UseBorderAlign, vtkTypeBool);
241
243
259 VTK_DEPRECATED_IN_9_6_0("Please use vtkTextProperty Justification instead.")
260 void SetAlignmentPoint(int point);
262 VTK_DEPRECATED_IN_9_6_0("Please use vtkTextProperty Justification instead.")
263 int GetAlignmentPoint();
265
267
274 void SetOrientation(float orientation);
275 vtkGetMacro(Orientation, float);
277
279
282 virtual void SetTextProperty(vtkTextProperty* p);
283 vtkGetObjectMacro(TextProperty, vtkTextProperty);
285
291 virtual void GetBoundingBox(vtkViewport* vport, double bbox[4]);
292
296 virtual void GetSize(vtkViewport* vport, double size[2]);
297
299
304 virtual int SetConstrainedFontSize(vtkViewport*, int targetWidth, int targetHeight);
305 static int SetConstrainedFontSize(vtkTextActor*, vtkViewport*, int targetWidth, int targetHeight);
307
314 static int SetMultipleConstrainedFontSize(vtkViewport*, int targetWidth, int targetHeight,
315 vtkTextActor** actors, int nbOfActors, int* maxResultingSize);
316
326 virtual void SetNonLinearFontScale(double exponent, int target);
327
329
332 vtkGetMacro(FontScaleExponent, double);
333 vtkSetMacro(FontScaleExponent, double);
335
340 void SpecifiedToDisplay(double* pos, vtkViewport* vport, int specified);
341
346 void DisplayToSpecified(double* pos, vtkViewport* vport, int specified);
347
352 virtual void ComputeScaledFont(vtkViewport* viewport);
353
355
359 vtkGetObjectMacro(ScaledTextProperty, vtkTextProperty);
361
369 static float GetFontScale(vtkViewport* viewport);
370
378 void ReleaseGraphicsResources(vtkWindow*) override;
379
381
386 int RenderOpaqueGeometry(vtkViewport* viewport) override;
387 int RenderTranslucentPolygonalGeometry(vtkViewport*) override { return 0; }
388 int RenderOverlay(vtkViewport* viewport) override;
390
395
396protected:
400 virtual bool RenderImage(vtkTextProperty* tprop, vtkViewport* viewport);
401
405 virtual bool GetImageBoundingBox(vtkTextProperty* tprop, vtkViewport* viewport, int bbox[4]);
406
408 ~vtkTextActor() override;
409
410 int MinimumSize[2];
416
422 int LastSize[2];
423 int LastOrigin[2];
424 char* Input;
428
430
431 // Stuff needed to display the image text as a texture map.
434
435 virtual void ComputeRectangle(vtkViewport* viewport);
436
450 virtual int UpdateRectangle(vtkViewport* viewport);
451
452private:
453 vtkTextActor(const vtkTextActor&) = delete;
454 void operator=(const vtkTextActor&) = delete;
455};
456
457VTK_ABI_NAMESPACE_END
458#endif
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:108
represent and manipulate 3D points
Definition vtkPoints.h:139
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:69
represent surface properties of a 2D image
An actor that displays text.
vtkTextProperty * TextProperty
vtkTypeBool HasTranslucentPolygonalGeometry() override
Does this prop have some translucent polygonal geometry?
static vtkTextActor * New()
Instantiate object with a rectangle in normaled view coordinates of (0.2,0.85, 0.8,...
double FormerOrientation
float MaximumLineHeight
void ShallowCopy(vtkProp *prop) override
Shallow copy of this text actor.
int RenderOverlay(vtkViewport *viewport) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
virtual bool RenderImage(vtkTextProperty *tprop, vtkViewport *viewport)
Render Input to Image using the supplied font property.
vtkTransform * Transform
vtkTextProperty * ScaledTextProperty
char * GetInput()
Set the text string to be displayed.
void SetInput(const char *inputString)
Set the text string to be displayed.
virtual int UpdateRectangle(vtkViewport *viewport)
Ensure that Rectangle and RectanglePoints are valid and up-to-date.
virtual bool GetImageBoundingBox(vtkTextProperty *tprop, vtkViewport *viewport, int bbox[4])
Get the bounding box for Input using the supplied font property.
~vtkTextActor() override
vtkImageData * ImageData
vtkTextRenderer * TextRenderer
vtkPolyData * Rectangle
vtkTimeStamp BuildTime
virtual void ComputeRectangle(vtkViewport *viewport)
double FontScaleExponent
void SetTextScaleModeToProp()
Set how text should be scaled.
void SetTextScaleModeToViewport()
Set how text should be scaled.
vtkPoints * RectanglePoints
vtkTypeBool UseBorderAlign
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetTextScaleModeToNone()
Set how text should be scaled.
represent text properties.
Interface for generating images and path data from string data, using multiple backends.
actor that draws 2D data with texture support
record modification and/or execution time
describes linear transformations via a 4x4 matrix
abstract specification for Viewports
Definition vtkViewport.h:66
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
int vtkTypeBool
Definition vtkABI.h:64
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
#define VTK_DEPRECATED_IN_9_6_0(reason)
#define VTK_MARSHAL_EXCLUDE_REASON_IS_REDUNDANT
#define VTK_MARSHALAUTO
#define VTK_MARSHALEXCLUDE(reason)