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 "vtkPVView.h"
27 #include "vtkRemotingViewsModule.h" //needed for exports
28 #include "vtkSmartPointer.h" // needed for vtkSmartPointer.
29 
31 class vtkChart;
34 class vtkContextView;
35 class vtkCSVExporter;
37 class vtkRenderWindow;
39 class vtkSelection;
40 
42 {
43 public:
44  vtkTypeMacro(vtkPVContextView, vtkPVView);
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
51  void StillRender() override;
52 
58  void InteractiveRender() override;
59 
61 
64  vtkGetObjectMacro(ContextView, vtkContextView);
66 
70  virtual vtkAbstractContextItem* GetContextItem() = 0;
71 
73 
78  virtual void SetupInteractor(vtkRenderWindowInteractor*);
79  vtkRenderWindowInteractor* GetInteractor();
81 
89  virtual void SetSelection(vtkChartRepresentation* repr, vtkSelection* selection) = 0;
90 
97  vtkSelection* GetSelection();
98 
105  virtual bool Export(vtkCSVExporter* exporter);
106 
108 
114  vtkSetStringMacro(Title);
115  vtkGetStringMacro(Title);
117 
119 
125  virtual void SetTitleFont(const char* family, int pointSize, bool bold, bool italic) = 0;
126  virtual void SetTitleFontFamily(const char* family) = 0;
127  virtual void SetTitleFontSize(int pointSize) = 0;
128  virtual void SetTitleBold(bool bold) = 0;
129  virtual void SetTitleItalic(bool italic) = 0;
130  virtual void SetTitleFontFile(const char* file) = 0;
131  virtual const char* GetTitleFontFamily() = 0;
132  virtual int GetTitleFontSize() = 0;
133  virtual int GetTitleFontBold() = 0;
134  virtual int GetTitleFontItalic() = 0;
136 
138 
144  virtual void SetTitleColor(double red, double green, double blue) = 0;
145  virtual double* GetTitleColor() = 0;
147 
149 
155  virtual void SetTitleAlignment(int alignment) = 0;
156  virtual int GetTitleAlignment() = 0;
157 
158 protected:
160  ~vtkPVContextView() override;
161 
165  virtual void Render(bool interactive);
166 
177  virtual bool MapSelectionToInput(vtkSelection*);
178 
184  virtual std::string GetFormattedTitle();
185 
187 
188 private:
189  vtkPVContextView(const vtkPVContextView&) = delete;
190  void operator=(const vtkPVContextView&) = delete;
191 
192  char* Title = nullptr;
193 
194  // Used in GetSelection to avoid modifying the selection obtained from the
195  // annotation link.
196  vtkSmartPointer<vtkSelection> SelectionClone;
197  vtkNew<vtkPVContextInteractorStyle> InteractorStyle;
198 
199  template <class T>
200  vtkSelection* GetSelectionImplementation(T* chart);
201 };
202 
203 #endif
#define VTKREMOTINGVIEWS_EXPORT
baseclass for all ParaView views.
Definition: vtkPVView.h:44
vtkContextView * ContextView
Get/Set the alignement of the title.
vtkPVContextView adopts vtkContextView so that it can be used in ParaView configurations.
vtkChartRepresentation is the base representation for charting representations.
exporter used by certain views to export data as CSV.
extends vtkContextInteractorStyle to fire start/end interaction events.
void PrintSelf(ostream &os, vtkIndent indent) override
virtual void StillRender()=0
Triggers a high-resolution render.
virtual void InteractiveRender()=0
Triggers a interactive render.