Subversion Repositories spk

Rev

Rev 1 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 cycrow 1
#ifndef BOB_DOM_FRAME_INCLUDED
2
#define BOB_DOM_FRAME_INCLUDED
3
 
4
#include "bob_dom_base.h"
114 cycrow 5
#include "geometry_bob.h"
1 cycrow 6
 
7
#define CUT_F_LINEAR          0x1
8
#define CUT_F_ROT             0x2
9
#define CUT_F_TARGETPOS       0x8
10
#define CUT_F_SAMEPOS         0x10
11
#define CUT_F_SAMEROT         0x20
12
#define CUT_F_SAMETARGET      0x40
13
#define CUT_F_BEZIER          0x80
14
#define CUT_F_SAMESCALE       0x100
15
#define CUT_F_COLOR           0x200
16
#define CUT_F_SAMECOLOR       0x400
17
#define CUT_F_FOV             0x800
18
#define CUT_F_SAMEFOV         0x1000
19
#define CUT_F_ABSROT          0x2000
20
#define CUT_F_POSTCBINFO      0x4000
21
#define CUT_F_ROTTCBINFO      0x8000
22
#define CUT_F_POSBEZINFO      0x10000
23
#define CUT_F_TPOSTCBINFO     0x20000
24
#define CUT_F_FAKEROTTCBINFO  0x40000
25
 
114 cycrow 26
class bob_frame : public bob_with_errors
1 cycrow 27
{
28
	public:
114 cycrow 29
		struct Position : public point3d<int>
1 cycrow 30
		{
114 cycrow 31
			bool toFile(obinaryfilestream& os) { return point3d<value_type>::toFile(os); }
32
			bool toFile(otextfilestream& os);
1 cycrow 33
		};
34
 
114 cycrow 35
		struct AngleAxis
1 cycrow 36
		{
37
			double angle, x, y, z;
114 cycrow 38
 
39
			AngleAxis() { angle=0; x=0; y=0; z=0; }
40
 
41
			bool load(ibinaryfilestream& is);
42
			bool toFile(otextfilestream & os);
43
			bool toFile(obinaryfilestream& os);
1 cycrow 44
		};
45
 
46
		struct rgb
47
		{
48
			double r, g, b;
114 cycrow 49
 
1 cycrow 50
			rgb() { r=0; g=0; b=0; }
114 cycrow 51
 
52
			bool load(ibinaryfilestream& is);
53
			bool toFile(otextfilestream & os);
54
			bool toFile(obinaryfilestream& os);
1 cycrow 55
		};
56
 
57
		struct tcb_info
58
		{
59
			double tension, continuity, bias, easeFrom, easeTo;
114 cycrow 60
 
1 cycrow 61
			tcb_info() { tension=0; continuity=0; bias=0; easeFrom=0; easeTo=0; }
114 cycrow 62
 
63
			bool load(ibinaryfilestream& is);
64
			bool toFile(otextfilestream& os);
65
			bool toFile(obinaryfilestream& os);
1 cycrow 66
		};
114 cycrow 67
 
1 cycrow 68
	public:
69
		// don't include CUT_F_POSBEZINFO in the mask until it's known!
114 cycrow 70
		static const int flagMask = CUT_F_LINEAR|CUT_F_ROT|CUT_F_TARGETPOS|CUT_F_SAMEPOS|CUT_F_SAMEROT|CUT_F_SAMETARGET|CUT_F_BEZIER|CUT_F_SAMESCALE|CUT_F_COLOR|CUT_F_SAMECOLOR|CUT_F_FOV|CUT_F_SAMEFOV|CUT_F_ABSROT|CUT_F_POSTCBINFO|CUT_F_ROTTCBINFO|CUT_F_TPOSTCBINFO|CUT_F_FAKEROTTCBINFO;
71
 
1 cycrow 72
		int flags;
114 cycrow 73
		Position position;
74
		AngleAxis *rotation;
75
		Position *targetPos;
1 cycrow 76
		double rollAngle;
77
		tcb_info *pos_tcb_info, *rot_tcb_info, *tpos_tcb_info;
78
		double fov;
79
		rgb *color;
80
		int length, index;
114 cycrow 81
 
82
		bob_frame()
83
		{
84
			flags=0;
1 cycrow 85
			rotation=0;
86
			targetPos=0;
87
			rollAngle=0;
88
			color=0;
89
			pos_tcb_info=0;
90
			rot_tcb_info=0;
91
			tpos_tcb_info=0;
92
			fov=0;
93
			length=0;
94
			index=0;
95
		}
114 cycrow 96
 
97
		~bob_frame()
98
		{
1 cycrow 99
			delete rotation; delete targetPos; delete pos_tcb_info; delete rot_tcb_info; delete tpos_tcb_info;
100
			delete color;
101
		}
114 cycrow 102
 
1 cycrow 103
		int valueCount();
114 cycrow 104
 
105
		bool toFile(obinaryfilestream& os);
106
		bool toFile(otextfilestream& os);
107
 
108
		bool load(ibinaryfilestream& is);
1 cycrow 109
};
110
 
111
#endif // !defined(BOB_DOM_FRAME_INCLUDED)