VTK  9.1.0
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 =========================================================================*/
55 #ifndef vtkCaptionRepresentation_h
56 #define vtkCaptionRepresentation_h
57 
59 #include "vtkInteractionWidgetsModule.h" // For export macro
60 
61 class vtkRenderer;
62 class vtkCaptionActor2D;
63 class vtkConeSource;
65 
66 class VTKINTERACTIONWIDGETS_EXPORT vtkCaptionRepresentation : public vtkBorderRepresentation
67 {
68 public:
73 
75 
79  void PrintSelf(ostream& os, vtkIndent indent) override;
81 
83 
87  void SetAnchorPosition(double pos[3]);
88  void GetAnchorPosition(double pos[3]);
90 
92 
96  void SetCaptionActor2D(vtkCaptionActor2D* captionActor);
97  vtkGetObjectMacro(CaptionActor2D, vtkCaptionActor2D);
99 
101 
107  vtkGetObjectMacro(AnchorRepresentation, vtkPointHandleRepresentation3D);
109 
113  void BuildRepresentation() override;
114  void GetSize(double size[2]) override
115  {
116  size[0] = 2.0;
117  size[1] = 2.0;
118  }
119 
121 
127  int RenderOverlay(vtkViewport*) override;
132 
134 
138  vtkSetClampMacro(FontFactor, double, 0.1, 10.0);
139  vtkGetMacro(FontFactor, double);
141 
142 protected:
145 
146  // the text to manage
149 
151  int DisplayAttachmentPoint[2];
152  double FontFactor;
153 
154  // Internal representation for the anchor
156 
157  // Check and adjust boundaries according to the size of the caption text
158  virtual void AdjustCaptionBoundary();
159 
160 private:
162  void operator=(const vtkCaptionRepresentation&) = delete;
163 };
164 
165 #endif
vtkCaptionRepresentation::GetSize
void GetSize(double size[2]) override
Subclasses should implement these methods.
Definition: vtkCaptionRepresentation.h:114
vtkCaptionRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK class methods.
vtkCaptionRepresentation::CaptionActor2D
vtkCaptionActor2D * CaptionActor2D
Definition: vtkCaptionRepresentation.h:147
vtkCaptionRepresentation::RenderTranslucentPolygonalGeometry
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
These methods are necessary to make this representation behave as a vtkProp.
vtkCaptionRepresentation::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
These methods are necessary to make this representation behave as a vtkProp.
vtkCaptionRepresentation::FontFactor
double FontFactor
Definition: vtkCaptionRepresentation.h:152
vtkBorderRepresentation
represent a vtkBorderWidget
Definition: vtkBorderRepresentation.h:107
vtkCaptionRepresentation::HasTranslucentPolygonalGeometry
vtkTypeBool HasTranslucentPolygonalGeometry() override
These methods are necessary to make this representation behave as a vtkProp.
vtkCaptionRepresentation::PointWidgetState
int PointWidgetState
Definition: vtkCaptionRepresentation.h:150
vtkPointHandleRepresentation3D
represent the position of a point in 3D space
Definition: vtkPointHandleRepresentation3D.h:41
vtkCaptionRepresentation
represents vtkCaptionWidget in the scene
Definition: vtkCaptionRepresentation.h:67
vtkConeSource
generate polygonal cone
Definition: vtkConeSource.h:148
vtkCaptionRepresentation::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *) override
These methods are necessary to make this representation behave as a vtkProp.
vtkCaptionRepresentation::GetActors2D
void GetActors2D(vtkPropCollection *) override
These methods are necessary to make this representation behave as a vtkProp.
vtkCaptionRepresentation::RenderOverlay
int RenderOverlay(vtkViewport *) override
These methods are necessary to make this representation behave as a vtkProp.
vtkCaptionRepresentation::vtkCaptionRepresentation
vtkCaptionRepresentation()
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
vtkCaptionRepresentation::SetCaptionActor2D
void SetCaptionActor2D(vtkCaptionActor2D *captionActor)
Specify the vtkCaptionActor2D to manage.
vtkCaptionRepresentation::AnchorRepresentation
vtkPointHandleRepresentation3D * AnchorRepresentation
Definition: vtkCaptionRepresentation.h:155
vtkBorderRepresentation.h
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkCaptionRepresentation::CaptionGlyph
vtkConeSource * CaptionGlyph
Definition: vtkCaptionRepresentation.h:148
vtkX3D::size
@ size
Definition: vtkX3D.h:259
vtkCaptionRepresentation::~vtkCaptionRepresentation
~vtkCaptionRepresentation() override
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkCaptionRepresentation::BuildRepresentation
void BuildRepresentation() override
Satisfy the superclasses API.
vtkCaptionActor2D
draw text label associated with a point
Definition: vtkCaptionActor2D.h:144
vtkCaptionRepresentation::SetAnchorPosition
void SetAnchorPosition(double pos[3])
Specify the position of the anchor (i.e., the point that the caption is anchored to).
vtkCaptionRepresentation::GetAnchorPosition
void GetAnchorPosition(double pos[3])
Specify the position of the anchor (i.e., the point that the caption is anchored to).
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:182
vtkCaptionRepresentation::New
static vtkCaptionRepresentation * New()
Instantiate this class.
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:85
vtkCaptionRepresentation::SetAnchorRepresentation
void SetAnchorRepresentation(vtkPointHandleRepresentation3D *)
Set and get the instances of vtkPointHandleRepresention3D used to implement this representation.
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkCaptionRepresentation::AdjustCaptionBoundary
virtual void AdjustCaptionBoundary()