VTK  9.0.20201030
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 =========================================================================*/
36 #ifndef vtkCaptionRepresentation_h
37 #define vtkCaptionRepresentation_h
38 
40 #include "vtkInteractionWidgetsModule.h" // For export macro
41 
42 class vtkRenderer;
43 class vtkCaptionActor2D;
44 class vtkConeSource;
46 
47 class VTKINTERACTIONWIDGETS_EXPORT vtkCaptionRepresentation : public vtkBorderRepresentation
48 {
49 public:
53  static vtkCaptionRepresentation* New();
54 
56 
60  void PrintSelf(ostream& os, vtkIndent indent) override;
62 
64 
68  void SetAnchorPosition(double pos[3]);
69  void GetAnchorPosition(double pos[3]);
71 
73 
77  void SetCaptionActor2D(vtkCaptionActor2D* captionActor);
78  vtkGetObjectMacro(CaptionActor2D, vtkCaptionActor2D);
80 
82 
87  void SetAnchorRepresentation(vtkPointHandleRepresentation3D*);
88  vtkGetObjectMacro(AnchorRepresentation, vtkPointHandleRepresentation3D);
90 
94  void BuildRepresentation() override;
95  void GetSize(double size[2]) override
96  {
97  size[0] = 2.0;
98  size[1] = 2.0;
99  }
100 
102 
106  void GetActors2D(vtkPropCollection*) override;
107  void ReleaseGraphicsResources(vtkWindow*) override;
108  int RenderOverlay(vtkViewport*) override;
109  int RenderOpaqueGeometry(vtkViewport*) override;
113 
115 
119  vtkSetClampMacro(FontFactor, double, 0.1, 10.0);
120  vtkGetMacro(FontFactor, double);
122 
123 protected:
125  ~vtkCaptionRepresentation() override;
126 
127  // the text to manage
130 
132  int DisplayAttachmentPoint[2];
133  double FontFactor;
134 
135  // Internal representation for the anchor
137 
138  // Check and adjust boundaries according to the size of the caption text
139  virtual void AdjustCaptionBoundary();
140 
141 private:
143  void operator=(const vtkCaptionRepresentation&) = delete;
144 };
145 
146 #endif
vtkCaptionRepresentation::GetSize
void GetSize(double size[2]) override
Definition: vtkCaptionRepresentation.h:95
vtkCaptionRepresentation::CaptionActor2D
vtkCaptionActor2D * CaptionActor2D
Definition: vtkCaptionRepresentation.h:128
vtkCaptionRepresentation::FontFactor
double FontFactor
Definition: vtkCaptionRepresentation.h:133
vtkBorderRepresentation
represent a vtkBorderWidget
Definition: vtkBorderRepresentation.h:54
vtkCaptionRepresentation::PointWidgetState
int PointWidgetState
Definition: vtkCaptionRepresentation.h:131
vtkPointHandleRepresentation3D
represent the position of a point in 3D space
Definition: vtkPointHandleRepresentation3D.h:40
vtkBorderRepresentation::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
vtkBorderRepresentation::New
static vtkBorderRepresentation * New()
Instantiate this class.
vtkCaptionRepresentation
represents vtkCaptionWidget in the scene
Definition: vtkCaptionRepresentation.h:47
vtkConeSource
generate polygonal cone
Definition: vtkConeSource.h:38
vtkBorderRepresentation::BuildRepresentation
void BuildRepresentation() override
Subclasses should implement these methods.
vtkBorderRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
vtkBorderRepresentation::GetActors2D
void GetActors2D(vtkPropCollection *) override
These methods are necessary to make this representation behave as a vtkProp.
vtkCaptionRepresentation::AnchorRepresentation
vtkPointHandleRepresentation3D * AnchorRepresentation
Definition: vtkCaptionRepresentation.h:136
vtkBorderRepresentation.h
vtkBorderRepresentation::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkCaptionRepresentation::CaptionGlyph
vtkConeSource * CaptionGlyph
Definition: vtkCaptionRepresentation.h:129
vtkBorderRepresentation::RenderTranslucentPolygonalGeometry
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
vtkX3D::size
Definition: vtkX3D.h:259
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:44
vtkCaptionActor2D
draw text label associated with a point
Definition: vtkCaptionActor2D.h:74
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:67
vtkBorderRepresentation::RenderOverlay
int RenderOverlay(vtkViewport *) override
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:35
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkBorderRepresentation::HasTranslucentPolygonalGeometry
vtkTypeBool HasTranslucentPolygonalGeometry() override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...