The Bnode Class

Subclasses: BSubTree BSpecialXform BSlotNode BSwitchNode  BSplitterNode BPrimitiveNode BLitPrimitiveNode BCulledPrimitiveNode



 public:
 BNode( BYTE *baseAddress, BNodeType **tagListPtr );
 BNode()            { sibling = NULL; };
 virtual ~BNode()         { delete sibling; };

 // We have special new and delete operators which don't do any memory operations
 void *operator new(size_t, void *p) { return p; };
 void *operator new(size_t n)   { return malloc(n); };
 void operator delete(void *)   { };
// void operator delete(void *, void *) { };

 // Function to identify the type of an encoded node and call the appropriate constructor
 static BNode* RestorePointers( BYTE *baseAddress, int offset, BNodeType **tagListPtr );

 BNode *sibling;

 virtual void  Draw(void) = 0;
 virtual BNodeType Type(void) { return tagBNode; };


BNodeType;

typedef enum {
        tagBNode,
        tagBSubTree,
        tagBRoot,
        tagBSlotNode,
        tagBDofNode,
        tagBSwitchNode,
        tagBSplitterNode,
        tagBPrimitiveNode,
        tagBLitPrimitiveNode,
        tagBCulledPrimitiveNode,
        tagBSpecialXform,
        tagBLightStringNode,
} BNodeType;
 

BTransformType;

typedef enum {
        Normal,
        Billboard,
        Tree
} BTransformType;