xtgSerialize.h
Go to the documentation of this file.
00001 /*
00002  * @author:  Marko Mahnič
00003  * @created: 2010-05-11
00004  */
00005    
00006 #ifndef XTGSERIALIZE_9NFCOXJ1
00007 #define XTGSERIALIZE_9NFCOXJ1
00008 
00009 #include <blort/TomGine/tgRenderModel.h>
00010 
00011 #include <boost/archive/text_oarchive.hpp>
00012 #include <boost/archive/text_iarchive.hpp>
00013 #include <boost/serialization/base_object.hpp>
00014 #include <boost/serialization/list.hpp>
00015 #include <boost/serialization/vector.hpp>
00016 #include <boost/serialization/string.hpp>
00017 
00018 
00019 namespace boost {
00020 namespace serialization {
00021 
00022 template<class Archive>
00023 void serialize(Archive & ar, TomGine::vec2 & v, const unsigned int version)
00024 {
00025    ar & v.v;
00026 }
00027 
00028 template<class Archive>
00029 void serialize(Archive & ar, TomGine::vec3 & v, const unsigned int version)
00030 {
00031    ar & v.v;
00032 }
00033 
00034 template<class Archive>
00035 void serialize(Archive & ar, TomGine::vec4 & v, const unsigned int version)
00036 {
00037    ar & v.v;
00038 }
00039 
00040 template<class Archive>
00041 void serialize(Archive & ar, TomGine::tgQuaternion & v, const unsigned int version)
00042 {
00043    ar & v.x;
00044    ar & v.y;
00045    ar & v.z;
00046    ar & v.w;
00047 }
00048 
00049 template<class Archive>
00050 void serialize(Archive & ar, TomGine::tgModel::Vertex & m, const unsigned int version)
00051 {
00052    ar & m.pos;
00053    ar & m.normal;
00054    ar & m.texCoord;
00055 }
00056 
00057 template<class Archive>
00058 void serialize(Archive & ar, TomGine::tgModel::Face & m, const unsigned int version)
00059 {
00060    ar & m.vertices;
00061    ar & m.normal;
00062 }
00063 
00064 template<class Archive>
00065 void serialize(Archive & ar, TomGine::tgModel::Line & m, const unsigned int version)
00066 {
00067    ar & m.start;
00068    ar & m.end;
00069 }
00070 
00071 template<class Archive>
00072 void serialize(Archive & ar, TomGine::tgModel::LineLoop & m, const unsigned int version)
00073 {
00074    ar & m.points;
00075 }
00076 
00077 template<class Archive>
00078 void serialize(Archive & ar, TomGine::tgModel & m, const unsigned int version)
00079 {
00080    ar & m.m_vertices;
00081    ar & m.m_faces;
00082    ar & m.m_trianglefans;
00083    ar & m.m_quadstrips;
00084    ar & m.m_lines;
00085    ar & m.m_lineloops;
00086    ar & m.m_points;
00087 }
00088 
00089 template<class Archive>
00090 void serialize(Archive & ar, TomGine::tgRenderModel::Material & m, const unsigned int version)
00091 {
00092    ar & m.ambient;
00093    ar & m.diffuse;
00094    ar & m.specular;
00095    ar & m.color;
00096    ar & m.shininess;
00097 }
00098 
00099 template<class Archive>
00100 void serialize(Archive & ar, TomGine::tgPose & m, const unsigned int version)
00101 {
00102    ar & m.pos;
00103    ar & m.q;
00104 }
00105 
00106 template<class Archive>
00107 void serialize(Archive & ar, TomGine::tgRenderModel & m, const unsigned int version)
00108 {
00109     ar & boost::serialization::base_object<TomGine::tgModel>(m);
00110     ar & m.m_pose;
00111     ar & m.m_material;
00112 }
00113 
00114 } // namespace serialization
00115 } // namespace boost
00116 
00117 #endif /* end of include guard: XTGSERIALIZE_9NFCOXJ1 */


blort
Author(s): Michael Zillich, Thomas Mörwald, Johann Prankl, Andreas Richtsfeld, Bence Magyar (ROS version)
autogenerated on Thu Jan 2 2014 11:38:26