OSDN Git Service

fix for gcc-4.5 on cygwin
[meshio/meshio.git] / src / pmd.h
index 3a41a19..d0deb7b 100644 (file)
--- a/src/pmd.h
+++ b/src/pmd.h
@@ -48,11 +48,11 @@ namespace meshio {
     struct Vertex
     {
       //! \8dÀ\95W
-      Vector3 pos;
+      meshio::Vector3 pos;
       //! \96@\90ü\83x\83N\83g\83\8b
-      Vector3 normal;
+      meshio::Vector3 normal;
       //! \83e\83N\83X\83`\83\83UV
-      Vector2 uv;
+      meshio::Vector2 uv;
       //! \83u\83\8c\83\93\83f\83B\83\93\83O\83{\81[\83\931
       unsigned short bone0;
       //! \83u\83\8c\83\93\83f\83B\83\93\83O\83{\81[\83\932
@@ -62,6 +62,7 @@ namespace meshio {
       //! \94ñ\83G\83b\83W
       unsigned char edge_flag;
     };
+#ifndef SWIG
     inline std::ostream &operator<<(std::ostream &os, const Vertex &rhs)
     {
       os
@@ -77,6 +78,7 @@ namespace meshio {
         ;
       return os;
     }
+#endif
 
     ////////////////////////////////////////////////////////////
     //! \8dÞ\8e¿
@@ -84,13 +86,13 @@ namespace meshio {
     struct Material
     {
       //! Diffuse
-      fRGBA diffuse;
+      meshio::fRGBA diffuse;
       //! Shinness
       float shinness;
       //! Specular
-      fRGB specular;
+      meshio::fRGB specular;
       //! Ambient
-      fRGB ambient;
+      meshio::fRGB ambient;
       //! \83g\83D\81[\83\93\83e\83N\83X\83`\83\83
       unsigned char toon_index;
       //! \97Ö\8as/\89e
@@ -98,8 +100,9 @@ namespace meshio {
       //! \96Ê\92¸\93_\90\94
       unsigned int vertex_count;
       //! \83e\83N\83X\83`\83\83
-      fixed_string<20> texture;
+      meshio::fixed_string<20> texture;
     };
+#ifndef SWIG
     inline std::ostream &operator<<(std::ostream &os,
         const Material &rhs)
     {
@@ -114,6 +117,7 @@ namespace meshio {
         ;
       return os;
     }
+#endif
 
     ////////////////////////////////////////////////////////////
     //! \83{\81[\83\93 
@@ -145,7 +149,7 @@ namespace meshio {
     struct Bone
     {
       //! \96¼\91O
-      fixed_string<20> name;
+      meshio::fixed_string<20> name;
       //! \90e\83{\81[\83\93
       unsigned short parent_index;
       //! \8eq\83{\81[\83\93
@@ -155,12 +159,12 @@ namespace meshio {
       //! \89e\8b¿IK\83{\81[\83\93
       unsigned short ik_index;
       // \83{\81[\83\93\8dÀ\95W
-      Vector3 pos;
+      meshio::Vector3 pos;
       //! \89p\8cê\96¼
-      fixed_string<20> english_name;
+      meshio::fixed_string<20> english_name;
       //! \83{\81[\83\93\8aK\91w\8d\\92z\97p
       Bone* parent;
-      Vector3 tail;
+      meshio::Vector3 tail;
       std::vector<Bone*> children;
       unsigned short index;
 
@@ -168,6 +172,7 @@ namespace meshio {
         : parent_index(-1), tail_index(-1), type(BONE_UNKNOWN), ik_index(-1), parent(0), index(-1)
       {}
     };
+#ifndef SWIG
     inline std::ostream &operator<<(std::ostream &os,
         const Bone &rhs)
     {
@@ -178,6 +183,7 @@ namespace meshio {
         ;
       return os;
     }
+#endif
 
     ////////////////////////////////////////////////////////////
     //! IK
@@ -197,6 +203,7 @@ namespace meshio {
       //! \83G\83t\83F\83N\83^\82É\98A\93®\82·\82é\83{\81[\83\93(\8aî\96{\93I\82É\90e\83{\81[\83\93\82É\91k\82é)
       std::vector<unsigned short> children;
     };
+#ifndef SWIG
     inline std::ostream &operator<<(std::ostream &os, const IK &rhs)
     {
       os
@@ -205,6 +212,7 @@ namespace meshio {
         ;
       return os;
     }
+#endif
 
     ////////////////////////////////////////////////////////////
     //! \95\\8fî
@@ -226,7 +234,7 @@ namespace meshio {
     struct Morph
     {
       //! \95\\8fî\96¼
-      fixed_string<20> name;
+      meshio::fixed_string<20> name;
       //! \8eg\97p\82·\82é\92¸\93_\90\94
       unsigned int vertex_count;
       //! \95ª\97Þ
@@ -234,10 +242,11 @@ namespace meshio {
       //! \92¸\93_Index
       std::vector<unsigned int> indices;
       //! \88Ú\93®\97Ê
-      std::vector<Vector3> pos_list;
+      std::vector<meshio::Vector3> pos_list;
       //! \89p\8cê\96¼
-      fixed_string<20> english_name;
+      meshio::fixed_string<20> english_name;
     };
+#ifndef SWIG
     inline std::ostream &operator<<(std::ostream &os, const Morph &rhs)
     {
       os
@@ -247,14 +256,15 @@ namespace meshio {
         ;
       return os;
     }
+#endif
 
     ////////////////////////////////////////////////////////////
     //! \83{\81[\83\93\95\\8e¦\98g
     ////////////////////////////////////////////////////////////
     struct BoneGroup
     {
-      fixed_string<50> name;
-      fixed_string<50> english_name;
+      meshio::fixed_string<50> name;
+      meshio::fixed_string<50> english_name;
     };
 
     ////////////////////////////////////////////////////////////
@@ -284,7 +294,7 @@ namespace meshio {
     struct RigidBody
     {
       //! \8d\84\91Ì\96¼
-      fixed_string<20> name;
+      meshio::fixed_string<20> name;
       //! \8aÖ\98A\83{\81[\83\93(\83{\81[\83\93\92Ç\8f]\82Æ\83{\81[\83\93\88Ê\92u\8d\87\82í\82¹\82Å\95K\97v)
       unsigned short boneIndex;
       //! \83O\83\8b\81[\83v
@@ -298,8 +308,8 @@ namespace meshio {
       float h;
       float d;
       //! \8ep\90¨
-      Vector3 position;
-      Vector3 rotation;
+      meshio::Vector3 position;
+      meshio::Vector3 rotation;
       //! \8e¿\97Ê
       float weight;
       //! \95¨\97\9d\89\89\8eZ\83p\83\89\83\81\81[\83^(bullet)
@@ -315,24 +325,24 @@ namespace meshio {
     struct Constraint
     {
       //! Joint\96¼
-      fixed_string<20> name;
+      meshio::fixed_string<20> name;
       //! \90Ú\91±\8d\84\91ÌA
       unsigned int rigidA;
       //! \90Ú\91±\8d\84\91ÌB
       unsigned int rigidB;
       //! \88Ê\92u
-      Vector3 pos;
+      meshio::Vector3 pos;
       //! \89ñ\93]
-      Vector3 rot;
+      meshio::Vector3 rot;
       //! \88Ú\93®\90§\8cÀ
-      Vector3 constraintPosMin;
-      Vector3 constraintPosMax;
+      meshio::Vector3 constraintPosMin;
+      meshio::Vector3 constraintPosMax;
       //! \89ñ\93]\90§\8cÀ
-      Vector3 constraintRotMin;
-      Vector3 constraintRotMax;
+      meshio::Vector3 constraintRotMin;
+      meshio::Vector3 constraintRotMax;
       //! \82Î\82Ë
-      Vector3 springPos;
-      Vector3 springRot;
+      meshio::Vector3 springPos;
+      meshio::Vector3 springRot;
     };
 
 
@@ -340,8 +350,8 @@ namespace meshio {
     struct IO
     {
       float version;
-      fixed_string<20> name;
-      fixed_string<256> comment;
+      meshio::fixed_string<20> name;
+      meshio::fixed_string<256> comment;
       std::vector<Vertex> vertices;
       std::vector<unsigned short> indices;
       std::vector<Material> materials;
@@ -351,19 +361,20 @@ namespace meshio {
       std::vector<unsigned short> face_list;
       std::vector<BoneGroup> bone_group_list;
       std::vector<std::pair<unsigned short, unsigned char> > bone_display_list;
-      std::array<fixed_string<100>, 10> toon_textures;
+      std::array<meshio::fixed_string<100>, 10> toon_textures;
       std::vector<RigidBody> rigidbodies;
       std::vector<Constraint> constraints;
 
-      fixed_string<20> english_name;
-      fixed_string<256> english_comment;
+      meshio::fixed_string<20> english_name;
+      meshio::fixed_string<256> english_comment;
 
       IO();
       bool read(const char *path);
       bool write(const char *path);
-      bool read(binary::IReader &reader);
-      bool write(binary::IWriter &writer);
+      bool read(meshio::binary::IReader &reader);
+      bool write(meshio::binary::IWriter &writer);
     };
+#ifndef SWIG
     inline std::ostream &operator<<(std::ostream &os, const IO &rhs)
     {
       os
@@ -401,6 +412,7 @@ namespace meshio {
         ;
       return os;
     }
+#endif
 
 
   } // namespace pmd