VTK  9.0.1
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 "vtkRenderViewBase.h"
41 #include "vtkSmartPointer.h" // For SP ivars
42 #include "vtkViewsInfovisModule.h" // For export macro
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() { this->SetInteractionMode(INTERACTION_MODE_2D); }
108  virtual void SetInteractionModeTo3D() { this->SetInteractionMode(INTERACTION_MODE_3D); }
109 
114  void Render() override;
115 
119  void ApplyViewTheme(vtkViewTheme* theme) override;
120 
122 
126  virtual void SetTransform(vtkAbstractTransform* transform);
127  vtkGetObjectMacro(Transform, vtkAbstractTransform);
129 
131 
134  virtual void SetDisplayHoverText(bool b);
135  vtkGetMacro(DisplayHoverText, bool);
136  vtkBooleanMacro(DisplayHoverText, bool);
138 
139  enum
140  {
141  SURFACE = 0,
142  FRUSTUM = 1
143  };
144 
146 
153  vtkSetClampMacro(SelectionMode, int, 0, 1);
154  vtkGetMacro(SelectionMode, int);
155  void SetSelectionModeToSurface() { this->SetSelectionMode(SURFACE); }
156  void SetSelectionModeToFrustum() { this->SetSelectionMode(FRUSTUM); }
158 
164  virtual void AddLabels(vtkAlgorithmOutput* conn);
165 
169  virtual void RemoveLabels(vtkAlgorithmOutput* conn);
170 
172 
175  virtual void SetIconTexture(vtkTexture* texture);
176  vtkGetObjectMacro(IconTexture, vtkTexture);
178 
180 
183  vtkSetVector2Macro(IconSize, int);
184  vtkGetVector2Macro(IconSize, int);
186 
188 
192  vtkSetVector2Macro(DisplaySize, int);
193  int* GetDisplaySize();
194  void GetDisplaySize(int& dsx, int& dsy);
196 
197  enum
198  {
200  ALL
201  };
202 
204 
211  virtual void SetLabelPlacementMode(int mode);
212  virtual int GetLabelPlacementMode();
213  virtual void SetLabelPlacementModeToNoOverlap() { this->SetLabelPlacementMode(NO_OVERLAP); }
214  virtual void SetLabelPlacementModeToAll() { this->SetLabelPlacementMode(ALL); }
216 
217  enum
218  {
220  QT
221  };
222 
224 
229  virtual void SetLabelRenderMode(int mode);
230  virtual int GetLabelRenderMode();
231  virtual void SetLabelRenderModeToFreetype() { this->SetLabelRenderMode(FREETYPE); }
232  virtual void SetLabelRenderModeToQt() { this->SetLabelRenderMode(QT); }
234 
236 
239  void SetRenderOnMouseMove(bool b);
240  vtkGetMacro(RenderOnMouseMove, bool);
241  vtkBooleanMacro(RenderOnMouseMove, bool);
243 
244 protected:
245  vtkRenderView();
246  ~vtkRenderView() override;
247 
253  void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData) override;
254 
258  virtual void GenerateSelection(void* callData, vtkSelection* selection);
259 
263  void PrepareForRendering() override;
264 
268  virtual void UpdateHoverText();
269 
274  virtual void UpdateHoverWidgetState();
275 
280  void UpdatePickRender();
281 
289 
292  int IconSize[2];
293  int DisplaySize[2];
294 
297 
304 
305 private:
306  vtkRenderView(const vtkRenderView&) = delete;
307  void operator=(const vtkRenderView&) = delete;
308 };
309 
310 #endif
virtual void ApplyViewTheme(vtkViewTheme *vtkNotUsed(theme))
Apply a theme to the view.
Definition: vtkView.h:150
abstract base class for most VTK objects
Definition: vtkObject.h:56
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:39
vtkSmartPointer< vtkBalloonRepresentation > Balloon
draw text labels at 2D dataset points
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:57
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:42
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:33
superclass for all geometric transformations
virtual void SetLabelPlacementModeToNoOverlap()
Label placement mode.
handles properties associated with a texture map
Definition: vtkTexture.h:65
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