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

Function box3TupleConstructor2

src/python/PyImath/PyImathBox.cpp:143–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141
142template <class T>
143static Box<T> * box3TupleConstructor2(const tuple &t0, const tuple &t1)
144{
145 if(t0.attr("__len__")() == 3 && t1.attr("__len__")() == 3)
146 {
147 T point0, point1;
148 point0.x = extract<typename T::BaseType>(t0[0]);
149 point0.y = extract<typename T::BaseType>(t0[1]);
150 point0.z = extract<typename T::BaseType>(t0[2]);
151
152 point1.x = extract<typename T::BaseType>(t1[0]);
153 point1.y = extract<typename T::BaseType>(t1[1]);
154 point1.z = extract<typename T::BaseType>(t1[2]);
155
156 return new Box<T>(point0, point1);
157 }
158 else
159 throw std::invalid_argument ("Invalid input to Box tuple constructor");
160}
161
162template <class T>
163static std::string Box_repr(const Box<T> &box)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected