19 #ifndef __vtkPythonUtil_h
20 #define __vtkPythonUtil_h
22 #include "vtkPython.h"
23 #include "PyVTKClass.h"
24 #include "PyVTKMutableObject.h"
25 #include "PyVTKObject.h"
26 #include "PyVTKSpecialObject.h"
28 class vtkPythonClassMap;
30 class vtkPythonCommandList;
31 class vtkPythonGhostMap;
32 class vtkPythonObjectMap;
33 class vtkPythonSpecialTypeMap;
46 static const char *PythonicClassName(
const char *classname);
50 static void AddClassToMap(
PyObject *
obj,
const char *classname);
53 static PyObject *FindClass(
const char *classname);
66 const char *classname);
78 static void *SIPGetPointerFromObject(
PyObject *obj,
const char *classname);
83 static PyObject *SIPGetObjectFromPointer(
84 const void *ptr,
const char* classname,
bool is_new);
98 static void RemoveObjectFromMap(
PyObject *obj);
103 static PyVTKSpecialType *AddSpecialTypeToMap(
104 PyTypeObject *pytype, PyMethodDef *methods, PyMethodDef *constructors,
105 const char *docstring[], PyVTKSpecialCopyFunc copyfunc);
109 static PyVTKSpecialType *FindSpecialType(
const char *classname);
119 static void *GetPointerFromSpecialObject(
125 static PyObject *BuildDocString(
const char *docstring[]);
128 static char *ManglePointer(
const void *ptr,
const char *type);
131 static void *UnmanglePointer(
char *ptrText,
int *
len,
const char *type);
134 static long VariantHash(
const vtkVariant *variant);
152 vtkPythonObjectMap *ObjectMap;
153 vtkPythonGhostMap *GhostMap;
154 vtkPythonClassMap *ClassMap;
155 vtkPythonSpecialTypeMap *SpecialTypeMap;
156 vtkPythonCommandList *PythonCommandList;
159 friend void vtkPythonUtilCreateIfNeeded();
170 #if PY_VERSION_HEX >= 0x02060000 // for tp_version_tag
171 #define VTK_PYTHON_UTIL_SUPRESS_UNINITIALIZED \
172 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0, 0,
173 #define VTK_WRAP_PYTHON_SUPRESS_UNINITIALIZED \
175 #elif PY_VERSION_HEX >= 0x02030000
176 #define VTK_PYTHON_UTIL_SUPRESS_UNINITIALIZED \
177 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,
178 #define VTK_WRAP_PYTHON_SUPRESS_UNINITIALIZED \
180 #elif PY_VERSION_HEX >= 0x02020000
181 #define VTK_PYTHON_UTIL_SUPRESS_UNINITIALIZED \
182 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0,
183 #define VTK_WRAP_PYTHON_SUPRESS_UNINITIALIZED
185 #define VTK_PYTHON_UTIL_SUPRESS_UNINITIALIZED
186 #define VTK_WRAP_PYTHON_SUPRESS_UNINITIALIZED
189 #if PY_VERSION_HEX < 0x02050000
Wrapper around std::string to keep symbols short.
GLuint GLuint GLsizei GLenum type
GLsizei GLsizei GLuint * obj
void vtkPythonUtilDelete()
A atomic type representing the union of many types.
VTKWRAPPINGPYTHONCORE_EXPORT void vtkPythonVoidFuncArgDelete(void *)
#define VTKWRAPPINGPYTHONCORE_EXPORT
abstract base class for most VTK objects
VTKWRAPPINGPYTHONCORE_EXPORT void vtkPythonVoidFunc(void *)
String class that stores Unicode text.