Toast++
1.0.2 (r.539)
Forward and inverse modelling in optical tomography
Main Page
Related Pages
Modules
Classes
Files
File List
libfe
point.h
1
// ==========================================================================
2
// Module libfe
3
// File point.h
4
// Declaration of classes Point, Point2D, Point3D
5
//
6
// Inheritance:
7
// ------------
8
// RVector ----> Point ----> Point2D
9
// ----> Point3D
10
// ==========================================================================
11
12
#ifndef __POINT_H
13
#define __POINT_H
14
15
// ==========================================================================
16
// class Point
17
18
class
FELIB
Point
:
public
RVector
{
19
public
:
20
// constructors
21
Point
() :
RVector
() {}
22
Point
(
int
dim) :
RVector
(dim) {}
23
Point
(
const
Point
&p) :
RVector
(p) {}
24
Point
(
const
RVector
&v) :
RVector
(v) {}
25
26
// assignment
27
Point
operator=
(
const
Point
& p);
28
Point
operator=
(
const
RVector
&v);
29
30
friend
void
Swap (
Point
&p1,
Point
&p2);
31
// Swap two points. Assumes same dimension
32
33
double
Dist (
const
Point
& p)
const
;
34
// distance between points
35
36
// rotate point around origin, by multiplying with matrix `rot',
37
// and return rotated point in `rotpoint'
38
void
Rotate (
const
RDenseMatrix
&rot,
Point
&rotpoint)
const
;
39
};
40
41
42
// ==========================================================================
43
// class Point2D
44
45
class
Point2D
:
public
Point
{
46
public
:
47
Point2D
():
Point
(2) {}
48
Point2D
(
const
Point2D
&p):
Point
(p) {}
49
Point2D
(
double
x1,
double
x2):
Point
(2)
50
{
data
[0] = x1;
data
[1] = x2; }
51
};
52
53
54
// ==========================================================================
55
// class Point3D
56
57
class
Point3D
:
public
Point
{
58
public
:
59
Point3D
():
Point
(3) {}
60
Point3D
(
const
Point3D
&p):
Point
(p) {}
61
Point3D
(
double
x1,
double
x2,
double
x3):
Point
(3)
62
{
data
[0] = x1;
data
[1] = x2;
data
[2] = x3; }
63
};
64
65
#endif // !__POINT_H
66
67
68
// ==========================================================================
69
// friend prototypes
70
71
void
Swap (
Point
&p1,
Point
&p2);
TVector< double >
Point
Definition:
point.h:18
Point3D
Definition:
point.h:57
TVector< double >::operator=
TVector & operator=(const TVector &v)
Assignment operator.
Definition:
vector.h:309
TDenseMatrix< double >
TVector< double >::data
double * data
pointer to first vector element
Definition:
vector.h:1052
Point2D
Definition:
point.h:45
Generated on Tue Sep 2 2014 17:14:26 for Toast++ by
1.8.6