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

Function Line3_tuple_construct

src/python/PyImath/PyImathLine.cpp:42–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40
41template <class T>
42static Line3<T> *
43Line3_tuple_construct(const tuple &t0, const tuple &t1)
44{
45 Vec3<T> v0, v1;
46 if(t0.attr("__len__")() == 3 && t1.attr("__len__")() == 3)
47 {
48 v0.x = extract<T>(t0[0]);
49 v0.y = extract<T>(t0[1]);
50 v0.z = extract<T>(t0[2]);
51
52 v1.x = extract<T>(t1[0]);
53 v1.y = extract<T>(t1[1]);
54 v1.z = extract<T>(t1[2]);
55
56 return new Line3<T>(v0, v1);
57 }
58 else
59 throw std::invalid_argument ("Line3 expects tuple of length 3");
60}
61
62template <class T, class S>
63static Line3<T> *

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected