VTK  9.3.1
vtkRenderView.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
24 #ifndef vtkRenderView_h
25 #define vtkRenderView_h
26 
27 #include "vtkRenderViewBase.h"
28 #include "vtkSmartPointer.h" // For SP ivars
29 #include "vtkViewsInfovisModule.h" // For export macro
30 
31 VTK_ABI_NAMESPACE_BEGIN
33 class vtkActor2D;
34 class vtkAlgorithmOutput;
35 class vtkArrayCalculator;
39 class vtkHoverWidget;
43 class vtkSelection;
44 class vtkTextProperty;
45 class vtkTexture;
46 class vtkTexturedActor2D;
48 
49 class VTKVIEWSINFOVIS_EXPORT vtkRenderView : public vtkRenderViewBase
50 {
51 public:
52  static vtkRenderView* New();
54  void PrintSelf(ostream& os, vtkIndent indent) override;
55 
61  void SetInteractor(vtkRenderWindowInteractor* interactor) override;
62 
66  virtual void SetInteractorStyle(vtkInteractorObserver* style);
67 
71  virtual vtkInteractorObserver* GetInteractorStyle();
72 
78  void SetRenderWindow(vtkRenderWindow* win) override;
79 
80  enum
81  {
84  INTERACTION_MODE_UNKNOWN
85  };
86 
87  void SetInteractionMode(int mode);
88  vtkGetMacro(InteractionMode, int);
89 
95  virtual void SetInteractionModeTo2D() { this->SetInteractionMode(INTERACTION_MODE_2D); }
96  virtual void SetInteractionModeTo3D() { this->SetInteractionMode(INTERACTION_MODE_3D); }
97 
102  void Render() override;
103 
107  void ApplyViewTheme(vtkViewTheme* theme) override;
108 
110 
114  virtual void SetTransform(vtkAbstractTransform* transform);
115  vtkGetObjectMacro(Transform, vtkAbstractTransform);
117 
119 
122  virtual void SetDisplayHoverText(bool b);
123  vtkGetMacro(DisplayHoverText, bool);
124  vtkBooleanMacro(DisplayHoverText, bool);
126 
127  enum
128  {
129  SURFACE = 0,
130  FRUSTUM = 1
131  };
132 
134 
141  vtkSetClampMacro(SelectionMode, int, 0, 1);
142  vtkGetMacro(SelectionMode, int);
143  void SetSelectionModeToSurface() { this->SetSelectionMode(SURFACE); }
144  void SetSelectionModeToFrustum() { this->SetSelectionMode(FRUSTUM); }
146 
152  virtual void AddLabels(vtkAlgorithmOutput* conn);
153 
157  virtual void RemoveLabels(vtkAlgorithmOutput* conn);
158 
160 
163  virtual void SetIconTexture(vtkTexture* texture);
164  vtkGetObjectMacro(IconTexture, vtkTexture);
166 
168 
171  vtkSetVector2Macro(IconSize, int);
172  vtkGetVector2Macro(IconSize, int);
174 
176 
180  vtkSetVector2Macro(DisplaySize, int);
181  int* GetDisplaySize();
182  void GetDisplaySize(int& dsx, int& dsy);
184 
185  enum
186  {
188  ALL
189  };
190 
192 
199  virtual void SetLabelPlacementMode(int mode);
200  virtual int GetLabelPlacementMode();
201  virtual void SetLabelPlacementModeToNoOverlap() { this->SetLabelPlacementMode(NO_OVERLAP); }
202  virtual void SetLabelPlacementModeToAll() { this->SetLabelPlacementMode(ALL); }
204 
205  enum
206  {
208  QT
209  };
210 
212 
217  virtual void SetLabelRenderMode(int mode);
218  virtual int GetLabelRenderMode();
219  virtual void SetLabelRenderModeToFreetype() { this->SetLabelRenderMode(FREETYPE); }
220  virtual void SetLabelRenderModeToQt() { this->SetLabelRenderMode(QT); }
222 
224 
227  void SetRenderOnMouseMove(bool b);
228  vtkGetMacro(RenderOnMouseMove, bool);
229  vtkBooleanMacro(RenderOnMouseMove, bool);
231 
232 protected:
233  vtkRenderView();
234  ~vtkRenderView() override;
235 
241  void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData) override;
242 
246  virtual void GenerateSelection(void* callData, vtkSelection* selection);
247 
251  void PrepareForRendering() override;
252 
256  virtual void UpdateHoverText();
257 
262  virtual void UpdateHoverWidgetState();
263 
268  void UpdatePickRender();
269 
277 
280  int IconSize[2];
281  int DisplaySize[2];
282 
285 
292 
293 private:
294  vtkRenderView(const vtkRenderView&) = delete;
295  void operator=(const vtkRenderView&) = delete;
296 };
297 
298 VTK_ABI_NAMESPACE_END
299 #endif
virtual void ApplyViewTheme(vtkViewTheme *vtkNotUsed(theme))
Apply a theme to the view.
Definition: vtkView.h:141
abstract base class for most VTK objects
Definition: vtkObject.h:51
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:34
vtkSmartPointer< vtkBalloonRepresentation > Balloon
draw text labels at 2D dataset points
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:49
virtual void SetLabelPlacementModeToAll()
Label placement mode.
virtual void SetInteractionModeTo2D()
Set the interaction mode for the view.
Definition: vtkRenderView.h:95
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:33
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:28
superclass for all geometric transformations
virtual void SetLabelPlacementModeToNoOverlap()
Label placement mode.
handles properties associated with a texture map
Definition: vtkTexture.h:57
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:49
vtkSmartPointer< vtkTexturedActor2D > LabelActor
virtual void SetInteractionModeTo3D()
Definition: vtkRenderView.h:96
static vtkRenderViewBase * New()
bool RenderOnMouseMove
Places and renders non-overlapping labels.
draw vtkPolyData onto the image plane
vtkTexture * IconTexture