summaryrefslogtreecommitdiff
path: root/esolid/wrapper/include/ksolid.h
blob: 39b7e236d38a6122ccc4ffd10cb488c81eacc4ef (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
83
84
85
86
//  file:    ksolid.h
//  update:  12/13/02

#ifndef _KSOLID_H
#define _KSOLID_H

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

#include "kpatch.h"
#include "kpartition.h"
#include "kgraph.h"
#include "bigrational_matrix.h"

using namespace std;

class K_SOLID
{
  
  //  stream
  
  ostream& output(ostream&) const;
  
public:
  unsigned long num_patches;
  K_PATCH**     patches;
  
  //  constructors, assignment and destructor
  
  K_SOLID();
  K_SOLID(K_PATCH* const [], const unsigned long);
  
  K_SOLID(const K_SOLID&);
  K_SOLID& operator =(const K_SOLID&);
  
  ~K_SOLID();
  
  //  stream
  
  friend ostream& operator <<(ostream&, const K_SOLID&);
 
  void internal_gen_box(const bigrational_vector*, long unsigned int);
  void initialize_from_patches(K_PATCH* const*, long unsigned int);
  void internal_read_box(std::istream&, const bigrational&);
  void bryan_read_box_from_file(const char*);
  //K_SOLID bryan_read_file(const char *);
  K_SOLID transform(const bigrational_matrix&) const;
  int     Bezier_output(ostream&) const;
  
  //  primitives
  
  //  int classify_pt(const bigrational& x,
  //                  const bigrational& y,
  //                  const bigrational& z) const
  //    returns IN  if (x, y, z) lies inside *this and
  //            OUT if (x, y, z) lies outside *this.
  
  int classify_pt(const bigrational&,
                  const bigrational&,
                  const bigrational&) const;
  
  //  int classify_pt(const bigrational_vector& pt) const
  //    returns IN  if pt lies inside *this and
  //            OUT if pt lies outside *this.
  
  int classify_pt(const bigrational_vector&) const;
  
  //  arithmetic
  
  K_SOLID boolean(K_SOLID&, const char);
  K_SOLID merge(const K_SOLID&) const;
  
  //  other functions
  
  friend K_SOLID gen_new_solid(K_PARTITION**, const unsigned long,
                               K_PARTITION**, const unsigned long, const char);
};

K_SOLID read_solid(istream&, const bigrational& = 0);
K_SOLID read_CSG(const char*, const char*, const bigrational& = 0);

bigrational_matrix read_BRLCAD_matrix(istream&);

#endif