VTK  9.3.20240304
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 
52 VTK_ABI_NAMESPACE_BEGIN
53 class vtkRenderer;
54 class vtkCaptionActor2D;
55 class vtkConeSource;
57 
58 class VTKINTERACTIONWIDGETS_EXPORT vtkCaptionRepresentation : public vtkBorderRepresentation
59 {
60 public:
65 
67 
71  void PrintSelf(ostream& os, vtkIndent indent) override;
73 
75 
79  void SetAnchorPosition(double pos[3]);
80  void GetAnchorPosition(double pos[3]);
82 
84 
88  void SetCaptionActor2D(vtkCaptionActor2D* captionActor);
89  vtkGetObjectMacro(CaptionActor2D, vtkCaptionActor2D);
91 
93 
99  vtkGetObjectMacro(AnchorRepresentation, vtkPointHandleRepresentation3D);
101 
105  void BuildRepresentation() override;
106  void GetSize(double size[2]) override
107  {
108  size[0] = 2.0;
109  size[1] = 2.0;
110  }
111 
113 
119  int RenderOverlay(vtkViewport*) override;
124 
126 
130  vtkSetClampMacro(FontFactor, double, 0.1, 10.0);
131  vtkGetMacro(FontFactor, double);
133 
134 protected:
137 
138  // the text to manage
141 
143  int DisplayAttachmentPoint[2];
144  double FontFactor;
145 
146  // Internal representation for the anchor
148 
149  // Check and adjust boundaries according to the size of the caption text
150  virtual void AdjustCaptionBoundary();
151 
152 private:
154  void operator=(const vtkCaptionRepresentation&) = delete;
155 };
156 
157 VTK_ABI_NAMESPACE_END
158 #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.
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.
static vtkCaptionRepresentation * New()
Instantiate this class.
virtual void AdjustCaptionBoundary()
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).
~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
Definition: vtkRenderer.h:171
abstract specification for Viewports
Definition: vtkViewport.h:64
window superclass for vtkRenderWindow
Definition: vtkWindow.h:47
@ size
Definition: vtkX3D.h:253
int vtkTypeBool
Definition: vtkABI.h:64