2 Copyright (C) 2001-2006, William Joseph.
5 This file is part of GtkRadiant.
7 GtkRadiant is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 GtkRadiant is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #if !defined(INCLUDED_IMAP_H)
23 #define INCLUDED_IMAP_H
25 #include "generic/constant.h"
30 /// \brief A node whose state can be imported from a token stream.
34 STRING_CONSTANT(Name, "MapImporter");
36 virtual bool importTokens(Tokeniser& tokeniser) = 0;
39 /// \brief A node whose state can be exported to a token stream.
43 STRING_CONSTANT(Name, "MapExporter");
45 virtual void exportTokens(TokenWriter& writer) const = 0;
48 #include "iscenegraph.h"
52 class TextInputStream;
53 class TextOutputStream;
56 typedef void(*GraphTraversalFunc)(scene::Node& root, const scene::Traversable::Walker& walker);
58 /// \brief A module that reads and writes a map in a specific format.
62 INTEGER_CONSTANT(Version, 2);
63 STRING_CONSTANT(Name, "map");
65 /// \brief Read a map graph into \p root from \p outputStream, using \p entityTable to create entities.
66 virtual void readGraph(scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable) const = 0;
67 /// \brief Write the map graph obtained by applying \p traverse to \p root into \p outputStream.
68 virtual void writeGraph(scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream) const = 0;
72 template<typename Type>
74 typedef Modules<MapFormat> MapModules;
76 template<typename Type>
78 typedef ModulesRef<MapFormat> MapModulesRef;