ParaView
vtkPVContextView.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkPVContextView.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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 =========================================================================*/
22 #ifndef vtkPVContextView_h
23 #define vtkPVContextView_h
24 
25 #include "vtkNew.h" // needed for vtkNew.
26 #include "vtkPVClientServerCoreRenderingModule.h" //needed for exports
27 #include "vtkPVView.h"
28 #include "vtkSmartPointer.h" // needed for vtkSmartPointer.
29 
30 class vtkAbstractContextItem;
31 class vtkChart;
33 class vtkContextInteractorStyle;
34 class vtkContextView;
35 class vtkCSVExporter;
36 class vtkInformationIntegerKey;
37 class vtkRenderWindow;
38 class vtkRenderWindowInteractor;
39 class vtkSelection;
40 
41 class VTKPVCLIENTSERVERCORERENDERING_EXPORT vtkPVContextView : public vtkPVView
42 {
43 public:
44  vtkTypeMacro(vtkPVContextView, vtkPVView);
45  void PrintSelf(ostream& os, vtkIndent indent);
46 
51  virtual void StillRender();
52 
58  virtual void InteractiveRender();
59 
61 
64  vtkGetObjectMacro(ContextView, vtkContextView);
66 
70  virtual vtkAbstractContextItem* GetContextItem() = 0;
71 
73  vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
75 
77 
82  virtual void SetupInteractor(vtkRenderWindowInteractor*);
83  vtkRenderWindowInteractor* GetInteractor();
85 
91  virtual void Initialize(unsigned int id);
92 
97  virtual void Update();
98 
100 
104  vtkSetMacro(UseOffscreenRenderingForScreenshots, bool);
105  vtkBooleanMacro(UseOffscreenRenderingForScreenshots, bool);
106  vtkGetMacro(UseOffscreenRenderingForScreenshots, bool);
108 
110 
118  virtual void SetUseOffscreenRendering(bool);
119  vtkBooleanMacro(UseOffscreenRendering, bool);
120  vtkGetMacro(UseOffscreenRendering, bool);
122 
130  virtual void SetSelection(vtkChartRepresentation* repr, vtkSelection* selection) = 0;
131 
138  vtkSelection* GetSelection();
139 
146  virtual bool Export(vtkCSVExporter* exporter);
147 
148 protected:
150  ~vtkPVContextView();
151 
155  virtual void Render(bool interactive);
156 
167  virtual bool MapSelectionToInput(vtkSelection*);
168 
170 
176  void OnStartRender();
177  void OnEndRender();
179 
180  vtkContextView* ContextView;
181  vtkRenderWindow* RenderWindow;
182 
185 
186 private:
187  vtkPVContextView(const vtkPVContextView&) VTK_DELETE_FUNCTION;
188  void operator=(const vtkPVContextView&) VTK_DELETE_FUNCTION;
189 
190  // Used in GetSelection to avoid modifying the selection obtained from the
191  // annotation link.
192  vtkSmartPointer<vtkSelection> SelectionClone;
193  vtkNew<vtkContextInteractorStyle> InteractorStyle;
194 
195  template <class T>
196  vtkSelection* GetSelectionImplementation(T* chart);
197 };
198 
199 #endif
void PrintSelf(ostream &os, vtkIndent indent)
baseclass for all ParaView views.
Definition: vtkPVView.h:38
vtkContextView * ContextView
vtkPVContextView adopts vtkContextView so that it can be used in ParaView configurations.
virtual void Initialize(unsigned int id)
Initialize the view with an identifier.
vtkChartRepresentation is the base representation for charting representations.
bool UseOffscreenRenderingForScreenshots
exporter used by certain views to export data as a CSV file.
virtual void StillRender()=0
Triggers a high-resolution render.
virtual void Update()
Overridden to not call Update() directly on the input representations, instead use ProcessViewRequest...
virtual void InteractiveRender()=0
Triggers a interactive render.
vtkRenderWindow * RenderWindow