VTK  9.6.1
vtkCornerAnnotation.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
26
27#ifndef vtkCornerAnnotation_h
28#define vtkCornerAnnotation_h
29
30#include "vtkActor2D.h"
31#include "vtkRenderingAnnotationModule.h" // For export macro
32#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
33
34VTK_ABI_NAMESPACE_BEGIN
35class vtkTextMapper;
37class vtkImageActor;
38class vtkTextProperty;
39
40class VTKRENDERINGANNOTATION_EXPORT VTK_MARSHALAUTO vtkCornerAnnotation : public vtkActor2D
41{
42public:
44 void PrintSelf(ostream& os, vtkIndent indent) override;
45
51
53
56 int RenderOpaqueGeometry(vtkViewport* viewport) override;
58 int RenderOverlay(vtkViewport* viewport) override;
60
65
67
72 vtkSetMacro(MaximumLineHeight, double);
73 vtkGetMacro(MaximumLineHeight, double);
75
77
81 vtkSetMacro(MinimumFontSize, int);
82 vtkGetMacro(MinimumFontSize, int);
83 vtkSetMacro(MaximumFontSize, int);
84 vtkGetMacro(MaximumFontSize, int);
86
88
97 vtkSetMacro(LinearFontScaleFactor, double);
98 vtkGetMacro(LinearFontScaleFactor, double);
99 vtkSetMacro(NonlinearFontScaleFactor, double);
100 vtkGetMacro(NonlinearFontScaleFactor, double);
102
109
111
126 static const int NumTextPositions = 8;
128
130
134 void SetText(int i, const char* text);
135 const char* GetText(int i);
138 std::vector<std::string> GetAllTexts() const;
139 void SetAllTexts(const std::vector<std::string>& values);
141
143
147 vtkGetObjectMacro(ImageActor, vtkImageActor);
149
151
158
160
163 vtkSetMacro(LevelShift, double);
164 vtkGetMacro(LevelShift, double);
166
168
171 vtkSetMacro(LevelScale, double);
172 vtkGetMacro(LevelScale, double);
174
176
180 vtkGetObjectMacro(TextProperty, vtkTextProperty);
182
184
191
192protected:
195
197
199
205
207
211 int LastSize[2];
213
216
219
221
226
228
231 virtual void SetTextActorsPosition(const int vsize[2]);
234
235private:
237 void operator=(const vtkCornerAnnotation&) = delete;
238};
239
240VTK_ABI_NAMESPACE_END
241#endif
static vtkCornerAnnotation * New()
Instantiate object with a rectangle in normaled view coordinates of (0.2,0.85, 0.8,...
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
Draw the scalar bar and annotation text to the screen.
vtkActor2D * TextActor[NumTextPositions]
virtual void SetTextActorsPosition(const int vsize[2])
Set text actor positions given a viewport size and justification.
static const int NumTextPositions
Position used to get or set the corner annotation text.
virtual void SetTextActorsJustification()
Set text actor positions given a viewport size and justification.
TextPosition
Position used to get or set the corner annotation text.
@ LowerEdge
Uses the lower edge center.
@ UpperEdge
Uses the upper edge center.
@ UpperLeft
Uses the upper left corner.
@ LeftEdge
Uses the left edge center.
@ UpperRight
Uses the upper right corner.
@ RightEdge
Uses the right edge center.
@ LowerRight
Uses the lower right corner.
@ LowerLeft
Uses the lower left corner.
void SetAllTexts(const std::vector< std::string > &values)
Set/Get the text to be displayed for each corner.
~vtkCornerAnnotation() override
virtual void SetTextProperty(vtkTextProperty *p)
Set/Get the text property of all corners.
int RenderOpaqueGeometry(vtkViewport *viewport) override
Draw the scalar bar and annotation text to the screen.
vtkImageMapToWindowLevelColors * WindowLevel
void SetWindowLevel(vtkImageMapToWindowLevelColors *)
Set an instance of vtkImageMapToWindowLevelColors to use for looking at window level changes.
char * CornerText[NumTextPositions]
void SetText(int i, const char *text)
Set/Get the text to be displayed for each corner.
virtual void TextReplace(vtkImageActor *ia, vtkImageMapToWindowLevelColors *wl)
Search for replaceable tokens and replace.
vtkTextMapper * TextMapper[NumTextPositions]
void SetImageActor(vtkImageActor *)
Set an image actor to look at for slice information.
const char * GetText(int i)
Set/Get the text to be displayed for each corner.
vtkTextProperty * TextProperty
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImageActor * LastImageActor
void ClearAllTexts()
Set/Get the text to be displayed for each corner.
vtkTypeBool HasTranslucentPolygonalGeometry() override
Does this prop have some translucent polygonal geometry?
std::vector< std::string > GetAllTexts() const
Set/Get the text to be displayed for each corner.
int RenderOverlay(vtkViewport *viewport) override
Draw the scalar bar and annotation text to the screen.
void CopyAllTextsFrom(vtkCornerAnnotation *ca)
Set/Get the text to be displayed for each corner.
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
draw an image in a rendered 3D scene
Map an image through a lookup table and/or a window/level.
a simple class to control print indentation
Definition vtkIndent.h:29
2D text annotation
represent text properties.
record modification and/or execution time
abstract specification for Viewports
Definition vtkViewport.h:47
window superclass for vtkRenderWindow
Definition vtkWindow.h:29
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_MARSHALAUTO