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 "vtkRemotingViewsModule.h" //needed for exports
16 #include "vtkSmartPointer.h" // needed for vtkSmartPointer.
17 
19 class vtkChart;
22 class vtkContextView;
25 class vtkRenderWindow;
27 class vtkSelection;
28 
29 class VTKREMOTINGVIEWS_EXPORT vtkPVContextView : public vtkPVView
30 {
31 public:
32  vtkTypeMacro(vtkPVContextView, vtkPVView);
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
39  void StillRender() override;
40 
46  void InteractiveRender() override;
47 
49 
52  vtkGetObjectMacro(ContextView, vtkContextView);
54 
58  virtual vtkAbstractContextItem* GetContextItem() = 0;
59 
61 
66  virtual void SetupInteractor(vtkRenderWindowInteractor*);
67  vtkRenderWindowInteractor* GetInteractor();
69 
77  virtual void SetSelection(vtkChartRepresentation* repr, vtkSelection* selection) = 0;
78 
85  vtkSelection* GetSelection();
86 
93  virtual bool Export(vtkAbstractChartExporter* exporter);
94 
96 
102  vtkSetStringMacro(Title);
103  vtkGetStringMacro(Title);
105 
107 
113  virtual void SetTitleFont(const char* family, int pointSize, bool bold, bool italic) = 0;
114  virtual void SetTitleFontFamily(const char* family) = 0;
115  virtual void SetTitleFontSize(int pointSize) = 0;
116  virtual void SetTitleBold(bool bold) = 0;
117  virtual void SetTitleItalic(bool italic) = 0;
118  virtual void SetTitleFontFile(const char* file) = 0;
119  virtual const char* GetTitleFontFamily() = 0;
120  virtual int GetTitleFontSize() = 0;
121  virtual int GetTitleFontBold() = 0;
122  virtual int GetTitleFontItalic() = 0;
124 
126 
132  virtual void SetTitleColor(double red, double green, double blue) = 0;
133  virtual double* GetTitleColor() = 0;
135 
137 
143  virtual void SetTitleAlignment(int alignment) = 0;
144  virtual int GetTitleAlignment() = 0;
145 
146 protected:
148  ~vtkPVContextView() override;
149 
153  virtual void Render(bool interactive);
154 
165  virtual bool MapSelectionToInput(vtkSelection*);
166 
171  virtual std::string GetFormattedTitle();
172 
174 
175 private:
176  vtkPVContextView(const vtkPVContextView&) = delete;
177  void operator=(const vtkPVContextView&) = delete;
178 
179  char* Title = nullptr;
180 
181  // Used in GetSelection to avoid modifying the selection obtained from the
182  // annotation link.
183  vtkSmartPointer<vtkSelection> SelectionClone;
184  vtkNew<vtkPVContextInteractorStyle> InteractorStyle;
185 
186  template <class T>
187  vtkSelection* GetSelectionImplementation(T* chart);
188 };
189 
190 #endif
vtkChart
vtkPVView::InteractiveRender
virtual void InteractiveRender()=0
Triggers a interactive render.
vtkAbstractContextItem
vtkPVView::StillRender
virtual void StillRender()=0
Triggers a high-resolution render.
vtkSmartPointer< vtkSelection >
vtkAbstractChartExporter
exporter used by certain views to export data into a file or stream.
Definition: vtkAbstractChartExporter.h:23
vtkPVContextView
Definition: vtkPVContextView.h:29
vtkPVContextView::ContextView
vtkContextView * ContextView
Get/Set the alignement of the title.
Definition: vtkPVContextView.h:173
vtkSelection
vtkPVView
baseclass for all ParaView views.
Definition: vtkPVView.h:32
vtkContextView
vtkInformationIntegerKey
vtkPVContextInteractorStyle
extends vtkContextInteractorStyle to fire start/end interaction events.
Definition: vtkPVContextInteractorStyle.h:18
vtkIndent
vtkSmartPointer.h
vtkNew< vtkPVContextInteractorStyle >
vtkRenderWindowInteractor
vtkNew.h
vtkPVView.h
vtkRenderWindow
vtkChartRepresentation
Definition: vtkChartRepresentation.h:33
vtkPVView::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override