本文整理汇总了C++中tree_t::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ tree_t::insert方法的具体用法?C++ tree_t::insert怎么用?C++ tree_t::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tree_t
的用法示例。
在下文中一共展示了tree_t::insert方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: insert
void insert(box2d<double> const& box, mapnik::value_unicode_string const& text)
{
if (tree_.extent().intersects(box))
{
tree_.insert(label(box, text), box);
}
}
示例2: set
void set(const char *name, const char *value)
{
node *n = tree.search(name);
if (!n)
{
// This variable does not currently exist. Create a node for it.
n = new node;
n->name = new char [strlen(name) + 2];
strcpy(n->name + 1, name);
tree.insert(n);
}
else
// Delete current value.
delete [] n->value;
if (value)
{
if (strlen(value) == 0)
value = 0;
}
if (value)
{
n->value = new char [strlen(value) + 1];
strcpy(n->value, value);
}
else
{
// Variable is being set to empty string, which deletes it.
tree.remove(name);
delete [] n->name;
delete n;
}
}
示例3: has_placement
bool has_placement(box2d<double> const& box)
{
tree_t::query_iterator itr = tree_.query_in_box(box);
tree_t::query_iterator end = tree_.query_end();
for ( ;itr != end; ++itr)
{
if (itr->intersects(box)) return false;
}
tree_.insert(box,box);
return true;
}
示例4: Insert_Node
void Insert_Node( tree_t &tree, node_t &node )
{
tree_t::iterator ptr;
ptr = tree.end();
// insert smallest items at back
for( int lcv = tree.size() - 1; lcv >= 0; lcv--, ptr-- ) {
if( node.size <= tree[ lcv ].size ) break;
}
tree.insert( ptr, node );
}
示例5: insert
void insert(box2d<double> const& box, mapnik::value_unicode_string const& text)
{
tree_.insert(label(box, text), box);
}
示例6: insert
void insert(Envelope<double> const& box)
{
tree_.insert(box, box);
}