-
Notifications
You must be signed in to change notification settings - Fork 0
/
tri.h
54 lines (41 loc) · 1.32 KB
/
tri.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
#ifndef triangle_h
#define triangle_h
/*****************************************************************************
Simple Triangle classClass
NAME:tri.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 plane class
#include "plane.h"
class TSimpleTriangle :public TObject
{
private:
TVector _P1 ; // 1st point of the Triangle
TVector _P2 ; // 2nd Point of the Triangle
TVector _P3 ; // 3rd point of the Triangle
TPlane _Plane ; // Plane the triangle is in
// read and write functions
istream &Read (istream &In) ;
ostream &Write (ostream &Out) const ;
public:
// Constructors
TSimpleTriangle () ;
TSimpleTriangle (TVector P1,TVector P2,TVector P3,
const TSurfaceProperties) ;
// Intersection of a line and a plane
double Intersection(TVector &Point,TVector &Normal,const TLine &Line) const;
// streaming operators
friend istream &operator>>(istream &In, TSimpleTriangle &SimpleTriangle);
friend ostream &operator<<(ostream &Out,const TSimpleTriangle
&SimpleTriangle) ;
} ;
#endif