OSDN Git Service

add constraint.
[meshio/meshio.git] / include / mqo.h
index f8da2f6..b64c7f6 100644 (file)
 namespace meshio {
 namespace mqo {
 
-typedef la::Vector2 Vector2;
-typedef la::Vector3 Vector3;
-typedef la::Vector4 Vector4;
-typedef color::bRGBA RGBA;
+typedef ::meshio::la::Vector2 Vector2;
+typedef ::meshio::la::Vector3 Vector3;
+typedef ::meshio::la::Vector4 Vector4;
+typedef ::meshio::color::fRGBA RGBA;
 
 //! Scene\83`\83\83\83\93\83N
 struct Scene
@@ -97,6 +97,10 @@ struct Material
                : shader(0), diffuse(1), ambient(0), emmit(0), specular(0), power(0),
                vcol(0)
                {}
+
+       // for python3 unicode
+       std::wstring getName()const;
+       std::wstring getTexture()const;
 };
 inline std::ostream &operator<<(std::ostream &os, const Material &rhs)
 {
@@ -138,6 +142,8 @@ struct Face
                        uv[2]=Vector2();
                        uv[3]=Vector2();
                }
+       int getIndex(int i){ return indices[i]; }
+       Vector2 getUV(int i){ return uv[i]; }
 };
 inline std::ostream &operator<<(std::ostream &os, const Face &rhs)
 {
@@ -207,9 +213,17 @@ struct Object
        float smoothing;
        Vector3 color;
        int color_type;
+       int mirror;
 
        std::vector<Vector3> vertices;
        std::vector<Face> faces;
+
+       Object()
+               : depth(0), folding(0), visible(1), locking(0), shading(0), 
+               smoothing(60.0f), color_type(0), mirror(0)
+       {}
+
+       std::wstring getName()const;
 };
 inline std::ostream &operator<<(std::ostream &os, const Object &rhs)
 {
@@ -233,7 +247,12 @@ struct IO
        std::vector<Object> objects;
 
        bool read(binary::IReader &reader);
-       bool write(std::ostream &os);
+       bool read(const char *path);
+//#ifdef _WIN32
+       bool read(const wchar_t *path);
+//#endif
+       bool write(binary::IWriter &writer);
+       bool write(const char *path);
 };
 
 } // namespace mqo