소스 검색

remove old headers

cxgeorge 25 년 전
부모
커밋
f116c2422b

+ 105 - 106
panda/src/graph/Sources.pp

@@ -6,119 +6,118 @@
   #define LOCAL_LIBS \
     putil mathutil
 
-  #define SOURCES \    
-	allAttributesWrapper.I	      nodeAttributes.T  \
-	allAttributesWrapper.T	      nodeAttributes.cxx  \
-	allAttributesWrapper.cxx      nodeAttributes.h  \
-	allAttributesWrapper.h	      nodeRelation.I  \
-	allTransitionsWrapper.I       nodeRelation.N  \
-	allTransitionsWrapper.T       nodeRelation.T  \
-	allTransitionsWrapper.cxx     nodeRelation.cxx  \
-	allTransitionsWrapper.h       nodeRelation.h  \
-	arcChain.I		      nodeTransition.I  \
-	arcChain.cxx		      nodeTransition.N  \
-	arcChain.h		      nodeTransition.cxx  \
-	bitMask32Transition.cxx       nodeTransition.h  \
-	bitMask32Transition.h	      nodeTransitionCache.I  \
-	bitMaskAttribute.T	      nodeTransitionCache.cxx  \
-	bitMaskAttribute.h	      nodeTransitionCache.h  \
-	bitMaskTransition.T	      nodeTransitionCacheEntry.I  \
-	bitMaskTransition.h	      nodeTransitionCacheEntry.cxx  \
-	boundedObject.I		      nodeTransitionCacheEntry.h  \
-	boundedObject.N		      nodeTransitionWrapper.I  \
-	boundedObject.cxx	      nodeTransitionWrapper.T  \
-	boundedObject.h		      nodeTransitionWrapper.cxx  \
-	config_graph.cxx	      nodeTransitionWrapper.h  \
-	config_graph.h		      nodeTransitions.I  \
-	dftraverser.T		      nodeTransitions.T  \
-	dftraverser.h		      nodeTransitions.cxx  \
-	graphReducer.cxx	      nodeTransitions.h  \
-	graphReducer.h		      nullAttributeWrapper.I  \
-	immediateAttribute.cxx	      nullAttributeWrapper.cxx  \
-	immediateAttribute.h	      nullAttributeWrapper.h  \
-	immediateTransition.I	      nullLevelState.cxx  \
-	immediateTransition.cxx       nullLevelState.h  \
-	immediateTransition.h	      nullTransitionWrapper.I  \
-	lmatrix4fTransition.cxx       nullTransitionWrapper.cxx  \
-	lmatrix4fTransition.h	      nullTransitionWrapper.h  \
-	matrixAttribute.T	      onAttribute.cxx  \
-	matrixAttribute.h	      onAttribute.h  \
-	matrixTransition.T	      onOffAttribute.I  \
-	matrixTransition.h	      onOffAttribute.cxx  \
-	multiAttribute.T	      onOffAttribute.h  \
-	multiAttribute.h	      onOffTransition.I  \
-	multiNodeAttribute.cxx	      onOffTransition.cxx  \
-	multiNodeAttribute.h	      onOffTransition.h  \
-	multiNodeTransition.cxx       onTransition.I  \
-	multiNodeTransition.h	      onTransition.cxx  \
-	multiTransition.I	      onTransition.h  \
-	multiTransition.T	      pointerNameClass.h  \
-	multiTransition.h	      pt_NamedNode.N  \
+  #define SOURCES \  
+	allAttributesWrapper.I        nodeAttributes.cxx  \
+	allAttributesWrapper.T        nodeAttributes.h  \
+	allAttributesWrapper.cxx      nodeRelation.I  \
+	allAttributesWrapper.h        nodeRelation.N  \
+	allTransitionsWrapper.I       nodeRelation.T  \
+	allTransitionsWrapper.T       nodeRelation.cxx  \
+	allTransitionsWrapper.cxx     nodeRelation.h  \
+	allTransitionsWrapper.h       nodeTransition.I  \
+	arcChain.I                    nodeTransition.N  \
+	arcChain.cxx                  nodeTransition.cxx  \
+	arcChain.h                    nodeTransition.h  \
+	bitMask32Transition.cxx       nodeTransitionCache.I  \
+	bitMask32Transition.h         nodeTransitionCache.cxx  \
+	bitMaskAttribute.T            nodeTransitionCache.h  \
+	bitMaskAttribute.h            nodeTransitionCacheEntry.I  \
+	bitMaskTransition.T           nodeTransitionCacheEntry.cxx  \
+	bitMaskTransition.h           nodeTransitionCacheEntry.h  \
+	boundedObject.I               nodeTransitionWrapper.I  \
+	boundedObject.N               nodeTransitionWrapper.T  \
+	boundedObject.cxx             nodeTransitionWrapper.cxx  \
+	boundedObject.h               nodeTransitionWrapper.h  \
+	config_graph.cxx              nodeTransitions.I  \
+	config_graph.h                nodeTransitions.T  \
+	dftraverser.T                 nodeTransitions.cxx  \
+	dftraverser.h                 nodeTransitions.h  \
+	graphReducer.cxx              nullAttributeWrapper.I  \
+	graphReducer.h                nullAttributeWrapper.cxx  \
+	immediateAttribute.cxx        nullAttributeWrapper.h  \
+	immediateAttribute.h          nullLevelState.cxx  \
+	immediateTransition.I         nullLevelState.h  \
+	immediateTransition.cxx       nullTransitionWrapper.I  \
+	immediateTransition.h         nullTransitionWrapper.cxx  \
+	lmatrix4fTransition.cxx       nullTransitionWrapper.h  \
+	lmatrix4fTransition.h         onAttribute.cxx  \
+	matrixAttribute.T             onAttribute.h  \
+	matrixAttribute.h             onOffAttribute.I  \
+	matrixTransition.T            onOffAttribute.cxx  \
+	matrixTransition.h            onOffAttribute.h  \
+	multiAttribute.T              onOffTransition.I  \
+	multiAttribute.h              onOffTransition.cxx  \
+	multiNodeAttribute.cxx        onOffTransition.h  \
+	multiNodeAttribute.h          onTransition.I  \
+	multiNodeTransition.cxx       onTransition.cxx  \
+	multiNodeTransition.h         onTransition.h  \
+	multiTransition.T             pointerNameClass.h  \
+	multiTransition.h             pt_NamedNode.N  \
 	multiTransitionHelpers.I      pt_NamedNode.cxx  \
 	multiTransitionHelpers.h      pt_NamedNode.h  \
-	namedNode.I		      pt_Node.N  \
-	namedNode.cxx		      pt_Node.cxx  \
-	namedNode.h		      pt_Node.h  \
-	node.I			      setTransitionHelpers.T  \
-	node.cxx		      setTransitionHelpers.h  \
-	node.h			      \
-	nodeAttribute.I		      \
-	nodeAttribute.N		      \
-	nodeAttribute.cxx	      transitionDirection.h  \
-	nodeAttribute.h		      traverserVisitor.T  \
-	nodeAttributeWrapper.I	      traverserVisitor.h  \
-	nodeAttributeWrapper.T	      vector_PT_Node.cxx  \
+	namedNode.I                   pt_Node.N  \
+	namedNode.cxx                 pt_Node.cxx  \
+	namedNode.h                   pt_Node.h  \
+	node.I                        setTransitionHelpers.T  \
+	node.cxx                      setTransitionHelpers.h  \
+	node.h                          \
+	nodeAttribute.I                 \
+	nodeAttribute.N                 \
+	nodeAttribute.cxx             transitionDirection.h  \
+	nodeAttribute.h               traverserVisitor.T  \
+	nodeAttributeWrapper.I        traverserVisitor.h  \
+	nodeAttributeWrapper.T        vector_PT_Node.cxx  \
 	nodeAttributeWrapper.cxx      vector_PT_Node.h  \
-	nodeAttributeWrapper.h	      wrt.I  \
-	nodeAttributes.I	      wrt.cxx  \
-	nodeAttributes.N	      wrt.h
-
+	nodeAttributeWrapper.h        wrt.I  \
+	nodeAttributes.I              wrt.cxx  \
+	nodeAttributes.N              wrt.h  \
+	nodeAttributes.T  
 
   #define INSTALL_HEADERS \
-	allAttributesWrapper.I	    nodeAttributeWrapper.T  \
-	allAttributesWrapper.T	    nodeAttributeWrapper.h  \
-	allAttributesWrapper.h	    nodeAttributes.I  \
-	allTransitionsWrapper.I     nodeAttributes.T  \
-	allTransitionsWrapper.T     nodeAttributes.h  \
-	allTransitionsWrapper.h     nodeRelation.I  \
-	arcChain.I		    nodeRelation.T  \
-	arcChain.h		    nodeRelation.h  \
-	bitMask32Transition.h	    nodeTransition.I  \
-	bitMaskAttribute.T	    nodeTransition.h  \
-	bitMaskAttribute.h	    nodeTransitionCache.I  \
-	bitMaskTransition.T	    nodeTransitionCache.h  \
-	bitMaskTransition.h	    nodeTransitionCacheEntry.I  \
-	boundedObject.I		    nodeTransitionCacheEntry.h  \
-	boundedObject.h		    nodeTransitionWrapper.I  \
-	config_graph.h		    nodeTransitionWrapper.T  \
-	dftraverser.T		    nodeTransitionWrapper.h  \
-	dftraverser.h		    nodeTransitions.I  \
-	graphReducer.h		    nodeTransitions.T  \
-	immediateAttribute.h	    nodeTransitions.h  \
-	immediateTransition.I	    nullAttributeWrapper.I  \
-	immediateTransition.h	    nullAttributeWrapper.h  \
-	lmatrix4fTransition.h	    nullLevelState.h  \
-	matrixAttribute.T	    nullTransitionWrapper.I  \
-	matrixAttribute.h	    nullTransitionWrapper.h  \
-	matrixTransition.T	    onAttribute.h  \
-	matrixTransition.h	    onOffAttribute.I  \
-	multiAttribute.T	    onOffAttribute.h  \
-	multiAttribute.h	    onOffTransition.I  \
-	multiNodeAttribute.h	    onOffTransition.h  \
-	multiNodeTransition.h	    onTransition.I  \
-	multiTransition.I	    onTransition.h  \
-	multiTransition.T	    pointerNameClass.h  \
-	multiTransition.h	    pt_NamedNode.h  \
+	allAttributesWrapper.I      nodeAttributeWrapper.h  \
+	allAttributesWrapper.T      nodeAttributes.I  \
+	allAttributesWrapper.h      nodeAttributes.T  \
+	allTransitionsWrapper.I     nodeAttributes.h  \
+	allTransitionsWrapper.T     nodeRelation.I  \
+	allTransitionsWrapper.h     nodeRelation.T  \
+	arcChain.I                  nodeRelation.h  \
+	arcChain.h                  nodeTransition.I  \
+	bitMask32Transition.h       nodeTransition.h  \
+	bitMaskAttribute.T          nodeTransitionCache.I  \
+	bitMaskAttribute.h          nodeTransitionCache.h  \
+	bitMaskTransition.T         nodeTransitionCacheEntry.I  \
+	bitMaskTransition.h         nodeTransitionCacheEntry.h  \
+	boundedObject.I             nodeTransitionWrapper.I  \
+	boundedObject.h             nodeTransitionWrapper.T  \
+	config_graph.h              nodeTransitionWrapper.h  \
+	dftraverser.T               nodeTransitions.I  \
+	dftraverser.h               nodeTransitions.T  \
+	graphReducer.h              nodeTransitions.h  \
+	immediateAttribute.h        nullAttributeWrapper.I  \
+	immediateTransition.I       nullAttributeWrapper.h  \
+	immediateTransition.h       nullLevelState.h  \
+	lmatrix4fTransition.h       nullTransitionWrapper.I  \
+	matrixAttribute.T           nullTransitionWrapper.h  \
+	matrixAttribute.h           onAttribute.h  \
+	matrixTransition.T          onOffAttribute.I  \
+	matrixTransition.h          onOffAttribute.h  \
+	multiAttribute.T            onOffTransition.I  \
+	multiAttribute.h            onOffTransition.h  \
+	multiNodeAttribute.h        onTransition.I  \
+	multiNodeTransition.h       onTransition.h  \
+	multiTransition.T           pointerNameClass.h  \
+	multiTransition.h           pt_NamedNode.h  \
 	multiTransitionHelpers.I    pt_Node.h  \
 	multiTransitionHelpers.h    setTransitionHelpers.T  \
-	namedNode.I		    setTransitionHelpers.h  \
-	namedNode.h		    transitionDirection.h  \
-	node.I			    traverserVisitor.T  \
-	node.h			    traverserVisitor.h  \
-	nodeAttribute.I		    vector_PT_Node.h  \
-	nodeAttribute.h		    wrt.I  \
-	nodeAttributeWrapper.I	    wrt.h
-  
+	namedNode.I                 setTransitionHelpers.h  \
+	namedNode.h                 transitionDirection.h  \
+	node.I                      traverserVisitor.T  \
+	node.h                      traverserVisitor.h  \
+	nodeAttribute.I             vector_PT_Node.h  \
+	nodeAttribute.h             wrt.I  \
+	nodeAttributeWrapper.I      wrt.h  \
+	nodeAttributeWrapper.T
+
   #define IGATESCAN all
 
 #end lib_target

+ 0 - 103
panda/src/graph/bitMaskAttribute.I

@@ -1,103 +0,0 @@
-// Filename: bitMaskAttribute.I
-// Created by:  drose (08Jun00)
-// 
-////////////////////////////////////////////////////////////////////
-
-#include <indent.h>
-
-template<class MaskType>
-TypeHandle BitMaskAttribute<MaskType>::_type_handle;
-
-////////////////////////////////////////////////////////////////////
-//     Function: BitMaskAttribute::Constructor
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class MaskType>
-INLINE_GRAPH BitMaskAttribute<MaskType>::
-BitMaskAttribute() {
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: BitMaskAttribute::Constructor
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class MaskType>
-INLINE_GRAPH BitMaskAttribute<MaskType>::
-BitMaskAttribute(const MaskType &mask) :
-  _mask(mask)
-{
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: BitMaskAttribute::Copy Constructor
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class MaskType>
-INLINE_GRAPH BitMaskAttribute<MaskType>::
-BitMaskAttribute(const BitMaskAttribute &copy) :
-  NodeAttribute(copy),
-  _mask(copy._mask)
-{
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: BitMaskAttribute::Copy Assignment Operator
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class MaskType>
-INLINE_GRAPH void BitMaskAttribute<MaskType>::
-operator = (const BitMaskAttribute &copy) {
-  NodeAttribute::operator = (copy);
-  _mask = copy._mask;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: BitMaskAttribute::set_mask
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class MaskType>
-INLINE_GRAPH void BitMaskAttribute<MaskType>::
-set_mask(const MaskType &mask) {
-  _mask = mask;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: BitMaskAttribute::get_maskType
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class MaskType>
-INLINE_GRAPH const MaskType &BitMaskAttribute<MaskType>::
-get_mask() const {
-  return _mask;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: BitMaskAttribute::output
-//       Access: Public, Virtual
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class MaskType>
-void BitMaskAttribute<MaskType>::
-output(ostream &out) const {
-  out << _mask;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: BitMaskAttribute::internal_compare_to
-//       Access: Public, Virtual
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class MaskType>
-int BitMaskAttribute<MaskType>::
-internal_compare_to(const NodeAttribute *other) const {
-  const BitMaskAttribute *ot;
-  DCAST_INTO_R(ot, other, false);
-
-  return _mask.compare_to(ot->_mask);
-}

+ 0 - 230
panda/src/graph/bitMaskTransition.I

@@ -1,230 +0,0 @@
-// Filename: bitMaskTransition.I
-// Created by:  drose (08Jun00)
-// 
-////////////////////////////////////////////////////////////////////
-
-#include "bitMaskAttribute.h"
-
-#include <indent.h>
-
-template<class MaskType>
-TypeHandle BitMaskTransition<MaskType>::_type_handle;
-
-////////////////////////////////////////////////////////////////////
-//     Function: BitMaskTransition::Constructor
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class MaskType>
-INLINE_GRAPH BitMaskTransition<MaskType>::
-BitMaskTransition() {
-  _and = MaskType::all_on();
-  _or = MaskType::all_off();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: BitMaskTransition::Constructor
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class MaskType>
-INLINE_GRAPH BitMaskTransition<MaskType>::
-BitMaskTransition(const MaskType &and, const MaskType &or) {
-  _and = and;
-  _or = or;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: BitMaskTransition::Copy Constructor
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class MaskType>
-INLINE_GRAPH BitMaskTransition<MaskType>::
-BitMaskTransition(const BitMaskTransition &copy) :
-  NodeTransition(copy),
-  _and(copy._and),
-  _or(copy._or)
-{
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: BitMaskTransition::Copy Assignment Operator
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class MaskType>
-INLINE_GRAPH void BitMaskTransition<MaskType>::
-operator = (const BitMaskTransition &copy) {
-  NodeTransition::operator = (copy);
-  _and = copy._and;
-  _or = copy._or;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: BitMaskTransition::set_and
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class MaskType>
-INLINE_GRAPH void BitMaskTransition<MaskType>::
-set_and(const MaskType &and) {
-  _and = and;
-  state_changed();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: BitMaskTransition::get_and
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class MaskType>
-INLINE_GRAPH const MaskType &BitMaskTransition<MaskType>::
-get_and() const {
-  return _and;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: BitMaskTransition::set_or
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class MaskType>
-INLINE_GRAPH void BitMaskTransition<MaskType>::
-set_or(const MaskType &or) {
-  _or = or;
-  state_changed();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: BitMaskTransition::get_or
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class MaskType>
-INLINE_GRAPH const MaskType &BitMaskTransition<MaskType>::
-get_or() const {
-  return _or;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: BitMaskTransition::compose
-//       Access: Public, Virtual
-//  Description: Returns a new transition that corresponds to the
-//               composition of this transition with the second
-//               transition (which must be of an equivalent type).
-//               This may return the same pointer as either source
-//               transition.  Applying the transition returned from
-//               this function to an attribute attribute will produce
-//               the same effect as applying each transition
-//               separately.
-////////////////////////////////////////////////////////////////////
-template<class MaskType>
-NodeTransition *BitMaskTransition<MaskType>::
-compose(const NodeTransition *other) const {
-  const BitMaskTransition<MaskType> *ot;
-  DCAST_INTO_R(ot, other, NULL);
-
-  if (ot->_priority < _priority) {
-    // The other transition is too low-priority; the result is
-    // unchanged.
-    return (BitMaskTransition<MaskType> *)this;
-  }
-
-  return make_with_masks(ot->_and & _and, ot->_or | _or);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: BitMaskTransition::invert
-//       Access: Public, Virtual
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class MaskType>
-NodeTransition *BitMaskTransition<MaskType>::
-invert() const {
-  return NULL;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: BitMaskTransition::apply
-//       Access: Public, Virtual
-//  Description: Returns a new attribute (or possibly the same
-//               attribute) that represents the effect of applying this
-//               indicated transition to the indicated attribute.  The
-//               source attribute may be NULL, indicating the initial
-//               attribute.
-////////////////////////////////////////////////////////////////////
-template<class MaskType>
-NodeAttribute *BitMaskTransition<MaskType>::
-apply(const NodeAttribute *attrib) const {
-  BitMaskAttribute<MaskType> *result;
-  DCAST_INTO_R(result, make_attrib(), NULL);
-
-  if (attrib == (const NodeAttribute *)NULL) {
-    // If there is no root attribute, the default attribute is always
-    // all bits on.
-    result->_mask = (MaskType::all_on() & _and) | _or;
-    return result;
-  }
-
-  if (_priority < result->_priority) {
-    // The priority is too low to affect the attribute.
-    return result;
-  }
-
-  const BitMaskAttribute<MaskType> *at;
-  DCAST_INTO_R(at, attrib, NULL);
-
-  result->_mask = (at->_mask & _and) | _or;
-  return result;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: BitMaskTransition::output
-//       Access: Public, Virtual
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class MaskType>
-void BitMaskTransition<MaskType>::
-output(ostream &out) const {
-  out << "&";
-  _and.output_hex(out);
-  out << " |";
-  _or.output_hex(out);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: BitMaskTransition::internal_compare_to
-//       Access: Public, Virtual
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class MaskType>
-int BitMaskTransition<MaskType>::
-internal_compare_to(const NodeTransition *other) const {
-  const BitMaskTransition<MaskType> *ot;
-  DCAST_INTO_R(ot, other, false);
-
-  int result = _and.compare_to(ot->_and);
-  if (result == 0) {
-    result = _or.compare_to(ot->_or);
-  }
-  return result;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: BitMaskTransition::make_with_masks
-//       Access: Protected, Virtual
-//  Description: This function creates a new BitMaskTransition of the
-//               appropriate type, given the indicated and & or masks.
-//
-//               This is a pure virtual function and normally wouldn't
-//               require a definition, but for some reason VC++
-//               objects to instantiating the template if it's missing
-//               any function definitions--even those for pure-virtual
-//               functions.
-////////////////////////////////////////////////////////////////////
-template<class MaskType>
-BitMaskTransition<MaskType> *BitMaskTransition<MaskType>::
-make_with_masks(const MaskType &, const MaskType &) const {
-  return NULL;
-}

+ 0 - 101
panda/src/graph/dftraverser.I

@@ -1,101 +0,0 @@
-// Filename: dftraverser.cxx
-// Created by:  drose (26Oct98)
-// 
-////////////////////////////////////////////////////////////////////
-
-#include "dftraverser.h"
-
-#include <notify.h>
-
-////////////////////////////////////////////////////////////////////
-//     Function: DFTraverser::Constructor
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Visitor, class LevelState>
-INLINE_GRAPH DFTraverser<Visitor, LevelState>::
-DFTraverser(Visitor &visitor,
-	    const AttributeWrapper &initial_render_state,
-	    TypeHandle graph_type) :
-  _visitor(visitor),
-  _initial_render_state(initial_render_state),
-  _graph_type(graph_type)
-{
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: DFTraverser::start
-//       Access: Public
-//  Description: Starts the traversal from the indicated arc.
-////////////////////////////////////////////////////////////////////
-template<class Visitor, class LevelState>
-INLINE_GRAPH void DFTraverser<Visitor, LevelState>::
-start(NodeRelation *arc, const LevelState &initial_level_state) {
-  traverse(arc, _initial_render_state, initial_level_state);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: DFTraverser::start
-//       Access: Public
-//  Description: Starts the traversal from the indicated node.
-////////////////////////////////////////////////////////////////////
-template<class Visitor, class LevelState>
-INLINE_GRAPH void DFTraverser<Visitor, LevelState>::
-start(Node *root, const LevelState &initial_level_state) {
-  LevelState level_state(initial_level_state);
-  traverse(root, _initial_render_state, level_state);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: DFTraverser::Traverse
-//       Access: Public
-//  Description: Walks to the next arc of the graph.
-////////////////////////////////////////////////////////////////////
-template<class Visitor, class LevelState>
-void DFTraverser<Visitor, LevelState>::
-traverse(NodeRelation *arc, AttributeWrapper state, LevelState level_state) {
-  nassertv(arc->get_child() != (Node *)NULL);
-  
-  // Give the visitor a chance to veto this arc.
-  TransitionWrapper trans = 
-    TransitionWrapper::init_from(_initial_render_state);
-  trans.extract_from(arc);
-
-  AttributeWrapper post_state(state);
-  post_state.apply_in_place(trans);
-  if (_visitor.forward_arc(arc, trans, state, post_state, level_state)) {
-    traverse(arc->get_child(), post_state, level_state);
-    _visitor.backward_arc(arc, trans, state, post_state, level_state);
-  }
-}
-
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: DFTraverser::Traverse
-//       Access: Public
-//  Description: Walks to the next node of the graph.
-////////////////////////////////////////////////////////////////////
-template<class Visitor, class LevelState>
-void DFTraverser<Visitor, LevelState>::
-traverse(Node *node, AttributeWrapper &state, LevelState &level_state) {
-  // Tell the visitor we reached the node, and give it a chance to
-  // veto our further progress.
-  if (_visitor.reached_node(node, state, level_state)) {
-
-    // Look for further children of the given NodeRelation.
-    DownRelations::const_iterator dri;
-    dri = node->_children.find(_graph_type);
-    if (dri != node->_children.end()) {
-      // Here are some!
-      const DownRelationPointers &drp = (*dri).second;
-
-      // Now visit each of the children in turn.
-      DownRelationPointers::const_iterator drpi;
-      for (drpi = drp.begin(); drpi != drp.end(); ++drpi) {
-	traverse(*drpi, state, level_state);
-      }
-    }
-  }
-}
-

+ 0 - 34
panda/src/graph/immediateAttribute.I

@@ -1,34 +0,0 @@
-// Filename: immediateAttribute.I
-// Created by:  drose (24Mar00)
-// 
-////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////////////
-//     Function: ImmediateAttribute::Constructor
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-INLINE_GRAPH ImmediateAttribute::
-ImmediateAttribute() {
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: ImmediateAttribute::Copy Constructor
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-INLINE_GRAPH ImmediateAttribute::
-ImmediateAttribute(const ImmediateAttribute &copy) :
-  NodeAttribute(copy)
-{
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: ImmediateAttribute::Copy Assignment Operator
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-INLINE_GRAPH void ImmediateAttribute::
-operator = (const ImmediateAttribute &copy) {
-  NodeAttribute::operator = (copy);
-}

+ 0 - 103
panda/src/graph/matrixAttribute.I

@@ -1,103 +0,0 @@
-// Filename: matrixAttribute.I
-// Created by:  drose (24Mar00)
-// 
-////////////////////////////////////////////////////////////////////
-
-#include <indent.h>
-
-template<class Matrix>
-TypeHandle MatrixAttribute<Matrix>::_type_handle;
-
-////////////////////////////////////////////////////////////////////
-//     Function: MatrixAttribute::Constructor
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Matrix>
-INLINE_GRAPH MatrixAttribute<Matrix>::
-MatrixAttribute() {
-  _matrix = Matrix::ident_mat();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MatrixAttribute::Copy Constructor
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Matrix>
-INLINE_GRAPH MatrixAttribute<Matrix>::
-MatrixAttribute(const MatrixAttribute &copy) :
-  NodeAttribute(copy),
-  _matrix(copy._matrix)
-{
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MatrixAttribute::Copy Assignment Operator
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Matrix>
-INLINE_GRAPH void MatrixAttribute<Matrix>::
-operator = (const MatrixAttribute &copy) {
-  NodeAttribute::operator = (copy);
-  _matrix = copy._matrix;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MatrixAttribute::set_matrix
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Matrix>
-INLINE_GRAPH void MatrixAttribute<Matrix>::
-set_matrix(const Matrix &mat) {
-  _matrix = mat;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MatrixAttribute::get_matrix
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Matrix>
-INLINE_GRAPH const Matrix &MatrixAttribute<Matrix>::
-get_matrix() const {
-  return _matrix;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MatrixAttribute::output
-//       Access: Public, Virtual
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Matrix>
-void MatrixAttribute<Matrix>::
-output(ostream &out) const {
-  out << _matrix;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MatrixAttribute::write
-//       Access: Public, Virtual
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Matrix>
-void MatrixAttribute<Matrix>::
-write(ostream &out, int indent_level) const {
-  _matrix.write(out, indent_level);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MatrixAttribute::internal_compare_to
-//       Access: Public, Virtual
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Matrix>
-int MatrixAttribute<Matrix>::
-internal_compare_to(const NodeAttribute *other) const {
-  const MatrixAttribute *ot;
-  DCAST_INTO_R(ot, other, false);
-
-  return _matrix.compare_to(ot->_matrix);
-}

+ 0 - 240
panda/src/graph/matrixTransition.I

@@ -1,240 +0,0 @@
-// Filename: matrixTransition.I
-// Created by:  drose (24Mar00)
-// 
-////////////////////////////////////////////////////////////////////
-
-#include "matrixAttribute.h"
-
-#include <indent.h>
-
-template<class Matrix>
-TypeHandle MatrixTransition<Matrix>::_type_handle;
-
-////////////////////////////////////////////////////////////////////
-//     Function: MatrixTransition::Constructor
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Matrix>
-INLINE_GRAPH MatrixTransition<Matrix>::
-MatrixTransition() {
-  _matrix = Matrix::ident_mat();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MatrixTransition::Constructor
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Matrix>
-INLINE_GRAPH MatrixTransition<Matrix>::
-MatrixTransition(const Matrix &matrix) {
-  _matrix = matrix;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MatrixTransition::Copy Constructor
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Matrix>
-INLINE_GRAPH MatrixTransition<Matrix>::
-MatrixTransition(const MatrixTransition &copy) :
-  NodeTransition(copy),
-  _matrix(copy._matrix)
-{
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MatrixTransition::Copy Assignment Operator
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Matrix>
-INLINE_GRAPH void MatrixTransition<Matrix>::
-operator = (const MatrixTransition &copy) {
-  NodeTransition::operator = (copy);
-  _matrix = copy._matrix;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MatrixTransition::set_matrix
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Matrix>
-INLINE_GRAPH void MatrixTransition<Matrix>::
-set_matrix(const Matrix &mat) {
-  _matrix = mat;
-  state_changed();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MatrixTransition::get_matrix
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Matrix>
-INLINE_GRAPH const Matrix &MatrixTransition<Matrix>::
-get_matrix() const {
-  return _matrix;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MatrixTransition::compose
-//       Access: Public, Virtual
-//  Description: Returns a new transition that corresponds to the
-//               composition of this transition with the second
-//               transition (which must be of an equivalent type).
-//               This may return the same pointer as either source
-//               transition.  Applying the transition returned from
-//               this function to an attribute attribute will produce
-//               the same effect as applying each transition
-//               separately.
-////////////////////////////////////////////////////////////////////
-template<class Matrix>
-NodeTransition *MatrixTransition<Matrix>::
-compose(const NodeTransition *other) const {
-  const MatrixTransition<Matrix> *ot;
-  DCAST_INTO_R(ot, other, NULL);
-
-  return make_with_matrix(ot->_matrix * _matrix);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MatrixTransition::invert
-//       Access: Public, Virtual
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Matrix>
-NodeTransition *MatrixTransition<Matrix>::
-invert() const {
-  if (_matrix.almost_equal(Matrix::ident_mat())) {
-    return (MatrixTransition<Matrix> *)this;
-  }
-  Matrix inverted;
-  inverted.invert_from(_matrix);
-  return make_with_matrix(inverted);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MatrixTransition::apply
-//       Access: Public, Virtual
-//  Description: Returns a new attribute (or possibly the same
-//               attribute) that represents the effect of applying this
-//               indicated transition to the indicated attribute.  The
-//               source attribute may be NULL, indicating the initial
-//               attribute.
-////////////////////////////////////////////////////////////////////
-template<class Matrix>
-NodeAttribute *MatrixTransition<Matrix>::
-apply(const NodeAttribute *attrib) const {
-  
-  MatrixAttribute<Matrix> *result;
-  DCAST_INTO_R(result, make_attrib(), NULL);
-
-  if (attrib == (const NodeAttribute *)NULL) {
-    result->_matrix = _matrix;
-    return result;
-  }
-
-  const MatrixAttribute<Matrix> *at;
-  DCAST_INTO_R(at, attrib, NULL);
-
-  result->_matrix = _matrix * at->_matrix;
-  return result;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MatrixTransition::output
-//       Access: Public, Virtual
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Matrix>
-void MatrixTransition<Matrix>::
-output(ostream &out) const {
-  out << _matrix;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MatrixTransition::write
-//       Access: Public, Virtual
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Matrix>
-void MatrixTransition<Matrix>::
-write(ostream &out, int indent_level) const {
-  _matrix.write(out, indent_level);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MatrixTransition::internal_compare_to
-//       Access: Public, Virtual
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Matrix>
-int MatrixTransition<Matrix>::
-internal_compare_to(const NodeTransition *other) const {
-  const MatrixTransition<Matrix> *ot;
-  DCAST_INTO_R(ot, other, false);
-
-  // Should we bother comparing matrices componentwise, or should we
-  // just assume that any two different Matrix pointers are probably
-  // different matrices?
-
-  // For now, we compare componentwise.  It makes paranoid_wrt more
-  // sensible, and it doesn't seem to make a big different to
-  // performance.
-  return _matrix.compare_to(ot->_matrix, 0.00001);
-
-  // Uncomment this line instead to compare matrices pointerwise.
-  //  return this - other;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MatrixTransition::make_with_matrix
-//       Access: Protected, Virtual
-//  Description: This function creates a new MatrixTransition of the
-//               appropriate type, given the indicated matrix.
-//
-//               This is a pure virtual function and normally wouldn't
-//               require a definition, but for some reason VC++
-//               objects to instantiating the template if it's missing
-//               any function definitions--even those for pure-virtual
-//               functions.
-////////////////////////////////////////////////////////////////////
-template<class Matrix>
-MatrixTransition<Matrix> *MatrixTransition<Matrix>::
-make_with_matrix(const Matrix &) const {
-  return NULL;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MatrixTransition::write_datagram
-//       Access: Public
-//  Description: Function to write the important information in
-//               the particular object to a Datagram
-////////////////////////////////////////////////////////////////////
-template<class Matrix>
-void MatrixTransition<Matrix>::
-write_datagram(BamWriter *manager, Datagram &me)
-{
-  NodeTransition::write_datagram(manager, me);
-  _matrix.write_datagram(me);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MatrixTransition::fillin
-//       Access: Protected
-//  Description: Function that reads out of the datagram (or asks
-//               manager to read) all of the data that is needed to
-//               re-create this object and stores it in the appropiate
-//               place
-////////////////////////////////////////////////////////////////////
-template<class Matrix>
-void MatrixTransition<Matrix>::
-fillin(DatagramIterator& scan, BamReader* manager)
-{
-  NodeTransition::fillin(scan, manager);
-  _matrix.read_datagram(scan);
-}

+ 0 - 327
panda/src/graph/multiAttribute.I

@@ -1,327 +0,0 @@
-// Filename: multiAttribute.I
-// Created by:  drose (23Mar00)
-// 
-////////////////////////////////////////////////////////////////////
-
-/* okcircular */
-#include "multiTransition.h"
-
-template<class Property, class NameClass>
-TypeHandle MultiAttribute<Property, NameClass>::_type_handle;
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiAttribute::Constructor
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-MultiAttribute<Property, NameClass>::
-MultiAttribute() {
-  _properties_is_on = true;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiAttribute::Copy Constructor
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-MultiAttribute<Property, NameClass>::
-MultiAttribute(const MultiAttribute &copy) :
-  NodeAttribute(copy),
-  _properties(copy._properties),
-  _properties_is_on(copy._properties_is_on)
-{
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiAttribute::Copy Assignment Operator
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-void MultiAttribute<Property, NameClass>::
-operator = (const MultiAttribute &copy) {
-  NodeAttribute::operator = (copy);
-  _properties = copy._properties;
-  _properties_is_on = copy._properties_is_on;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiAttribute::set_on
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-void MultiAttribute<Property, NameClass>::
-set_on(const Property &property) {
-  if (_properties_is_on) {
-    set_property(property);
-  } else {
-    clear_property(property);
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiAttribute::set_off
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-void MultiAttribute<Property, NameClass>::
-set_off(const Property &property) {
-  if (_properties_is_on) {
-    clear_property(property);
-  } else {
-    set_property(property);
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiAttribute::is_on
-//       Access: Public
-//  Description: Returns true if the particular properties member is
-//               on, false if it is not.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-bool MultiAttribute<Property, NameClass>::
-is_on(const Property &property) const {
-  if (_properties_is_on) {
-    return has_property(property);
-  } else {
-    return !has_property(property);
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiAttribute::is_off
-//       Access: Public
-//  Description: Returns true if the particular properties member is
-//               off, false if it is not.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-bool MultiAttribute<Property, NameClass>::
-is_off(const Property &property) const {
-  if (_properties_is_on) {
-    return !has_property(property);
-  } else {
-    return has_property(property);
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiAttribute::properties_is_on
-//       Access: Public
-//  Description: Returns true if inclusion in the set traversible via
-//               begin()/end() indicates that the given property is
-//               on, the default.  Returns false if inclusion in the
-//               set indicates that the given property is off.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-INLINE_GRAPH bool MultiAttribute<Property, NameClass>::
-get_properties_is_on() const {
-  return _properties_is_on;
-}
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiAttribute::output
-//       Access: Public, Virtual
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-void MultiAttribute<Property, NameClass>::
-output(ostream &out) const {
-  if (!_properties.empty()) {
-    Properties::const_iterator pi = _properties.begin();
-    output_property(out, *pi);
-    ++pi;
-    while (pi != _properties.end()) {
-      out << " ";
-      output_property(out, *pi);
-      ++pi;
-    }
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiAttribute::write
-//       Access: Public, Virtual
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-void MultiAttribute<Property, NameClass>::
-write(ostream &out, int indent_level) const {
-  Properties::const_iterator pi;
-  for (pi = _properties.begin(); pi != _properties.end(); ++pi) {
-    write_property(out, *pi, indent_level);
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiAttribute::internal_compare_to
-//       Access: Protected, Virtual
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-int MultiAttribute<Property, NameClass>::
-internal_compare_to(const NodeAttribute *other) const {
-  const MultiAttribute<Property, NameClass> *ot;
-  DCAST_INTO_R(ot, other, false);
-
-  return bmap_compare(_properties.begin(), _properties.end(),
-		      ot->_properties.begin(), ot->_properties.end());
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiAttribute::output_property
-//       Access: Public, Virtual
-//  Description: This is a pure virtual function and normally would
-//               not need a body, except that VC++ doesn't seem happy
-//               about instantiating the template otherwise.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-void MultiAttribute<Property, NameClass>::
-output_property(ostream &, const Property &) const {
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiAttribute::write_property
-//       Access: Public, Virtual
-//  Description: This is a pure virtual function and normally would
-//               not need a body, except that VC++ doesn't seem happy
-//               about instantiating the template otherwise.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-void MultiAttribute<Property, NameClass>::
-write_property(ostream &, const Property &, int) const {
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiAttribute::set_property
-//       Access: Private
-//  Description: An internal function that adds the indicated property
-//               to the sorted vector, if it is not already there.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-INLINE_GRAPH void MultiAttribute<Property, NameClass>::
-set_property(const Property &prop) {
-  bool found_flag = false;
-  Properties::iterator pi = find_property(prop, found_flag);
-  if (!found_flag) {
-    _properties.insert(pi, prop);
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiAttribute::set_property
-//       Access: Private
-//  Description: An internal function that returns true if the
-//               indicated property is a member of the sorted vector,
-//               false if not.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-INLINE_GRAPH bool MultiAttribute<Property, NameClass>::
-has_property(const Property &prop) const {
-  bool found_flag = false;
-  ((MultiAttribute<Property, NameClass> *)this)->find_property(prop, found_flag);
-  return found_flag;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiAttribute::clear_property
-//       Access: Private
-//  Description: An internal function that removes the indicated
-//               property from the sorted vector.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-INLINE_GRAPH void MultiAttribute<Property, NameClass>::
-clear_property(const Property &prop) {
-  bool found_flag = false;
-  Properties::iterator pi = find_property(prop, found_flag);
-  if (found_flag) {
-    _properties.erase(pi);
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiAttribute::find_property
-//       Access: Private
-//  Description: An internal function that searches for the indicated
-//               property within the sorted vector.  If the property
-//               is found, found_flag is set true, and its iterator is
-//               returned; otherwise, found_flag is unchanged, and the
-//               iterator at which the property should be inserted is
-//               returned.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-INLINE_GRAPH MultiAttribute<Property, NameClass>::Properties::iterator MultiAttribute<Property, NameClass>::
-find_property(const Property &prop, bool &found_flag) {
-  return binary_search_property(_properties.begin(), _properties.end(),
-				prop, found_flag);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiAttribute::binary_search_property
-//       Access: Private
-//  Description: An internal function that implements a binary search
-//               for a particular property on the sorted vector.  If
-//               the property is found, found_flag is set true, and
-//               its iterator is returned; otherwise, found_flag is
-//               unchanged, and the iterator at which the property
-//               should be inserted is returned.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-MultiAttribute<Property, NameClass>::Properties::iterator MultiAttribute<Property, NameClass>::
-binary_search_property(Properties::iterator begin, Properties::iterator end,
-		       const Property &prop, bool &found_flag) {
-  if (begin == end) {
-    return begin;
-  }
-  Properties::iterator mid = begin + (end - begin) / 2;
-  if (prop < *mid) {
-    return binary_search_property(begin, mid, prop, found_flag);
-
-  } else if (*mid < prop) {
-    return binary_search_property(mid + 1, end, prop, found_flag);
-
-  } else { // *mid == prop
-    found_flag = true;
-    return mid;
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiAttribute::size
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-INLINE_GRAPH MultiAttribute<Property, NameClass>::size_type MultiAttribute<Property, NameClass>::
-size() const {
-  return _properties.size();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiAttribute::begin
-//       Access: Public
-//  Description: Returns an iterator that begins the sequence of
-//               properties in the attribute.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-INLINE_GRAPH MultiAttribute<Property, NameClass>::const_iterator MultiAttribute<Property, NameClass>::
-begin() const {
-  return _properties.begin();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiAttribute::end
-//       Access: Public
-//  Description: Returns an iterator that marks the end of the
-//               sequence of properties in the attribute.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-INLINE_GRAPH MultiAttribute<Property, NameClass>::const_iterator MultiAttribute<Property, NameClass>::
-end() const {
-  return _properties.end();
-}

+ 0 - 34
panda/src/graph/multiNodeAttribute.I

@@ -1,34 +0,0 @@
-// Filename: multiNodeAttribute.I
-// Created by:  drose (23Mar00)
-// 
-////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiNodeAttribute::Constructor
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-INLINE_GRAPH MultiNodeAttribute::
-MultiNodeAttribute() {
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiNodeAttribute::Copy Constructor
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-INLINE_GRAPH MultiNodeAttribute::
-MultiNodeAttribute(const MultiNodeAttribute &copy) :
-  MultiAttribute<PT_Node, PointerNameClass>(copy)
-{
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiNodeAttribute::Copy Assignment Operator
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-INLINE_GRAPH void MultiNodeAttribute::
-operator = (const MultiNodeAttribute &copy) {
-  MultiAttribute<PT_Node, PointerNameClass>::operator = (copy);
-}

+ 0 - 34
panda/src/graph/multiNodeTransition.I

@@ -1,34 +0,0 @@
-// Filename: multiNodeTransition.I
-// Created by:  drose (23Mar00)
-// 
-////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiNodeTransition::Constructor
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-INLINE_GRAPH MultiNodeTransition::
-MultiNodeTransition() {
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiNodeTransition::Copy Constructor
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-INLINE_GRAPH MultiNodeTransition::
-MultiNodeTransition(const MultiNodeTransition &copy) :
-  MultiTransition<PT_Node, PointerNameClass>(copy)
-{
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiNodeTransition::Copy Assignment Operator
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-INLINE_GRAPH void MultiNodeTransition::
-operator = (const MultiNodeTransition &copy) {
-  MultiTransition<PT_Node, PointerNameClass>::operator = (copy);
-}

+ 0 - 560
panda/src/graph/multiTransition.I

@@ -1,560 +0,0 @@
-// Filename: multiTransition.I
-// Created by:  drose (23Mar00)
-// 
-////////////////////////////////////////////////////////////////////
-
-/* okcircular */
-#include "multiAttribute.h"
-
-
-template<class Property, class NameClass>
-TypeHandle MultiTransition<Property, NameClass>::_type_handle;
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiTransition::Constructor
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-MultiTransition<Property, NameClass>::
-MultiTransition() {
-  _default_dir = TD_identity;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiTransition::Copy Constructor
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-MultiTransition<Property, NameClass>::
-MultiTransition(const MultiTransition &copy) :
-  NodeTransition(copy),
-  _properties(copy._properties),
-  _default_dir(copy._default_dir)
-{
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiTransition::Copy Assignment Operator
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-void MultiTransition<Property, NameClass>::
-operator = (const MultiTransition &copy) {
-  NodeTransition::operator = (copy);
-  _properties = copy._properties;
-  _default_dir = copy._default_dir;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiTransition::clear
-//       Access: Public
-//  Description: Removes all properties from the set, and resets it to
-//               its initial state.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-void MultiTransition<Property, NameClass>::
-clear() {
-  _properties.clear();
-  state_changed();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiTransition::is_identity
-//       Access: Public
-//  Description: Returns true if this transition does not have any
-//               effect.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-bool MultiTransition<Property, NameClass>::
-is_identity() const {
-  if (_default_dir != TD_identity) {
-    return false;
-  }
-
-  Properties::const_iterator pi;
-  for (pi = _properties.begin(); pi != _properties.end(); ++pi) {
-    if ((*pi).second != TD_identity) {
-      return false;
-    }
-  }
-
-  return true;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiTransition::set_default_dir
-//       Access: Public
-//  Description: Sets the default direction on the MultiTransition.
-//               This controls whether the MultiTransition applies
-//               itself by completely replacing everything that went
-//               before, or by adding to whatever has gone before.
-//
-//               When this is set to either TD_on or TD_off, all
-//               properties which are not explicitly mentioned are
-//               assumed to be 'on' or 'off' transitions,
-//               respectively; when it is set to TD_identity, the
-//               default, all properties which are not explicitly
-//               mentions are assumed to be identity transitions and
-//               are left unchanged.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-INLINE_GRAPH void MultiTransition<Property, NameClass>::
-set_default_dir(TransitionDirection dir) {
-  _default_dir = dir;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiTransition::get_default_dir
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-INLINE_GRAPH TransitionDirection MultiTransition<Property, NameClass>::
-get_default_dir() const {
-  return _default_dir;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiTransition::set_identity
-//       Access: Public
-//  Description: Changes the indicated property to an identity
-//               transition: this property will not be changed by the
-//               application of the MultiTransition.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-void MultiTransition<Property, NameClass>::
-set_identity(const Property &property) {
-  _properties[property] = TD_identity;
-  state_changed();  
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiTransition::set_on
-//       Access: Public
-//  Description: Changes the indicated property to an 'on' transition:
-//               this property will be explicitly turned on by the
-//               application of the MultiTransition.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-void MultiTransition<Property, NameClass>::
-set_on(const Property &property) {
-  _properties[property] = TD_on;
-  state_changed();  
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiTransition::set_off
-//       Access: Public
-//  Description: Changes the indicated property to an 'off' transition:
-//               this property will be explicitly turned off by the
-//               application of the MultiTransition.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-void MultiTransition<Property, NameClass>::
-set_off(const Property &property) {
-  _properties[property] = TD_off;
-  state_changed();  
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiTransition::is_identity
-//       Access: Public
-//  Description: Returns true if this property has been indicated as
-//               an identity transition, false otherwise.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-bool MultiTransition<Property, NameClass>::
-is_identity(const Property &property) const {
-  Properties::const_iterator pi;
-  pi = _properties.find(property);
-  if (pi != _properties.end()) {
-    return (*pi).second == TD_identity;
-  }
-
-  // The property is not mentioned.  It's implicitly identity only if
-  // the default_dir flag is identity.
-  return (_default_dir == TD_identity);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiTransition::is_on
-//       Access: Public
-//  Description: Returns true if this property has been indicated as
-//               an 'on' transition, false otherwise.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-bool MultiTransition<Property, NameClass>::
-is_on(const Property &property) const {
-  Properties::const_iterator pi;
-  pi = _properties.find(property);
-  if (pi != _properties.end()) {
-    return (*pi).second == TD_on;
-  }
-
-  // The property is not mentioned.  It's implicitly 'on' only if the
-  // default_dir flag is TD_on.
-  return (_default_dir == TD_on);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiTransition::is_on
-//       Access: Public
-//  Description: Returns true if this property has been indicated as
-//               an 'off' transition, false otherwise.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-bool MultiTransition<Property, NameClass>::
-is_off(const Property &property) const {
-  Properties::const_iterator pi;
-  pi = _properties.find(property);
-  if (pi != _properties.end()) {
-    return (*pi).second == TD_off;
-  }
-
-  // The property is not mentioned.  It's implicitly 'off' only if the
-  // default_dir flag is TD_off.
-  return (_default_dir == TD_off);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiTransition::make_identity
-//       Access: Public, Virtual
-//  Description: This is a pure virtual function and normally would
-//               not need a body, except that VC++ doesn't seem happy
-//               about instantiating the template otherwise.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-NodeTransition *MultiTransition<Property, NameClass>::
-make_identity() const {
-  return NULL;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiTransition::compose
-//       Access: Public, Virtual
-//  Description: Returns a new transition that corresponds to the
-//               composition of this transition with the second
-//               transition (which must be of an equivalent type).
-//               This may return the same pointer as either source
-//               transition.  Applying the transition returned from
-//               this function to an attribute attribute will produce
-//               the same effect as applying each transition
-//               separately.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-NodeTransition *MultiTransition<Property, NameClass>::
-compose(const NodeTransition *other) const {
-  const MultiTransition<Property, NameClass> *ot;
-  DCAST_INTO_R(ot, other, NULL);
-
-  if (ot->_priority < _priority) {
-    // The other transition too low-priority; the result is unchanged.
-    return (MultiTransition<Property, NameClass> *)this;
-
-  } else if (ot->_priority > _priority) {
-    // The other priority is higher: the result is the same as the other.
-    return (MultiTransition<Property, NameClass> *)ot;
-
-  } else if (ot->_default_dir != TD_identity) {
-    // The other transition is a complete-world transition: the result
-    // is the same as other.
-    return (MultiTransition<Property, NameClass> *)ot;
-
-  } else if (is_identity()) {
-    // We're identity: the result is the same as other.
-    return (MultiTransition<Property, NameClass> *)ot;
-
-  } else if (ot->is_identity()) {
-    // The other transition is identity: it has no effect.
-    return (MultiTransition<Property, NameClass> *)this;
-
-  } else {
-    // Neither of us is identity.  Build and return a new list.
-    MultiTransition<Property, NameClass> *result;
-    DCAST_INTO_R(result, make_identity(), NULL);
-    result->_default_dir = _default_dir;
-
-    dmap_compose(_properties.begin(), _properties.end(),
-		 ot->_properties.begin(), ot->_properties.end(),
-		 inserter(result->_properties, result->_properties.begin()));
-
-    return result;
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiTransition::invert
-//       Access: Public, Virtual
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-NodeTransition *MultiTransition<Property, NameClass>::
-invert() const {
-  if (is_identity()) {
-    return (MultiTransition<Property, NameClass> *)this;
-  }
-
-  MultiTransition<Property, NameClass> *result;
-  DCAST_INTO_R(result, make_identity(), NULL);
-
-  result->_default_dir = TD_identity;
-
-  dmap_invert(_properties.begin(), _properties.end(),
-	      inserter(result->_properties, result->_properties.begin()));
-
-  return result;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiTransition::apply
-//       Access: Public, Virtual
-//  Description: Returns a new attribute (or possibly the same
-//               attribute) that represents the effect of applying this
-//               indicated transition to the indicated attribute.  The
-//               source attribute may be NULL, indicating the initial
-//               attribute.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-NodeAttribute *MultiTransition<Property, NameClass>::
-apply(const NodeAttribute *attrib) const {
-  
-  MultiAttribute<Property, NameClass> *result;
-  if (attrib == (const NodeAttribute *)NULL) {
-    DCAST_INTO_R(result, make_attrib(), NULL);
-  } else {
-    DCAST_INTO_R(result, (NodeAttribute *)attrib, NULL);
-  }    
-
-  if (_priority < result->_priority || is_identity()) {
-    // The priority is too low to affect the attribute, or we're
-    // identity.
-    return result;
-  }
-
-  if (result->get_ref_count() > 1) {
-    // Copy on write.
-    DCAST_INTO_R(result, result->make_copy(), NULL);
-  }
-
-  result->_priority = _priority;
-
-  MultiAttribute<Property, NameClass>::Properties temp;
-  if (_default_dir == TD_identity) {
-    // In this case, the normal case, the transition does not specify
-    // completely what the attributes should be.
-    bmap_apply(result->_properties.begin(), result->_properties.end(),
-	       _properties.begin(), _properties.end(),
-	       false, TD_on,
-	       inserter(temp, temp.begin()));
-    result->_properties_is_on = true;
-
-  } else if (_default_dir == TD_off) {
-    // In this case, the transition completely specifies what the
-    // attributes should be; any property not explicitly mentioned by
-    // the transition should be turned off.
-    bmap_apply(result->_properties.begin(), result->_properties.end(),
-	       _properties.begin(), _properties.end(),
-	       true, TD_on,
-	       inserter(temp, temp.begin()));
-    result->_properties_is_on = true;
-
-  } else { // _default_dir == TD_on
-    // In this case, the transition completely specifies what the
-    // attributes should be; any property not explicitly mentioned by
-    // the transition should be turned on.
-    bmap_apply(result->_properties.begin(), result->_properties.end(),
-	       _properties.begin(), _properties.end(),
-	       true, TD_off,
-	       inserter(temp, temp.begin()));
-    result->_properties_is_on = false;
-  }
-
-  result->_properties.swap(temp);
-
-  return result;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiTransition::output
-//       Access: Public, Virtual
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-void MultiTransition<Property, NameClass>::
-output(ostream &out) const {
-  Properties::const_iterator pi;
-
-  bool any_identity = false;
-  for (pi = _properties.begin(); pi != _properties.end(); ++pi) {
-    if ((*pi).second == TD_identity) {
-      if (!any_identity) {
-	out << " identity(";
-	any_identity = true;
-      } else {
-	out << ", ";
-      }
-      output_property(out, (*pi).first);
-    }
-  }
-  if (any_identity) {
-    out << ")";
-  }
-
-  bool any_on = false;
-  for (pi = _properties.begin(); pi != _properties.end(); ++pi) {
-    if ((*pi).second == TD_on) {
-      if (!any_on) {
-	out << " on(";
-	any_on = true;
-      } else {
-	out << ", ";
-      }
-      output_property(out, (*pi).first);
-    }
-  }
-  if (any_on) {
-    out << ")";
-  }
-
-  bool any_off = false;
-  for (pi = _properties.begin(); pi != _properties.end(); ++pi) {
-    if ((*pi).second == TD_off) {
-      if (!any_off) {
-	out << " off(";
-	any_off = true;
-      } else {
-	out << ", ";
-      }
-      output_property(out, (*pi).first);
-    }
-  }
-  if (any_off) {
-    out << ")";
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiTransition::write
-//       Access: Public, Virtual
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-void MultiTransition<Property, NameClass>::
-write(ostream &out, int indent_level) const {
-  Properties::const_iterator pi;
-
-  bool any_identity = false;
-  for (pi = _properties.begin(); pi != _properties.end(); ++pi) {
-    if ((*pi).second == TD_identity) {
-      if (!any_identity) {
-	indent(out, indent_level) << "identity:\n";
-	any_identity = true;
-      }
-      write_property(out, (*pi).first, indent_level + 2);
-    }
-  }
-
-  bool any_on = false;
-  for (pi = _properties.begin(); pi != _properties.end(); ++pi) {
-    if ((*pi).second == TD_on) {
-      if (!any_on) {
-	indent(out, indent_level) << "on:\n";
-	any_on = true;
-      }
-      write_property(out, (*pi).first, indent_level + 2);
-    }
-  }
-
-  bool any_off = false;
-  for (pi = _properties.begin(); pi != _properties.end(); ++pi) {
-    if ((*pi).second == TD_off) {
-      if (!any_off) {
-	indent(out, indent_level) << "off:\n";
-	any_off = true;
-      }
-      write_property(out, (*pi).first, indent_level + 2);
-    }
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiTransition::internal_compare_to
-//       Access: Protected, Virtual
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-int MultiTransition<Property, NameClass>::
-internal_compare_to(const NodeTransition *other) const {
-  const MultiTransition<Property, NameClass> *ot;
-  DCAST_INTO_R(ot, other, false);
-
-  if (_default_dir != ot->_default_dir) {
-    return (int)_default_dir - (int)ot->_default_dir;
-  }
-
-  return dmap_compare(_properties.begin(), _properties.end(),
-		      ot->_properties.begin(), ot->_properties.end());
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiTransition::output_property
-//       Access: Public, Virtual
-//  Description: This is a pure virtual function and normally would
-//               not need a body, except that VC++ doesn't seem happy
-//               about instantiating the template otherwise.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-void MultiTransition<Property, NameClass>::
-output_property(ostream &, const Property &) const {
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiTransition::write_property
-//       Access: Public, Virtual
-//  Description: This is a pure virtual function and normally would
-//               not need a body, except that VC++ doesn't seem happy
-//               about instantiating the template otherwise.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-void MultiTransition<Property, NameClass>::
-write_property(ostream &, const Property &, int) const {
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiTransition::size
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-INLINE_GRAPH MultiTransition<Property, NameClass>::size_type MultiTransition<Property, NameClass>::
-size() const {
-  return _properties.size();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiTransition::begin
-//       Access: Public
-//  Description: Returns an iterator that begins the sequence of
-//               properties in the transition.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-INLINE_GRAPH MultiTransition<Property, NameClass>::const_iterator MultiTransition<Property, NameClass>::
-begin() const {
-  return _properties.begin();
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: MultiTransition::end
-//       Access: Public
-//  Description: Returns an iterator that marks the end of the
-//               sequence of properties in the transition.
-////////////////////////////////////////////////////////////////////
-template<class Property, class NameClass>
-INLINE_GRAPH MultiTransition<Property, NameClass>::const_iterator MultiTransition<Property, NameClass>::
-end() const {
-  return _properties.end();
-}
-

+ 0 - 34
panda/src/graph/onAttribute.I

@@ -1,34 +0,0 @@
-// Filename: onAttribute.I
-// Created by:  drose (22Mar00)
-// 
-////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////////////
-//     Function: OnAttribute::Constructor
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-INLINE_GRAPH OnAttribute::
-OnAttribute() {
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: OnAttribute::Copy Constructor
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-INLINE_GRAPH OnAttribute::
-OnAttribute(const OnAttribute &copy) :
-  NodeAttribute(copy)
-{
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: OnAttribute::Copy Assignment Operator
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-INLINE_GRAPH void OnAttribute::
-operator = (const OnAttribute &copy) {
-  NodeAttribute::operator = (copy);
-}

+ 0 - 1104
panda/src/graph/setTransitionHelpers.I

@@ -1,1104 +0,0 @@
-// Filename: setTransitionHelpers.I
-// Created by:  drose (25Jan99)
-// 
-////////////////////////////////////////////////////////////////////
-
-#include "nodeTransitionCacheEntry.h"
-#include "config_graph.h"
-
-////////////////////////////////////////////////////////////////////
-//     Function: tmap_get_interest
-//  Description: Returns the NodeTransition elements of interest to
-//               us.  These are the elements of the first sequence--a
-//               NodeTransition map--whose keys appear in the second
-//               sequence, a sorted list of NodeTransition
-//               TypeHandles.
-////////////////////////////////////////////////////////////////////
-template<class InputIterator1, class InputIterator2, class OutputIterator>
-OutputIterator
-tmap_get_interest(InputIterator1 first1, InputIterator1 last1,
-		  InputIterator2 first2, InputIterator2 last2,
-		  OutputIterator result) {
-  while (first1 != last1 && first2 != last2) {
-    if ((*first1).first < *first2) {
-      ++first1;
-      ++result;
-    } else if (*first2 < (*first1).first) {
-      ++first2;
-      ++result;
-    } else {
-      *result = *first1;
-      ++first1;
-      ++first2;
-      ++result;
-    }
-  }
-  return result;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: tmap_override_union
-//  Description: Accepts two NodeTransition or NodeAttribute maps, and
-//               builds a new map which is the union of the first two.
-//               If an element appears in both maps, the entry from
-//               the second is preferred.
-////////////////////////////////////////////////////////////////////
-template<class InputIterator1, class InputIterator2, class OutputIterator>
-OutputIterator
-tmap_override_union(InputIterator1 first1, InputIterator1 last1,
-		    InputIterator2 first2, InputIterator2 last2,
-		    OutputIterator result) {
-  while (first1 != last1 && first2 != last2) {
-    if ((*first1).first < (*first2).first) {
-      *result = *first1;
-      ++first1;
-      ++result;
-    } else if ((*first2).first < (*first1).first) {
-      *result = *first2;
-      ++first2;
-      ++result;
-    } else {
-      *result = *first2;
-      ++first1;
-      ++first2;
-      ++result;
-    }
-  }
-
-  while (first1 != last1) {
-    *result = *first1;
-    ++first1;
-    ++result;
-  }
-
-  while (first2 != last2) { 
-    *result = *first2;
-    ++first2;
-    ++result;
-  }
-  return result;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: tmap_merge_union
-//  Description: Accepts two NodeAttribute maps, and builds a new map
-//               which is the union of the first two.  If an element
-//               appears in both maps, the two are merged, preferring
-//               the second.
-////////////////////////////////////////////////////////////////////
-template<class InputIterator1, class InputIterator2, class OutputIterator>
-OutputIterator
-tmap_merge_union(InputIterator1 first1, InputIterator1 last1,
-		 InputIterator2 first2, InputIterator2 last2,
-		 OutputIterator result) {
-  while (first1 != last1 && first2 != last2) {
-    if ((*first1).first < (*first2).first) {
-      *result = *first1;
-      ++first1;
-      ++result;
-    } else if ((*first2).first < (*first1).first) {
-      *result = *first2;
-      ++first2;
-      ++result;
-    } else {
-      PT(NodeAttribute) c = (*first1).second->merge((*first2).second);
-      *result = pair<TypeHandle,  PT(NodeAttribute) >((*first1).first, c);
-      ++first1;
-      ++first2;
-      ++result;
-    }
-  }
-
-  while (first1 != last1) {
-    *result = *first1;
-    ++first1;
-    ++result;
-  }
-
-  while (first2 != last2) { 
-    *result = *first2;
-    ++first2;
-    ++result;
-  }
-  return result;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: tmap_arc_union
-//  Description: As above, but updates the transitions on the way to
-//               indicate they are being attached to (or removed from)
-//               the indicated arc.
-////////////////////////////////////////////////////////////////////
-template<class InputIterator1, class InputIterator2, class OutputIterator>
-OutputIterator
-tmap_arc_union(InputIterator1 first1, InputIterator1 last1,
-	       InputIterator2 first2, InputIterator2 last2,
-	       NodeRelation *to_arc, OutputIterator result) {
-  while (first1 != last1 && first2 != last2) {
-    if ((*first1).first < (*first2).first) {
-      *result = *first1;
-      ++first1;
-      ++result;
-    } else if ((*first2).first < (*first1).first) {
-      (*first2).second->added_to_arc(to_arc);
-      *result = *first2;
-      ++first2;
-      ++result;
-    } else {
-      (*first1).second->removed_from_arc(to_arc);
-      (*first2).second->added_to_arc(to_arc);
-      *result = *first2;
-      ++first1;
-      ++first2;
-      ++result;
-    }
-  }
-
-  while (first1 != last1) {
-    *result = *first1;
-    ++first1;
-    ++result;
-  }
-
-  while (first2 != last2) { 
-    (*first2).second->added_to_arc(to_arc);
-    *result = *first2;
-    ++first2;
-    ++result;
-  }
-  return result;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: tmap_arc_compose
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class InputIterator1, class InputIterator2, class OutputIterator>
-OutputIterator
-tmap_arc_compose(InputIterator1 first1, InputIterator1 last1,
-		 InputIterator2 first2, InputIterator2 last2,
-		 NodeRelation *to_arc, OutputIterator result) {
-  while (first1 != last1 && first2 != last2) {
-    if ((*first1).first < (*first2).first) {
-      *result = *first1;
-      ++first1;
-      ++result;
-    } else if ((*first2).first < (*first1).first) {
-      (*first2).second->added_to_arc(to_arc);
-      *result = *first2;
-      ++first2;
-      ++result;
-    } else {
-      (*first1).second->removed_from_arc(to_arc);
-
-      PT(NodeTransition) c = (*first1).second->compose((*first2).second);
-      if (c != (NodeTransition *)NULL) {
-	c->added_to_arc(to_arc);
-	*result = pair<TypeHandle,  PT(NodeTransition) >((*first1).first, c);
-	++result;
-      }
-      ++first1;
-      ++first2;
-    }
-  }
-
-  while (first1 != last1) {
-    *result = *first1;
-    ++first1;
-    ++result;
-  }
-
-  while (first2 != last2) { 
-    (*first2).second->added_to_arc(to_arc);
-    *result = *first2;
-    ++first2;
-    ++result;
-  }
-  return result;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: tmap_arc_compose
-//  Description: 
-////////////////////////////////////////////////////////////////////
-template<class InputIterator1, class InputIterator2, class OutputIterator>
-OutputIterator
-tmap_arc_compose(InputIterator1 first1, InputIterator1 last1,
-		 InputIterator2 first2, InputIterator2 last2,
-		 OutputIterator result) {
-  while (first1 != last1 && first2 != last2) {
-    if ((*first1).first < (*first2).first) {
-      *result = *first1;
-      ++first1;
-      ++result;
-    } else if ((*first2).first < (*first1).first) {
-      *result = *first2;
-      ++first2;
-      ++result;
-    } else {
-      NodeTransition *c = (*first1).second->compose((*first2).second);
-      if (c != (NodeTransition *)NULL) {
-	*result = pair<TypeHandle, NodeTransitionCacheEntry>
-	  ((*first1).first, c);
-	++result;
-      }
-      ++first1;
-      ++first2;
-    }
-  }
-
-  while (first1 != last1) {
-    *result = *first1;
-    ++first1;
-    ++result;
-  }
-
-  while (first2 != last2) { 
-    *result = *first2;
-    ++first2;
-    ++result;
-  }
-  return result;
-}
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: tmap_compose
-//  Description: Accepts two NodeTransition maps, and builds a new
-//               list (a NodeTransition map) which represents the
-//               memberwise composition of the two input maps.
-////////////////////////////////////////////////////////////////////
-template<class InputIterator1, class InputIterator2, class OutputIterator>
-OutputIterator
-tmap_compose(InputIterator1 first1, InputIterator1 last1,
-	     InputIterator2 first2, InputIterator2 last2,
-	     OutputIterator result) {
-  while (first1 != last1 && first2 != last2) {
-    if ((*first1).first < (*first2).first) {
-      *result = *first1;
-      ++first1;
-      ++result;
-    } else if ((*first2).first < (*first1).first) {
-      *result = *first2;
-      ++first2;
-      ++result;
-    } else {
-      *result = pair<TypeHandle, NodeTransitionCacheEntry>
-	((*first1).first, 
-	 NodeTransitionCacheEntry::compose((*first1).second, (*first2).second));
-      ++first1;
-      ++first2;
-      ++result;
-    }
-  }
-
-  while (first1 != last1) {
-    *result = *first1;
-    ++first1;
-    ++result;
-  }
-
-  while (first2 != last2) { 
-    *result = *first2;
-    ++first2;
-    ++result;
-  }
-  return result;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: tmap_invert_compose
-//  Description: Accepts two NodeTransition maps, and builds a new
-//               list (a NodeTransition map) which represents the
-//               memberwise result of invert_compose of the two input
-//               maps.
-////////////////////////////////////////////////////////////////////
-template<class InputIterator1, class InputIterator2, class OutputIterator>
-OutputIterator
-tmap_invert_compose(InputIterator1 first1, InputIterator1 last1,
-		    InputIterator2 first2, InputIterator2 last2,
-		    OutputIterator result) {
-  while (first1 != last1 && first2 != last2) {
-    if ((*first1).first < (*first2).first) {
-      *result = pair<TypeHandle, NodeTransitionCacheEntry>
-	((*first1).first, NodeTransitionCacheEntry::invert((*first1).second));
-      ++first1;
-      ++result;
-    } else if ((*first2).first < (*first1).first) {
-      *result = *first2;
-      ++first2;
-      ++result;
-    } else {
-      NodeTransitionCacheEntry ic =
-	NodeTransitionCacheEntry::invert_compose((*first1).second,
-						 (*first2).second);
-      if (!ic.is_identity()) {
-	// Only bother to store the result if it's not identity.
-	*result = pair<TypeHandle,  PT(NodeTransition) >((*first1).first, ic);
-	++result;
-      }
-      ++first1;
-      ++first2;
-    }
-  }
-
-  while (first1 != last1) {
-    *result = pair<TypeHandle, NodeTransitionCacheEntry>
-      ((*first1).first, NodeTransitionCacheEntry::invert((*first1).second));
-    ++first1;
-    ++result;
-  }
-
-  while (first2 != last2) { 
-    *result = *first2;
-    ++first2;
-    ++result;
-  }
-  return result;
-}
-
-// This macro is used in the various cached_compose functions to
-// possibly output debug statements about which pieces we're
-// composing.
-
-#ifndef NDEBUG
-#define OUTPUT_CC_ELEM(desc, type) \
-{ \
-  if (wrt_cat.is_spam()) { \
-    wrt_cat.spam() << "in " << desc << ": " << (type) << "\n"; \
-  } \
-}
-#else
-#define OUTPUT_CC_ELEM(desc, type)
-#endif
-
-////////////////////////////////////////////////////////////////////
-//     Function: tmap_cached_compose_not_1
-//  Description: One of several support functions for
-//               tmap_cached_compose(), below, this handles the case
-//               of tmap_cached_compose() for a NodeTransition that
-//               is already known not to be present in list 1, but may
-//               be in one or both of lists 2 and 3.
-////////////////////////////////////////////////////////////////////
-template<class InputIterator2, class InputIterator3, class OutputIterator>
-void
-tmap_cached_compose_not_1(InputIterator2 &first2, InputIterator3 &first3,
-			  UpdateSeq now, OutputIterator &result) {
-  if ((*first2).first < (*first3).first) {
-    // Here's an element in list 2 that is not in lists 1 or 3.
-    OUTPUT_CC_ELEM("2", (*first2).first);
-
-    *result = pair<TypeHandle, NodeTransitionCacheEntry>
-      ((*first2).first, 
-       NodeTransitionCacheEntry::cached_compose
-       (NodeTransitionCacheEntry(),
-	(*first2).second, 
-	NodeTransitionCacheEntry(),
-	now));
-    ++first2;
-    ++result;
-    
-  } else if ((*first3).first < (*first2).first) {
-    // Here's an element in list 3 that is not lists 2 or 1.
-    OUTPUT_CC_ELEM("3", (*first3).first);
-
-    *result = pair<TypeHandle, NodeTransitionCacheEntry>
-      ((*first3).first, 
-       NodeTransitionCacheEntry::cached_compose
-       (NodeTransitionCacheEntry(),
-	NodeTransitionCacheEntry(),
-	(*first3).second, 
-	now));
-    ++first3;
-    ++result;
-    
-  } else {  // (*first2).first == (*first3).first
-    // Here's an element in lists 2 and 3 that is not in list 1.
-    OUTPUT_CC_ELEM("2, 3", (*first2).first);
-
-    *result = pair<TypeHandle, NodeTransitionCacheEntry>
-      ((*first2).first, 
-       NodeTransitionCacheEntry::cached_compose
-       (NodeTransitionCacheEntry(),
-	(*first2).second, 
-	(*first3).second, 
-	now));
-    ++first2;
-    ++first3;
-    ++result;
-  }
-}
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: tmap_cached_compose_not_2
-//  Description: One of several support functions for
-//               tmap_cached_compose(), below, this handles the case
-//               of tmap_cached_compose() for an NodeTransition that
-//               is already known not to be present in list 2, but may
-//               be in one or both of lists 1 and 3.
-////////////////////////////////////////////////////////////////////
-template<class InputIterator1, class InputIterator3, class OutputIterator>
-void
-tmap_cached_compose_not_2(InputIterator1 &first1, InputIterator3 &first3,
-			  UpdateSeq now, OutputIterator &result) {
-  if ((*first1).first < (*first3).first) {
-    // Here's an element in list 1 that is not in lists 2 or 3.
-    OUTPUT_CC_ELEM("1", (*first1).first);
-
-    *result = pair<TypeHandle, NodeTransitionCacheEntry>
-      ((*first1).first, 
-       NodeTransitionCacheEntry::cached_compose
-       ((*first1).second, 
-	NodeTransitionCacheEntry(),
-	NodeTransitionCacheEntry(),
-	now));
-    ++first1;
-    ++result;
-    
-  } else if ((*first3).first < (*first1).first) {
-    // Here's an element in list 3 that is not lists 1 or 2.
-    OUTPUT_CC_ELEM("3", (*first3).first);
-
-    *result = pair<TypeHandle, NodeTransitionCacheEntry>
-      ((*first3).first, 
-       NodeTransitionCacheEntry::cached_compose
-       (NodeTransitionCacheEntry(),
-	NodeTransitionCacheEntry(),
-	(*first3).second, 
-	now));
-    ++first3;
-    ++result;
-    
-  } else {  // (*first1).first == (*first3).first
-    // Here's an element in lists 1 and 3 that is not in list 2.
-    OUTPUT_CC_ELEM("1, 3", (*first1).first);
-
-    *result = pair<TypeHandle, NodeTransitionCacheEntry>
-      ((*first1).first, 
-       NodeTransitionCacheEntry::cached_compose
-       ((*first1).second,
-	NodeTransitionCacheEntry(),
-	(*first3).second, 
-	now));
-    ++first1;
-    ++first3;
-    ++result;
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: tmap_cached_compose_not_3
-//  Description: One of several support functions for
-//               tmap_cached_compose(), below, this handles the case
-//               of tmap_cached_compose() for an NodeTransition that
-//               is already known not to be present in list 3, but may
-//               be in one or both of lists 1 and 2.
-////////////////////////////////////////////////////////////////////
-template<class InputIterator1, class InputIterator2, class OutputIterator>
-void
-tmap_cached_compose_not_3(InputIterator1 &first1, InputIterator2 &first2,
-			  UpdateSeq now, OutputIterator &result) {
-  if ((*first1).first < (*first2).first) {
-    // Here's an element in list 1 that is not in lists 2 or 3.
-    OUTPUT_CC_ELEM("1", (*first1).first);
-
-    *result = pair<TypeHandle, NodeTransitionCacheEntry>
-      ((*first1).first, 
-       NodeTransitionCacheEntry::cached_compose
-       ((*first1).second, 
-	NodeTransitionCacheEntry(),
-	NodeTransitionCacheEntry(),
-	now));
-    ++first1;
-    ++result;
-    
-  } else if ((*first2).first < (*first1).first) {
-    // Here's an element in list 2 that is not lists 1 or 3.
-    OUTPUT_CC_ELEM("2", (*first2).first);
-
-    *result = pair<TypeHandle, NodeTransitionCacheEntry>
-      ((*first2).first, 
-       NodeTransitionCacheEntry::cached_compose
-       (NodeTransitionCacheEntry(),
-	(*first2).second, 
-	NodeTransitionCacheEntry(),
-	now));
-    ++first2;
-    ++result;
-    
-  } else {  // (*first1).first == (*first2).first
-    // Here's an element in lists 1 and 2 that is not in list 3.
-    OUTPUT_CC_ELEM("1, 2", (*first1).first);
-
-    *result = pair<TypeHandle, NodeTransitionCacheEntry>
-      ((*first1).first, 
-       NodeTransitionCacheEntry::cached_compose
-       ((*first1).second,
-	(*first2).second,
-	NodeTransitionCacheEntry(),
-	now));
-    ++first1;
-    ++first2;
-    ++result;
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: tmap_cached_compose_12
-//  Description: One of several support functions for
-//               tmap_cached_compose(), below, this handles the case
-//               of tmap_cached_compose() for an NodeTransition that
-//               is already known to be in both lists 1 and 2, and may
-//               or may not also be in list 3.
-////////////////////////////////////////////////////////////////////
-template<class InputIterator1, class InputIterator2, class InputIterator3, 
-  class OutputIterator>
-void
-tmap_cached_compose_12(InputIterator1 &first1, InputIterator2 &first2,
-		       InputIterator3 &first3,
-		       UpdateSeq now, OutputIterator &result) {
-  if ((*first1).first < (*first3).first) {
-    // Here's an element in lists 1 and 2 that is not in list 3.
-    OUTPUT_CC_ELEM("1, 2", (*first1).first);
-
-    *result = pair<TypeHandle, NodeTransitionCacheEntry>
-      ((*first1).first, 
-       NodeTransitionCacheEntry::cached_compose
-       ((*first1).second,
-	(*first2).second,
-	NodeTransitionCacheEntry(),
-	now));
-    ++first1;
-    ++first2;
-    ++result;
-    
-  } else if ((*first3).first < (*first1).first) {
-    // Here's an element in list 3 that is not lists 1 or 2.
-    OUTPUT_CC_ELEM("3", (*first3).first);
-
-    *result = pair<TypeHandle, NodeTransitionCacheEntry>
-      ((*first3).first, 
-       NodeTransitionCacheEntry::cached_compose
-       (NodeTransitionCacheEntry(),
-	NodeTransitionCacheEntry(),
-	(*first3).second,
-	now));
-    ++first3;
-    ++result;
-    
-  } else {  // (*first1).first == (*first3).first
-    // Here's an element in lists 1, 2, and 3.
-    OUTPUT_CC_ELEM("1, 2, 3", (*first1).first);
-    
-    *result = pair<TypeHandle, NodeTransitionCacheEntry>
-      ((*first1).first, 
-       NodeTransitionCacheEntry::cached_compose
-       ((*first1).second,
-	(*first2).second,
-	(*first3).second,
-	now));
-    ++first1;
-    ++first2;
-    ++first3;
-    ++result;
-  }
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: tmap_cached_compose
-//  Description: Calls dynamic_cached_compose() on each matching
-//               element of [first1 .. last1), [cached_first
-//               .. cached_last), and [value_first .. value_last).
-//
-//               This function is big and complicated because it has
-//               to do a parallel merge on three separate lists.  Any
-//               NodeTransition type may appear in any or all of the
-//               lists; if a particular type appears in any list but
-//               is absent from the others, an implicit identity
-//               transition should be inferred where it is absent.
-////////////////////////////////////////////////////////////////////
-template<class InputIterator1, class InputIterator2, class InputIterator3,
-  class OutputIterator>
-OutputIterator
-tmap_cached_compose(InputIterator1 first1, InputIterator1 last1,
-		    InputIterator2 first2, InputIterator2 last2,
-		    InputIterator3 first3, InputIterator3 last3,
-		    UpdateSeq now, OutputIterator result) {
-  while (first1 != last1 && first2 != last2 && first3 != last3) {
-    if ((*first1).first < (*first2).first) {
-      tmap_cached_compose_not_2(first1, first3, now, result);
-
-    } else if ((*first2).first < (*first1).first) {
-      tmap_cached_compose_not_1(first2, first3, now, result);
-
-    } else {    // (*first1).first == (*first2).first
-      tmap_cached_compose_12(first1, first2, first3, now, result);
-    }
-  }
-
-  // Now pick up everything else.
-  if (first1 == last1) {
-    while (first2 != last2 && first3 != last3) {
-      tmap_cached_compose_not_1(first2, first3, now, result);
-    }
-
-  } else if (first2 == last2) {
-    while (first1 != last1 && first3 != last3) {
-      tmap_cached_compose_not_2(first1, first3, now, result);
-    }
-
-  } else if (first3 == last3) {
-    while (first1 != last1 && first2 != last2) {
-      tmap_cached_compose_not_3(first1, first2, now, result);
-    }
-  }
-
-  while (first1 != last1) {
-    // Here's an element in list 1 that is not in lists 2 or 3.
-    OUTPUT_CC_ELEM("1", (*first1).first);
-
-    *result = pair<TypeHandle, NodeTransitionCacheEntry>
-      ((*first1).first, 
-       NodeTransitionCacheEntry::cached_compose
-       ((*first1).second, 
-	NodeTransitionCacheEntry(),
-	NodeTransitionCacheEntry(),
-	now));
-    ++first1;
-    ++result;
-  }
-
-  while (first2 != last2) {
-    // Here's an element in list 2 that is not in lists 1 or 3.
-    OUTPUT_CC_ELEM("2", (*first2).first);
-
-    *result = pair<TypeHandle, NodeTransitionCacheEntry>
-      ((*first2).first, 
-       NodeTransitionCacheEntry::cached_compose
-       (NodeTransitionCacheEntry(),
-	(*first2).second, 
-	NodeTransitionCacheEntry(),
-	now));
-    ++first2;
-    ++result;
-  }
-
-  while (first3 != last3) {
-    // Here's an element in list 3 that is not lists 1 or 2.
-    OUTPUT_CC_ELEM("3", (*first3).first);
-
-    *result = pair<TypeHandle, NodeTransitionCacheEntry>
-      ((*first3).first, 
-       NodeTransitionCacheEntry::cached_compose
-       (NodeTransitionCacheEntry(),
-	NodeTransitionCacheEntry(),
-	(*first3).second, 
-	now));
-    ++first3;
-    ++result;
-  }
-
-  return result;
-}
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: tmap_apply
-//  Description: Accepts a NodeAttribute map and a NodeTransition map,
-//               and builds a new list (a NodeAttribute map) which
-//               represents the memberwise application of the two
-//               input maps.
-////////////////////////////////////////////////////////////////////
-template<class InputIterator1, class InputIterator2, class OutputIterator>
-OutputIterator
-tmap_apply(InputIterator1 first1, InputIterator1 last1,
-	   InputIterator2 first2, InputIterator2 last2,
-	   OutputIterator result) {
-  while (first1 != last1 && first2 != last2) {
-    if ((*first1).first < (*first2).first) {
-      *result = *first1;
-      ++first1;
-      ++result;
-    } else if ((*first2).first < (*first1).first) {
-      *result = pair<TypeHandle,  PT(NodeAttribute) >
-	((*first2).first, 
-	 NodeTransitionCacheEntry::apply(NULL, (*first2).second));
-      ++first2;
-      ++result;
-    } else {
-      *result = pair<TypeHandle,  PT(NodeAttribute) >
-	((*first1).first, 
-	 NodeTransitionCacheEntry::apply((*first1).second, (*first2).second));
-      ++first1;
-      ++first2;
-      ++result;
-    }
-  }
-
-  while (first1 != last1) {
-    *result = *first1;
-    ++first1;
-    ++result;
-  }
-
-  while (first2 != last2) { 
-    *result = pair<TypeHandle,  PT(NodeAttribute) >
-      ((*first2).first, 
-       NodeTransitionCacheEntry::apply(NULL, (*first2).second));
-    ++first2;
-    ++result;
-  }
-  return result;
-}
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: tmap_invert
-//  Description: Accepts a NodeTransition map, and builds a new list
-//               which represents the memberwise inversion of the
-//               input.  Guarantees that the new list will have
-//               exactly the same length as the input list.
-////////////////////////////////////////////////////////////////////
-template<class InputIterator, class OutputIterator>
-OutputIterator
-tmap_invert(InputIterator first, InputIterator last,
-	    OutputIterator result) {
-  while (first != last) {
-    *result = pair<TypeHandle, NodeTransitionCacheEntry>
-      ((*first).first, NodeTransitionCacheEntry::invert((*first).second));
-    ++first;
-    ++result;
-  }
-  return result;
-}
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: tmap_equiv_trans
-//  Description: Accepts a pair of NodeTransition maps, and returns
-//               true if they are equivalent, false otherwise.  Two
-//               NodeTransition maps are defined to be equivalent if
-//               all nonidentity members present in one set are
-//               present and equivalent in the other set,
-////////////////////////////////////////////////////////////////////
-template<class InputIterator1, class InputIterator2>
-bool
-tmap_equiv_trans(InputIterator1 first1, InputIterator1 last1,
-		 InputIterator2 first2, InputIterator2 last2) {
-  while (first1 != last1 && first2 != last2) {
-    if ((*first1).first < (*first2).first) {
-      if (!(*first1).second.is_identity()) {
-	return false;
-      }
-      ++first1;
-    } else if ((*first2).first < (*first1).first) {
-      if (!(*first2).second.is_identity()) {
-	return false;
-      }
-      ++first2;
-    } else {
-      if (!(*first1).second.compare_to((*first2).second) == 0) {
-	return false;
-      }
-      ++first1;
-      ++first2;
-    }
-  }
-
-  while (first1 != last1) {
-    if (!(*first1).second.is_identity()) {
-      return false;
-    }
-    ++first1;
-  }
-
-  while (first2 != last2) { 
-    if (!(*first2).second.is_identity()) {
-      return false;
-    }
-    ++first2;
-  }
-  return true;
-}
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: tmap_equiv_attr
-//  Description: Accepts a pair of NodeAttribute maps, and returns
-//               true if they are equivalent, false otherwise.  Two
-//               NodeAttributes maps are defined to be equivalent if
-//               all non-NULL members present in one set are present
-//               and equivalent in the other set,
-////////////////////////////////////////////////////////////////////
-template<class InputIterator1, class InputIterator2>
-bool
-tmap_equiv_attr(InputIterator1 first1, InputIterator1 last1,
-		InputIterator2 first2, InputIterator2 last2) {
-  while (first1 != last1 && first2 != last2) {
-    if ((*first1).first < (*first2).first) {
-      if ((*first1).second != (NodeAttribute *)NULL) {
-	return false;
-      }
-      ++first1;
-    } else if ((*first2).first < (*first1).first) {
-      if ((*first2).second != (NodeAttribute *)NULL) {
-	return false;
-      }
-      ++first2;
-    } else {
-      if ((*first1).second != (*first2).second) {
-	if ((*first1).second == (NodeAttribute *)NULL ||
-	    (*first2).second == (NodeAttribute *)NULL ||
-	    (*first1).second->compare_to((*first2).second) != 0) {
-	  return false;
-	}
-      }
-      ++first1;
-      ++first2;
-    }
-  }
-
-  while (first1 != last1) {
-    if ((*first1).second != (NodeAttribute *)NULL) {
-      return false;
-    }
-    ++first1;
-  }
-
-  while (first2 != last2) { 
-    if ((*first2).second != (NodeAttribute *)NULL) {
-      return false;
-    }
-    ++first2;
-  }
-  return true;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: tmap_compare_cache
-//  Description: Accepts a pair of NodeTransition maps, and returns
-//               -1 if the first one sorts before the second one,
-//               1 if it sorts after, or 0 if they are equivalent.
-////////////////////////////////////////////////////////////////////
-template<class InputIterator1, class InputIterator2>
-int
-tmap_compare_cache(InputIterator1 first1, InputIterator1 last1,
-		   InputIterator2 first2, InputIterator2 last2) {
-  while (first1 != last1 && first2 != last2) {
-    if ((*first1).first < (*first2).first) {
-      if (!(*first1).second.is_identity()) {
-	return 1;
-      }
-      ++first1;
-    } else if ((*first2).first < (*first1).first) {
-      if (!(*first2).second.is_identity()) {
-	return -1;
-      }
-      ++first2;
-    } else {
-      int result;
-      result = (*first1).second.compare_to((*first2).second);
-      if (result != 0) {
-	return result;
-      }
-      ++first1;
-      ++first2;
-    }
-  }
-
-  while (first1 != last1) {
-    if (!(*first1).second.is_identity()) {
-      // list1 is longer.
-      return -1;
-    }
-    ++first1;
-  }
-
-  while (first2 != last2) { 
-    if (!(*first2).second.is_identity()) {
-      // list2 is longer.
-      return 1;
-    }
-    ++first2;
-  }
-
-  return 0;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: tmap_compare_trans
-//  Description: Accepts a pair of NodeTransition maps, and returns
-//               -1 if the first one sorts before the second one,
-//               1 if it sorts after, or 0 if they are equivalent.
-////////////////////////////////////////////////////////////////////
-template<class InputIterator1, class InputIterator2>
-int
-tmap_compare_trans(InputIterator1 first1, InputIterator1 last1,
-		   InputIterator2 first2, InputIterator2 last2) {
-  while (first1 != last1 && first2 != last2) {
-    if ((*first1).first < (*first2).first) {
-      if ((*first1).second != (NodeTransition *)NULL) {
-	return 1;
-      }
-      ++first1;
-    } else if ((*first2).first < (*first1).first) {
-      if ((*first2).second != (NodeTransition *)NULL) {
-	return -1;
-      }
-      ++first2;
-    } else {
-      if ((*first1).second != (*first2).second) {
-	if ((*first1).second == (NodeTransition *)NULL) {
-	  return -1;
-	} else if ((*first2).second == (NodeTransition *)NULL) {
-	  return 1;
-	} else {
-	  int result;
-	  result = (*first1).second->compare_to(*(*first2).second);
-	  if (result != 0) {
-	    return result;
-	  }
-	}
-      }
-      ++first1;
-      ++first2;
-    }
-  }
-
-  while (first1 != last1) {
-    if ((*first1).second != (NodeTransition *)NULL) {
-      // list1 is longer.
-      return -1;
-    }
-    ++first1;
-  }
-
-  while (first2 != last2) { 
-    if ((*first2).second != (NodeTransition *)NULL) {
-      // list2 is longer.
-      return 1;
-    }
-    ++first2;
-  }
-
-  return 0;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: tmap_compare_attr
-//  Description: Accepts a pair of NodeAttribute maps, and returns
-//               -1 if the first one sorts before the second one,
-//               1 if it sorts after, or 0 if they are equivalent.
-////////////////////////////////////////////////////////////////////
-template<class InputIterator1, class InputIterator2>
-int
-tmap_compare_attr(InputIterator1 first1, InputIterator1 last1,
-		  InputIterator2 first2, InputIterator2 last2) {
-  while (first1 != last1 && first2 != last2) {
-    if ((*first1).first < (*first2).first) {
-      if ((*first1).second != (NodeAttribute *)NULL) {
-	return 1;
-      }
-      ++first1;
-    } else if ((*first2).first < (*first1).first) {
-      if ((*first2).second != (NodeAttribute *)NULL) {
-	return -1;
-      }
-      ++first2;
-    } else {
-      if ((*first1).second != (*first2).second) {
-	if ((*first1).second == (NodeAttribute *)NULL) {
-	  return -1;
-	} else if ((*first2).second == (NodeAttribute *)NULL) {
-	  return 1;
-	} else {
-	  int result;
-	  result = (*first1).second->compare_to(*(*first2).second);
-	  if (result != 0) {
-	    return result;
-	  }
-	}
-      }
-      ++first1;
-      ++first2;
-    }
-  }
-
-  while (first1 != last1) {
-    if ((*first1).second != (NodeAttribute *)NULL) {
-      // list1 is longer.
-      return -1;
-    }
-    ++first1;
-  }
-
-  while (first2 != last2) { 
-    if ((*first2).second != (NodeAttribute *)NULL) {
-      // list2 is longer.
-      return 1;
-    }
-    ++first2;
-  }
-
-  return 0;
-}
-
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: tmap_is_identity
-//  Description: Accepts a NodeTransition map, and returns true if all
-//               elements in the map correspond to the identity
-//               transition, false otherwise.
-////////////////////////////////////////////////////////////////////
-template<class InputIterator>
-bool
-tmap_is_identity(InputIterator first, InputIterator last) {
-  while (first != last) {
-    if (!(*first).second.is_identity()) {
-      return false;
-    }
-    ++first;
-  }
-  return true;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: tmap_is_initial
-//  Description: Accepts a NodeAttribute map, and returns true if all
-//               elements in the map correspond to the initial
-//               attribute, false otherwise.
-////////////////////////////////////////////////////////////////////
-template<class InputIterator>
-bool
-tmap_is_initial(InputIterator first, InputIterator last) {
-  while (first != last) {
-    if (!(*first).second.is_initial()) {
-      return false;
-    }
-    ++first;
-  }
-  return true;
-}
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: tmap_output
-//  Description: Accepts a NodeTransition or NodeAttribute map and
-//               writes each element to the given output stream with a
-//               single space separating them.
-////////////////////////////////////////////////////////////////////
-template<class InputIterator>
-ostream &
-tmap_output(InputIterator first, InputIterator last, ostream &out) {
-  if (first != last) {
-    out << *((*first).second);
-    ++first;
-    while (first != last) {
-      out << " " << *((*first).second);
-      ++first;
-    }
-  }
-  return out;
-}

+ 0 - 57
panda/src/graph/traverserVisitor.I

@@ -1,57 +0,0 @@
-// Filename: traverserVisitor.I
-// Created by:  drose (20Mar00)
-// 
-////////////////////////////////////////////////////////////////////
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: TraverserVisitor::reached_node
-//       Access: Public
-//  Description: Called for each node visited.  It may return true if
-//               the traversal is to be continued, or false if it
-//               should be pruned at this node.
-////////////////////////////////////////////////////////////////////
-template<class TW, class LevelState>
-INLINE_GRAPH bool TraverserVisitor<TW, LevelState>::
-reached_node(Node *, 
-	     TraverserVisitor<TW, LevelState>::AttributeWrapper &,
-	     LevelState &) {
-  return true;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: TraverserVisitor::reached_node
-//       Access: Public
-//  Description: Called each time an arc is traversed in the forward
-//               direction.  As above, it may return true if the
-//               traversal should continue, or false if it should be
-//               pruned and not reach the destination node.
-////////////////////////////////////////////////////////////////////
-template<class TW, class LevelState>
-INLINE_GRAPH bool TraverserVisitor<TW, LevelState>:: 
-forward_arc(NodeRelation *, 
-	    TraverserVisitor<TW, LevelState>::TransitionWrapper &,
-	    TraverserVisitor<TW, LevelState>::AttributeWrapper &, 
-	    TraverserVisitor<TW, LevelState>::AttributeWrapper &,
-	    LevelState &) {
-  return true;
-}
-
-
-////////////////////////////////////////////////////////////////////
-//     Function: TraverserVisitor::reached_node
-//       Access: Public
-//  Description: Called each time an arc is traversed in the backward
-//               direction.  It is guaranteed to be paired stack-wise
-//               with the corresponding call to forward_arc, so that
-//               each call to backward_arc matches the previous
-//               unmatched call to forward_arc.
-////////////////////////////////////////////////////////////////////
-template<class TW, class LevelState>
-INLINE_GRAPH void TraverserVisitor<TW, LevelState>::
-backward_arc(NodeRelation *, 
-	     TraverserVisitor<TW, LevelState>::TransitionWrapper &,
-	     TraverserVisitor<TW, LevelState>::AttributeWrapper &, 
-	     TraverserVisitor<TW, LevelState>::AttributeWrapper &,
-	     const LevelState &) {
-}