Subversion Repositories spk

Rev

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

#ifndef BOB_DOM_FRAME_INCLUDED
#define BOB_DOM_FRAME_INCLUDED

#include "bob_dom_base.h"
#include "geometry_bob.h"

#define CUT_F_LINEAR          0x1
#define CUT_F_ROT             0x2
#define CUT_F_TARGETPOS       0x8
#define CUT_F_SAMEPOS         0x10
#define CUT_F_SAMEROT         0x20
#define CUT_F_SAMETARGET      0x40
#define CUT_F_BEZIER          0x80
#define CUT_F_SAMESCALE       0x100
#define CUT_F_COLOR           0x200
#define CUT_F_SAMECOLOR       0x400
#define CUT_F_FOV             0x800
#define CUT_F_SAMEFOV         0x1000
#define CUT_F_ABSROT          0x2000
#define CUT_F_POSTCBINFO      0x4000
#define CUT_F_ROTTCBINFO      0x8000
#define CUT_F_POSBEZINFO      0x10000
#define CUT_F_TPOSTCBINFO     0x20000
#define CUT_F_FAKEROTTCBINFO  0x40000

class bob_frame : public bob_with_errors
{
        public:
                struct Position : public point3d<int>
                {
                        bool toFile(obinaryfilestream& os) { return point3d<value_type>::toFile(os); }
                        bool toFile(otextfilestream& os);
                };

                struct AngleAxis
                {
                        double angle, x, y, z;

                        AngleAxis() { angle=0; x=0; y=0; z=0; }

                        bool load(ibinaryfilestream& is);
                        bool toFile(otextfilestream & os);
                        bool toFile(obinaryfilestream& os);
                };

                struct rgb
                {
                        double r, g, b;

                        rgb() { r=0; g=0; b=0; }

                        bool load(ibinaryfilestream& is);
                        bool toFile(otextfilestream & os);
                        bool toFile(obinaryfilestream& os);
                };

                struct tcb_info
                {
                        double tension, continuity, bias, easeFrom, easeTo;

                        tcb_info() { tension=0; continuity=0; bias=0; easeFrom=0; easeTo=0; }

                        bool load(ibinaryfilestream& is);
                        bool toFile(otextfilestream& os);
                        bool toFile(obinaryfilestream& os);
                };

        public:
                // don't include CUT_F_POSBEZINFO in the mask until it's known!
                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;

                int flags;
                Position position;
                AngleAxis *rotation;
                Position *targetPos;
                double rollAngle;
                tcb_info *pos_tcb_info, *rot_tcb_info, *tpos_tcb_info;
                double fov;
                rgb *color;
                int length, index;

                bob_frame()
                {
                        flags=0;
                        rotation=0;
                        targetPos=0;
                        rollAngle=0;
                        color=0;
                        pos_tcb_info=0;
                        rot_tcb_info=0;
                        tpos_tcb_info=0;
                        fov=0;
                        length=0;
                        index=0;
                }

                ~bob_frame()
                {
                        delete rotation; delete targetPos; delete pos_tcb_info; delete rot_tcb_info; delete tpos_tcb_info;
                        delete color;
                }

                int valueCount();

                bool toFile(obinaryfilestream& os);
                bool toFile(otextfilestream& os);

                bool load(ibinaryfilestream& is);
};

#endif // !defined(BOB_DOM_FRAME_INCLUDED)