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: Hotspot.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 HOTSPOT_H
29 #define HOTSPOT_H 1
30 
31 #ifdef HAVE_CONFIG_H
32   #include <config.h>
33 #endif
34 
35 #include <map>
36 #include <vector>
37 #include <iostream>
38 #include <fstream>
39 #include "FileReader.h"
40 
41 namespace Animorph {
42 
43 typedef std::vector <int> HotspotData;
44 
45 /*! \brief Loadable map from hotspot names to vectors of ints
46 
47 The format of Hotspot file:
48 \verbatim
49 <string>:
50 <int>
51 <int>
52 ...
53 {<newline>
54 <hotspot>}
55 \endverbatim
56 */
57 class Hotspot : public std::map <std::string, HotspotData>
58 {
59 private:
60   void fromStream (std::ifstream &in_stream);
61 
62 public:
63   /// load a Hotspot
64   /*!
65    * \param filename the file with Hotspot data to load
66    * \return true if file was found
67    * \return false if file wasn't found
68    */
69   bool load (const std::string& filename);
70 };
71 
72 }
73 
74 #endif	// HOTSPOT_H
75