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 -------------------------------------------------------------------------*/
34 #ifndef vtkRenderView_h
35 #define vtkRenderView_h
36 
37 #include "vtkViewsInfovisModule.h" // For export macro
38 #include "vtkRenderViewBase.h"
39 #include "vtkSmartPointer.h" // For SP ivars
40 
42 class vtkActor2D;
43 class vtkAlgorithmOutput;
44 class vtkArrayCalculator;
48 class vtkHoverWidget;
52 class vtkSelection;
53 class vtkTextProperty;
54 class vtkTexture;
55 class vtkTexturedActor2D;
57 
58 class VTKVIEWSINFOVIS_EXPORT vtkRenderView : public vtkRenderViewBase
59 {
60 public:
61  static vtkRenderView* New();
63  void PrintSelf(ostream& os, vtkIndent indent) override;
64 
70  void SetInteractor(vtkRenderWindowInteractor *interactor) override;
71 
75  virtual void SetInteractorStyle(vtkInteractorObserver* style);
76 
80  virtual vtkInteractorObserver* GetInteractorStyle();
81 
87  void SetRenderWindow(vtkRenderWindow *win) override;
88 
89  enum
90  {
93  INTERACTION_MODE_UNKNOWN
94  };
95 
96  void SetInteractionMode(int mode);
97  vtkGetMacro(InteractionMode, int);
98 
104  virtual void SetInteractionModeTo2D()
105  { this->SetInteractionMode(INTERACTION_MODE_2D); }
106  virtual void SetInteractionModeTo3D()
107  { this->SetInteractionMode(INTERACTION_MODE_3D); }
108 
113  void Render() override;
114 
118  void ApplyViewTheme(vtkViewTheme* theme) override;
119 
121 
125  virtual void SetTransform(vtkAbstractTransform* transform);
126  vtkGetObjectMacro(Transform, vtkAbstractTransform);
128 
130 
133  virtual void SetDisplayHoverText(bool b);
134  vtkGetMacro(DisplayHoverText, bool);
135  vtkBooleanMacro(DisplayHoverText, bool);
137 
138  enum {
139  SURFACE = 0,
140  FRUSTUM = 1
141  };
142 
144 
151  vtkSetClampMacro(SelectionMode, int, 0, 1);
152  vtkGetMacro(SelectionMode, int);
153  void SetSelectionModeToSurface() { this->SetSelectionMode(SURFACE); }
154  void SetSelectionModeToFrustum() { this->SetSelectionMode(FRUSTUM); }
156 
162  virtual void AddLabels(vtkAlgorithmOutput* conn);
163 
167  virtual void RemoveLabels(vtkAlgorithmOutput* conn);
168 
170 
173  virtual void SetIconTexture(vtkTexture* texture);
174  vtkGetObjectMacro(IconTexture, vtkTexture);
176 
178 
181  vtkSetVector2Macro(IconSize, int);
182  vtkGetVector2Macro(IconSize, int);
184 
186 
190  vtkSetVector2Macro(DisplaySize, int);
191  int* GetDisplaySize();
192  void GetDisplaySize(int &dsx, int &dsy);
194 
195  enum
196  {
198  ALL
199  };
200 
202 
209  virtual void SetLabelPlacementMode(int mode);
210  virtual int GetLabelPlacementMode();
212  { this->SetLabelPlacementMode(NO_OVERLAP); }
214  { this->SetLabelPlacementMode(ALL); }
216 
217  enum
218  {
220  QT
221  };
222 
224 
229  virtual void SetLabelRenderMode(int mode);
230  virtual int GetLabelRenderMode();
232  { this->SetLabelRenderMode(FREETYPE); }
233  virtual void SetLabelRenderModeToQt()
234  { this->SetLabelRenderMode(QT); }
236 
238 
241  void SetRenderOnMouseMove(bool b);
242  vtkGetMacro(RenderOnMouseMove, bool);
243  vtkBooleanMacro(RenderOnMouseMove, bool);
245 
246 protected:
247  vtkRenderView();
248  ~vtkRenderView() override;
249 
255  void ProcessEvents(vtkObject* caller, unsigned long eventId,
256  void* callData) override;
257 
261  virtual void GenerateSelection(
262  void* callData, vtkSelection* selection);
263 
267  void PrepareForRendering() override;
268 
272  virtual void UpdateHoverText();
273 
278  virtual void UpdateHoverWidgetState();
279 
284  void UpdatePickRender();
285 
293 
296  int IconSize[2];
297  int DisplaySize[2];
298 
301 
308 
309 private:
310  vtkRenderView(const vtkRenderView&) = delete;
311  void operator=(const vtkRenderView&) = delete;
312 };
313 
314 #endif
virtual void ApplyViewTheme(vtkViewTheme *vtkNotUsed(theme))
Apply a theme to the view.
Definition: vtkView.h:147
abstract base class for most VTK objects
Definition: vtkObject.h:53
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
A node in a selection tree.
Definition: vtkSelection.h:37
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:58
vtkSmartPointer< vtkTexturedActor2D > LabelActor
virtual void SetInteractionModeTo3D()
manager for OpenGL-based selection.
static vtkRenderViewBase * New()
bool RenderOnMouseMove
Places and renders non-overlapping labels.
draw vtkPolyData onto the image plane
vtkTexture * IconTexture
Transform
Definition: ADIOSDefs.h:40