File: software_design_rgs.cpp

package info (click to toggle)
cgal 4.0-5
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 65,068 kB
  • sloc: cpp: 500,870; ansic: 102,544; sh: 321; python: 92; makefile: 75; xml: 2
file content (35 lines) | stat: -rw-r--r-- 866 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <CGAL/Segment_tree_d.h>
#include <CGAL/Tree_traits.h>

using namespace CGAL;

struct Data{
  int min,max;
  double point;
};

struct Window{
  int min,max;
  double min_point, max_point;
};

class Interval_traits{
 public:
  typedef int Key;
  Key get_left( const Data&  d) const {return d.min;}
  Key get_right( const Data&  d) const {return d.max;}
  Key get_left_win( const Window& w) const {return w.min;}
  Key get_right_win(  const Window& w) const {return w.max;}
  static bool comp( const Key& key1, const Key& key2) {return (key1 < key2);}
};

typedef Tree_anchor<Data,Window> Tree_Anchor;
typedef Segment_tree_d<Data,Window,Interval_traits> Segment_Tree_d;

void remove_warning(Segment_Tree_d*){}

int main(){
  Tree_Anchor *anchor = new Tree_Anchor;
  Segment_Tree_d *segment_tree = new Segment_Tree_d(*anchor);
  remove_warning(segment_tree);
}