summaryrefslogtreecommitdiff
path: root/include/kbox3d.h
blob: 0a2cad953bdf9b0adbc613044a6b4420586d9845 (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
#ifndef _KBOX3D_H
#define _KBOX3D_H

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

#include <bigrational.h>

using namespace std;

class K_BOX3D
{
friend class K_SURF;
friend class K_SOLID;
  
  bigrational low[3];
  bigrational high[3];
  
  int low_infty[3];   //  - 1 iff low[i] or high[i] is - infty
  int high_infty[3];  //    1 iff low[i] or high[i] is + infty
                      //    0 otherwise, i.e., low[i] or high[i] is bigrational
  
  //  stream
  
  ostream& output(ostream&) const;
  
  //  comparisons
public:
  int overlap(const K_BOX3D&) const;
  int contains(const K_BOX3D&) const;
  
//public:
  
  //  constructors, assignment and destructor
  
  K_BOX3D();
  K_BOX3D(const bigrational&, const bigrational&,
          const bigrational&, const bigrational&,
          const bigrational&, const bigrational&);
  K_BOX3D(const bigrational* const, const bigrational* const);
  
  K_BOX3D(const K_BOX3D&);
  K_BOX3D& operator =(const K_BOX3D&);
  
  ~K_BOX3D();
  
  //  stream
  
  friend ostream& operator <<(ostream&, const K_BOX3D&);
};

#endif