Subject: CGAL users discussion list
List archive
[cgal-discuss] CGAL::Range_tree_map_traits_3 -- Range over z coordinate appears to not be working
Chronological Thread
- From: Toledo <>
- To:
- Subject: [cgal-discuss] CGAL::Range_tree_map_traits_3 -- Range over z coordinate appears to not be working
- Date: Tue, 18 Aug 2009 04:53:46 +0200 (CEST)
Hi!
I'm implementing a test for a range search over a range tree in three
dimensions using CGAL::Range_tree_map_traits_3 and all related classes. But
when i do the search, the z-coordinate seems to not work. I think i have an
idea why this could be happening, but first my code:
------------------------------------------------------------------------------
#include <CGAL/basic.h>
#include <iostream>
#include <CGAL/Range_tree_k.h>
#include <CGAL/Filtered_kernel.h>
#include <CGAL/Cartesian.h>
#include "Tree_Traits.h"
#include <list>
#include <iterator>
#include <utility>
#include <CGAL/Range_segment_tree_traits.h>
//mapped types
int main()
{
typedef CGAL::Filtered_kernel<CGAL::Cartesian<double> > K;
typedef CGAL::Range_tree_map_traits_3<K, char> Traits;
typedef Traits::Pure_key Pure_key;
typedef Traits::Key Key;
typedef Traits::Interval Interval;
typedef CGAL::Range_tree_3<Traits> Range_tree_3_type;
std::list<Key> InputList, OutputList;
std::list<Key>::iterator first, last, current;
InputList.push_back(Key(Pure_key(8,5.1,36), 'a')); //each key is centroid on
tetrahedron
InputList.push_back(Key(Pure_key(1,1.1,67), 'b'));
InputList.push_back(Key(Pure_key(3,2.1,56), 'c'));
InputList.push_back(Key(Pure_key(2,6.1,89), 'd'));
InputList.push_back(Key(Pure_key(5,4.1,45), 'e'));
InputList.push_back(Key(Pure_key(4,8.1,88.9), 'f'));
InputList.push_back(Key(Pure_key(7,7.1,87), 'g'));
InputList.push_back(Key(Pure_key(6,3.1,78), 'h'));
first = InputList.begin();
last = InputList.end();
Range_tree_3_type Range_tree_3(first,last);
Key a= Key(Pure_key(0,0,54),'a');
Key b= Key(Pure_key(100,100,56),'a');
Interval win = Interval(a,b);
std::cerr << "\n Window Query:\n";
Range_tree_3.window_query(win, std::back_inserter(OutputList));
current=OutputList.begin();
while(current!=OutputList.end())
{
std::cerr << (*current).first << "-" << (*current).second << std::endl;
current++;
}
if(Range_tree_3.range_tree_3->is_valid())
std::cerr << "Tree is valid\n";
else
std::cerr << "Tree is not valid\n";
return 0;
}
--------------------------------------------------------------------------------------------------------
The x, and y range are very "wide" and the z range is narrow to just obtain
the
"c" value. But is not working. (x and y range works). ¿Can you replicate this
behaviour?
Best regards,
Víctor.
- [cgal-discuss] CGAL::Range_tree_map_traits_3 -- Range over z coordinate appears to not be working, Toledo, 08/18/2009
Archive powered by MHonArc 2.6.16.