summaryrefslogtreecommitdiff
path: root/include/kboxco2.h
blob: 20502f919434486b38bd2393b5a8e044472b287b (plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#ifndef _KBOXCO2_H
#define _KBOXCO2_H

#include <cassert>
#include <cstdlib>
#include <iostream>

#include <bigrational.h>

using namespace std;

class K_POINT2D;
class K_CURVE;

class K_BOXCO2
{
friend class K_SEGMENT;
friend class K_CURVE;
friend class K_PATCH;
friend class K_PARTITION;
  
  bigrational low[2];
  bigrational high[2];
  
  int low_open[2];
  int high_open[2];
  
  //  stream
  
  ostream& output(ostream&) const;
  
  //  comparison
  
  int overlap(const K_BOXCO2&) const;
  int contains(const K_BOXCO2&) const;
  
  //  other
  
  K_BOXCO2 merge(const K_BOXCO2&) const;
  
public:
  
  //  constructors, assignment and destructor
  
  K_BOXCO2();
  K_BOXCO2(const bigrational&, const bigrational&,
           const bigrational&, const bigrational&,
           const int, const int, const int, const int);
  K_BOXCO2(const bigrational* const, const bigrational* const,
           const int* const, const int* const);
  
  K_BOXCO2(const K_BOXCO2&);
  K_BOXCO2& operator =(const K_BOXCO2&);
  
  ~K_BOXCO2();
  
  //  stream
  
  friend ostream& operator <<(ostream&, const K_BOXCO2&);
  
  //  primitive
  
  bigrational get_low_s() const;
  bigrational get_high_s() const;
  bigrational get_low_t() const;
  bigrational get_high_t() const;
  
  int is_low_s_open() const;
  int is_high_s_open() const;
  int is_low_t_open() const;
  int is_high_t_open() const;
  
  //  other
  
  friend int pt_inside_trim_curves(K_POINT2D&,
                                   K_CURVE** const, const unsigned long);
  friend int pt_in_on_out_trim_curves(K_POINT2D&,
                                      K_CURVE** const, const unsigned long);
};

#endif