VTK  9.2.6
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 =========================================================================*/
39 #ifndef vtkCaptionRepresentation_h
40 #define vtkCaptionRepresentation_h
41 
43 #include "vtkInteractionWidgetsModule.h" // For export macro
44 
45 class vtkRenderer;
46 class vtkCaptionActor2D;
47 class vtkConeSource;
49 
50 class VTKINTERACTIONWIDGETS_EXPORT vtkCaptionRepresentation : public vtkBorderRepresentation
51 {
52 public:
56  static vtkCaptionRepresentation* New();
57 
59 
63  void PrintSelf(ostream& os, vtkIndent indent) override;
65 
67 
71  void SetAnchorPosition(double pos[3]);
72  void GetAnchorPosition(double pos[3]);
74 
76 
80  void SetCaptionActor2D(vtkCaptionActor2D* captionActor);
81  vtkGetObjectMacro(CaptionActor2D, vtkCaptionActor2D);
83 
85 
90  void SetAnchorRepresentation(vtkPointHandleRepresentation3D*);
91  vtkGetObjectMacro(AnchorRepresentation, vtkPointHandleRepresentation3D);
93 
97  void BuildRepresentation() override;
98  void GetSize(double size[2]) override
99  {
100  size[0] = 2.0;
101  size[1] = 2.0;
102  }
103 
105 
109  void GetActors2D(vtkPropCollection*) override;
110  void ReleaseGraphicsResources(vtkWindow*) override;
111  int RenderOverlay(vtkViewport*) override;
112  int RenderOpaqueGeometry(vtkViewport*) override;
116 
118 
122  vtkSetClampMacro(FontFactor, double, 0.1, 10.0);
123  vtkGetMacro(FontFactor, double);
125 
126 protected:
128  ~vtkCaptionRepresentation() override;
129 
130  // the text to manage
133 
135  int DisplayAttachmentPoint[2];
136  double FontFactor;
137 
138  // Internal representation for the anchor
140 
141  // Check and adjust boundaries according to the size of the caption text
142  virtual void AdjustCaptionBoundary();
143 
144 private:
146  void operator=(const vtkCaptionRepresentation&) = delete;
147 };
148 
149 #endif
int RenderOverlay(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.
represent the position of a point in 3D space
abstract specification for Viewports
Definition: vtkViewport.h:55
void GetSize(double size[2]) override
Subclasses should implement these methods.
int RenderOpaqueGeometry(vtkViewport *) override
These methods are necessary to make this representation behave as a vtkProp.
void GetActors2D(vtkPropCollection *) override
These methods are necessary to make this representation behave as a vtkProp.
abstract specification for renderers
Definition: vtkRenderer.h:72
generate polygonal cone
Definition: vtkConeSource.h:44
static vtkBorderRepresentation * New()
Instantiate this class.
an ordered list of Props
void PrintSelf(ostream &os, vtkIndent indent) override
Define standard methods.
int vtkTypeBool
Definition: vtkABI.h:69
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
These methods are necessary to make this representation behave as a vtkProp.
represents vtkCaptionWidget in the scene
void BuildRepresentation() override
Subclasses should implement these methods.
a simple class to control print indentation
Definition: vtkIndent.h:39
void ReleaseGraphicsResources(vtkWindow *) override
These methods are necessary to make this representation behave as a vtkProp.
represent a vtkBorderWidget
draw text label associated with a point
vtkPointHandleRepresentation3D * AnchorRepresentation