1 /* 2 * Copyright (C) 2005 Andreas Volz 3 * Copyright (C) 2006-2007 MakeHuman Project 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License as 7 * published by the Free Software Foundation; either version 3 of 8 * the License, or (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software Foun- 17 * dation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 18 * USA 19 * 20 * File: FaceVector.h 21 * Project: MakeHuman <info@makehuman.org>, http://www.makehuman.org/ 22 * Library: ANIMORPH 23 * 24 * For individual developers look into the AUTHORS file. 25 * 26 */ 27 28 #ifndef FACEVECTOR_H 29 #define FACEVECTOR_H 1 30 31 #ifdef HAVE_CONFIG_H 32 #include <config.h> 33 #endif 34 35 #include <iostream> 36 #include <fstream> 37 #include "Face.h" 38 #include "FileReader.h" 39 40 namespace Animorph { 41 42 /*! \brief Represents a vector of faces. 43 44 Can be loaded from a file. 45 46 The format of Faces file: 47 \verbatim 48 <int>,<int>,<int>{,<int>} 49 ... 50 \endverbatim 51 The format of Face colors file: 52 \verbatim 53 <int> 54 ... 55 \endverbatim 56 */ 57 class FaceVector : public std::vector <Face> 58 { 59 private: 60 void fromGeometryStream (std::ifstream &in_stream); 61 void fromColorsStream (std::ifstream &in_stream); 62 63 public: 64 /// load the Face data from a file 65 /*! 66 * \param filename the file to load 67 * \return true if file is found 68 * \return false if file isn't found 69 */ 70 bool loadGeometry (const std::string& filename); 71 72 /// load the Face Color data from a file 73 /*! 74 * \param filename the file to load 75 * \return true if file was found 76 * \return false if file wasn't found 77 */ 78 bool loadColors (const std::string& filename); 79 }; 80 81 } 82 83 #endif // FACEVECTOR_H 84