00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GEE_PARAM_WRITER_H
00021 #define GEE_PARAM_WRITER_H
00022
00023 #include <di_types.h>
00024
00025 #include <gee_config.h>
00026
00027 #include <vee_matrix3.h>
00028 #include <vee_matrix4.h>
00029 #include <vee_vector3.h>
00030 #include <vee_vector4.h>
00031
00032 #include <map>
00033
00034 class GEE_Io;
00035
00054 class GEE_ParamWriter
00055 {
00056 public:
00057 GEE_ParamWriter();
00058 virtual ~GEE_ParamWriter();
00059
00060 bool writeParameters(GEE_Io *);
00061 bool readParameters(GEE_Io *);
00062
00063 void clear();
00064
00065 enum Type {
00066 FLOAT,
00067 INT,
00068 ID,
00069 BOOL,
00070 MATRIX3,
00071 MATRIX4,
00072 MATRIX4D,
00073 VECTOR3,
00074 VECTOR4,
00075 STLSTRING
00076 };
00077
00078 void addMemberFloat(ushort id, const float *x) { addMember(FLOAT, id, x); }
00079 void addMemberInt(ushort id, const int *x) { addMember(INT, id, x); }
00080 void addMemberUInt(ushort id, const unsigned *x) { addMember(INT, id, x); }
00081 void addMemberId(ushort id, const GEE_id_t *x) { addMember(ID, id, x); }
00082 void addMemberBool(ushort id, const bool *x) { addMember(BOOL, id, x); }
00083 void addMemberVector3(ushort id, const VEE_Vector3 *x)
00084 { addMember(VECTOR3, id, x); }
00085 void addMemberVector4(ushort id, const VEE_Vector4 *x)
00086 { addMember(VECTOR4, id, x); }
00087 void addMemberMatrix3(ushort id, const VEE_Matrix3 *x)
00088 { addMember(MATRIX3, id, x); }
00089 void addMemberMatrix4(ushort id, const VEE_Matrix4 *x)
00090 { addMember(MATRIX4, id, x); }
00091 void addMemberMatrix4d(ushort id, const VEE_Matrix4d *x)
00092 { addMember(MATRIX4D, id, x); }
00093
00094 void addMember(Type, ushort, const void *);
00095
00096 private:
00097
00098 class Item
00099 {
00100 public:
00101 int m_offset;
00102 Type m_type;
00103 };
00104
00105 typedef std::map<ushort, Item> container;
00106
00107 container m_params;
00108 };
00109
00110 #endif