OSDN Git Service

update site
[meshio/meshio_doc.git] / source / meshio.rst
diff --git a/source/meshio.rst b/source/meshio.rst
new file mode 100644 (file)
index 0000000..c949e8f
--- /dev/null
@@ -0,0 +1,48 @@
+==================================
+meshio
+==================================
+
+.. toctree::
+   :maxdepth: 2
+
+C++で実装したpmd, mqoの読み書きライブラリ。本プロジェクトの本体。
+2次元画像のlibjpegやlibpngのような使い勝手のライブラリを目指している。
+
+swigで作ったpythonバインディングでBlender addonを作っていたのだが
+ビルド済みのCモジュールを提供するのはめんどくさいことがわかった。
+Blenderはpymeshioに切り離す方向で整理中。
+あと、luaバインディングを実験中。
+
+
+sample code(c++)
+==================================
+::
+
+   #include <meshio.h>
+   #include <iostream>
+   
+   
+   int main(int argc, char **argv)
+   {
+      using namespace meshio;
+   
+      if(argc<2){
+         std::wcout << "usage: " << argv[0] << " {mqo file}" << std::endl;
+         return -1;
+      }
+      mqo::IO io;
+      if(!io.read(argv[1])){
+         std::wcout << "fail to read " << argv[1] << std::endl;
+         return -1;
+      }
+   
+      for(std::vector<mqo::Material>::iterator it=io.materials.begin();
+            it!=io.materials.end();
+            ++it)
+      {
+         std::wcout << it->getName() << std::endl;
+      }
+   
+      return 0;
+   }
+