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