Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/python/api2_2x/vector.h')
-rw-r--r--source/blender/python/api2_2x/vector.h38
1 files changed, 22 insertions, 16 deletions
diff --git a/source/blender/python/api2_2x/vector.h b/source/blender/python/api2_2x/vector.h
index 048fa1df8bc..40e5851359a 100644
--- a/source/blender/python/api2_2x/vector.h
+++ b/source/blender/python/api2_2x/vector.h
@@ -33,34 +33,40 @@
#ifndef EXPP_vector_h
#define EXPP_vector_h
+#include "Python.h"
+#include "gen_utils.h"
+#include "Types.h"
+#include "matrix.h"
+#include "BKE_utildefines.h"
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/*****************************/
+// Vector Python Object
+/*****************************/
+
#define VectorObject_Check(v) ((v)->ob_type == &vector_Type)
typedef struct {
- PyObject_VAR_HEAD
- struct{
- float *py_data; //python managed
- float *blend_data; //blender managed
- }data;
- float *vec; //1D array of data (alias)
+ PyObject_VAR_HEAD float *vec;
int size;
- PyObject *coerced_object;
+ int flag;
+ //0 - no coercion
+ //1 - coerced from int
+ //2 - coerced from float
+ int delete_pymem; /* flag to delete the memory vec points at */
} VectorObject;
-/*coerced_object is a pointer to the object that it was
-coerced from when a dummy vector needs to be created from
-the coerce() function for numeric protocol operations*/
-
-/*struct data contains a pointer to the actual data that the
-object uses. It can use either PyMem allocated data (which will
-be stored in py_data) or be a wrapper for data allocated through
-blender (stored in blend_data). This is an either/or struct not both*/
//prototypes
+PyObject *newVectorObject( float *vec, int size );
+PyObject *newVectorProxy( float *vec, int size );
PyObject *Vector_Zero( VectorObject * self );
PyObject *Vector_Normalize( VectorObject * self );
PyObject *Vector_Negate( VectorObject * self );
PyObject *Vector_Resize2D( VectorObject * self );
PyObject *Vector_Resize3D( VectorObject * self );
PyObject *Vector_Resize4D( VectorObject * self );
-PyObject *newVectorObject(float *vec, int size, int type);
#endif /* EXPP_vector_h */