vtkPythonView.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
10 #ifndef vtkPythonView_h
11 #define vtkPythonView_h
12 
13 #include "vtkPVView.h"
14 
15 #include "vtkImageData.h" // needed for member variable
16 #include "vtkRemotingViewsPythonModule.h" //needed for exports
17 #include "vtkSmartPointer.h" //needed for member variables
18 
19 class vtkImageData;
22 class vtkRenderer;
23 class vtkRenderWindow;
24 class vtkTexture;
25 
27 {
28 public:
29  static vtkPythonView* New();
30  vtkTypeMacro(vtkPythonView, vtkPVView);
31  void PrintSelf(ostream& os, vtkIndent indent) override;
32 
36  static vtkInformationRequestKey* REQUEST_DELIVER_DATA_TO_CLIENT();
37 
42  void Update() override;
43 
47  virtual vtkRenderer* GetRenderer();
48 
49  // Sets the renderer for this view.
50  virtual void SetRenderer(vtkRenderer* ren);
51 
53 
56  vtkSetStringMacro(Script);
57  vtkGetStringMacro(Script);
59 
61 
64  vtkSetVector2Macro(Magnification, int);
65  vtkGetVector2Macro(Magnification, int);
67 
71  int GetNumberOfVisibleDataObjects();
72 
76  vtkPythonRepresentation* GetVisibleRepresentation(int visibleObjectIndex);
77 
88  vtkDataObject* GetVisibleDataObjectForSetup(int visibleObjectIndex);
89 
98  vtkDataObject* GetVisibleDataObjectForRendering(int visibleObjectIndex);
99 
105  int GetNumberOfAttributeArrays(int visibleObjectIndex, int attributeType);
106 
111  const char* GetAttributeArrayName(int visibleObjectIndex, int attributeType, int arrayIndex);
112 
120  void SetAttributeArrayStatus(
121  int visibleObjectIndex, int attributeType, const char* name, int status);
122 
128  int GetAttributeArrayStatus(int visibleObjectIndex, int attributeType, const char* name);
129 
133  void EnableAllAttributeArrays();
134 
138  void DisableAllAttributeArrays();
139 
140  void StillRender() override;
141 
142  void InteractiveRender() override;
143 
145 
150  vtkSetObjectMacro(ImageData, vtkImageData);
152 
153 protected:
154  vtkPythonView();
155  ~vtkPythonView() override;
156 
159 
160  // Needed to handle rendering at different magnifications
161  int Magnification[2];
162 
166  bool IsLocalDataAvailable();
167 
168 private:
169  vtkPythonView(const vtkPythonView&) = delete;
170  void operator=(const vtkPythonView&) = delete;
171 
172  class vtkInternals;
173  vtkInternals* Internals;
174 
175  // The Python script
176  char* Script;
177 
178  // The image data to be displayed in the view
179  vtkImageData* ImageData;
180 };
181 
182 #endif
static vtkView * New()
vtkSmartPointer< vtkRenderer > Renderer
Script
Representation for showing data in a vtkPythonView.
void Update() override
Overridden to not call Update() directly on the input representations, instead use ProcessViewRequest...
baseclass for all ParaView views.
Definition: vtkPVView.h:32
vtkPythonView is a view for displaying data via a Python script that uses matplotlib to generate a pl...
Definition: vtkPythonView.h:26
vtkSmartPointer< vtkTexture > RenderTexture
void PrintSelf(ostream &os, vtkIndent indent) override
virtual void StillRender()=0
Triggers a high-resolution render.
virtual void InteractiveRender()=0
Triggers a interactive render.
#define VTKREMOTINGVIEWSPYTHON_EXPORT