VTK  9.2.20230606
vtkCaptionRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCaptionRepresentation.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
58 #ifndef vtkCaptionRepresentation_h
59 #define vtkCaptionRepresentation_h
60 
62 #include "vtkInteractionWidgetsModule.h" // For export macro
63 
64 VTK_ABI_NAMESPACE_BEGIN
65 class vtkRenderer;
66 class vtkCaptionActor2D;
67 class vtkConeSource;
69 
70 class VTKINTERACTIONWIDGETS_EXPORT vtkCaptionRepresentation : public vtkBorderRepresentation
71 {
72 public:
77 
79 
83  void PrintSelf(ostream& os, vtkIndent indent) override;
85 
87 
91  void SetAnchorPosition(double pos[3]);
92  void GetAnchorPosition(double pos[3]);
94 
96 
101  vtkGetObjectMacro(CaptionActor2D, vtkCaptionActor2D);
103 
105 
111  vtkGetObjectMacro(AnchorRepresentation, vtkPointHandleRepresentation3D);
113 
117  void BuildRepresentation() override;
118  void GetSize(double size[2]) override
119  {
120  size[0] = 2.0;
121  size[1] = 2.0;
122  }
123 
125 
131  int RenderOverlay(vtkViewport*) override;
136 
138 
142  vtkSetClampMacro(FontFactor, double, 0.1, 10.0);
143  vtkGetMacro(FontFactor, double);
145 
146 protected:
149 
150  // the text to manage
153 
155  int DisplayAttachmentPoint[2];
156  double FontFactor;
157 
158  // Internal representation for the anchor
160 
161  // Check and adjust boundaries according to the size of the caption text
162  virtual void AdjustCaptionBoundary();
163 
164 private:
166  void operator=(const vtkCaptionRepresentation&) = delete;
167 };
168 
169 VTK_ABI_NAMESPACE_END
170 #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:120
represent the position of a point in 3D space
an ordered list of Props
abstract specification for renderers
Definition: vtkRenderer.h:183
abstract specification for Viewports
Definition: vtkViewport.h:57
window superclass for vtkRenderWindow
Definition: vtkWindow.h:40
@ size
Definition: vtkX3D.h:265
int vtkTypeBool
Definition: vtkABI.h:71