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

Function register_Line

src/python/PyImath/PyImathLine.cpp:434–548  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432
433template <class T>
434class_<Line3<T> >
435register_Line()
436{
437 const char *name = LineName<T>::value;
438
439 class_<Line3<T> > line_class(name);
440 line_class
441 .def("__init__", make_constructor(Line3_construct_default<T>), "initialize point to (0,0,0) and direction to (1,0,0)")
442 .def("__init__", make_constructor(Line3_tuple_construct<T>))
443 .def("__init__", make_constructor(Line3_line_construct<T,float>))
444 .def("__init__", make_constructor(Line3_line_construct<T,double>))
445 .def(init<const Vec3<float> &, const Vec3<float> &>("Line3(point1, point2) construction"))
446 .def(init<const Vec3<double> &, const Vec3<double> &>("Line3(point1, point2) construction"))
447 .def(self * Matrix44<T>())
448 .def("__eq__", &equal<T>)
449 .def("__ne__", &notequal<T>)
450
451 .def_readwrite("pos", &Line3<T>::pos)
452 .def_readwrite("dir", &Line3<T>::dir)
453
454 .def("pos", &getPosition<T>,
455 "l.pos() -- returns the start point of line l")
456
457 .def("dir", &getDirection<T>,
458 "l.dir() -- returns the direction of line l\n")
459
460 .def("setPos", &setPosition<T>,
461 "l.setPos(p) -- sets the start point of line l to p")
462 .def("setPos", &setPositionTuple<T>)
463
464 .def("setDir", &setDirection<T>,
465 "l.setDir(d) -- sets the direction of line l\n"
466 "to d.normalized().\n")
467 .def("setDir", &setDirectionTuple<T>)
468
469 .def("set", &set1<T>,
470 "l.set(p1, p2) -- sets the start point\n"
471 "and direction of line l by calling\n"
472 " l.setPos (p1)\n"
473 " l.setDir (p2 - p1)\n")
474
475 .def("set", &setTuple<T>)
476
477 .def("pointAt", &pointAt<T>,
478 "l.pointAt(t) -- returns l.pos() + t * l.dir()")
479
480 .def("distanceTo", &distanceTo1<T>,
481 "l.distanceTo(p) -- returns the distance from\n"
482 " line l to point p\n")
483
484 .def("distanceTo", &distanceTo2<T>,
485 "l1.distanceTo(l2) -- returns the distance from\n"
486 " line l1 to line l2\n")
487
488 .def("distanceTo", &distanceToTuple<T>)
489
490 .def("closestPointTo", &closestPointTo1<T>,
491 "l.closestPointTo(p) -- returns the point on\n"

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected