Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

nodes.hpp

Go to the documentation of this file.
00001 // libdoomwad: manipulates Doom wad files.
00002 // Copyright (C) 2005  John Gaughan
00003 //
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2.1 of the License, or (at your option) any later version.
00008 //
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Lesser General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU Lesser General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 //
00018 // This library is distributed with the full text of the LGPL. Please see
00019 // the accompanying file named COPYING.
00020 // 
00021 // You may contact the author at john@johngaughan.net
00022 
00043 // C++ required.
00044 #if !defined __cplusplus
00045 #error C++ compiler required
00046 #endif
00047 
00048 // Include guard
00049 #if !defined NODES_H
00050 #define NODES_H
00051 
00052 // C++ headers
00053 #include <vector>
00054 
00055 // Doom headers
00056 #include "global.hpp"
00057 #include "lump.hpp"
00058 #include "wadentry.hpp"
00059 
00060 namespace Doomwad
00061 {
00062 
00070   EXPORT class Node : public WadEntryElement
00071   {
00072     public:
00073 
00075     static const size_t LENGTH;
00076 
00078     static const int16 SUBSECTOR_MASK;
00079 
00080     int16 x;         
00081     int16 y;         
00082     int16 dx;        
00083     int16 dy;        
00084     int16 r_y_upper; 
00085     int16 r_y_lower; 
00086     int16 r_x_lower; 
00087     int16 r_x_upper; 
00088     int16 l_y_upper; 
00089     int16 l_y_lower; 
00090     int16 l_x_lower; 
00091     int16 l_x_upper; 
00092     uint16 r_child;  
00093     uint16 l_child;  
00094 
00095     // Constructors
00096     Node (int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, uint16 = 0, uint16 = 0) throw ();
00097     virtual ~Node (void) throw ();
00098 
00099     virtual size_t getLength (void) const throw ();
00100     virtual bool write (Lump &lump, Lump::size_type i) const throw ();
00101     virtual bool read (const Lump &lump, Lump::size_type i) throw ();
00102     virtual std::string toString (void) const throw ();
00103   };
00104 
00112   EXPORT class GLNode : public WadEntryElement
00113   {
00114     public:
00115 
00117     static const size_t LENGTH;
00118 
00120     static const int16 SUBSECTOR_MASK;
00121 
00122     int16 x;         
00123     int16 y;         
00124     int16 dx;        
00125     int16 dy;        
00126     int16 r_y_upper; 
00127     int16 r_y_lower; 
00128     int16 r_x_lower; 
00129     int16 r_x_upper; 
00130     int16 l_y_upper; 
00131     int16 l_y_lower; 
00132     int16 l_x_lower; 
00133     int16 l_x_upper; 
00134     uint16 r_child;  
00135     uint16 l_child;  
00136 
00137     // Constructors
00138     GLNode (int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, uint16 = 0, uint16 = 0) throw ();
00139     virtual ~GLNode (void) throw ();
00140 
00141     virtual size_t getLength (void) const throw ();
00142     virtual bool write (Lump &lump, Lump::size_type i) const throw ();
00143     virtual bool read (const Lump &lump, Lump::size_type i) throw ();
00144     virtual std::string toString (void) const throw ();
00145   };
00146 
00152   EXPORT class Nodes : public WadEntry, public std::vector<Node>
00153   {
00154     public:
00155 
00157     static const std::string NAME;
00158 
00159     Nodes (void) throw ();
00160     Nodes (const Lump&) throw ();
00161     virtual ~Nodes (void) throw ();
00162 
00163     virtual bool setFromLump (const Lump &lump) throw ();
00164     virtual Lump toLump (void) const throw ();
00165     virtual std::string toString (void) const throw ();
00166   };
00167 
00173   EXPORT class GLNodes : public WadEntry, public std::vector<GLNode>
00174   {
00175     public:
00176 
00178     static const std::string NAME;
00179 
00180     GLNodes (void) throw ();
00181     GLNodes (const Lump&) throw ();
00182     virtual ~GLNodes (void) throw ();
00183 
00184     virtual bool setFromLump (const Lump &lump) throw ();
00185     virtual Lump toLump (void) const throw ();
00186     virtual std::string toString (void) const throw ();
00187   };
00188 }
00189 #endif

Generated on Fri Jun 10 19:38:51 2005 for libdoomwad by  doxygen 1.4.0