OSDN Git Service

add site document.
[meshio/meshio.git] / doc / source / c++.rst
1 .. highlight:: c++
2
3 C++ライブラリの使い方
4 =====================
5
6 :: 
7
8     #include <meshio.h>
9     #include <iostream>
10
11
12     int main(int argc, char **argv)
13     {
14         using namespace meshio;
15
16         if(argc<2){
17             std::wcout << "usage: " << argv[0] << " {mqo file}" << std::endl;
18             return -1;
19         }
20         mqo::IO io;
21         if(!io.read(argv[1])){
22             std::wcout << "fail to read " << argv[1] << std::endl;
23             return -1;
24         }
25
26         for(std::vector<mqo::Material>::iterator it=io.materials.begin();
27                 it!=io.materials.end();
28                 ++it)
29         {
30             std::wcout << it->getName() << std::endl;
31         }
32
33         return 0;
34     }
35