本文整理汇总了C++中tuple::attr方法的典型用法代码示例。如果您正苦于以下问题:C++ tuple::attr方法的具体用法?C++ tuple::attr怎么用?C++ tuple::attr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tuple
的用法示例。
在下文中一共展示了tuple::attr方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: THROW
static tuple
intersectTuple(Line3<T> &line, const tuple &t0, const tuple &t1, const tuple &t2)
{
if(t0.attr("__len__")() == 3 && t1.attr("__len__")() == 3 && t2.attr("__len__")() == 3)
{
Vec3<T> v0, v1, v2, pt, bar;
bool front;
v0.x = extract<T>(t0[0]);
v0.y = extract<T>(t0[1]);
v0.z = extract<T>(t0[2]);
v1.x = extract<T>(t1[0]);
v1.y = extract<T>(t1[1]);
v1.z = extract<T>(t1[2]);
v2.x = extract<T>(t2[0]);
v2.y = extract<T>(t2[1]);
v2.z = extract<T>(t2[2]);
if(Imath::intersect(line, v0, v1, v2, pt, bar, front))
{
tuple t = make_tuple(pt, bar, front);
return t;
}
else
{
tuple t;
return t;
}
}
else
THROW(Iex::LogicExc, "Line3 expects tuple of length 3");
}
示例2: compoundDataPlugConstructor
static CompoundDataPlugPtr compoundDataPlugConstructor( const char *name, Plug::Direction direction, unsigned flags, tuple children )
{
CompoundDataPlugPtr result = new CompoundDataPlug( name, direction, flags );
size_t s = extract<size_t>( children.attr( "__len__" )() );
for( size_t i=0; i<s; i++ )
{
Gaffer::PlugPtr c = extract<Gaffer::PlugPtr>( children[i] );
result->addChild( c );
}
return result;
}
示例3: closestVertex
static Vec3<T>
closestVertexTuple(Line3<T> &line, const tuple &t0, const tuple &t1, const tuple &t2)
{
MATH_EXC_ON;
if(t0.attr("__len__")() == 3 && t1.attr("__len__")() == 3 && t2.attr("__len__")() == 3)
{
Vec3<T> v0, v1, v2;
v0.x = extract<T>(t0[0]);
v0.y = extract<T>(t0[1]);
v0.z = extract<T>(t0[2]);
v1.x = extract<T>(t1[0]);
v1.y = extract<T>(t1[1]);
v1.z = extract<T>(t1[2]);
v2.x = extract<T>(t2[0]);
v2.y = extract<T>(t2[1]);
v2.z = extract<T>(t2[2]);
return Imath::closestVertex(v0, v1, v2, line);
}
else
THROW(Iex::LogicExc, "Line3 expects tuple of length 3");
}
示例4: rotatePoint
static Vec3<T>
rotatePointTuple(Line3<T> &line, const tuple &t, const T &r)
{
MATH_EXC_ON;
if(t.attr("__len__")() == 3)
{
Vec3<T> p;
p.x = extract<T>(t[0]);
p.y = extract<T>(t[1]);
p.z = extract<T>(t[2]);
return Imath::rotatePoint(p, line, r);
}
else
THROW(Iex::LogicExc, "Line3 expects tuple of length 3");
}