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

Function register_Box2

src/python/PyImath/PyImathBox.cpp:270–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268
269template <class T>
270class_<IMATH_NAMESPACE::Box<T> >
271register_Box2()
272{
273 void (IMATH_NAMESPACE::Box<T>::*extendBy1)(const T&) = &IMATH_NAMESPACE::Box<T>::extendBy;
274 void (IMATH_NAMESPACE::Box<T>::*extendBy2)(const IMATH_NAMESPACE::Box<T>&) = &IMATH_NAMESPACE::Box<T>::extendBy;
275 bool (IMATH_NAMESPACE::Box<T>::*intersects1)(const T&) const = &IMATH_NAMESPACE::Box<T>::intersects;
276 bool (IMATH_NAMESPACE::Box<T>::*intersects2)(const IMATH_NAMESPACE::Box<T>&) const = &IMATH_NAMESPACE::Box<T>::intersects;
277 const char *name = BoxName<T>::value;
278 class_<Box<T> > box_class(name);
279 box_class
280 .def(init<>("Box() create empty box") )
281 .def(init<T>("Box(point)create box containing the given point") )
282 .def(init<T,T>("Box(point,point) create box continaing min and max") )
283 .def("__init__", make_constructor(box2TupleConstructor1<T>), "Box(point) where point is a python tuple")
284 .def("__init__", make_constructor(box2TupleConstructor2<T>), "Box(point,point) where point is a python tuple")
285 .def("__init__", make_constructor(boxConstructor<T, IMATH_NAMESPACE::V2f>))
286 .def("__init__", make_constructor(boxConstructor<T, IMATH_NAMESPACE::V2d>))
287 .def("__init__", make_constructor(boxConstructor<T, IMATH_NAMESPACE::V2i>))
288 .def("__init__", make_constructor(boxConstructor<T, IMATH_NAMESPACE::V2i64>))
289 .def_readwrite("min",&Box<T>::min)
290 .def_readwrite("max",&Box<T>::max)
291 .def("min", &boxMin<T>)
292 .def("max", &boxMax<T>)
293 .def(self == self) // NOSONAR - suppress SonarCloud bug report.
294 .def(self != self) // NOSONAR - suppress SonarCloud bug report.
295 .def("__repr__", &Box_repr<T>)
296 .def("makeEmpty",&Box<T>::makeEmpty,"makeEmpty() make the box empty")
297 .def("makeInfinite",&Box<T>::makeInfinite,"makeInfinite() make the box cover all space")
298 .def("extendBy",extendBy1,"extendBy(point) extend the box by a point")
299 .def("extendBy",box_extendBy<T>,"extendBy(array) extend the box the values in the array")
300 .def("extendBy",extendBy2,"extendBy(box) extend the box by a box")
301 .def("size",&Box<T>::size,"size() size of the box")
302 .def("center",&Box<T>::center,"center() center of the box")
303 .def("intersects",intersects1,"intersects(point) returns true if the box intersects the given point")
304 .def("intersects",intersects2,"intersects(box) returns true if the box intersects the given box")
305 .def("majorAxis",&Box<T>::majorAxis,"majorAxis() major axis of the box")
306 .def("isEmpty",&Box<T>::isEmpty,"isEmpty() returns true if the box is empty")
307 .def("isInfinite",&Box<T>::isInfinite,"isInfinite() returns true if the box covers all space")
308 .def("hasVolume",&Box<T>::hasVolume,"hasVolume() returns true if the box has volume")
309 .def("setMin",&boxSetMin<T>,"setMin() sets the min value of the box")
310 .def("setMax",&boxSetMax<T>,"setMax() sets the max value of the box")
311 ;
312 return box_class;
313}
314
315template <class T, class U>
316static IMATH_NAMESPACE::Box<T>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected