Public Member Functions | Public Attributes

HierarchyEntry Class Reference

Search for all occurrences

Detailed 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.

#include <genhier.h>

Inheritance diagram for HierarchyEntry:
Inheritance graph
[legend]

List of all members.

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
HierarchyEntry parent
HierarchyEntry sibling
HierarchyEntry child
MSTR  sortKey

Constructor & Destructor Documentation

UtilExport HierarchyEntry ( )
Remarks:
Constructor. The entry is initialized as empty.
UtilExport HierarchyEntry ( int  d,
HierarchyEntry p,
HierarchyEntry s 
)
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.
{ return children; }
UtilExport void Sort ( )
Remarks:
Sorts the hierarchy using the sortKeys.

Member Data Documentation

int data
int children

HierarchyEntry HierarchyEntry HierarchyEntry HierarchyEntry HierarchyEntry HierarchyEntry HierarchyEntry HierarchyEntry HierarchyEntry HierarchyEntry
HierarchyEntry HierarchyEntry HierarchyEntry HierarchyEntry HierarchyEntry HierarchyEntry HierarchyEntry HierarchyEntry HierarchyEntry HierarchyEntry