pybind11Utils.hpp File Reference
#include <Core/Math/Quaternion.hpp>
#include <Core/Matrix/Matrix.hpp>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

Go to the source code of this file.

Namespaces

 CubbyFlow
 

Macros

#define CUBBYFLOW_PYTHON_MAKE_INDEX_FUNCTION2(Class, Func)
 
#define CUBBYFLOW_PYTHON_MAKE_INDEX_FUNCTION3(Class, Func)
 

Functions

Vector2UZ CubbyFlow::TupleToVector2UZ (pybind11::tuple tuple)
 
Vector2UZ CubbyFlow::TupleToVector2UZ (pybind11::list list)
 
Vector3UZ CubbyFlow::TupleToVector3UZ (pybind11::tuple tuple)
 
Vector3UZ CubbyFlow::TupleToVector3UZ (pybind11::list list)
 
pybind11::tuple CubbyFlow::Vector2UZToTuple (const Vector2UZ &size)
 
pybind11::tuple CubbyFlow::Vector3UZToTuple (const Vector3UZ &size)
 
template<typename T , size_t N>
Vector< T, N > CubbyFlow::TupleToVector (pybind11::tuple tuple)
 
template<typename T , size_t N>
Vector< T, N > CubbyFlow::TupleToVector (pybind11::list list)
 
template<typename T >
Quaternion< T > CubbyFlow::TupleToQuaternion (pybind11::tuple tuple)
 
template<typename T >
Quaternion< T > CubbyFlow::TupleToQuaternion (pybind11::list list)
 
Vector2F CubbyFlow::TupleToVector2F (pybind11::tuple tuple)
 
Vector2F CubbyFlow::TupleToVector2F (pybind11::list list)
 
Vector3F CubbyFlow::TupleToVector3F (pybind11::tuple tuple)
 
Vector3F CubbyFlow::TupleToVector3F (pybind11::list list)
 
Vector4F CubbyFlow::TupleToVector4F (pybind11::tuple tuple)
 
Vector4F CubbyFlow::TupleToVector4F (pybind11::list list)
 
QuaternionF CubbyFlow::TupleToQuaternionF (pybind11::tuple tuple)
 
QuaternionF CubbyFlow::TupleToQuaternionF (pybind11::list list)
 
Vector2D CubbyFlow::TupleToVector2D (pybind11::tuple tuple)
 
Vector2D CubbyFlow::TupleToVector2D (pybind11::list list)
 
Vector3D CubbyFlow::TupleToVector3D (pybind11::tuple tuple)
 
Vector3D CubbyFlow::TupleToVector3D (pybind11::list list)
 
Vector4D CubbyFlow::TupleToVector4D (pybind11::tuple tuple)
 
Vector4D CubbyFlow::TupleToVector4D (pybind11::list list)
 
template<typename T >
pybind11::tuple CubbyFlow::Vector2ToTuple (const Vector< T, 2 > &vec)
 
template<typename T >
pybind11::tuple CubbyFlow::Vector3ToTuple (const Vector< T, 3 > &vec)
 
template<typename T >
pybind11::tuple CubbyFlow::Vector4ToTuple (const Vector< T, 4 > &vec)
 
QuaternionD CubbyFlow::TupleToQuaternionD (pybind11::tuple tuple)
 
QuaternionD CubbyFlow::TupleToQuaternionD (pybind11::list list)
 
Vector2UZ CubbyFlow::ObjectToVector2UZ (const pybind11::object &obj)
 
Vector3UZ CubbyFlow::ObjectToVector3UZ (const pybind11::object &obj)
 
Vector2F CubbyFlow::ObjectToVector2F (const pybind11::object &obj)
 
Vector2D CubbyFlow::ObjectToVector2D (const pybind11::object &obj)
 
Vector3F CubbyFlow::ObjectToVector3F (const pybind11::object &obj)
 
Vector3D CubbyFlow::ObjectToVector3D (const pybind11::object &obj)
 
Vector4F CubbyFlow::ObjectToVector4F (const pybind11::object &obj)
 
Vector4D CubbyFlow::ObjectToVector4D (const pybind11::object &obj)
 
QuaternionF CubbyFlow::ObjectToQuaternionF (const pybind11::object &obj)
 
QuaternionD CubbyFlow::ObjectToQuaternionD (const pybind11::object &obj)
 
void CubbyFlow::ParseGridResizeParams (pybind11::args args, pybind11::kwargs kwargs, Vector2UZ &resolution, Vector2D &gridSpacing, Vector2D &gridOrigin)
 

Macro Definition Documentation

◆ CUBBYFLOW_PYTHON_MAKE_INDEX_FUNCTION2

#define CUBBYFLOW_PYTHON_MAKE_INDEX_FUNCTION2 (   Class,
  Func 
)
Value:
[](const Class& instance, pybind11::args args) { \
if (args.size() == 1) \
{ \
return instance.Func(ObjectToVector2UZ(args[0])); \
} \
else \
{ \
throw std::invalid_argument("Invalid number of arguments."); \
} \
}
Vector2UZ ObjectToVector2UZ(const pybind11::object &obj)
Definition: pybind11Utils.hpp:272

◆ CUBBYFLOW_PYTHON_MAKE_INDEX_FUNCTION3

#define CUBBYFLOW_PYTHON_MAKE_INDEX_FUNCTION3 (   Class,
  Func 
)
Value:
[](const Class& instance, pybind11::args args) { \
if (args.size() == 1) \
{ \
return instance.Func(ObjectToVector3UZ(args[0])); \
} \
else \
{ \
throw std::invalid_argument("Invalid number of arguments."); \
} \
}
Vector3UZ ObjectToVector3UZ(const pybind11::object &obj)
Definition: pybind11Utils.hpp:294