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 
183  virtual std::string GetFormattedTitle();
184 
186 
187 private:
188  vtkPVContextView(const vtkPVContextView&) = delete;
189  void operator=(const vtkPVContextView&) = delete;
190 
191  char* Title = nullptr;
192 
193  // Used in GetSelection to avoid modifying the selection obtained from the
194  // annotation link.
195  vtkSmartPointer<vtkSelection> SelectionClone;
196  vtkNew<vtkPVContextInteractorStyle> InteractorStyle;
197 
198  template <class T>
199  vtkSelection* GetSelectionImplementation(T* chart);
200 };
201 
202 #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.