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);
97 
98  PARAVIEW_DEPRECATED_IN_5_12_0("Use Export(vtkAbstractChartExporter* exporter) instead")
99  virtual bool Export(vtkCSVExporter* exporter);
101 
103 
109  vtkSetStringMacro(Title);
110  vtkGetStringMacro(Title);
112 
114 
120  virtual void SetTitleFont(const char* family, int pointSize, bool bold, bool italic) = 0;
121  virtual void SetTitleFontFamily(const char* family) = 0;
122  virtual void SetTitleFontSize(int pointSize) = 0;
123  virtual void SetTitleBold(bool bold) = 0;
124  virtual void SetTitleItalic(bool italic) = 0;
125  virtual void SetTitleFontFile(const char* file) = 0;
126  virtual const char* GetTitleFontFamily() = 0;
127  virtual int GetTitleFontSize() = 0;
128  virtual int GetTitleFontBold() = 0;
129  virtual int GetTitleFontItalic() = 0;
131 
133 
139  virtual void SetTitleColor(double red, double green, double blue) = 0;
140  virtual double* GetTitleColor() = 0;
142 
144 
150  virtual void SetTitleAlignment(int alignment) = 0;
151  virtual int GetTitleAlignment() = 0;
152 
153 protected:
155  ~vtkPVContextView() override;
156 
160  virtual void Render(bool interactive);
161 
172  virtual bool MapSelectionToInput(vtkSelection*);
173 
178  virtual std::string GetFormattedTitle();
179 
180  vtkContextView* ContextView;
181 
182 private:
183  vtkPVContextView(const vtkPVContextView&) = delete;
184  void operator=(const vtkPVContextView&) = delete;
185 
186  char* Title = nullptr;
187 
188  // Used in GetSelection to avoid modifying the selection obtained from the
189  // annotation link.
190  vtkSmartPointer<vtkSelection> SelectionClone;
191  vtkNew<vtkPVContextInteractorStyle> InteractorStyle;
192 
193  template <class T>
194  vtkSelection* GetSelectionImplementation(T* chart);
195 };
196 
197 #endif
#define PARAVIEW_DEPRECATED_IN_5_12_0(reason)
#define VTKREMOTINGVIEWS_EXPORT
baseclass for all ParaView views.
Definition: vtkPVView.h:32
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.
#define const
Definition: zconf.h:238
exporter used by certain views to export data into a file or stream.
virtual void InteractiveRender()=0
Triggers a interactive render.