本文整理汇总了C++中Relation::getMeshObj方法的典型用法代码示例。如果您正苦于以下问题:C++ Relation::getMeshObj方法的具体用法?C++ Relation::getMeshObj怎么用?C++ Relation::getMeshObj使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Relation
的用法示例。
在下文中一共展示了Relation::getMeshObj方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: find_relation
RelationIterator Entity::find_relation(const Relation& relation) const
{
// Extremely hacky: It would be better to set up the < operator for relations so that lower_bound
// can return the desired iterator, but any sane definition would probably force a change in
// relation ordering and that's more than I'm willing to take on now.
//
// The current semantics for relation-searching is as follows:
// Ordered based on derived_type, relation_type, and ordinal in descending precedence
// If multiple relations have the same derived_type, relation_type, and ordinal, a linear
// scan takes place looking for a matching meshobj. If no such meshobj was found, then
// we are left with an iterator pointing to the first relation with a different derived_type,
// relation_type, or ordinal. To sum up, the result of the search can either be equivalent to
// lower_bound OR upper_bound depending upon the state of the relations... YUCK!
const Relation::RelationType relation_type = relation.getRelationType();
RelationIterator rel = std::lower_bound(internal_begin_relation(relation_type),
internal_end_relation(relation_type),
relation,
IgnoreIdOrder());
// Should only loop if we are looking at back-relations, otherwise, relations with
// matching specifications are not legal.
while (rel != internal_end_relation(relation_type) &&
same_specification(*rel, relation) &&
rel->getMeshObj() != relation.getMeshObj())
++rel;
return rel;
}