VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkPythonArgs.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPythonArgs.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 =========================================================================*/
15 /*-----------------------------------------------------------------------
16 The vtkPythonArgs class was created in Oct 2010 by David Gobbi for.
17 
18 This class provides methods for reading an argument tuple from Python
19 and converting it to types that can be used by VTK. It is meant to be
20 more efficient and flexible that the original PyArg_ParseTuple() code,
21 resulting in wrapper code that is faster and more compact.
22 -----------------------------------------------------------------------*/
23 
27 #ifndef __vtkPythonArgs_h
28 #define __vtkPythonArgs_h
29 
30 #include "vtkWrappingPythonCoreModule.h" // For export macro
31 #include "vtkPythonUtil.h"
32 #include "PyVTKClass.h"
33 #include "PyVTKTemplate.h"
34 
35 #include "vtkConfigure.h"
36 #include "vtkUnicodeString.h"
37 
38 #include <string>
39 
41 {
42 public:
43 
45 
46  vtkPythonArgs(PyObject *self, PyObject *args, const char *methodname) :
47  Args(args), MethodName(methodname) {
48  this->N = PyTuple_GET_SIZE(args);
49  this->M = PyVTKClass_Check(self);
50  this->I = this->M;
51  }
53 
55 
56  vtkPythonArgs(PyObject *args, const char *methodname) :
57  Args(args), MethodName(methodname) {
58  this->N = PyTuple_GET_SIZE(args);
59  this->M = 0;
60  this->I = 0;
61  }
63 
65  void Reset() { this->I = this->M; }
66 
70  static vtkObjectBase *GetSelfPointer(PyObject *self, PyObject *args);
71 
74  static void *GetSelfPointer(PyObject *self);
75 
77  bool CheckArgCount(int nmin, int nmax);
78 
80  bool CheckArgCount(int n);
81 
83  bool IsBound() { return (this->M == 0); }
84 
86  bool IsPureVirtual();
87 
89  static bool ErrorOccurred();
90 
92  bool NoArgsLeft() { return (this->I >= this->N); }
93 
97  int GetArgSize(int i);
98 
100 
104  template<class T>
105  bool GetVTKObject(T *&v, const char *classname) {
106  bool b;
107  v = (T *)this->GetArgAsVTKObject(classname, b);
108  return b; }
109  template<class T>
110  bool GetVTKObject(PyObject *o, T *&v, const char *classname) {
111  bool b;
112  v = (T *)vtkPythonArgs::GetArgAsVTKObject(o, classname, b);
113  return b; }
115 
117 
120  template<class T>
121  bool GetSpecialObject(T *&v, PyObject *&o, const char *classname) {
122  v = static_cast<T *>(this->GetArgAsSpecialObject(classname, &o));
123  return (v != NULL); }
124  template<class T>
125  static bool GetSpecialObject(
126  PyObject *arg, T *&v, PyObject *&o, const char *classname) {
127  v = static_cast<T *>(
128  vtkPythonArgs::GetArgAsSpecialObject(arg, classname, &o));
129  return (v != NULL); }
131 
133 
135  template<class T>
136  bool GetSpecialObject(T *&v, const char *classname) {
137  v = static_cast<T *>(this->GetArgAsSpecialObject(classname, NULL));
138  return (v != NULL); }
139  template<class T>
140  static bool GetSpecialObject(PyObject *o, T *&v, const char *classname) {
141  v = static_cast<T *>(
142  vtkPythonArgs::GetArgAsSpecialObject(o, classname, NULL));
143  return (v != NULL); }
145 
147 
148  template<class T>
149  bool GetEnumValue(T &v, const char *enumname) {
150  bool r;
151  v = static_cast<T>(this->GetArgAsEnum(enumname, r));
152  return r; }
153  template<class T>
154  static bool GetEnumValue(PyObject *o, T &v, const char *enumname) {
155  bool r;
156  v = static_cast<T>(vtkPythonArgs::GetArgAsEnum(o, enumname, r));
157  return r; }
159 
161 
162  template<class T>
163  bool GetSIPObject(T *&v, const char *classname) {
164  bool r;
165  v = (T *)this->GetArgAsSIPObject(classname, r);
166  return r; }
167  template<class T>
168  static bool GetSIPObject(PyObject *o, T *&v, const char *classname) {
169  bool r;
170  v = (T *)vtkPythonArgs::GetArgAsSIPObject(o, classname, r);
171  return r; }
173 
175 
176  template<class T>
177  bool GetSIPEnumValue(T &v, const char *enumname) {
178  bool r;
179  v = static_cast<T>(this->GetArgAsSIPEnum(enumname, r));
180  return r; }
181  template<class T>
182  static bool GetSIPEnumValue(PyObject *o, T &v, const char *enumname) {
183  bool r;
184  v = static_cast<T>(vtkPythonArgs::GetArgAsSIPEnum(o, enumname, r));
185  return r; }
187 
189 
191  bool GetFunction(PyObject *&o);
192  static bool GetFunction(PyObject *arg, PyObject *&o);
194 
195  // Get the next arg as a void pointer (to a buffer object).
196  bool GetValue(void *&v);
197  static bool GetValue(PyObject *o, void *&v);
198  bool GetValue(const void *&v);
199  static bool GetValue(PyObject *o, const void *&v);
200 
202 
203  bool GetValue(const char *&v);
204  static bool GetValue(PyObject *o, const char *&v);
205  bool GetValue(char *&v);
206  static bool GetValue(PyObject *o, char *&v);
207  bool GetValue(std::string &v);
208  static bool GetValue(PyObject *o, std::string &v);
209  bool GetValue(vtkUnicodeString &v);
210  static bool GetValue(PyObject *o, vtkUnicodeString &v);
212 
214 
215  bool GetValue(char &v);
216  static bool GetValue(PyObject *o, char &v);
218 
220 
221  bool GetValue(float &v);
222  static bool GetValue(PyObject *o, float &v);
223  bool GetValue(double &v);
224  static bool GetValue(PyObject *o, double &v);
225  bool GetValue(bool &v);
226  static bool GetValue(PyObject *o, bool &v);
227  bool GetValue(signed char &v);
228  static bool GetValue(PyObject *o, signed char &v);
229  bool GetValue(unsigned char &v);
230  static bool GetValue(PyObject *o, unsigned char &v);
231  bool GetValue(short &v);
232  static bool GetValue(PyObject *o, short &v);
233  bool GetValue(unsigned short &v);
234  static bool GetValue(PyObject *o, unsigned short &v);
235  bool GetValue(int &v);
236  static bool GetValue(PyObject *o, int &v);
237  bool GetValue(unsigned int &v);
238  static bool GetValue(PyObject *o, unsigned int &v);
239  bool GetValue(long &v);
240  static bool GetValue(PyObject *o, long &v);
241  bool GetValue(unsigned long &v);
242  static bool GetValue(PyObject *o, unsigned long &v);
243 #ifdef VTK_TYPE_USE_LONG_LONG
244  bool GetValue(long long &v);
245  static bool GetValue(PyObject *o, long long &v);
246  bool GetValue(unsigned long long &v);
247  static bool GetValue(PyObject *o, unsigned long long &v);
248 #endif
249 #ifdef VTK_TYPE_USE___INT64
250  bool GetValue(__int64 &v);
251  static bool GetValue(PyObject *o, __int64 &v);
252  bool GetValue(unsigned __int64 &v);
253  static bool GetValue(PyObject *o, unsigned __int64 &v);
254 #endif
255 
256 
258 
259  bool GetArray(float *v, int n);
260  bool GetArray(double *v, int n);
261  bool GetArray(bool *v, int n);
262  bool GetArray(char *v, int n);
263  bool GetArray(signed char *v, int n);
264  bool GetArray(unsigned char *v, int n);
265  bool GetArray(short *v, int n);
266  bool GetArray(unsigned short *v, int n);
267  bool GetArray(int *v, int n);
268  bool GetArray(unsigned int *v, int n);
269  bool GetArray(long *v, int n);
270  bool GetArray(unsigned long *v, int n);
271 #ifdef VTK_TYPE_USE_LONG_LONG
272  bool GetArray(long long *v, int n);
273  bool GetArray(unsigned long long *v, int n);
274 #endif
275 #ifdef VTK_TYPE_USE___INT64
276  bool GetArray(__int64 *v, int n);
277  bool GetArray(unsigned __int64 *v, int n);
278 #endif
279 
280 
282 
283  bool GetNArray(float *v, int ndims, const int *dims);
284  bool GetNArray(double *v, int ndims, const int *dims);
285  bool GetNArray(bool *v, int ndims, const int *dims);
286  bool GetNArray(char *v, int ndims, const int *dims);
287  bool GetNArray(signed char *v, int ndims, const int *dims);
288  bool GetNArray(unsigned char *v, int ndims, const int *dims);
289  bool GetNArray(short *v, int ndims, const int *dims);
290  bool GetNArray(unsigned short *v, int ndims, const int *dims);
291  bool GetNArray(int *v, int ndims, const int *dims);
292  bool GetNArray(unsigned int *v, int ndims, const int *dims);
293  bool GetNArray(long *v, int ndims, const int *dims);
294  bool GetNArray(unsigned long *v, int ndims, const int *dims);
295 #ifdef VTK_TYPE_USE_LONG_LONG
296  bool GetNArray(long long *v, int ndims, const int *dims);
297  bool GetNArray(unsigned long long *v, int ndims, const int *dims);
298 #endif
299 #ifdef VTK_TYPE_USE___INT64
300  bool GetNArray(__int64 *v, int ndims, const int *dims);
301  bool GetNArray(unsigned __int64 *v, int ndims, const int *dims);
302 #endif
303 
304 
306 
307  bool SetArgValue(int i, const std::string &v);
308  bool SetArgValue(int i, const vtkUnicodeString &v);
309  bool SetArgValue(int i, char v);
310  bool SetArgValue(int i, float v);
311  bool SetArgValue(int i, double v);
312  bool SetArgValue(int i, bool v);
313  bool SetArgValue(int i, signed char v);
314  bool SetArgValue(int i, unsigned char v);
315  bool SetArgValue(int i, short v);
316  bool SetArgValue(int i, unsigned short v);
317  bool SetArgValue(int i, int v);
318  bool SetArgValue(int i, unsigned int v);
319  bool SetArgValue(int i, long v);
320  bool SetArgValue(int i, unsigned long v);
321 #ifdef VTK_TYPE_USE_LONG_LONG
322  bool SetArgValue(int i, long long v);
323  bool SetArgValue(int i, unsigned long long v);
324 #endif
325 #ifdef VTK_TYPE_USE___INT64
326  bool SetArgValue(int i, __int64 v);
327  bool SetArgValue(int i, unsigned __int64 v);
328 #endif
329 
330 
332 
333  bool SetArray(int i, const float *v, int n);
334  bool SetArray(int i, const double *v, int n);
335  bool SetArray(int i, const bool *v, int n);
336  bool SetArray(int i, const char *v, int n);
337  bool SetArray(int i, const signed char *v, int n);
338  bool SetArray(int i, const unsigned char *v, int n);
339  bool SetArray(int i, const short *v, int n);
340  bool SetArray(int i, const unsigned short *v, int n);
341  bool SetArray(int i, const int *v, int n);
342  bool SetArray(int i, const unsigned int *v, int n);
343  bool SetArray(int i, const long *v, int n);
344  bool SetArray(int i, const unsigned long *v, int n);
345 #ifdef VTK_TYPE_USE_LONG_LONG
346  bool SetArray(int i, const long long *v, int n);
347  bool SetArray(int i, const unsigned long long *v, int n);
348 #endif
349 #ifdef VTK_TYPE_USE___INT64
350  bool SetArray(int i, const __int64 *v, int n);
351  bool SetArray(int i, const unsigned __int64 *v, int n);
352 #endif
353 
354 
356 
357  bool SetNArray(int i, const float *v, int n, const int *d);
358  bool SetNArray(int i, const double *v, int n, const int *d);
359  bool SetNArray(int i, const bool *v, int n, const int *d);
360  bool SetNArray(int i, const char *v, int n, const int *d);
361  bool SetNArray(int i, const signed char *v, int n, const int *d);
362  bool SetNArray(int i, const unsigned char *v, int n, const int *d);
363  bool SetNArray(int i, const short *v, int n, const int *d);
364  bool SetNArray(int i, const unsigned short *v, int n, const int *d);
365  bool SetNArray(int i, const int *v, int n, const int *d);
366  bool SetNArray(int i, const unsigned int *v, int n, const int *d);
367  bool SetNArray(int i, const long *v, int n, const int *d);
368  bool SetNArray(int i, const unsigned long *v, int n, const int *d);
369 #ifdef VTK_TYPE_USE_LONG_LONG
370  bool SetNArray(int i, const long long *v, int n, const int *d);
371  bool SetNArray(int i, const unsigned long long *v, int n, const int *d);
372 #endif
373 #ifdef VTK_TYPE_USE___INT64
374  bool SetNArray(int i, const __int64 *v, int n, const int *d);
375  bool SetNArray(int i, const unsigned __int64 *v, int n, const int *d);
376 #endif
377 
378 
380  static PyObject *BuildNone();
381 
384  static PyObject *BuildVTKObject(const void *v);
385 
387  static PyObject *BuildSpecialObject(const void *v, const char *classname);
388 
390  static PyObject *BuildEnumValue(int v, const char *enumname);
391 
393 
395  static PyObject *BuildSIPObject(
396  const void *v, const char *classname, bool created);
398 
400  static PyObject *BuildSIPEnumValue(int v, const char *classname);
401 
403  static PyObject *BuildValue(const void *v);
404 
406 
407  static PyObject *BuildValue(const char *v);
408  static PyObject *BuildValue(const std::string &v);
409  static PyObject *BuildValue(const vtkUnicodeString &v);
411 
413  static PyObject *BuildValue(char v);
414 
416 
417  static PyObject *BuildValue(double v);
418  static PyObject *BuildValue(bool v);
419  static PyObject *BuildValue(int v);
420  static PyObject *BuildValue(unsigned int v);
421  static PyObject *BuildValue(long v);
422  static PyObject *BuildValue(unsigned long v);
423 #ifdef VTK_TYPE_USE_LONG_LONG
424  static PyObject *BuildValue(long long v);
425  static PyObject *BuildValue(unsigned long long v);
426 #endif
427 #ifdef VTK_TYPE_USE___INT64
428  static PyObject *BuildValue(__int64 v);
429  static PyObject *BuildValue(unsigned __int64 v);
430 #endif
431 
432 
434  static PyObject *BuildBytes(const char *v, int n);
435 
437 
438  static PyObject *BuildTuple(const float *v, int n);
439  static PyObject *BuildTuple(const double *v, int n);
440  static PyObject *BuildTuple(const bool *v, int n);
441  static PyObject *BuildTuple(const signed char *v, int n);
442  static PyObject *BuildTuple(const unsigned char *v, int n);
443  static PyObject *BuildTuple(const short *v, int n);
444  static PyObject *BuildTuple(const unsigned short *v, int n);
445  static PyObject *BuildTuple(const int *v, int n);
446  static PyObject *BuildTuple(const unsigned int *v, int n);
447  static PyObject *BuildTuple(const long *v, int n);
448  static PyObject *BuildTuple(const unsigned long *v, int n);
449 #ifdef VTK_TYPE_USE_LONG_LONG
450  static PyObject *BuildTuple(const long long *v, int n);
451  static PyObject *BuildTuple(const unsigned long long *v, int n);
452 #endif
453 #ifdef VTK_TYPE_USE___INT64
454  static PyObject *BuildTuple(const __int64 *v, int n);
455  static PyObject *BuildTuple(const unsigned __int64 *v, int n);
456 #endif
457 
458 
460 
461  template<class T>
462  static void SaveArray(const T *a, T *b, int n) {
463  int i = 0;
464  do { b[i] = a[i]; } while (++i < n); }
466 
468 
469  template<class T>
470  static bool ArrayHasChanged(const T *a, const T *b, int n) {
471  int i = 0;
472  do { if (a[i] != b[i]) break; } while (++i < n);
473  return (i < n); }
475 
477 
478  static int GetArgCount(PyObject *args) {
479  return static_cast<int>(PyTuple_GET_SIZE(args)); }
481 
483 
484  static int GetArgCount(PyObject *self, PyObject *args) {
485  return (static_cast<int>(PyTuple_GET_SIZE(args)) -
486  PyVTKClass_Check(self)); }
488 
490  static bool ArgCountError(int n, const char *name);
491 
492 
493 protected:
494 
496  static vtkObjectBase *GetSelfFromFirstArg(PyObject *self, PyObject *args);
497 
499 
500  vtkObjectBase *GetArgAsVTKObject(const char *classname, bool &valid);
501  static vtkObjectBase *GetArgAsVTKObject(
502  PyObject *o, const char *classname, bool &valid);
504 
506 
507  void *GetArgAsSpecialObject(const char *classname, PyObject **newobj);
508  static void *GetArgAsSpecialObject(
509  PyObject *o, const char *classname, PyObject **newobj);
511 
513 
514  int GetArgAsEnum(const char *classname, bool &valid);
515  static int GetArgAsEnum(
516  PyObject *o, const char *classname, bool &valid);
518 
520 
521  void *GetArgAsSIPObject(const char *classname, bool &valid);
522  static void *GetArgAsSIPObject(
523  PyObject *o, const char *classname, bool &valid);
525 
527 
528  int GetArgAsSIPEnum(const char *classname, bool &valid);
529  static int GetArgAsSIPEnum(
530  PyObject *o, const char *classname, bool &valid);
532 
534  bool PureVirtualError();
535 
537  bool ArgCountError(int m, int n);
538 
540  bool RefineArgTypeError(int i);
541 
542 private:
543 
544  PyObject *Args;
545  const char *MethodName;
546 
547  int N; // size of args tuple
548  int M; // 1 if Self is a PyVTKClass and first arg is the PyVTKObject
549  int I; // the arg counter, starts at M
550 };
551 
552 //--------------------------------------------------------------------
553 // Inline methods for getting "self" as its original type
554 
555 // Get "self" from a PyVTKObject, which contains a vtkObjectBase object.
556 inline
558 {
559  if (PyVTKClass_Check(self))
560  {
561  return vtkPythonArgs::GetSelfFromFirstArg(self, args);
562  }
563  return ((PyVTKObject *)self)->vtk_ptr;
564 }
565 
566 // Get "self" from a PyVTKSpecialObject.
567 inline
569 {
570  return ((PyVTKSpecialObject *)self)->vtk_ptr;
571 }
572 
573 //--------------------------------------------------------------------
574 // Inline methods for checking the arg count
575 
576 // Verify the arg count for a method with optional arguments.
577 inline
578 bool vtkPythonArgs::CheckArgCount(int nmin, int nmax)
579 {
580  int nargs = this->N - this->M;
581  if (nargs >= nmin && nargs <= nmax)
582  {
583  return true;
584  }
585  this->ArgCountError(nmin, nmax);
586  return false;
587 }
588 
589 // Verify the arg count for a method with optional arguments.
590 inline
592 {
593  int nargs = this->N - this->M;
594  if (nargs == n)
595  {
596  return true;
597  }
598  this->ArgCountError(n, n);
599  return false;
600 }
601 
602 //--------------------------------------------------------------------
603 // Inline method for guarding against pure virtual method calls
604 
605 inline
607 {
608  if (IsBound())
609  {
610  return false;
611  }
612  this->PureVirtualError();
613  return true;
614 }
615 
616 //--------------------------------------------------------------------
617 // Inline method for checking if an error has occurred.
618 
619 inline
621 {
622  return (PyErr_Occurred() != NULL);
623 }
624 
625 //--------------------------------------------------------------------
626 // Inline methods for building python objects of various types.
627 
628 inline
630 {
631  Py_INCREF(Py_None);
632  return Py_None;
633 }
634 
635 inline
637 {
639  static_cast<vtkObjectBase *>(const_cast<void *>(v)));
640 }
641 
642 inline
644  const char *classname)
645 {
646  return PyVTKSpecialObject_CopyNew(classname, v);
647 }
648 
649 inline
651 {
652  /* not implemented */
653  return NULL;
654 }
655 
656 inline
658  const void *v, const char *classname, bool created)
659 {
660  return vtkPythonUtil::SIPGetObjectFromPointer(v, classname, created);
661 }
662 
663 inline
665 {
666  /* not implemented */
667  return NULL;
668 }
669 
670 inline
672 {
673  if (a)
674  {
675  const char *s = vtkPythonUtil::ManglePointer(a, "void_p");
676  return PyString_FromString(s);
677  }
678  Py_INCREF(Py_None);
679  return Py_None;
680 }
681 
682 inline
684 {
685  if (a)
686  {
687  return PyString_FromString(a);
688  }
689  Py_INCREF(Py_None);
690  return Py_None;
691 }
692 
693 inline
695 {
696  return PyString_FromStringAndSize(a.c_str(), static_cast<Py_ssize_t>(a.size()));
697 }
698 
699 inline
701 {
702  std::string s;
703  a.utf8_str(s);
704 #ifdef Py_USING_UNICODE
705  return PyUnicode_DecodeUTF8(s.c_str(), static_cast<Py_ssize_t>(s.size()), NULL);
706 #else
707  return PyString_FromStringAndSize(s.c_str(), static_cast<Py_ssize_t>(s.size()));
708 #endif
709 }
710 
711 inline
713 {
714  char b[2];
715  b[0] = a;
716  b[1] = '\0';
717  return PyString_FromString(b);
718 }
719 
720 inline
722 {
723  return PyFloat_FromDouble(a);
724 }
725 
726 inline
728 {
729 #if PY_VERSION_HEX >= 0x02030000
730  return PyBool_FromLong((long)a);
731 #else
732  return PyInt_FromLong((long)a);
733 #endif
734 }
735 
736 inline
738 {
739  return PyInt_FromLong(a);
740 }
741 
742 inline
744 {
745 #if VTK_SIZEOF_INT < VTK_SIZEOF_LONG
746  return PyInt_FromLong(a);
747 #else
748  if ((long)(a) >= 0)
749  {
750  return PyInt_FromLong((long)(a));
751  }
752  return PyLong_FromUnsignedLong(a);
753 #endif
754 }
755 
756 inline
758 {
759  return PyInt_FromLong(a);
760 }
761 
762 inline
764 {
765  if ((long)(a) >= 0)
766  {
767  return PyInt_FromLong((long)(a));
768  }
769  return PyLong_FromUnsignedLong(a);
770 }
771 
772 #if defined(VTK_TYPE_USE_LONG_LONG)
773 inline
775 {
776 #if defined(PY_LONG_LONG)
777  return PyLong_FromLongLong(a);
778 #else
779  return PyLong_FromLong((long)(a));
780 #endif
781 }
782 
783 inline
784 PyObject *vtkPythonArgs::BuildValue(unsigned long long a)
785 {
786 #if defined(PY_LONG_LONG)
787  return PyLong_FromUnsignedLongLong(a);
788 #else
789  return PyLong_FromUnsignedLong((unsigned long)(a));
790 #endif
791 }
792 #endif
793 
794 #if defined(VTK_TYPE_USE___INT64)
795 inline
797 {
798 #if defined(PY_LONG_LONG)
799  return PyLong_FromLongLong(a);
800 #else
801  return PyLong_FromLong((long)(a));
802 #endif
803 }
804 
805 inline
806 PyObject *vtkPythonArgs::BuildValue(unsigned __int64 a)
807 {
808 #if defined(PY_LONG_LONG)
809  return PyLong_FromUnsignedLongLong(a);
810 #else
811  return PyLong_FromUnsignedLong((unsigned long)(a));
812 #endif
813 }
814 #endif
815 
816 inline
818 {
819  return PyString_FromStringAndSize(a, n);
820 }
821 
822 #endif
int GetArgAsEnum(const char *classname, bool &valid)
bool GetSIPObject(T *&v, const char *classname)
static void SaveArray(const T *a, T *b, int n)
GLboolean GLboolean GLboolean b
Definition: vtkgl.h:12312
vtkPythonArgs(PyObject *args, const char *methodname)
Definition: vtkPythonArgs.h:56
static PyObject * BuildVTKObject(const void *v)
bool GetSpecialObject(T *&v, PyObject *&o, const char *classname)
bool GetSIPEnumValue(T &v, const char *enumname)
const GLdouble * v
Definition: vtkgl.h:11595
static PyObject * BuildValue(const void *v)
bool NoArgsLeft()
Definition: vtkPythonArgs.h:92
static vtkObjectBase * GetSelfPointer(PyObject *self, PyObject *args)
static bool GetSIPEnumValue(PyObject *o, T &v, const char *enumname)
static vtkObjectBase * GetSelfFromFirstArg(PyObject *self, PyObject *args)
int GetArgAsSIPEnum(const char *classname, bool &valid)
static bool GetSpecialObject(PyObject *o, T *&v, const char *classname)
static PyObject * BuildSIPObject(const void *v, const char *classname, bool created)
vtkObjectBase * GetArgAsVTKObject(const char *classname, bool &valid)
static bool GetSIPObject(PyObject *o, T *&v, const char *classname)
static bool GetSpecialObject(PyObject *arg, T *&v, PyObject *&o, const char *classname)
void * GetArgAsSpecialObject(const char *classname, PyObject **newobj)
static PyObject * BuildSIPEnumValue(int v, const char *classname)
int Py_ssize_t
static bool ErrorOccurred()
bool PureVirtualError()
GLdouble GLdouble GLdouble r
Definition: vtkgl.h:11610
vtkPythonArgs(PyObject *self, PyObject *args, const char *methodname)
Definition: vtkPythonArgs.h:46
static int GetArgCount(PyObject *args)
static PyObject * BuildBytes(const char *v, int n)
GLuint const GLchar * name
Definition: vtkgl.h:11983
const GLfloat * m
Definition: vtkgl.h:18169
static bool ArgCountError(int n, const char *name)
const char * utf8_str() const
#define VTKWRAPPINGPYTHONCORE_EXPORT
abstract base class for most VTK objects
Definition: vtkObjectBase.h:58
bool GetVTKObject(T *&v, const char *classname)
static char * ManglePointer(const void *ptr, const char *type)
static int GetArgCount(PyObject *self, PyObject *args)
GLboolean GLboolean GLboolean GLboolean a
Definition: vtkgl.h:12312
static bool GetEnumValue(PyObject *o, T &v, const char *enumname)
#define M(row, col)
bool GetVTKObject(PyObject *o, T *&v, const char *classname)
bool GetEnumValue(T &v, const char *enumname)
GLdouble s
Definition: vtkgl.h:11594
struct _object PyObject
static bool ArrayHasChanged(const T *a, const T *b, int n)
GLclampd n
Definition: vtkgl.h:14370
void * GetArgAsSIPObject(const char *classname, bool &valid)
static PyObject * SIPGetObjectFromPointer(const void *ptr, const char *classname, bool is_new)
static PyObject * BuildSpecialObject(const void *v, const char *classname)
bool GetSpecialObject(T *&v, const char *classname)
bool IsPureVirtual()
static PyObject * BuildEnumValue(int v, const char *enumname)
GLsizei const GLchar ** string
Definition: vtkgl.h:12011
static PyObject * BuildNone()
bool CheckArgCount(int nmin, int nmax)
String class that stores Unicode text.
static PyObject * GetObjectFromPointer(vtkObjectBase *ptr)