-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmesh.h
75 lines (57 loc) · 1.68 KB
/
tmesh.h
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
#ifndef tmesh_h
#define tmesh_h
/*****************************************************************************
Triangle Mesh Class
NAME:tmesh.h
DATE:17/12/1996
AUTHOR: Z.A. Nolan
*****************************************************************************/
// include vector class
#include "vector.h"
// and the colour class
#include "colour.h"
// and the line class
#include "line.h"
// and include the object class
#include "object.h"
// and include the triangle class class
#include "tri.h"
// include the queue class
#include "pqueue.h"
class TTriangleMesh :public TObject
{
private:
class TTriangleDef
{
private:
int _Point1 ;
int _Point2 ;
int _Point3 ;
public:
TTriangleDef() ;
TTriangleDef(int A,int B,int C) ;
int Point1() const;
int Point2() const;
int Point3() const;
} ;
TPointerQueue <TVector> _PointList ;
TPointerQueue <TTriangleMesh::TTriangleDef> _TriangleList ;
// read and write functions
istream &Read (istream &In) ;
ostream &Write (ostream &Out) const ;
public:
// Constructors
TTriangleMesh () ;
TTriangleMesh (TPointerQueue<TVector> &Points,
TPointerQueue<TTriangleDef> &TDef,
TSurfaceProperties &SurfaceProperties) ;
TTriangleMesh (TTriangleMesh &TMesh) ;
operator= (TTriangleMesh &TMesh) ;
// Intersection of a line and a plane
double Intersection(TVector &Point,TVector &Normal,const TLine &Line) const;
// streaming operators
friend istream &operator>>(istream &In, TTriangleMesh &TriangleMesh);
friend ostream &operator<<(ostream &Out,const TTriangleMesh
&TriangleMesh) ;
} ;
#endif