vtkPVContextView.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
10 #ifndef vtkPVContextView_h
11 #define vtkPVContextView_h
12 
13 #include "vtkNew.h" // needed for vtkNew.
14 #include "vtkPVView.h"
15 #include "vtkParaViewDeprecation.h" // for deprecation
16 #include "vtkRemotingViewsModule.h" //needed for exports
17 #include "vtkSmartPointer.h" // needed for vtkSmartPointer.
18 
20 class vtkChart;
22 class vtkCSVExporter;
24 class vtkContextView;
27 class vtkRenderWindow;
29 class vtkSelection;
30 
32 {
33 public:
34  vtkTypeMacro(vtkPVContextView, vtkPVView);
35  void PrintSelf(ostream& os, vtkIndent indent) override;
36 
41  void StillRender() override;
42 
48  void InteractiveRender() override;
49 
51 
54  vtkGetObjectMacro(ContextView, vtkContextView);
56 
60  virtual vtkAbstractContextItem* GetContextItem() = 0;
61 
63 
68  virtual void SetupInteractor(vtkRenderWindowInteractor*);
69  vtkRenderWindowInteractor* GetInteractor();
71 
79  virtual void SetSelection(vtkChartRepresentation* repr, vtkSelection* selection) = 0;
80 
87  vtkSelection* GetSelection();
88 
90 
96  virtual bool Export(vtkAbstractChartExporter* exporter);
98 
100 
106  vtkSetStringMacro(Title);
107  vtkGetStringMacro(Title);
109 
111 
117  virtual void SetTitleFont(const char* family, int pointSize, bool bold, bool italic) = 0;
118  virtual void SetTitleFontFamily(const char* family) = 0;
119  virtual void SetTitleFontSize(int pointSize) = 0;
120  virtual void SetTitleBold(bool bold) = 0;
121  virtual void SetTitleItalic(bool italic) = 0;
122  virtual void SetTitleFontFile(const char* file) = 0;
123  virtual const char* GetTitleFontFamily() = 0;
124  virtual int GetTitleFontSize() = 0;
125  virtual int GetTitleFontBold() = 0;
126  virtual int GetTitleFontItalic() = 0;
128 
130 
136  virtual void SetTitleColor(double red, double green, double blue) = 0;
137  virtual double* GetTitleColor() = 0;
139 
141 
147  virtual void SetTitleAlignment(int alignment) = 0;
148  virtual int GetTitleAlignment() = 0;
149 
150 protected:
152  ~vtkPVContextView() override;
153 
157  virtual void Render(bool interactive);
158 
169  virtual bool MapSelectionToInput(vtkSelection*);
170 
175  virtual std::string GetFormattedTitle();
176 
178 
179 private:
180  vtkPVContextView(const vtkPVContextView&) = delete;
181  void operator=(const vtkPVContextView&) = delete;
182 
183  char* Title = nullptr;
184 
185  // Used in GetSelection to avoid modifying the selection obtained from the
186  // annotation link.
187  vtkSmartPointer<vtkSelection> SelectionClone;
188  vtkNew<vtkPVContextInteractorStyle> InteractorStyle;
189 
190  template <class T>
191  vtkSelection* GetSelectionImplementation(T* chart);
192 };
193 
194 #endif
#define VTKREMOTINGVIEWS_EXPORT
baseclass for all ParaView views.
Definition: vtkPVView.h:32
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.
exporter used by certain views to export data into a file or stream.
virtual void InteractiveRender()=0
Triggers a interactive render.