VTK  9.2.6
vtkRenderView.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkRenderView.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=========================================================================*/
15/*-------------------------------------------------------------------------
16 Copyright 2008 Sandia Corporation.
17 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18 the U.S. Government retains certain rights in this software.
19-------------------------------------------------------------------------*/
56#ifndef vtkRenderView_h
57#define vtkRenderView_h
58
59#include "vtkRenderViewBase.h"
60#include "vtkSmartPointer.h" // For SP ivars
61#include "vtkViewsInfovisModule.h" // For export macro
62
64class vtkActor2D;
70class vtkHoverWidget;
74class vtkSelection;
75class vtkTextProperty;
76class vtkTexture;
79
80class VTKVIEWSINFOVIS_EXPORT vtkRenderView : public vtkRenderViewBase
81{
82public:
83 static vtkRenderView* New();
85 void PrintSelf(ostream& os, vtkIndent indent) override;
86
92 void SetInteractor(vtkRenderWindowInteractor* interactor) override;
93
98
103
109 void SetRenderWindow(vtkRenderWindow* win) override;
110
111 enum
112 {
115 INTERACTION_MODE_UNKNOWN
116 };
117
119 vtkGetMacro(InteractionMode, int);
120
126 virtual void SetInteractionModeTo2D() { this->SetInteractionMode(INTERACTION_MODE_2D); }
127 virtual void SetInteractionModeTo3D() { this->SetInteractionMode(INTERACTION_MODE_3D); }
128
133 void Render() override;
134
138 void ApplyViewTheme(vtkViewTheme* theme) override;
139
141
145 virtual void SetTransform(vtkAbstractTransform* transform);
146 vtkGetObjectMacro(Transform, vtkAbstractTransform);
148
150
153 virtual void SetDisplayHoverText(bool b);
154 vtkGetMacro(DisplayHoverText, bool);
155 vtkBooleanMacro(DisplayHoverText, bool);
157
158 enum
159 {
160 SURFACE = 0,
161 FRUSTUM = 1
162 };
163
165
172 vtkSetClampMacro(SelectionMode, int, 0, 1);
173 vtkGetMacro(SelectionMode, int);
174 void SetSelectionModeToSurface() { this->SetSelectionMode(SURFACE); }
175 void SetSelectionModeToFrustum() { this->SetSelectionMode(FRUSTUM); }
177
183 virtual void AddLabels(vtkAlgorithmOutput* conn);
184
188 virtual void RemoveLabels(vtkAlgorithmOutput* conn);
189
191
194 virtual void SetIconTexture(vtkTexture* texture);
195 vtkGetObjectMacro(IconTexture, vtkTexture);
197
199
202 vtkSetVector2Macro(IconSize, int);
203 vtkGetVector2Macro(IconSize, int);
205
207
211 vtkSetVector2Macro(DisplaySize, int);
213 void GetDisplaySize(int& dsx, int& dsy);
215
216 enum
217 {
219 ALL
220 };
221
223
230 virtual void SetLabelPlacementMode(int mode);
232 virtual void SetLabelPlacementModeToNoOverlap() { this->SetLabelPlacementMode(NO_OVERLAP); }
233 virtual void SetLabelPlacementModeToAll() { this->SetLabelPlacementMode(ALL); }
235
236 enum
237 {
239 QT
240 };
241
243
248 virtual void SetLabelRenderMode(int mode);
249 virtual int GetLabelRenderMode();
250 virtual void SetLabelRenderModeToFreetype() { this->SetLabelRenderMode(FREETYPE); }
251 virtual void SetLabelRenderModeToQt() { this->SetLabelRenderMode(QT); }
253
255
259 vtkGetMacro(RenderOnMouseMove, bool);
260 vtkBooleanMacro(RenderOnMouseMove, bool);
262
263protected:
265 ~vtkRenderView() override;
266
272 void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData) override;
273
277 virtual void GenerateSelection(void* callData, vtkSelection* selection);
278
282 void PrepareForRendering() override;
283
287 virtual void UpdateHoverText();
288
294
300
308
311 int IconSize[2];
312 int DisplaySize[2];
313
316
323
324private:
325 vtkRenderView(const vtkRenderView&) = delete;
326 void operator=(const vtkRenderView&) = delete;
327};
328
329#endif
superclass for all geometric transformations
a actor that draws 2D data
Definition: vtkActor2D.h:155
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:119
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:79
draw vtkPolyData onto the image plane
A base view containing a renderer.
A view containing a renderer.
Definition: vtkRenderView.h:81
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.
bool InHoverTextRender
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
bool RenderOnMouseMove
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.
Definition: vtkSelection.h:169
represent text properties.
handles properties associated with a texture map
Definition: vtkTexture.h:178
actor that draws 2D data with texture support
transform points into different coordinate systems
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:138
@ Transform
Definition: vtkX3D.h:47
@ mode
Definition: vtkX3D.h:253
@ style
Definition: vtkX3D.h:498