vtkPythonView.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkPythonView.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 vtkPythonView_h
23 #define vtkPythonView_h
24 
25 #include "vtkPVView.h"
26 
27 #include "vtkImageData.h" // needed for member variable
28 #include "vtkRemotingViewsPythonModule.h" //needed for exports
29 #include "vtkSmartPointer.h" //needed for member variables
30 
31 class vtkImageData;
34 class vtkRenderer;
35 class vtkRenderWindow;
36 class vtkTexture;
37 
39 {
40 public:
41  static vtkPythonView* New();
42  vtkTypeMacro(vtkPythonView, vtkPVView);
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
48  static vtkInformationRequestKey* REQUEST_DELIVER_DATA_TO_CLIENT();
49 
54  void Update() override;
55 
59  virtual vtkRenderer* GetRenderer();
60 
61  // Sets the renderer for this view.
62  virtual void SetRenderer(vtkRenderer* ren);
63 
65 
68  vtkSetStringMacro(Script);
69  vtkGetStringMacro(Script);
71 
73 
76  vtkSetVector2Macro(Magnification, int);
77  vtkGetVector2Macro(Magnification, int);
79 
83  int GetNumberOfVisibleDataObjects();
84 
88  vtkPythonRepresentation* GetVisibleRepresentation(int visibleObjectIndex);
89 
100  vtkDataObject* GetVisibleDataObjectForSetup(int visibleObjectIndex);
101 
110  vtkDataObject* GetVisibleDataObjectForRendering(int visibleObjectIndex);
111 
117  int GetNumberOfAttributeArrays(int visibleObjectIndex, int attributeType);
118 
123  const char* GetAttributeArrayName(int visibleObjectIndex, int attributeType, int arrayIndex);
124 
132  void SetAttributeArrayStatus(
133  int visibleObjectIndex, int attributeType, const char* name, int status);
134 
140  int GetAttributeArrayStatus(int visibleObjectIndex, int attributeType, const char* name);
141 
145  void EnableAllAttributeArrays();
146 
150  void DisableAllAttributeArrays();
151 
152  void StillRender() override;
153 
154  void InteractiveRender() override;
155 
157 
162  vtkSetObjectMacro(ImageData, vtkImageData);
164 
165 protected:
166  vtkPythonView();
167  ~vtkPythonView() override;
168 
171 
172  // Needed to handle rendering at different magnifications
173  int Magnification[2];
174 
178  bool IsLocalDataAvailable();
179 
180 private:
181  vtkPythonView(const vtkPythonView&) = delete;
182  void operator=(const vtkPythonView&) = delete;
183 
184  class vtkInternals;
185  vtkInternals* Internals;
186 
187  // The Python script
188  char* Script;
189 
190  // The image data to be displayed in the view
191  vtkImageData* ImageData;
192 };
193 
194 #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:44
vtkPythonView is a view for displaying data via a Python script that uses matplotlib to generate a pl...
Definition: vtkPythonView.h:38
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