コード例 #1
0
        static void test_vector()
        {
            test_name("vector");

            // vector member
            PHFemMeshNewDesc  descFemMeshNew = new PHFemMeshNewDesc();
            vectorwrapper_int tets           = descFemMeshNew.tets;

            // intrinsic element
            tets.push_back(101);
            tets.push_back(102);
            put("vec<int>", "2  ", tets.size());
            put("vec<int>", "101", tets[0]);
            put("vec<int>", "102", tets[1]);
            tets.clear();
            tets.push_back(101);
            tets.push_back(102);
            tets[0] = 201;
            tets[1] = 202;
            tets.push_back(203);
            put("vec<int>", "3  ", tets.size());
            put("vec<int>", "201", tets[0]);
            put("vec<int>", "202", tets[1]);
            put("vec<int>", "203", tets[2]);
            // structure element
            vectorwrapper_Vec3d vertices = descFemMeshNew.vertices;

            vertices.push_back(new Vec3d(0.1, 0.2, 0.3));
            vertices.push_back(new Vec3d(0.4, 0.5, 0.6));
            put("vec<Vec3d>", "2  ", vertices.size());
            put("vec<Vec3d>", "0.1", vertices[0].x);
            put("vec<Vec3d>", "0.2", vertices[0].y);
            put("vec<Vec3d>", "0.3", vertices[0].z);
            put("vec<Vec3d>", "(0.4, 0.5, 0.6)", vertices[1].ToString());
        }
コード例 #2
0
 static string edit_vectorwrapper(vectorwrapper_Vec3d v, int ix)
 {
     return("( " + v[ix].x + ", " + v[ix].y + ", " + v[ix].z + " )");
 }