VTK  9.2.5
vtkPythonArchiver.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkArchiver.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm 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 =========================================================================*/
40 #ifndef vtkPythonArchiver_h
41 #define vtkPythonArchiver_h
42 #if !defined(__VTK_WRAP__) || defined(__VTK_WRAP_HIERARCHY__) || defined(__VTK_WRAP_PYTHON__)
43 
44 #include "vtkPython.h" // Must be first
45 
46 #include "vtkArchiver.h"
47 #include "vtkCommonPythonModule.h" // For export macro
48 
49 class vtkSmartPyObject;
50 
51 class VTKCOMMONPYTHON_EXPORT vtkPythonArchiver : public vtkArchiver
52 {
53 public:
56  void PrintSelf(ostream& os, vtkIndent indent) override;
57 
63 
65 
68  void OpenArchive() override;
70 
72 
75  void CloseArchive() override;
77 
79 
83  const std::string& relativePath, const char* data, std::size_t size) override;
85 
87 
90  bool Contains(const std::string& relativePath) override;
92 
93 protected:
95  ~vtkPythonArchiver() override;
96 
97 private:
98  vtkPythonArchiver(const vtkPythonArchiver&) = delete;
99  void operator=(const vtkPythonArchiver&) = delete;
100 
101  int CheckResult(const char* method, const vtkSmartPyObject& res);
102 
103  PyObject* Object;
104 };
105 
106 #endif
107 #endif
Writes an archive.
Definition: vtkArchiver.h:40
a simple class to control print indentation
Definition: vtkIndent.h:119
A version of vtkArchiver that can be implemented in Python.
static vtkPythonArchiver * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool Contains(const std::string &relativePath) override
Checks if relativePath represents an entry in the archive.
void InsertIntoArchive(const std::string &relativePath, const char *data, std::size_t size) override
Insert data of size size into the archive at relativePath.
~vtkPythonArchiver() override
void SetPythonObject(PyObject *obj)
Specify the Python object to use to perform the archiving.
void OpenArchive() override
Open the archive for writing.
void CloseArchive() override
Close the archive.
@ size
Definition: vtkX3D.h:259
@ data
Definition: vtkX3D.h:321
@ string
Definition: vtkX3D.h:496
struct _object PyObject