VTK
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 -------------------------------------------------------------------------*/
37 #ifndef vtkRenderView_h
38 #define vtkRenderView_h
39 
40 #include "vtkViewsInfovisModule.h" // For export macro
41 #include "vtkRenderViewBase.h"
42 #include "vtkSmartPointer.h" // For SP ivars
43 
45 class vtkActor2D;
46 class vtkAlgorithmOutput;
47 class vtkArrayCalculator;
51 class vtkHoverWidget;
55 class vtkSelection;
56 class vtkTextProperty;
57 class vtkTexture;
58 class vtkTexturedActor2D;
60 
61 class VTKVIEWSINFOVIS_EXPORT vtkRenderView : public vtkRenderViewBase
62 {
63 public:
64  static vtkRenderView* New();
66  void PrintSelf(ostream& os, vtkIndent indent) override;
67 
73  void SetInteractor(vtkRenderWindowInteractor *interactor) override;
74 
78  virtual void SetInteractorStyle(vtkInteractorObserver* style);
79 
83  virtual vtkInteractorObserver* GetInteractorStyle();
84 
90  void SetRenderWindow(vtkRenderWindow *win) override;
91 
92  enum
93  {
96  INTERACTION_MODE_UNKNOWN
97  };
98 
99  void SetInteractionMode(int mode);
100  vtkGetMacro(InteractionMode, int);
101 
107  virtual void SetInteractionModeTo2D()
108  { this->SetInteractionMode(INTERACTION_MODE_2D); }
109  virtual void SetInteractionModeTo3D()
110  { this->SetInteractionMode(INTERACTION_MODE_3D); }
111 
116  void Render() override;
117 
121  void ApplyViewTheme(vtkViewTheme* theme) override;
122 
124 
128  virtual void SetTransform(vtkAbstractTransform* transform);
129  vtkGetObjectMacro(Transform, vtkAbstractTransform);
131 
133 
136  virtual void SetDisplayHoverText(bool b);
137  vtkGetMacro(DisplayHoverText, bool);
138  vtkBooleanMacro(DisplayHoverText, bool);
140 
141  enum {
142  SURFACE = 0,
143  FRUSTUM = 1
144  };
145 
147 
154  vtkSetClampMacro(SelectionMode, int, 0, 1);
155  vtkGetMacro(SelectionMode, int);
156  void SetSelectionModeToSurface() { this->SetSelectionMode(SURFACE); }
157  void SetSelectionModeToFrustum() { this->SetSelectionMode(FRUSTUM); }
159 
165  virtual void AddLabels(vtkAlgorithmOutput* conn);
166 
170  virtual void RemoveLabels(vtkAlgorithmOutput* conn);
171 
173 
176  virtual void SetIconTexture(vtkTexture* texture);
177  vtkGetObjectMacro(IconTexture, vtkTexture);
179 
181 
184  vtkSetVector2Macro(IconSize, int);
185  vtkGetVector2Macro(IconSize, int);
187 
189 
193  vtkSetVector2Macro(DisplaySize, int);
194  int* GetDisplaySize();
195  void GetDisplaySize(int &dsx, int &dsy);
197 
198  enum
199  {
201  ALL
202  };
203 
205 
212  virtual void SetLabelPlacementMode(int mode);
213  virtual int GetLabelPlacementMode();
215  { this->SetLabelPlacementMode(NO_OVERLAP); }
217  { this->SetLabelPlacementMode(ALL); }
219 
220  enum
221  {
223  QT
224  };
225 
227 
232  virtual void SetLabelRenderMode(int mode);
233  virtual int GetLabelRenderMode();
235  { this->SetLabelRenderMode(FREETYPE); }
236  virtual void SetLabelRenderModeToQt()
237  { this->SetLabelRenderMode(QT); }
239 
241 
244  void SetRenderOnMouseMove(bool b);
245  vtkGetMacro(RenderOnMouseMove, bool);
246  vtkBooleanMacro(RenderOnMouseMove, bool);
248 
249 protected:
250  vtkRenderView();
251  ~vtkRenderView() override;
252 
258  void ProcessEvents(vtkObject* caller, unsigned long eventId,
259  void* callData) override;
260 
264  virtual void GenerateSelection(
265  void* callData, vtkSelection* selection);
266 
270  void PrepareForRendering() override;
271 
275  virtual void UpdateHoverText();
276 
281  virtual void UpdateHoverWidgetState();
282 
287  void UpdatePickRender();
288 
296 
299  int IconSize[2];
300  int DisplaySize[2];
301 
304 
311 
312 private:
313  vtkRenderView(const vtkRenderView&) = delete;
314  void operator=(const vtkRenderView&) = delete;
315 };
316 
317 #endif
virtual void ApplyViewTheme(vtkViewTheme *vtkNotUsed(theme))
Apply a theme to the view.
Definition: vtkView.h:153
abstract base class for most VTK objects
Definition: vtkObject.h:59
actor that draws 2D data with texture support
void SetSelectionModeToFrustum()
Sets the selection mode for the render view.
virtual void Render()
Updates the representations, then calls Render() on the render window associated with this view...
perform mathematical operations on data in field data arrays
virtual void SetRenderWindow(vtkRenderWindow *win)
Set the render window for this view.
a actor that draws 2D data
Definition: vtkActor2D.h:45
vtkSmartPointer< vtkBalloonRepresentation > Balloon
draw text labels at 2D dataset points
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:63
virtual void SetLabelPlacementModeToAll()
Label placement mode.
virtual void SetInteractionModeTo2D()
Set the interaction mode for the view.
A base view containing a renderer.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void SetInteractor(vtkRenderWindowInteractor *)
The render window interactor.
Proxy object to connect input/output ports.
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor ...
void SetSelectionModeToSurface()
Sets the selection mode for the render view.
platform-independent render window interaction including picking and frame rate control.
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:48
virtual void ProcessEvents(vtkObject *caller, unsigned long eventId, void *callData)
Called to process events.
vtkAbstractTransform * Transform
vtkSmartPointer< vtkLabelPlacementMapper > LabelPlacementMapper
a simple class to control print indentation
Definition: vtkIndent.h:39
superclass for all geometric transformations
virtual void SetLabelPlacementModeToNoOverlap()
Label placement mode.
handles properties associated with a texture map
Definition: vtkTexture.h:71
vtkSmartPointer< vtkHoverWidget > HoverWidget
virtual void SetLabelRenderModeToFreetype()
Label render mode.
virtual void SetLabelRenderModeToQt()
Label render mode.
bool InHoverTextRender
bool PickRenderNeedsUpdate
virtual void PrepareForRendering()
Called by the view when the renderer is about to render.
represent text properties.
transform points into different coordinate systems
represent the vtkBalloonWidget
vtkSmartPointer< vtkHardwareSelector > Selector
create a window for renderers to draw into
vtkSmartPointer< vtkRenderer > LabelRenderer
invoke a vtkTimerEvent when hovering
A view containing a renderer.
Definition: vtkRenderView.h:61
vtkSmartPointer< vtkTexturedActor2D > LabelActor
virtual void SetInteractionModeTo3D()
static vtkRenderViewBase * New()
bool RenderOnMouseMove
Places and renders non-overlapping labels.
draw vtkPolyData onto the image plane
vtkTexture * IconTexture
Transform
Definition: ADIOSDefs.h:40