VTK
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 
39 #include "vtkInteractionWidgetsModule.h" // For export macro
41 
42 class vtkRenderer;
43 class vtkCaptionActor2D;
44 class vtkConeSource;
46 
47 
48 class VTKINTERACTIONWIDGETS_EXPORT vtkCaptionRepresentation : public vtkBorderRepresentation
49 {
50 public:
54  static vtkCaptionRepresentation *New();
55 
57 
61  void PrintSelf(ostream& os, vtkIndent indent) override;
63 
65 
69  void SetAnchorPosition(double pos[3]);
70  void GetAnchorPosition(double pos[3]);
72 
74 
78  void SetCaptionActor2D(vtkCaptionActor2D *captionActor);
79  vtkGetObjectMacro(CaptionActor2D,vtkCaptionActor2D);
81 
83 
88  void SetAnchorRepresentation(vtkPointHandleRepresentation3D*);
89  vtkGetObjectMacro(AnchorRepresentation,vtkPointHandleRepresentation3D);
91 
95  void BuildRepresentation() override;
96  void GetSize(double size[2]) override
97  {size[0]=2.0; size[1]=2.0;}
98 
100 
104  void GetActors2D(vtkPropCollection*) override;
105  void ReleaseGraphicsResources(vtkWindow*) override;
106  int RenderOverlay(vtkViewport*) override;
107  int RenderOpaqueGeometry(vtkViewport*) override;
109  int HasTranslucentPolygonalGeometry() override;
111 
113 
117  vtkSetClampMacro(FontFactor, double, 0.1, 10.0);
118  vtkGetMacro(FontFactor, double);
120 
121 protected:
123  ~vtkCaptionRepresentation() override;
124 
125  // the text to manage
128 
130  int DisplayAttachmentPoint[2];
131  double FontFactor;
132 
133  // Internal representation for the anchor
135 
136  // Check and adjust boundaries according to the size of the caption text
137  virtual void AdjustCaptionBoundary();
138 
139 private:
141  void operator=(const vtkCaptionRepresentation&) = delete;
142 };
143 
144 #endif
vtkCaptionRepresentation::GetSize
void GetSize(double size[2]) override
Definition: vtkCaptionRepresentation.h:96
vtkCaptionRepresentation::CaptionActor2D
vtkCaptionActor2D * CaptionActor2D
Definition: vtkCaptionRepresentation.h:126
vtkCaptionRepresentation::FontFactor
double FontFactor
Definition: vtkCaptionRepresentation.h:131
vtkBorderRepresentation
represent a vtkBorderWidget
Definition: vtkBorderRepresentation.h:55
vtkCaptionRepresentation::PointWidgetState
int PointWidgetState
Definition: vtkCaptionRepresentation.h:129
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:48
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:34
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:134
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:127
vtkBorderRepresentation::RenderTranslucentPolygonalGeometry
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
vtkX3D::size
Definition: vtkX3D.h:253
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:57
vtkBorderRepresentation::RenderOverlay
int RenderOverlay(vtkViewport *) override
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:35
vtkBorderRepresentation::HasTranslucentPolygonalGeometry
int HasTranslucentPolygonalGeometry() override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...