| 1 | cycrow | 1 | #ifndef BOB_DOM_FRAME_INCLUDED
 | 
        
           |  |  | 2 | #define BOB_DOM_FRAME_INCLUDED
 | 
        
           |  |  | 3 |   | 
        
           |  |  | 4 | #include "bob_dom_base.h"
 | 
        
           |  |  | 5 |   | 
        
           |  |  | 6 | #define CUT_F_LINEAR          0x1
 | 
        
           |  |  | 7 | #define CUT_F_ROT             0x2
 | 
        
           |  |  | 8 | #define CUT_F_TARGETPOS       0x8
 | 
        
           |  |  | 9 | #define CUT_F_SAMEPOS         0x10
 | 
        
           |  |  | 10 | #define CUT_F_SAMEROT         0x20
 | 
        
           |  |  | 11 | #define CUT_F_SAMETARGET      0x40
 | 
        
           |  |  | 12 | #define CUT_F_BEZIER          0x80
 | 
        
           |  |  | 13 | #define CUT_F_SAMESCALE       0x100
 | 
        
           |  |  | 14 | #define CUT_F_COLOR           0x200
 | 
        
           |  |  | 15 | #define CUT_F_SAMECOLOR       0x400
 | 
        
           |  |  | 16 | #define CUT_F_FOV             0x800
 | 
        
           |  |  | 17 | #define CUT_F_SAMEFOV         0x1000
 | 
        
           |  |  | 18 | #define CUT_F_ABSROT          0x2000
 | 
        
           |  |  | 19 | #define CUT_F_POSTCBINFO      0x4000
 | 
        
           |  |  | 20 | #define CUT_F_ROTTCBINFO      0x8000
 | 
        
           |  |  | 21 | #define CUT_F_POSBEZINFO      0x10000
 | 
        
           |  |  | 22 | #define CUT_F_TPOSTCBINFO     0x20000
 | 
        
           |  |  | 23 | #define CUT_F_FAKEROTTCBINFO  0x40000
 | 
        
           |  |  | 24 |   | 
        
           |  |  | 25 | class bob_dom_frame : public bob_with_errors
 | 
        
           |  |  | 26 | {
 | 
        
           |  |  | 27 | 	public:
 | 
        
           |  |  | 28 | 		struct point3d
 | 
        
           |  |  | 29 | 		{
 | 
        
           |  |  | 30 | 			int x,y,z;
 | 
        
           |  |  | 31 |   | 
        
           |  |  | 32 | 			point3d() { x=0; y=0; z=0; }
 | 
        
           |  |  | 33 |   | 
        
           |  |  | 34 | 			bool load(bob_dom_ibinaryfilestream& is);
 | 
        
           |  |  | 35 | 			bool toFile(bob_dom_otextfilestream& os);
 | 
        
           |  |  | 36 | 			bool toFile(bob_dom_obinaryfilestream& os);
 | 
        
           |  |  | 37 | 		};
 | 
        
           |  |  | 38 |   | 
        
           |  |  | 39 | 		struct angle_axis
 | 
        
           |  |  | 40 | 		{
 | 
        
           |  |  | 41 | 			double angle, x, y, z;
 | 
        
           |  |  | 42 |   | 
        
           |  |  | 43 | 			angle_axis() { angle=0; x=0; y=0; z=0; }
 | 
        
           |  |  | 44 |   | 
        
           |  |  | 45 | 			bool load(bob_dom_ibinaryfilestream& is);
 | 
        
           |  |  | 46 | 			bool toFile(bob_dom_otextfilestream & os);
 | 
        
           |  |  | 47 | 			bool toFile(bob_dom_obinaryfilestream& os);
 | 
        
           |  |  | 48 | 		};
 | 
        
           |  |  | 49 |   | 
        
           |  |  | 50 | 		struct rgb
 | 
        
           |  |  | 51 | 		{
 | 
        
           |  |  | 52 | 			double r, g, b;
 | 
        
           |  |  | 53 |   | 
        
           |  |  | 54 | 			rgb() { r=0; g=0; b=0; }
 | 
        
           |  |  | 55 |   | 
        
           |  |  | 56 | 			bool load(bob_dom_ibinaryfilestream& is);
 | 
        
           |  |  | 57 | 			bool toFile(bob_dom_otextfilestream & os);
 | 
        
           |  |  | 58 | 			bool toFile(bob_dom_obinaryfilestream& os);
 | 
        
           |  |  | 59 | 		};
 | 
        
           |  |  | 60 |   | 
        
           |  |  | 61 | 		struct tcb_info
 | 
        
           |  |  | 62 | 		{
 | 
        
           |  |  | 63 | 			double tension, continuity, bias, easeFrom, easeTo;
 | 
        
           |  |  | 64 |   | 
        
           |  |  | 65 | 			tcb_info() { tension=0; continuity=0; bias=0; easeFrom=0; easeTo=0; }
 | 
        
           |  |  | 66 |   | 
        
           |  |  | 67 | 			bool load(bob_dom_ibinaryfilestream& is);
 | 
        
           |  |  | 68 | 			bool toFile(bob_dom_otextfilestream& os);
 | 
        
           |  |  | 69 | 			bool toFile(bob_dom_obinaryfilestream& os);
 | 
        
           |  |  | 70 | 		};
 | 
        
           |  |  | 71 |   | 
        
           |  |  | 72 | 	public:
 | 
        
           |  |  | 73 | 		// 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;
 | 
        
           |  |  | 75 |   | 
        
           |  |  | 76 | 		int flags;
 | 
        
           |  |  | 77 | 		point3d position;
 | 
        
           |  |  | 78 | 		angle_axis *rotation;
 | 
        
           |  |  | 79 | 		point3d *targetPos;
 | 
        
           |  |  | 80 | 		double rollAngle;
 | 
        
           |  |  | 81 | 		tcb_info *pos_tcb_info, *rot_tcb_info, *tpos_tcb_info;
 | 
        
           |  |  | 82 | 		double fov;
 | 
        
           |  |  | 83 | 		rgb *color;
 | 
        
           |  |  | 84 | 		int length, index;
 | 
        
           |  |  | 85 |   | 
        
           |  |  | 86 | 		bob_dom_frame() 
 | 
        
           |  |  | 87 | 		{ 
 | 
        
           |  |  | 88 | 			flags=0; 
 | 
        
           |  |  | 89 | 			rotation=0;
 | 
        
           |  |  | 90 | 			targetPos=0;
 | 
        
           |  |  | 91 | 			rollAngle=0;
 | 
        
           |  |  | 92 | 			color=0;
 | 
        
           |  |  | 93 | 			pos_tcb_info=0;
 | 
        
           |  |  | 94 | 			rot_tcb_info=0;
 | 
        
           |  |  | 95 | 			tpos_tcb_info=0;
 | 
        
           |  |  | 96 | 			fov=0;
 | 
        
           |  |  | 97 | 			length=0;
 | 
        
           |  |  | 98 | 			index=0;
 | 
        
           |  |  | 99 | 		}
 | 
        
           |  |  | 100 |   | 
        
           |  |  | 101 | 		~bob_dom_frame() 
 | 
        
           |  |  | 102 | 		{ 
 | 
        
           |  |  | 103 | 			delete rotation; delete targetPos; delete pos_tcb_info; delete rot_tcb_info; delete tpos_tcb_info;
 | 
        
           |  |  | 104 | 			delete color;
 | 
        
           |  |  | 105 | 		}
 | 
        
           |  |  | 106 |   | 
        
           |  |  | 107 | 		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 |   | 
        
           |  |  | 115 | template <class Ty>
 | 
        
           |  |  | 116 | inline
 | 
        
           |  |  | 117 | Ty& operator << (Ty& os, bob_dom_frame& right)
 | 
        
           |  |  | 118 | {
 | 
        
           |  |  | 119 | 	right.toFile(os);
 | 
        
           |  |  | 120 | 	return os;
 | 
        
           |  |  | 121 | }
 | 
        
           |  |  | 122 |   | 
        
           |  |  | 123 | #endif // !defined(BOB_DOM_FRAME_INCLUDED)
 |