Subversion Repositories spk

Rev

Rev 1 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1 Rev 114
Line 4... Line 4...
4
#include "bob_dom_base.h"
4
#include "bob_dom_base.h"
-
 
5
#include "geometry_bob.h"
5
 
6
 
6
#define CUT_F_LINEAR          0x1
7
#define CUT_F_LINEAR          0x1
7
#define CUT_F_ROT             0x2
8
#define CUT_F_ROT             0x2
8
#define CUT_F_TARGETPOS       0x8
9
#define CUT_F_TARGETPOS       0x8
9
#define CUT_F_SAMEPOS         0x10
10
#define CUT_F_SAMEPOS         0x10
Line 20... Line 21...
20
#define CUT_F_ROTTCBINFO      0x8000
21
#define CUT_F_ROTTCBINFO      0x8000
21
#define CUT_F_POSBEZINFO      0x10000
22
#define CUT_F_POSBEZINFO      0x10000
22
#define CUT_F_TPOSTCBINFO     0x20000
23
#define CUT_F_TPOSTCBINFO     0x20000
23
#define CUT_F_FAKEROTTCBINFO  0x40000
24
#define CUT_F_FAKEROTTCBINFO  0x40000
24
 
25
 
25
class bob_dom_frame : public bob_with_errors
26
class bob_frame : public bob_with_errors
26
{
27
{
27
	public:
28
	public:
28
		struct point3d
29
		struct Position : public point3d<int>
29
		{
30
		{
30
			int x,y,z;
-
 
31
			
-
 
32
			point3d() { x=0; y=0; z=0; }
-
 
33
			
-
 
34
			bool load(bob_dom_ibinaryfilestream& is);
31
			bool toFile(obinaryfilestream& os) { return point3d<value_type>::toFile(os); }
35
			bool toFile(bob_dom_otextfilestream& os);
32
			bool toFile(otextfilestream& os);
36
			bool toFile(bob_dom_obinaryfilestream& os);
-
 
37
		};
33
		};
38
 
34
 
39
		struct angle_axis
35
		struct AngleAxis
40
		{
36
		{
41
			double angle, x, y, z;
37
			double angle, x, y, z;
42
			
38
 
43
			angle_axis() { angle=0; x=0; y=0; z=0; }
39
			AngleAxis() { angle=0; x=0; y=0; z=0; }
44
			
40
 
45
			bool load(bob_dom_ibinaryfilestream& is);
41
			bool load(ibinaryfilestream& is);
46
			bool toFile(bob_dom_otextfilestream & os);
42
			bool toFile(otextfilestream & os);
47
			bool toFile(bob_dom_obinaryfilestream& os);
43
			bool toFile(obinaryfilestream& os);
48
		};
44
		};
49
 
45
 
50
		struct rgb
46
		struct rgb
51
		{
47
		{
52
			double r, g, b;
48
			double r, g, b;
53
			
49
 
54
			rgb() { r=0; g=0; b=0; }
50
			rgb() { r=0; g=0; b=0; }
55
			
51
 
56
			bool load(bob_dom_ibinaryfilestream& is);
52
			bool load(ibinaryfilestream& is);
57
			bool toFile(bob_dom_otextfilestream & os);
53
			bool toFile(otextfilestream & os);
58
			bool toFile(bob_dom_obinaryfilestream& os);
54
			bool toFile(obinaryfilestream& os);
59
		};
55
		};
60
 
56
 
61
		struct tcb_info
57
		struct tcb_info
62
		{
58
		{
63
			double tension, continuity, bias, easeFrom, easeTo;
59
			double tension, continuity, bias, easeFrom, easeTo;
64
			
60
 
65
			tcb_info() { tension=0; continuity=0; bias=0; easeFrom=0; easeTo=0; }
61
			tcb_info() { tension=0; continuity=0; bias=0; easeFrom=0; easeTo=0; }
66
			
62
 
67
			bool load(bob_dom_ibinaryfilestream& is);
63
			bool load(ibinaryfilestream& is);
68
			bool toFile(bob_dom_otextfilestream& os);
64
			bool toFile(otextfilestream& os);
69
			bool toFile(bob_dom_obinaryfilestream& os);
65
			bool toFile(obinaryfilestream& os);
70
		};
66
		};
71
	
67
 
72
	public:
68
	public:
73
		// don't include CUT_F_POSBEZINFO in the mask until it's known!
69
		// don't include CUT_F_POSBEZINFO in the mask until it's known!
74
		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;
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;
75
	
71
 
76
		int flags;
72
		int flags;
77
		point3d position;
73
		Position position;
78
		angle_axis *rotation;
74
		AngleAxis *rotation;
79
		point3d *targetPos;
75
		Position *targetPos;
80
		double rollAngle;
76
		double rollAngle;
81
		tcb_info *pos_tcb_info, *rot_tcb_info, *tpos_tcb_info;
77
		tcb_info *pos_tcb_info, *rot_tcb_info, *tpos_tcb_info;
82
		double fov;
78
		double fov;
83
		rgb *color;
79
		rgb *color;
84
		int length, index;
80
		int length, index;
85
		
81
 
86
		bob_dom_frame() 
82
		bob_frame()
87
		{ 
83
		{
88
			flags=0; 
84
			flags=0;
89
			rotation=0;
85
			rotation=0;
90
			targetPos=0;
86
			targetPos=0;
91
			rollAngle=0;
87
			rollAngle=0;
92
			color=0;
88
			color=0;
93
			pos_tcb_info=0;
89
			pos_tcb_info=0;
Line 95... Line 91...
95
			tpos_tcb_info=0;
91
			tpos_tcb_info=0;
96
			fov=0;
92
			fov=0;
97
			length=0;
93
			length=0;
98
			index=0;
94
			index=0;
99
		}
95
		}
100
		
96
 
101
		~bob_dom_frame() 
97
		~bob_frame()
102
		{ 
98
		{
103
			delete rotation; delete targetPos; delete pos_tcb_info; delete rot_tcb_info; delete tpos_tcb_info;
99
			delete rotation; delete targetPos; delete pos_tcb_info; delete rot_tcb_info; delete tpos_tcb_info;
104
			delete color;
100
			delete color;
105
		}
101
		}
106
		
102
 
107
		int valueCount();
103
		int valueCount();
108
		
-
 
109
		bool toFile(bob_dom_obinaryfilestream& os);
-
 
110
		bool toFile(bob_dom_otextfilestream& os);
-
 
111
		
-
 
112
		bool load(bob_dom_ibinaryfilestream& is);
-
 
113
};
-
 
114
 
104
 
115
template &lt;class Ty>;
105
		bool toFile(obinaryfilestream&amp; os);
116
inline
-
 
117
Ty& operator << (Ty& os, bob_dom_frame& right)
106
		bool toFile(otextfilestream& os);
118
{
107
 
119
	right.toFile(os);
108
		bool load(ibinaryfilestream& is);
120
	return os;
-
 
121
}
109
};
122
 
110
 
123
#endif // !defined(BOB_DOM_FRAME_INCLUDED)
111
#endif // !defined(BOB_DOM_FRAME_INCLUDED)