HierarchyEntry Class Reference

HierarchyEntry Class Reference

#include <genhier.h>

Class Description

See also
Class GenericHierarchy.

Description:
This class represents an entry in a GenericHierarchy. All methods of the class are implemented by the system.
Data Members:
int data;

This is the polygon number. For example a donut shape will have polygon 0 and polygon 1. This is an index into the list of polygons for the shape.

int children;

Number of children of this entry.

HierarchyEntry *parent;

Points to the parent entry.

HierarchyEntry *sibling;

Points to the first sibling.

HierarchyEntry *child;

Points to the first child.

MSTR sortKey;

The sort key. This is used internally by the hierarchy so that it can determine whether two hierarchies are compatible. Developers shouldn't alter this value.
+ Inheritance diagram for HierarchyEntry:

Public Member Functions

UtilExport HierarchyEntry ()
 
UtilExport HierarchyEntry (int d, HierarchyEntry *p, HierarchyEntry *s)
 
UtilExport int HierarchyLevel ()
 
UtilExport void AddChild (int d)
 
UtilExport int GetChild (int index)
 
int Children ()
 
UtilExport void Sort ()
 

Public Attributes

int data
 
int children
 
HierarchyEntryparent
 
HierarchyEntrysibling
 
HierarchyEntrychild
 
MSTR sortKey
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 

Constructor & Destructor Documentation

Remarks
Constructor. The entry is initialized as empty.
Remarks
Constructor. The entry is initialized to the data passed.
Parameters:
int d

The value for data. This is the polygon number.

HierarchyEntry *p

The parent pointer is initialized to this value.

HierarchyEntry *s

The sibling pointer is initialized to this value.

Member Function Documentation

UtilExport int HierarchyLevel ( )
Remarks
Returns the level in the hierarchy this entry represents. This is the number of parents this item has. The root level is not counted.
Returns
The level in the hierarchy of this entry.
UtilExport void AddChild ( int  d)
Remarks
Adds a new child entry to this entry using the data specified.
Parameters:
int d

The data value of the child. This is the polygon number.
UtilExport int GetChild ( int  index)
Remarks
Returns the specified child of this entry.
Parameters:
int index

The child to retrieve.
Returns
The specified child of this entry. If the specified index is greater than or equal to the number of children INVALID_HIERARCHY is returned.
int Children ( )
inline
Remarks
Returns the number of children of this entry.
80 { return children; }
int children
Definition: genhier.h:44
UtilExport void Sort ( )
Remarks
Sorts the hierarchy using the sortKeys.

Member Data Documentation

int data
int children
HierarchyEntry* parent
HierarchyEntry* sibling
MSTR sortKey