Frapper  1.0a
NodeType.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of FRAPPER
4 research.animationsinstitut.de
5 sourceforge.net/projects/frapper
6 
7 Copyright (c) 2008-2009 Filmakademie Baden-Wuerttemberg, Institute of Animation
8 
9 This program is free software; you can redistribute it and/or modify it under
10 the terms of the GNU Lesser General Public License as published by the Free Software
11 Foundation; version 2.1 of the License.
12 
13 This program is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16 
17 You should have received a copy of the GNU Lesser General Public License along with
18 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20 http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
21 -----------------------------------------------------------------------------
22 */
23 
33 
34 #ifndef NODETYPE_H
35 #define NODETYPE_H
36 
37 #include "FrapperPrerequisites.h"
38 #include <QtCore/QString>
39 #include <QtGui/QColor>
40 #include "Node.h"
41 #include "ParameterGroup.h"
42 #include <QtXml/QDomElement>
43 #include "NodeTypeInterface.h"
44 #include "InstanceCounterMacros.h"
45 
46 namespace Frapper {
47 
52  {
53 
55 
56  public: // type definitions
57 
62  typedef QMap<QString, NodeType *> Map;
63 
68  typedef QPair<QString, QString> Category;
69 
73  typedef QList<Category> CategoryList;
74 
75  public: // static data
76 
82 
83  private: // static data
84 
89  static QMap<QString, unsigned int> s_nodeIndex;
90 
91  public: // constructors and destructors
92 
98  NodeType ( const QString &filename );
99 
103  ~NodeType ();
104 
105  public: // functions
106 
112  QString getName () const;
113 
120  QString getCategoryName () const;
121 
127  QColor getColor () const;
128 
134  bool isAvailable () const;
135 
144  bool isInternal () const;
145 
152  bool isErroneous () const;
153 
160  Node * createNode ( const QString &name );
161 
162  private: // functions
163 
170  bool parseDescriptionFile ( const QString &filename );
171 
179  ParameterGroup * parseParameters ( QDomElement rootElement );
180 
187  void parseAffections ( QDomElement rootElement );
188 
189  private: // data
190 
196 
201 
205  QString m_name;
206 
210  QString m_categoryName;
211 
215  QColor m_color;
216 
225 
231 
237 
241  QMultiMap<QString, QString> m_affectionMap;
242 
243 
244  };
245 
246 } // end namespace Frapper
247 
248 #endif