H3D API  2.4.1
PythonTypes.h
Go to the documentation of this file.
1 // Copyright 2004-2019, SenseGraphics AB
3 //
4 // This file is part of H3D API.
5 //
6 // H3D API is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // H3D API is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with H3D API; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // A commercial license is also available. Please contact us at
21 // www.sensegraphics.com for more information.
22 //
23 //
27 //
29 #ifndef __PYTHONTYPES_H__
30 #define __PYTHONTYPES_H__
31 
32 // If the following comment is read through the generated documentation then
33 // ignore this comment section.
34 // The following is doxygen comment in order to generate a page explaining the
35 // connection between python and H3DAPI. The % sign is a doxygen feature and
36 // can be ignored when reading the documentation directly in this header file.
62 
63 
64 #include <H3DUtil/Exception.h>
65 #include <H3D/X3DTypes.h>
66 #include <H3D/X3DFieldConversion.h>
67 #include <H3D/Node.h>
68 #include <H3D/H3DApi.h>
69 
70 
71 #ifdef HAVE_PYTHON
72 
74 #include <H3D/PyTypeWrapper.h>
75 
76 
77 namespace H3D {
78 
79  class PyNodePtr {
80  public:
81  PyNodePtr() : refCountNode ( true ), ptr( NULL ) {
83  python_node_ptrs.insert( this );
84  }
85 
86  ~PyNodePtr() {
88  python_node_ptrs.erase( this );
89  }
90 
95  inline void setRefCountNode ( bool _refCountNode ) {
96  refCountNode= _refCountNode;
97  }
98 
100  inline void setNodePtr( Node *_ptr ) {
101  if( ptr ) {
102  python_node_ptrs.erase( this );
103  }
104 
105  if( refCountNode && ptr ) ptr->unref();
106  ptr = _ptr;
107  if( refCountNode && ptr ) ptr->ref();
108 
109  if (ptr && refCountNode) {
110  python_node_ptrs.insert( this );
111  }
112  }
114  inline Node *nodePtr() {
115  return ptr;
116  }
117  static H3DAPI_API std::set<PyNodePtr *> python_node_ptrs;
118 
119  protected:
120  bool refCountNode;
121  Node *ptr;
122  };
123 
125  // Python C declarations for PyNode type
127 
128  extern H3DAPI_API PyTypeObject PyNode_Type;
131  inline string PyNode_Name() { return "Node"; }
132 
140  PyObject H3DAPI_API *PyNode_FromNode( Node *v, bool _refCountNode= true );
141 
143  Node H3DAPI_API *PyNode_AsNode( PyObject *o );
144 
146  inline bool PyNode_Check( PyObject *o) {
147  return PyObject_TypeCheck(o,&PyNode_Type ) || o == Py_None;
148  }
149 
152  struct PyNode : public PyType, PyNodePtr {
153 
154  static void installType( PyObject* H3D_module );
155 
159  static PyObject* create();
160 
162  static void dealloc( PyNode *self );
163 
166  static int init(PyNode *self, PyObject *args, PyObject *kwds);
167 
169  static PyObject* repr( PyNode *myself, PyObject *args);
170 
173  static int compare( PyObject *veca, PyObject *vecb );
174 
175 #if PY_MAJOR_VERSION >= 3
176  static PyObject* richCompare( PyObject *lhs, PyObject *rhs, int operation );
177 #endif
178 
180  static PyObject* getField( PyObject *myself, char* arg );
181 
187  static PyObject* getAttr( PyObject *myself, char* arg );
188 
190  static PyObject* getFieldList( PyObject *myself, PyObject *args );
191 
193  static PyObject* getName( PyObject *myself, PyObject *args );
194 
196  static PyObject* getTypeName( PyObject *myself, PyObject *args );
197 
199  static PyObject* setName( PyObject *self, PyObject *args );
200 
202  static PyObject* getSingleField( PyObject *self, PyObject *args );
203 
205  static PyObject* addField( PyObject *self, PyObject *args );
206 
208  static PyObject* removeField( PyObject *self, PyObject *args);
209 
211  static PyObject* clearFields( PyObject* self, PyObject *args );
212 
214  static PyObject* clone ( PyObject* self, PyObject *args );
215 
217  static PyObject* closestPoint ( PyObject* self, PyObject *args );
218 
220  static PyObject* lineIntersect ( PyObject* self, PyObject *args );
221  };
222 
224  // Python C declarations for PyVec2f type
226 
227  extern H3DAPI_API PyTypeObject PyVec2f_Type;
230  inline string PyVec2f_Name() { return "Vec2f"; }
231 
233  PyObject *PyVec2f_FromVec2f( const Vec2f &v);
234 
236  Vec2f H3DAPI_API PyVec2f_AsVec2f( PyObject *o );
237 
239  inline bool PyVec2f_Check( PyObject *o) {
240  return PyObject_TypeCheck(o,&PyVec2f_Type);
241  }
242 
245  struct PyVec2f :
246  public PyVecTypeWrapper< Vec2f,
247  &PyVec2f_Type,
248  PyVec2f_Name,
249  PyVec2f_Check,
250  PyVec2f_AsVec2f,
251  PyVec2f_FromVec2f >{
252 
255  static int init(PyVec2f *self, PyObject *args, PyObject *kwds);
256 
258  static PyObject* length( PyObject *self, PyObject *args );
259 
261  static PyObject* lengthSqr( PyObject *self, PyObject *args );
262 
264  static PyObject* normalize( PyObject *self, PyObject *args );
265 
268  static PyObject* normalizeSafe( PyObject *self, PyObject *args );
269 
271  static PyObject* dotProduct( PyObject *self, PyObject *args );
272 
273  };
274 
276  // Python C declarations for PyVec2d type
278 
279  extern H3DAPI_API PyTypeObject PyVec2d_Type;
282  inline string PyVec2d_Name() { return "Vec2d"; }
283 
285  PyObject *PyVec2d_FromVec2d( const Vec2d &v);
286 
288  Vec2d H3DAPI_API PyVec2d_AsVec2d( PyObject *o );
289 
291  inline bool PyVec2d_Check( PyObject *o) {
292  return PyObject_TypeCheck(o,&PyVec2d_Type);
293  }
294 
295  namespace PythonInternals {
297  inline bool PyVec2d2f_Check( PyObject *o) {
298  return PyObject_TypeCheck(o,&PyVec2d_Type) ||
299  PyObject_TypeCheck( o, &PyVec2f_Type );
300  }
301 
303  Vec2d PyVec2d2f_AsVec2d( PyObject *o );
304  }
305 
308 
309  // In the PyVec2d operators a PyVec2f can be used instead of a PyVec2d so we
310  // used the specially defined PyVec2d2f operators for this type.
311  struct PyVec2d :
312  public PyVecTypeWrapper< Vec2d,
313  &PyVec2d_Type,
314  PyVec2d_Name,
315  PythonInternals::PyVec2d2f_Check,
316  PythonInternals::PyVec2d2f_AsVec2d,
317  PyVec2d_FromVec2d >{
318 
321  static int init(PyVec2d *self, PyObject *args, PyObject *kwds);
322 
324  static PyObject* length( PyObject *self, PyObject *args );
325 
327  static PyObject* lengthSqr( PyObject *self, PyObject *args );
328 
330  static PyObject* normalize( PyObject *self, PyObject *args );
331 
334  static PyObject* normalizeSafe( PyObject *self, PyObject *args );
335 
337  static PyObject* dotProduct( PyObject *self, PyObject *args );
338  };
339 
341  // Python C declarations for PyVec3f type
343 
344  extern H3DAPI_API PyTypeObject PyVec3f_Type;
345 
348  inline string PyVec3f_Name() { return "Vec3f"; }
349 
351  PyObject *PyVec3f_FromVec3f( const Vec3f &v);
352 
354  Vec3f H3DAPI_API PyVec3f_AsVec3f( PyObject *o );
355 
357  inline bool PyVec3f_Check( PyObject *o) {
358  return PyObject_TypeCheck(o,&PyVec3f_Type);
359  }
360 
363  struct PyVec3f :
364  public PyVecTypeWrapper< Vec3f,
365  &PyVec3f_Type,
366  PyVec3f_Name,
367  PyVec3f_Check,
368  PyVec3f_AsVec3f,
369  PyVec3f_FromVec3f > {
370 
373  static int init(PyVec3f *self, PyObject *args, PyObject *kwds);
374 
376  static PyObject* mod( PyObject *veca, PyObject *vecb );
377 
379  static PyObject* length( PyObject *self, PyObject *args );
380 
382  static PyObject* lengthSqr( PyObject *self, PyObject *args );
383 
385  static PyObject* normalize( PyObject *self, PyObject *args );
386 
389  static PyObject* normalizeSafe( PyObject *self, PyObject *args );
390 
392  static PyObject* dotProduct( PyObject *self, PyObject *args );
393 
395  static PyObject* crossProduct( PyObject *self, PyObject *args );
396 
397  };
398 
400  // Python C declarations for PyVec3d type
402 
403  extern H3DAPI_API PyTypeObject PyVec3d_Type;
404 
407  inline string PyVec3d_Name() { return "Vec3d"; }
408 
410  PyObject *PyVec3d_FromVec3d( const Vec3d &v);
411 
413  Vec3d H3DAPI_API PyVec3d_AsVec3d( PyObject *o );
414 
416  inline bool PyVec3d_Check( PyObject *o) {
417  return PyObject_TypeCheck(o,&PyVec3d_Type);
418  }
419 
420  namespace PythonInternals {
422  inline bool PyVec3d3f_Check( PyObject *o) {
423  return PyObject_TypeCheck(o,&PyVec3d_Type) ||
424  PyObject_TypeCheck( o, &PyVec3f_Type );
425  }
426 
428  Vec3d PyVec3d3f_AsVec3d( PyObject *o );
429  }
430 
433 
434  // In the PyVec3d operators a PyVec3f can be used instead of a PyVec3d so we
435  // used the specially defined PyVec3d3f operators for this type.
436  struct PyVec3d : public PyVecTypeWrapper< Vec3d,
437  &PyVec3d_Type,
438  PyVec3d_Name,
439  PythonInternals::PyVec3d3f_Check,
440  PythonInternals::PyVec3d3f_AsVec3d,
441  PyVec3d_FromVec3d > {
444  static int init(PyVec3d *self, PyObject *args, PyObject *kwds);
445  static PyObject* mod( PyObject *veca, PyObject *vecb );
447  static PyObject* length( PyObject *self, PyObject *args );
449  static PyObject* lengthSqr( PyObject *self, PyObject *args );
451  static PyObject* normalize( PyObject *self, PyObject *args );
454  static PyObject* normalizeSafe( PyObject *self, PyObject *args );
456  static PyObject* dotProduct( PyObject *self, PyObject *args );
457 
459  static PyObject* crossProduct( PyObject *self, PyObject *args );
460  };
461 
463  // Python C declarations for PyVec4f type
465 
466  extern H3DAPI_API PyTypeObject PyVec4f_Type;
467 
470  inline string PyVec4f_Name() { return "Vec4f"; }
471 
473  PyObject *PyVec4f_FromVec4f( const Vec4f &v);
474 
476  Vec4f H3DAPI_API PyVec4f_AsVec4f( PyObject *o );
477 
479  inline bool PyVec4f_Check( PyObject *o) {
480  return PyObject_TypeCheck(o,&PyVec4f_Type);
481  }
482 
485  struct PyVec4f : public PyVecTypeWrapper< Vec4f,
486  &PyVec4f_Type,
487  PyVec4f_Name,
488  PyVec4f_Check,
489  PyVec4f_AsVec4f,
490  PyVec4f_FromVec4f > {
491 
494  static int init(PyVec4f *self, PyObject *args, PyObject *kwds);
495  };
496 
497 
499  // Python C declarations for PyVec4d type
501 
502  extern H3DAPI_API PyTypeObject PyVec4d_Type;
503 
506  inline string PyVec4d_Name() { return "Vec4d"; }
507 
509  PyObject *PyVec4d_FromVec4d( const Vec4d &v);
510 
512  Vec4d H3DAPI_API PyVec4d_AsVec4d( PyObject *o );
513 
515  inline bool PyVec4d_Check( PyObject *o) {
516  return PyObject_TypeCheck(o,&PyVec4d_Type);
517  }
518 
519  namespace PythonInternals {
521  inline bool PyVec4d4f_Check( PyObject *o) {
522  return PyObject_TypeCheck(o,&PyVec4d_Type) ||
523  PyObject_TypeCheck( o, &PyVec4f_Type );
524  }
525 
527  Vec4d PyVec4d4f_AsVec4d( PyObject *o );
528  }
529 
532  struct PyVec4d : public PyVecTypeWrapper< Vec4d,
533  &PyVec4d_Type,
534  PyVec4d_Name,
535  PythonInternals::PyVec4d4f_Check,
536  PythonInternals::PyVec4d4f_AsVec4d,
537  PyVec4d_FromVec4d > {
538 
541  static int init(PyVec4d *self, PyObject *args, PyObject *kwds);
542  };
543 
545  // Python C declarations for PyRotation type
547 
548  extern H3DAPI_API PyTypeObject PyRotation_Type;
549 
552  inline string PyRotation_Name() { return "Rotation"; }
553 
555  PyObject *PyRotation_FromRotation( const Rotation &v);
556 
558  Rotation H3DAPI_API PyRotation_AsRotation( PyObject *o );
559 
561  inline bool PyRotation_Check( PyObject *o) {
562  return PyObject_TypeCheck(o,&PyRotation_Type);
563  }
564 
567  struct PyRotation : public PyNumberTypeWrapper< Rotation,
568  &PyRotation_Type,
569  PyRotation_Name,
570  PyRotation_Check,
571  PyRotation_AsRotation,
572  PyRotation_FromRotation > {
573 
576  static int init(PyRotation *self, PyObject *args, PyObject *kwds);
577 
580  static PyObject *toEulerAngles( PyObject *self, PyObject *args );
581 
583  static PyObject *slerp( PyObject *self, PyObject *args );
584 
586  static PyObject* mul( PyObject *rota, PyObject *rotb );
587  };
588 
590  // Python C declarations for PyQuaternion type
592 
593  extern H3DAPI_API PyTypeObject PyQuaternion_Type;
594 
597  inline string PyQuaternion_Name() { return "Quaternion"; }
598 
600  PyObject *PyQuaternion_FromQuaternion( const Quaternion &v);
601 
603  Quaternion H3DAPI_API PyQuaternion_AsQuaternion( PyObject *o );
604 
606  inline bool PyQuaternion_Check( PyObject *o) {
607  return PyObject_TypeCheck(o,&PyQuaternion_Type);
608  }
609 
612  struct PyQuaternion : public PyNumberTypeWrapper< Quaternion,
613  &PyQuaternion_Type,
614  PyQuaternion_Name,
615  PyQuaternion_Check,
616  PyQuaternion_AsQuaternion,
617  PyQuaternion_FromQuaternion > {
618 
621  static int init(PyQuaternion *self, PyObject *args, PyObject *kwds);
622 
624  static PyObject* mul( PyObject *rota, PyObject *rotb );
625 
628  static PyObject *toEulerAngles( PyObject *self, PyObject *args );
629 
631  static PyObject *norm( PyObject *self, PyObject *args );
632 
635  static PyObject* normalize( PyObject *self, PyObject *args );
636 
638  static PyObject* conjugate( PyObject *self, PyObject *args );
639 
641  static PyObject* inverse( PyObject *self, PyObject *args );
642 
644  static PyObject* slerp( PyObject *self, PyObject *args );
645 
647  static PyObject* dotProduct( PyObject *self, PyObject *args );
648  };
649 
651  // Python C declarations for PyMatrix3f type
653 
654  extern H3DAPI_API PyTypeObject PyMatrix3f_Type;
655 
658  inline string PyMatrix3f_Name() { return "Matrix3f"; }
659 
661  PyObject *PyMatrix3f_FromMatrix3f( const Matrix3f &v);
662 
664  Matrix3f H3DAPI_API PyMatrix3f_AsMatrix3f( PyObject *o );
665 
667  inline bool PyMatrix3f_Check( PyObject *o) {
668  return PyObject_TypeCheck(o,&PyMatrix3f_Type);
669  }
672  struct PyMatrix3f : public PyNumberTypeWrapper< Matrix3f,
673  &PyMatrix3f_Type,
674  PyMatrix3f_Name,
675  PyMatrix3f_Check,
676  PyMatrix3f_AsMatrix3f,
677  PyMatrix3f_FromMatrix3f > {
678 
681  static int init(PyMatrix3f *self, PyObject *args, PyObject *kwds);
682 
684  static PyObject* mul( PyObject *rota, PyObject *rotb );
685 
687  static PyObject* setToIdentity( PyObject *self, PyObject *args );
688 
690  static PyObject* inverse( PyObject *self, PyObject *args );
691 
693  static PyObject* transpose( PyObject *self, PyObject *args );
694 
697  static PyObject* toEulerAngles( PyObject *self, PyObject *args );
698 
700  static PyObject* getScalePart( PyObject *self, PyObject *args );
701 
703  static PyObject* getRow( PyObject *self, PyObject *args );
704 
706  static PyObject* getColumn( PyObject *self, PyObject *args );
707 
709  static PyObject* getElement( PyObject *self, PyObject *args );
710 
712  static PyObject* setElement( PyObject *self, PyObject *args );
713  };
714 
716  // Python C declarations for PyMatrix4f type
718 
719  extern H3DAPI_API PyTypeObject PyMatrix4f_Type;
720 
723  inline string PyMatrix4f_Name() { return "Matrix4f"; }
724 
726  PyObject *PyMatrix4f_FromMatrix4f( const Matrix4f &v);
727 
729  Matrix4f H3DAPI_API PyMatrix4f_AsMatrix4f( PyObject *o );
730 
732  inline bool PyMatrix4f_Check( PyObject *o) {
733  return PyObject_TypeCheck(o,&PyMatrix4f_Type);
734  }
737  struct PyMatrix4f : public PyNumberTypeWrapper< Matrix4f,
738  &PyMatrix4f_Type,
739  PyMatrix4f_Name,
740  PyMatrix4f_Check,
741  PyMatrix4f_AsMatrix4f,
742  PyMatrix4f_FromMatrix4f > {
743 
744 
747  static int init(PyMatrix4f *self, PyObject *args, PyObject *kwds);
748 
750  static PyObject* mul( PyObject *rota, PyObject *rotb );
751 
753  static PyObject* setToIdentity( PyObject *self, PyObject *args );
754 
763  static PyObject* transformInverse( PyObject *self, PyObject *args );
764 
766  static PyObject* inverse( PyObject *self, PyObject *args );
767 
769  static PyObject* transpose( PyObject *self, PyObject *args );
770 
772  static PyObject* getRow( PyObject *self, PyObject *args );
773 
775  static PyObject* getColumn( PyObject *self, PyObject *args );
776 
778  static PyObject* getScaleRotationPart( PyObject *self, PyObject *args );
779 
781  static PyObject* getRotationPart( PyObject *self, PyObject *args );
782 
784  static PyObject* getScalePart( PyObject *self, PyObject *args );
785 
787  static PyObject* getTranslationPart( PyObject *self, PyObject *args );
788 
790  static PyObject* getElement( PyObject *self, PyObject *args );
791 
793  static PyObject* setElement( PyObject *self, PyObject *args );
794  };
795 
796 
798  // Python C declarations for PyMatrix3d type
800 
801  extern H3DAPI_API PyTypeObject PyMatrix3d_Type;
802 
805  inline string PyMatrix3d_Name() { return "Matrix3d"; }
806 
808  PyObject *PyMatrix3d_FromMatrix3d( const Matrix3d &v);
809 
811  Matrix3d H3DAPI_API PyMatrix3d_AsMatrix3d( PyObject *o );
812 
814  inline bool PyMatrix3d_Check( PyObject *o) {
815  return PyObject_TypeCheck(o,&PyMatrix3d_Type);
816  }
817 
818  namespace PythonInternals {
820  inline bool PyMatrix3d3f_Check( PyObject *o) {
821  return PyObject_TypeCheck(o,&PyMatrix3d_Type) ||
822  PyObject_TypeCheck( o, &PyMatrix3f_Type );
823  }
824 
826  Matrix3d PyMatrix3d3f_AsMatrix3d( PyObject *o );
827  }
828 
831  struct PyMatrix3d : public PyNumberTypeWrapper< Matrix3d,
832  &PyMatrix3d_Type,
833  PyMatrix3d_Name,
834  PythonInternals::PyMatrix3d3f_Check,
835  PythonInternals::PyMatrix3d3f_AsMatrix3d,
836  PyMatrix3d_FromMatrix3d > {
837 
840  static int init(PyMatrix3d *self, PyObject *args, PyObject *kwds);
841 
843  static PyObject* mul( PyObject *rota, PyObject *rotb );
844 
846  static PyObject* setToIdentity( PyObject *self, PyObject *args );
847 
849  static PyObject* inverse( PyObject *self, PyObject *args );
850 
852  static PyObject* transpose( PyObject *self, PyObject *args );
853 
856  static PyObject* toEulerAngles( PyObject *self, PyObject *args );
857 
859  static PyObject* getScalePart( PyObject *self, PyObject *args );
860 
862  static PyObject* getRow( PyObject *self, PyObject *args );
863 
865  static PyObject* getColumn( PyObject *self, PyObject *args );
866 
868  static PyObject* getElement( PyObject *self, PyObject *args );
869 
871  static PyObject* setElement( PyObject *self, PyObject *args );
872  };
873 
875  // Python C declarations for PyMatrix4d type
877 
878  extern H3DAPI_API PyTypeObject PyMatrix4d_Type;
879 
882  inline string PyMatrix4d_Name() { return "Matrix4d"; }
883 
885  PyObject *PyMatrix4d_FromMatrix4d( const Matrix4d &v);
886 
888  Matrix4d H3DAPI_API PyMatrix4d_AsMatrix4d( PyObject *o );
889 
891  inline bool PyMatrix4d_Check( PyObject *o) {
892  return PyObject_TypeCheck(o,&PyMatrix4d_Type);
893  }
894 
895  namespace PythonInternals {
897  inline bool PyMatrix4d4f_Check( PyObject *o) {
898  return PyObject_TypeCheck(o,&PyMatrix4d_Type) ||
899  PyObject_TypeCheck( o, &PyMatrix4f_Type );
900  }
901 
903  Matrix4d PyMatrix4d4f_AsMatrix4d( PyObject *o );
904  }
905 
908  struct PyMatrix4d : public PyNumberTypeWrapper< Matrix4d,
909  &PyMatrix4d_Type,
910  PyMatrix4d_Name,
911  PythonInternals::PyMatrix4d4f_Check,
912  PythonInternals::PyMatrix4d4f_AsMatrix4d,
913  PyMatrix4d_FromMatrix4d > {
914 
915 
918  static int init(PyMatrix4d *self, PyObject *args, PyObject *kwds);
919 
921  static PyObject* mul( PyObject *rota, PyObject *rotb );
922 
924  static PyObject* setToIdentity( PyObject *self, PyObject *args );
925 
934  static PyObject* transformInverse( PyObject *self, PyObject *args );
935 
937  static PyObject* inverse( PyObject *self, PyObject *args );
938 
940  static PyObject* transpose( PyObject *self, PyObject *args );
941 
943  static PyObject* getRow( PyObject *self, PyObject *args );
944 
946  static PyObject* getColumn( PyObject *self, PyObject *args );
947 
949  static PyObject* getScaleRotationPart( PyObject *self, PyObject *args );
950 
952  static PyObject* getRotationPart( PyObject *self, PyObject *args );
953 
955  static PyObject* getScalePart( PyObject *self, PyObject *args );
956 
958  static PyObject* getTranslationPart( PyObject *self, PyObject *args );
959 
961  static PyObject* getElement( PyObject *self, PyObject *args );
962 
964  static PyObject* setElement( PyObject *self, PyObject *args );
965  };
966 
968  // Python C declarations for PyRGB type
970 
971  extern H3DAPI_API PyTypeObject PyRGB_Type;
972 
975  inline string PyRGB_Name() { return "RGB"; }
976 
978  PyObject *PyRGB_FromRGB( const RGB &v);
979 
981  RGB H3DAPI_API PyRGB_AsRGB( PyObject *o );
982 
984  inline bool PyRGB_Check( PyObject *o) {
985  return PyObject_TypeCheck(o,&PyRGB_Type);
986  }
987 
990  struct PyRGB : public PyTypeWrapper< RGB,
991  &PyRGB_Type,
992  PyRGB_Name,
993  PyRGB_Check,
994  PyRGB_AsRGB,
995  PyRGB_FromRGB > {
996 
999  static int init(PyRGB *self, PyObject *args, PyObject *kwds);
1000  };
1001 
1003  // Python C declarations for PyRGBA type
1005 
1006  extern H3DAPI_API PyTypeObject PyRGBA_Type;
1007 
1010  inline string PyRGBA_Name() { return "RGBA"; }
1011 
1013  PyObject *PyRGBA_FromRGBA( const RGBA &v);
1014 
1016  RGBA H3DAPI_API PyRGBA_AsRGBA( PyObject *o );
1017 
1019  inline bool PyRGBA_Check( PyObject *o) {
1020  return PyObject_TypeCheck(o,&PyRGBA_Type);
1021  }
1022 
1025  struct PyRGBA : public PyTypeWrapper< RGBA,
1026  &PyRGBA_Type,
1027  PyRGBA_Name,
1028  PyRGBA_Check,
1029  PyRGBA_AsRGBA,
1030  PyRGBA_FromRGBA > {
1031 
1034  static int init(PyRGBA *self, PyObject *args, PyObject *kwds);
1035  };
1036 
1038  // Python C declarations for PyConsole type(interface to Console)
1040  extern H3DAPI_API PyTypeObject PyConsole_Type;
1041 
1042  struct PyConsole: public PyType {
1043  PyConsole() : log_level( LogLevel::Info ) {}
1044 
1047  static void installType( PyObject* H3D_module ) {
1048  if (PyType_Ready( &PyConsole_Type ) < 0 )
1049  return; // THROW ERROR!?
1050 
1051  Py_INCREF( &PyConsole_Type );
1052  PyModule_AddObject( H3D_module,
1053  "H3DConsole",
1054  (PyObject *)&PyConsole_Type );
1055  }
1056 
1058  static int init(PyConsole *self, PyObject *args, PyObject *kwds);
1059 
1061  static void dealloc( PyObject *self ) {
1062  self->ob_type->tp_free( self );
1063  }
1064 
1065  static PyObject* write( PyObject *self, PyObject *to_write );
1066  static PyObject* flush( PyObject *self, PyObject *args );
1067  static PyObject* writeAtLevel( PyObject *self, PyObject *args );
1068 
1071  int log_level;
1072 
1073  };
1074 
1077  inline string PyConsole_Name() { return "Console"; }
1078 
1080  inline bool PyConsole_Check( PyObject *o) {
1081  return PyObject_TypeCheck(o,&PyConsole_Type);
1082  }
1083 
1084 
1085 }
1086 
1087 #endif
1088 #endif
Base header file that handles all configuration related settings.
Node base class.
Header file for PyTypeWrapper.
Defines and function for easy porting to Python 3.
bool PyMatrix3d3f_Check(PyObject *o)
Returns true if its argument is a PyVec3d or PyVec3f.
Definition: PythonTypes.h:820
bool PyVec2d2f_Check(PyObject *o)
Returns true if its argument is a PyVec2d or PyVec2f.
Definition: PythonTypes.h:297
bool PyVec4d4f_Check(PyObject *o)
Returns true if its argument is a PyVec3d or PyVec3f.
Definition: PythonTypes.h:521
bool PyMatrix4d4f_Check(PyObject *o)
Returns true if its argument is a PyVec3d or PyVec3f.
Definition: PythonTypes.h:897
bool PyVec3d3f_Check(PyObject *o)
Returns true if its argument is a PyVec3d or PyVec3f.
Definition: PythonTypes.h:422
This file contains functions for convertion from a string to a value of an X3D field type.
Header file containing all X3D types enumerated.
static bool inMainThread()
Rotation()
Vec2d()
Vec2f()
Vec3d()
Vec4f()
H3D API namespace.
Definition: Anchor.h:38
Vec2d H3DAPI_API PyVec2d_AsVec2d(PyObject *o)
Returns an Vec2d representation of the contents of o.
Definition: PythonTypes.cpp:1208
bool PyMatrix3d_Check(PyObject *o)
Returns true if its argument is a PyMatrix3d.
Definition: PythonTypes.h:814
string PyNode_Name()
Returns which is the name the PyNode is to be installed as in Python.
Definition: PythonTypes.h:131
string PyVec2d_Name()
Returns which is the name the PyVec2d is to be installed as in Python.
Definition: PythonTypes.h:282
bool PyQuaternion_Check(PyObject *o)
Returns true if its argument is a PyVec3f.
Definition: PythonTypes.h:606
bool PyVec4d_Check(PyObject *o)
Returns true if its argument is a PyVec3f.
Definition: PythonTypes.h:515
bool PyMatrix3f_Check(PyObject *o)
Returns true if its argument is a PyMatrix3f.
Definition: PythonTypes.h:667
string PyVec2f_Name()
Returns which is the name the PyVec2f is to be installed as in Python.
Definition: PythonTypes.h:230
string PyVec4d_Name()
Returns which is the name the PyVec3f is to be installed as in Python.
Definition: PythonTypes.h:506
string PyRGBA_Name()
Returns which is the name the PyRGBA is to be installed as in Python.
Definition: PythonTypes.h:1010
bool PyVec4f_Check(PyObject *o)
Returns true if its argument is a PyVec3f.
Definition: PythonTypes.h:479
PyObject * PyRotation_FromRotation(const Rotation &v)
Creates a new PyRotation object based on the value of v.
Definition: PythonTypes.cpp:4080
Matrix4f H3DAPI_API PyMatrix4f_AsMatrix4f(PyObject *o)
Returns an Matrix4f representation of the contents of o.
Definition: PythonTypes.cpp:2815
Node H3DAPI_API * PyNode_AsNode(PyObject *o)
Returns an Node * representation of the contents of o.
Definition: PythonTypes.cpp:263
PyObject * PyVec4f_FromVec4f(const Vec4f &v)
Creates a new PyVec4f object based on the value of v.
Definition: PythonTypes.cpp:2031
Vec3f H3DAPI_API PyVec3f_AsVec3f(PyObject *o)
Returns an Vec3f representation of the contents of o.
Definition: PythonTypes.cpp:1458
bool PyVec2d_Check(PyObject *o)
Returns true if its argument is a PyVec2d.
Definition: PythonTypes.h:291
PyObject * PyMatrix3f_FromMatrix3f(const Matrix3f &v)
Creates a new PyMatrix3f object based on the value of v.
Definition: PythonTypes.cpp:2519
Matrix4d H3DAPI_API PyMatrix4d_AsMatrix4d(PyObject *o)
Returns an Matrix4d representation of the contents of o.
Definition: PythonTypes.cpp:3626
PyObject * PyQuaternion_FromQuaternion(const Quaternion &v)
Creates a new PyQuaternion object based on the value of v.
Definition: PythonTypes.cpp:4404
string PyRotation_Name()
Returns which is the name the PyVec3f is to be installed as in Python.
Definition: PythonTypes.h:552
Vec3d H3DAPI_API PyVec3d_AsVec3d(PyObject *o)
Returns an Vec3d representation of the contents of o.
Definition: PythonTypes.cpp:1743
PyObject * PyVec2d_FromVec2d(const Vec2d &v)
Creates a new PyVec2d object based on the value of v.
Definition: PythonTypes.cpp:1218
RGBA H3DAPI_API PyRGBA_AsRGBA(PyObject *o)
Returns an RGBA representation of the contents of o.
Definition: PythonTypes.cpp:4888
PyObject * PyRGB_FromRGB(const RGB &v)
Creates a new PyRGB object based on the value of v.
Definition: PythonTypes.cpp:4702
Vec2f H3DAPI_API PyVec2f_AsVec2f(PyObject *o)
Returns an Vec2f representation of the contents of o.
Definition: PythonTypes.cpp:949
RGB H3DAPI_API PyRGB_AsRGB(PyObject *o)
Returns an RGB representation of the contents of o.
Definition: PythonTypes.cpp:4692
PyObject H3DAPI_API * PyNode_FromNode(Node *v, bool _refCountNode=true)
Creates a new PyNode object based on the value of v.
Definition: PythonTypes.cpp:276
string PyVec3d_Name()
Returns which is the name the PyVec3f is to be installed as in Python.
Definition: PythonTypes.h:407
string PyMatrix4f_Name()
Returns which is the name the PyMatrix4f is to be installed as in Python.
Definition: PythonTypes.h:723
string PyMatrix3d_Name()
Returns which is the name the PyMatrix3d is to be installed as in Python.
Definition: PythonTypes.h:805
PyObject * PyVec3d_FromVec3d(const Vec3d &v)
Creates a new PyVec3d object based on the value of v.
Definition: PythonTypes.cpp:1753
PyObject * PyMatrix3d_FromMatrix3d(const Matrix3d &v)
Creates a new PyMatrix3d object based on the value of v.
Definition: PythonTypes.cpp:3274
PyObject * PyVec3f_FromVec3f(const Vec3f &v)
Creates a new PyVec3f object based on the value of v.
Definition: PythonTypes.cpp:1468
bool PyRGBA_Check(PyObject *o)
Returns true if its argument is a PyRGBA.
Definition: PythonTypes.h:1019
string PyMatrix3f_Name()
Returns which is the name the PyMatrix3f is to be installed as in Python.
Definition: PythonTypes.h:658
Vec4f H3DAPI_API PyVec4f_AsVec4f(PyObject *o)
Returns an Vec4f representation of the contents of o.
Definition: PythonTypes.cpp:2021
bool PyVec2f_Check(PyObject *o)
Returns true if its argument is a PyVec2f.
Definition: PythonTypes.h:239
bool PyConsole_Check(PyObject *o)
Returns true if its argument is a PyVec3f.
Definition: PythonTypes.h:1080
Matrix3f H3DAPI_API PyMatrix3f_AsMatrix3f(PyObject *o)
Returns an Matrix3f representation of the contents of o.
Definition: PythonTypes.cpp:2453
bool PyRGB_Check(PyObject *o)
Returns true if its argument is a PyVec3f.
Definition: PythonTypes.h:984
bool PyNode_Check(PyObject *o)
Returns true if its argument is a PyNode.
Definition: PythonTypes.h:146
PyObject * PyMatrix4f_FromMatrix4f(const Matrix4f &v)
Creates a new PyMatrix4f object based on the value of v.
Definition: PythonTypes.cpp:2825
PyObject * PyVec2f_FromVec2f(const Vec2f &v)
Creates a new PyVec2f object based on the value of v.
Definition: PythonTypes.cpp:959
bool PyVec3f_Check(PyObject *o)
Returns true if its argument is a PyVec3f.
Definition: PythonTypes.h:357
string PyQuaternion_Name()
Returns which is the name the PyQuaternion is to be installed as in Python.
Definition: PythonTypes.h:597
bool PyRotation_Check(PyObject *o)
Returns true if its argument is a PyRotation.
Definition: PythonTypes.h:561
bool PyMatrix4d_Check(PyObject *o)
Returns true if its argument is a PyMatrix4d.
Definition: PythonTypes.h:891
string PyVec4f_Name()
Returns which is the name the PyVec3f is to be installed as in Python.
Definition: PythonTypes.h:470
string PyRGB_Name()
Returns which is the name the PyVec3f is to be installed as in Python.
Definition: PythonTypes.h:975
Quaternion H3DAPI_API PyQuaternion_AsQuaternion(PyObject *o)
Returns an Quaternion representation of the contents of o.
Definition: PythonTypes.cpp:4394
bool PyMatrix4f_Check(PyObject *o)
Returns true if its argument is a PyMatrix4f.
Definition: PythonTypes.h:732
Rotation H3DAPI_API PyRotation_AsRotation(PyObject *o)
Returns an Rotation representation of the contents of o.
Definition: PythonTypes.cpp:4070
string PyMatrix4d_Name()
Returns which is the name the PyMatrix4d is to be installed as in Python.
Definition: PythonTypes.h:882
string PyConsole_Name()
Returns which is the name the PyVec3f is to be installed as in Python.
Definition: PythonTypes.h:1077
PyObject * PyVec4d_FromVec4d(const Vec4d &v)
Creates a new PyVec4d object based on the value of v.
Definition: PythonTypes.cpp:2248
bool PyVec3d_Check(PyObject *o)
Returns true if its argument is a PyVec3f.
Definition: PythonTypes.h:416
PyObject * PyRGBA_FromRGBA(const RGBA &v)
Creates a new PyRGBA object based on the value of v.
Definition: PythonTypes.cpp:4898
Matrix3d H3DAPI_API PyMatrix3d_AsMatrix3d(PyObject *o)
Returns an Matrix3d representation of the contents of o.
Definition: PythonTypes.cpp:3264
string PyVec3f_Name()
Returns which is the name the PyVec3f is to be installed as in Python.
Definition: PythonTypes.h:348
Vec4d H3DAPI_API PyVec4d_AsVec4d(PyObject *o)
Returns an Vec4d representation of the contents of o.
Definition: PythonTypes.cpp:2238
PyObject * PyMatrix4d_FromMatrix4d(const Matrix4d &v)
Creates a new PyMatrix4d object based on the value of v.
Definition: PythonTypes.cpp:3636
Python C Type wrapper around Matrix3d.
Definition: PythonTypes.h:836
static int init(PyMatrix3d *self, PyObject *args, PyObject *kwds)
Python type initialisation: will set the Matrix3d value from a python string argument list.
Definition: PythonTypes.cpp:3281
static PyObject * transpose(PyObject *self, PyObject *args)
Returns the transpose of the matrix.
Definition: PythonTypes.cpp:3421
static PyObject * inverse(PyObject *self, PyObject *args)
Returns the inverse of the matrix.
Definition: PythonTypes.cpp:3416
static PyObject * setElement(PyObject *self, PyObject *args)
Set an element in the matrix.
Definition: PythonTypes.cpp:3373
static PyObject * toEulerAngles(PyObject *self, PyObject *args)
Get the euler angles( yaw, pitch, roll ) representation of the rotation matrix.
Definition: PythonTypes.cpp:3426
static PyObject * getElement(PyObject *self, PyObject *args)
Get an element in the matrix.
Definition: PythonTypes.cpp:3352
static PyObject * getScalePart(PyObject *self, PyObject *args)
Get the scaling part of the matrix for each axis.
Definition: PythonTypes.cpp:3431
static PyObject * getColumn(PyObject *self, PyObject *args)
Get a column of the matrix.
Definition: PythonTypes.cpp:3447
static PyObject * setToIdentity(PyObject *self, PyObject *args)
Set to the identity matrix.
Definition: PythonTypes.cpp:3408
static PyObject * mul(PyObject *rota, PyObject *rotb)
Multiplies two Matrix3d objects.
Definition: PythonTypes.cpp:3326
static PyObject * getRow(PyObject *self, PyObject *args)
Get a row of the matrix.
Definition: PythonTypes.cpp:3436
Python C Type wrapper around Matrix3f.
Definition: PythonTypes.h:677
static PyObject * setToIdentity(PyObject *self, PyObject *args)
Set to the identity matrix.
Definition: PythonTypes.cpp:2598
static PyObject * setElement(PyObject *self, PyObject *args)
Set an element in the matrix.
Definition: PythonTypes.cpp:2483
static PyObject * getRow(PyObject *self, PyObject *args)
Get a row of the matrix.
Definition: PythonTypes.cpp:2626
static PyObject * toEulerAngles(PyObject *self, PyObject *args)
Get the euler angles( yaw, pitch, roll ) representation of the rotation matrix.
Definition: PythonTypes.cpp:2616
static PyObject * mul(PyObject *rota, PyObject *rotb)
Multiplies two Matrix3f objects.
Definition: PythonTypes.cpp:2572
static PyObject * getScalePart(PyObject *self, PyObject *args)
Get the scaling part of the matrix for each axis.
Definition: PythonTypes.cpp:2621
static PyObject * inverse(PyObject *self, PyObject *args)
Returns the inverse of the matrix.
Definition: PythonTypes.cpp:2606
static int init(PyMatrix3f *self, PyObject *args, PyObject *kwds)
Python type initialisation: will set the Matrix3f value from a python string argument list.
Definition: PythonTypes.cpp:2526
static PyObject * getColumn(PyObject *self, PyObject *args)
Get a column of the matrix.
Definition: PythonTypes.cpp:2637
static PyObject * getElement(PyObject *self, PyObject *args)
Get an element in the matrix.
Definition: PythonTypes.cpp:2462
static PyObject * transpose(PyObject *self, PyObject *args)
Returns the transpose of the matrix.
Definition: PythonTypes.cpp:2611
Python C Type wrapper around Matrix4d.
Definition: PythonTypes.h:913
static PyObject * getColumn(PyObject *self, PyObject *args)
Get a column of the matrix.
Definition: PythonTypes.cpp:3874
static PyObject * transpose(PyObject *self, PyObject *args)
Returns the inverse of the matrix.
Definition: PythonTypes.cpp:3848
static PyObject * getElement(PyObject *self, PyObject *args)
Get an element in the matrix.
Definition: PythonTypes.cpp:3774
static PyObject * setElement(PyObject *self, PyObject *args)
Set an element in the matrix.
Definition: PythonTypes.cpp:3795
static PyObject * transformInverse(PyObject *self, PyObject *args)
Returns the inverse of the matrix assuming that it is on the form.
Definition: PythonTypes.cpp:3838
static PyObject * getScalePart(PyObject *self, PyObject *args)
Returns the scaling part of the Matrix4d.
Definition: PythonTypes.cpp:3853
static int init(PyMatrix4d *self, PyObject *args, PyObject *kwds)
Python type initialisation: will set the Matrix4d value from a python string argument list.
Definition: PythonTypes.cpp:3643
static PyObject * setToIdentity(PyObject *self, PyObject *args)
Set to the identity matrix.
Definition: PythonTypes.cpp:3830
static PyObject * getTranslationPart(PyObject *self, PyObject *args)
Returns the translation part of the Matrix4d.
Definition: PythonTypes.cpp:3858
static PyObject * getRotationPart(PyObject *self, PyObject *args)
Returns the rotation part of the Matrix4d.
Definition: PythonTypes.cpp:3891
static PyObject * mul(PyObject *rota, PyObject *rotb)
Multiplies two Matrix4d objects.
Definition: PythonTypes.cpp:3742
static PyObject * getScaleRotationPart(PyObject *self, PyObject *args)
Returns the scale and rotation part of the Matrix4d.
Definition: PythonTypes.cpp:3885
static PyObject * getRow(PyObject *self, PyObject *args)
Get a row of the matrix.
Definition: PythonTypes.cpp:3863
static PyObject * inverse(PyObject *self, PyObject *args)
Returns the inverse of the matrix.
Definition: PythonTypes.cpp:3843
Python C Type wrapper around Matrix4f.
Definition: PythonTypes.h:742
static PyObject * getScaleRotationPart(PyObject *self, PyObject *args)
Returns the scale and rotation part of the Matrix4f.
Definition: PythonTypes.cpp:3086
static PyObject * getRotationPart(PyObject *self, PyObject *args)
Returns the rotation part of the Matrix4f.
Definition: PythonTypes.cpp:3092
static PyObject * getRow(PyObject *self, PyObject *args)
Get a row of the matrix.
Definition: PythonTypes.cpp:3064
static PyObject * setToIdentity(PyObject *self, PyObject *args)
Set to the identity matrix.
Definition: PythonTypes.cpp:3031
static PyObject * setElement(PyObject *self, PyObject *args)
Set an element in the matrix.
Definition: PythonTypes.cpp:2996
static PyObject * getElement(PyObject *self, PyObject *args)
Get an element in the matrix.
Definition: PythonTypes.cpp:2975
static PyObject * mul(PyObject *rota, PyObject *rotb)
Multiplies two Matrix4f objects.
Definition: PythonTypes.cpp:2942
static PyObject * inverse(PyObject *self, PyObject *args)
Returns the inverse of the matrix.
Definition: PythonTypes.cpp:3044
static PyObject * getTranslationPart(PyObject *self, PyObject *args)
Returns the translation part of the Matrix4f.
Definition: PythonTypes.cpp:3059
static PyObject * getScalePart(PyObject *self, PyObject *args)
Returns the scaling part of the Matrix4f.
Definition: PythonTypes.cpp:3054
static PyObject * transpose(PyObject *self, PyObject *args)
Returns the inverse of the matrix.
Definition: PythonTypes.cpp:3049
static PyObject * getColumn(PyObject *self, PyObject *args)
Get a column of the matrix.
Definition: PythonTypes.cpp:3075
static int init(PyMatrix4f *self, PyObject *args, PyObject *kwds)
Python type initialisation: will set the Matrix4f value from a python string argument list.
Definition: PythonTypes.cpp:2832
static PyObject * transformInverse(PyObject *self, PyObject *args)
Returns the inverse of the matrix assuming that it is on the form.
Definition: PythonTypes.cpp:3039
Python C Type wrapper around Node*.
Definition: PythonTypes.h:152
static PyObject * getFieldList(PyObject *myself, PyObject *args)
Get the list of fields available in this Node.
Definition: PythonTypes.cpp:746
static PyObject * getSingleField(PyObject *self, PyObject *args)
Get a field from the node database.
Definition: PythonTypes.cpp:725
static PyObject * getField(PyObject *myself, char *arg)
Get the field of a node. arg is the name of the field.
Definition: PythonTypes.cpp:714
static PyObject * removeField(PyObject *self, PyObject *args)
If this Node is a DynamicFieldsObject then the specified field is removed.
Definition: PythonTypes.cpp:350
static int init(PyNode *self, PyObject *args, PyObject *kwds)
Python type initialisation: will set the Node value from a python string argument list.
Definition: PythonTypes.cpp:645
static PyObject * clearFields(PyObject *self, PyObject *args)
If this Node is a DynamicFieldsObject then all dynamic fields are removed.
Definition: PythonTypes.cpp:374
static PyObject * closestPoint(PyObject *self, PyObject *args)
Calculate the closest point to the node.
Definition: PythonTypes.cpp:414
static void dealloc(PyNode *self)
Python type deallocation.
Definition: PythonTypes.cpp:640
static PyObject * lineIntersect(PyObject *self, PyObject *args)
Calculate a line intersection with the node.
Definition: PythonTypes.cpp:493
static int compare(PyObject *veca, PyObject *vecb)
Test if two PyNode are equal or not.
Definition: PythonTypes.cpp:601
static PyObject * repr(PyNode *myself, PyObject *args)
Converts a PyNode to a char* string.
Definition: PythonTypes.cpp:653
static PyObject * getTypeName(PyObject *myself, PyObject *args)
Get the type name of this node, i.e. "Group".
Definition: PythonTypes.cpp:672
static PyObject * setName(PyObject *self, PyObject *args)
Set the name of this node.
Definition: PythonTypes.cpp:682
static PyObject * getName(PyObject *myself, PyObject *args)
Get the name of this node.
Definition: PythonTypes.cpp:662
static PyObject * addField(PyObject *self, PyObject *args)
If this Node is a DynamicFieldsObject a new field is added.
Definition: PythonTypes.cpp:291
static PyObject * getAttr(PyObject *myself, char *arg)
If myself encapsulates a node that is not a PythonScript node it works just as getField.
Definition: PythonTypes.cpp:696
static PyObject * create()
create() a new instance of PyNode using Python to allocate the memory and initialise the PyObject hea...
Definition: PythonTypes.cpp:597
static PyObject * clone(PyObject *self, PyObject *args)
Create a clone of the node.
Definition: PythonTypes.cpp:391
PyNumberTypeWrapper is the same as PyNumberTypeWrapperBase with the difference that its mul function ...
Definition: PyTypeWrapper.h:357
Python C Type wrapper around Quaternion.
Definition: PythonTypes.h:617
static PyObject * dotProduct(PyObject *self, PyObject *args)
dotProduct() returns the cos(angle) between two quaternions
Definition: PythonTypes.cpp:4473
static PyObject * normalize(PyObject *self, PyObject *args)
Normalize the Quaternion, i.e.
Definition: PythonTypes.cpp:4465
static PyObject * mul(PyObject *rota, PyObject *rotb)
Multiplies two PyQuaternion objects.
Definition: PythonTypes.cpp:4373
static PyObject * slerp(PyObject *self, PyObject *args)
Spherical linear interpolation between two Quaternions.
Definition: PythonTypes.cpp:4484
static PyObject * toEulerAngles(PyObject *self, PyObject *args)
Get the euler angles( yaw, pitch, roll ) representation of the Rotation.
Definition: PythonTypes.cpp:4511
static PyObject * norm(PyObject *self, PyObject *args)
Returns the Quaternion norm.
Definition: PythonTypes.cpp:4506
static PyObject * inverse(PyObject *self, PyObject *args)
Returns the inverse of the Quaternion.
Definition: PythonTypes.cpp:4521
static int init(PyQuaternion *self, PyObject *args, PyObject *kwds)
Python type initialisation: will set the Quaternion value from a python string argument list.
Definition: PythonTypes.cpp:4411
static PyObject * conjugate(PyObject *self, PyObject *args)
Returns the conjugate of the Quaternion.
Definition: PythonTypes.cpp:4516
Python C Type wrapper around RGBA.
Definition: PythonTypes.h:1030
static int init(PyRGBA *self, PyObject *args, PyObject *kwds)
Python type initialisation: will set the RGBA value from a python string argument list.
Definition: PythonTypes.cpp:4906
Python C Type wrapper around RGB.
Definition: PythonTypes.h:995
static int init(PyRGB *self, PyObject *args, PyObject *kwds)
Python type initialisation: will set the RGB value from a python string argument list.
Definition: PythonTypes.cpp:4709
Python C Type wrapper around Rotation.
Definition: PythonTypes.h:572
static PyObject * slerp(PyObject *self, PyObject *args)
Spherical linear interpolation between two Rotations.
Definition: PythonTypes.cpp:4087
static int init(PyRotation *self, PyObject *args, PyObject *kwds)
Python type initialisation: will set the Rotation value from a python string argument list.
Definition: PythonTypes.cpp:4109
static PyObject * mul(PyObject *rota, PyObject *rotb)
Multiplies two Matrix3f objects.
Definition: PythonTypes.cpp:4173
static PyObject * toEulerAngles(PyObject *self, PyObject *args)
Get the euler angles( yaw, pitch, roll ) representation of the Rotation.
Definition: PythonTypes.cpp:4193
PyTypeWrapper is a template wrapper class to create new Python types from types already existing in t...
Definition: PyTypeWrapper.h:92
Base class for all Python C type wrappers.
Definition: PyTypeWrapper.h:71
Python C Type wrapper around Vec2d.
Definition: PythonTypes.h:317
static PyObject * normalizeSafe(PyObject *self, PyObject *args)
Normalize the vector to be of length 1.
Definition: PythonTypes.cpp:1276
static int init(PyVec2d *self, PyObject *args, PyObject *kwds)
Python type initialisation: will set the Vec2d value from a python string argument list.
Definition: PythonTypes.cpp:1224
static PyObject * length(PyObject *self, PyObject *args)
Get the length of the PyVec2d. args is ignored.
Definition: PythonTypes.cpp:1253
static PyObject * dotProduct(PyObject *self, PyObject *args)
Returns the dot product between two vectors.
Definition: PythonTypes.cpp:1195
static PyObject * normalize(PyObject *self, PyObject *args)
Normalizes the PyVec2d to be of length 1. args is ignored.
Definition: PythonTypes.cpp:1263
static PyObject * lengthSqr(PyObject *self, PyObject *args)
Get the length squared of the PyVec2d. args is ignored.
Definition: PythonTypes.cpp:1258
Python C Type wrapper around Vec2f.
Definition: PythonTypes.h:251
static PyObject * normalizeSafe(PyObject *self, PyObject *args)
Normalize the vector to be of length 1.
Definition: PythonTypes.cpp:1017
static PyObject * lengthSqr(PyObject *self, PyObject *args)
Get the length squared of the PyVec2f. args is ignored.
Definition: PythonTypes.cpp:999
static PyObject * dotProduct(PyObject *self, PyObject *args)
Returns the dot product between two vectors.
Definition: PythonTypes.cpp:936
static int init(PyVec2f *self, PyObject *args, PyObject *kwds)
Python type initialisation: will set the Vec2f value from a python string argument list.
Definition: PythonTypes.cpp:966
static PyObject * normalize(PyObject *self, PyObject *args)
Normalizes the PyVec2f to be of length 1. args is ignored.
Definition: PythonTypes.cpp:1004
static PyObject * length(PyObject *self, PyObject *args)
Get the length of the PyVec2f. args is ignored.
Definition: PythonTypes.cpp:994
Python C Type wrapper around Vec3d.
Definition: PythonTypes.h:441
static PyObject * lengthSqr(PyObject *self, PyObject *args)
Get the length squared of the PyVec3d.
Definition: PythonTypes.cpp:1828
static PyObject * crossProduct(PyObject *self, PyObject *args)
Returns the dot product between two vectors.
Definition: PythonTypes.cpp:1772
static PyObject * dotProduct(PyObject *self, PyObject *args)
Returns the dot product between two vectors.
Definition: PythonTypes.cpp:1760
static int init(PyVec3d *self, PyObject *args, PyObject *kwds)
Python type initialisation: will set the Vec3d value from a python string argument list.
Definition: PythonTypes.cpp:1784
static PyObject * length(PyObject *self, PyObject *args)
Get the length of the PyVec3d.
Definition: PythonTypes.cpp:1823
static PyObject * normalizeSafe(PyObject *self, PyObject *args)
Normalize the vector to be of length 1.
Definition: PythonTypes.cpp:1846
static PyObject * normalize(PyObject *self, PyObject *args)
Normalizes the PyVec3d to be of length 1.
Definition: PythonTypes.cpp:1833
Python C Type wrapper around Vec3f.
Definition: PythonTypes.h:369
static PyObject * dotProduct(PyObject *self, PyObject *args)
Returns the dot product between two vectors.
Definition: PythonTypes.cpp:1505
static PyObject * normalize(PyObject *self, PyObject *args)
Normalizes the PyVec3f to be of length 1. args is ignored.
Definition: PythonTypes.cpp:1549
static PyObject * mod(PyObject *veca, PyObject *vecb)
Performs Vec3f cross product of two PyVec3f instances.
Definition: PythonTypes.cpp:1529
static int init(PyVec3f *self, PyObject *args, PyObject *kwds)
Python type initialisation: will set the Vec3f value from a python string argument list.
Definition: PythonTypes.cpp:1475
static PyObject * lengthSqr(PyObject *self, PyObject *args)
Get the length squared of the PyVec3f. args is ignored.
Definition: PythonTypes.cpp:1544
static PyObject * normalizeSafe(PyObject *self, PyObject *args)
Normalize the vector to be of length 1.
Definition: PythonTypes.cpp:1562
static PyObject * crossProduct(PyObject *self, PyObject *args)
Returns the dot product between two vectors.
Definition: PythonTypes.cpp:1517
static PyObject * length(PyObject *self, PyObject *args)
Get the length of the PyVec3f. args is ignored.
Definition: PythonTypes.cpp:1539
Python C Type wrapper around Vec4d.
Definition: PythonTypes.h:537
static int init(PyVec4d *self, PyObject *args, PyObject *kwds)
Python type initialisation: will set the Vec4d value from a python string argument list.
Definition: PythonTypes.cpp:2255
Python C Type wrapper around Vec4f.
Definition: PythonTypes.h:490
static int init(PyVec4f *self, PyObject *args, PyObject *kwds)
Python type initialisation: will set the Vec4f value from a python string argument list.
Definition: PythonTypes.cpp:2038
PyVecTypeWrapper is the same as PyNumberTypeWrapperBase with the difference that its mul function als...
Definition: PyTypeWrapper.h:315