diff --git a/panda/src/graph/nodeRelation.I b/panda/src/graph/nodeRelation.I index cb386c8206..ec14e3542a 100644 --- a/panda/src/graph/nodeRelation.I +++ b/panda/src/graph/nodeRelation.I @@ -160,37 +160,6 @@ set_graph_type(TypeHandle graph_type) { attach(); } -//////////////////////////////////////////////////////////////////// -// Function: NodeRelation::set_transition -// Access: Public -// Description: This flavor of set_transition() accepts a specific -// TypeHandle, indicating the type of transition that we -// are setting, and a NodeTransition pointer indicating -// the value of the transition. The NodeTransition may -// be NULL indicating that the transition should be -// cleared. If the NodeTransition is not NULL, it must -// match the type indicated by the TypeHandle. -// -// The return value is a pointer to the *previous* -// transition in the set, if any, or NULL if there was -// none. -//////////////////////////////////////////////////////////////////// -INLINE PT(NodeTransition) NodeRelation:: -set_transition(TypeHandle handle, NodeTransition *trans) { - PT(NodeTransition) old_trans = - _transitions.set_transition(handle, trans); - - if (old_trans != (NodeTransition *)NULL) { - old_trans->removed_from_arc(this); - } - if (trans != (NodeTransition *)NULL) { - trans->added_to_arc(this); - } - - changed_transition(handle); - return old_trans; -} - //////////////////////////////////////////////////////////////////// // Function: NodeRelation::set_transition // Access: Public @@ -229,28 +198,6 @@ set_transition(NodeTransition *trans, int priority) { return set_transition(trans->get_handle(), trans); } -//////////////////////////////////////////////////////////////////// -// Function: NodeRelation::clear_transition -// Access: Public -// Description: Removes any transition associated with the indicated -// handle from the arc. -// -// The return value is a pointer to the previous -// transition in the set, if any, or NULL if there was -// none. -//////////////////////////////////////////////////////////////////// -INLINE PT(NodeTransition) NodeRelation:: -clear_transition(TypeHandle handle) { - PT(NodeTransition) old_trans = - _transitions.clear_transition(handle); - if (old_trans != (NodeTransition *)NULL) { - old_trans->removed_from_arc(this); - } - - changed_transition(handle); - return old_trans; -} - //////////////////////////////////////////////////////////////////// // Function: NodeRelation::has_transition // Access: Public diff --git a/panda/src/graph/nodeRelation.cxx b/panda/src/graph/nodeRelation.cxx index 3d2cbe8a2c..1402ffaf66 100644 --- a/panda/src/graph/nodeRelation.cxx +++ b/panda/src/graph/nodeRelation.cxx @@ -1019,3 +1019,57 @@ force_init_type() { init_type(); return get_class_type(); } + +//////////////////////////////////////////////////////////////////// +// Function: NodeRelation::set_transition +// Access: Public +// Description: This flavor of set_transition() accepts a specific +// TypeHandle, indicating the type of transition that we +// are setting, and a NodeTransition pointer indicating +// the value of the transition. The NodeTransition may +// be NULL indicating that the transition should be +// cleared. If the NodeTransition is not NULL, it must +// match the type indicated by the TypeHandle. +// +// The return value is a pointer to the *previous* +// transition in the set, if any, or NULL if there was +// none. +//////////////////////////////////////////////////////////////////// +PT(NodeTransition) NodeRelation:: +set_transition(TypeHandle handle, NodeTransition *trans) { + PT(NodeTransition) old_trans = + _transitions.set_transition(handle, trans); + + if (old_trans != (NodeTransition *)NULL) { + old_trans->removed_from_arc(this); + } + if (trans != (NodeTransition *)NULL) { + trans->added_to_arc(this); + } + + changed_transition(handle); + return old_trans; +} + +//////////////////////////////////////////////////////////////////// +// Function: NodeRelation::clear_transition +// Access: Public +// Description: Removes any transition associated with the indicated +// handle from the arc. +// +// The return value is a pointer to the previous +// transition in the set, if any, or NULL if there was +// none. +//////////////////////////////////////////////////////////////////// +PT(NodeTransition) NodeRelation:: +clear_transition(TypeHandle handle) { + PT(NodeTransition) old_trans = + _transitions.clear_transition(handle); + if (old_trans != (NodeTransition *)NULL) { + old_trans->removed_from_arc(this); + } + + changed_transition(handle); + return old_trans; +} + diff --git a/panda/src/graph/nodeRelation.h b/panda/src/graph/nodeRelation.h index d9289f9395..c5cfa7feb0 100644 --- a/panda/src/graph/nodeRelation.h +++ b/panda/src/graph/nodeRelation.h @@ -88,11 +88,11 @@ PUBLISHED: INLINE void set_sort(int sort); INLINE void set_graph_type(TypeHandle graph_type); - INLINE PT(NodeTransition) set_transition(TypeHandle handle, - NodeTransition *trans); + PT(NodeTransition) set_transition(TypeHandle handle, NodeTransition *trans); /*DONT INLINE THIS*/ INLINE PT(NodeTransition) set_transition(NodeTransition *trans); INLINE PT(NodeTransition) set_transition(NodeTransition *trans, int priority); - INLINE PT(NodeTransition) clear_transition(TypeHandle handle); + PT(NodeTransition) clear_transition(TypeHandle handle); /*DONT INLINE THIS*/ + INLINE bool has_transition(TypeHandle handle) const; INLINE bool has_any_transition() const; INLINE NodeTransition *get_transition(TypeHandle handle) const;