VTK  9.4.20250126
vtkCaptionRepresentation.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
46#ifndef vtkCaptionRepresentation_h
47#define vtkCaptionRepresentation_h
48
50#include "vtkInteractionWidgetsModule.h" // For export macro
51#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
52
53VTK_ABI_NAMESPACE_BEGIN
54class vtkRenderer;
56class vtkConeSource;
58
59class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkCaptionRepresentation
61{
62public:
67
69
73 void PrintSelf(ostream& os, vtkIndent indent) override;
75
77
81 void SetAnchorPosition(double pos[3]);
82 void GetAnchorPosition(double pos[3]);
84
86
91 vtkGetObjectMacro(CaptionActor2D, vtkCaptionActor2D);
93
95
101 vtkGetObjectMacro(AnchorRepresentation, vtkPointHandleRepresentation3D);
103
107 void BuildRepresentation() override;
108 void GetSize(double size[2]) override
109 {
110 size[0] = 2.0;
111 size[1] = 2.0;
112 }
113
115
126
128
133 vtkSetClampMacro(FontFactor, double, 0.1, 10.0);
134 vtkGetMacro(FontFactor, double);
136
149 {
150 VTK_FIT_TO_BORDER = 0,
151 VTK_FIT_TO_TEXT
152 };
153 vtkSetClampMacro(Fit, int, VTK_FIT_TO_BORDER, VTK_FIT_TO_TEXT);
154 vtkGetMacro(Fit, int);
155 void SetFitToBorder() { this->SetFit(VTK_FIT_TO_BORDER); }
156 void SetFitToText() { this->SetFit(VTK_FIT_TO_TEXT); }
157 const char* GetFitAsString();
158
159protected:
162
163 // the text to manage
166
168 int DisplayAttachmentPoint[2];
170 int Fit;
171
172 // Internal representation for the anchor
174
175 // Check and adjust boundaries according to the size of the caption text
176 virtual void AdjustCaptionBoundary();
177
178private:
180 void operator=(const vtkCaptionRepresentation&) = delete;
181};
182
183VTK_ABI_NAMESPACE_END
184#endif
represent a vtkBorderWidget
draw text label associated with a point
represents vtkCaptionWidget in the scene
int RenderOpaqueGeometry(vtkViewport *) override
These methods are necessary to make this representation behave as a vtkProp.
static vtkCaptionRepresentation * New()
Instantiate this class.
vtkTypeBool HasTranslucentPolygonalGeometry() override
These methods are necessary to make this representation behave as a vtkProp.
void SetAnchorRepresentation(vtkPointHandleRepresentation3D *)
Set and get the instances of vtkPointHandleRepresentation3D used to implement this representation.
void GetActors2D(vtkPropCollection *) override
These methods are necessary to make this representation behave as a vtkProp.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK class methods.
virtual void AdjustCaptionBoundary()
FitType
Control the relationship between the size of the text and the border.
vtkPointHandleRepresentation3D * AnchorRepresentation
void ReleaseGraphicsResources(vtkWindow *) override
These methods are necessary to make this representation behave as a vtkProp.
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
These methods are necessary to make this representation behave as a vtkProp.
void BuildRepresentation() override
Satisfy the superclasses API.
int RenderOverlay(vtkViewport *) override
These methods are necessary to make this representation behave as a vtkProp.
void GetAnchorPosition(double pos[3])
Specify the position of the anchor (i.e., the point that the caption is anchored to).
const char * GetFitAsString()
~vtkCaptionRepresentation() override
void SetAnchorPosition(double pos[3])
Specify the position of the anchor (i.e., the point that the caption is anchored to).
void GetSize(double size[2]) override
Subclasses should implement these methods.
void SetCaptionActor2D(vtkCaptionActor2D *captionActor)
Specify the vtkCaptionActor2D to manage.
generate polygonal cone
a simple class to control print indentation
Definition vtkIndent.h:108
represent the position of a point in 3D space
an ordered list of Props
abstract specification for renderers
abstract specification for Viewports
Definition vtkViewport.h:65
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_MARSHALAUTO