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 -------------------------------------------------------------------------*/
40 #ifndef vtkRenderView_h
41 #define vtkRenderView_h
42 
43 #include "vtkRenderViewBase.h"
44 #include "vtkSmartPointer.h" // For SP ivars
45 #include "vtkViewsInfovisModule.h" // For export macro
46 
48 class vtkActor2D;
49 class vtkAlgorithmOutput;
50 class vtkArrayCalculator;
54 class vtkHoverWidget;
58 class vtkSelection;
59 class vtkTextProperty;
60 class vtkTexture;
61 class vtkTexturedActor2D;
63 
64 class VTKVIEWSINFOVIS_EXPORT vtkRenderView : public vtkRenderViewBase
65 {
66 public:
67  static vtkRenderView* New();
69  void PrintSelf(ostream& os, vtkIndent indent) override;
70 
76  void SetInteractor(vtkRenderWindowInteractor* interactor) override;
77 
81  virtual void SetInteractorStyle(vtkInteractorObserver* style);
82 
86  virtual vtkInteractorObserver* GetInteractorStyle();
87 
93  void SetRenderWindow(vtkRenderWindow* win) override;
94 
95  enum
96  {
99  INTERACTION_MODE_UNKNOWN
100  };
101 
102  void SetInteractionMode(int mode);
103  vtkGetMacro(InteractionMode, int);
104 
110  virtual void SetInteractionModeTo2D() { this->SetInteractionMode(INTERACTION_MODE_2D); }
111  virtual void SetInteractionModeTo3D() { this->SetInteractionMode(INTERACTION_MODE_3D); }
112 
117  void Render() override;
118 
122  void ApplyViewTheme(vtkViewTheme* theme) override;
123 
125 
129  virtual void SetTransform(vtkAbstractTransform* transform);
130  vtkGetObjectMacro(Transform, vtkAbstractTransform);
132 
134 
137  virtual void SetDisplayHoverText(bool b);
138  vtkGetMacro(DisplayHoverText, bool);
139  vtkBooleanMacro(DisplayHoverText, bool);
141 
142  enum
143  {
144  SURFACE = 0,
145  FRUSTUM = 1
146  };
147 
149 
156  vtkSetClampMacro(SelectionMode, int, 0, 1);
157  vtkGetMacro(SelectionMode, int);
158  void SetSelectionModeToSurface() { this->SetSelectionMode(SURFACE); }
159  void SetSelectionModeToFrustum() { this->SetSelectionMode(FRUSTUM); }
161 
167  virtual void AddLabels(vtkAlgorithmOutput* conn);
168 
172  virtual void RemoveLabels(vtkAlgorithmOutput* conn);
173 
175 
178  virtual void SetIconTexture(vtkTexture* texture);
179  vtkGetObjectMacro(IconTexture, vtkTexture);
181 
183 
186  vtkSetVector2Macro(IconSize, int);
187  vtkGetVector2Macro(IconSize, int);
189 
191 
195  vtkSetVector2Macro(DisplaySize, int);
196  int* GetDisplaySize();
197  void GetDisplaySize(int& dsx, int& dsy);
199 
200  enum
201  {
203  ALL
204  };
205 
207 
214  virtual void SetLabelPlacementMode(int mode);
215  virtual int GetLabelPlacementMode();
216  virtual void SetLabelPlacementModeToNoOverlap() { this->SetLabelPlacementMode(NO_OVERLAP); }
217  virtual void SetLabelPlacementModeToAll() { this->SetLabelPlacementMode(ALL); }
219 
220  enum
221  {
223  QT
224  };
225 
227 
232  virtual void SetLabelRenderMode(int mode);
233  virtual int GetLabelRenderMode();
234  virtual void SetLabelRenderModeToFreetype() { this->SetLabelRenderMode(FREETYPE); }
235  virtual void SetLabelRenderModeToQt() { this->SetLabelRenderMode(QT); }
237 
239 
242  void SetRenderOnMouseMove(bool b);
243  vtkGetMacro(RenderOnMouseMove, bool);
244  vtkBooleanMacro(RenderOnMouseMove, bool);
246 
247 protected:
248  vtkRenderView();
249  ~vtkRenderView() override;
250 
256  void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData) override;
257 
261  virtual void GenerateSelection(void* callData, vtkSelection* selection);
262 
266  void PrepareForRendering() override;
267 
271  virtual void UpdateHoverText();
272 
277  virtual void UpdateHoverWidgetState();
278 
283  void UpdatePickRender();
284 
292 
295  int IconSize[2];
296  int DisplaySize[2];
297 
300 
307 
308 private:
309  vtkRenderView(const vtkRenderView&) = delete;
310  void operator=(const vtkRenderView&) = delete;
311 };
312 
313 #endif
virtual void ApplyViewTheme(vtkViewTheme *vtkNotUsed(theme))
Apply a theme to the view.
Definition: vtkView.h:156
abstract base class for most VTK objects
Definition: vtkObject.h:62
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:59
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:68
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:64
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