Debian Codegraph @

tools/physicalModeling/mesh2faust/vega/libraries/include/objMeshBinaryLoader.h

raw symbols SCIP
1 /*************************************************************************
2 * *
3 * Vega FEM Simulation Library Version 3.1 *
4 * *
5 * "objMesh" library , Copyright (C) 2007 CMU, 2009 MIT, 2016 USC *
6 * All rights reserved. *
7 * *
8 * Code authors: Jernej Barbic, Christopher Twigg, Daniel Schroeder *
9 * http://www.jernejbarbic.com/code *
10 * *
11 * Research: Jernej Barbic, Fun Shing Sin, Daniel Schroeder, *
12 * Doug L. James, Jovan Popovic *
13 * *
14 * Funding: National Science Foundation, Link Foundation, *
15 * Singapore-MIT GAMBIT Game Lab, *
16 * Zumberge Research and Innovation Fund at USC *
17 * *
18 * This library is free software; you can redistribute it and/or *
19 * modify it under the terms of the BSD-style license that is *
20 * included with this library in the file LICENSE.txt *
21 * *
22 * This library is distributed in the hope that it will be useful, *
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the file *
25 * LICENSE.TXT for more details. *
26 * *
27 *************************************************************************/
28
29 /*
30 Loads/saves an obj file to binary format.
31 Jernej Barbic, 2009
32 */
33
34 #ifndef _OBJMESHBINARYLOADER_H_
35 #define _OBJMESHBINARYLOADER_H_
36
37 #include "objMesh.h"
38 #include <string>
39
40 class ObjMeshBinaryLoader
41 {
42 public:
43 static int readFromBinaryFile(ObjMesh ** objMesh, const std::string & filename);
44 static int writeToBinaryFile(ObjMesh * objMesh, const std::string & filename);
45
46 protected:
47 static int readFromBinary(ObjMesh::Vertex ** vertex, std::ifstream * fin);
48 static int readFromBinary(ObjMesh::Face ** face, std::ifstream * fin);
49 static int readFromBinary(ObjMesh::Group ** group, std::ifstream * fin);
50 static int readFromBinary(ObjMesh::Material ** material, std::ifstream * fin);
51 static int writeToBinary(ObjMesh::Vertex * vertex, std::ofstream * fout);
52 static int writeToBinary(ObjMesh::Face * face, std::ofstream * fout);
53 static int writeToBinary(ObjMesh::Group * group, std::ofstream * fout);
54 static int writeToBinary(ObjMesh::Material * material, std::ofstream * fout);
55
56 static int readStringFromBinary(std::string & name, std::ifstream * fin);
57 static int readVec3dFromBinary(Vec3d & vec, std::ifstream * fin);
58 static int writeStringToBinary(const std::string name, std::ofstream * fout);
59 static int writeVec3dToBinary(Vec3d & vec, std::ofstream * fout);
60 };
61
62 #endif
63