当前位置: 首页>>代码示例>>C++>>正文


C++ Geom::IsInstanceOf方法代码示例

本文整理汇总了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);
    }
  }
}
开发者ID:geomview,项目名称:gv2,代码行数:26,代码来源:GvPath.cpp

示例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();
}
开发者ID:geomview,项目名称:gv2,代码行数:9,代码来源:GvPath.cpp

示例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;
}
开发者ID:geomview,项目名称:gv2,代码行数:17,代码来源:GvPath.cpp


注:本文中的Geom::IsInstanceOf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。