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

Doomwad::Node Class Reference

Inheritance diagram for Doomwad::Node:

Doomwad::WadEntryElement List of all members.

Detailed Description

Represents a single Node in a map.

See also:
Nodes Seg
Nodes are the main unit used to partition a map into convex regions.

Definition at line 70 of file nodes.hpp.

Public Member Functions

virtual size_t getLength (void) const throw ()
 Get the length of an element.
 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 ()
 Node constructor.
virtual bool read (const Lump &lump, Lump::size_type i) throw ()
 Read this element from a Lump.
virtual std::string toString (void) const throw ()
 Convert this element to a string.
virtual bool write (Lump &lump, Lump::size_type i) const throw ()
 Write this element into a Lump.
virtual ~Node (void) throw ()
 Destructor.

Public Attributes

int16 dx
 End x, offset from begin X.
int16 dy
 End y, offset from begin y.
uint16 l_child
 Left child.
int16 l_x_lower
 Lower X bound of left bounding box.
int16 l_x_upper
 Upper X bound of left bounding box.
int16 l_y_lower
 Lower Y bound of left bounding box.
int16 l_y_upper
 Upper Y bound of left bounding box.
uint16 r_child
 Right child.
int16 r_x_lower
 Lower X bound of right bounding box.
int16 r_x_upper
 Upper X bound of right bounding box.
int16 r_y_lower
 Lower Y bound of right bounding box.
int16 r_y_upper
 Upper Y bound of right bounding box.
int16 x
 X coordinate.
int16 y
 Y coordinate.

Static Public Attributes

static const size_t LENGTH = 0x0000001C
 Length of a single record.
static const int16 SUBSECTOR_MASK = 0x80000
 Subsector mask.


Constructor & Destructor Documentation

Node::Node int16  _x = 0,
int16  _y = 0,
int16  _dx = 0,
int16  _dy = 0,
int16  _r_y_up = 0,
int16  _r_y_lo = 0,
int16  _r_x_lo = 0,
int16  _r_x_up = 0,
int16  _l_y_up = 0,
int16  _l_y_lo = 0,
int16  _l_x_lo = 0,
int16  _l_x_up = 0,
uint16  _r = 0,
uint16  _l = 0
throw ()
 

Node constructor.

Constructs a Node object.

Parameters:
_x X coordinate where the Node starts.
_y Y coordinate where the Node starts.
_dx X offset compared to X where the Node ends.
_dy Y offset compared to Y where the Node ends.
_r_y_up Upper Y bound of right bounding box.
_r_y_lo Lower Y bound of right bounding box.
_r_x_lo Lower X bound of right bounding box.
_r_x_up Upper X bound of right bounding box.
_l_y_up Upper Y bound of left bounding box.
_l_y_lo Lower Y bound of left bounding box.
_l_x_lo Lower X bound of left bounding box.
_l_x_up Upper X bound of left bounding box.
_r Right child Node.
_l Left child Node.

Definition at line 75 of file nodes.cpp.


Member Function Documentation

size_t Node::getLength void   )  const throw () [virtual]
 

Get the length of an element.

Each element record type has a length. Some are fixed, in which case this function returns that length. Some records are variable-length, in which case this function returns zero.

Returns:
Length of the record.

Implements Doomwad::WadEntryElement.

Definition at line 86 of file nodes.cpp.

References LENGTH.

bool Node::read const Lump lump,
Lump::size_type  i
throw () [virtual]
 

Read this element from a Lump.

Read one element from a Lump at the specified index.

Parameters:
lump Reference to the target Lump.
i Index into the Lump's buffer.
Returns:
True if successful, false if not.

Implements Doomwad::WadEntryElement.

Definition at line 120 of file nodes.cpp.

Referenced by Doomwad::Nodes::setFromLump().

std::string Node::toString void   )  const throw () [virtual]
 

Convert this element to a string.

The format of the string will vary from class to class, but every subclass must be able to format itself as a string. IMPORTANT: this string representation is not guaranteed to preserve all data. Reading back in is not supported. This function's goal is to make the object's state user-readable, not machine-readable.

Returns:
std::string object containing object state.

Implements Doomwad::WadEntryElement.

Definition at line 149 of file nodes.cpp.

References dx, dy, l_child, l_x_lower, l_x_upper, l_y_lower, l_y_upper, r_child, r_x_lower, r_x_upper, r_y_lower, r_y_upper, x, and y.

bool Node::write Lump lump,
Lump::size_type  i
const throw () [virtual]
 

Write this element into a Lump.

Write one element into a Lump at the specified index.

Parameters:
lump Reference to the target Lump.
i Index into the Lump's buffer.
Returns:
True if successful, false if not.

Implements Doomwad::WadEntryElement.

Definition at line 91 of file nodes.cpp.


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