MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/Imath / register_Box3

Function register_Box3

src/python/PyImath/PyImathBox.cpp:333–384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331
332template <class T>
333class_<IMATH_NAMESPACE::Box<T> >
334register_Box3()
335{
336 void (IMATH_NAMESPACE::Box<T>::*extendBy1)(const T&) = &IMATH_NAMESPACE::Box<T>::extendBy;
337 void (IMATH_NAMESPACE::Box<T>::*extendBy2)(const IMATH_NAMESPACE::Box<T>&) = &IMATH_NAMESPACE::Box<T>::extendBy;
338 bool (IMATH_NAMESPACE::Box<T>::*intersects1)(const T&) const = &IMATH_NAMESPACE::Box<T>::intersects;
339 bool (IMATH_NAMESPACE::Box<T>::*intersects2)(const IMATH_NAMESPACE::Box<T>&) const = &IMATH_NAMESPACE::Box<T>::intersects;
340 const char *name = BoxName<T>::value;
341 class_<Box<T> > box_class(name);
342 box_class
343 .def(init<>("Box() create empty box") )
344 .def(init<T>("Box(point)create box containing the given point") )
345 .def(init<T,T>("Box(point,point) create box continaing min and max") )
346 .def("__init__", make_constructor(box3TupleConstructor1<T>), "Box(point) where point is a python tuple")
347 .def("__init__", make_constructor(box3TupleConstructor2<T>), "Box(point,point) where point is a python tuple")
348 .def("__init__", make_constructor(boxConstructor<T, IMATH_NAMESPACE::V3f>))
349 .def("__init__", make_constructor(boxConstructor<T, IMATH_NAMESPACE::V3d>))
350 .def("__init__", make_constructor(boxConstructor<T, IMATH_NAMESPACE::V3i>))
351 .def("__init__", make_constructor(boxConstructor<T, IMATH_NAMESPACE::V3i64>))
352 .def_readwrite("min",&Box<T>::min)
353 .def_readwrite("max",&Box<T>::max)
354 .def(self == self) // NOSONAR - suppress SonarCloud bug report.
355 .def(self != self) // NOSONAR - suppress SonarCloud bug report.
356 .def("__mul__", &mulM44<T, float>)
357 .def("__mul__", &mulM44<T, double>)
358 .def("__imul__", &imulM44<T, float>,return_internal_reference<>())
359 .def("__imul__", &imulM44<T, double>,return_internal_reference<>())
360 .def("min", &boxMin<T>)
361 .def("max", &boxMax<T>)
362 .def("__repr__", &Box_repr<T>)
363 .def("makeEmpty",&Box<T>::makeEmpty,"makeEmpty() make the box empty")
364 .def("makeInfinite",&Box<T>::makeInfinite,"makeInfinite() make the box cover all space")
365 .def("extendBy",extendBy1,"extendBy(point) extend the box by a point")
366 .def("extendBy",box_extendBy<T>,"extendBy(array) extend the box the values in the array")
367 .def("extendBy",extendBy2,"extendBy(box) extend the box by a box")
368 .def("size",&Box<T>::size,"size() size of the box")
369 .def("center",&Box<T>::center,"center() center of the box")
370 .def("intersects",intersects1,"intersects(point) returns true if the box intersects the given point")
371 .def("intersects",intersects2,"intersects(box) returns true if the box intersects the given box")
372 .def("intersects",box_intersects<T>, "intersects(array) returns an int array where 0 indicates the point is not in the box and 1 indicates that it is")
373 .def("majorAxis",&Box<T>::majorAxis,"majorAxis() major axis of the box")
374 .def("isEmpty",&Box<T>::isEmpty,"isEmpty() returns true if the box is empty")
375 .def("isInfinite",&Box<T>::isInfinite,"isInfinite() returns true if the box covers all space")
376 .def("hasVolume",&Box<T>::hasVolume,"hasVolume() returns true if the box has volume")
377 .def("setMin",&boxSetMin<T>,"setMin() sets the min value of the box")
378 .def("setMax",&boxSetMax<T>,"setMax() sets the max value of the box")
379 ;
380
381 decoratecopy(box_class);
382
383 return box_class;
384}
385
386
387template PYIMATH_EXPORT class_<IMATH_NAMESPACE::Box<IMATH_NAMESPACE::V2s> > register_Box2<IMATH_NAMESPACE::V2s>();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected