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


C++ DLIList::step方法代码示例

本文整理汇总了C++中DLIList::step方法的典型用法代码示例。如果您正苦于以下问题:C++ DLIList::step方法的具体用法?C++ DLIList::step怎么用?C++ DLIList::step使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DLIList的用法示例。


在下文中一共展示了DLIList::step方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: about_spatially_equal

//-------------------------------------------------------------------------
// Purpose       : Check if loops are spatially equal.
//
// Special Notes : 
//
// Creator       : Jason Kraftcheck
//
// Creation Date : 04/01/04
//-------------------------------------------------------------------------
CubitBoolean Loop::about_spatially_equal( DLIList<CoEdge*>& other_coedges,
                                          CubitSense relative_sense,
                                          double tolerance_factor,
                                          CubitBoolean notify_refEntity )
{
  DLIList<CoEdge*> this_coedges(other_coedges.size());
  
    // Loops must have same number of coedges to match.
  this->ordered_co_edges( this_coedges );
  if (this_coedges.size() != other_coedges.size())
    return CUBIT_FALSE;
  
    // Want to compare coedges in order, so make sure we have
    // them in the correct order.
  if (relative_sense == CUBIT_REVERSED)
    this_coedges.reverse();
  
    // Try to match all coedges.  Begin with the first coedge
    // in this loop.  For each coedge in the other loop that 
    // it matches, check if all the other coedges match in the
    // correct order.
  int other_loop_index = 0;
  this_coedges.reset();
  other_coedges.reset();
  CoEdge* this_coedge = this_coedges.get_and_step();
  for (int i = other_coedges.size(); i--; )
  {
      // Loop until we find a matching CoEdge
    CoEdge* other_coedge = other_coedges.get_and_step();
    if (!this_coedge->about_spatially_equal( other_coedge,
                                             relative_sense,
                                             tolerance_factor,
                                             notify_refEntity ))
      continue;
    
      // Found a matching coedge.  Now try to match all the
      // others in the correct order.
    bool match = true;
    other_loop_index = other_coedges.get_index();
    for (int j = other_coedges.size() - 1; j-- && match; )
    {
      this_coedge = this_coedges.get_and_step();
      other_coedge = other_coedges.get_and_step();
      match = this_coedge->about_spatially_equal( other_coedge,
                                                  relative_sense,
                                                  tolerance_factor,
                                                  notify_refEntity );
    }
    
      // Matched all coedges, in order.  Done.
    if (match)
      return CUBIT_TRUE;
    
     // Try again, as perhaps the first coedge of this loop
     // also matches some other one in the second loop and
     // if we start with that one, the remaining coedges will
     // also match.
    this_coedges.reset();
    this_coedge = this_coedges.get_and_step();
    other_coedges.reset();
    other_coedges.step( other_loop_index );
  }
  
    // If here, loops didn't match.
  return CUBIT_FALSE;
}
开发者ID:tenpercent,项目名称:cp-sandbox,代码行数:75,代码来源:Loop.cpp


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