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 -------------------------------------------------------------------------*/
39 #ifndef __vtkRenderView_h
40 #define __vtkRenderView_h
41 
42 #include "vtkRenderViewBase.h"
43 #include "vtkSmartPointer.h" // For SP ivars
44 
46 class vtkActor2D;
47 class vtkAlgorithmOutput;
48 class vtkArrayCalculator;
52 class vtkHoverWidget;
56 class vtkSelection;
57 class vtkTextProperty;
58 class vtkTexture;
59 class vtkTexturedActor2D;
61 
63 {
64 public:
65  static vtkRenderView* New();
67  void PrintSelf(ostream& os, vtkIndent indent);
68 
72  virtual void SetInteractor(vtkRenderWindowInteractor *interactor);
73 
75  virtual void SetInteractorStyle(vtkInteractorObserver* style);
76 
78  virtual vtkInteractorObserver* GetInteractorStyle();
79 
83  virtual void SetRenderWindow(vtkRenderWindow *win);
84 
85  //BTX
86  enum
87  {
90  INTERACTION_MODE_UNKNOWN
91  };
92  //ETX
93  void SetInteractionMode(int mode);
94  vtkGetMacro(InteractionMode, int);
95 
97 
100  virtual void SetInteractionModeTo2D()
101  { this->SetInteractionMode(INTERACTION_MODE_2D); }
102  virtual void SetInteractionModeTo3D()
103  { this->SetInteractionMode(INTERACTION_MODE_3D); }
105 
108  virtual void Render();
109 
111  virtual void ApplyViewTheme(vtkViewTheme* theme);
112 
114 
116  virtual void SetTransform(vtkAbstractTransform* transform);
117  vtkGetObjectMacro(Transform, vtkAbstractTransform);
119 
121 
122  virtual void SetDisplayHoverText(bool b);
123  vtkGetMacro(DisplayHoverText, bool);
124  vtkBooleanMacro(DisplayHoverText, bool);
126 
127  //BTX
128  enum {
129  SURFACE = 0,
130  FRUSTUM = 1
131  };
132  //ETX
133 
135 
139  vtkSetClampMacro(SelectionMode, int, 0, 1);
140  vtkGetMacro(SelectionMode, int);
141  void SetSelectionModeToSurface() { this->SetSelectionMode(SURFACE); }
142  void SetSelectionModeToFrustum() { this->SetSelectionMode(FRUSTUM); }
144 
148  virtual void AddLabels(vtkAlgorithmOutput* conn);
149 
151  virtual void RemoveLabels(vtkAlgorithmOutput* conn);
152 
154 
155  virtual void SetIconTexture(vtkTexture* texture);
156  vtkGetObjectMacro(IconTexture, vtkTexture);
158 
160 
161  vtkSetVector2Macro(IconSize, int);
162  vtkGetVector2Macro(IconSize, int);
164 
166 
169  vtkSetVector2Macro(DisplaySize, int);
170  int* GetDisplaySize();
171  void GetDisplaySize(int &dsx, int &dsy);
173 
174  //BTX
175  enum
176  {
178  ALL
179  };
180  //ETX
181 
183 
187  virtual void SetLabelPlacementMode(int mode);
188  virtual int GetLabelPlacementMode();
190  { this->SetLabelPlacementMode(NO_OVERLAP); }
192  { this->SetLabelPlacementMode(ALL); }
194 
195  //BTX
196  enum
197  {
199  QT
200  };
201  //ETX
202 
204 
206  virtual void SetLabelRenderMode(int mode);
207  virtual int GetLabelRenderMode();
209  { this->SetLabelRenderMode(FREETYPE); }
210  virtual void SetLabelRenderModeToQt()
211  { this->SetLabelRenderMode(QT); }
213 
215 
216  void SetRenderOnMouseMove(bool b);
217  vtkGetMacro(RenderOnMouseMove, bool);
218  vtkBooleanMacro(RenderOnMouseMove, bool);
219 protected:
220  vtkRenderView();
221  ~vtkRenderView();
223 
225 
228  virtual void ProcessEvents(vtkObject* caller, unsigned long eventId,
229  void* callData);
231 
233 
235  virtual void GenerateSelection(
236  void* callData, vtkSelection* selection);
238 
240  virtual void PrepareForRendering();
241 
243  virtual void UpdateHoverText();
244 
247  virtual void UpdateHoverWidgetState();
248 
251  void UpdatePickRender();
252 
260 
263  int IconSize[2];
264  int DisplaySize[2];
265 
268 
269  //BTX
276  //ETX
277 
278 private:
279  vtkRenderView(const vtkRenderView&); // Not implemented.
280  void operator=(const vtkRenderView&); // Not implemented.
281 };
282 
283 #endif
virtual void ApplyViewTheme(vtkViewTheme *vtkNotUsed(theme))
Definition: vtkView.h:124
abstract base class for most VTK objects
Definition: vtkObject.h:60
actor that draws 2D data with texture support
void SetSelectionModeToFrustum()
virtual void Render()
perform mathematical operations on data in field data arrays
virtual void SetRenderWindow(vtkRenderWindow *win)
a actor that draws 2D data
Definition: vtkActor2D.h:43
vtkSmartPointer< vtkBalloonRepresentation > Balloon
draw text labels at 2D dataset points
A node in a selection tree. Used to store selection results.
Definition: vtkSelection.h:43
virtual void SetLabelPlacementModeToAll()
virtual void SetInteractionModeTo2D()
A base view containing a renderer.
#define VTK_VIEWS_EXPORT
virtual void SetInteractor(vtkRenderWindowInteractor *)
Proxy object to connect input/output ports.
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor ...
void SetSelectionModeToSurface()
platform-independent render window interaction including picking and frame rate control.
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:46
virtual void ProcessEvents(vtkObject *caller, unsigned long eventId, void *callData)
vtkAbstractTransform * Transform
vtkSmartPointer< vtkLabelPlacementMapper > LabelPlacementMapper
a simple class to control print indentation
Definition: vtkIndent.h:37
superclass for all geometric transformations
virtual void SetLabelPlacementModeToNoOverlap()
handles properties associated with a texture map
Definition: vtkTexture.h:68
vtkSmartPointer< vtkHoverWidget > HoverWidget
virtual void SetLabelRenderModeToFreetype()
virtual void SetLabelRenderModeToQt()
void PrintSelf(ostream &os, vtkIndent indent)
bool InHoverTextRender
bool PickRenderNeedsUpdate
virtual void PrepareForRendering()
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:62
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