本文整理汇总了C++中NodeSet::node方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeSet::node方法的具体用法?C++ NodeSet::node怎么用?C++ NodeSet::node使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodeSet
的用法示例。
在下文中一共展示了NodeSet::node方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: check_range_set
static bool check_range_set( EntityTopology type, NodeSet set, unsigned dim, bool value = true )
{
const unsigned max_count[] = { NodeSet::NUM_CORNER_BITS, NodeSet::NUM_EDGE_BITS,
NodeSet::NUM_FACE_BITS, NodeSet::NUM_REGION_BITS };
// test that any bits corresponding to some other dimension are not set.
for (unsigned d = 0; d <= 3; ++d) {
if (d == dim)
continue;
for (unsigned i = 0; i < max_count[d]; ++i)
if (!set.node( Sample(d,i) ) != value)
return false;
}
// test that any bits for this dimension beyond the number for this
// type are not set
for (unsigned i = TopologyInfo::adjacent( type, dim ); i < max_count[dim]; ++i)
if (!set.node( Sample(dim,i) ) != value)
return false;
// test that any bits for the type and dimension are set
for (unsigned i = 0; i < TopologyInfo::adjacent( type, dim ); ++i)
if (set.node( Sample(dim,i) ) == value)
return false;
return true;
}
示例2: check_all
static bool check_all( EntityTopology type, NodeSet set, unsigned dim, bool value )
{
unsigned count = TopologyInfo::adjacent( type, dim );
for (unsigned i = 0; i < count; ++i)
if (set.node( Sample(dim, i) ) != value )
return false;
return true;
}
示例3: test_set_get_clear_dim
void NodeSetTest::test_set_get_clear_dim()
{
NodeSet set;
for (unsigned i = 0; i < NodeSet::NUM_CORNER_BITS; ++i) {
CPPUNIT_ASSERT( !set.node(Sample(0,i)) );
set.set_node( Sample(0, i) );
CPPUNIT_ASSERT( set.node(Sample(0,i)) );
set.clear_node( Sample(0, i) );
CPPUNIT_ASSERT( !set.node(Sample(0,i)) );
}
for (unsigned i = 0; i < NodeSet::NUM_EDGE_BITS; ++i) {
CPPUNIT_ASSERT( !set.node(Sample(1,i)) );
set.set_node( Sample(1, i) );
CPPUNIT_ASSERT( set.node(Sample(1,i)) );
set.clear_node( Sample(1, i) );
CPPUNIT_ASSERT( !set.node(Sample(1,i)) );
}
for (unsigned i = 0; i < NodeSet::NUM_FACE_BITS; ++i) {
CPPUNIT_ASSERT( !set.node(Sample(2,i)) );
set.set_node( Sample(2, i) );
CPPUNIT_ASSERT( set.node(Sample(2,i)) );
set.clear_node( Sample(2, i) );
CPPUNIT_ASSERT( !set.node(Sample(2,i)) );
}
for (unsigned i = 0; i < NodeSet::NUM_REGION_BITS; ++i) {
CPPUNIT_ASSERT( !set.node(Sample(3,i)) );
set.set_node( Sample(3, i) );
CPPUNIT_ASSERT( set.node(Sample(3,i)) );
set.clear_node( Sample(3, i) );
CPPUNIT_ASSERT( !set.node(Sample(3,i)) );
}
}