コード例 #1
0
 void insert(box2d<double> const& box, mapnik::value_unicode_string const& text)
 {
     if (tree_.extent().intersects(box))
     {
         tree_.insert(label(box, text), box);
     }
 }
コード例 #2
0
 void insert(box2d<double> const& box)
 {
     if (tree_.extent().intersects(box))
     {
         tree_.insert(label(box), box);
     }
 }
コード例 #3
0
    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;
	  }
      }
コード例 #4
0
 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;
 }
コード例 #5
0
ファイル: huffman.cpp プロジェクト: maxim-zhao/psrp
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 );
}
コード例 #6
0
 void insert(box2d<double> const& box, mapnik::value_unicode_string const& text)
 {
     tree_.insert(label(box, text), box);
 }
コード例 #7
0
 void insert(box2d<double> const& box)
 {
     tree_.insert(label(box), box);
 }
コード例 #8
0
 void insert(box2d<double> const& box)
 {
     tree_.insert(box, box);
 }
コード例 #9
0
 void insert(Envelope<double> const& box)
 {
   tree_.insert(box, box);
 }