VTK  9.3.0
vtkRenderView.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3// SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
21#ifndef vtkRenderView_h
22#define vtkRenderView_h
23
24#include "vtkRenderViewBase.h"
25#include "vtkSmartPointer.h" // For SP ivars
26#include "vtkViewsInfovisModule.h" // For export macro
27
28VTK_ABI_NAMESPACE_BEGIN
30class vtkActor2D;
36class vtkHoverWidget;
40class vtkSelection;
41class vtkTextProperty;
42class vtkTexture;
45
46class VTKVIEWSINFOVIS_EXPORT vtkRenderView : public vtkRenderViewBase
47{
48public:
49 static vtkRenderView* New();
51 void PrintSelf(ostream& os, vtkIndent indent) override;
52
58 void SetInteractor(vtkRenderWindowInteractor* interactor) override;
59
64
69
75 void SetRenderWindow(vtkRenderWindow* win) override;
76
77 enum
78 {
81 INTERACTION_MODE_UNKNOWN
82 };
83
84 void SetInteractionMode(int mode);
85 vtkGetMacro(InteractionMode, int);
86
92 virtual void SetInteractionModeTo2D() { this->SetInteractionMode(INTERACTION_MODE_2D); }
93 virtual void SetInteractionModeTo3D() { this->SetInteractionMode(INTERACTION_MODE_3D); }
94
99 void Render() override;
100
104 void ApplyViewTheme(vtkViewTheme* theme) override;
105
107
111 virtual void SetTransform(vtkAbstractTransform* transform);
112 vtkGetObjectMacro(Transform, vtkAbstractTransform);
114
116
119 virtual void SetDisplayHoverText(bool b);
120 vtkGetMacro(DisplayHoverText, bool);
121 vtkBooleanMacro(DisplayHoverText, bool);
123
124 enum
125 {
126 SURFACE = 0,
127 FRUSTUM = 1
128 };
129
131
138 vtkSetClampMacro(SelectionMode, int, 0, 1);
139 vtkGetMacro(SelectionMode, int);
140 void SetSelectionModeToSurface() { this->SetSelectionMode(SURFACE); }
141 void SetSelectionModeToFrustum() { this->SetSelectionMode(FRUSTUM); }
143
149 virtual void AddLabels(vtkAlgorithmOutput* conn);
150
154 virtual void RemoveLabels(vtkAlgorithmOutput* conn);
155
157
160 virtual void SetIconTexture(vtkTexture* texture);
161 vtkGetObjectMacro(IconTexture, vtkTexture);
163
165
168 vtkSetVector2Macro(IconSize, int);
169 vtkGetVector2Macro(IconSize, int);
171
173
177 vtkSetVector2Macro(DisplaySize, int);
179 void GetDisplaySize(int& dsx, int& dsy);
181
182 enum
183 {
185 ALL
186 };
187
189
196 virtual void SetLabelPlacementMode(int mode);
198 virtual void SetLabelPlacementModeToNoOverlap() { this->SetLabelPlacementMode(NO_OVERLAP); }
199 virtual void SetLabelPlacementModeToAll() { this->SetLabelPlacementMode(ALL); }
201
202 enum
203 {
205 QT
206 };
207
209
214 virtual void SetLabelRenderMode(int mode);
215 virtual int GetLabelRenderMode();
216 virtual void SetLabelRenderModeToFreetype() { this->SetLabelRenderMode(FREETYPE); }
217 virtual void SetLabelRenderModeToQt() { this->SetLabelRenderMode(QT); }
219
221
225 vtkGetMacro(RenderOnMouseMove, bool);
226 vtkBooleanMacro(RenderOnMouseMove, bool);
228
229protected:
231 ~vtkRenderView() override;
232
238 void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData) override;
239
243 virtual void GenerateSelection(void* callData, vtkSelection* selection);
244
248 void PrepareForRendering() override;
249
253 virtual void UpdateHoverText();
254
260
266
274
277 int IconSize[2];
278 int DisplaySize[2];
279
282
289
290private:
291 vtkRenderView(const vtkRenderView&) = delete;
292 void operator=(const vtkRenderView&) = delete;
293};
294
295VTK_ABI_NAMESPACE_END
296#endif
superclass for all geometric transformations
a actor that draws 2D data
Definition vtkActor2D.h:35
Proxy object to connect input/output ports.
perform mathematical operations on data in field data arrays
represent the vtkBalloonWidget
draw text labels at 2D dataset points
invoke a vtkTimerEvent when hovering
a simple class to control print indentation
Definition vtkIndent.h:29
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor
Places and renders non-overlapping labels.
abstract base class for most VTK objects
Definition vtkObject.h:49
draw vtkPolyData onto the image plane
A base view containing a renderer.
A view containing a renderer.
vtkTexture * IconTexture
virtual void SetInteractionModeTo3D()
virtual void SetLabelRenderModeToFreetype()
Label render mode.
virtual void UpdateHoverWidgetState()
Enable or disable hovering based on DisplayHoverText ivar and interaction state.
vtkSmartPointer< vtkHoverWidget > HoverWidget
virtual vtkInteractorObserver * GetInteractorStyle()
Get the interactor style associated with the render view.
void PrepareForRendering() override
Called by the view when the renderer is about to render.
void ApplyViewTheme(vtkViewTheme *theme) override
Applies a view theme to this view.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSmartPointer< vtkTexturedActor2D > LabelActor
void ProcessEvents(vtkObject *caller, unsigned long eventId, void *callData) override
Called to process events.
virtual void GenerateSelection(void *callData, vtkSelection *selection)
Generates the selection based on the view event and the selection mode.
virtual void SetInteractionModeTo2D()
Set the interaction mode for the view.
int * GetDisplaySize()
Set the display size of the icon (which may be different from the icon size).
void Render() override
Updates the representations, then calls Render() on the render window associated with this view.
virtual void SetDisplayHoverText(bool b)
Whether the view should display hover text.
virtual void SetTransform(vtkAbstractTransform *transform)
Set the view's transform.
virtual void SetLabelRenderMode(int mode)
Label render mode.
virtual void SetLabelPlacementModeToAll()
Label placement mode.
virtual int GetLabelPlacementMode()
Label placement mode.
virtual int GetLabelRenderMode()
Label render mode.
void SetSelectionModeToSurface()
Sets the selection mode for the render view.
static vtkRenderView * New()
virtual void SetLabelRenderModeToQt()
Label render mode.
void SetInteractor(vtkRenderWindowInteractor *interactor) override
The render window interactor.
bool PickRenderNeedsUpdate
void SetInteractionMode(int mode)
~vtkRenderView() override
virtual void SetIconTexture(vtkTexture *texture)
Set the icon sheet to use for rendering icons.
vtkSmartPointer< vtkRenderer > LabelRenderer
void UpdatePickRender()
Update the pick render for queries for drag selections or hover ballooons.
void SetRenderWindow(vtkRenderWindow *win) override
Set the render window for this view.
vtkSmartPointer< vtkBalloonRepresentation > Balloon
void SetSelectionModeToFrustum()
Sets the selection mode for the render view.
virtual void AddLabels(vtkAlgorithmOutput *conn)
Add labels from an input connection with an associated text property.
vtkSmartPointer< vtkLabelPlacementMapper > LabelPlacementMapper
void GetDisplaySize(int &dsx, int &dsy)
Set the display size of the icon (which may be different from the icon size).
virtual void SetLabelPlacementMode(int mode)
Label placement mode.
vtkSmartPointer< vtkHardwareSelector > Selector
vtkAbstractTransform * Transform
void SetRenderOnMouseMove(bool b)
Whether to render on every mouse move.
virtual void RemoveLabels(vtkAlgorithmOutput *conn)
Remove labels from an input connection.
virtual void UpdateHoverText()
Called in PrepareForRendering to update the hover text.
virtual void SetLabelPlacementModeToNoOverlap()
Label placement mode.
virtual void SetInteractorStyle(vtkInteractorObserver *style)
The interactor style associated with the render view.
platform-independent render window interaction including picking and frame rate control.
create a window for renderers to draw into
data object that represents a "selection" in VTK.
Hold a reference to a vtkObjectBase instance.
represent text properties.
handles properties associated with a texture map
Definition vtkTexture.h:58
actor that draws 2D data with texture support
transform points into different coordinate systems
Sets theme colors for a graphical view.