-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFieldMaster.h
64 lines (51 loc) · 1.12 KB
/
FieldMaster.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
#ifndef _FIELD_MASTER_H_
#define _FIELD_MASTER_H_
// forward declaration
class Polyhedron;
/**
* Encapsualte analysis and manipulation of vector and tensor field.
* \a Polyhedron is responsible for holding tensor data. \a FieldMaster is
* analysis and manipulation of the field. Seperate data and manipulation into
* different classes to prevent the Polyhedron class becomming a huge class.
*/
class FieldMaster
{
private:
Polyhedron* mPoly;
static FieldMaster* mSingle; // for singleton
FieldMaster()
{
mPoly = NULL;
}
FieldMaster(Polyhedron* poly)
{
mPoly = poly;
}
public:
FieldMaster* getInstance() // for singleton
{
if(!mSingle)
mSingle = new FieldMaster;
return mSingle;
}
FieldMaster* getInstance(Polyhedron* poly) // for singleton
{
if(!mSingle)
mSingle = new FieldMaster(poly);
return mSingle;
}
FieldMaster* getMaster()
{
return mSingle;
}
void setPoly(Polyhedron* poly)
{
mPoly = poly;
}
/**
* Initialize polyhedron.
* Set up triangle local frame.
*/
void initPoly();
};
#endif//_FIELD_MASTER_H_