本文整理汇总了C++中Geom::IsInstanceOf方法的典型用法代码示例。如果您正苦于以下问题:C++ Geom::IsInstanceOf方法的具体用法?C++ Geom::IsInstanceOf怎么用?C++ Geom::IsInstanceOf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Geom
的用法示例。
在下文中一共展示了Geom::IsInstanceOf方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetCumulativeTransform
void GvPath::GetCumulativeTransform(Transform3 *T)
{
T->Identity();
int i;
for (i=0; i<mAncestryLength; ++i) {
Geom *g = mAncestry[i];
if (g->IsInstanceOf(TYPE_INFO(GeomWrapped))) {
Transform3 *M = ((GeomWrapped*)g)->GetTransform();
// Explanation of the order of multiplication: Our
// transform libarary treats data points as row vectors;
// transforms act on them by right multiplication, i.e.
// [point] * [matrix] = [new point]. Transforms lower in
// the heirarchy are closer to the data points (the one
// just above the leaf node Geom being the one that acts
// on it first), so the order in which the product of
// transformations act on a point is:
// [point] * [transf n] * ... * [transf 1] * [transf 0]
// = [new point]
// At this point, we've accumulated the product
// [transf i-1] ... [transf 0]
// in T, and we're about to multiply it by [transf i]
// (which is in M), so the order should be M * T.
T->Concat(M, T);
}
}
}
示例2: return
Transform3 *GvPath::GetLocalTransform()
{
if (mAncestryLength <= 1) { return &Transform3::IDENTITY; }
Geom *parent = mAncestry[mAncestryLength-2];
if (!parent->IsInstanceOf(TYPE_INFO(GeomWrapped))) {
return NULL;
}
return ((GeomWrapped*)parent)->GetTransform();
}
示例3: FindStack
int GvPath::FindStack(UtLStack<Geom *> *stack, Geom *geom)
{
Geom *g = *(stack->Top());
if ( g == geom ) { return 1; }
if (g->IsInstanceOf(TYPE_INFO(GeomParent))) {
GeomParent *p = (GeomParent*)g;
int nchildren = p->GetChildCount();
for (int i=0; i<nchildren; ++i) {
(*(stack->Push())) = p->GetChild(i);
if (FindStack(stack, geom)) {
return 1;
}
stack->Pop();
}
}
return 0;
}