eng_node.cc File Reference

Classes for Nodes in a Graph. More...

#include "base.hh"
#include "gfx.hh"
#include "eng.hh"
#include "eng_node.hh"

Namespaces

namespace  eng

Defines

#define ENG_NODE_CC   1
#define NODE_PRIVATE   public
#define NODE_PROTECTED   public
#define CODE_POLYGON_NODE_DERIVATIVE(PARENT_NODE_CLASS, NODE_CLASS)
#define CODE_RETURN_NODE_LESS_THAN(NODE_CLASS, M_VALUE)

Functions

void eng::CHECK_PATERNITY (const Node &parent, const Node &child)
static int eng::LOWER_NODE_PRIORITY1 (int priority1)
static void eng::CHECK_PARENT_CHILD_PRIORITY (const Node &parent, const Node &child)
static void eng::CHECK_SIBLING_PRIORITY (const Node &parent, const Node &sibling1, const Node &sibling2)
static void eng::CHECK_CHILDREN (const Node::SortedNodes &children)
void eng::CheckNode (const Node *node, bool nullOk)
static void eng::ReindexSiblingNodes (SortedArray< Node::SortableNode > &sortedNodes, const uint idx)
static bool eng::PartitionNodeOrTransformNodeLessThan (const Node::Value &valuePartitionOrTransform, const Node::Value &valueOther)


Detailed Description

Classes for Nodes in a Graph.

Id
LastChangedDate

Author:
Jim E. Brooks http://www.palomino3d.org
Remarks:
Sorted sibling nodes: --------------------- Sibling nodes are sorted using a SortedArray<SortableNode> which has a private STL vector that stays sorted. It offers quick access at the expense of slower insertion. The inserting of a Node has the overhead of needing to reindex Node::mSiblingIdx which is how, during graph traversal, a Node's next sibling is accessed. Reindexing siblings may seem grossly inefficient but is actually fast. The reason is that PolygonNodes would be the only type of Node that will exist as multitudes of siblings, but new PolygonNodes are inserted as the LAST among equals, so ReindexSiblings() in fact indexs only the last one. Fast indexing depends on PolygonNodes having equal values. Defining PolygonNode::Value::operator<() to sort by vix etc would be detrimental.
Homogeneous vs. heterogeneous children: --------------------------------------- A general rule is that children nodes should be homogeneous. This rule exists to catch misplaced Nodes that would result in aberrant rendering (the fundamental Graph structure itself doesn't impose this rule). In DEBUG build, homogeneous children (same type of Nodes) is enforced, but these are the exceptions where heterogeneous are allowed:

Define Documentation

#define CODE_POLYGON_NODE_DERIVATIVE ( PARENT_NODE_CLASS,
NODE_CLASS   ) 

Value:

NODE_CLASS::NODE_CLASS( const Value& value )                                    \
:   PARENT_NODE_CLASS(value)                                                    \
{                                                                               \
}                                                                               \
                                                                                \
NODE_CLASS::NODE_CLASS( const NODE_CLASS& src )                                 \
:   PARENT_NODE_CLASS(src)                                                      \
{                                                                               \
}                                                                               \
                                                                                \
Node::Ptr                                                                       \
NODE_CLASS::Clone( void ) const                                                 \
{                                                                               \
    return new NODE_CLASS( *this );                                             \
}

#define CODE_RETURN_NODE_LESS_THAN ( NODE_CLASS,
M_VALUE   ) 

Value:

{                                                                                       \
    if ( GetPriority1() != otherValue.GetPriority1() )                                  \
    {                                                                                   \
        return GetPriority1() < otherValue.GetPriority1();  /* priority2 is N/A */      \
    }                                                                                   \
    else                                                                                \
    {                                                                                   \
        /* Oh, you naughty boy!  Other is in fact a CLASS::Value. */                    \
        return M_VALUE                                                                  \
             < static_cast<const NODE_CLASS::Value*>(&otherValue)->M_VALUE;             \
    }                                                                                   \
}

#define ENG_NODE_CC   1

#define NODE_PRIVATE   public

#define NODE_PROTECTED   public

Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:14 2007