mantaflow  0.10
A framework for fluid simulation
Classes | Macros | Functions
pvec3.cpp File Reference
#include "pythonInclude.h"
#include <string>
#include <sstream>
#include "vectorbase.h"
#include "structmember.h"
#include "manta.h"

Classes

struct  Manta::PbVec3
 
struct  Manta::PbVec4
 

Macros

#define CONVERTVEC(obj)
 
#define OPHEADER
 
#define OPHEADER1
 

Functions

PyObject * Manta::PbNew (const Vec3 &a)
 
PyObject * Manta::PbVec3Add (PyObject *a, PyObject *b)
 
PyObject * Manta::PbVec3Sub (PyObject *a, PyObject *b)
 
PyObject * Manta::PbVec3Mult (PyObject *a, PyObject *b)
 
PyObject * Manta::PbVec3Div (PyObject *a, PyObject *b)
 
PyObject * Manta::PbVec3Negative (PyObject *a)
 
PyObject * Manta::castPy (PyTypeObject *p)
 
void Manta::PbVecInitialize (PyObject *module)
 

Macro Definition Documentation

◆ CONVERTVEC

#define CONVERTVEC (   obj)
Value:
Vec3 v##obj; \
if (PyObject_TypeCheck(obj, &PbVec3Type)) \
v##obj = Vec3(&( ((PbVec3*)obj)->data[0])); \
else if (PyFloat_Check(obj)) \
v##obj = Vec3(PyFloat_AsDouble(obj)); \
else if (PyLong_Check(obj)) \
v##obj = Vec3(PyLong_AsDouble(obj)); \
else { \
Py_INCREF(Py_NotImplemented); \
return Py_NotImplemented; \
} \
Vector3D< Real > Vec3
3D vector class of type Real (typically float)
Definition: randomstream.h:545

◆ OPHEADER

#define OPHEADER
Value:
if (!PyObject_TypeCheck(a, &PbVec3Type) && !PyObject_TypeCheck(b, &PbVec3Type)) { \
Py_INCREF(Py_NotImplemented); \
return Py_NotImplemented; \
} \
CONVERTVEC(a) \
CONVERTVEC(b)

◆ OPHEADER1

#define OPHEADER1
Value:
if (!PyObject_TypeCheck(a, &PbVec3Type)) { \
Py_INCREF(Py_NotImplemented); \
return Py_NotImplemented; \
} \
CONVERTVEC(a)