Skip to content

Commit

Permalink
Add int64_t specializations of Vec and Box.
Browse files Browse the repository at this point in the history
Suggested by @ssteinbach for OpenTimelineIO.

Signed-off-by: Cary Phillips <[email protected]>
  • Loading branch information
cary-ilm committed Mar 4, 2021
1 parent 8b3363a commit 5f43024
Show file tree
Hide file tree
Showing 16 changed files with 192 additions and 55 deletions.
2 changes: 2 additions & 0 deletions src/Imath/ImathBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ typedef Box<V2s> Box2s;

/// 2D box of base type `int`.
typedef Box<V2i> Box2i;
typedef Box<V2i64> Box2i64;

/// 2D box of base type `float`.
typedef Box<V2f> Box2f;
Expand All @@ -151,6 +152,7 @@ typedef Box<V3s> Box3s;

/// 3D box of base type `int`.
typedef Box<V3i> Box3i;
typedef Box<V3i64> Box3i64;

/// 3D box of base type `float`.
typedef Box<V3f> Box3f;
Expand Down
3 changes: 3 additions & 0 deletions src/Imath/ImathVec.h
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ typedef Vec2<short> V2s;

/// Vec2 of integer
typedef Vec2<int> V2i;
typedef Vec2<int64_t> V2i64;

/// Vec2 of float
typedef Vec2<float> V2f;
Expand All @@ -704,6 +705,7 @@ typedef Vec3<short> V3s;

/// Vec3 of integer
typedef Vec3<int> V3i;
typedef Vec3<int64_t> V3i64;

/// Vec3 of float
typedef Vec3<float> V3f;
Expand All @@ -716,6 +718,7 @@ typedef Vec4<short> V4s;

/// Vec4 of integer
typedef Vec4<int> V4i;
typedef Vec4<int64_t> V4i64;

/// Vec4 of float
typedef Vec4<float> V4f;
Expand Down
36 changes: 36 additions & 0 deletions src/ImathTest/testBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -934,16 +934,19 @@ testBox()
//
testConstructors<IMATH_INTERNAL_NAMESPACE::V2s> ("V2s");
testConstructors<IMATH_INTERNAL_NAMESPACE::V2i> ("V2i");
testConstructors<IMATH_INTERNAL_NAMESPACE::V2i64> ("V2i64");
testConstructors<IMATH_INTERNAL_NAMESPACE::V2f> ("V2f");
testConstructors<IMATH_INTERNAL_NAMESPACE::V2d> ("V2d");

testConstructors<IMATH_INTERNAL_NAMESPACE::V3s> ("V3s");
testConstructors<IMATH_INTERNAL_NAMESPACE::V3i> ("V3i");
testConstructors<IMATH_INTERNAL_NAMESPACE::V3i64> ("V3i64");
testConstructors<IMATH_INTERNAL_NAMESPACE::V3f> ("V3f");
testConstructors<IMATH_INTERNAL_NAMESPACE::V3d> ("V3d");

testConstructors<IMATH_INTERNAL_NAMESPACE::V4s> ("V4s");
testConstructors<IMATH_INTERNAL_NAMESPACE::V4i> ("V4i");
testConstructors<IMATH_INTERNAL_NAMESPACE::V4i64> ("V4i64");
testConstructors<IMATH_INTERNAL_NAMESPACE::V4f> ("V4f");
testConstructors<IMATH_INTERNAL_NAMESPACE::V4d> ("V4d");

Expand All @@ -952,16 +955,19 @@ testBox()
//
testMakeEmpty<IMATH_INTERNAL_NAMESPACE::V2s> ("V2s");
testMakeEmpty<IMATH_INTERNAL_NAMESPACE::V2i> ("V2i");
testMakeEmpty<IMATH_INTERNAL_NAMESPACE::V2i64> ("V2i64");
testMakeEmpty<IMATH_INTERNAL_NAMESPACE::V2f> ("V2f");
testMakeEmpty<IMATH_INTERNAL_NAMESPACE::V2d> ("V2d");

testMakeEmpty<IMATH_INTERNAL_NAMESPACE::V3s> ("V3s");
testMakeEmpty<IMATH_INTERNAL_NAMESPACE::V3i> ("V3i");
testMakeEmpty<IMATH_INTERNAL_NAMESPACE::V3i64> ("V3i64");
testMakeEmpty<IMATH_INTERNAL_NAMESPACE::V3f> ("V3f");
testMakeEmpty<IMATH_INTERNAL_NAMESPACE::V3d> ("V3d");

testMakeEmpty<IMATH_INTERNAL_NAMESPACE::V4s> ("V4s");
testMakeEmpty<IMATH_INTERNAL_NAMESPACE::V4i> ("V4i");
testMakeEmpty<IMATH_INTERNAL_NAMESPACE::V4i64> ("V4i64");
testMakeEmpty<IMATH_INTERNAL_NAMESPACE::V4f> ("V4f");
testMakeEmpty<IMATH_INTERNAL_NAMESPACE::V4d> ("V4d");

Expand All @@ -970,16 +976,19 @@ testBox()
//
testMakeInfinite<IMATH_INTERNAL_NAMESPACE::V2s> ("V2s");
testMakeInfinite<IMATH_INTERNAL_NAMESPACE::V2i> ("V2i");
testMakeInfinite<IMATH_INTERNAL_NAMESPACE::V2i64> ("V2i64");
testMakeInfinite<IMATH_INTERNAL_NAMESPACE::V2f> ("V2f");
testMakeInfinite<IMATH_INTERNAL_NAMESPACE::V2d> ("V2d");

testMakeInfinite<IMATH_INTERNAL_NAMESPACE::V3s> ("V3s");
testMakeInfinite<IMATH_INTERNAL_NAMESPACE::V3i> ("V3i");
testMakeInfinite<IMATH_INTERNAL_NAMESPACE::V3i64> ("V3i64");
testMakeInfinite<IMATH_INTERNAL_NAMESPACE::V3f> ("V3f");
testMakeInfinite<IMATH_INTERNAL_NAMESPACE::V3d> ("V3d");

testMakeInfinite<IMATH_INTERNAL_NAMESPACE::V4s> ("V4s");
testMakeInfinite<IMATH_INTERNAL_NAMESPACE::V4i> ("V4i");
testMakeInfinite<IMATH_INTERNAL_NAMESPACE::V4i64> ("V4i64");
testMakeInfinite<IMATH_INTERNAL_NAMESPACE::V4f> ("V4f");
testMakeInfinite<IMATH_INTERNAL_NAMESPACE::V4d> ("V4d");

Expand All @@ -988,16 +997,19 @@ testBox()
//
testExtendByPoint<IMATH_INTERNAL_NAMESPACE::V2s> ("V2s");
testExtendByPoint<IMATH_INTERNAL_NAMESPACE::V2i> ("V2i");
testExtendByPoint<IMATH_INTERNAL_NAMESPACE::V2i64> ("V2i64");
testExtendByPoint<IMATH_INTERNAL_NAMESPACE::V2f> ("V2f");
testExtendByPoint<IMATH_INTERNAL_NAMESPACE::V2d> ("V2d");

testExtendByPoint<IMATH_INTERNAL_NAMESPACE::V3s> ("V3s");
testExtendByPoint<IMATH_INTERNAL_NAMESPACE::V3i> ("V3i");
testExtendByPoint<IMATH_INTERNAL_NAMESPACE::V3i64> ("V3i64");
testExtendByPoint<IMATH_INTERNAL_NAMESPACE::V3f> ("V3f");
testExtendByPoint<IMATH_INTERNAL_NAMESPACE::V3d> ("V3d");

testExtendByPoint<IMATH_INTERNAL_NAMESPACE::V4s> ("V4s");
testExtendByPoint<IMATH_INTERNAL_NAMESPACE::V4i> ("V4i");
testExtendByPoint<IMATH_INTERNAL_NAMESPACE::V4i64> ("V4i64");
testExtendByPoint<IMATH_INTERNAL_NAMESPACE::V4f> ("V4f");
testExtendByPoint<IMATH_INTERNAL_NAMESPACE::V4d> ("V4d");

Expand All @@ -1006,16 +1018,19 @@ testBox()
//
testExtendByBox<IMATH_INTERNAL_NAMESPACE::V2s> ("V2s");
testExtendByBox<IMATH_INTERNAL_NAMESPACE::V2i> ("V2i");
testExtendByBox<IMATH_INTERNAL_NAMESPACE::V2i64> ("V2i64");
testExtendByBox<IMATH_INTERNAL_NAMESPACE::V2f> ("V2f");
testExtendByBox<IMATH_INTERNAL_NAMESPACE::V2d> ("V2d");

testExtendByBox<IMATH_INTERNAL_NAMESPACE::V3s> ("V3s");
testExtendByBox<IMATH_INTERNAL_NAMESPACE::V3i> ("V3i");
testExtendByBox<IMATH_INTERNAL_NAMESPACE::V3i64> ("V3i64");
testExtendByBox<IMATH_INTERNAL_NAMESPACE::V3f> ("V3f");
testExtendByBox<IMATH_INTERNAL_NAMESPACE::V3d> ("V3d");

testExtendByBox<IMATH_INTERNAL_NAMESPACE::V4s> ("V4s");
testExtendByBox<IMATH_INTERNAL_NAMESPACE::V4i> ("V4i");
testExtendByBox<IMATH_INTERNAL_NAMESPACE::V4i64> ("V4i64");
testExtendByBox<IMATH_INTERNAL_NAMESPACE::V4f> ("V4f");
testExtendByBox<IMATH_INTERNAL_NAMESPACE::V4d> ("V4d");

Expand All @@ -1024,16 +1039,19 @@ testBox()
//
testComparators<IMATH_INTERNAL_NAMESPACE::V2s> ("V2s");
testComparators<IMATH_INTERNAL_NAMESPACE::V2i> ("V2i");
testComparators<IMATH_INTERNAL_NAMESPACE::V2i64> ("V2i64");
testComparators<IMATH_INTERNAL_NAMESPACE::V2f> ("V2f");
testComparators<IMATH_INTERNAL_NAMESPACE::V2d> ("V2d");

testComparators<IMATH_INTERNAL_NAMESPACE::V3s> ("V3s");
testComparators<IMATH_INTERNAL_NAMESPACE::V3i> ("V3i");
testComparators<IMATH_INTERNAL_NAMESPACE::V3i64> ("V3i64");
testComparators<IMATH_INTERNAL_NAMESPACE::V3f> ("V3f");
testComparators<IMATH_INTERNAL_NAMESPACE::V3d> ("V3d");

testComparators<IMATH_INTERNAL_NAMESPACE::V4s> ("V4s");
testComparators<IMATH_INTERNAL_NAMESPACE::V4i> ("V4i");
testComparators<IMATH_INTERNAL_NAMESPACE::V4i64> ("V4i64");
testComparators<IMATH_INTERNAL_NAMESPACE::V4f> ("V4f");
testComparators<IMATH_INTERNAL_NAMESPACE::V4d> ("V4d");

Expand All @@ -1042,16 +1060,19 @@ testBox()
//
testSize<IMATH_INTERNAL_NAMESPACE::V2s> ("V2s");
testSize<IMATH_INTERNAL_NAMESPACE::V2i> ("V2i");
testSize<IMATH_INTERNAL_NAMESPACE::V2i64> ("V2i64");
testSize<IMATH_INTERNAL_NAMESPACE::V2f> ("V2f");
testSize<IMATH_INTERNAL_NAMESPACE::V2d> ("V2d");

testSize<IMATH_INTERNAL_NAMESPACE::V3s> ("V3s");
testSize<IMATH_INTERNAL_NAMESPACE::V3i> ("V3i");
testSize<IMATH_INTERNAL_NAMESPACE::V3i64> ("V3i64");
testSize<IMATH_INTERNAL_NAMESPACE::V3f> ("V3f");
testSize<IMATH_INTERNAL_NAMESPACE::V3d> ("V3d");

testSize<IMATH_INTERNAL_NAMESPACE::V4s> ("V4s");
testSize<IMATH_INTERNAL_NAMESPACE::V4i> ("V4i");
testSize<IMATH_INTERNAL_NAMESPACE::V4i64> ("V4i64");
testSize<IMATH_INTERNAL_NAMESPACE::V4f> ("V4f");
testSize<IMATH_INTERNAL_NAMESPACE::V4d> ("V4d");

Expand All @@ -1060,16 +1081,19 @@ testBox()
//
testCenter<IMATH_INTERNAL_NAMESPACE::V2s> ("V2s");
testCenter<IMATH_INTERNAL_NAMESPACE::V2i> ("V2i");
testCenter<IMATH_INTERNAL_NAMESPACE::V2i64> ("V2i64");
testCenter<IMATH_INTERNAL_NAMESPACE::V2f> ("V2f");
testCenter<IMATH_INTERNAL_NAMESPACE::V2d> ("V2d");

testCenter<IMATH_INTERNAL_NAMESPACE::V3s> ("V3s");
testCenter<IMATH_INTERNAL_NAMESPACE::V3i> ("V3i");
testCenter<IMATH_INTERNAL_NAMESPACE::V3i64> ("V3i64");
testCenter<IMATH_INTERNAL_NAMESPACE::V3f> ("V3f");
testCenter<IMATH_INTERNAL_NAMESPACE::V3d> ("V3d");

testCenter<IMATH_INTERNAL_NAMESPACE::V4s> ("V4s");
testCenter<IMATH_INTERNAL_NAMESPACE::V4i> ("V4i");
testCenter<IMATH_INTERNAL_NAMESPACE::V4i64> ("V4i64");
testCenter<IMATH_INTERNAL_NAMESPACE::V4f> ("V4f");
testCenter<IMATH_INTERNAL_NAMESPACE::V4d> ("V4d");

Expand All @@ -1078,16 +1102,19 @@ testBox()
//
testIsEmpty<IMATH_INTERNAL_NAMESPACE::V2s> ("V2s");
testIsEmpty<IMATH_INTERNAL_NAMESPACE::V2i> ("V2i");
testIsEmpty<IMATH_INTERNAL_NAMESPACE::V2i64> ("V2i64");
testIsEmpty<IMATH_INTERNAL_NAMESPACE::V2f> ("V2f");
testIsEmpty<IMATH_INTERNAL_NAMESPACE::V2d> ("V2d");

testIsEmpty<IMATH_INTERNAL_NAMESPACE::V3s> ("V3s");
testIsEmpty<IMATH_INTERNAL_NAMESPACE::V3i> ("V3i");
testIsEmpty<IMATH_INTERNAL_NAMESPACE::V3i64> ("V3i64");
testIsEmpty<IMATH_INTERNAL_NAMESPACE::V3f> ("V3f");
testIsEmpty<IMATH_INTERNAL_NAMESPACE::V3d> ("V3d");

testIsEmpty<IMATH_INTERNAL_NAMESPACE::V4s> ("V4s");
testIsEmpty<IMATH_INTERNAL_NAMESPACE::V4i> ("V4i");
testIsEmpty<IMATH_INTERNAL_NAMESPACE::V4i64> ("V4i64");
testIsEmpty<IMATH_INTERNAL_NAMESPACE::V4f> ("V4f");
testIsEmpty<IMATH_INTERNAL_NAMESPACE::V4d> ("V4d");

Expand All @@ -1096,16 +1123,19 @@ testBox()
//
testIsInfinite<IMATH_INTERNAL_NAMESPACE::V2s> ("V2s");
testIsInfinite<IMATH_INTERNAL_NAMESPACE::V2i> ("V2i");
testIsInfinite<IMATH_INTERNAL_NAMESPACE::V2i64> ("V2i64");
testIsInfinite<IMATH_INTERNAL_NAMESPACE::V2f> ("V2f");
testIsInfinite<IMATH_INTERNAL_NAMESPACE::V2d> ("V2d");

testIsInfinite<IMATH_INTERNAL_NAMESPACE::V3s> ("V3s");
testIsInfinite<IMATH_INTERNAL_NAMESPACE::V3i> ("V3i");
testIsInfinite<IMATH_INTERNAL_NAMESPACE::V3i64> ("V3i64");
testIsInfinite<IMATH_INTERNAL_NAMESPACE::V3f> ("V3f");
testIsInfinite<IMATH_INTERNAL_NAMESPACE::V3d> ("V3d");

testIsInfinite<IMATH_INTERNAL_NAMESPACE::V4s> ("V4s");
testIsInfinite<IMATH_INTERNAL_NAMESPACE::V4i> ("V4i");
testIsInfinite<IMATH_INTERNAL_NAMESPACE::V4i64> ("V4i64");
testIsInfinite<IMATH_INTERNAL_NAMESPACE::V4f> ("V4f");
testIsInfinite<IMATH_INTERNAL_NAMESPACE::V4d> ("V4d");

Expand All @@ -1114,16 +1144,19 @@ testBox()
//
testHasVolume<IMATH_INTERNAL_NAMESPACE::V2s> ("V2s");
testHasVolume<IMATH_INTERNAL_NAMESPACE::V2i> ("V2i");
testHasVolume<IMATH_INTERNAL_NAMESPACE::V2i64> ("V2i64");
testHasVolume<IMATH_INTERNAL_NAMESPACE::V2f> ("V2f");
testHasVolume<IMATH_INTERNAL_NAMESPACE::V2d> ("V2d");

testHasVolume<IMATH_INTERNAL_NAMESPACE::V3s> ("V3s");
testHasVolume<IMATH_INTERNAL_NAMESPACE::V3i> ("V3i");
testHasVolume<IMATH_INTERNAL_NAMESPACE::V3i64> ("V3i64");
testHasVolume<IMATH_INTERNAL_NAMESPACE::V3f> ("V3f");
testHasVolume<IMATH_INTERNAL_NAMESPACE::V3d> ("V3d");

testHasVolume<IMATH_INTERNAL_NAMESPACE::V4s> ("V4s");
testHasVolume<IMATH_INTERNAL_NAMESPACE::V4i> ("V4i");
testHasVolume<IMATH_INTERNAL_NAMESPACE::V4i64> ("V4i64");
testHasVolume<IMATH_INTERNAL_NAMESPACE::V4f> ("V4f");
testHasVolume<IMATH_INTERNAL_NAMESPACE::V4d> ("V4d");

Expand All @@ -1132,16 +1165,19 @@ testBox()
//
testMajorAxis<IMATH_INTERNAL_NAMESPACE::V2s> ("V2s");
testMajorAxis<IMATH_INTERNAL_NAMESPACE::V2i> ("V2i");
testMajorAxis<IMATH_INTERNAL_NAMESPACE::V2i64> ("V2i64");
testMajorAxis<IMATH_INTERNAL_NAMESPACE::V2f> ("V2f");
testMajorAxis<IMATH_INTERNAL_NAMESPACE::V2d> ("V2d");

testMajorAxis<IMATH_INTERNAL_NAMESPACE::V3s> ("V3s");
testMajorAxis<IMATH_INTERNAL_NAMESPACE::V3i> ("V3i");
testMajorAxis<IMATH_INTERNAL_NAMESPACE::V3i64> ("V3i64");
testMajorAxis<IMATH_INTERNAL_NAMESPACE::V3f> ("V3f");
testMajorAxis<IMATH_INTERNAL_NAMESPACE::V3d> ("V3d");

testMajorAxis<IMATH_INTERNAL_NAMESPACE::V4s> ("V4s");
testMajorAxis<IMATH_INTERNAL_NAMESPACE::V4i> ("V4i");
testMajorAxis<IMATH_INTERNAL_NAMESPACE::V4i64> ("V4i64");
testMajorAxis<IMATH_INTERNAL_NAMESPACE::V4f> ("V4f");
testMajorAxis<IMATH_INTERNAL_NAMESPACE::V4d> ("V4d");

Expand Down
24 changes: 16 additions & 8 deletions src/python/PyImath/PyImathBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,25 @@ using namespace PyImath;
template <class T> struct BoxName { static const char *value; };
template <> const char *BoxName<IMATH_NAMESPACE::V2s>::value = "Box2s";
template <> const char *BoxName<IMATH_NAMESPACE::V2i>::value = "Box2i";
template <> const char *BoxName<IMATH_NAMESPACE::V2i64>::value = "Box2i64";
template <> const char *BoxName<IMATH_NAMESPACE::V2f>::value = "Box2f";
template <> const char *BoxName<IMATH_NAMESPACE::V2d>::value = "Box2d";
template <> const char *BoxName<IMATH_NAMESPACE::V3s>::value = "Box3s";
template <> const char *BoxName<IMATH_NAMESPACE::V3i>::value = "Box3i";
template <> const char *BoxName<IMATH_NAMESPACE::V3i64>::value = "Box3i64";
template <> const char *BoxName<IMATH_NAMESPACE::V3f>::value = "Box3f";
template <> const char *BoxName<IMATH_NAMESPACE::V3d>::value = "Box3d";

template <> PYIMATH_EXPORT const char *PyImath::Box2sArray::name() { return "Box2sArray"; }
template <> PYIMATH_EXPORT const char *PyImath::Box2iArray::name() { return "Box2iArray"; }
template <> PYIMATH_EXPORT const char *PyImath::Box2fArray::name() { return "Box2fArray"; }
template <> PYIMATH_EXPORT const char *PyImath::Box2dArray::name() { return "Box2dArray"; }
template <> PYIMATH_EXPORT const char *PyImath::Box3sArray::name() { return "Box3sArray"; }
template <> PYIMATH_EXPORT const char *PyImath::Box3iArray::name() { return "Box3iArray"; }
template <> PYIMATH_EXPORT const char *PyImath::Box3fArray::name() { return "Box3fArray"; }
template <> PYIMATH_EXPORT const char *PyImath::Box3dArray::name() { return "Box3dArray"; }
template <> PYIMATH_EXPORT const char *PyImath::Box2sArray::name() { return "Box2sArray"; }
template <> PYIMATH_EXPORT const char *PyImath::Box2iArray::name() { return "Box2iArray"; }
template <> PYIMATH_EXPORT const char *PyImath::Box2i64Array::name() { return "Box2i64Array"; }
template <> PYIMATH_EXPORT const char *PyImath::Box2fArray::name() { return "Box2fArray"; }
template <> PYIMATH_EXPORT const char *PyImath::Box2dArray::name() { return "Box2dArray"; }
template <> PYIMATH_EXPORT const char *PyImath::Box3sArray::name() { return "Box3sArray"; }
template <> PYIMATH_EXPORT const char *PyImath::Box3iArray::name() { return "Box3iArray"; }
template <> PYIMATH_EXPORT const char *PyImath::Box3i64Array::name() { return "Box3i64Array"; }
template <> PYIMATH_EXPORT const char *PyImath::Box3fArray::name() { return "Box3fArray"; }
template <> PYIMATH_EXPORT const char *PyImath::Box3dArray::name() { return "Box3dArray"; }

template <class T>
static Box<T> * box2TupleConstructor1(const tuple &t)
Expand Down Expand Up @@ -326,6 +330,7 @@ register_Box2()
.def("__init__", make_constructor(boxConstructor<T, IMATH_NAMESPACE::V2f>))
.def("__init__", make_constructor(boxConstructor<T, IMATH_NAMESPACE::V2d>))
.def("__init__", make_constructor(boxConstructor<T, IMATH_NAMESPACE::V2i>))
.def("__init__", make_constructor(boxConstructor<T, IMATH_NAMESPACE::V2i64>))
.def_readwrite("min",&Box<T>::min)
.def_readwrite("max",&Box<T>::max)
.def("min", &boxMin<T>)
Expand Down Expand Up @@ -388,6 +393,7 @@ register_Box3()
.def("__init__", make_constructor(boxConstructor<T, IMATH_NAMESPACE::V3f>))
.def("__init__", make_constructor(boxConstructor<T, IMATH_NAMESPACE::V3d>))
.def("__init__", make_constructor(boxConstructor<T, IMATH_NAMESPACE::V3i>))
.def("__init__", make_constructor(boxConstructor<T, IMATH_NAMESPACE::V3i64>))
.def_readwrite("min",&Box<T>::min)
.def_readwrite("max",&Box<T>::max)
.def(self == self) // NOSONAR - suppress SonarCloud bug report.
Expand Down Expand Up @@ -425,10 +431,12 @@ register_Box3()

template PYIMATH_EXPORT class_<IMATH_NAMESPACE::Box<IMATH_NAMESPACE::V2s> > register_Box2<IMATH_NAMESPACE::V2s>();
template PYIMATH_EXPORT class_<IMATH_NAMESPACE::Box<IMATH_NAMESPACE::V2i> > register_Box2<IMATH_NAMESPACE::V2i>();
template PYIMATH_EXPORT class_<IMATH_NAMESPACE::Box<IMATH_NAMESPACE::V2i64> > register_Box2<IMATH_NAMESPACE::V2i64>();
template PYIMATH_EXPORT class_<IMATH_NAMESPACE::Box<IMATH_NAMESPACE::V2f> > register_Box2<IMATH_NAMESPACE::V2f>();
template PYIMATH_EXPORT class_<IMATH_NAMESPACE::Box<IMATH_NAMESPACE::V2d> > register_Box2<IMATH_NAMESPACE::V2d>();
template PYIMATH_EXPORT class_<IMATH_NAMESPACE::Box<IMATH_NAMESPACE::V3s> > register_Box3<IMATH_NAMESPACE::V3s>();
template PYIMATH_EXPORT class_<IMATH_NAMESPACE::Box<IMATH_NAMESPACE::V3i> > register_Box3<IMATH_NAMESPACE::V3i>();
template PYIMATH_EXPORT class_<IMATH_NAMESPACE::Box<IMATH_NAMESPACE::V3i64> > register_Box3<IMATH_NAMESPACE::V3i64>();
template PYIMATH_EXPORT class_<IMATH_NAMESPACE::Box<IMATH_NAMESPACE::V3f> > register_Box3<IMATH_NAMESPACE::V3f>();
template PYIMATH_EXPORT class_<IMATH_NAMESPACE::Box<IMATH_NAMESPACE::V3d> > register_Box3<IMATH_NAMESPACE::V3d>();

Expand Down
22 changes: 13 additions & 9 deletions src/python/PyImath/PyImathBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,17 @@ template <class T> boost::python::class_<IMATH_NAMESPACE::Box<T> > register_Box3

template <class T> boost::python::class_<FixedArray<IMATH_NAMESPACE::Box<T> > > register_BoxArray();

typedef FixedArray<IMATH_NAMESPACE::Box2s> Box2sArray;
typedef FixedArray<IMATH_NAMESPACE::Box2i> Box2iArray;
typedef FixedArray<IMATH_NAMESPACE::Box2f> Box2fArray;
typedef FixedArray<IMATH_NAMESPACE::Box2d> Box2dArray;

typedef FixedArray<IMATH_NAMESPACE::Box3s> Box3sArray;
typedef FixedArray<IMATH_NAMESPACE::Box3i> Box3iArray;
typedef FixedArray<IMATH_NAMESPACE::Box3f> Box3fArray;
typedef FixedArray<IMATH_NAMESPACE::Box3d> Box3dArray;
typedef FixedArray<IMATH_NAMESPACE::Box2s> Box2sArray;
typedef FixedArray<IMATH_NAMESPACE::Box2i> Box2iArray;
typedef FixedArray<IMATH_NAMESPACE::Box2i64> Box2i64Array;
typedef FixedArray<IMATH_NAMESPACE::Box2f> Box2fArray;
typedef FixedArray<IMATH_NAMESPACE::Box2d> Box2dArray;

typedef FixedArray<IMATH_NAMESPACE::Box3s> Box3sArray;
typedef FixedArray<IMATH_NAMESPACE::Box3i> Box3iArray;
typedef FixedArray<IMATH_NAMESPACE::Box3i64> Box3i64Array;
typedef FixedArray<IMATH_NAMESPACE::Box3f> Box3fArray;
typedef FixedArray<IMATH_NAMESPACE::Box3d> Box3dArray;

//

Expand Down Expand Up @@ -190,10 +192,12 @@ Box3<T>::convert (PyObject *p, IMATH_NAMESPACE::Box< IMATH_NAMESPACE::Vec3<T> >
}

typedef Box2<int> Box2i;
typedef Box2<int64_t> Box2i64;
typedef Box2<float> Box2f;
typedef Box2<double> Box2d;

typedef Box3<int> Box3i;
typedef Box3<int64_t> Box3i64;
typedef Box3<float> Box3f;
typedef Box3<double> Box3d;

Expand Down
Loading

0 comments on commit 5f43024

Please sign in to comment.