19 #ifndef vtkPythonUtil_h
20 #define vtkPythonUtil_h
22 #include "vtkPython.h"
23 #include "PyVTKClass.h"
24 #include "PyVTKMutableObject.h"
25 #include "PyVTKNamespace.h"
26 #include "PyVTKObject.h"
27 #include "PyVTKSpecialObject.h"
29 class vtkPythonClassMap;
31 class vtkPythonCommandList;
32 class vtkPythonGhostMap;
33 class vtkPythonObjectMap;
34 class vtkPythonSpecialTypeMap;
35 class vtkPythonNamespaceMap;
48 static const char *PythonicClassName(
const char *classname);
52 static void AddClassToMap(
PyObject *obj,
const char *classname);
55 static PyObject *FindClass(
const char *classname);
68 const char *classname);
80 static void *SIPGetPointerFromObject(
PyObject *obj,
const char *classname);
85 static PyObject *SIPGetObjectFromPointer(
86 const void *ptr,
const char* classname,
bool is_new);
100 static void RemoveObjectFromMap(
PyObject *obj);
105 static PyVTKSpecialType *AddSpecialTypeToMap(
106 PyTypeObject *pytype, PyMethodDef *methods, PyMethodDef *constructors,
107 const char *docstring[], PyVTKSpecialCopyFunc copyfunc);
111 static PyVTKSpecialType *FindSpecialType(
const char *classname);
121 static void *GetPointerFromSpecialObject(
127 static void AddNamespaceToMap(
PyObject *o);
131 static void RemoveNamespaceFromMap(
PyObject *o);
138 static PyObject *BuildDocString(
const char *docstring[]);
141 static char *ManglePointer(
const void *ptr,
const char *type);
144 static void *UnmanglePointer(
char *ptrText,
int *len,
const char *type);
147 static long VariantHash(
const vtkVariant *variant);
165 vtkPythonObjectMap *ObjectMap;
166 vtkPythonGhostMap *GhostMap;
167 vtkPythonClassMap *ClassMap;
168 vtkPythonSpecialTypeMap *SpecialTypeMap;
169 vtkPythonNamespaceMap *NamespaceMap;
170 vtkPythonCommandList *PythonCommandList;
173 friend void vtkPythonUtilCreateIfNeeded();
184 #if PY_VERSION_HEX >= 0x02060000 // for tp_version_tag
185 #define VTK_PYTHON_UTIL_SUPRESS_UNINITIALIZED \
186 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0, 0,
187 #define VTK_WRAP_PYTHON_SUPRESS_UNINITIALIZED \
189 #elif PY_VERSION_HEX >= 0x02030000
190 #define VTK_PYTHON_UTIL_SUPRESS_UNINITIALIZED \
191 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,
192 #define VTK_WRAP_PYTHON_SUPRESS_UNINITIALIZED \
194 #elif PY_VERSION_HEX >= 0x02020000
195 #define VTK_PYTHON_UTIL_SUPRESS_UNINITIALIZED \
196 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0,
197 #define VTK_WRAP_PYTHON_SUPRESS_UNINITIALIZED
199 #define VTK_PYTHON_UTIL_SUPRESS_UNINITIALIZED
200 #define VTK_WRAP_PYTHON_SUPRESS_UNINITIALIZED
203 #if PY_VERSION_HEX < 0x02050000
Wrapper around std::string to keep symbols short.
void vtkPythonUtilDelete()
A atomic type representing the union of many types.
VTKWRAPPINGPYTHONCORE_EXPORT void vtkPythonVoidFuncArgDelete(void *)
abstract base class for most VTK objects
VTKWRAPPINGPYTHONCORE_EXPORT void vtkPythonVoidFunc(void *)
String class that stores Unicode text.