VTK  9.3.20240329
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
43 #ifndef vtkRenderView_h
44 #define vtkRenderView_h
45 
46 #include "vtkRenderViewBase.h"
47 #include "vtkSmartPointer.h" // For SP ivars
48 #include "vtkViewsInfovisModule.h" // For export macro
49 
50 VTK_ABI_NAMESPACE_BEGIN
52 class vtkActor2D;
53 class vtkAlgorithmOutput;
54 class vtkArrayCalculator;
58 class vtkHoverWidget;
62 class vtkSelection;
63 class vtkTextProperty;
64 class vtkTexture;
65 class vtkTexturedActor2D;
67 
68 class VTKVIEWSINFOVIS_EXPORT vtkRenderView : public vtkRenderViewBase
69 {
70 public:
71  static vtkRenderView* New();
73  void PrintSelf(ostream& os, vtkIndent indent) override;
74 
80  void SetInteractor(vtkRenderWindowInteractor* interactor) override;
81 
86 
91 
97  void SetRenderWindow(vtkRenderWindow* win) override;
98 
99  enum
100  {
103  INTERACTION_MODE_UNKNOWN
104  };
105 
107  vtkGetMacro(InteractionMode, int);
108 
114  virtual void SetInteractionModeTo2D() { this->SetInteractionMode(INTERACTION_MODE_2D); }
115  virtual void SetInteractionModeTo3D() { this->SetInteractionMode(INTERACTION_MODE_3D); }
116 
121  void Render() override;
122 
126  void ApplyViewTheme(vtkViewTheme* theme) override;
127 
129 
133  virtual void SetTransform(vtkAbstractTransform* transform);
134  vtkGetObjectMacro(Transform, vtkAbstractTransform);
136 
138 
141  virtual void SetDisplayHoverText(bool b);
142  vtkGetMacro(DisplayHoverText, bool);
143  vtkBooleanMacro(DisplayHoverText, bool);
145 
146  enum
147  {
148  SURFACE = 0,
149  FRUSTUM = 1
150  };
151 
153 
160  vtkSetClampMacro(SelectionMode, int, 0, 1);
161  vtkGetMacro(SelectionMode, int);
162  void SetSelectionModeToSurface() { this->SetSelectionMode(SURFACE); }
163  void SetSelectionModeToFrustum() { this->SetSelectionMode(FRUSTUM); }
165 
171  virtual void AddLabels(vtkAlgorithmOutput* conn);
172 
176  virtual void RemoveLabels(vtkAlgorithmOutput* conn);
177 
179 
182  virtual void SetIconTexture(vtkTexture* texture);
183  vtkGetObjectMacro(IconTexture, vtkTexture);
185 
187 
190  vtkSetVector2Macro(IconSize, int);
191  vtkGetVector2Macro(IconSize, int);
193 
195 
199  vtkSetVector2Macro(DisplaySize, int);
201  void GetDisplaySize(int& dsx, int& dsy);
203 
204  enum
205  {
207  ALL
208  };
209 
211 
218  virtual void SetLabelPlacementMode(int mode);
219  virtual int GetLabelPlacementMode();
220  virtual void SetLabelPlacementModeToNoOverlap() { this->SetLabelPlacementMode(NO_OVERLAP); }
221  virtual void SetLabelPlacementModeToAll() { this->SetLabelPlacementMode(ALL); }
223 
224  enum
225  {
227  QT
228  };
229 
231 
236  virtual void SetLabelRenderMode(int mode);
237  virtual int GetLabelRenderMode();
238  virtual void SetLabelRenderModeToFreetype() { this->SetLabelRenderMode(FREETYPE); }
239  virtual void SetLabelRenderModeToQt() { this->SetLabelRenderMode(QT); }
241 
243 
246  void SetRenderOnMouseMove(bool b);
247  vtkGetMacro(RenderOnMouseMove, bool);
248  vtkBooleanMacro(RenderOnMouseMove, bool);
250 
251 protected:
253  ~vtkRenderView() override;
254 
260  void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData) override;
261 
265  virtual void GenerateSelection(void* callData, vtkSelection* selection);
266 
270  void PrepareForRendering() override;
271 
275  virtual void UpdateHoverText();
276 
281  virtual void UpdateHoverWidgetState();
282 
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 VTK_ABI_NAMESPACE_END
318 #endif
superclass for all geometric transformations
a actor that draws 2D data
Definition: vtkActor2D.h:145
Proxy object to connect input/output ports.
perform mathematical operations on data in field data arrays
represent the vtkBalloonWidget
draw text labels at 2D dataset points
invoke a vtkTimerEvent when hovering
a simple class to control print indentation
Definition: vtkIndent.h:108
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor
Places and renders non-overlapping labels.
abstract base class for most VTK objects
Definition: vtkObject.h:162
draw vtkPolyData onto the image plane
A base view containing a renderer.
A view containing a renderer.
Definition: vtkRenderView.h:69
vtkTexture * IconTexture
virtual void SetInteractionModeTo3D()
virtual void SetLabelRenderModeToFreetype()
Label render mode.
virtual void UpdateHoverWidgetState()
Enable or disable hovering based on DisplayHoverText ivar and interaction state.
vtkSmartPointer< vtkHoverWidget > HoverWidget
bool InHoverTextRender
void PrepareForRendering() override
Called by the view when the renderer is about to render.
void ApplyViewTheme(vtkViewTheme *theme) override
Applies a view theme to this view.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSmartPointer< vtkTexturedActor2D > LabelActor
void ProcessEvents(vtkObject *caller, unsigned long eventId, void *callData) override
Called to process events.
virtual void GenerateSelection(void *callData, vtkSelection *selection)
Generates the selection based on the view event and the selection mode.
virtual void SetInteractionModeTo2D()
Set the interaction mode for the view.
void Render() override
Updates the representations, then calls Render() on the render window associated with this view.
virtual void SetDisplayHoverText(bool b)
Whether the view should display hover text.
virtual void SetTransform(vtkAbstractTransform *transform)
Set the view's transform.
virtual void SetLabelRenderMode(int mode)
Label render mode.
virtual void SetLabelPlacementModeToAll()
Label placement mode.
virtual int GetLabelPlacementMode()
Label placement mode.
virtual vtkInteractorObserver * GetInteractorStyle()
Get the interactor style associated with the render view.
virtual int GetLabelRenderMode()
Label render mode.
void SetSelectionModeToSurface()
Sets the selection mode for the render view.
virtual void SetLabelRenderModeToQt()
Label render mode.
void SetInteractor(vtkRenderWindowInteractor *interactor) override
The render window interactor.
bool PickRenderNeedsUpdate
static vtkRenderView * New()
void SetInteractionMode(int mode)
~vtkRenderView() override
virtual void SetIconTexture(vtkTexture *texture)
Set the icon sheet to use for rendering icons.
vtkSmartPointer< vtkRenderer > LabelRenderer
void UpdatePickRender()
Update the pick render for queries for drag selections or hover ballooons.
void SetRenderWindow(vtkRenderWindow *win) override
Set the render window for this view.
vtkSmartPointer< vtkBalloonRepresentation > Balloon
void SetSelectionModeToFrustum()
Sets the selection mode for the render view.
virtual void AddLabels(vtkAlgorithmOutput *conn)
Add labels from an input connection with an associated text property.
vtkSmartPointer< vtkLabelPlacementMapper > LabelPlacementMapper
bool RenderOnMouseMove
void GetDisplaySize(int &dsx, int &dsy)
Set the display size of the icon (which may be different from the icon size).
int * GetDisplaySize()
Set the display size of the icon (which may be different from the icon size).
virtual void SetLabelPlacementMode(int mode)
Label placement mode.
vtkSmartPointer< vtkHardwareSelector > Selector
vtkAbstractTransform * Transform
void SetRenderOnMouseMove(bool b)
Whether to render on every mouse move.
virtual void RemoveLabels(vtkAlgorithmOutput *conn)
Remove labels from an input connection.
virtual void UpdateHoverText()
Called in PrepareForRendering to update the hover text.
virtual void SetLabelPlacementModeToNoOverlap()
Label placement mode.
virtual void SetInteractorStyle(vtkInteractorObserver *style)
The interactor style associated with the render view.
platform-independent render window interaction including picking and frame rate control.
create a window for renderers to draw into
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:159
represent text properties.
handles properties associated with a texture map
Definition: vtkTexture.h:167
actor that draws 2D data with texture support
transform points into different coordinate systems
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:123
@ Transform
Definition: vtkX3D.h:41
@ mode
Definition: vtkX3D.h:247
@ style
Definition: vtkX3D.h:492