make graph be un-inlined for dll's other than panda
This commit is contained in:
parent
28b5f9e924
commit
5251fa5667
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include <collideMask.h>
|
||||
|
||||
class NodeRelation;
|
||||
#include "nodeRelation.h"
|
||||
class Node;
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -6,78 +6,119 @@
|
|||
#define LOCAL_LIBS \
|
||||
putil mathutil
|
||||
|
||||
#define SOURCES \
|
||||
allAttributesWrapper.I allAttributesWrapper.cxx \
|
||||
allAttributesWrapper.h allTransitionsWrapper.I \
|
||||
allTransitionsWrapper.cxx allTransitionsWrapper.h \
|
||||
arcChain.I arcChain.cxx arcChain.h \
|
||||
bitMask32Transition.cxx bitMask32Transition.h \
|
||||
bitMaskAttribute.I bitMaskAttribute.h \
|
||||
bitMaskTransition.I bitMaskTransition.h \
|
||||
boundedObject.I \
|
||||
boundedObject.N boundedObject.cxx boundedObject.h config_graph.cxx \
|
||||
config_graph.h graphReducer.cxx graphReducer.h immediateAttribute.I \
|
||||
immediateAttribute.cxx immediateAttribute.h immediateTransition.I \
|
||||
immediateTransition.cxx immediateTransition.h \
|
||||
lmatrix4fTransition.cxx lmatrix4fTransition.h \
|
||||
matrixAttribute.I matrixAttribute.h matrixTransition.I \
|
||||
matrixTransition.h \
|
||||
multiAttribute.I multiAttribute.h \
|
||||
multiNodeAttribute.I \
|
||||
multiNodeAttribute.cxx multiNodeAttribute.h multiNodeTransition.I \
|
||||
multiNodeTransition.cxx multiNodeTransition.h \
|
||||
multiTransition.I multiTransition.h multiTransitionHelpers.I \
|
||||
multiTransitionHelpers.h namedNode.I \
|
||||
namedNode.cxx namedNode.h node.I node.cxx node.h nodeAttribute.I \
|
||||
nodeAttribute.N nodeAttribute.cxx nodeAttribute.h \
|
||||
nodeAttributeWrapper.I nodeAttributeWrapper.cxx \
|
||||
nodeAttributeWrapper.h nodeAttributes.I nodeAttributes.N \
|
||||
nodeAttributes.cxx nodeAttributes.h nodeRelation.I nodeRelation.N \
|
||||
nodeRelation.cxx nodeRelation.h nodeTransition.I nodeTransition.N \
|
||||
nodeTransition.cxx nodeTransition.h nodeTransitionCache.I \
|
||||
nodeTransitionCache.cxx nodeTransitionCache.h \
|
||||
nodeTransitionCacheEntry.I nodeTransitionCacheEntry.cxx \
|
||||
nodeTransitionCacheEntry.h nodeTransitionWrapper.I \
|
||||
nodeTransitionWrapper.cxx nodeTransitionWrapper.h nodeTransitions.I \
|
||||
nodeTransitions.cxx nodeTransitions.h nullAttributeWrapper.I \
|
||||
nullAttributeWrapper.cxx nullAttributeWrapper.h nullLevelState.cxx \
|
||||
nullLevelState.h nullTransitionWrapper.I nullTransitionWrapper.cxx \
|
||||
nullTransitionWrapper.h onAttribute.I onAttribute.cxx onAttribute.h \
|
||||
onOffAttribute.I onOffAttribute.cxx onOffAttribute.h \
|
||||
onOffTransition.I onOffTransition.cxx onOffTransition.h \
|
||||
onTransition.I onTransition.cxx onTransition.h pt_NamedNode.N \
|
||||
pt_NamedNode.cxx pt_NamedNode.h pt_Node.N pt_Node.cxx pt_Node.h \
|
||||
setTransitionHelpers.I setTransitionHelpers.h \
|
||||
traverserVisitor.I traverserVisitor.h \
|
||||
vector_PT_Node.cxx vector_PT_Node.h wrt.I wrt.h wrt.cxx
|
||||
#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 \
|
||||
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 \
|
||||
nodeAttributeWrapper.cxx vector_PT_Node.h \
|
||||
nodeAttributeWrapper.h wrt.I \
|
||||
nodeAttributes.I wrt.cxx \
|
||||
nodeAttributes.N wrt.h
|
||||
|
||||
|
||||
#define INSTALL_HEADERS \
|
||||
allAttributesWrapper.I allAttributesWrapper.h \
|
||||
allTransitionsWrapper.I allTransitionsWrapper.h \
|
||||
arcChain.I arcChain.h \
|
||||
bitMask32Transition.h bitMaskAttribute.I bitMaskAttribute.h \
|
||||
bitMaskTransition.I bitMaskTransition.h boundedObject.I \
|
||||
boundedObject.h config_graph.h dftraverser.I dftraverser.h \
|
||||
graphReducer.h immediateAttribute.I immediateAttribute.h \
|
||||
immediateTransition.I immediateTransition.h lmatrix4fTransition.h \
|
||||
matrixAttribute.I matrixAttribute.h matrixTransition.I \
|
||||
matrixTransition.h multiAttribute.I multiAttribute.h \
|
||||
multiNodeAttribute.I multiNodeAttribute.h multiNodeTransition.I \
|
||||
multiNodeTransition.h multiTransition.I multiTransition.h \
|
||||
multiTransitionHelpers.I multiTransitionHelpers.h namedNode.I \
|
||||
namedNode.h node.I node.h nodeAttribute.I nodeAttribute.h \
|
||||
nodeAttributeWrapper.I nodeAttributeWrapper.h nodeAttributes.I \
|
||||
nodeAttributes.h nodeRelation.I nodeRelation.h nodeTransition.I \
|
||||
nodeTransition.h nodeTransitionCache.I nodeTransitionCache.h \
|
||||
nodeTransitionCacheEntry.I nodeTransitionCacheEntry.h \
|
||||
nodeTransitionWrapper.I nodeTransitionWrapper.h nodeTransitions.I \
|
||||
nodeTransitions.h nullAttributeWrapper.I nullAttributeWrapper.h \
|
||||
nullLevelState.h nullTransitionWrapper.I nullTransitionWrapper.h \
|
||||
onAttribute.I onAttribute.h onOffAttribute.I onOffAttribute.h \
|
||||
onOffTransition.I onOffTransition.h onTransition.I onTransition.h \
|
||||
pointerNameClass.h pt_NamedNode.h pt_Node.h transitionDirection.h \
|
||||
traverserVisitor.I traverserVisitor.h vector_PT_Node.h wrt.I wrt.h
|
||||
|
||||
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 \
|
||||
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
|
||||
|
||||
#define IGATESCAN all
|
||||
|
||||
#end lib_target
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE AllAttributesWrapper::
|
||||
INLINE_GRAPH AllAttributesWrapper::
|
||||
AllAttributesWrapper() {
|
||||
}
|
||||
|
||||
|
|
@ -17,7 +17,7 @@ AllAttributesWrapper() {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE AllAttributesWrapper::
|
||||
INLINE_GRAPH AllAttributesWrapper::
|
||||
AllAttributesWrapper(const NodeAttributes &attrib) :
|
||||
_attrib(attrib)
|
||||
{
|
||||
|
|
@ -28,7 +28,7 @@ AllAttributesWrapper(const NodeAttributes &attrib) :
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE AllAttributesWrapper::
|
||||
INLINE_GRAPH AllAttributesWrapper::
|
||||
AllAttributesWrapper(const AllAttributesWrapper ©) :
|
||||
_attrib(copy._attrib)
|
||||
{
|
||||
|
|
@ -39,7 +39,7 @@ AllAttributesWrapper(const AllAttributesWrapper ©) :
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void AllAttributesWrapper::
|
||||
INLINE_GRAPH void AllAttributesWrapper::
|
||||
operator = (const AllAttributesWrapper ©) {
|
||||
_attrib = copy._attrib;
|
||||
}
|
||||
|
|
@ -51,7 +51,7 @@ operator = (const AllAttributesWrapper ©) {
|
|||
// AllAttributesWrapper ready to access the same type
|
||||
// of AllAttributes as the other.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE AllAttributesWrapper AllAttributesWrapper::
|
||||
INLINE_GRAPH AllAttributesWrapper AllAttributesWrapper::
|
||||
init_from(const AllTransitionsWrapper &) {
|
||||
return AllAttributesWrapper();
|
||||
}
|
||||
|
|
@ -61,7 +61,7 @@ init_from(const AllTransitionsWrapper &) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE AllAttributesWrapper::
|
||||
INLINE_GRAPH AllAttributesWrapper::
|
||||
~AllAttributesWrapper() {
|
||||
}
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ INLINE AllAttributesWrapper::
|
|||
// the set, or false if there are any (even initial)
|
||||
// Attributes.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool AllAttributesWrapper::
|
||||
INLINE_GRAPH bool AllAttributesWrapper::
|
||||
is_empty() const {
|
||||
return _attrib.is_empty();
|
||||
}
|
||||
|
|
@ -92,7 +92,7 @@ is_empty() const {
|
|||
// attribute in the set, if any, or NULL if there was
|
||||
// none.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE PT(NodeAttribute) AllAttributesWrapper::
|
||||
INLINE_GRAPH PT(NodeAttribute) AllAttributesWrapper::
|
||||
set_attribute(TypeHandle handle, NodeAttribute *trans) {
|
||||
return _attrib.set_attribute(handle, trans);
|
||||
}
|
||||
|
|
@ -107,7 +107,7 @@ set_attribute(TypeHandle handle, NodeAttribute *trans) {
|
|||
// set_attribute; if the pointer might be NULL, use the
|
||||
// above flavor instead (or just call clear_attribute).
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE PT(NodeAttribute) AllAttributesWrapper::
|
||||
INLINE_GRAPH PT(NodeAttribute) AllAttributesWrapper::
|
||||
set_attribute(NodeAttribute *trans) {
|
||||
nassertr(trans != (NodeAttribute *)NULL, NULL);
|
||||
nassertr(trans->get_handle() != TypeHandle::none(), NULL);
|
||||
|
|
@ -124,7 +124,7 @@ set_attribute(NodeAttribute *trans) {
|
|||
// attribute in the set, if any, or NULL if there was
|
||||
// none.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE PT(NodeAttribute) AllAttributesWrapper::
|
||||
INLINE_GRAPH PT(NodeAttribute) AllAttributesWrapper::
|
||||
clear_attribute(TypeHandle handle) {
|
||||
return _attrib.clear_attribute(handle);
|
||||
}
|
||||
|
|
@ -136,7 +136,7 @@ clear_attribute(TypeHandle handle) {
|
|||
// indicated handle has been stored in the set (even if
|
||||
// it is the initial attribute), or false otherwise.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool AllAttributesWrapper::
|
||||
INLINE_GRAPH bool AllAttributesWrapper::
|
||||
has_attribute(TypeHandle handle) const {
|
||||
return _attrib.has_attribute(handle);
|
||||
}
|
||||
|
|
@ -148,7 +148,7 @@ has_attribute(TypeHandle handle) const {
|
|||
// handle, or NULL if no such attribute has been stored
|
||||
// in the set.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeAttribute *AllAttributesWrapper::
|
||||
INLINE_GRAPH NodeAttribute *AllAttributesWrapper::
|
||||
get_attribute(TypeHandle handle) const {
|
||||
return _attrib.get_attribute(handle);
|
||||
}
|
||||
|
|
@ -159,7 +159,7 @@ get_attribute(TypeHandle handle) const {
|
|||
// Description: Returns the entire set of attributes associated with
|
||||
// the wrapper.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE const NodeAttributes &AllAttributesWrapper::
|
||||
INLINE_GRAPH const NodeAttributes &AllAttributesWrapper::
|
||||
get_attributes() const {
|
||||
return _attrib;
|
||||
}
|
||||
|
|
@ -170,7 +170,7 @@ get_attributes() const {
|
|||
// Description: Returns the entire set of attributes associated with
|
||||
// the wrapper.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeAttributes &AllAttributesWrapper::
|
||||
INLINE_GRAPH NodeAttributes &AllAttributesWrapper::
|
||||
get_attributes() {
|
||||
return _attrib;
|
||||
}
|
||||
|
|
@ -181,7 +181,7 @@ get_attributes() {
|
|||
// Description: Returns true if the wrapper represents an initial
|
||||
// attribute.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool AllAttributesWrapper::
|
||||
INLINE_GRAPH bool AllAttributesWrapper::
|
||||
is_initial() const {
|
||||
return _attrib.is_initial();
|
||||
}
|
||||
|
|
@ -191,7 +191,7 @@ is_initial() const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE int AllAttributesWrapper::
|
||||
INLINE_GRAPH int AllAttributesWrapper::
|
||||
compare_to(const AllAttributesWrapper &other) const {
|
||||
return _attrib.compare_to(other._attrib);
|
||||
}
|
||||
|
|
@ -201,31 +201,12 @@ compare_to(const AllAttributesWrapper &other) const {
|
|||
// Access: Public
|
||||
// Description: Resets the wrapper to the initial attribute.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void AllAttributesWrapper::
|
||||
INLINE_GRAPH void AllAttributesWrapper::
|
||||
make_initial() {
|
||||
_attrib.clear();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: get_attribute_into
|
||||
// Description: This external template function is handy for
|
||||
// extracting a attribute of a particular type from the
|
||||
// set. If the attribute exists, it is automatically
|
||||
// downcasted to the correct type and stored in the
|
||||
// pointer given in the first parameter, and the return
|
||||
// value is true. If the attribute does not exist, the
|
||||
// pointer is filled with NULL and the return value is
|
||||
// false.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Attribute>
|
||||
INLINE bool
|
||||
get_attribute_into(Attribute *&ptr, const AllAttributesWrapper &attrib,
|
||||
TypeHandle transition_type) {
|
||||
NodeAttribute *nt = attrib.get_attribute(transition_type);
|
||||
if (nt == (NodeAttribute *)NULL) {
|
||||
ptr = (Attribute *)NULL;
|
||||
return false;
|
||||
}
|
||||
DCAST_INTO_R(ptr, nt, false);
|
||||
return true;
|
||||
INLINE_GRAPH ostream &operator << (ostream &out, const AllAttributesWrapper &a) {
|
||||
a.output(out);
|
||||
return out;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
// Filename: allAttributesWrapper.T
|
||||
// Created by: drose (21Mar00)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: get_attribute_into
|
||||
// Description: This external template function is handy for
|
||||
// extracting a attribute of a particular type from the
|
||||
// set. If the attribute exists, it is automatically
|
||||
// downcasted to the correct type and stored in the
|
||||
// pointer given in the first parameter, and the return
|
||||
// value is true. If the attribute does not exist, the
|
||||
// pointer is filled with NULL and the return value is
|
||||
// false.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Attribute>
|
||||
INLINE_GRAPH bool
|
||||
get_attribute_into(Attribute *&ptr, const AllAttributesWrapper &attrib,
|
||||
TypeHandle transition_type) {
|
||||
NodeAttribute *nt = attrib.get_attribute(transition_type);
|
||||
if (nt == (NodeAttribute *)NULL) {
|
||||
ptr = (Attribute *)NULL;
|
||||
return false;
|
||||
}
|
||||
DCAST_INTO_R(ptr, nt, false);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -24,29 +24,29 @@ public:
|
|||
typedef AllTransitionsWrapper TransitionWrapper;
|
||||
typedef AllAttributesWrapper AttributeWrapper;
|
||||
|
||||
INLINE AllAttributesWrapper();
|
||||
INLINE AllAttributesWrapper(const NodeAttributes &attrib);
|
||||
INLINE AllAttributesWrapper(const AllAttributesWrapper ©);
|
||||
INLINE void operator = (const AllAttributesWrapper ©);
|
||||
INLINE static AllAttributesWrapper
|
||||
INLINE_GRAPH AllAttributesWrapper();
|
||||
INLINE_GRAPH AllAttributesWrapper(const NodeAttributes &attrib);
|
||||
INLINE_GRAPH AllAttributesWrapper(const AllAttributesWrapper ©);
|
||||
INLINE_GRAPH void operator = (const AllAttributesWrapper ©);
|
||||
INLINE_GRAPH static AllAttributesWrapper
|
||||
init_from(const AllTransitionsWrapper &trans);
|
||||
INLINE ~AllAttributesWrapper();
|
||||
INLINE_GRAPH ~AllAttributesWrapper();
|
||||
|
||||
INLINE bool is_empty() const;
|
||||
INLINE PT(NodeAttribute) set_attribute(TypeHandle handle,
|
||||
INLINE_GRAPH bool is_empty() const;
|
||||
INLINE_GRAPH PT(NodeAttribute) set_attribute(TypeHandle handle,
|
||||
NodeAttribute *trans);
|
||||
INLINE PT(NodeAttribute) set_attribute(NodeAttribute *trans);
|
||||
INLINE PT(NodeAttribute) clear_attribute(TypeHandle handle);
|
||||
INLINE bool has_attribute(TypeHandle handle) const;
|
||||
INLINE NodeAttribute *get_attribute(TypeHandle handle) const;
|
||||
INLINE_GRAPH PT(NodeAttribute) set_attribute(NodeAttribute *trans);
|
||||
INLINE_GRAPH PT(NodeAttribute) clear_attribute(TypeHandle handle);
|
||||
INLINE_GRAPH bool has_attribute(TypeHandle handle) const;
|
||||
INLINE_GRAPH NodeAttribute *get_attribute(TypeHandle handle) const;
|
||||
|
||||
INLINE const NodeAttributes &get_attributes() const;
|
||||
INLINE NodeAttributes &get_attributes();
|
||||
INLINE_GRAPH const NodeAttributes &get_attributes() const;
|
||||
INLINE_GRAPH NodeAttributes &get_attributes();
|
||||
|
||||
INLINE bool is_initial() const;
|
||||
INLINE int compare_to(const AllAttributesWrapper &other) const;
|
||||
INLINE_GRAPH bool is_initial() const;
|
||||
INLINE_GRAPH int compare_to(const AllAttributesWrapper &other) const;
|
||||
|
||||
INLINE void make_initial();
|
||||
INLINE_GRAPH void make_initial();
|
||||
void apply_in_place(const AllTransitionsWrapper &trans);
|
||||
void apply_from(const AllAttributesWrapper &other,
|
||||
const AllTransitionsWrapper &trans);
|
||||
|
|
@ -59,16 +59,12 @@ private:
|
|||
NodeAttributes _attrib;
|
||||
};
|
||||
|
||||
INLINE ostream &operator << (ostream &out, const AllAttributesWrapper &a) {
|
||||
a.output(out);
|
||||
return out;
|
||||
}
|
||||
INLINE_GRAPH ostream &operator << (ostream &out, const AllAttributesWrapper &a);
|
||||
|
||||
template<class Attribute>
|
||||
INLINE bool
|
||||
get_attribute_into(Attribute *&ptr, const AllAttributesWrapper &attrib,
|
||||
TypeHandle transition_type);
|
||||
#include "allAttributesWrapper.T"
|
||||
|
||||
#ifdef BUILDING_PANDA
|
||||
#include "allAttributesWrapper.I"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE AllTransitionsWrapper::
|
||||
INLINE_GRAPH AllTransitionsWrapper::
|
||||
AllTransitionsWrapper() {
|
||||
}
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ AllTransitionsWrapper() {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE AllTransitionsWrapper::
|
||||
INLINE_GRAPH AllTransitionsWrapper::
|
||||
AllTransitionsWrapper(const AllTransitionsWrapper ©) :
|
||||
_cache(copy._cache),
|
||||
_all_verified(copy._all_verified)
|
||||
|
|
@ -31,7 +31,7 @@ AllTransitionsWrapper(const AllTransitionsWrapper ©) :
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void AllTransitionsWrapper::
|
||||
INLINE_GRAPH void AllTransitionsWrapper::
|
||||
operator = (const AllTransitionsWrapper ©) {
|
||||
_cache = copy._cache;
|
||||
_all_verified = copy._all_verified;
|
||||
|
|
@ -42,7 +42,7 @@ operator = (const AllTransitionsWrapper ©) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE AllTransitionsWrapper::
|
||||
INLINE_GRAPH AllTransitionsWrapper::
|
||||
~AllTransitionsWrapper() {
|
||||
}
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ INLINE AllTransitionsWrapper::
|
|||
// AllTransitionsWrapper ready to access the same type
|
||||
// of NodeTransition as the other.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE AllTransitionsWrapper AllTransitionsWrapper::
|
||||
INLINE_GRAPH AllTransitionsWrapper AllTransitionsWrapper::
|
||||
init_from(const AllTransitionsWrapper &) {
|
||||
return AllTransitionsWrapper();
|
||||
}
|
||||
|
|
@ -65,7 +65,7 @@ init_from(const AllTransitionsWrapper &) {
|
|||
// AllTransitionsWrapper ready to access the same type
|
||||
// of NodeTransition as the other.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE AllTransitionsWrapper AllTransitionsWrapper::
|
||||
INLINE_GRAPH AllTransitionsWrapper AllTransitionsWrapper::
|
||||
init_from(const AllAttributesWrapper &) {
|
||||
return AllTransitionsWrapper();
|
||||
}
|
||||
|
|
@ -77,7 +77,7 @@ init_from(const AllAttributesWrapper &) {
|
|||
// the wrapper, or false if there are any (even identity)
|
||||
// Transitions.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool AllTransitionsWrapper::
|
||||
INLINE_GRAPH bool AllTransitionsWrapper::
|
||||
is_empty() const {
|
||||
return
|
||||
(_cache == (NodeTransitionCache *)NULL) ||
|
||||
|
|
@ -99,7 +99,7 @@ is_empty() const {
|
|||
// transition in the set, if any, or NULL if there was
|
||||
// none.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE PT(NodeTransition) AllTransitionsWrapper::
|
||||
INLINE_GRAPH PT(NodeTransition) AllTransitionsWrapper::
|
||||
set_transition(TypeHandle handle, NodeTransition *trans) {
|
||||
if (_cache == (NodeTransitionCache *)NULL) {
|
||||
_cache = new NodeTransitionCache;
|
||||
|
|
@ -118,7 +118,7 @@ set_transition(TypeHandle handle, NodeTransition *trans) {
|
|||
// set_transition; if the pointer might be NULL, use the
|
||||
// above flavor instead (or just call clear_transition).
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE PT(NodeTransition) AllTransitionsWrapper::
|
||||
INLINE_GRAPH PT(NodeTransition) AllTransitionsWrapper::
|
||||
set_transition(NodeTransition *trans) {
|
||||
nassertr(trans != (NodeTransition *)NULL, NULL);
|
||||
nassertr(trans->get_handle() != TypeHandle::none(), NULL);
|
||||
|
|
@ -135,7 +135,7 @@ set_transition(NodeTransition *trans) {
|
|||
// transition in the set, if any, or NULL if there was
|
||||
// none.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE PT(NodeTransition) AllTransitionsWrapper::
|
||||
INLINE_GRAPH PT(NodeTransition) AllTransitionsWrapper::
|
||||
clear_transition(TypeHandle handle) {
|
||||
if (_cache == (NodeTransitionCache *)NULL) {
|
||||
return NULL;
|
||||
|
|
@ -151,7 +151,7 @@ clear_transition(TypeHandle handle) {
|
|||
// indicated handle has been stored in the wrapper, or
|
||||
// false otherwise.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool AllTransitionsWrapper::
|
||||
INLINE_GRAPH bool AllTransitionsWrapper::
|
||||
has_transition(TypeHandle handle) const {
|
||||
if (_cache == (NodeTransitionCache *)NULL) {
|
||||
return false;
|
||||
|
|
@ -166,7 +166,7 @@ has_transition(TypeHandle handle) const {
|
|||
// handle, or NULL if no such transition has been stored
|
||||
// in the wrapper.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeTransition *AllTransitionsWrapper::
|
||||
INLINE_GRAPH NodeTransition *AllTransitionsWrapper::
|
||||
get_transition(TypeHandle handle) const {
|
||||
if (_cache == (NodeTransitionCache *)NULL) {
|
||||
return NULL;
|
||||
|
|
@ -181,7 +181,7 @@ get_transition(TypeHandle handle) const {
|
|||
// shouldn't modify this, or probably even store it for
|
||||
// any length of time.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE const NodeTransitionCache &AllTransitionsWrapper::
|
||||
INLINE_GRAPH const NodeTransitionCache &AllTransitionsWrapper::
|
||||
get_transitions() const {
|
||||
static NodeTransitionCache empty_transitions;
|
||||
|
||||
|
|
@ -197,7 +197,7 @@ get_transitions() const {
|
|||
// Description: Returns true if the wrapper represents an identity
|
||||
// transition.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool AllTransitionsWrapper::
|
||||
INLINE_GRAPH bool AllTransitionsWrapper::
|
||||
is_identity() const {
|
||||
if (_cache == (NodeTransitionCache *)NULL) {
|
||||
return true;
|
||||
|
|
@ -210,7 +210,7 @@ is_identity() const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE int AllTransitionsWrapper::
|
||||
INLINE_GRAPH int AllTransitionsWrapper::
|
||||
compare_to(const AllTransitionsWrapper &other) const {
|
||||
if (_cache == other._cache) {
|
||||
return 0;
|
||||
|
|
@ -230,7 +230,7 @@ compare_to(const AllTransitionsWrapper &other) const {
|
|||
// Access: Public
|
||||
// Description: Resets the wrapper to the empty set.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void AllTransitionsWrapper::
|
||||
INLINE_GRAPH void AllTransitionsWrapper::
|
||||
make_identity() {
|
||||
_cache = (NodeTransitionCache *)NULL;
|
||||
}
|
||||
|
|
@ -241,7 +241,7 @@ make_identity() {
|
|||
// Description: Sets the wrapper to the set of transitions contained
|
||||
// on the arc.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void AllTransitionsWrapper::
|
||||
INLINE_GRAPH void AllTransitionsWrapper::
|
||||
extract_from(const NodeRelation *arc) {
|
||||
nassertv(arc != (NodeRelation *)NULL);
|
||||
if (arc->_transitions.is_empty()) {
|
||||
|
|
@ -257,7 +257,7 @@ extract_from(const NodeRelation *arc) {
|
|||
// Access: Public
|
||||
// Description: Stores all the transitions in the wrapper to the arc.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void AllTransitionsWrapper::
|
||||
INLINE_GRAPH void AllTransitionsWrapper::
|
||||
store_to(NodeRelation *arc) const {
|
||||
nassertv(arc != (NodeRelation *)NULL);
|
||||
NodeTransitionCache::store_to(_cache, arc, arc->_transitions);
|
||||
|
|
@ -269,7 +269,7 @@ store_to(NodeRelation *arc) const {
|
|||
// Description: Sets this transition to the composition of this
|
||||
// transition and the following one.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void AllTransitionsWrapper::
|
||||
INLINE_GRAPH void AllTransitionsWrapper::
|
||||
compose_in_place(const AllTransitionsWrapper &other) {
|
||||
_cache = NodeTransitionCache::compose(_cache, other._cache);
|
||||
_all_verified.clear();
|
||||
|
|
@ -280,7 +280,7 @@ compose_in_place(const AllTransitionsWrapper &other) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void AllTransitionsWrapper::
|
||||
INLINE_GRAPH void AllTransitionsWrapper::
|
||||
invert_in_place() {
|
||||
_cache = NodeTransitionCache::invert(_cache);
|
||||
_all_verified.clear();
|
||||
|
|
@ -292,7 +292,7 @@ invert_in_place() {
|
|||
// Description: Sets this transition to the composition of this
|
||||
// transition and the following one.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void AllTransitionsWrapper::
|
||||
INLINE_GRAPH void AllTransitionsWrapper::
|
||||
invert_compose_in_place(const AllTransitionsWrapper &other) {
|
||||
_cache = NodeTransitionCache::invert_compose(_cache, other._cache);
|
||||
_all_verified.clear();
|
||||
|
|
@ -305,7 +305,7 @@ invert_compose_in_place(const AllTransitionsWrapper &other) {
|
|||
// in the cache on the arc. Also returns the arc's
|
||||
// top_subtree indication.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE Node *AllTransitionsWrapper::
|
||||
INLINE_GRAPH Node *AllTransitionsWrapper::
|
||||
extract_from_cache(const NodeRelation *arc) {
|
||||
_cache = arc->_net_transitions;
|
||||
_all_verified = arc->_all_verified;
|
||||
|
|
@ -327,7 +327,7 @@ extract_from_cache(const NodeRelation *arc) {
|
|||
// have computed the complete set of net transitions to
|
||||
// the arc.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void AllTransitionsWrapper::
|
||||
INLINE_GRAPH void AllTransitionsWrapper::
|
||||
store_to_cache(NodeRelation *arc, Node *top_subtree) {
|
||||
arc->_top_subtree = top_subtree;
|
||||
arc->_net_transitions = _cache;
|
||||
|
|
@ -352,7 +352,7 @@ store_to_cache(NodeRelation *arc, Node *top_subtree) {
|
|||
// net transitions to the arc, but not necessarily all
|
||||
// of them.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void AllTransitionsWrapper::
|
||||
INLINE_GRAPH void AllTransitionsWrapper::
|
||||
store_to_cache_partial(NodeRelation *arc, Node *top_subtree) {
|
||||
arc->_top_subtree = top_subtree;
|
||||
arc->_net_transitions =
|
||||
|
|
@ -372,7 +372,7 @@ store_to_cache_partial(NodeRelation *arc, Node *top_subtree) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool AllTransitionsWrapper::
|
||||
INLINE_GRAPH bool AllTransitionsWrapper::
|
||||
is_cache_verified(UpdateSeq as_of) const {
|
||||
#ifndef NDEBUG
|
||||
if (wrt_cat.is_spam()) {
|
||||
|
|
@ -390,7 +390,7 @@ is_cache_verified(UpdateSeq as_of) const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void AllTransitionsWrapper::
|
||||
INLINE_GRAPH void AllTransitionsWrapper::
|
||||
set_computed_verified(UpdateSeq now) {
|
||||
_cache = NodeTransitionCache::set_computed_verified(_cache, now);
|
||||
_all_verified = now;
|
||||
|
|
@ -410,7 +410,7 @@ set_computed_verified(UpdateSeq now) {
|
|||
// that indicated by value, using the cache as a helper,
|
||||
// and stores the result in this wrapper.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void AllTransitionsWrapper::
|
||||
INLINE_GRAPH void AllTransitionsWrapper::
|
||||
cached_compose(const AllTransitionsWrapper &cache,
|
||||
const AllTransitionsWrapper &value,
|
||||
UpdateSeq now) {
|
||||
|
|
@ -424,7 +424,7 @@ cached_compose(const AllTransitionsWrapper &cache,
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE AllTransitionsWrapper::size_type AllTransitionsWrapper::
|
||||
INLINE_GRAPH AllTransitionsWrapper::size_type AllTransitionsWrapper::
|
||||
size() const {
|
||||
if (_cache == (NodeTransitionCache *)NULL) {
|
||||
return 0;
|
||||
|
|
@ -437,7 +437,7 @@ size() const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE AllTransitionsWrapper::const_iterator AllTransitionsWrapper::
|
||||
INLINE_GRAPH AllTransitionsWrapper::const_iterator AllTransitionsWrapper::
|
||||
begin() const {
|
||||
if (_cache == (NodeTransitionCache *)NULL) {
|
||||
return _empty_cache.begin();
|
||||
|
|
@ -450,7 +450,7 @@ begin() const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE AllTransitionsWrapper::const_iterator AllTransitionsWrapper::
|
||||
INLINE_GRAPH AllTransitionsWrapper::const_iterator AllTransitionsWrapper::
|
||||
end() const {
|
||||
if (_cache == (NodeTransitionCache *)NULL) {
|
||||
// We intentionally return begin() instead of end() here, just in
|
||||
|
|
@ -460,32 +460,7 @@ end() const {
|
|||
return _cache->end();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: get_transition_into
|
||||
// Description: This external template function is handy for
|
||||
// extracting a transition of a particular type from the
|
||||
// set. If the transition exists, it is automatically
|
||||
// downcasted to the correct type and stored in the
|
||||
// pointer given in the first parameter, and the return
|
||||
// value is true. If the transition does not exist, the
|
||||
// pointer is filled with NULL and the return value is
|
||||
// false.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Transition>
|
||||
INLINE bool
|
||||
get_transition_into(Transition *&ptr, const AllTransitionsWrapper &trans,
|
||||
TypeHandle transition_type) {
|
||||
NodeTransition *nt = trans.get_transition(transition_type);
|
||||
if (nt == (NodeTransition *)NULL) {
|
||||
ptr = (Transition *)NULL;
|
||||
return false;
|
||||
}
|
||||
DCAST_INTO_R(ptr, nt, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
template<class Transition>
|
||||
INLINE bool
|
||||
get_transition_into(Transition *&ptr, const AllTransitionsWrapper &trans) {
|
||||
return get_transition_into(ptr, trans, Transition::get_class_type());
|
||||
INLINE_GRAPH ostream &operator << (ostream &out, const AllTransitionsWrapper &ntw) {
|
||||
ntw.output(out);
|
||||
return out;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
// Filename: allTransitionsWrapper.T
|
||||
// Created by: drose (21Mar00)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: get_transition_into
|
||||
// Description: This external template function is handy for
|
||||
// extracting a transition of a particular type from the
|
||||
// set. If the transition exists, it is automatically
|
||||
// downcasted to the correct type and stored in the
|
||||
// pointer given in the first parameter, and the return
|
||||
// value is true. If the transition does not exist, the
|
||||
// pointer is filled with NULL and the return value is
|
||||
// false.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Transition>
|
||||
INLINE_GRAPH bool
|
||||
get_transition_into(Transition *&ptr, const AllTransitionsWrapper &trans,
|
||||
TypeHandle transition_type) {
|
||||
NodeTransition *nt = trans.get_transition(transition_type);
|
||||
if (nt == (NodeTransition *)NULL) {
|
||||
ptr = (Transition *)NULL;
|
||||
return false;
|
||||
}
|
||||
DCAST_INTO_R(ptr, nt, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
template<class Transition>
|
||||
INLINE_GRAPH bool
|
||||
get_transition_into(Transition *&ptr, const AllTransitionsWrapper &trans) {
|
||||
return get_transition_into(ptr, trans, Transition::get_class_type());
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -33,3 +33,4 @@ write(ostream &out, int indent_level) const {
|
|||
_cache->write(out, indent_level);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,44 +44,44 @@ public:
|
|||
typedef AllTransitionsWrapper TransitionWrapper;
|
||||
typedef AllAttributesWrapper AttributeWrapper;
|
||||
|
||||
INLINE AllTransitionsWrapper();
|
||||
INLINE AllTransitionsWrapper(const AllTransitionsWrapper ©);
|
||||
INLINE void operator = (const AllTransitionsWrapper ©);
|
||||
INLINE ~AllTransitionsWrapper();
|
||||
INLINE_GRAPH AllTransitionsWrapper();
|
||||
INLINE_GRAPH AllTransitionsWrapper(const AllTransitionsWrapper ©);
|
||||
INLINE_GRAPH void operator = (const AllTransitionsWrapper ©);
|
||||
INLINE_GRAPH ~AllTransitionsWrapper();
|
||||
|
||||
INLINE static AllTransitionsWrapper
|
||||
INLINE_GRAPH static AllTransitionsWrapper
|
||||
init_from(const AllTransitionsWrapper &other);
|
||||
INLINE static AllTransitionsWrapper
|
||||
INLINE_GRAPH static AllTransitionsWrapper
|
||||
init_from(const AllAttributesWrapper &attrib);
|
||||
|
||||
INLINE bool is_empty() const;
|
||||
INLINE PT(NodeTransition) set_transition(TypeHandle handle,
|
||||
INLINE_GRAPH bool is_empty() const;
|
||||
INLINE_GRAPH PT(NodeTransition) set_transition(TypeHandle handle,
|
||||
NodeTransition *trans);
|
||||
INLINE PT(NodeTransition) set_transition(NodeTransition *trans);
|
||||
INLINE PT(NodeTransition) clear_transition(TypeHandle handle);
|
||||
INLINE bool has_transition(TypeHandle handle) const;
|
||||
INLINE NodeTransition *get_transition(TypeHandle handle) const;
|
||||
INLINE_GRAPH PT(NodeTransition) set_transition(NodeTransition *trans);
|
||||
INLINE_GRAPH PT(NodeTransition) clear_transition(TypeHandle handle);
|
||||
INLINE_GRAPH bool has_transition(TypeHandle handle) const;
|
||||
INLINE_GRAPH NodeTransition *get_transition(TypeHandle handle) const;
|
||||
|
||||
INLINE const NodeTransitionCache &get_transitions() const;
|
||||
INLINE_GRAPH const NodeTransitionCache &get_transitions() const;
|
||||
|
||||
INLINE bool is_identity() const;
|
||||
INLINE int compare_to(const AllTransitionsWrapper &other) const;
|
||||
INLINE_GRAPH bool is_identity() const;
|
||||
INLINE_GRAPH int compare_to(const AllTransitionsWrapper &other) const;
|
||||
|
||||
INLINE void make_identity();
|
||||
INLINE void extract_from(const NodeRelation *arc);
|
||||
INLINE void store_to(NodeRelation *arc) const;
|
||||
INLINE_GRAPH void make_identity();
|
||||
INLINE_GRAPH void extract_from(const NodeRelation *arc);
|
||||
INLINE_GRAPH void store_to(NodeRelation *arc) const;
|
||||
|
||||
INLINE void compose_in_place(const AllTransitionsWrapper &other);
|
||||
INLINE void invert_in_place();
|
||||
INLINE void invert_compose_in_place(const AllTransitionsWrapper &other);
|
||||
INLINE_GRAPH void compose_in_place(const AllTransitionsWrapper &other);
|
||||
INLINE_GRAPH void invert_in_place();
|
||||
INLINE_GRAPH void invert_compose_in_place(const AllTransitionsWrapper &other);
|
||||
|
||||
INLINE Node *extract_from_cache(const NodeRelation *arc);
|
||||
INLINE void store_to_cache(NodeRelation *arc, Node *top_subtree);
|
||||
INLINE void store_to_cache_partial(NodeRelation *arc, Node *top_subtree);
|
||||
INLINE bool is_cache_verified(UpdateSeq as_of) const;
|
||||
INLINE void set_computed_verified(UpdateSeq now);
|
||||
INLINE_GRAPH Node *extract_from_cache(const NodeRelation *arc);
|
||||
INLINE_GRAPH void store_to_cache(NodeRelation *arc, Node *top_subtree);
|
||||
INLINE_GRAPH void store_to_cache_partial(NodeRelation *arc, Node *top_subtree);
|
||||
INLINE_GRAPH bool is_cache_verified(UpdateSeq as_of) const;
|
||||
INLINE_GRAPH void set_computed_verified(UpdateSeq now);
|
||||
|
||||
INLINE void cached_compose(const AllTransitionsWrapper &cache,
|
||||
INLINE_GRAPH void cached_compose(const AllTransitionsWrapper &cache,
|
||||
const AllTransitionsWrapper &value,
|
||||
UpdateSeq now);
|
||||
|
||||
|
|
@ -96,9 +96,9 @@ public:
|
|||
typedef NodeTransitionCache::value_type value_type;
|
||||
typedef NodeTransitionCache::size_type size_type;
|
||||
|
||||
INLINE size_type size() const;
|
||||
INLINE const_iterator begin() const;
|
||||
INLINE const_iterator end() const;
|
||||
INLINE_GRAPH size_type size() const;
|
||||
INLINE_GRAPH const_iterator begin() const;
|
||||
INLINE_GRAPH const_iterator end() const;
|
||||
|
||||
public:
|
||||
void output(ostream &out) const;
|
||||
|
|
@ -112,23 +112,15 @@ private:
|
|||
// empty. It's used just so we can have a sensible return value
|
||||
// from begin() and end() when our pointer is NULL.
|
||||
static NodeTransitionCache _empty_cache;
|
||||
friend class AllAttributesWrapper;
|
||||
friend class AllAttributesWrapper;
|
||||
};
|
||||
|
||||
INLINE ostream &operator << (ostream &out, const AllTransitionsWrapper &ntw) {
|
||||
ntw.output(out);
|
||||
return out;
|
||||
}
|
||||
INLINE_GRAPH ostream &operator << (ostream &out, const AllTransitionsWrapper &ntw);
|
||||
|
||||
template<class Transition>
|
||||
INLINE bool
|
||||
get_transition_into(Transition *&ptr, const AllTransitionsWrapper &trans,
|
||||
TypeHandle transition_type);
|
||||
|
||||
template<class Transition>
|
||||
INLINE bool
|
||||
get_transition_into(Transition *&ptr, const AllTransitionsWrapper &trans);
|
||||
#include "allTransitionsWrapper.T"
|
||||
|
||||
#ifdef BUILDING_PANDA
|
||||
#include "allTransitionsWrapper.I"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
// This kind of ArcComponent may *only* be at the head
|
||||
// of the chain; i.e. _next must always be NULL.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE ArcChain::ArcComponent::
|
||||
INLINE_GRAPH ArcChain::ArcComponent::
|
||||
ArcComponent(Node *node) :
|
||||
_next(NULL)
|
||||
{
|
||||
|
|
@ -27,7 +27,7 @@ ArcComponent(Node *node) :
|
|||
// tail of the chain; it may not be at the head of the
|
||||
// chain; i.e. _next must never be NULL.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE ArcChain::ArcComponent::
|
||||
INLINE_GRAPH ArcChain::ArcComponent::
|
||||
ArcComponent(NodeRelation *arc, ArcComponent *next) :
|
||||
_next(next)
|
||||
{
|
||||
|
|
@ -43,7 +43,7 @@ ArcComponent(NodeRelation *arc, ArcComponent *next) :
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE ArcChain::ArcComponent::
|
||||
INLINE_GRAPH ArcChain::ArcComponent::
|
||||
ArcComponent(const ArcComponent ©) :
|
||||
_next(copy._next)
|
||||
{
|
||||
|
|
@ -63,7 +63,7 @@ ArcComponent(const ArcComponent ©) :
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE ArcChain::ArcComponent::
|
||||
INLINE_GRAPH ArcChain::ArcComponent::
|
||||
~ArcComponent() {
|
||||
if (has_arc()) {
|
||||
_p._arc->unref_parent();
|
||||
|
|
@ -79,7 +79,7 @@ INLINE ArcChain::ArcComponent::
|
|||
// Description: Returns true if this component stores an arc, false
|
||||
// if it stores a node.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool ArcChain::ArcComponent::
|
||||
INLINE_GRAPH bool ArcChain::ArcComponent::
|
||||
has_arc() const {
|
||||
return (_next != (ArcComponent *)NULL);
|
||||
}
|
||||
|
|
@ -91,7 +91,7 @@ has_arc() const {
|
|||
// an error to call this unless has_arc() has already
|
||||
// returned true.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeRelation *ArcChain::ArcComponent::
|
||||
INLINE_GRAPH NodeRelation *ArcChain::ArcComponent::
|
||||
get_arc() const {
|
||||
nassertr(has_arc(), (NodeRelation *)NULL);
|
||||
return _p._arc;
|
||||
|
|
@ -106,7 +106,7 @@ get_arc() const {
|
|||
// references an arc (has_arc() is true), this will
|
||||
// return the child node of the arc.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE Node *ArcChain::ArcComponent::
|
||||
INLINE_GRAPH Node *ArcChain::ArcComponent::
|
||||
get_node() const {
|
||||
if (has_arc()) {
|
||||
return _p._arc->get_child();
|
||||
|
|
@ -123,7 +123,7 @@ get_node() const {
|
|||
// top of the chain that represents a node; the rest of
|
||||
// the chain represents arcs.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool ArcChain::ArcComponent::
|
||||
INLINE_GRAPH bool ArcChain::ArcComponent::
|
||||
is_top_node() const {
|
||||
return (_next == (ArcComponent *)NULL);
|
||||
}
|
||||
|
|
@ -136,7 +136,7 @@ is_top_node() const {
|
|||
// top of the chain; the highest component in the chain
|
||||
// that still represents an arc.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool ArcChain::ArcComponent::
|
||||
INLINE_GRAPH bool ArcChain::ArcComponent::
|
||||
is_top_arc() const {
|
||||
return (_next != (ArcComponent *)NULL && _next->is_top_node());
|
||||
}
|
||||
|
|
@ -146,7 +146,7 @@ is_top_arc() const {
|
|||
// Access: Public
|
||||
// Description: Returns the next component in the chain.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE ArcChain::ArcComponent *ArcChain::ArcComponent::
|
||||
INLINE_GRAPH ArcChain::ArcComponent *ArcChain::ArcComponent::
|
||||
get_next() const {
|
||||
return _next;
|
||||
}
|
||||
|
|
@ -158,7 +158,7 @@ get_next() const {
|
|||
// the chain at this component and relinks it to another
|
||||
// chain.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void ArcChain::ArcComponent::
|
||||
INLINE_GRAPH void ArcChain::ArcComponent::
|
||||
set_next(ArcComponent *next) {
|
||||
nassertv(next != (ArcComponent *)NULL);
|
||||
nassertv(_next != (ArcComponent *)NULL);
|
||||
|
|
@ -176,7 +176,7 @@ set_next(ArcComponent *next) {
|
|||
// relative wrt to the particular instance we've reached
|
||||
// so far.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE ArcChain::ForwardIterator::
|
||||
INLINE_GRAPH ArcChain::ForwardIterator::
|
||||
ForwardIterator(ArcChain::ArcComponent *comp) : _comp(comp) {
|
||||
}
|
||||
|
||||
|
|
@ -185,7 +185,7 @@ ForwardIterator(ArcChain::ArcComponent *comp) : _comp(comp) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeRelation *ArcChain::ForwardIterator::
|
||||
INLINE_GRAPH NodeRelation *ArcChain::ForwardIterator::
|
||||
operator * () const {
|
||||
nassertr(_comp != (ArcComponent *)NULL, NULL);
|
||||
return _comp->get_arc();
|
||||
|
|
@ -196,7 +196,7 @@ operator * () const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void ArcChain::ForwardIterator::
|
||||
INLINE_GRAPH void ArcChain::ForwardIterator::
|
||||
operator ++() {
|
||||
nassertv(_comp != (ArcComponent *)NULL);
|
||||
if (_comp->is_top_arc()) {
|
||||
|
|
@ -213,7 +213,7 @@ operator ++() {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool ArcChain::ForwardIterator::
|
||||
INLINE_GRAPH bool ArcChain::ForwardIterator::
|
||||
operator == (const ArcChain::ForwardIterator &other) const {
|
||||
return _comp == other._comp;
|
||||
}
|
||||
|
|
@ -223,7 +223,7 @@ operator == (const ArcChain::ForwardIterator &other) const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool ArcChain::ForwardIterator::
|
||||
INLINE_GRAPH bool ArcChain::ForwardIterator::
|
||||
operator != (const ArcChain::ForwardIterator &other) const {
|
||||
return _comp != other._comp;
|
||||
}
|
||||
|
|
@ -237,7 +237,7 @@ operator != (const ArcChain::ForwardIterator &other) const {
|
|||
// that receives a node if you ever want to do anything
|
||||
// with this chain.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE ArcChain::
|
||||
INLINE_GRAPH ArcChain::
|
||||
ArcChain() {
|
||||
}
|
||||
|
||||
|
|
@ -249,7 +249,7 @@ ArcChain() {
|
|||
// push_back() with each arc below that node in
|
||||
// sequence.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE ArcChain::
|
||||
INLINE_GRAPH ArcChain::
|
||||
ArcChain(Node *top_node) {
|
||||
_head = new ArcComponent(top_node);
|
||||
}
|
||||
|
|
@ -259,7 +259,7 @@ ArcChain(Node *top_node) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE ArcChain::
|
||||
INLINE_GRAPH ArcChain::
|
||||
ArcChain(const ArcChain ©) :
|
||||
_head(copy._head)
|
||||
{
|
||||
|
|
@ -270,7 +270,7 @@ ArcChain(const ArcChain ©) :
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void ArcChain::
|
||||
INLINE_GRAPH void ArcChain::
|
||||
operator = (const ArcChain ©) {
|
||||
_head = copy._head;
|
||||
}
|
||||
|
|
@ -281,7 +281,7 @@ operator = (const ArcChain ©) {
|
|||
// Description: Returns true if there is at least a top node in the
|
||||
// chain, or false otherwise.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool ArcChain::
|
||||
INLINE_GRAPH bool ArcChain::
|
||||
has_node() const {
|
||||
return (_head != (ArcComponent *)NULL);
|
||||
}
|
||||
|
|
@ -292,7 +292,7 @@ has_node() const {
|
|||
// Description: Returns true if there are any arcs in the chain, or
|
||||
// false otherwise.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool ArcChain::
|
||||
INLINE_GRAPH bool ArcChain::
|
||||
has_arcs() const {
|
||||
return (_head != (ArcComponent *)NULL && !_head->is_top_node());
|
||||
}
|
||||
|
|
@ -303,7 +303,7 @@ has_arcs() const {
|
|||
// Description: Returns an iterator that can be used to traverse the
|
||||
// list of arcs.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE ArcChain::const_iterator ArcChain::
|
||||
INLINE_GRAPH ArcChain::const_iterator ArcChain::
|
||||
begin() const {
|
||||
if (empty()) {
|
||||
return ForwardIterator();
|
||||
|
|
@ -318,7 +318,7 @@ begin() const {
|
|||
// Description: Returns an iterator that can be used to traverse the
|
||||
// list of arcs.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE ArcChain::const_iterator ArcChain::
|
||||
INLINE_GRAPH ArcChain::const_iterator ArcChain::
|
||||
end() const {
|
||||
return ForwardIterator();
|
||||
}
|
||||
|
|
@ -330,7 +330,7 @@ end() const {
|
|||
// .. end() is empty (i.e. begin() == end()), false
|
||||
// otherwise. This is the same as !has_arcs().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool ArcChain::
|
||||
INLINE_GRAPH bool ArcChain::
|
||||
empty() const {
|
||||
return (_head == (ArcComponent *)NULL || _head->is_top_node());
|
||||
}
|
||||
|
|
@ -340,7 +340,7 @@ empty() const {
|
|||
// Access: Public
|
||||
// Description: Appends the indicated arc onto the end of the chain.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void ArcChain::
|
||||
INLINE_GRAPH void ArcChain::
|
||||
push_back(NodeRelation *arc) {
|
||||
// It is invalid to push an arc onto a chain that does not already
|
||||
// have at least a top node.
|
||||
|
|
@ -353,7 +353,7 @@ push_back(NodeRelation *arc) {
|
|||
// Access: Public
|
||||
// Description: Removes the last arc from the end of the chain.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void ArcChain::
|
||||
INLINE_GRAPH void ArcChain::
|
||||
pop_back() {
|
||||
nassertv(_head != (ArcComponent *)NULL);
|
||||
_head = _head->get_next();
|
||||
|
|
@ -367,7 +367,7 @@ pop_back() {
|
|||
// Access: Public
|
||||
// Description: Returns the last arc in the chain.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeRelation *ArcChain::
|
||||
INLINE_GRAPH NodeRelation *ArcChain::
|
||||
back() const {
|
||||
nassertr(_head != (ArcComponent *)NULL, (NodeRelation *)NULL);
|
||||
return _head->get_arc();
|
||||
|
|
@ -380,7 +380,7 @@ back() const {
|
|||
// is, if they contain the same list of arcs in the same
|
||||
// order.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool ArcChain::
|
||||
INLINE_GRAPH bool ArcChain::
|
||||
operator == (const ArcChain &other) const {
|
||||
return (compare_to(other) == 0);
|
||||
}
|
||||
|
|
@ -390,7 +390,7 @@ operator == (const ArcChain &other) const {
|
|||
// Access: Public
|
||||
// Description: Returns true if the two chains are not equivalent.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool ArcChain::
|
||||
INLINE_GRAPH bool ArcChain::
|
||||
operator != (const ArcChain &other) const {
|
||||
return !operator == (other);
|
||||
}
|
||||
|
|
@ -404,7 +404,7 @@ operator != (const ArcChain &other) const {
|
|||
// and is useful only for storing ArcChains in a sorted
|
||||
// container like an STL set.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool ArcChain::
|
||||
INLINE_GRAPH bool ArcChain::
|
||||
operator < (const ArcChain &other) const {
|
||||
return (compare_to(other) < 0);
|
||||
}
|
||||
|
|
@ -424,7 +424,7 @@ operator < (const ArcChain &other) const {
|
|||
// placing the ArcChains in a sorted container like an
|
||||
// STL set.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE int ArcChain::
|
||||
INLINE_GRAPH int ArcChain::
|
||||
compare_to(const ArcChain &other) const {
|
||||
return r_compare_to(_head, other._head);
|
||||
}
|
||||
|
|
@ -435,7 +435,7 @@ compare_to(const ArcChain &other) const {
|
|||
// Description: Writes a sensible description of the ArcChain to the
|
||||
// indicated output stream.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void ArcChain::
|
||||
INLINE_GRAPH void ArcChain::
|
||||
output(ostream &out) const {
|
||||
if (_head == (ArcComponent *)NULL) {
|
||||
out << "(empty)";
|
||||
|
|
@ -443,3 +443,9 @@ output(ostream &out) const {
|
|||
r_output(out, _head);
|
||||
}
|
||||
}
|
||||
|
||||
INLINE_GRAPH ostream &operator << (ostream &out, const ArcChain &arc_chain) {
|
||||
arc_chain.output(out);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -106,3 +106,4 @@ r_compare_to(const ArcComponent *a, const ArcComponent *b) {
|
|||
return r_compare_to(a->get_next(), b->get_next());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,22 +61,22 @@ protected:
|
|||
// in the chain will store a reference-counting pointer to the
|
||||
// chain's top node.
|
||||
|
||||
class ArcComponent : public ReferenceCount {
|
||||
class EXPCL_PANDA ArcComponent : public ReferenceCount {
|
||||
public:
|
||||
INLINE ArcComponent(Node *node);
|
||||
INLINE ArcComponent(NodeRelation *arc, ArcComponent *next);
|
||||
INLINE ArcComponent(const ArcComponent ©);
|
||||
INLINE_GRAPH ArcComponent(Node *node);
|
||||
INLINE_GRAPH ArcComponent(NodeRelation *arc, ArcComponent *next);
|
||||
INLINE_GRAPH ArcComponent(const ArcComponent ©);
|
||||
void operator = (const ArcComponent ©);
|
||||
INLINE ~ArcComponent();
|
||||
INLINE_GRAPH ~ArcComponent();
|
||||
|
||||
INLINE bool has_arc() const;
|
||||
INLINE NodeRelation *get_arc() const;
|
||||
INLINE Node *get_node() const;
|
||||
INLINE bool is_top_node() const;
|
||||
INLINE bool is_top_arc() const;
|
||||
INLINE_GRAPH bool has_arc() const;
|
||||
INLINE_GRAPH NodeRelation *get_arc() const;
|
||||
INLINE_GRAPH Node *get_node() const;
|
||||
INLINE_GRAPH bool is_top_node() const;
|
||||
INLINE_GRAPH bool is_top_arc() const;
|
||||
|
||||
INLINE ArcComponent *get_next() const;
|
||||
INLINE void set_next(ArcComponent *next);
|
||||
INLINE_GRAPH ArcComponent *get_next() const;
|
||||
INLINE_GRAPH void set_next(ArcComponent *next);
|
||||
|
||||
private:
|
||||
union {
|
||||
|
|
@ -95,11 +95,11 @@ protected:
|
|||
// begin() .. end().
|
||||
class ForwardIterator {
|
||||
public:
|
||||
INLINE ForwardIterator(ArcComponent *comp = NULL);
|
||||
INLINE NodeRelation *operator * () const;
|
||||
INLINE void operator ++();
|
||||
INLINE bool operator == (const ForwardIterator &other) const;
|
||||
INLINE bool operator != (const ForwardIterator &other) const;
|
||||
INLINE_GRAPH ForwardIterator(ArcComponent *comp = NULL);
|
||||
INLINE_GRAPH NodeRelation *operator * () const;
|
||||
INLINE_GRAPH void operator ++();
|
||||
INLINE_GRAPH bool operator == (const ForwardIterator &other) const;
|
||||
INLINE_GRAPH bool operator != (const ForwardIterator &other) const;
|
||||
|
||||
private:
|
||||
ArcComponent *_comp;
|
||||
|
|
@ -109,39 +109,38 @@ public:
|
|||
typedef ForwardIterator iterator;
|
||||
typedef ForwardIterator const_iterator;
|
||||
|
||||
INLINE ArcChain();
|
||||
INLINE ArcChain(Node *top_node);
|
||||
INLINE ArcChain(const ArcChain ©);
|
||||
INLINE void operator = (const ArcChain ©);
|
||||
INLINE_GRAPH ArcChain();
|
||||
INLINE_GRAPH ArcChain(Node *top_node);
|
||||
INLINE_GRAPH ArcChain(const ArcChain ©);
|
||||
INLINE_GRAPH void operator = (const ArcChain ©);
|
||||
|
||||
INLINE bool has_node() const;
|
||||
INLINE bool has_arcs() const;
|
||||
INLINE_GRAPH bool has_node() const;
|
||||
INLINE_GRAPH bool has_arcs() const;
|
||||
|
||||
INLINE const_iterator begin() const;
|
||||
INLINE const_iterator end() const;
|
||||
INLINE bool empty() const;
|
||||
INLINE_GRAPH const_iterator begin() const;
|
||||
INLINE_GRAPH const_iterator end() const;
|
||||
INLINE_GRAPH bool empty() const;
|
||||
|
||||
INLINE void push_back(NodeRelation *arc);
|
||||
INLINE void pop_back();
|
||||
INLINE NodeRelation *back() const;
|
||||
INLINE_GRAPH void push_back(NodeRelation *arc);
|
||||
INLINE_GRAPH void pop_back();
|
||||
INLINE_GRAPH NodeRelation *back() const;
|
||||
|
||||
INLINE bool operator == (const ArcChain &other) const;
|
||||
INLINE bool operator != (const ArcChain &other) const;
|
||||
INLINE bool operator < (const ArcChain &other) const;
|
||||
INLINE int compare_to(const ArcChain &other) const;
|
||||
INLINE_GRAPH bool operator == (const ArcChain &other) const;
|
||||
INLINE_GRAPH bool operator != (const ArcChain &other) const;
|
||||
INLINE_GRAPH bool operator < (const ArcChain &other) const;
|
||||
INLINE_GRAPH int compare_to(const ArcChain &other) const;
|
||||
|
||||
INLINE void output(ostream &out) const;
|
||||
INLINE_GRAPH void output(ostream &out) const;
|
||||
|
||||
private:
|
||||
void r_output(ostream &out, ArcComponent *comp) const;
|
||||
static int r_compare_to(const ArcComponent *a, const ArcComponent *v);
|
||||
};
|
||||
|
||||
INLINE ostream &operator << (ostream &out, const ArcChain &arc_chain) {
|
||||
arc_chain.output(out);
|
||||
return out;
|
||||
}
|
||||
INLINE_GRAPH ostream &operator << (ostream &out, const ArcChain &arc_chain);
|
||||
|
||||
#ifdef BUILDING_PANDA
|
||||
#include "arcChain.I"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ TypeHandle BitMaskAttribute<MaskType>::_type_handle;
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class MaskType>
|
||||
INLINE BitMaskAttribute<MaskType>::
|
||||
INLINE_GRAPH BitMaskAttribute<MaskType>::
|
||||
BitMaskAttribute() {
|
||||
}
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ BitMaskAttribute() {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class MaskType>
|
||||
INLINE BitMaskAttribute<MaskType>::
|
||||
INLINE_GRAPH BitMaskAttribute<MaskType>::
|
||||
BitMaskAttribute(const MaskType &mask) :
|
||||
_mask(mask)
|
||||
{
|
||||
|
|
@ -36,7 +36,7 @@ BitMaskAttribute(const MaskType &mask) :
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class MaskType>
|
||||
INLINE BitMaskAttribute<MaskType>::
|
||||
INLINE_GRAPH BitMaskAttribute<MaskType>::
|
||||
BitMaskAttribute(const BitMaskAttribute ©) :
|
||||
NodeAttribute(copy),
|
||||
_mask(copy._mask)
|
||||
|
|
@ -49,7 +49,7 @@ BitMaskAttribute(const BitMaskAttribute ©) :
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class MaskType>
|
||||
INLINE void BitMaskAttribute<MaskType>::
|
||||
INLINE_GRAPH void BitMaskAttribute<MaskType>::
|
||||
operator = (const BitMaskAttribute ©) {
|
||||
NodeAttribute::operator = (copy);
|
||||
_mask = copy._mask;
|
||||
|
|
@ -61,7 +61,7 @@ operator = (const BitMaskAttribute ©) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class MaskType>
|
||||
INLINE void BitMaskAttribute<MaskType>::
|
||||
INLINE_GRAPH void BitMaskAttribute<MaskType>::
|
||||
set_mask(const MaskType &mask) {
|
||||
_mask = mask;
|
||||
}
|
||||
|
|
@ -72,7 +72,7 @@ set_mask(const MaskType &mask) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class MaskType>
|
||||
INLINE const MaskType &BitMaskAttribute<MaskType>::
|
||||
INLINE_GRAPH const MaskType &BitMaskAttribute<MaskType>::
|
||||
get_mask() const {
|
||||
return _mask;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,103 @@
|
|||
// 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 ©) :
|
||||
NodeAttribute(copy),
|
||||
_mask(copy._mask)
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: BitMaskAttribute::Copy Assignment Operator
|
||||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class MaskType>
|
||||
INLINE_GRAPH void BitMaskAttribute<MaskType>::
|
||||
operator = (const BitMaskAttribute ©) {
|
||||
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);
|
||||
}
|
||||
|
|
@ -20,14 +20,14 @@ class BitMaskTransition;
|
|||
template<class MaskType>
|
||||
class BitMaskAttribute : public NodeAttribute {
|
||||
protected:
|
||||
INLINE BitMaskAttribute();
|
||||
INLINE BitMaskAttribute(const MaskType &mask);
|
||||
INLINE BitMaskAttribute(const BitMaskAttribute ©);
|
||||
INLINE void operator = (const BitMaskAttribute ©);
|
||||
INLINE_GRAPH BitMaskAttribute();
|
||||
INLINE_GRAPH BitMaskAttribute(const MaskType &mask);
|
||||
INLINE_GRAPH BitMaskAttribute(const BitMaskAttribute ©);
|
||||
INLINE_GRAPH void operator = (const BitMaskAttribute ©);
|
||||
|
||||
public:
|
||||
INLINE void set_mask(const MaskType &mask);
|
||||
INLINE const MaskType &get_mask() const;
|
||||
INLINE_GRAPH void set_mask(const MaskType &mask);
|
||||
INLINE_GRAPH const MaskType &get_mask() const;
|
||||
|
||||
virtual void output(ostream &out) const;
|
||||
|
||||
|
|
@ -59,6 +59,6 @@ private:
|
|||
friend class BitMaskTransition<MaskType>;
|
||||
};
|
||||
|
||||
#include "bitMaskAttribute.I"
|
||||
#include "bitMaskAttribute.T"
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ TypeHandle BitMaskTransition<MaskType>::_type_handle;
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class MaskType>
|
||||
INLINE BitMaskTransition<MaskType>::
|
||||
INLINE_GRAPH BitMaskTransition<MaskType>::
|
||||
BitMaskTransition() {
|
||||
_and = MaskType::all_on();
|
||||
_or = MaskType::all_off();
|
||||
|
|
@ -28,7 +28,7 @@ BitMaskTransition() {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class MaskType>
|
||||
INLINE BitMaskTransition<MaskType>::
|
||||
INLINE_GRAPH BitMaskTransition<MaskType>::
|
||||
BitMaskTransition(const MaskType &and, const MaskType &or) {
|
||||
_and = and;
|
||||
_or = or;
|
||||
|
|
@ -40,7 +40,7 @@ BitMaskTransition(const MaskType &and, const MaskType &or) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class MaskType>
|
||||
INLINE BitMaskTransition<MaskType>::
|
||||
INLINE_GRAPH BitMaskTransition<MaskType>::
|
||||
BitMaskTransition(const BitMaskTransition ©) :
|
||||
NodeTransition(copy),
|
||||
_and(copy._and),
|
||||
|
|
@ -54,7 +54,7 @@ BitMaskTransition(const BitMaskTransition ©) :
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class MaskType>
|
||||
INLINE void BitMaskTransition<MaskType>::
|
||||
INLINE_GRAPH void BitMaskTransition<MaskType>::
|
||||
operator = (const BitMaskTransition ©) {
|
||||
NodeTransition::operator = (copy);
|
||||
_and = copy._and;
|
||||
|
|
@ -67,7 +67,7 @@ operator = (const BitMaskTransition ©) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class MaskType>
|
||||
INLINE void BitMaskTransition<MaskType>::
|
||||
INLINE_GRAPH void BitMaskTransition<MaskType>::
|
||||
set_and(const MaskType &and) {
|
||||
_and = and;
|
||||
state_changed();
|
||||
|
|
@ -79,7 +79,7 @@ set_and(const MaskType &and) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class MaskType>
|
||||
INLINE const MaskType &BitMaskTransition<MaskType>::
|
||||
INLINE_GRAPH const MaskType &BitMaskTransition<MaskType>::
|
||||
get_and() const {
|
||||
return _and;
|
||||
}
|
||||
|
|
@ -90,7 +90,7 @@ get_and() const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class MaskType>
|
||||
INLINE void BitMaskTransition<MaskType>::
|
||||
INLINE_GRAPH void BitMaskTransition<MaskType>::
|
||||
set_or(const MaskType &or) {
|
||||
_or = or;
|
||||
state_changed();
|
||||
|
|
@ -102,7 +102,7 @@ set_or(const MaskType &or) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class MaskType>
|
||||
INLINE const MaskType &BitMaskTransition<MaskType>::
|
||||
INLINE_GRAPH const MaskType &BitMaskTransition<MaskType>::
|
||||
get_or() const {
|
||||
return _or;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,228 @@
|
|||
// Filename: bitMaskTransition.I
|
||||
// Created by: drose (08Jun00)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "bitMaskAttribute.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 ©) :
|
||||
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 ©) {
|
||||
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;
|
||||
}
|
||||
|
|
@ -26,16 +26,16 @@ class NodeRelation;
|
|||
template<class MaskType>
|
||||
class BitMaskTransition : public NodeTransition {
|
||||
protected:
|
||||
INLINE BitMaskTransition();
|
||||
INLINE BitMaskTransition(const MaskType &and, const MaskType &or);
|
||||
INLINE BitMaskTransition(const BitMaskTransition ©);
|
||||
INLINE void operator = (const BitMaskTransition ©);
|
||||
INLINE_GRAPH BitMaskTransition();
|
||||
INLINE_GRAPH BitMaskTransition(const MaskType &and, const MaskType &or);
|
||||
INLINE_GRAPH BitMaskTransition(const BitMaskTransition ©);
|
||||
INLINE_GRAPH void operator = (const BitMaskTransition ©);
|
||||
|
||||
public:
|
||||
INLINE void set_and(const MaskType &and);
|
||||
INLINE const MaskType &get_and() const;
|
||||
INLINE void set_or(const MaskType &or);
|
||||
INLINE const MaskType &get_or() const;
|
||||
INLINE_GRAPH void set_and(const MaskType &and);
|
||||
INLINE_GRAPH const MaskType &get_and() const;
|
||||
INLINE_GRAPH void set_or(const MaskType &or);
|
||||
INLINE_GRAPH const MaskType &get_or() const;
|
||||
|
||||
virtual NodeTransition *compose(const NodeTransition *other) const;
|
||||
virtual NodeTransition *invert() const;
|
||||
|
|
@ -74,6 +74,6 @@ private:
|
|||
static TypeHandle _type_handle;
|
||||
};
|
||||
|
||||
#include "bitMaskTransition.I"
|
||||
#include "bitMaskTransition.T"
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE BoundedObject::
|
||||
INLINE_GRAPH BoundedObject::
|
||||
BoundedObject() {
|
||||
_bound_type = BVT_dynamic_sphere;
|
||||
_bound_stale = true;
|
||||
|
|
@ -23,7 +23,7 @@ BoundedObject() {
|
|||
// dynamically computed for this particular node.
|
||||
// Presently, this should only be BVT_dynamic_sphere.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BoundedObject::
|
||||
INLINE_GRAPH void BoundedObject::
|
||||
set_bound(BoundedObject::BoundingVolumeType type) {
|
||||
nassertv(type != BVT_static);
|
||||
mark_bound_stale();
|
||||
|
|
@ -37,7 +37,7 @@ set_bound(BoundedObject::BoundingVolumeType type) {
|
|||
// This will be a static bounding volume that will no
|
||||
// longer be recomputed automatically.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BoundedObject::
|
||||
INLINE_GRAPH void BoundedObject::
|
||||
set_bound(const BoundingVolume &bound) {
|
||||
mark_bound_stale();
|
||||
_bound_type = BVT_static;
|
||||
|
|
@ -55,7 +55,7 @@ set_bound(const BoundingVolume &bound) {
|
|||
// different from the bounding volumes on the arcs,
|
||||
// which enclose all geometry below them.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE const BoundingVolume &BoundedObject::
|
||||
INLINE_GRAPH const BoundingVolume &BoundedObject::
|
||||
get_bound() const {
|
||||
if (_bound_type == BVT_static) {
|
||||
((BoundedObject *)this)->_bound_stale = false;
|
||||
|
|
@ -75,7 +75,7 @@ get_bound() const {
|
|||
// setting was changed, or false if it was already
|
||||
// marked stale (or if it is a static bounding volume).
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool BoundedObject::
|
||||
INLINE_GRAPH bool BoundedObject::
|
||||
mark_bound_stale() {
|
||||
if (_bound_stale) {
|
||||
return false;
|
||||
|
|
@ -93,7 +93,7 @@ mark_bound_stale() {
|
|||
// effect at least one level, even if it had already
|
||||
// been marked stale.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void BoundedObject::
|
||||
INLINE_GRAPH void BoundedObject::
|
||||
force_bound_stale() {
|
||||
_bound_stale = true;
|
||||
propagate_stale_bound();
|
||||
|
|
@ -106,7 +106,8 @@ force_bound_stale() {
|
|||
// and will be recomputed the next time get_bound() is
|
||||
// called.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool BoundedObject::
|
||||
INLINE_GRAPH bool BoundedObject::
|
||||
is_bound_stale() const {
|
||||
return _bound_stale;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
////////////////////////////////////////////////////////////////////
|
||||
class EXPCL_PANDA BoundedObject {
|
||||
public:
|
||||
INLINE BoundedObject();
|
||||
INLINE_GRAPH BoundedObject();
|
||||
virtual ~BoundedObject();
|
||||
|
||||
PUBLISHED:
|
||||
|
|
@ -32,13 +32,13 @@ PUBLISHED:
|
|||
BVT_dynamic_sphere,
|
||||
};
|
||||
|
||||
INLINE void set_bound(BoundingVolumeType type);
|
||||
INLINE void set_bound(const BoundingVolume &volume);
|
||||
INLINE const BoundingVolume &get_bound() const;
|
||||
INLINE_GRAPH void set_bound(BoundingVolumeType type);
|
||||
INLINE_GRAPH void set_bound(const BoundingVolume &volume);
|
||||
INLINE_GRAPH const BoundingVolume &get_bound() const;
|
||||
|
||||
INLINE bool mark_bound_stale();
|
||||
INLINE void force_bound_stale();
|
||||
INLINE bool is_bound_stale() const;
|
||||
INLINE_GRAPH bool mark_bound_stale();
|
||||
INLINE_GRAPH void force_bound_stale();
|
||||
INLINE_GRAPH bool is_bound_stale() const;
|
||||
|
||||
protected:
|
||||
virtual void propagate_stale_bound();
|
||||
|
|
@ -63,7 +63,9 @@ private:
|
|||
static TypeHandle _type_handle;
|
||||
};
|
||||
|
||||
#ifdef BUILDING_PANDA
|
||||
#include "boundedObject.I"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Visitor, class LevelState>
|
||||
INLINE DFTraverser<Visitor, LevelState>::
|
||||
INLINE_GRAPH DFTraverser<Visitor, LevelState>::
|
||||
DFTraverser(Visitor &visitor,
|
||||
const AttributeWrapper &initial_render_state,
|
||||
TypeHandle graph_type) :
|
||||
|
|
@ -29,7 +29,7 @@ DFTraverser(Visitor &visitor,
|
|||
// Description: Starts the traversal from the indicated arc.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Visitor, class LevelState>
|
||||
INLINE void DFTraverser<Visitor, LevelState>::
|
||||
INLINE_GRAPH void DFTraverser<Visitor, LevelState>::
|
||||
start(NodeRelation *arc, const LevelState &initial_level_state) {
|
||||
traverse(arc, _initial_render_state, initial_level_state);
|
||||
}
|
||||
|
|
@ -40,7 +40,7 @@ start(NodeRelation *arc, const LevelState &initial_level_state) {
|
|||
// Description: Starts the traversal from the indicated node.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Visitor, class LevelState>
|
||||
INLINE void DFTraverser<Visitor, 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);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,124 @@
|
|||
// Filename: dftraverser.T
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Convenience functions.
|
||||
template<class Visitor, class AttributeWrapper, class LevelState>
|
||||
INLINE void
|
||||
df_traverse(NodeRelation *arc, Visitor &visitor,
|
||||
const AttributeWrapper &initial_render_state,
|
||||
const LevelState &initial_level_state,
|
||||
TypeHandle graph_type) {
|
||||
DFTraverser<Visitor, LevelState>
|
||||
dft(visitor, initial_render_state, graph_type);
|
||||
dft.start(arc, initial_level_state);
|
||||
}
|
||||
|
||||
template<class Visitor, class AttributeWrapper, class LevelState>
|
||||
INLINE void
|
||||
df_traverse(Node *root, Visitor &visitor,
|
||||
const AttributeWrapper &initial_render_state,
|
||||
const LevelState &initial_level_state,
|
||||
TypeHandle graph_type) {
|
||||
DFTraverser<Visitor, LevelState>
|
||||
dft(visitor, initial_render_state, graph_type);
|
||||
dft.start(root, initial_level_state);
|
||||
}
|
||||
|
||||
|
|
@ -26,12 +26,12 @@ public:
|
|||
typedef TYPENAME Visitor::TransitionWrapper TransitionWrapper;
|
||||
typedef TYPENAME Visitor::AttributeWrapper AttributeWrapper;
|
||||
|
||||
INLINE DFTraverser(Visitor &visitor,
|
||||
INLINE_GRAPH DFTraverser(Visitor &visitor,
|
||||
const AttributeWrapper &initial_render_state,
|
||||
TypeHandle graph_type);
|
||||
|
||||
INLINE void start(NodeRelation *arc, const LevelState &initial_level_state);
|
||||
INLINE void start(Node *root, const LevelState &initial_level_state);
|
||||
INLINE_GRAPH void start(NodeRelation *arc, const LevelState &initial_level_state);
|
||||
INLINE_GRAPH void start(Node *root, const LevelState &initial_level_state);
|
||||
|
||||
protected:
|
||||
void traverse(NodeRelation *arc,
|
||||
|
|
@ -46,29 +46,6 @@ protected:
|
|||
TypeHandle _graph_type;
|
||||
};
|
||||
|
||||
// Convenience functions.
|
||||
template<class Visitor, class AttributeWrapper, class LevelState>
|
||||
INLINE void
|
||||
df_traverse(NodeRelation *arc, Visitor &visitor,
|
||||
const AttributeWrapper &initial_render_state,
|
||||
const LevelState &initial_level_state,
|
||||
TypeHandle graph_type) {
|
||||
DFTraverser<Visitor, LevelState>
|
||||
dft(visitor, initial_render_state, graph_type);
|
||||
dft.start(arc, initial_level_state);
|
||||
}
|
||||
|
||||
template<class Visitor, class AttributeWrapper, class LevelState>
|
||||
INLINE void
|
||||
df_traverse(Node *root, Visitor &visitor,
|
||||
const AttributeWrapper &initial_render_state,
|
||||
const LevelState &initial_level_state,
|
||||
TypeHandle graph_type) {
|
||||
DFTraverser<Visitor, LevelState>
|
||||
dft(visitor, initial_render_state, graph_type);
|
||||
dft.start(root, initial_level_state);
|
||||
}
|
||||
|
||||
#include "dftraverser.I"
|
||||
#include "dftraverser.T"
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE ImmediateAttribute::
|
||||
INLINE_GRAPH ImmediateAttribute::
|
||||
ImmediateAttribute() {
|
||||
}
|
||||
|
||||
|
|
@ -17,7 +17,7 @@ ImmediateAttribute() {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE ImmediateAttribute::
|
||||
INLINE_GRAPH ImmediateAttribute::
|
||||
ImmediateAttribute(const ImmediateAttribute ©) :
|
||||
NodeAttribute(copy)
|
||||
{
|
||||
|
|
@ -28,7 +28,7 @@ ImmediateAttribute(const ImmediateAttribute ©) :
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void ImmediateAttribute::
|
||||
INLINE_GRAPH void ImmediateAttribute::
|
||||
operator = (const ImmediateAttribute ©) {
|
||||
NodeAttribute::operator = (copy);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,10 +18,12 @@ class ImmediateTransition;
|
|||
////////////////////////////////////////////////////////////////////
|
||||
class EXPCL_PANDA ImmediateAttribute : public NodeAttribute {
|
||||
public:
|
||||
INLINE ImmediateAttribute();
|
||||
INLINE ImmediateAttribute(const ImmediateAttribute ©);
|
||||
INLINE void operator = (const ImmediateAttribute ©);
|
||||
|
||||
INLINE_GRAPH ImmediateAttribute() {};
|
||||
INLINE_GRAPH ImmediateAttribute(const ImmediateAttribute ©) :
|
||||
NodeAttribute(copy){};
|
||||
INLINE_GRAPH void operator = (const ImmediateAttribute ©)
|
||||
{NodeAttribute::operator = (copy);}
|
||||
public:
|
||||
virtual NodeAttribute *make_copy() const;
|
||||
virtual NodeAttribute *make_initial() const;
|
||||
|
|
@ -48,6 +50,4 @@ private:
|
|||
static TypeHandle _type_handle;
|
||||
};
|
||||
|
||||
#include "immediateAttribute.I"
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE ImmediateTransition::
|
||||
INLINE_GRAPH ImmediateTransition::
|
||||
ImmediateTransition() {
|
||||
}
|
||||
|
||||
|
|
@ -17,7 +17,7 @@ ImmediateTransition() {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE ImmediateTransition::
|
||||
INLINE_GRAPH ImmediateTransition::
|
||||
ImmediateTransition(const ImmediateTransition ©) :
|
||||
NodeTransition(copy)
|
||||
{
|
||||
|
|
@ -28,7 +28,7 @@ ImmediateTransition(const ImmediateTransition ©) :
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void ImmediateTransition::
|
||||
INLINE_GRAPH void ImmediateTransition::
|
||||
operator = (const ImmediateTransition ©) {
|
||||
NodeTransition::operator = (copy);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,9 +36,9 @@ class NodeRelation;
|
|||
////////////////////////////////////////////////////////////////////
|
||||
class EXPCL_PANDA ImmediateTransition : public NodeTransition {
|
||||
protected:
|
||||
INLINE ImmediateTransition();
|
||||
INLINE ImmediateTransition(const ImmediateTransition ©);
|
||||
INLINE void operator = (const ImmediateTransition ©);
|
||||
INLINE_GRAPH ImmediateTransition();
|
||||
INLINE_GRAPH ImmediateTransition(const ImmediateTransition ©);
|
||||
INLINE_GRAPH void operator = (const ImmediateTransition ©);
|
||||
|
||||
public:
|
||||
virtual NodeAttribute *make_attrib() const;
|
||||
|
|
@ -75,7 +75,9 @@ private:
|
|||
static TypeHandle _type_handle;
|
||||
};
|
||||
|
||||
#ifdef BUILDING_PANDA
|
||||
#include "immediateTransition.I"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ TypeHandle MatrixAttribute<Matrix>::_type_handle;
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Matrix>
|
||||
INLINE MatrixAttribute<Matrix>::
|
||||
INLINE_GRAPH MatrixAttribute<Matrix>::
|
||||
MatrixAttribute() {
|
||||
_matrix = Matrix::ident_mat();
|
||||
}
|
||||
|
|
@ -25,7 +25,7 @@ MatrixAttribute() {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Matrix>
|
||||
INLINE MatrixAttribute<Matrix>::
|
||||
INLINE_GRAPH MatrixAttribute<Matrix>::
|
||||
MatrixAttribute(const MatrixAttribute ©) :
|
||||
NodeAttribute(copy),
|
||||
_matrix(copy._matrix)
|
||||
|
|
@ -38,7 +38,7 @@ MatrixAttribute(const MatrixAttribute ©) :
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Matrix>
|
||||
INLINE void MatrixAttribute<Matrix>::
|
||||
INLINE_GRAPH void MatrixAttribute<Matrix>::
|
||||
operator = (const MatrixAttribute ©) {
|
||||
NodeAttribute::operator = (copy);
|
||||
_matrix = copy._matrix;
|
||||
|
|
@ -50,7 +50,7 @@ operator = (const MatrixAttribute ©) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Matrix>
|
||||
INLINE void MatrixAttribute<Matrix>::
|
||||
INLINE_GRAPH void MatrixAttribute<Matrix>::
|
||||
set_matrix(const Matrix &mat) {
|
||||
_matrix = mat;
|
||||
}
|
||||
|
|
@ -61,7 +61,7 @@ set_matrix(const Matrix &mat) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Matrix>
|
||||
INLINE const Matrix &MatrixAttribute<Matrix>::
|
||||
INLINE_GRAPH const Matrix &MatrixAttribute<Matrix>::
|
||||
get_matrix() const {
|
||||
return _matrix;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,103 @@
|
|||
// 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 ©) :
|
||||
NodeAttribute(copy),
|
||||
_matrix(copy._matrix)
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: MatrixAttribute::Copy Assignment Operator
|
||||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Matrix>
|
||||
INLINE_GRAPH void MatrixAttribute<Matrix>::
|
||||
operator = (const MatrixAttribute ©) {
|
||||
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);
|
||||
}
|
||||
|
|
@ -20,13 +20,13 @@ class MatrixTransition;
|
|||
template<class Matrix>
|
||||
class MatrixAttribute : public NodeAttribute {
|
||||
protected:
|
||||
INLINE MatrixAttribute();
|
||||
INLINE MatrixAttribute(const MatrixAttribute ©);
|
||||
INLINE void operator = (const MatrixAttribute ©);
|
||||
INLINE_GRAPH MatrixAttribute();
|
||||
INLINE_GRAPH MatrixAttribute(const MatrixAttribute ©);
|
||||
INLINE_GRAPH void operator = (const MatrixAttribute ©);
|
||||
|
||||
public:
|
||||
INLINE void set_matrix(const Matrix &mat);
|
||||
INLINE const Matrix &get_matrix() const;
|
||||
INLINE_GRAPH void set_matrix(const Matrix &mat);
|
||||
INLINE_GRAPH const Matrix &get_matrix() const;
|
||||
|
||||
virtual void output(ostream &out) const;
|
||||
virtual void write(ostream &out, int indent_level = 0) const;
|
||||
|
|
@ -56,9 +56,9 @@ public:
|
|||
|
||||
private:
|
||||
static TypeHandle _type_handle;
|
||||
friend class MatrixTransition<Matrix>;
|
||||
friend class MatrixTransition<Matrix>;
|
||||
};
|
||||
|
||||
#include "matrixAttribute.I"
|
||||
#include "matrixAttribute.T"
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ TypeHandle MatrixTransition<Matrix>::_type_handle;
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Matrix>
|
||||
INLINE MatrixTransition<Matrix>::
|
||||
INLINE_GRAPH MatrixTransition<Matrix>::
|
||||
MatrixTransition() {
|
||||
_matrix = Matrix::ident_mat();
|
||||
}
|
||||
|
|
@ -27,7 +27,7 @@ MatrixTransition() {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Matrix>
|
||||
INLINE MatrixTransition<Matrix>::
|
||||
INLINE_GRAPH MatrixTransition<Matrix>::
|
||||
MatrixTransition(const Matrix &matrix) {
|
||||
_matrix = matrix;
|
||||
}
|
||||
|
|
@ -38,7 +38,7 @@ MatrixTransition(const Matrix &matrix) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Matrix>
|
||||
INLINE MatrixTransition<Matrix>::
|
||||
INLINE_GRAPH MatrixTransition<Matrix>::
|
||||
MatrixTransition(const MatrixTransition ©) :
|
||||
NodeTransition(copy),
|
||||
_matrix(copy._matrix)
|
||||
|
|
@ -51,7 +51,7 @@ MatrixTransition(const MatrixTransition ©) :
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Matrix>
|
||||
INLINE void MatrixTransition<Matrix>::
|
||||
INLINE_GRAPH void MatrixTransition<Matrix>::
|
||||
operator = (const MatrixTransition ©) {
|
||||
NodeTransition::operator = (copy);
|
||||
_matrix = copy._matrix;
|
||||
|
|
@ -63,7 +63,7 @@ operator = (const MatrixTransition ©) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Matrix>
|
||||
INLINE void MatrixTransition<Matrix>::
|
||||
INLINE_GRAPH void MatrixTransition<Matrix>::
|
||||
set_matrix(const Matrix &mat) {
|
||||
_matrix = mat;
|
||||
state_changed();
|
||||
|
|
@ -75,7 +75,7 @@ set_matrix(const Matrix &mat) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Matrix>
|
||||
INLINE const Matrix &MatrixTransition<Matrix>::
|
||||
INLINE_GRAPH const Matrix &MatrixTransition<Matrix>::
|
||||
get_matrix() const {
|
||||
return _matrix;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,240 @@
|
|||
// 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 ©) :
|
||||
NodeTransition(copy),
|
||||
_matrix(copy._matrix)
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: MatrixTransition::Copy Assignment Operator
|
||||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Matrix>
|
||||
INLINE_GRAPH void MatrixTransition<Matrix>::
|
||||
operator = (const MatrixTransition ©) {
|
||||
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);
|
||||
}
|
||||
|
|
@ -27,14 +27,14 @@ class NodeRelation;
|
|||
template<class Matrix>
|
||||
class MatrixTransition : public NodeTransition {
|
||||
protected:
|
||||
INLINE MatrixTransition();
|
||||
INLINE MatrixTransition(const Matrix &matrix);
|
||||
INLINE MatrixTransition(const MatrixTransition ©);
|
||||
INLINE void operator = (const MatrixTransition ©);
|
||||
INLINE_GRAPH MatrixTransition();
|
||||
INLINE_GRAPH MatrixTransition(const Matrix &matrix);
|
||||
INLINE_GRAPH MatrixTransition(const MatrixTransition ©);
|
||||
INLINE_GRAPH void operator = (const MatrixTransition ©);
|
||||
|
||||
public:
|
||||
INLINE void set_matrix(const Matrix &mat);
|
||||
INLINE const Matrix &get_matrix() const;
|
||||
INLINE_GRAPH void set_matrix(const Matrix &mat);
|
||||
INLINE_GRAPH const Matrix &get_matrix() const;
|
||||
|
||||
virtual NodeTransition *compose(const NodeTransition *other) const;
|
||||
virtual NodeTransition *invert() const;
|
||||
|
|
@ -82,6 +82,6 @@ private:
|
|||
static TypeHandle _type_handle;
|
||||
};
|
||||
|
||||
#include "matrixTransition.I"
|
||||
#include "matrixTransition.T"
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ is_off(const Property &property) const {
|
|||
// set indicates that the given property is off.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Property, class NameClass>
|
||||
INLINE bool MultiAttribute<Property, NameClass>::
|
||||
INLINE_GRAPH bool MultiAttribute<Property, NameClass>::
|
||||
get_properties_is_on() const {
|
||||
return _properties_is_on;
|
||||
}
|
||||
|
|
@ -204,7 +204,7 @@ write_property(ostream &, const Property &, int) const {
|
|||
// to the sorted vector, if it is not already there.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Property, class NameClass>
|
||||
INLINE void MultiAttribute<Property, NameClass>::
|
||||
INLINE_GRAPH void MultiAttribute<Property, NameClass>::
|
||||
set_property(const Property &prop) {
|
||||
bool found_flag = false;
|
||||
Properties::iterator pi = find_property(prop, found_flag);
|
||||
|
|
@ -221,7 +221,7 @@ set_property(const Property &prop) {
|
|||
// false if not.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Property, class NameClass>
|
||||
INLINE bool MultiAttribute<Property, 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);
|
||||
|
|
@ -235,7 +235,7 @@ has_property(const Property &prop) const {
|
|||
// property from the sorted vector.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Property, class NameClass>
|
||||
INLINE void MultiAttribute<Property, NameClass>::
|
||||
INLINE_GRAPH void MultiAttribute<Property, NameClass>::
|
||||
clear_property(const Property &prop) {
|
||||
bool found_flag = false;
|
||||
Properties::iterator pi = find_property(prop, found_flag);
|
||||
|
|
@ -255,7 +255,7 @@ clear_property(const Property &prop) {
|
|||
// returned.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Property, class NameClass>
|
||||
INLINE MultiAttribute<Property, NameClass>::Properties::iterator MultiAttribute<Property, 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);
|
||||
|
|
@ -297,7 +297,7 @@ binary_search_property(Properties::iterator begin, Properties::iterator end,
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Property, class NameClass>
|
||||
INLINE MultiAttribute<Property, NameClass>::size_type MultiAttribute<Property, NameClass>::
|
||||
INLINE_GRAPH MultiAttribute<Property, NameClass>::size_type MultiAttribute<Property, NameClass>::
|
||||
size() const {
|
||||
return _properties.size();
|
||||
}
|
||||
|
|
@ -309,7 +309,7 @@ size() const {
|
|||
// properties in the attribute.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Property, class NameClass>
|
||||
INLINE MultiAttribute<Property, NameClass>::const_iterator MultiAttribute<Property, NameClass>::
|
||||
INLINE_GRAPH MultiAttribute<Property, NameClass>::const_iterator MultiAttribute<Property, NameClass>::
|
||||
begin() const {
|
||||
return _properties.begin();
|
||||
}
|
||||
|
|
@ -321,7 +321,7 @@ begin() const {
|
|||
// sequence of properties in the attribute.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Property, class NameClass>
|
||||
INLINE MultiAttribute<Property, NameClass>::const_iterator MultiAttribute<Property, NameClass>::
|
||||
INLINE_GRAPH MultiAttribute<Property, NameClass>::const_iterator MultiAttribute<Property, NameClass>::
|
||||
end() const {
|
||||
return _properties.end();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,324 @@
|
|||
// Filename: multiAttribute.T
|
||||
// Created by: drose (23Mar00)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
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 ©) :
|
||||
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 ©) {
|
||||
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();
|
||||
}
|
||||
|
|
@ -38,7 +38,7 @@ PUBLISHED:
|
|||
bool is_on(const Property &prop) const;
|
||||
bool is_off(const Property &prop) const;
|
||||
|
||||
INLINE bool get_properties_is_on() const;
|
||||
INLINE_GRAPH bool get_properties_is_on() const;
|
||||
|
||||
public:
|
||||
virtual void output(ostream &out) const;
|
||||
|
|
@ -52,11 +52,11 @@ protected:
|
|||
int indent_level) const=0;
|
||||
|
||||
private:
|
||||
INLINE void set_property(const Property &prop);
|
||||
INLINE bool has_property(const Property &prop) const;
|
||||
INLINE void clear_property(const Property &prop);
|
||||
INLINE_GRAPH void set_property(const Property &prop);
|
||||
INLINE_GRAPH bool has_property(const Property &prop) const;
|
||||
INLINE_GRAPH void clear_property(const Property &prop);
|
||||
|
||||
INLINE Properties::iterator
|
||||
INLINE_GRAPH Properties::iterator
|
||||
find_property(const Property &prop, bool &found_flag);
|
||||
|
||||
Properties::iterator
|
||||
|
|
@ -73,9 +73,9 @@ public:
|
|||
typedef Properties::value_type value_type;
|
||||
typedef Properties::size_type size_type;
|
||||
|
||||
INLINE size_type size() const;
|
||||
INLINE const_iterator begin() const;
|
||||
INLINE const_iterator end() const;
|
||||
INLINE_GRAPH size_type size() const;
|
||||
INLINE_GRAPH const_iterator begin() const;
|
||||
INLINE_GRAPH const_iterator end() const;
|
||||
|
||||
private:
|
||||
// The following is a set of properties listed in the attribute. If
|
||||
|
|
@ -102,9 +102,9 @@ public:
|
|||
|
||||
private:
|
||||
static TypeHandle _type_handle;
|
||||
friend class MultiTransition<Property, NameClass>;
|
||||
friend class MultiTransition<Property, NameClass>;
|
||||
};
|
||||
|
||||
#include "multiAttribute.I"
|
||||
#include "multiAttribute.T"
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE MultiNodeAttribute::
|
||||
INLINE_GRAPH MultiNodeAttribute::
|
||||
MultiNodeAttribute() {
|
||||
}
|
||||
|
||||
|
|
@ -17,7 +17,7 @@ MultiNodeAttribute() {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE MultiNodeAttribute::
|
||||
INLINE_GRAPH MultiNodeAttribute::
|
||||
MultiNodeAttribute(const MultiNodeAttribute ©) :
|
||||
MultiAttribute<PT_Node, PointerNameClass>(copy)
|
||||
{
|
||||
|
|
@ -28,7 +28,7 @@ MultiNodeAttribute(const MultiNodeAttribute ©) :
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void MultiNodeAttribute::
|
||||
INLINE_GRAPH void MultiNodeAttribute::
|
||||
operator = (const MultiNodeAttribute ©) {
|
||||
MultiAttribute<PT_Node, PointerNameClass>::operator = (copy);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,9 +30,12 @@ EXPORT_TEMPLATE_CLASS(EXPCL_PANDA, EXPTP_PANDA, MULTIATTRIBUTE_NODE);
|
|||
class EXPCL_PANDA MultiNodeAttribute :
|
||||
public MultiAttribute<PT_Node, PointerNameClass> {
|
||||
protected:
|
||||
INLINE MultiNodeAttribute();
|
||||
INLINE MultiNodeAttribute(const MultiNodeAttribute ©);
|
||||
INLINE void operator = (const MultiNodeAttribute ©);
|
||||
INLINE_GRAPH MultiNodeAttribute() {};
|
||||
INLINE_GRAPH MultiNodeAttribute(const MultiNodeAttribute ©) :
|
||||
MultiAttribute<PT_Node, PointerNameClass>(copy) {};
|
||||
|
||||
INLINE_GRAPH void operator = (const MultiNodeAttribute ©)
|
||||
{MultiAttribute<PT_Node, PointerNameClass>::operator = (copy);}
|
||||
|
||||
public:
|
||||
virtual TypeHandle get_type() const {
|
||||
|
|
@ -53,6 +56,4 @@ private:
|
|||
static TypeHandle _type_handle;
|
||||
};
|
||||
|
||||
#include "multiNodeAttribute.I"
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE MultiNodeTransition::
|
||||
INLINE_GRAPH MultiNodeTransition::
|
||||
MultiNodeTransition() {
|
||||
}
|
||||
|
||||
|
|
@ -17,7 +17,7 @@ MultiNodeTransition() {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE MultiNodeTransition::
|
||||
INLINE_GRAPH MultiNodeTransition::
|
||||
MultiNodeTransition(const MultiNodeTransition ©) :
|
||||
MultiTransition<PT_Node, PointerNameClass>(copy)
|
||||
{
|
||||
|
|
@ -28,7 +28,7 @@ MultiNodeTransition(const MultiNodeTransition ©) :
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void MultiNodeTransition::
|
||||
INLINE_GRAPH void MultiNodeTransition::
|
||||
operator = (const MultiNodeTransition ©) {
|
||||
MultiTransition<PT_Node, PointerNameClass>::operator = (copy);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,11 +36,12 @@ EXPORT_TEMPLATE_CLASS(EXPCL_PANDA, EXPTP_PANDA, MULTITRANSITION_NODE);
|
|||
class EXPCL_PANDA MultiNodeTransition :
|
||||
public MultiTransition<PT_Node, PointerNameClass> {
|
||||
protected:
|
||||
INLINE MultiNodeTransition();
|
||||
INLINE MultiNodeTransition(const MultiNodeTransition ©);
|
||||
INLINE void operator = (const MultiNodeTransition ©);
|
||||
INLINE_GRAPH MultiNodeTransition() {};
|
||||
INLINE_GRAPH MultiNodeTransition(const MultiNodeTransition ©) :
|
||||
MultiTransition<PT_Node, PointerNameClass>(copy) {};
|
||||
|
||||
public:
|
||||
INLINE_GRAPH void operator = (const MultiNodeTransition ©)
|
||||
{MultiTransition<PT_Node, PointerNameClass>::operator = (copy);};
|
||||
|
||||
public:
|
||||
virtual TypeHandle get_type() const {
|
||||
|
|
@ -61,6 +62,4 @@ private:
|
|||
static TypeHandle _type_handle;
|
||||
};
|
||||
|
||||
#include "multiNodeTransition.I"
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ is_identity() const {
|
|||
// are left unchanged.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Property, class NameClass>
|
||||
INLINE void MultiTransition<Property, NameClass>::
|
||||
INLINE_GRAPH void MultiTransition<Property, NameClass>::
|
||||
set_default_dir(TransitionDirection dir) {
|
||||
_default_dir = dir;
|
||||
}
|
||||
|
|
@ -112,7 +112,7 @@ set_default_dir(TransitionDirection dir) {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Property, class NameClass>
|
||||
INLINE TransitionDirection MultiTransition<Property, NameClass>::
|
||||
INLINE_GRAPH TransitionDirection MultiTransition<Property, NameClass>::
|
||||
get_default_dir() const {
|
||||
return _default_dir;
|
||||
}
|
||||
|
|
@ -529,7 +529,7 @@ write_property(ostream &, const Property &, int) const {
|
|||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Property, class NameClass>
|
||||
INLINE MultiTransition<Property, NameClass>::size_type MultiTransition<Property, NameClass>::
|
||||
INLINE_GRAPH MultiTransition<Property, NameClass>::size_type MultiTransition<Property, NameClass>::
|
||||
size() const {
|
||||
return _properties.size();
|
||||
}
|
||||
|
|
@ -541,7 +541,7 @@ size() const {
|
|||
// properties in the transition.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Property, class NameClass>
|
||||
INLINE MultiTransition<Property, NameClass>::const_iterator MultiTransition<Property, NameClass>::
|
||||
INLINE_GRAPH MultiTransition<Property, NameClass>::const_iterator MultiTransition<Property, NameClass>::
|
||||
begin() const {
|
||||
return _properties.begin();
|
||||
}
|
||||
|
|
@ -553,7 +553,7 @@ begin() const {
|
|||
// sequence of properties in the transition.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Property, class NameClass>
|
||||
INLINE MultiTransition<Property, NameClass>::const_iterator MultiTransition<Property, NameClass>::
|
||||
INLINE_GRAPH MultiTransition<Property, NameClass>::const_iterator MultiTransition<Property, NameClass>::
|
||||
end() const {
|
||||
return _properties.end();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,559 @@
|
|||
// 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 ©) :
|
||||
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 ©) {
|
||||
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();
|
||||
}
|
||||
|
||||
|
|
@ -63,8 +63,8 @@ PUBLISHED:
|
|||
// set the default direction, which indicates whether to implicitly
|
||||
// turn on or off (or leave alone) any property not explicitly
|
||||
// mentioned in the transition.
|
||||
INLINE void set_default_dir(TransitionDirection dir);
|
||||
INLINE TransitionDirection get_default_dir() const;
|
||||
INLINE_GRAPH void set_default_dir(TransitionDirection dir);
|
||||
INLINE_GRAPH TransitionDirection get_default_dir() const;
|
||||
|
||||
void set_identity(const Property &prop);
|
||||
void set_on(const Property &prop);
|
||||
|
|
@ -100,9 +100,9 @@ public:
|
|||
typedef Properties::value_type value_type;
|
||||
typedef Properties::size_type size_type;
|
||||
|
||||
INLINE size_type size() const;
|
||||
INLINE const_iterator begin() const;
|
||||
INLINE const_iterator end() const;
|
||||
INLINE_GRAPH size_type size() const;
|
||||
INLINE_GRAPH const_iterator begin() const;
|
||||
INLINE_GRAPH const_iterator end() const;
|
||||
|
||||
private:
|
||||
Properties _properties;
|
||||
|
|
@ -127,6 +127,6 @@ private:
|
|||
static TypeHandle _type_handle;
|
||||
};
|
||||
|
||||
#include "multiTransition.I"
|
||||
#include "multiTransition.T"
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -124,6 +124,8 @@ bmap_apply(InputIterator1 first1, InputIterator1 last1,
|
|||
bool complete_transition, TransitionDirection want_dirs,
|
||||
OutputIterator result);
|
||||
|
||||
#ifdef BUILDING_PANDA
|
||||
#include "multiTransitionHelpers.I"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NamedNode::
|
||||
INLINE_GRAPH NamedNode::
|
||||
NamedNode(const string &initial_name) :
|
||||
Namable(initial_name)
|
||||
{
|
||||
|
|
@ -20,7 +20,7 @@ NamedNode(const string &initial_name) :
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NamedNode::
|
||||
INLINE_GRAPH NamedNode::
|
||||
NamedNode(const NamedNode ©) :
|
||||
Node(copy), Namable(copy)
|
||||
{
|
||||
|
|
@ -31,8 +31,13 @@ NamedNode(const NamedNode ©) :
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NamedNode::
|
||||
INLINE_GRAPH void NamedNode::
|
||||
operator = (const NamedNode ©) {
|
||||
Node::operator = (copy);
|
||||
Namable::operator = (copy);
|
||||
}
|
||||
|
||||
EXPCL_PANDA INLINE_GRAPH ostream & operator << (ostream &out, const NamedNode &nod) {
|
||||
nod.output(out);
|
||||
return out;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@
|
|||
// Created by: drose (15Jan99)
|
||||
//
|
||||
|
||||
#include "namedNode.h"
|
||||
#include <bamWriter.h>
|
||||
#include <bamReader.h>
|
||||
#include <datagram.h>
|
||||
#include <datagramIterator.h>
|
||||
#include "namedNode.h"
|
||||
|
||||
TypeHandle NamedNode::_type_handle;
|
||||
|
||||
|
|
|
|||
|
|
@ -17,22 +17,20 @@
|
|||
////////////////////////////////////////////////////////////////////
|
||||
class EXPCL_PANDA NamedNode : public Node, public Namable {
|
||||
PUBLISHED:
|
||||
INLINE NamedNode(const string &initial_name = "");
|
||||
INLINE_GRAPH NamedNode(const string &initial_name = "");
|
||||
|
||||
public:
|
||||
INLINE NamedNode(const NamedNode ©);
|
||||
INLINE void operator = (const NamedNode ©);
|
||||
INLINE_GRAPH NamedNode(const NamedNode ©);
|
||||
INLINE_GRAPH void operator = (const NamedNode ©);
|
||||
|
||||
virtual Node *make_copy() const;
|
||||
virtual void output(ostream &out) const;
|
||||
|
||||
public:
|
||||
static void register_with_read_factory(void);
|
||||
virtual void write_datagram(BamWriter* manager, Datagram &me);
|
||||
|
||||
static TypedWriteable *make_NamedNode(const FactoryParams ¶ms);
|
||||
|
||||
|
||||
protected:
|
||||
void fillin(DatagramIterator& scan, BamReader* manager);
|
||||
|
||||
|
|
@ -58,13 +56,11 @@ private:
|
|||
|
||||
// We need this operator to specify which output operator (from Node
|
||||
// or Namable) that NamedNode uses.
|
||||
INLINE ostream &
|
||||
operator << (ostream &out, const NamedNode &node) {
|
||||
node.output(out);
|
||||
return out;
|
||||
}
|
||||
EXPCL_PANDA INLINE_GRAPH ostream & operator << (ostream &out, const NamedNode &nod);
|
||||
|
||||
#ifdef BUILDING_PANDA
|
||||
#include "namedNode.I"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
// removes it. Returns true if the arc was found and
|
||||
// removed, false if it did not exist.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool
|
||||
EXPCL_PANDA INLINE_GRAPH bool
|
||||
remove_child(Node *parent, Node *child, TypeHandle graph_type) {
|
||||
NodeRelation *arc = find_arc(parent, child, graph_type);
|
||||
if (arc != (NodeRelation *)NULL) {
|
||||
|
|
@ -21,3 +21,9 @@ remove_child(Node *parent, Node *child, TypeHandle graph_type) {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
INLINE_GRAPH ostream &
|
||||
operator << (ostream &out, const Node &node) {
|
||||
node.output(out);
|
||||
return out;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,43 +141,17 @@ private:
|
|||
static TypeHandle _type_handle;
|
||||
};
|
||||
|
||||
INLINE ostream &
|
||||
operator << (ostream &out, const Node &node) {
|
||||
node.output(out);
|
||||
return out;
|
||||
}
|
||||
INLINE_GRAPH ostream & operator << (ostream &out, const Node &node);
|
||||
|
||||
EXPCL_PANDA NodeRelation *
|
||||
find_arc(Node *parent, Node *child, TypeHandle graph_type);
|
||||
|
||||
INLINE bool
|
||||
EXPCL_PANDA INLINE_GRAPH bool
|
||||
remove_child(Node *parent, Node *child, TypeHandle graph_type);
|
||||
|
||||
|
||||
#ifdef BUILDING_PANDA
|
||||
#include "node.I"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeAttribute::
|
||||
INLINE_GRAPH NodeAttribute::
|
||||
NodeAttribute() {
|
||||
_priority = 0;
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@ NodeAttribute() {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeAttribute::
|
||||
INLINE_GRAPH NodeAttribute::
|
||||
NodeAttribute(const NodeAttribute ©) :
|
||||
TypedReferenceCount(copy),
|
||||
_priority(copy._priority)
|
||||
|
|
@ -30,7 +30,7 @@ NodeAttribute(const NodeAttribute ©) :
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeAttribute::
|
||||
INLINE_GRAPH void NodeAttribute::
|
||||
operator = (const NodeAttribute ©) {
|
||||
TypedReferenceCount::operator = (copy);
|
||||
_priority = copy._priority;
|
||||
|
|
@ -41,7 +41,7 @@ operator = (const NodeAttribute ©) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool NodeAttribute::
|
||||
INLINE_GRAPH bool NodeAttribute::
|
||||
operator == (const NodeAttribute &other) const {
|
||||
return compare_to(other) == 0;
|
||||
}
|
||||
|
|
@ -51,7 +51,7 @@ operator == (const NodeAttribute &other) const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool NodeAttribute::
|
||||
INLINE_GRAPH bool NodeAttribute::
|
||||
operator != (const NodeAttribute &other) const {
|
||||
return compare_to(other) != 0;
|
||||
}
|
||||
|
|
@ -61,7 +61,7 @@ operator != (const NodeAttribute &other) const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool NodeAttribute::
|
||||
INLINE_GRAPH bool NodeAttribute::
|
||||
operator < (const NodeAttribute &other) const {
|
||||
return compare_to(other) < 0;
|
||||
}
|
||||
|
|
@ -71,7 +71,7 @@ operator < (const NodeAttribute &other) const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool NodeAttribute::
|
||||
INLINE_GRAPH bool NodeAttribute::
|
||||
operator <= (const NodeAttribute &other) const {
|
||||
return compare_to(other) <= 0;
|
||||
}
|
||||
|
|
@ -81,7 +81,7 @@ operator <= (const NodeAttribute &other) const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool NodeAttribute::
|
||||
INLINE_GRAPH bool NodeAttribute::
|
||||
operator > (const NodeAttribute &other) const {
|
||||
return compare_to(other) > 0;
|
||||
}
|
||||
|
|
@ -91,7 +91,7 @@ operator > (const NodeAttribute &other) const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool NodeAttribute::
|
||||
INLINE_GRAPH bool NodeAttribute::
|
||||
operator >= (const NodeAttribute &other) const {
|
||||
return compare_to(other) >= 0;
|
||||
}
|
||||
|
|
@ -110,7 +110,7 @@ operator >= (const NodeAttribute &other) const {
|
|||
// of equivalent attributes together in STL structures
|
||||
// like maps and sets.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE int NodeAttribute::
|
||||
INLINE_GRAPH int NodeAttribute::
|
||||
compare_to(const NodeAttribute &other) const {
|
||||
TypeHandle my_handle = get_handle();
|
||||
TypeHandle other_handle = other.get_handle();
|
||||
|
|
@ -131,7 +131,7 @@ compare_to(const NodeAttribute &other) const {
|
|||
// The attribute will not be affected by transitions
|
||||
// with a lower priority.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeAttribute::
|
||||
INLINE_GRAPH void NodeAttribute::
|
||||
set_priority(int priority) {
|
||||
_priority = priority;
|
||||
}
|
||||
|
|
@ -143,7 +143,12 @@ set_priority(int priority) {
|
|||
// Normally this is of limited value; the priority is
|
||||
// meaningful primarily on the transitions.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE int NodeAttribute::
|
||||
INLINE_GRAPH int NodeAttribute::
|
||||
get_priority() const {
|
||||
return _priority;
|
||||
}
|
||||
|
||||
INLINE_GRAPH ostream &operator << (ostream &out, const NodeAttribute &nab) {
|
||||
nab.output(out);
|
||||
return out;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,23 +42,23 @@ class GraphicsStateGuardianBase;
|
|||
////////////////////////////////////////////////////////////////////
|
||||
class EXPCL_PANDA NodeAttribute : public TypedReferenceCount {
|
||||
protected:
|
||||
INLINE NodeAttribute();
|
||||
INLINE NodeAttribute(const NodeAttribute ©);
|
||||
INLINE void operator = (const NodeAttribute ©);
|
||||
INLINE_GRAPH NodeAttribute();
|
||||
INLINE_GRAPH NodeAttribute(const NodeAttribute ©);
|
||||
INLINE_GRAPH void operator = (const NodeAttribute ©);
|
||||
|
||||
public:
|
||||
INLINE bool operator == (const NodeAttribute &other) const;
|
||||
INLINE bool operator != (const NodeAttribute &other) const;
|
||||
INLINE bool operator < (const NodeAttribute &other) const;
|
||||
INLINE bool operator <= (const NodeAttribute &other) const;
|
||||
INLINE bool operator > (const NodeAttribute &other) const;
|
||||
INLINE bool operator >= (const NodeAttribute &other) const;
|
||||
INLINE_GRAPH bool operator == (const NodeAttribute &other) const;
|
||||
INLINE_GRAPH bool operator != (const NodeAttribute &other) const;
|
||||
INLINE_GRAPH bool operator < (const NodeAttribute &other) const;
|
||||
INLINE_GRAPH bool operator <= (const NodeAttribute &other) const;
|
||||
INLINE_GRAPH bool operator > (const NodeAttribute &other) const;
|
||||
INLINE_GRAPH bool operator >= (const NodeAttribute &other) const;
|
||||
|
||||
INLINE int compare_to(const NodeAttribute &other) const;
|
||||
INLINE_GRAPH int compare_to(const NodeAttribute &other) const;
|
||||
|
||||
PUBLISHED:
|
||||
INLINE void set_priority(int priority);
|
||||
INLINE int get_priority() const;
|
||||
INLINE_GRAPH void set_priority(int priority);
|
||||
INLINE_GRAPH int get_priority() const;
|
||||
|
||||
public:
|
||||
virtual NodeAttribute *make_copy() const=0;
|
||||
|
|
@ -99,11 +99,10 @@ private:
|
|||
static TypeHandle _type_handle;
|
||||
};
|
||||
|
||||
INLINE ostream &operator << (ostream &out, const NodeAttribute &nab) {
|
||||
nab.output(out);
|
||||
return out;
|
||||
}
|
||||
INLINE_GRAPH ostream &operator << (ostream &out, const NodeAttribute &nab);
|
||||
|
||||
#ifdef BUILDING_PANDA
|
||||
#include "nodeAttribute.I"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeAttributeWrapper::
|
||||
INLINE_GRAPH NodeAttributeWrapper::
|
||||
NodeAttributeWrapper(TypeHandle handle) : _handle(handle) {
|
||||
nassertv(_handle != TypeHandle::none());
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@ NodeAttributeWrapper(TypeHandle handle) : _handle(handle) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeAttributeWrapper::
|
||||
INLINE_GRAPH NodeAttributeWrapper::
|
||||
NodeAttributeWrapper(const NodeAttributeWrapper ©) :
|
||||
_handle(copy._handle),
|
||||
_attrib(copy._attrib)
|
||||
|
|
@ -30,7 +30,7 @@ NodeAttributeWrapper(const NodeAttributeWrapper ©) :
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeAttributeWrapper::
|
||||
INLINE_GRAPH void NodeAttributeWrapper::
|
||||
operator = (const NodeAttributeWrapper ©) {
|
||||
_handle = copy._handle;
|
||||
_attrib = copy._attrib;
|
||||
|
|
@ -41,7 +41,7 @@ operator = (const NodeAttributeWrapper ©) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE TypeHandle NodeAttributeWrapper::
|
||||
INLINE_GRAPH TypeHandle NodeAttributeWrapper::
|
||||
get_handle() const {
|
||||
return _handle;
|
||||
}
|
||||
|
|
@ -51,7 +51,7 @@ get_handle() const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeAttribute *NodeAttributeWrapper::
|
||||
INLINE_GRAPH NodeAttribute *NodeAttributeWrapper::
|
||||
get_attrib() const {
|
||||
return _attrib;
|
||||
}
|
||||
|
|
@ -61,7 +61,7 @@ get_attrib() const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeAttributeWrapper::
|
||||
INLINE_GRAPH void NodeAttributeWrapper::
|
||||
set_attrib(NodeAttribute *attrib) {
|
||||
_attrib = attrib;
|
||||
}
|
||||
|
|
@ -72,7 +72,7 @@ set_attrib(NodeAttribute *attrib) {
|
|||
// Description: Returns true if the wrapper represents an initial
|
||||
// attribute.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool NodeAttributeWrapper::
|
||||
INLINE_GRAPH bool NodeAttributeWrapper::
|
||||
is_initial() const {
|
||||
return (_attrib == (NodeAttribute *)NULL);
|
||||
// || _attrib->is_initial()
|
||||
|
|
@ -83,7 +83,7 @@ is_initial() const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE int NodeAttributeWrapper::
|
||||
INLINE_GRAPH int NodeAttributeWrapper::
|
||||
compare_to(const NodeAttributeWrapper &other) const {
|
||||
nassertr(_handle == other._handle, false);
|
||||
if (_attrib == other._attrib) {
|
||||
|
|
@ -103,30 +103,12 @@ compare_to(const NodeAttributeWrapper &other) const {
|
|||
// Access: Public
|
||||
// Description: Resets the wrapper to the initial attribute.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeAttributeWrapper::
|
||||
INLINE_GRAPH void NodeAttributeWrapper::
|
||||
make_initial() {
|
||||
_attrib.clear();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: get_attribute_into
|
||||
// Description: This external template function is handy for
|
||||
// extracting the attribute (of a known type) from the
|
||||
// wrapper. If the attribute exists, it is
|
||||
// automatically downcasted to the correct type and
|
||||
// stored in the pointer given in the first parameter,
|
||||
// and the return value is true. If the attribute does
|
||||
// not exist, the pointer is filled with NULL and the
|
||||
// return value is false.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Attribute>
|
||||
INLINE bool
|
||||
get_attribute_into(Attribute *&ptr, const NodeAttributeWrapper &attrib) {
|
||||
NodeAttribute *nt = attrib.get_attrib();
|
||||
if (nt == (NodeAttribute *)NULL) {
|
||||
ptr = (Attribute *)NULL;
|
||||
return false;
|
||||
}
|
||||
DCAST_INTO_R(ptr, nt, false);
|
||||
return true;
|
||||
INLINE_GRAPH ostream &operator << (ostream &out, const NodeAttributeWrapper &naw) {
|
||||
naw.output(out);
|
||||
return out;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
// Filename: nodeAttributeWrapper.T
|
||||
// Created by: drose (20Mar00)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: get_attribute_into
|
||||
// Description: This external template function is handy for
|
||||
// extracting the attribute (of a known type) from the
|
||||
// wrapper. If the attribute exists, it is
|
||||
// automatically downcasted to the correct type and
|
||||
// stored in the pointer given in the first parameter,
|
||||
// and the return value is true. If the attribute does
|
||||
// not exist, the pointer is filled with NULL and the
|
||||
// return value is false.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Attribute>
|
||||
INLINE_GRAPH bool
|
||||
get_attribute_into(Attribute *&ptr, const NodeAttributeWrapper &attrib) {
|
||||
NodeAttribute *nt = attrib.get_attrib();
|
||||
if (nt == (NodeAttribute *)NULL) {
|
||||
ptr = (Attribute *)NULL;
|
||||
return false;
|
||||
}
|
||||
DCAST_INTO_R(ptr, nt, false);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -24,19 +24,19 @@ public:
|
|||
typedef NodeTransitionWrapper TransitionWrapper;
|
||||
typedef NodeAttributeWrapper AttributeWrapper;
|
||||
|
||||
INLINE NodeAttributeWrapper(TypeHandle handle);
|
||||
INLINE NodeAttributeWrapper(const NodeAttributeWrapper ©);
|
||||
INLINE void operator = (const NodeAttributeWrapper ©);
|
||||
INLINE_GRAPH NodeAttributeWrapper(TypeHandle handle);
|
||||
INLINE_GRAPH NodeAttributeWrapper(const NodeAttributeWrapper ©);
|
||||
INLINE_GRAPH void operator = (const NodeAttributeWrapper ©);
|
||||
static NodeAttributeWrapper init_from(const NodeTransitionWrapper &trans);
|
||||
|
||||
INLINE TypeHandle get_handle() const;
|
||||
INLINE NodeAttribute *get_attrib() const;
|
||||
INLINE void set_attrib(NodeAttribute *attrib);
|
||||
INLINE_GRAPH TypeHandle get_handle() const;
|
||||
INLINE_GRAPH NodeAttribute *get_attrib() const;
|
||||
INLINE_GRAPH void set_attrib(NodeAttribute *attrib);
|
||||
|
||||
INLINE bool is_initial() const;
|
||||
INLINE int compare_to(const NodeAttributeWrapper &other) const;
|
||||
INLINE_GRAPH bool is_initial() const;
|
||||
INLINE_GRAPH int compare_to(const NodeAttributeWrapper &other) const;
|
||||
|
||||
INLINE void make_initial();
|
||||
INLINE_GRAPH void make_initial();
|
||||
void apply_in_place(const NodeTransitionWrapper &trans);
|
||||
|
||||
void output(ostream &out) const;
|
||||
|
|
@ -47,15 +47,12 @@ private:
|
|||
PT(NodeAttribute) _attrib;
|
||||
};
|
||||
|
||||
INLINE ostream &operator << (ostream &out, const NodeAttributeWrapper &naw) {
|
||||
naw.output(out);
|
||||
return out;
|
||||
}
|
||||
INLINE_GRAPH ostream &operator << (ostream &out, const NodeAttributeWrapper &naw);
|
||||
|
||||
#include "nodeAttributeWrapper.T"
|
||||
|
||||
#ifdef BUILDING_PANDA
|
||||
#include "nodeAttributeWrapper.I"
|
||||
|
||||
template<class Attribute>
|
||||
INLINE bool
|
||||
get_attribute_into(Attribute *&ptr, const NodeAttributeWrapper &trans);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeAttributes::size_type NodeAttributes::
|
||||
INLINE_GRAPH NodeAttributes::size_type NodeAttributes::
|
||||
size() const {
|
||||
return _attributes.size();
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@ size() const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeAttributes::iterator NodeAttributes::
|
||||
INLINE_GRAPH NodeAttributes::iterator NodeAttributes::
|
||||
begin() {
|
||||
return _attributes.begin();
|
||||
}
|
||||
|
|
@ -28,7 +28,7 @@ begin() {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeAttributes::iterator NodeAttributes::
|
||||
INLINE_GRAPH NodeAttributes::iterator NodeAttributes::
|
||||
end() {
|
||||
return _attributes.end();
|
||||
}
|
||||
|
|
@ -38,7 +38,7 @@ end() {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeAttributes::const_iterator NodeAttributes::
|
||||
INLINE_GRAPH NodeAttributes::const_iterator NodeAttributes::
|
||||
begin() const {
|
||||
return _attributes.begin();
|
||||
}
|
||||
|
|
@ -48,7 +48,7 @@ begin() const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeAttributes::const_iterator NodeAttributes::
|
||||
INLINE_GRAPH NodeAttributes::const_iterator NodeAttributes::
|
||||
end() const {
|
||||
return _attributes.end();
|
||||
}
|
||||
|
|
@ -58,7 +58,7 @@ end() const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeAttributes::iterator NodeAttributes::
|
||||
INLINE_GRAPH NodeAttributes::iterator NodeAttributes::
|
||||
insert(NodeAttributes::iterator position,
|
||||
const NodeAttributes::value_type &x) {
|
||||
return _attributes.insert(position, x);
|
||||
|
|
@ -69,7 +69,7 @@ insert(NodeAttributes::iterator position,
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeAttributes::
|
||||
INLINE_GRAPH void NodeAttributes::
|
||||
erase(NodeAttributes::iterator position) {
|
||||
_attributes.erase(position);
|
||||
}
|
||||
|
|
@ -80,7 +80,7 @@ erase(NodeAttributes::iterator position) {
|
|||
// Description: Modifies the current NodeAttributes object to reflect
|
||||
// the application of the indicated transitions.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeAttributes::
|
||||
INLINE_GRAPH void NodeAttributes::
|
||||
apply_in_place(const NodeTransitionCache &trans) {
|
||||
apply_from(*this, trans);
|
||||
}
|
||||
|
|
@ -93,33 +93,15 @@ apply_in_place(const NodeTransitionCache &trans) {
|
|||
// NodeAttributes to the indicated transition cache.
|
||||
// This NodeAttributes object is not changed.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeAttributes *NodeAttributes::
|
||||
INLINE_GRAPH NodeAttributes *NodeAttributes::
|
||||
apply(const NodeTransitionCache &trans) const {
|
||||
NodeAttributes *na = new NodeAttributes;
|
||||
na->apply_from(*this, trans);
|
||||
return na;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: get_attribute_into
|
||||
// Description: This external template function is handy for
|
||||
// extracting a attribute of a particular type from the
|
||||
// set. If the attribute exists, it is automatically
|
||||
// downcasted to the correct type and stored in the
|
||||
// pointer given in the first parameter, and the return
|
||||
// value is true. If the attribute does not exist, the
|
||||
// pointer is filled with NULL and the return value is
|
||||
// false.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Attribute>
|
||||
INLINE bool
|
||||
get_attribute_into(Attribute *&ptr, const NodeAttributes &attrib,
|
||||
TypeHandle transition_type) {
|
||||
NodeAttribute *nt = attrib.get_attribute(transition_type);
|
||||
if (nt == (NodeAttribute *)NULL) {
|
||||
ptr = (Attribute *)NULL;
|
||||
return false;
|
||||
}
|
||||
DCAST_INTO_R(ptr, nt, false);
|
||||
return true;
|
||||
INLINE_GRAPH ostream &operator << (ostream &out, const NodeAttributes &nas) {
|
||||
nas.output(out);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
// Filename: nodeAttributes.T
|
||||
// Created by: drose (21Mar00)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: get_attribute_into
|
||||
// Description: This external template function is handy for
|
||||
// extracting a attribute of a particular type from the
|
||||
// set. If the attribute exists, it is automatically
|
||||
// downcasted to the correct type and stored in the
|
||||
// pointer given in the first parameter, and the return
|
||||
// value is true. If the attribute does not exist, the
|
||||
// pointer is filled with NULL and the return value is
|
||||
// false.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Attribute>
|
||||
INLINE_GRAPH bool
|
||||
get_attribute_into(Attribute *&ptr, const NodeAttributes &attrib,
|
||||
TypeHandle transition_type) {
|
||||
NodeAttribute *nt = attrib.get_attribute(transition_type);
|
||||
if (nt == (NodeAttribute *)NULL) {
|
||||
ptr = (Attribute *)NULL;
|
||||
return false;
|
||||
}
|
||||
DCAST_INTO_R(ptr, nt, false);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -54,17 +54,17 @@ public:
|
|||
typedef Attributes::value_type value_type;
|
||||
typedef Attributes::size_type size_type;
|
||||
|
||||
INLINE size_type size() const;
|
||||
INLINE iterator begin();
|
||||
INLINE iterator end();
|
||||
INLINE const_iterator begin() const;
|
||||
INLINE const_iterator end() const;
|
||||
INLINE iterator insert(iterator position, const value_type &x);
|
||||
INLINE void erase(iterator position);
|
||||
INLINE_GRAPH size_type size() const;
|
||||
INLINE_GRAPH iterator begin();
|
||||
INLINE_GRAPH iterator end();
|
||||
INLINE_GRAPH const_iterator begin() const;
|
||||
INLINE_GRAPH const_iterator end() const;
|
||||
INLINE_GRAPH iterator insert(iterator position, const value_type &x);
|
||||
INLINE_GRAPH void erase(iterator position);
|
||||
|
||||
public:
|
||||
INLINE void apply_in_place(const NodeTransitionCache &trans);
|
||||
INLINE NodeAttributes *apply(const NodeTransitionCache &trans) const;
|
||||
INLINE_GRAPH void apply_in_place(const NodeTransitionCache &trans);
|
||||
INLINE_GRAPH NodeAttributes *apply(const NodeTransitionCache &trans) const;
|
||||
void apply_from(const NodeAttributes &other,
|
||||
const NodeTransitionCache &trans);
|
||||
|
||||
|
|
@ -76,19 +76,16 @@ PUBLISHED:
|
|||
|
||||
private:
|
||||
Attributes _attributes;
|
||||
friend class NodeAttributeCache;
|
||||
friend class NodeAttributeCache;
|
||||
};
|
||||
|
||||
INLINE ostream &operator << (ostream &out, const NodeAttributes &nas) {
|
||||
nas.output(out);
|
||||
return out;
|
||||
}
|
||||
INLINE_GRAPH ostream &operator << (ostream &out, const NodeAttributes &nas);
|
||||
|
||||
template<class Attribute>
|
||||
INLINE bool
|
||||
get_attribute_into(Attribute *&ptr, const NodeAttributes &attrib,
|
||||
TypeHandle transition_type);
|
||||
#include "nodeAttributes.T"
|
||||
|
||||
#ifdef BUILDING_PANDA
|
||||
#include "nodeAttributes.I"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
// will also delete the arc unless there are some
|
||||
// additional outstanding pointers to it.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void
|
||||
EXPCL_PANDA INLINE_GRAPH void
|
||||
remove_arc(NodeRelation *arc) {
|
||||
PT(NodeRelation) hold_arc = arc->detach();
|
||||
arc->_parent = NULL;
|
||||
|
|
@ -21,7 +21,7 @@ remove_arc(NodeRelation *arc) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeRelation::
|
||||
INLINE_GRAPH void NodeRelation::
|
||||
output_transitions(ostream &out) const {
|
||||
out << _transitions;
|
||||
}
|
||||
|
|
@ -31,7 +31,7 @@ output_transitions(ostream &out) const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeRelation::
|
||||
INLINE_GRAPH void NodeRelation::
|
||||
write_transitions(ostream &out, int indent_level) const {
|
||||
_transitions.write(out, indent_level);
|
||||
}
|
||||
|
|
@ -41,7 +41,7 @@ write_transitions(ostream &out, int indent_level) const {
|
|||
// Access: Public
|
||||
// Description: Returns the node above the arc in the scene graph.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE Node *NodeRelation::
|
||||
INLINE_GRAPH Node *NodeRelation::
|
||||
get_parent() const {
|
||||
return _parent;
|
||||
}
|
||||
|
|
@ -51,7 +51,7 @@ get_parent() const {
|
|||
// Access: Public
|
||||
// Description: Returns the node below the arc in the scene graph.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE Node *NodeRelation::
|
||||
INLINE_GRAPH Node *NodeRelation::
|
||||
get_child() const {
|
||||
return _child;
|
||||
}
|
||||
|
|
@ -62,7 +62,7 @@ get_child() const {
|
|||
// Description: Returns the sorting index of the arc. This affects
|
||||
// its apparent position among its list of siblings.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE int NodeRelation::
|
||||
INLINE_GRAPH int NodeRelation::
|
||||
get_sort() const {
|
||||
return _sort;
|
||||
}
|
||||
|
|
@ -76,7 +76,7 @@ get_sort() const {
|
|||
// A node may simultaneously have many arcs of different
|
||||
// types.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE TypeHandle NodeRelation::
|
||||
INLINE_GRAPH TypeHandle NodeRelation::
|
||||
get_graph_type() const {
|
||||
return _graph_type;
|
||||
}
|
||||
|
|
@ -86,7 +86,7 @@ get_graph_type() const {
|
|||
// Access: Public
|
||||
// Description: Changes the parent of the arc to a different node.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeRelation::
|
||||
INLINE_GRAPH void NodeRelation::
|
||||
change_parent(Node *parent) {
|
||||
PT(NodeRelation) hold_arc = detach();
|
||||
_parent = parent;
|
||||
|
|
@ -99,7 +99,7 @@ change_parent(Node *parent) {
|
|||
// Description: Changes the parent of the arc to a different node,
|
||||
// simultaneously changing the sort index.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeRelation::
|
||||
INLINE_GRAPH void NodeRelation::
|
||||
change_parent(Node *parent, int sort) {
|
||||
PT(NodeRelation) hold_arc = detach();
|
||||
_parent = parent;
|
||||
|
|
@ -112,7 +112,7 @@ change_parent(Node *parent, int sort) {
|
|||
// Access: Public
|
||||
// Description: Changes the child of the arc to a different node.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeRelation::
|
||||
INLINE_GRAPH void NodeRelation::
|
||||
change_child(Node *child) {
|
||||
PT(NodeRelation) hold_arc = detach();
|
||||
_child = child;
|
||||
|
|
@ -125,7 +125,7 @@ change_child(Node *child) {
|
|||
// Description: Simultaneously moves both the parent and child of the
|
||||
// arc to different nodes.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeRelation::
|
||||
INLINE_GRAPH void NodeRelation::
|
||||
change_parent_and_child(Node *parent, Node *child) {
|
||||
PT(NodeRelation) hold_arc = detach();
|
||||
_parent = parent;
|
||||
|
|
@ -139,7 +139,7 @@ change_parent_and_child(Node *parent, Node *child) {
|
|||
// Description: Changes the sorting index of the arc. This affects
|
||||
// its apparent position among its list of siblings.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeRelation::
|
||||
INLINE_GRAPH void NodeRelation::
|
||||
set_sort(int sort) {
|
||||
PT(NodeRelation) hold_arc = detach();
|
||||
_sort = sort;
|
||||
|
|
@ -153,7 +153,7 @@ set_sort(int sort) {
|
|||
// arc into a totally different graph; it may now be
|
||||
// detected only by a special traversal.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeRelation::
|
||||
INLINE_GRAPH void NodeRelation::
|
||||
set_graph_type(TypeHandle graph_type) {
|
||||
PT(NodeRelation) hold_arc = detach();
|
||||
_graph_type = graph_type;
|
||||
|
|
@ -174,7 +174,7 @@ set_graph_type(TypeHandle graph_type) {
|
|||
// transition in the set, if any, or NULL if there was
|
||||
// none.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE PT(NodeTransition) NodeRelation::
|
||||
INLINE_GRAPH PT(NodeTransition) NodeRelation::
|
||||
set_transition(NodeTransition *trans) {
|
||||
nassertr(trans != (NodeTransition *)NULL, NULL);
|
||||
nassertr(trans->get_handle() != TypeHandle::none(), NULL);
|
||||
|
|
@ -190,7 +190,7 @@ set_transition(NodeTransition *trans) {
|
|||
// this will be used for creating override transitions
|
||||
// on-the-fly.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE PT(NodeTransition) NodeRelation::
|
||||
INLINE_GRAPH PT(NodeTransition) NodeRelation::
|
||||
set_transition(NodeTransition *trans, int priority) {
|
||||
nassertr(trans != (NodeTransition *)NULL, NULL);
|
||||
nassertr(trans->get_handle() != TypeHandle::none(), NULL);
|
||||
|
|
@ -205,7 +205,7 @@ set_transition(NodeTransition *trans, int priority) {
|
|||
// indicated handle has been stored on the arc (even if
|
||||
// it is the identity transition), or false otherwise.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool NodeRelation::
|
||||
INLINE_GRAPH bool NodeRelation::
|
||||
has_transition(TypeHandle handle) const {
|
||||
return _transitions.has_transition(handle);
|
||||
}
|
||||
|
|
@ -217,7 +217,7 @@ has_transition(TypeHandle handle) const {
|
|||
// the arc (even if it is the identity transition), or
|
||||
// false otherwise.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool NodeRelation::
|
||||
INLINE_GRAPH bool NodeRelation::
|
||||
has_any_transition() const {
|
||||
return !_transitions.is_empty();
|
||||
}
|
||||
|
|
@ -229,7 +229,7 @@ has_any_transition() const {
|
|||
// handle, or NULL if no such transition has been stored
|
||||
// on the arc.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeTransition *NodeRelation::
|
||||
INLINE_GRAPH NodeTransition *NodeRelation::
|
||||
get_transition(TypeHandle handle) const {
|
||||
return _transitions.get_transition(handle);
|
||||
}
|
||||
|
|
@ -242,7 +242,7 @@ get_transition(TypeHandle handle) const {
|
|||
// they sort after, or zero if the sets of transitions
|
||||
// are equivalent.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE int NodeRelation::
|
||||
INLINE_GRAPH int NodeRelation::
|
||||
compare_transitions_to(const NodeRelation *arc) const {
|
||||
return _transitions.compare_to(arc->_transitions);
|
||||
}
|
||||
|
|
@ -256,7 +256,7 @@ compare_transitions_to(const NodeRelation *arc) const {
|
|||
// can do with this is store it and note whether it
|
||||
// increases.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE UpdateSeq NodeRelation::
|
||||
INLINE_GRAPH UpdateSeq NodeRelation::
|
||||
get_last_update() const {
|
||||
return _last_update;
|
||||
}
|
||||
|
|
@ -268,7 +268,7 @@ get_last_update() const {
|
|||
// type, and immediately attaches it. Returns NULL if
|
||||
// the type is unknown.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeRelation *NodeRelation::
|
||||
INLINE_GRAPH NodeRelation *NodeRelation::
|
||||
create_typed_arc(TypeHandle type, Node *parent, Node *child, int sort) {
|
||||
NodeRelation *arc = get_factory().make_instance(type);
|
||||
if (arc != (NodeRelation *)NULL) {
|
||||
|
|
@ -287,7 +287,7 @@ create_typed_arc(TypeHandle type, Node *parent, Node *child, int sort) {
|
|||
// This is only intended to be called at initialization
|
||||
// time; don't call it directly.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeRelation::
|
||||
INLINE_GRAPH void NodeRelation::
|
||||
register_with_factory() {
|
||||
get_factory().register_factory(get_class_type(), make_arc);
|
||||
}
|
||||
|
|
@ -300,7 +300,7 @@ register_with_factory() {
|
|||
// has been called. This is necessary to guarantee
|
||||
// ordering at static init time.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE Factory<NodeRelation> &NodeRelation::
|
||||
INLINE_GRAPH Factory<NodeRelation> &NodeRelation::
|
||||
get_factory() {
|
||||
if (_factory == (Factory<NodeRelation> *)NULL) {
|
||||
_factory = new Factory<NodeRelation>;
|
||||
|
|
@ -313,7 +313,7 @@ get_factory() {
|
|||
// Access: Public, Static
|
||||
// Description: Returns the TypeHandle associated with this type.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE TypeHandle NodeRelation::
|
||||
INLINE_GRAPH TypeHandle NodeRelation::
|
||||
get_class_type() {
|
||||
return _type_handle;
|
||||
}
|
||||
|
|
@ -328,37 +328,14 @@ get_class_type() {
|
|||
// removing themselves from the bounding volumes of
|
||||
// their parents, should set their graph_type to.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE TypeHandle NodeRelation::
|
||||
INLINE_GRAPH TypeHandle NodeRelation::
|
||||
get_stashed_type() {
|
||||
return _stashed_type_handle;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: get_transition_into
|
||||
// Description: This external template function is handy for
|
||||
// extracting a transition of a particular type from the
|
||||
// arc. If the transition exists, it is automatically
|
||||
// downcasted to the correct type and stored in the
|
||||
// pointer given in the first parameter, and the return
|
||||
// value is true. If the transition does not exist, the
|
||||
// pointer is filled with NULL and the return value is
|
||||
// false.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Transition>
|
||||
INLINE bool
|
||||
get_transition_into(Transition *&ptr, const NodeRelation *arc,
|
||||
TypeHandle transition_type) {
|
||||
NodeTransition *nt = arc->get_transition(transition_type);
|
||||
if (nt == (NodeTransition *)NULL) {
|
||||
ptr = (Transition *)NULL;
|
||||
return false;
|
||||
}
|
||||
DCAST_INTO_R(ptr, nt, false);
|
||||
return true;
|
||||
EXPCL_PANDA INLINE_GRAPH ostream &
|
||||
operator << (ostream &out, const NodeRelation &arc) {
|
||||
arc.output(out);
|
||||
return out;
|
||||
}
|
||||
|
||||
template<class Transition>
|
||||
INLINE bool
|
||||
get_transition_into(Transition *&ptr, const NodeRelation *arc) {
|
||||
return get_transition_into(ptr, arc, Transition::get_class_type());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
// Filename: nodeRelation.T
|
||||
// Created by: drose (30Sep99)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: get_transition_into
|
||||
// Description: This external template function is handy for
|
||||
// extracting a transition of a particular type from the
|
||||
// arc. If the transition exists, it is automatically
|
||||
// downcasted to the correct type and stored in the
|
||||
// pointer given in the first parameter, and the return
|
||||
// value is true. If the transition does not exist, the
|
||||
// pointer is filled with NULL and the return value is
|
||||
// false.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Transition>
|
||||
INLINE_GRAPH bool
|
||||
get_transition_into(Transition *&ptr, const NodeRelation *arc,
|
||||
TypeHandle transition_type) {
|
||||
NodeTransition *nt = arc->get_transition(transition_type);
|
||||
if (nt == (NodeTransition *)NULL) {
|
||||
ptr = (Transition *)NULL;
|
||||
return false;
|
||||
}
|
||||
DCAST_INTO_R(ptr, nt, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
template<class Transition>
|
||||
INLINE_GRAPH bool
|
||||
get_transition_into(Transition *&ptr, const NodeRelation *arc) {
|
||||
return get_transition_into(ptr, arc, Transition::get_class_type());
|
||||
}
|
||||
|
|
@ -62,7 +62,7 @@ init_last_graph_update() {
|
|||
////////////////////////////////////////////////////////////////////
|
||||
#ifdef NDEBUG
|
||||
template<class Iterator>
|
||||
INLINE void
|
||||
INLINE_GRAPH void
|
||||
verify_arc_list(Iterator, Iterator) {
|
||||
}
|
||||
#else // NDEBUG
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ class Node;
|
|||
// type of graph, hence the parameter.
|
||||
extern EXPCL_PANDA UpdateSeq &last_graph_update(TypeHandle graph_type);
|
||||
|
||||
extern EXPCL_PANDA INLINE_GRAPH void remove_arc(NodeRelation *arc);
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
// Class : NodeRelation
|
||||
// Description : The base class for all scene graph arcs. This is the
|
||||
|
|
@ -70,41 +72,41 @@ public:
|
|||
|
||||
PUBLISHED:
|
||||
void output(ostream &out) const;
|
||||
INLINE void output_transitions(ostream &out) const;
|
||||
INLINE void write_transitions(ostream &out, int indent = 0) const;
|
||||
INLINE_GRAPH void output_transitions(ostream &out) const;
|
||||
INLINE_GRAPH void write_transitions(ostream &out, int indent = 0) const;
|
||||
|
||||
INLINE Node *get_parent() const;
|
||||
INLINE Node *get_child() const;
|
||||
INLINE int get_sort() const;
|
||||
INLINE TypeHandle get_graph_type() const;
|
||||
INLINE_GRAPH Node *get_parent() const;
|
||||
INLINE_GRAPH Node *get_child() const;
|
||||
INLINE_GRAPH int get_sort() const;
|
||||
INLINE_GRAPH TypeHandle get_graph_type() const;
|
||||
|
||||
void ref_parent();
|
||||
void unref_parent();
|
||||
|
||||
INLINE void change_parent(Node *parent);
|
||||
INLINE void change_parent(Node *parent, int sort);
|
||||
INLINE void change_child(Node *child);
|
||||
INLINE void change_parent_and_child(Node *parent, Node *child);
|
||||
INLINE void set_sort(int sort);
|
||||
INLINE void set_graph_type(TypeHandle graph_type);
|
||||
INLINE_GRAPH void change_parent(Node *parent);
|
||||
INLINE_GRAPH void change_parent(Node *parent, int sort);
|
||||
INLINE_GRAPH void change_child(Node *child);
|
||||
INLINE_GRAPH void change_parent_and_child(Node *parent, Node *child);
|
||||
INLINE_GRAPH void set_sort(int sort);
|
||||
INLINE_GRAPH void set_graph_type(TypeHandle graph_type);
|
||||
|
||||
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);
|
||||
PT(NodeTransition) clear_transition(TypeHandle handle); /*DONT INLINE THIS*/
|
||||
PT(NodeTransition) set_transition(TypeHandle handle, NodeTransition *trans); /*DONT INLINE_GRAPH THIS*/
|
||||
INLINE_GRAPH PT(NodeTransition) set_transition(NodeTransition *trans);
|
||||
INLINE_GRAPH PT(NodeTransition) set_transition(NodeTransition *trans, int priority);
|
||||
PT(NodeTransition) clear_transition(TypeHandle handle); /*DONT INLINE_GRAPH THIS*/
|
||||
|
||||
INLINE bool has_transition(TypeHandle handle) const;
|
||||
INLINE bool has_any_transition() const;
|
||||
INLINE NodeTransition *get_transition(TypeHandle handle) const;
|
||||
INLINE_GRAPH bool has_transition(TypeHandle handle) const;
|
||||
INLINE_GRAPH bool has_any_transition() const;
|
||||
INLINE_GRAPH NodeTransition *get_transition(TypeHandle handle) const;
|
||||
void copy_transitions_from(const NodeRelation *arc);
|
||||
void compose_transitions_from(const NodeRelation *arc);
|
||||
void copy_transitions_from(const NodeTransitions &trans);
|
||||
void compose_transitions_from(const NodeTransitions &trans);
|
||||
void adjust_all_priorities(int adjustment);
|
||||
|
||||
INLINE int compare_transitions_to(const NodeRelation *arc) const;
|
||||
INLINE_GRAPH int compare_transitions_to(const NodeRelation *arc) const;
|
||||
|
||||
INLINE UpdateSeq get_last_update() const;
|
||||
INLINE_GRAPH UpdateSeq get_last_update() const;
|
||||
|
||||
public:
|
||||
bool sub_render_trans(const AllAttributesWrapper &attrib,
|
||||
|
|
@ -116,15 +118,15 @@ public:
|
|||
public:
|
||||
// Factory stuff: to create a new NodeRelation based on its
|
||||
// TypeHandle.
|
||||
INLINE static NodeRelation *
|
||||
INLINE_GRAPH static NodeRelation *
|
||||
create_typed_arc(TypeHandle type, Node *parent, Node *child, int sort = 0);
|
||||
|
||||
// This is just to be called at initialization time; don't try to
|
||||
// call this directly.
|
||||
INLINE static void register_with_factory();
|
||||
INLINE_GRAPH static void register_with_factory();
|
||||
|
||||
protected:
|
||||
INLINE static Factory<NodeRelation> &get_factory();
|
||||
INLINE_GRAPH static Factory<NodeRelation> &get_factory();
|
||||
|
||||
private:
|
||||
static NodeRelation *make_arc(const FactoryParams ¶ms);
|
||||
|
|
@ -196,8 +198,8 @@ protected:
|
|||
virtual void recompute_bound();
|
||||
|
||||
PUBLISHED:
|
||||
INLINE static TypeHandle get_class_type();
|
||||
INLINE static TypeHandle get_stashed_type();
|
||||
INLINE_GRAPH static TypeHandle get_class_type();
|
||||
INLINE_GRAPH static TypeHandle get_stashed_type();
|
||||
|
||||
public:
|
||||
static void init_type();
|
||||
|
|
@ -208,29 +210,15 @@ private:
|
|||
static TypeHandle _type_handle;
|
||||
static TypeHandle _stashed_type_handle;
|
||||
|
||||
friend INLINE void remove_arc(NodeRelation *arc);
|
||||
friend extern EXPCL_PANDA INLINE_GRAPH void remove_arc(NodeRelation *arc);
|
||||
friend class Node;
|
||||
friend class NodeTransitionWrapper;
|
||||
friend class AllTransitionsWrapper;
|
||||
friend class GraphPriorityAdjuster;
|
||||
};
|
||||
|
||||
INLINE ostream &
|
||||
operator << (ostream &out, const NodeRelation &arc) {
|
||||
arc.output(out);
|
||||
return out;
|
||||
}
|
||||
|
||||
INLINE void remove_arc(NodeRelation *arc);
|
||||
|
||||
template<class Transition>
|
||||
INLINE bool
|
||||
get_transition_into(Transition *&ptr, const NodeRelation *arc,
|
||||
TypeHandle transition_type);
|
||||
|
||||
template<class Transition>
|
||||
INLINE bool
|
||||
get_transition_into(Transition *&ptr, const NodeRelation *arc);
|
||||
EXPCL_PANDA INLINE_GRAPH ostream &
|
||||
operator << (ostream &out, const NodeRelation &arc);
|
||||
|
||||
typedef vector< PT(NodeRelation) > DownRelationPointers;
|
||||
typedef map<TypeHandle, DownRelationPointers> DownRelations;
|
||||
|
|
@ -238,7 +226,11 @@ typedef map<TypeHandle, DownRelationPointers> DownRelations;
|
|||
typedef vector<NodeRelation *> UpRelationPointers;
|
||||
typedef map<TypeHandle, UpRelationPointers> UpRelations;
|
||||
|
||||
#include "nodeRelation.T"
|
||||
|
||||
#ifdef BUILDING_PANDA
|
||||
#include "nodeRelation.I"
|
||||
#endif
|
||||
|
||||
// We include node.h here at the end, so we'll know that nodes are of
|
||||
// type ReferenceCount and will be able to compile anything that uses
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeTransition::
|
||||
INLINE_GRAPH NodeTransition::
|
||||
NodeTransition() {
|
||||
_priority = 0;
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@ NodeTransition() {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeTransition::
|
||||
INLINE_GRAPH NodeTransition::
|
||||
NodeTransition(const NodeTransition ©) :
|
||||
TypedWriteableReferenceCount(copy),
|
||||
_priority(copy._priority)
|
||||
|
|
@ -31,7 +31,7 @@ NodeTransition(const NodeTransition ©) :
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeTransition::
|
||||
INLINE_GRAPH void NodeTransition::
|
||||
operator = (const NodeTransition ©) {
|
||||
TypedWriteableReferenceCount::operator = (copy);
|
||||
_priority = copy._priority;
|
||||
|
|
@ -43,7 +43,7 @@ operator = (const NodeTransition ©) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool NodeTransition::
|
||||
INLINE_GRAPH bool NodeTransition::
|
||||
operator == (const NodeTransition &other) const {
|
||||
return compare_to(other) == 0;
|
||||
}
|
||||
|
|
@ -53,7 +53,7 @@ operator == (const NodeTransition &other) const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool NodeTransition::
|
||||
INLINE_GRAPH bool NodeTransition::
|
||||
operator != (const NodeTransition &other) const {
|
||||
return compare_to(other) != 0;
|
||||
}
|
||||
|
|
@ -63,7 +63,7 @@ operator != (const NodeTransition &other) const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool NodeTransition::
|
||||
INLINE_GRAPH bool NodeTransition::
|
||||
operator < (const NodeTransition &other) const {
|
||||
return compare_to(other) < 0;
|
||||
}
|
||||
|
|
@ -73,7 +73,7 @@ operator < (const NodeTransition &other) const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool NodeTransition::
|
||||
INLINE_GRAPH bool NodeTransition::
|
||||
operator <= (const NodeTransition &other) const {
|
||||
return compare_to(other) <= 0;
|
||||
}
|
||||
|
|
@ -83,7 +83,7 @@ operator <= (const NodeTransition &other) const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool NodeTransition::
|
||||
INLINE_GRAPH bool NodeTransition::
|
||||
operator > (const NodeTransition &other) const {
|
||||
return compare_to(other) > 0;
|
||||
}
|
||||
|
|
@ -93,7 +93,7 @@ operator > (const NodeTransition &other) const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool NodeTransition::
|
||||
INLINE_GRAPH bool NodeTransition::
|
||||
operator >= (const NodeTransition &other) const {
|
||||
return compare_to(other) >= 0;
|
||||
}
|
||||
|
|
@ -112,7 +112,7 @@ operator >= (const NodeTransition &other) const {
|
|||
// of equivalent transitions together in STL structures
|
||||
// like maps and sets.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE int NodeTransition::
|
||||
INLINE_GRAPH int NodeTransition::
|
||||
compare_to(const NodeTransition &other) const {
|
||||
TypeHandle my_handle = get_handle();
|
||||
TypeHandle other_handle = other.get_handle();
|
||||
|
|
@ -136,7 +136,7 @@ compare_to(const NodeTransition &other) const {
|
|||
// The transition will always override transitions with
|
||||
// a lower priority.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeTransition::
|
||||
INLINE_GRAPH void NodeTransition::
|
||||
set_priority(int priority) {
|
||||
_priority = priority;
|
||||
state_changed();
|
||||
|
|
@ -147,7 +147,7 @@ set_priority(int priority) {
|
|||
// Access: Public
|
||||
// Description: Returns the priority associated with this transition.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE int NodeTransition::
|
||||
INLINE_GRAPH int NodeTransition::
|
||||
get_priority() const {
|
||||
return _priority;
|
||||
}
|
||||
|
|
@ -161,7 +161,7 @@ get_priority() const {
|
|||
// state changes on the transition will now notify the
|
||||
// arc.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeTransition::
|
||||
INLINE_GRAPH void NodeTransition::
|
||||
added_to_arc(NodeRelation *arc) {
|
||||
bool inserted = _arcs.insert(arc).second;
|
||||
nassertv(inserted);
|
||||
|
|
@ -176,8 +176,13 @@ added_to_arc(NodeRelation *arc) {
|
|||
// is no longer assigned to the arc. Further state
|
||||
// changes on the transition will *not* notify the arc.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeTransition::
|
||||
INLINE_GRAPH void NodeTransition::
|
||||
removed_from_arc(NodeRelation *arc) {
|
||||
size_t num_erased = _arcs.erase(arc);
|
||||
nassertv(num_erased == 1);
|
||||
}
|
||||
|
||||
INLINE_GRAPH ostream &operator << (ostream &out, const NodeTransition &ntb) {
|
||||
ntb.output(out);
|
||||
return out;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,4 +117,3 @@ fillin(DatagramIterator& scan, BamReader*)
|
|||
_priority = scan.get_uint16();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -36,23 +36,23 @@ class DatagramIterator;
|
|||
////////////////////////////////////////////////////////////////////
|
||||
class EXPCL_PANDA NodeTransition : public TypedWriteableReferenceCount {
|
||||
protected:
|
||||
INLINE NodeTransition();
|
||||
INLINE NodeTransition(const NodeTransition ©);
|
||||
INLINE void operator = (const NodeTransition ©);
|
||||
INLINE_GRAPH NodeTransition();
|
||||
INLINE_GRAPH NodeTransition(const NodeTransition ©);
|
||||
INLINE_GRAPH void operator = (const NodeTransition ©);
|
||||
|
||||
public:
|
||||
INLINE bool operator == (const NodeTransition &other) const;
|
||||
INLINE bool operator != (const NodeTransition &other) const;
|
||||
INLINE bool operator < (const NodeTransition &other) const;
|
||||
INLINE bool operator <= (const NodeTransition &other) const;
|
||||
INLINE bool operator > (const NodeTransition &other) const;
|
||||
INLINE bool operator >= (const NodeTransition &other) const;
|
||||
INLINE_GRAPH bool operator == (const NodeTransition &other) const;
|
||||
INLINE_GRAPH bool operator != (const NodeTransition &other) const;
|
||||
INLINE_GRAPH bool operator < (const NodeTransition &other) const;
|
||||
INLINE_GRAPH bool operator <= (const NodeTransition &other) const;
|
||||
INLINE_GRAPH bool operator > (const NodeTransition &other) const;
|
||||
INLINE_GRAPH bool operator >= (const NodeTransition &other) const;
|
||||
|
||||
INLINE int compare_to(const NodeTransition &other) const;
|
||||
INLINE_GRAPH int compare_to(const NodeTransition &other) const;
|
||||
|
||||
PUBLISHED:
|
||||
INLINE void set_priority(int priority);
|
||||
INLINE int get_priority() const;
|
||||
INLINE_GRAPH void set_priority(int priority);
|
||||
INLINE_GRAPH int get_priority() const;
|
||||
|
||||
public:
|
||||
virtual NodeTransition *make_copy() const=0;
|
||||
|
|
@ -86,8 +86,8 @@ public:
|
|||
// These functions will be called by the arcs when appropriate.
|
||||
// Don't attempt to call them directly; they're public only to make
|
||||
// it convenient to call them from non-class template functions.
|
||||
INLINE void added_to_arc(NodeRelation *arc);
|
||||
INLINE void removed_from_arc(NodeRelation *arc);
|
||||
INLINE_GRAPH void added_to_arc(NodeRelation *arc);
|
||||
INLINE_GRAPH void removed_from_arc(NodeRelation *arc);
|
||||
|
||||
protected:
|
||||
int _priority;
|
||||
|
|
@ -124,11 +124,10 @@ private:
|
|||
friend class NodeTransitionCache;
|
||||
};
|
||||
|
||||
INLINE ostream &operator << (ostream &out, const NodeTransition &ntb) {
|
||||
ntb.output(out);
|
||||
return out;
|
||||
}
|
||||
INLINE_GRAPH ostream &operator << (ostream &out, const NodeTransition &ntb);
|
||||
|
||||
#ifdef BUILDING_PANDA
|
||||
#include "nodeTransition.I"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
// set_transition; if the pointer might be NULL, use the
|
||||
// above flavor instead (or just call clear_transition).
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE PT(NodeTransition) NodeTransitionCache::
|
||||
INLINE_GRAPH PT(NodeTransition) NodeTransitionCache::
|
||||
set_transition(NodeTransition *trans) {
|
||||
nassertr(trans != (NodeTransition *)NULL, NULL);
|
||||
nassertr(trans->get_handle() != TypeHandle::none(), NULL);
|
||||
|
|
@ -26,7 +26,7 @@ set_transition(NodeTransition *trans) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeTransitionCache::size_type NodeTransitionCache::
|
||||
INLINE_GRAPH NodeTransitionCache::size_type NodeTransitionCache::
|
||||
size() const {
|
||||
return _cache.size();
|
||||
}
|
||||
|
|
@ -36,7 +36,7 @@ size() const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeTransitionCache::const_iterator NodeTransitionCache::
|
||||
INLINE_GRAPH NodeTransitionCache::const_iterator NodeTransitionCache::
|
||||
begin() const {
|
||||
return _cache.begin();
|
||||
}
|
||||
|
|
@ -46,7 +46,12 @@ begin() const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeTransitionCache::const_iterator NodeTransitionCache::
|
||||
INLINE_GRAPH NodeTransitionCache::const_iterator NodeTransitionCache::
|
||||
end() const {
|
||||
return _cache.end();
|
||||
}
|
||||
|
||||
INLINE_GRAPH ostream &operator << (ostream &out, const NodeTransitionCache &ntc) {
|
||||
ntc.output(out);
|
||||
return out;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ public:
|
|||
|
||||
bool is_empty() const;
|
||||
PT(NodeTransition) set_transition(TypeHandle handle, NodeTransition *trans);
|
||||
INLINE PT(NodeTransition) set_transition(NodeTransition *trans);
|
||||
INLINE_GRAPH PT(NodeTransition) set_transition(NodeTransition *trans);
|
||||
PT(NodeTransition) clear_transition(TypeHandle handle);
|
||||
bool has_transition(TypeHandle handle) const;
|
||||
NodeTransition *get_transition(TypeHandle handle) const;
|
||||
|
|
@ -56,9 +56,9 @@ public:
|
|||
typedef Cache::value_type value_type;
|
||||
typedef Cache::size_type size_type;
|
||||
|
||||
INLINE size_type size() const;
|
||||
INLINE const_iterator begin() const;
|
||||
INLINE const_iterator end() const;
|
||||
INLINE_GRAPH size_type size() const;
|
||||
INLINE_GRAPH const_iterator begin() const;
|
||||
INLINE_GRAPH const_iterator end() const;
|
||||
|
||||
|
||||
public:
|
||||
|
|
@ -100,11 +100,10 @@ private:
|
|||
friend class NodeAttributes;
|
||||
};
|
||||
|
||||
INLINE ostream &operator << (ostream &out, const NodeTransitionCache &ntc) {
|
||||
ntc.output(out);
|
||||
return out;
|
||||
}
|
||||
INLINE_GRAPH ostream &operator << (ostream &out, const NodeTransitionCache &ntc);
|
||||
|
||||
#ifdef BUILDING_PANDA
|
||||
#include "nodeTransitionCache.I"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeTransitionCacheEntry::
|
||||
INLINE_GRAPH NodeTransitionCacheEntry::
|
||||
NodeTransitionCacheEntry(NodeTransition *trans) : _trans(trans) {
|
||||
}
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ NodeTransitionCacheEntry(NodeTransition *trans) : _trans(trans) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeTransitionCacheEntry::
|
||||
INLINE_GRAPH NodeTransitionCacheEntry::
|
||||
NodeTransitionCacheEntry(const NodeTransitionCacheEntry ©) :
|
||||
_trans(copy._trans),
|
||||
_computed(copy._computed),
|
||||
|
|
@ -32,7 +32,7 @@ NodeTransitionCacheEntry(const NodeTransitionCacheEntry ©) :
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeTransitionCacheEntry::
|
||||
INLINE_GRAPH void NodeTransitionCacheEntry::
|
||||
operator = (const NodeTransitionCacheEntry ©) {
|
||||
_trans = copy._trans;
|
||||
_computed = copy._computed;
|
||||
|
|
@ -44,7 +44,7 @@ operator = (const NodeTransitionCacheEntry ©) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool NodeTransitionCacheEntry::
|
||||
INLINE_GRAPH bool NodeTransitionCacheEntry::
|
||||
is_identity() const {
|
||||
return (_trans == (NodeTransition *)NULL);
|
||||
// || _trans->is_identity();
|
||||
|
|
@ -55,7 +55,7 @@ is_identity() const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE int NodeTransitionCacheEntry::
|
||||
INLINE_GRAPH int NodeTransitionCacheEntry::
|
||||
compare_to(const NodeTransitionCacheEntry &other) const {
|
||||
bool this_ident = is_identity();
|
||||
bool other_ident = other.is_identity();
|
||||
|
|
@ -81,7 +81,7 @@ compare_to(const NodeTransitionCacheEntry &other) const {
|
|||
// Access: Public
|
||||
// Description: Reinitializes the cache entry to its original state.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeTransitionCacheEntry::
|
||||
INLINE_GRAPH void NodeTransitionCacheEntry::
|
||||
clear() {
|
||||
_trans.clear();
|
||||
_computed.clear();
|
||||
|
|
@ -94,7 +94,7 @@ clear() {
|
|||
// Description: Changes the transition associated with the cache
|
||||
// entry without changing the associated time stamps.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeTransitionCacheEntry::
|
||||
INLINE_GRAPH void NodeTransitionCacheEntry::
|
||||
set_trans(NodeTransition *trans) {
|
||||
_trans = trans;
|
||||
}
|
||||
|
|
@ -106,7 +106,7 @@ set_trans(NodeTransition *trans) {
|
|||
// entry without changing the associated time stamps.
|
||||
// This is of limited usefulness.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeTransitionCacheEntry::
|
||||
INLINE_GRAPH void NodeTransitionCacheEntry::
|
||||
clear_trans() {
|
||||
_trans.clear();
|
||||
}
|
||||
|
|
@ -118,7 +118,7 @@ clear_trans() {
|
|||
// NodeTransition, false if it doesn't (and the
|
||||
// transition should be assumed to be identity).
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool NodeTransitionCacheEntry::
|
||||
INLINE_GRAPH bool NodeTransitionCacheEntry::
|
||||
has_trans() const {
|
||||
return _trans != (NodeTransition *)NULL;
|
||||
}
|
||||
|
|
@ -131,7 +131,7 @@ has_trans() const {
|
|||
// NodeTransition (in which case it should be assumed to
|
||||
// be identity).
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeTransition *NodeTransitionCacheEntry::
|
||||
INLINE_GRAPH NodeTransition *NodeTransitionCacheEntry::
|
||||
get_trans() const {
|
||||
return _trans;
|
||||
}
|
||||
|
|
@ -141,7 +141,7 @@ get_trans() const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool NodeTransitionCacheEntry::
|
||||
INLINE_GRAPH bool NodeTransitionCacheEntry::
|
||||
is_cache_verified(UpdateSeq as_of) const {
|
||||
#ifndef NDEBUG
|
||||
if (wrt_cat.is_spam()) {
|
||||
|
|
@ -159,7 +159,7 @@ is_cache_verified(UpdateSeq as_of) const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool NodeTransitionCacheEntry::
|
||||
INLINE_GRAPH bool NodeTransitionCacheEntry::
|
||||
is_freshly_computed(UpdateSeq changed) const {
|
||||
return changed < _computed;
|
||||
}
|
||||
|
|
@ -169,7 +169,7 @@ is_freshly_computed(UpdateSeq changed) const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeTransitionCacheEntry::
|
||||
INLINE_GRAPH void NodeTransitionCacheEntry::
|
||||
set_computed_verified(UpdateSeq now) {
|
||||
_computed = now;
|
||||
_verified = now;
|
||||
|
|
@ -184,7 +184,7 @@ set_computed_verified(UpdateSeq now) {
|
|||
// setTransitionHelpers.h interchangeably between
|
||||
// NodeTransitions and NodeTransitionCaches.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeTransitionCacheEntry::
|
||||
INLINE_GRAPH NodeTransitionCacheEntry::
|
||||
operator const PT(NodeTransition) &() const {
|
||||
return _trans;
|
||||
}
|
||||
|
|
@ -195,7 +195,7 @@ operator const PT(NodeTransition) &() const {
|
|||
// Description: Returns the timestamp at which this cache entry was
|
||||
// computed.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE UpdateSeq NodeTransitionCacheEntry::
|
||||
INLINE_GRAPH UpdateSeq NodeTransitionCacheEntry::
|
||||
get_computed() const {
|
||||
return _computed;
|
||||
}
|
||||
|
|
@ -207,7 +207,7 @@ get_computed() const {
|
|||
// was verified; i.e. when the graph was last walked up
|
||||
// to the root to ensure the cache entry is still valid.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE UpdateSeq NodeTransitionCacheEntry::
|
||||
INLINE_GRAPH UpdateSeq NodeTransitionCacheEntry::
|
||||
get_verified() const {
|
||||
return _verified;
|
||||
}
|
||||
|
|
@ -218,7 +218,7 @@ get_verified() const {
|
|||
// Description: Returns a new cache entry that represents the inverse
|
||||
// of a.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeTransitionCacheEntry NodeTransitionCacheEntry::
|
||||
INLINE_GRAPH NodeTransitionCacheEntry NodeTransitionCacheEntry::
|
||||
invert(const NodeTransitionCacheEntry &a) {
|
||||
if (a.is_identity()) {
|
||||
return a;
|
||||
|
|
@ -232,7 +232,7 @@ invert(const NodeTransitionCacheEntry &a) {
|
|||
// Description: Returns a new cache entry that represents the
|
||||
// composition of a and b.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeTransitionCacheEntry NodeTransitionCacheEntry::
|
||||
INLINE_GRAPH NodeTransitionCacheEntry NodeTransitionCacheEntry::
|
||||
compose(const NodeTransitionCacheEntry &a,
|
||||
const NodeTransitionCacheEntry &b) {
|
||||
if (a.is_identity()) {
|
||||
|
|
@ -250,7 +250,7 @@ compose(const NodeTransitionCacheEntry &a,
|
|||
// Description: Returns a new cache entry that represents the
|
||||
// composition of invert(a) and b.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeTransitionCacheEntry NodeTransitionCacheEntry::
|
||||
INLINE_GRAPH NodeTransitionCacheEntry NodeTransitionCacheEntry::
|
||||
invert_compose(const NodeTransitionCacheEntry &a,
|
||||
const NodeTransitionCacheEntry &b) {
|
||||
if (a.is_identity()) {
|
||||
|
|
@ -286,7 +286,7 @@ invert_compose(const NodeTransitionCacheEntry &a,
|
|||
// as computed using the cache value as a hint. Mark
|
||||
// the result as computed at time 'now'.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeTransitionCacheEntry NodeTransitionCacheEntry::
|
||||
INLINE_GRAPH NodeTransitionCacheEntry NodeTransitionCacheEntry::
|
||||
cached_compose(const NodeTransitionCacheEntry &a,
|
||||
const NodeTransitionCacheEntry &cache,
|
||||
const NodeTransitionCacheEntry &b,
|
||||
|
|
@ -339,7 +339,7 @@ cached_compose(const NodeTransitionCacheEntry &a,
|
|||
// NodeAttribute) that represents the indicated
|
||||
// transition applied to the attribute.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeAttribute *NodeTransitionCacheEntry::
|
||||
INLINE_GRAPH NodeAttribute *NodeTransitionCacheEntry::
|
||||
apply(const NodeAttribute *a, const NodeTransitionCacheEntry &b) {
|
||||
if (b.is_identity()) {
|
||||
return (NodeAttribute *)a;
|
||||
|
|
@ -353,10 +353,15 @@ apply(const NodeAttribute *a, const NodeTransitionCacheEntry &b) {
|
|||
// Access: Public, Static
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeAttribute *NodeTransitionCacheEntry::
|
||||
INLINE_GRAPH NodeAttribute *NodeTransitionCacheEntry::
|
||||
make_attrib() const {
|
||||
if (_trans == (NodeTransition *)NULL) {
|
||||
return NULL;
|
||||
}
|
||||
return _trans->make_attrib();
|
||||
}
|
||||
|
||||
INLINE_GRAPH ostream &operator << (ostream &out, const NodeTransitionCacheEntry &e) {
|
||||
e.output(out);
|
||||
return out;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,28 +22,28 @@
|
|||
////////////////////////////////////////////////////////////////////
|
||||
class EXPCL_PANDA NodeTransitionCacheEntry {
|
||||
public:
|
||||
INLINE NodeTransitionCacheEntry(NodeTransition *trans = NULL);
|
||||
INLINE NodeTransitionCacheEntry(const NodeTransitionCacheEntry ©);
|
||||
INLINE void operator = (const NodeTransitionCacheEntry ©);
|
||||
INLINE_GRAPH NodeTransitionCacheEntry(NodeTransition *trans = NULL);
|
||||
INLINE_GRAPH NodeTransitionCacheEntry(const NodeTransitionCacheEntry ©);
|
||||
INLINE_GRAPH void operator = (const NodeTransitionCacheEntry ©);
|
||||
|
||||
INLINE bool is_identity() const;
|
||||
INLINE int compare_to(const NodeTransitionCacheEntry &other) const;
|
||||
INLINE_GRAPH bool is_identity() const;
|
||||
INLINE_GRAPH int compare_to(const NodeTransitionCacheEntry &other) const;
|
||||
|
||||
INLINE void clear();
|
||||
INLINE_GRAPH void clear();
|
||||
|
||||
INLINE void set_trans(NodeTransition *trans);
|
||||
INLINE void clear_trans();
|
||||
INLINE bool has_trans() const;
|
||||
INLINE NodeTransition *get_trans() const;
|
||||
INLINE_GRAPH void set_trans(NodeTransition *trans);
|
||||
INLINE_GRAPH void clear_trans();
|
||||
INLINE_GRAPH bool has_trans() const;
|
||||
INLINE_GRAPH NodeTransition *get_trans() const;
|
||||
|
||||
INLINE bool is_cache_verified(UpdateSeq as_of) const;
|
||||
INLINE bool is_freshly_computed(UpdateSeq changed) const;
|
||||
INLINE void set_computed_verified(UpdateSeq now);
|
||||
INLINE_GRAPH bool is_cache_verified(UpdateSeq as_of) const;
|
||||
INLINE_GRAPH bool is_freshly_computed(UpdateSeq changed) const;
|
||||
INLINE_GRAPH void set_computed_verified(UpdateSeq now);
|
||||
|
||||
INLINE operator const PT(NodeTransition) &() const;
|
||||
INLINE_GRAPH operator const PT(NodeTransition) &() const;
|
||||
|
||||
INLINE UpdateSeq get_computed() const;
|
||||
INLINE UpdateSeq get_verified() const;
|
||||
INLINE_GRAPH UpdateSeq get_computed() const;
|
||||
INLINE_GRAPH UpdateSeq get_verified() const;
|
||||
|
||||
public:
|
||||
// The following functions perform the basic transition operations
|
||||
|
|
@ -51,27 +51,27 @@ public:
|
|||
// keep the _computed and _verified members consistent across these
|
||||
// operations.
|
||||
|
||||
INLINE static NodeTransitionCacheEntry
|
||||
INLINE_GRAPH static NodeTransitionCacheEntry
|
||||
invert(const NodeTransitionCacheEntry &a);
|
||||
|
||||
INLINE static NodeTransitionCacheEntry
|
||||
INLINE_GRAPH static NodeTransitionCacheEntry
|
||||
compose(const NodeTransitionCacheEntry &a,
|
||||
const NodeTransitionCacheEntry &b);
|
||||
|
||||
INLINE static NodeTransitionCacheEntry
|
||||
INLINE_GRAPH static NodeTransitionCacheEntry
|
||||
invert_compose(const NodeTransitionCacheEntry &a,
|
||||
const NodeTransitionCacheEntry &b);
|
||||
|
||||
INLINE static NodeTransitionCacheEntry
|
||||
INLINE_GRAPH static NodeTransitionCacheEntry
|
||||
cached_compose(const NodeTransitionCacheEntry &a,
|
||||
const NodeTransitionCacheEntry &cache,
|
||||
const NodeTransitionCacheEntry &b,
|
||||
UpdateSeq now);
|
||||
|
||||
INLINE static NodeAttribute *
|
||||
INLINE_GRAPH static NodeAttribute *
|
||||
apply(const NodeAttribute *a, const NodeTransitionCacheEntry &b);
|
||||
|
||||
INLINE NodeAttribute *make_attrib() const;
|
||||
INLINE_GRAPH NodeAttribute *make_attrib() const;
|
||||
|
||||
public:
|
||||
void output(ostream &out) const;
|
||||
|
|
@ -83,11 +83,10 @@ private:
|
|||
UpdateSeq _verified;
|
||||
};
|
||||
|
||||
INLINE ostream &operator << (ostream &out, const NodeTransitionCacheEntry &e) {
|
||||
e.output(out);
|
||||
return out;
|
||||
}
|
||||
INLINE_GRAPH ostream &operator << (ostream &out, const NodeTransitionCacheEntry &e);
|
||||
|
||||
#ifdef BUILDING_PANDA
|
||||
#include "nodeTransitionCacheEntry.I"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeTransitionWrapper::
|
||||
INLINE_GRAPH NodeTransitionWrapper::
|
||||
NodeTransitionWrapper(TypeHandle handle) : _handle(handle) {
|
||||
nassertv(_handle != TypeHandle::none());
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@ NodeTransitionWrapper(TypeHandle handle) : _handle(handle) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeTransitionWrapper::
|
||||
INLINE_GRAPH NodeTransitionWrapper::
|
||||
NodeTransitionWrapper(const NodeTransitionWrapper ©) :
|
||||
_handle(copy._handle),
|
||||
_entry(copy._entry)
|
||||
|
|
@ -33,7 +33,7 @@ NodeTransitionWrapper(const NodeTransitionWrapper ©) :
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeTransitionWrapper::
|
||||
INLINE_GRAPH void NodeTransitionWrapper::
|
||||
operator = (const NodeTransitionWrapper ©) {
|
||||
_handle = copy._handle;
|
||||
_entry = copy._entry;
|
||||
|
|
@ -46,7 +46,7 @@ operator = (const NodeTransitionWrapper ©) {
|
|||
// NodeTransitionWrapper ready to access the same type
|
||||
// of NodeTransition as the other.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeTransitionWrapper NodeTransitionWrapper::
|
||||
INLINE_GRAPH NodeTransitionWrapper NodeTransitionWrapper::
|
||||
init_from(const NodeTransitionWrapper &other) {
|
||||
return NodeTransitionWrapper(other._handle);
|
||||
}
|
||||
|
|
@ -56,7 +56,7 @@ init_from(const NodeTransitionWrapper &other) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE TypeHandle NodeTransitionWrapper::
|
||||
INLINE_GRAPH TypeHandle NodeTransitionWrapper::
|
||||
get_handle() const {
|
||||
return _handle;
|
||||
}
|
||||
|
|
@ -66,7 +66,7 @@ get_handle() const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool NodeTransitionWrapper::
|
||||
INLINE_GRAPH bool NodeTransitionWrapper::
|
||||
has_trans() const {
|
||||
return _entry.has_trans();
|
||||
}
|
||||
|
|
@ -76,7 +76,7 @@ has_trans() const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeTransition *NodeTransitionWrapper::
|
||||
INLINE_GRAPH NodeTransition *NodeTransitionWrapper::
|
||||
get_trans() const {
|
||||
return _entry.get_trans();
|
||||
}
|
||||
|
|
@ -87,7 +87,7 @@ get_trans() const {
|
|||
// Description: Returns true if the wrapper represents an identity
|
||||
// transition.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool NodeTransitionWrapper::
|
||||
INLINE_GRAPH bool NodeTransitionWrapper::
|
||||
is_identity() const {
|
||||
return _entry.is_identity();
|
||||
}
|
||||
|
|
@ -97,7 +97,7 @@ is_identity() const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE int NodeTransitionWrapper::
|
||||
INLINE_GRAPH int NodeTransitionWrapper::
|
||||
compare_to(const NodeTransitionWrapper &other) const {
|
||||
return _entry.compare_to(other._entry);
|
||||
}
|
||||
|
|
@ -107,7 +107,7 @@ compare_to(const NodeTransitionWrapper &other) const {
|
|||
// Access: Public
|
||||
// Description: Resets the wrapper to the identity transition.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeTransitionWrapper::
|
||||
INLINE_GRAPH void NodeTransitionWrapper::
|
||||
make_identity() {
|
||||
_entry.clear_trans();
|
||||
}
|
||||
|
|
@ -118,7 +118,7 @@ make_identity() {
|
|||
// Description: Sets the wrapper to the transition contained on the
|
||||
// arc.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeTransitionWrapper::
|
||||
INLINE_GRAPH void NodeTransitionWrapper::
|
||||
extract_from(const NodeRelation *arc) {
|
||||
nassertv(arc != (NodeRelation *)NULL);
|
||||
nassertv(_handle != TypeHandle::none());
|
||||
|
|
@ -130,7 +130,7 @@ extract_from(const NodeRelation *arc) {
|
|||
// Access: Public
|
||||
// Description: Stores the transition in the wrapper to the arc.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeTransitionWrapper::
|
||||
INLINE_GRAPH void NodeTransitionWrapper::
|
||||
store_to(NodeRelation *arc) const {
|
||||
nassertv(arc != (NodeRelation *)NULL);
|
||||
arc->set_transition(_handle, _entry.get_trans());
|
||||
|
|
@ -142,7 +142,7 @@ store_to(NodeRelation *arc) const {
|
|||
// Description: Sets this transition to the composition of this
|
||||
// transition and the following one.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeTransitionWrapper::
|
||||
INLINE_GRAPH void NodeTransitionWrapper::
|
||||
compose_in_place(const NodeTransitionWrapper &other) {
|
||||
nassertv(_handle == other._handle);
|
||||
_entry = NodeTransitionCacheEntry::compose(_entry, other._entry);
|
||||
|
|
@ -153,7 +153,7 @@ compose_in_place(const NodeTransitionWrapper &other) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeTransitionWrapper::
|
||||
INLINE_GRAPH void NodeTransitionWrapper::
|
||||
invert_in_place() {
|
||||
_entry = NodeTransitionCacheEntry::invert(_entry);
|
||||
}
|
||||
|
|
@ -164,7 +164,7 @@ invert_in_place() {
|
|||
// Description: Sets this transition to the composition of this
|
||||
// transition and the following one.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeTransitionWrapper::
|
||||
INLINE_GRAPH void NodeTransitionWrapper::
|
||||
invert_compose_in_place(const NodeTransitionWrapper &other) {
|
||||
_entry = NodeTransitionCacheEntry::invert_compose(_entry, other._entry);
|
||||
}
|
||||
|
|
@ -176,7 +176,7 @@ invert_compose_in_place(const NodeTransitionWrapper &other) {
|
|||
// cache on the arc. Also returns the arc's top_subtree
|
||||
// indication.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE Node *NodeTransitionWrapper::
|
||||
INLINE_GRAPH Node *NodeTransitionWrapper::
|
||||
extract_from_cache(const NodeRelation *arc) {
|
||||
nassertr(_handle != TypeHandle::none(), NULL);
|
||||
|
||||
|
|
@ -194,7 +194,7 @@ extract_from_cache(const NodeRelation *arc) {
|
|||
// Description: Stores this transition into the arc's cache, and
|
||||
// updates the arc's top_subtree.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeTransitionWrapper::
|
||||
INLINE_GRAPH void NodeTransitionWrapper::
|
||||
store_to_cache(NodeRelation *arc, Node *top_subtree) {
|
||||
arc->_top_subtree = top_subtree;
|
||||
if (arc->_net_transitions == (NodeTransitionCache *)NULL) {
|
||||
|
|
@ -213,7 +213,7 @@ store_to_cache(NodeRelation *arc, Node *top_subtree) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool NodeTransitionWrapper::
|
||||
INLINE_GRAPH bool NodeTransitionWrapper::
|
||||
is_cache_verified(UpdateSeq as_of) const {
|
||||
return _entry.is_cache_verified(as_of);
|
||||
}
|
||||
|
|
@ -223,7 +223,7 @@ is_cache_verified(UpdateSeq as_of) const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeTransitionWrapper::
|
||||
INLINE_GRAPH void NodeTransitionWrapper::
|
||||
set_computed_verified(UpdateSeq now) {
|
||||
_entry.set_computed_verified(now);
|
||||
}
|
||||
|
|
@ -235,7 +235,7 @@ set_computed_verified(UpdateSeq now) {
|
|||
// that indicated by value, using the cache as a helper,
|
||||
// and stores the result in this wrapper.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NodeTransitionWrapper::
|
||||
INLINE_GRAPH void NodeTransitionWrapper::
|
||||
cached_compose(const NodeTransitionWrapper &cache,
|
||||
const NodeTransitionWrapper &value,
|
||||
UpdateSeq now) {
|
||||
|
|
@ -244,25 +244,7 @@ cached_compose(const NodeTransitionWrapper &cache,
|
|||
value._entry, now);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: get_transition_into
|
||||
// Description: This external template function is handy for
|
||||
// extracting the transition (of a known type) from the
|
||||
// wrapper. If the transition exists, it is
|
||||
// automatically downcasted to the correct type and
|
||||
// stored in the pointer given in the first parameter,
|
||||
// and the return value is true. If the transition does
|
||||
// not exist, the pointer is filled with NULL and the
|
||||
// return value is false.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Transition>
|
||||
INLINE bool
|
||||
get_transition_into(Transition *&ptr, const NodeTransitionWrapper &trans) {
|
||||
NodeTransition *nt = trans.get_trans();
|
||||
if (nt == (NodeTransition *)NULL) {
|
||||
ptr = (Transition *)NULL;
|
||||
return false;
|
||||
}
|
||||
DCAST_INTO_R(ptr, nt, false);
|
||||
return true;
|
||||
INLINE_GRAPH ostream &operator << (ostream &out, const NodeTransitionWrapper &ntw) {
|
||||
ntw.output(out);
|
||||
return out;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
// Filename: nodeTransitionWrapper.T
|
||||
// Created by: drose (20Mar00)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: get_transition_into
|
||||
// Description: This external template function is handy for
|
||||
// extracting the transition (of a known type) from the
|
||||
// wrapper. If the transition exists, it is
|
||||
// automatically downcasted to the correct type and
|
||||
// stored in the pointer given in the first parameter,
|
||||
// and the return value is true. If the transition does
|
||||
// not exist, the pointer is filled with NULL and the
|
||||
// return value is false.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Transition>
|
||||
INLINE_GRAPH bool
|
||||
get_transition_into(Transition *&ptr, const NodeTransitionWrapper &trans) {
|
||||
NodeTransition *nt = trans.get_trans();
|
||||
if (nt == (NodeTransition *)NULL) {
|
||||
ptr = (Transition *)NULL;
|
||||
return false;
|
||||
}
|
||||
DCAST_INTO_R(ptr, nt, false);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -41,35 +41,35 @@ public:
|
|||
typedef NodeTransitionWrapper TransitionWrapper;
|
||||
typedef NodeAttributeWrapper AttributeWrapper;
|
||||
|
||||
INLINE NodeTransitionWrapper(TypeHandle handle);
|
||||
INLINE NodeTransitionWrapper(const NodeTransitionWrapper ©);
|
||||
INLINE void operator = (const NodeTransitionWrapper ©);
|
||||
INLINE_GRAPH NodeTransitionWrapper(TypeHandle handle);
|
||||
INLINE_GRAPH NodeTransitionWrapper(const NodeTransitionWrapper ©);
|
||||
INLINE_GRAPH void operator = (const NodeTransitionWrapper ©);
|
||||
|
||||
INLINE static NodeTransitionWrapper
|
||||
INLINE_GRAPH static NodeTransitionWrapper
|
||||
init_from(const NodeTransitionWrapper &other);
|
||||
static NodeTransitionWrapper init_from(const NodeAttributeWrapper &attrib);
|
||||
|
||||
INLINE TypeHandle get_handle() const;
|
||||
INLINE bool has_trans() const;
|
||||
INLINE NodeTransition *get_trans() const;
|
||||
INLINE_GRAPH TypeHandle get_handle() const;
|
||||
INLINE_GRAPH bool has_trans() const;
|
||||
INLINE_GRAPH NodeTransition *get_trans() const;
|
||||
|
||||
INLINE bool is_identity() const;
|
||||
INLINE int compare_to(const NodeTransitionWrapper &other) const;
|
||||
INLINE_GRAPH bool is_identity() const;
|
||||
INLINE_GRAPH int compare_to(const NodeTransitionWrapper &other) const;
|
||||
|
||||
INLINE void make_identity();
|
||||
INLINE void extract_from(const NodeRelation *arc);
|
||||
INLINE void store_to(NodeRelation *arc) const;
|
||||
INLINE_GRAPH void make_identity();
|
||||
INLINE_GRAPH void extract_from(const NodeRelation *arc);
|
||||
INLINE_GRAPH void store_to(NodeRelation *arc) const;
|
||||
|
||||
INLINE void compose_in_place(const NodeTransitionWrapper &other);
|
||||
INLINE void invert_in_place();
|
||||
INLINE void invert_compose_in_place(const NodeTransitionWrapper &other);
|
||||
INLINE_GRAPH void compose_in_place(const NodeTransitionWrapper &other);
|
||||
INLINE_GRAPH void invert_in_place();
|
||||
INLINE_GRAPH void invert_compose_in_place(const NodeTransitionWrapper &other);
|
||||
|
||||
INLINE Node *extract_from_cache(const NodeRelation *arc);
|
||||
INLINE void store_to_cache(NodeRelation *arc, Node *top_subtree);
|
||||
INLINE bool is_cache_verified(UpdateSeq as_of) const;
|
||||
INLINE void set_computed_verified(UpdateSeq now);
|
||||
INLINE_GRAPH Node *extract_from_cache(const NodeRelation *arc);
|
||||
INLINE_GRAPH void store_to_cache(NodeRelation *arc, Node *top_subtree);
|
||||
INLINE_GRAPH bool is_cache_verified(UpdateSeq as_of) const;
|
||||
INLINE_GRAPH void set_computed_verified(UpdateSeq now);
|
||||
|
||||
INLINE void cached_compose(const NodeTransitionWrapper &cache,
|
||||
INLINE_GRAPH void cached_compose(const NodeTransitionWrapper &cache,
|
||||
const NodeTransitionWrapper &value,
|
||||
UpdateSeq now);
|
||||
|
||||
|
|
@ -79,18 +79,15 @@ public:
|
|||
private:
|
||||
TypeHandle _handle;
|
||||
NodeTransitionCacheEntry _entry;
|
||||
friend class NodeAttributeWrapper;
|
||||
friend class NodeAttributeWrapper;
|
||||
};
|
||||
|
||||
INLINE ostream &operator << (ostream &out, const NodeTransitionWrapper &ntw) {
|
||||
ntw.output(out);
|
||||
return out;
|
||||
}
|
||||
|
||||
template<class Transition>
|
||||
INLINE bool
|
||||
get_transition_into(Transition *&ptr, const NodeTransitionWrapper &trans);
|
||||
INLINE_GRAPH ostream &operator << (ostream &out, const NodeTransitionWrapper &ntw);
|
||||
|
||||
#ifdef BUILDING_PANDA
|
||||
#include "nodeTransitionWrapper.I"
|
||||
#endif
|
||||
|
||||
#include "nodeTransitionWrapper.T"
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
// set_transition; if the pointer might be NULL, use the
|
||||
// above flavor instead (or just call clear_transition).
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE PT(NodeTransition) NodeTransitions::
|
||||
INLINE_GRAPH PT(NodeTransition) NodeTransitions::
|
||||
set_transition(NodeTransition *trans) {
|
||||
nassertr(trans != (NodeTransition *)NULL, NULL);
|
||||
nassertr(trans->get_handle() != TypeHandle::none(), NULL);
|
||||
|
|
@ -25,7 +25,7 @@ set_transition(NodeTransition *trans) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeTransitions::size_type NodeTransitions::
|
||||
INLINE_GRAPH NodeTransitions::size_type NodeTransitions::
|
||||
size() const {
|
||||
return _transitions.size();
|
||||
}
|
||||
|
|
@ -35,7 +35,7 @@ size() const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeTransitions::const_iterator NodeTransitions::
|
||||
INLINE_GRAPH NodeTransitions::const_iterator NodeTransitions::
|
||||
begin() const {
|
||||
return _transitions.begin();
|
||||
}
|
||||
|
|
@ -45,7 +45,7 @@ begin() const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NodeTransitions::const_iterator NodeTransitions::
|
||||
INLINE_GRAPH NodeTransitions::const_iterator NodeTransitions::
|
||||
end() const {
|
||||
return _transitions.end();
|
||||
}
|
||||
|
|
@ -62,7 +62,7 @@ end() const {
|
|||
// false.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Transition>
|
||||
INLINE bool
|
||||
INLINE_GRAPH bool
|
||||
get_transition_into(Transition *&ptr, const NodeTransitions &trans,
|
||||
TypeHandle transition_type) {
|
||||
NodeTransition *nt = trans.get_transition(transition_type);
|
||||
|
|
@ -75,7 +75,12 @@ get_transition_into(Transition *&ptr, const NodeTransitions &trans,
|
|||
}
|
||||
|
||||
template<class Transition>
|
||||
INLINE bool
|
||||
INLINE_GRAPH bool
|
||||
get_transition_into(Transition *&ptr, const NodeTransitions &trans) {
|
||||
return get_transition_into(ptr, trans, Transition::get_class_type());
|
||||
}
|
||||
|
||||
INLINE_GRAPH ostream &operator << (ostream &out, const NodeTransitions &nts) {
|
||||
nts.output(out);
|
||||
return out;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
// Filename: nodeTransitions.I
|
||||
// Created by: drose (20Mar00)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: get_transition_into
|
||||
// Description: This external template function is handy for
|
||||
// extracting a transition of a particular type from the
|
||||
// set. If the transition exists, it is automatically
|
||||
// downcasted to the correct type and stored in the
|
||||
// pointer given in the first parameter, and the return
|
||||
// value is true. If the transition does not exist, the
|
||||
// pointer is filled with NULL and the return value is
|
||||
// false.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Transition>
|
||||
INLINE_GRAPH bool
|
||||
get_transition_into(Transition *&ptr, const NodeTransitions &trans,
|
||||
TypeHandle transition_type) {
|
||||
NodeTransition *nt = trans.get_transition(transition_type);
|
||||
if (nt == (NodeTransition *)NULL) {
|
||||
ptr = (Transition *)NULL;
|
||||
return false;
|
||||
}
|
||||
DCAST_INTO_R(ptr, nt, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
template<class Transition>
|
||||
INLINE_GRAPH bool
|
||||
get_transition_into(Transition *&ptr, const NodeTransitions &trans) {
|
||||
return get_transition_into(ptr, trans, Transition::get_class_type());
|
||||
}
|
||||
|
|
@ -31,7 +31,7 @@ public:
|
|||
|
||||
bool is_empty() const;
|
||||
PT(NodeTransition) set_transition(TypeHandle handle, NodeTransition *trans);
|
||||
INLINE PT(NodeTransition) set_transition(NodeTransition *trans);
|
||||
INLINE_GRAPH PT(NodeTransition) set_transition(NodeTransition *trans);
|
||||
PT(NodeTransition) clear_transition(TypeHandle handle);
|
||||
bool has_transition(TypeHandle handle) const;
|
||||
NodeTransition *get_transition(TypeHandle handle) const;
|
||||
|
|
@ -60,9 +60,9 @@ public:
|
|||
typedef Transitions::value_type value_type;
|
||||
typedef Transitions::size_type size_type;
|
||||
|
||||
INLINE size_type size() const;
|
||||
INLINE const_iterator begin() const;
|
||||
INLINE const_iterator end() const;
|
||||
INLINE_GRAPH size_type size() const;
|
||||
INLINE_GRAPH const_iterator begin() const;
|
||||
INLINE_GRAPH const_iterator end() const;
|
||||
|
||||
public:
|
||||
void output(ostream &out) const;
|
||||
|
|
@ -73,20 +73,10 @@ private:
|
|||
friend class NodeTransitionCache;
|
||||
};
|
||||
|
||||
INLINE ostream &operator << (ostream &out, const NodeTransitions &nts) {
|
||||
nts.output(out);
|
||||
return out;
|
||||
}
|
||||
|
||||
template<class Transition>
|
||||
INLINE bool
|
||||
get_transition_into(Transition *&ptr, const NodeTransitions &trans,
|
||||
TypeHandle transition_type);
|
||||
|
||||
template<class Transition>
|
||||
INLINE bool
|
||||
get_transition_into(Transition *&ptr, const NodeTransitions &trans);
|
||||
INLINE_GRAPH ostream &operator << (ostream &out, const NodeTransitions &nts);
|
||||
|
||||
#ifdef BUILDING_PANDA
|
||||
#include "nodeTransitions.I"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NullAttributeWrapper::
|
||||
INLINE_GRAPH NullAttributeWrapper::
|
||||
NullAttributeWrapper() {
|
||||
}
|
||||
|
||||
|
|
@ -17,7 +17,7 @@ NullAttributeWrapper() {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NullAttributeWrapper::
|
||||
INLINE_GRAPH NullAttributeWrapper::
|
||||
NullAttributeWrapper(const NullAttributeWrapper &) {
|
||||
}
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ NullAttributeWrapper(const NullAttributeWrapper &) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NullAttributeWrapper::
|
||||
INLINE_GRAPH void NullAttributeWrapper::
|
||||
operator = (const NullAttributeWrapper &) {
|
||||
}
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ operator = (const NullAttributeWrapper &) {
|
|||
// Access: Public, Static
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NullAttributeWrapper NullAttributeWrapper::
|
||||
INLINE_GRAPH NullAttributeWrapper NullAttributeWrapper::
|
||||
init_from(const NullTransitionWrapper &) {
|
||||
return NullAttributeWrapper();
|
||||
}
|
||||
|
|
@ -45,7 +45,7 @@ init_from(const NullTransitionWrapper &) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool NullAttributeWrapper::
|
||||
INLINE_GRAPH bool NullAttributeWrapper::
|
||||
is_initial() const {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -55,7 +55,7 @@ is_initial() const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE int NullAttributeWrapper::
|
||||
INLINE_GRAPH int NullAttributeWrapper::
|
||||
compare_to(const NullAttributeWrapper &) const {
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -65,7 +65,7 @@ compare_to(const NullAttributeWrapper &) const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NullAttributeWrapper::
|
||||
INLINE_GRAPH void NullAttributeWrapper::
|
||||
make_initial() {
|
||||
}
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ make_initial() {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NullAttributeWrapper::
|
||||
INLINE_GRAPH void NullAttributeWrapper::
|
||||
apply_in_place(const NullTransitionWrapper &) {
|
||||
}
|
||||
|
||||
|
|
@ -83,7 +83,7 @@ apply_in_place(const NullTransitionWrapper &) {
|
|||
// Access: Public, Virtual
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NullAttributeWrapper::
|
||||
INLINE_GRAPH void NullAttributeWrapper::
|
||||
output(ostream &) const {
|
||||
}
|
||||
|
||||
|
|
@ -92,6 +92,12 @@ output(ostream &) const {
|
|||
// Access: Public, Virtual
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NullAttributeWrapper::
|
||||
INLINE_GRAPH void NullAttributeWrapper::
|
||||
write(ostream &, int) const {
|
||||
}
|
||||
|
||||
INLINE_GRAPH ostream &operator << (ostream &out, const NullAttributeWrapper &naw) {
|
||||
naw.output(out);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,27 +24,26 @@ public:
|
|||
typedef NullTransitionWrapper TransitionWrapper;
|
||||
typedef NullAttributeWrapper AttributeWrapper;
|
||||
|
||||
INLINE NullAttributeWrapper();
|
||||
INLINE NullAttributeWrapper(const NullAttributeWrapper ©);
|
||||
INLINE void operator = (const NullAttributeWrapper ©);
|
||||
INLINE static NullAttributeWrapper
|
||||
INLINE_GRAPH NullAttributeWrapper();
|
||||
INLINE_GRAPH NullAttributeWrapper(const NullAttributeWrapper ©);
|
||||
INLINE_GRAPH void operator = (const NullAttributeWrapper ©);
|
||||
INLINE_GRAPH static NullAttributeWrapper
|
||||
init_from(const NullTransitionWrapper &trans);
|
||||
|
||||
INLINE bool is_initial() const;
|
||||
INLINE int compare_to(const NullAttributeWrapper &other) const;
|
||||
INLINE_GRAPH bool is_initial() const;
|
||||
INLINE_GRAPH int compare_to(const NullAttributeWrapper &other) const;
|
||||
|
||||
INLINE void make_initial();
|
||||
INLINE void apply_in_place(const NullTransitionWrapper &trans);
|
||||
INLINE_GRAPH void make_initial();
|
||||
INLINE_GRAPH void apply_in_place(const NullTransitionWrapper &trans);
|
||||
|
||||
INLINE void output(ostream &out) const;
|
||||
INLINE void write(ostream &out, int indent_level = 0) const;
|
||||
INLINE_GRAPH void output(ostream &out) const;
|
||||
INLINE_GRAPH void write(ostream &out, int indent_level = 0) const;
|
||||
};
|
||||
|
||||
INLINE ostream &operator << (ostream &out, const NullAttributeWrapper &naw) {
|
||||
naw.output(out);
|
||||
return out;
|
||||
}
|
||||
INLINE_GRAPH ostream &operator << (ostream &out, const NullAttributeWrapper &naw);
|
||||
|
||||
#ifdef BUILDING_PANDA
|
||||
#include "nullAttributeWrapper.I"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
////////////////////////////////////////////////////////////////////
|
||||
class EXPCL_PANDA NullLevelState {
|
||||
public:
|
||||
INLINE NullLevelState() { }
|
||||
INLINE NullLevelState(const NullLevelState &) { }
|
||||
INLINE void operator = (const NullLevelState &) { }
|
||||
INLINE_GRAPH NullLevelState() { }
|
||||
INLINE_GRAPH NullLevelState(const NullLevelState &) { }
|
||||
INLINE_GRAPH void operator = (const NullLevelState &) { }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NullTransitionWrapper::
|
||||
INLINE_GRAPH NullTransitionWrapper::
|
||||
NullTransitionWrapper() {
|
||||
}
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ NullTransitionWrapper() {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NullTransitionWrapper::
|
||||
INLINE_GRAPH NullTransitionWrapper::
|
||||
NullTransitionWrapper(const NullTransitionWrapper &) {
|
||||
}
|
||||
|
||||
|
|
@ -29,7 +29,7 @@ NullTransitionWrapper(const NullTransitionWrapper &) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NullTransitionWrapper::
|
||||
INLINE_GRAPH void NullTransitionWrapper::
|
||||
operator = (const NullTransitionWrapper &) {
|
||||
}
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ operator = (const NullTransitionWrapper &) {
|
|||
// Access: Public, Static
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NullTransitionWrapper NullTransitionWrapper::
|
||||
INLINE_GRAPH NullTransitionWrapper NullTransitionWrapper::
|
||||
init_from(const NullTransitionWrapper &) {
|
||||
return NullTransitionWrapper();
|
||||
}
|
||||
|
|
@ -48,7 +48,7 @@ init_from(const NullTransitionWrapper &) {
|
|||
// Access: Public, Static
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE NullTransitionWrapper NullTransitionWrapper::
|
||||
INLINE_GRAPH NullTransitionWrapper NullTransitionWrapper::
|
||||
init_from(const NullAttributeWrapper &) {
|
||||
return NullTransitionWrapper();
|
||||
}
|
||||
|
|
@ -58,7 +58,7 @@ init_from(const NullAttributeWrapper &) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool NullTransitionWrapper::
|
||||
INLINE_GRAPH bool NullTransitionWrapper::
|
||||
is_identity() const {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -68,7 +68,7 @@ is_identity() const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE int NullTransitionWrapper::
|
||||
INLINE_GRAPH int NullTransitionWrapper::
|
||||
compare_to(const NullTransitionWrapper &) const {
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -78,7 +78,7 @@ compare_to(const NullTransitionWrapper &) const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NullTransitionWrapper::
|
||||
INLINE_GRAPH void NullTransitionWrapper::
|
||||
make_identity() {
|
||||
}
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ make_identity() {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NullTransitionWrapper::
|
||||
INLINE_GRAPH void NullTransitionWrapper::
|
||||
extract_from(const NodeRelation *) {
|
||||
}
|
||||
|
||||
|
|
@ -96,7 +96,7 @@ extract_from(const NodeRelation *) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NullTransitionWrapper::
|
||||
INLINE_GRAPH void NullTransitionWrapper::
|
||||
store_to(NodeRelation *) const {
|
||||
}
|
||||
|
||||
|
|
@ -105,7 +105,7 @@ store_to(NodeRelation *) const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NullTransitionWrapper::
|
||||
INLINE_GRAPH void NullTransitionWrapper::
|
||||
compose_in_place(const NullTransitionWrapper &) {
|
||||
}
|
||||
|
||||
|
|
@ -114,7 +114,7 @@ compose_in_place(const NullTransitionWrapper &) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NullTransitionWrapper::
|
||||
INLINE_GRAPH void NullTransitionWrapper::
|
||||
invert_in_place() {
|
||||
}
|
||||
|
||||
|
|
@ -123,7 +123,7 @@ invert_in_place() {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NullTransitionWrapper::
|
||||
INLINE_GRAPH void NullTransitionWrapper::
|
||||
invert_compose_in_place(const NullTransitionWrapper &) {
|
||||
}
|
||||
|
||||
|
|
@ -132,7 +132,7 @@ invert_compose_in_place(const NullTransitionWrapper &) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE Node *NullTransitionWrapper::
|
||||
INLINE_GRAPH Node *NullTransitionWrapper::
|
||||
extract_from_cache(const NodeRelation *) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -143,7 +143,7 @@ extract_from_cache(const NodeRelation *) {
|
|||
// Description: Stores this transition into the arc's cache, and
|
||||
// updates the arc's top_subtree.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NullTransitionWrapper::
|
||||
INLINE_GRAPH void NullTransitionWrapper::
|
||||
store_to_cache(NodeRelation *, Node *) {
|
||||
}
|
||||
|
||||
|
|
@ -152,7 +152,7 @@ store_to_cache(NodeRelation *, Node *) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool NullTransitionWrapper::
|
||||
INLINE_GRAPH bool NullTransitionWrapper::
|
||||
is_cache_verified(UpdateSeq) const {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -162,7 +162,7 @@ is_cache_verified(UpdateSeq) const {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NullTransitionWrapper::
|
||||
INLINE_GRAPH void NullTransitionWrapper::
|
||||
set_computed_verified(UpdateSeq) {
|
||||
}
|
||||
|
||||
|
|
@ -173,7 +173,7 @@ set_computed_verified(UpdateSeq) {
|
|||
// that indicated by value, using the cache as a helper,
|
||||
// and stores the result in this wrapper.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NullTransitionWrapper::
|
||||
INLINE_GRAPH void NullTransitionWrapper::
|
||||
cached_compose(const NullTransitionWrapper &,
|
||||
const NullTransitionWrapper &,
|
||||
UpdateSeq) {
|
||||
|
|
@ -184,7 +184,7 @@ cached_compose(const NullTransitionWrapper &,
|
|||
// Access: Public, Virtual
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NullTransitionWrapper::
|
||||
INLINE_GRAPH void NullTransitionWrapper::
|
||||
output(ostream &) const {
|
||||
}
|
||||
|
||||
|
|
@ -193,6 +193,11 @@ output(ostream &) const {
|
|||
// Access: Public, Virtual
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void NullTransitionWrapper::
|
||||
INLINE_GRAPH void NullTransitionWrapper::
|
||||
write(ostream &, int) const {
|
||||
}
|
||||
|
||||
INLINE_GRAPH ostream &operator << (ostream &out, const NullTransitionWrapper &ntw) {
|
||||
ntw.output(out);
|
||||
return out;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,45 +42,44 @@ public:
|
|||
typedef NullTransitionWrapper TransitionWrapper;
|
||||
typedef NullAttributeWrapper AttributeWrapper;
|
||||
|
||||
INLINE NullTransitionWrapper();
|
||||
INLINE NullTransitionWrapper(const NullTransitionWrapper ©);
|
||||
INLINE void operator = (const NullTransitionWrapper ©);
|
||||
INLINE_GRAPH NullTransitionWrapper();
|
||||
INLINE_GRAPH NullTransitionWrapper(const NullTransitionWrapper ©);
|
||||
INLINE_GRAPH void operator = (const NullTransitionWrapper ©);
|
||||
|
||||
INLINE static NullTransitionWrapper
|
||||
INLINE_GRAPH static NullTransitionWrapper
|
||||
init_from(const NullTransitionWrapper &other);
|
||||
INLINE static NullTransitionWrapper
|
||||
INLINE_GRAPH static NullTransitionWrapper
|
||||
init_from(const NullAttributeWrapper &attrib);
|
||||
|
||||
INLINE bool is_identity() const;
|
||||
INLINE int compare_to(const NullTransitionWrapper &other) const;
|
||||
INLINE_GRAPH bool is_identity() const;
|
||||
INLINE_GRAPH int compare_to(const NullTransitionWrapper &other) const;
|
||||
|
||||
INLINE void make_identity();
|
||||
INLINE void extract_from(const NodeRelation *arc);
|
||||
INLINE void store_to(NodeRelation *arc) const;
|
||||
INLINE_GRAPH void make_identity();
|
||||
INLINE_GRAPH void extract_from(const NodeRelation *arc);
|
||||
INLINE_GRAPH void store_to(NodeRelation *arc) const;
|
||||
|
||||
INLINE void compose_in_place(const NullTransitionWrapper &other);
|
||||
INLINE void invert_in_place();
|
||||
INLINE void invert_compose_in_place(const NullTransitionWrapper &other);
|
||||
INLINE_GRAPH void compose_in_place(const NullTransitionWrapper &other);
|
||||
INLINE_GRAPH void invert_in_place();
|
||||
INLINE_GRAPH void invert_compose_in_place(const NullTransitionWrapper &other);
|
||||
|
||||
INLINE Node *extract_from_cache(const NodeRelation *arc);
|
||||
INLINE void store_to_cache(NodeRelation *arc, Node *top_subtree);
|
||||
INLINE bool is_cache_verified(UpdateSeq now) const;
|
||||
INLINE void set_computed_verified(UpdateSeq now);
|
||||
INLINE_GRAPH Node *extract_from_cache(const NodeRelation *arc);
|
||||
INLINE_GRAPH void store_to_cache(NodeRelation *arc, Node *top_subtree);
|
||||
INLINE_GRAPH bool is_cache_verified(UpdateSeq now) const;
|
||||
INLINE_GRAPH void set_computed_verified(UpdateSeq now);
|
||||
|
||||
INLINE void cached_compose(const NullTransitionWrapper &cache,
|
||||
INLINE_GRAPH void cached_compose(const NullTransitionWrapper &cache,
|
||||
const NullTransitionWrapper &value,
|
||||
UpdateSeq now);
|
||||
|
||||
INLINE void output(ostream &out) const;
|
||||
INLINE void write(ostream &out, int indent_level = 0) const;
|
||||
INLINE_GRAPH void output(ostream &out) const;
|
||||
INLINE_GRAPH void write(ostream &out, int indent_level = 0) const;
|
||||
};
|
||||
|
||||
INLINE ostream &operator << (ostream &out, const NullTransitionWrapper &ntw) {
|
||||
ntw.output(out);
|
||||
return out;
|
||||
}
|
||||
INLINE_GRAPH ostream &operator << (ostream &out, const NullTransitionWrapper &ntw);
|
||||
|
||||
#ifdef BUILDING_PANDA
|
||||
#include "nullTransitionWrapper.I"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE OnAttribute::
|
||||
INLINE_GRAPH OnAttribute::
|
||||
OnAttribute() {
|
||||
}
|
||||
|
||||
|
|
@ -17,7 +17,7 @@ OnAttribute() {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE OnAttribute::
|
||||
INLINE_GRAPH OnAttribute::
|
||||
OnAttribute(const OnAttribute ©) :
|
||||
NodeAttribute(copy)
|
||||
{
|
||||
|
|
@ -28,7 +28,7 @@ OnAttribute(const OnAttribute ©) :
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void OnAttribute::
|
||||
INLINE_GRAPH void OnAttribute::
|
||||
operator = (const OnAttribute ©) {
|
||||
NodeAttribute::operator = (copy);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@ class OnTransition;
|
|||
////////////////////////////////////////////////////////////////////
|
||||
class EXPCL_PANDA OnAttribute : public NodeAttribute {
|
||||
protected:
|
||||
INLINE OnAttribute();
|
||||
INLINE OnAttribute(const OnAttribute ©);
|
||||
INLINE void operator = (const OnAttribute ©);
|
||||
INLINE_GRAPH OnAttribute() {};
|
||||
INLINE_GRAPH OnAttribute(const OnAttribute ©) : NodeAttribute(copy) {};
|
||||
INLINE_GRAPH void operator = (const OnAttribute ©) {NodeAttribute::operator = (copy);};
|
||||
|
||||
public:
|
||||
virtual void output(ostream &out) const;
|
||||
|
|
@ -50,9 +50,7 @@ public:
|
|||
|
||||
private:
|
||||
static TypeHandle _type_handle;
|
||||
friend class OnTransition;
|
||||
friend class OnTransition;
|
||||
};
|
||||
|
||||
#include "onAttribute.I"
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE OnOffAttribute::
|
||||
INLINE_GRAPH OnOffAttribute::
|
||||
OnOffAttribute(bool is_on) {
|
||||
_is_on = is_on;
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@ OnOffAttribute(bool is_on) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE OnOffAttribute::
|
||||
INLINE_GRAPH OnOffAttribute::
|
||||
OnOffAttribute(const OnOffAttribute ©) :
|
||||
NodeAttribute(copy),
|
||||
_is_on(copy._is_on)
|
||||
|
|
@ -30,7 +30,7 @@ OnOffAttribute(const OnOffAttribute ©) :
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void OnOffAttribute::
|
||||
INLINE_GRAPH void OnOffAttribute::
|
||||
operator = (const OnOffAttribute ©) {
|
||||
NodeAttribute::operator = (copy);
|
||||
_is_on = copy._is_on;
|
||||
|
|
@ -49,7 +49,7 @@ operator = (const OnOffAttribute ©) {
|
|||
// should override this function to accept a value
|
||||
// parameter of the appropriate type.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void OnOffAttribute::
|
||||
INLINE_GRAPH void OnOffAttribute::
|
||||
set_on() {
|
||||
_is_on = true;
|
||||
}
|
||||
|
|
@ -61,7 +61,7 @@ set_on() {
|
|||
// turns off the attribute for all nodes at this point
|
||||
// and below.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void OnOffAttribute::
|
||||
INLINE_GRAPH void OnOffAttribute::
|
||||
set_off() {
|
||||
_is_on = false;
|
||||
}
|
||||
|
|
@ -72,7 +72,7 @@ set_off() {
|
|||
// Description: Returns true if the attribute is on, false if it is
|
||||
// not.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool OnOffAttribute::
|
||||
INLINE_GRAPH bool OnOffAttribute::
|
||||
is_on() const {
|
||||
return _is_on;
|
||||
}
|
||||
|
|
@ -83,7 +83,7 @@ is_on() const {
|
|||
// Description: Returns true if the attribute is off, false if it is
|
||||
// not.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool OnOffAttribute::
|
||||
INLINE_GRAPH bool OnOffAttribute::
|
||||
is_off() const {
|
||||
return !_is_on;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,16 +18,16 @@ class OnOffTransition;
|
|||
////////////////////////////////////////////////////////////////////
|
||||
class EXPCL_PANDA OnOffAttribute : public NodeAttribute {
|
||||
protected:
|
||||
INLINE OnOffAttribute(bool is_on = false);
|
||||
INLINE OnOffAttribute(const OnOffAttribute ©);
|
||||
INLINE void operator = (const OnOffAttribute ©);
|
||||
INLINE_GRAPH OnOffAttribute(bool is_on = false);
|
||||
INLINE_GRAPH OnOffAttribute(const OnOffAttribute ©);
|
||||
INLINE_GRAPH void operator = (const OnOffAttribute ©);
|
||||
|
||||
PUBLISHED:
|
||||
INLINE void set_on();
|
||||
INLINE void set_off();
|
||||
INLINE_GRAPH void set_on();
|
||||
INLINE_GRAPH void set_off();
|
||||
|
||||
INLINE bool is_on() const;
|
||||
INLINE bool is_off() const;
|
||||
INLINE_GRAPH bool is_on() const;
|
||||
INLINE_GRAPH bool is_off() const;
|
||||
|
||||
public:
|
||||
virtual void output(ostream &out) const;
|
||||
|
|
@ -63,6 +63,8 @@ private:
|
|||
friend class OnOffTransition;
|
||||
};
|
||||
|
||||
#ifdef BUILDING_PANDA
|
||||
#include "onOffAttribute.I"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE OnOffTransition::
|
||||
INLINE_GRAPH OnOffTransition::
|
||||
OnOffTransition(TransitionDirection direction) {
|
||||
_direction = direction;
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@ OnOffTransition(TransitionDirection direction) {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE OnOffTransition::
|
||||
INLINE_GRAPH OnOffTransition::
|
||||
OnOffTransition(const OnOffTransition ©) :
|
||||
NodeTransition(copy),
|
||||
_direction(copy._direction)
|
||||
|
|
@ -30,7 +30,7 @@ OnOffTransition(const OnOffTransition ©) :
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void OnOffTransition::
|
||||
INLINE_GRAPH void OnOffTransition::
|
||||
operator = (const OnOffTransition ©) {
|
||||
NodeTransition::operator = (copy);
|
||||
_direction = copy._direction;
|
||||
|
|
@ -43,7 +43,7 @@ operator = (const OnOffTransition ©) {
|
|||
// this has no effect on the attribute for any nodes at
|
||||
// this point and below.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void OnOffTransition::
|
||||
INLINE_GRAPH void OnOffTransition::
|
||||
set_identity() {
|
||||
_direction = TD_identity;
|
||||
state_changed();
|
||||
|
|
@ -62,7 +62,7 @@ set_identity() {
|
|||
// should override this function to accept a value
|
||||
// parameter of the appropriate type.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void OnOffTransition::
|
||||
INLINE_GRAPH void OnOffTransition::
|
||||
set_on() {
|
||||
_direction = TD_on;
|
||||
state_changed();
|
||||
|
|
@ -75,7 +75,7 @@ set_on() {
|
|||
// turns off the attribute for all nodes at this point
|
||||
// and below.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void OnOffTransition::
|
||||
INLINE_GRAPH void OnOffTransition::
|
||||
set_off() {
|
||||
_direction = TD_off;
|
||||
state_changed();
|
||||
|
|
@ -87,7 +87,7 @@ set_off() {
|
|||
// Description: Returns true if this is the identity transition,
|
||||
// false otherwise.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool OnOffTransition::
|
||||
INLINE_GRAPH bool OnOffTransition::
|
||||
is_identity() const {
|
||||
return _direction == TD_identity;
|
||||
}
|
||||
|
|
@ -100,7 +100,7 @@ is_identity() const {
|
|||
// value, it should define a get_value() function which
|
||||
// allows you to query the on value.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool OnOffTransition::
|
||||
INLINE_GRAPH bool OnOffTransition::
|
||||
is_on() const {
|
||||
return _direction == TD_on;
|
||||
}
|
||||
|
|
@ -111,7 +111,7 @@ is_on() const {
|
|||
// Description: Returns true if this transition is the 'off'
|
||||
// transition, false otherwise.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool OnOffTransition::
|
||||
INLINE_GRAPH bool OnOffTransition::
|
||||
is_off() const {
|
||||
return _direction == TD_off;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,18 +36,18 @@ class NodeRelation;
|
|||
////////////////////////////////////////////////////////////////////
|
||||
class EXPCL_PANDA OnOffTransition : public NodeTransition {
|
||||
protected:
|
||||
INLINE OnOffTransition(TransitionDirection direction = TD_identity);
|
||||
INLINE OnOffTransition(const OnOffTransition ©);
|
||||
INLINE void operator = (const OnOffTransition ©);
|
||||
INLINE_GRAPH OnOffTransition(TransitionDirection direction = TD_identity);
|
||||
INLINE_GRAPH OnOffTransition(const OnOffTransition ©);
|
||||
INLINE_GRAPH void operator = (const OnOffTransition ©);
|
||||
|
||||
PUBLISHED:
|
||||
INLINE void set_identity();
|
||||
INLINE void set_on();
|
||||
INLINE void set_off();
|
||||
INLINE_GRAPH void set_identity();
|
||||
INLINE_GRAPH void set_on();
|
||||
INLINE_GRAPH void set_off();
|
||||
|
||||
INLINE bool is_identity() const;
|
||||
INLINE bool is_on() const;
|
||||
INLINE bool is_off() const;
|
||||
INLINE_GRAPH bool is_identity() const;
|
||||
INLINE_GRAPH bool is_on() const;
|
||||
INLINE_GRAPH bool is_off() const;
|
||||
|
||||
public:
|
||||
virtual NodeTransition *compose(const NodeTransition *other) const;
|
||||
|
|
@ -92,10 +92,11 @@ public:
|
|||
|
||||
private:
|
||||
static TypeHandle _type_handle;
|
||||
|
||||
friend class OnOffAttribute;
|
||||
friend class OnOffAttribute;
|
||||
};
|
||||
|
||||
#ifdef BUILDING_PANDA
|
||||
#include "onOffTransition.I"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE OnTransition::
|
||||
INLINE_GRAPH OnTransition::
|
||||
OnTransition() {
|
||||
}
|
||||
|
||||
|
|
@ -17,7 +17,7 @@ OnTransition() {
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE OnTransition::
|
||||
INLINE_GRAPH OnTransition::
|
||||
OnTransition(const OnTransition ©) :
|
||||
NodeTransition(copy)
|
||||
{
|
||||
|
|
@ -28,7 +28,7 @@ OnTransition(const OnTransition ©) :
|
|||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void OnTransition::
|
||||
INLINE_GRAPH void OnTransition::
|
||||
operator = (const OnTransition ©) {
|
||||
NodeTransition::operator = (copy);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@ class NodeRelation;
|
|||
////////////////////////////////////////////////////////////////////
|
||||
class EXPCL_PANDA OnTransition : public NodeTransition {
|
||||
protected:
|
||||
INLINE OnTransition();
|
||||
INLINE OnTransition(const OnTransition ©);
|
||||
INLINE void operator = (const OnTransition ©);
|
||||
INLINE_GRAPH OnTransition();
|
||||
INLINE_GRAPH OnTransition(const OnTransition ©);
|
||||
INLINE_GRAPH void operator = (const OnTransition ©);
|
||||
|
||||
public:
|
||||
virtual NodeTransition *compose(const NodeTransition *other) const;
|
||||
|
|
@ -72,10 +72,11 @@ public:
|
|||
|
||||
private:
|
||||
static TypeHandle _type_handle;
|
||||
|
||||
friend class OnAttribute;
|
||||
friend class OnAttribute;
|
||||
};
|
||||
|
||||
#ifdef BUILDING_PANDA
|
||||
#include "onTransition.I"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -120,6 +120,6 @@ template<class InputIterator>
|
|||
ostream &
|
||||
tmap_output(InputIterator first, InputIterator last, ostream &out);
|
||||
|
||||
#include "setTransitionHelpers.I"
|
||||
#include "setTransitionHelpers.T"
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
// should be pruned at this node.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class TW, class LevelState>
|
||||
INLINE bool TraverserVisitor<TW, LevelState>::
|
||||
INLINE_GRAPH bool TraverserVisitor<TW, LevelState>::
|
||||
reached_node(Node *,
|
||||
TraverserVisitor<TW, LevelState>::AttributeWrapper &,
|
||||
LevelState &) {
|
||||
|
|
@ -28,7 +28,7 @@ reached_node(Node *,
|
|||
// pruned and not reach the destination node.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class TW, class LevelState>
|
||||
INLINE bool TraverserVisitor<TW, LevelState>::
|
||||
INLINE_GRAPH bool TraverserVisitor<TW, LevelState>::
|
||||
forward_arc(NodeRelation *,
|
||||
TraverserVisitor<TW, LevelState>::TransitionWrapper &,
|
||||
TraverserVisitor<TW, LevelState>::AttributeWrapper &,
|
||||
|
|
@ -48,7 +48,7 @@ forward_arc(NodeRelation *,
|
|||
// unmatched call to forward_arc.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class TW, class LevelState>
|
||||
INLINE void TraverserVisitor<TW, LevelState>::
|
||||
INLINE_GRAPH void TraverserVisitor<TW, LevelState>::
|
||||
backward_arc(NodeRelation *,
|
||||
TraverserVisitor<TW, LevelState>::TransitionWrapper &,
|
||||
TraverserVisitor<TW, LevelState>::AttributeWrapper &,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,57 @@
|
|||
// 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 &) {
|
||||
}
|
||||
|
|
@ -17,7 +17,7 @@ public:
|
|||
typedef TW TransitionWrapper;
|
||||
typedef TYPENAME TransitionWrapper::AttributeWrapper AttributeWrapper;
|
||||
|
||||
INLINE bool reached_node(Node *node,
|
||||
INLINE_GRAPH bool reached_node(Node *node,
|
||||
AttributeWrapper &render_state,
|
||||
LevelState &level_state);
|
||||
|
||||
|
|
@ -25,15 +25,15 @@ public:
|
|||
// following two functions to mark the crossing of arcs. This will
|
||||
// allow the Visitor to maintain its own internal state as needed.
|
||||
|
||||
INLINE bool forward_arc(NodeRelation *arc, TransitionWrapper &trans,
|
||||
INLINE_GRAPH bool forward_arc(NodeRelation *arc, TransitionWrapper &trans,
|
||||
AttributeWrapper &pre, AttributeWrapper &post,
|
||||
LevelState &level_state);
|
||||
INLINE void backward_arc(NodeRelation *arc, TransitionWrapper &trans,
|
||||
INLINE_GRAPH void backward_arc(NodeRelation *arc, TransitionWrapper &trans,
|
||||
AttributeWrapper &pre, AttributeWrapper &post,
|
||||
const LevelState &level_state);
|
||||
};
|
||||
|
||||
#include "traverserVisitor.I"
|
||||
#include "traverserVisitor.T"
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -533,7 +533,7 @@ uncached_wrt_base(const Node *from,
|
|||
// various wrt() wrappers instead.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class InputIterator1, class InputIterator2, class TransitionWrapper>
|
||||
INLINE void
|
||||
INLINE_GRAPH void
|
||||
wrt_base(const Node *from,
|
||||
InputIterator1 from_arcs_begin, InputIterator1 from_arcs_end,
|
||||
const Node *to,
|
||||
|
|
@ -554,7 +554,7 @@ wrt_base(const Node *from,
|
|||
}
|
||||
|
||||
template<class TransitionWrapper>
|
||||
INLINE void
|
||||
INLINE_GRAPH void
|
||||
wrt(const Node *from, const Node *to,
|
||||
TransitionWrapper &result, TypeHandle graph_type) {
|
||||
// In the normal wrt() interface, we have no from_arcs or to_arcs
|
||||
|
|
@ -564,7 +564,7 @@ wrt(const Node *from, const Node *to,
|
|||
}
|
||||
|
||||
template<class InputIterator, class TransitionWrapper>
|
||||
INLINE void
|
||||
INLINE_GRAPH void
|
||||
wrt(const Node *from,
|
||||
InputIterator from_arcs_begin, InputIterator from_arcs_end,
|
||||
const Node *to,
|
||||
|
|
@ -575,7 +575,7 @@ wrt(const Node *from,
|
|||
}
|
||||
|
||||
template<class InputIterator, class TransitionWrapper>
|
||||
INLINE void
|
||||
INLINE_GRAPH void
|
||||
wrt(const Node *from,
|
||||
const Node *to,
|
||||
InputIterator to_arcs_begin, InputIterator to_arcs_end,
|
||||
|
|
@ -586,7 +586,7 @@ wrt(const Node *from,
|
|||
}
|
||||
|
||||
template<class InputIterator1, class InputIterator2, class TransitionWrapper>
|
||||
INLINE void
|
||||
INLINE_GRAPH void
|
||||
wrt(const Node *from,
|
||||
InputIterator1 from_arcs_begin, InputIterator1 from_arcs_end,
|
||||
const Node *to,
|
||||
|
|
@ -599,7 +599,7 @@ wrt(const Node *from,
|
|||
|
||||
#ifndef NDEBUG
|
||||
template<class TransitionWrapper>
|
||||
INLINE void
|
||||
INLINE_GRAPH void
|
||||
uncached_wrt(const Node *from, const Node *to,
|
||||
TransitionWrapper &result, TypeHandle graph_type) {
|
||||
const NodeRelation *arc = NULL;
|
||||
|
|
@ -607,7 +607,7 @@ uncached_wrt(const Node *from, const Node *to,
|
|||
}
|
||||
|
||||
template<class InputIterator, class TransitionWrapper>
|
||||
INLINE void
|
||||
INLINE_GRAPH void
|
||||
uncached_wrt(const Node *from,
|
||||
InputIterator from_arcs_begin, InputIterator from_arcs_end,
|
||||
const Node *to,
|
||||
|
|
@ -618,7 +618,7 @@ uncached_wrt(const Node *from,
|
|||
}
|
||||
|
||||
template<class InputIterator, class TransitionWrapper>
|
||||
INLINE void
|
||||
INLINE_GRAPH void
|
||||
uncached_wrt(const Node *from,
|
||||
const Node *to,
|
||||
InputIterator to_arcs_begin, InputIterator to_arcs_end,
|
||||
|
|
@ -629,7 +629,7 @@ uncached_wrt(const Node *from,
|
|||
}
|
||||
|
||||
template<class InputIterator1, class InputIterator2, class TransitionWrapper>
|
||||
INLINE void
|
||||
INLINE_GRAPH void
|
||||
uncached_wrt(const Node *from,
|
||||
InputIterator1 from_arcs_begin, InputIterator1 from_arcs_end,
|
||||
const Node *to,
|
||||
|
|
@ -734,7 +734,7 @@ get_uncached_wrt_subtree(Node *node, Node *to, TransitionWrapper &result,
|
|||
}
|
||||
|
||||
template<class TransitionWrapper>
|
||||
INLINE Node *
|
||||
INLINE_GRAPH Node *
|
||||
uncached_wrt_subtree(NodeRelation *arc, Node *to,
|
||||
TransitionWrapper &result, TypeHandle graph_type) {
|
||||
Node *stop =
|
||||
|
|
@ -921,7 +921,7 @@ cached_wrt_subtree(NodeRelation *arc, Node *to, UpdateSeq as_of, UpdateSeq now,
|
|||
}
|
||||
|
||||
template<class TransitionWrapper>
|
||||
INLINE Node *
|
||||
INLINE_GRAPH Node *
|
||||
wrt_subtree(NodeRelation *arc, Node *to, UpdateSeq as_of, UpdateSeq now,
|
||||
TransitionWrapper &result, TypeHandle graph_type) {
|
||||
#ifndef NDEBUG
|
||||
|
|
|
|||
|
|
@ -35,26 +35,26 @@ class Node;
|
|||
// to_arcs_begin..to_arcs_end.
|
||||
|
||||
template<class TransitionWrapper>
|
||||
INLINE void
|
||||
INLINE_GRAPH void
|
||||
wrt(const Node *from, const Node *to,
|
||||
TransitionWrapper &result, TypeHandle graph_type);
|
||||
|
||||
template<class InputIterator, class TransitionWrapper>
|
||||
INLINE void
|
||||
INLINE_GRAPH void
|
||||
wrt(const Node *from,
|
||||
InputIterator from_arcs_begin, InputIterator from_arcs_end,
|
||||
const Node *to,
|
||||
TransitionWrapper &result, TypeHandle graph_type);
|
||||
|
||||
template<class InputIterator, class TransitionWrapper>
|
||||
INLINE void
|
||||
INLINE_GRAPH void
|
||||
wrt(const Node *from,
|
||||
const Node *to,
|
||||
InputIterator to_arcs_begin, InputIterator to_arcs_end,
|
||||
TransitionWrapper &result, TypeHandle graph_type);
|
||||
|
||||
template<class InputIterator1, class InputIterator2, class TransitionWrapper>
|
||||
INLINE void
|
||||
INLINE_GRAPH void
|
||||
wrt(const Node *from,
|
||||
InputIterator1 from_arcs_begin, InputIterator1 from_arcs_end,
|
||||
const Node *to,
|
||||
|
|
@ -67,26 +67,26 @@ wrt(const Node *from,
|
|||
// that you can configure 'cache-wrt' or 'paranoid-wrt' to disable or
|
||||
// force verification of the cache implicitly.
|
||||
template<class TransitionWrapper>
|
||||
INLINE void
|
||||
INLINE_GRAPH void
|
||||
uncached_wrt(const Node *from, const Node *to,
|
||||
TransitionWrapper &result, TypeHandle graph_type);
|
||||
|
||||
template<class InputIterator, class TransitionWrapper>
|
||||
INLINE void
|
||||
INLINE_GRAPH void
|
||||
uncached_wrt(const Node *from,
|
||||
InputIterator from_arcs_begin, InputIterator from_arcs_end,
|
||||
const Node *to,
|
||||
TransitionWrapper &result, TypeHandle graph_type);
|
||||
|
||||
template<class InputIterator, class TransitionWrapper>
|
||||
INLINE void
|
||||
INLINE_GRAPH void
|
||||
uncached_wrt(const Node *from,
|
||||
const Node *to,
|
||||
InputIterator to_arcs_begin, InputIterator to_arcs_end,
|
||||
TransitionWrapper &result, TypeHandle graph_type);
|
||||
|
||||
template<class InputIterator1, class InputIterator2, class TransitionWrapper>
|
||||
INLINE void
|
||||
INLINE_GRAPH void
|
||||
uncached_wrt(const Node *from,
|
||||
InputIterator1 from_arcs_begin, InputIterator1 from_arcs_end,
|
||||
const Node *to,
|
||||
|
|
@ -123,11 +123,13 @@ uncached_wrt(const Node *from,
|
|||
// current most recent update sequence anywhere, used to use to mark
|
||||
// any computed cache values.
|
||||
template<class TransitionWrapper>
|
||||
INLINE Node *
|
||||
INLINE_GRAPH Node *
|
||||
wrt_subtree(NodeRelation *arc, Node *to, UpdateSeq as_of, UpdateSeq now,
|
||||
TransitionWrapper &result, TypeHandle graph_type);
|
||||
|
||||
|
||||
#ifdef BUILDING_PANDA
|
||||
#include "wrt.I"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -118,4 +118,50 @@
|
|||
|
||||
#endif /* WIN32_VC */
|
||||
|
||||
#ifdef WIN32_VC
|
||||
#define INLINE_LINMATH __forceinline
|
||||
#define INLINE_MATHUTIL __forceinline
|
||||
|
||||
#ifdef BUILDING_PANDA
|
||||
#define INLINE_GRAPH __forceinline
|
||||
#else
|
||||
#define INLINE_GRAPH
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define INLINE_LINMATH INLINE
|
||||
#define INLINE_MATHUTIL INLINE
|
||||
#define INLINE_GRAPH INLINE
|
||||
#endif
|
||||
|
||||
#define INLINE_CHAR INLINE
|
||||
#define INLINE_CHAT INLINE
|
||||
#define INLINE_CHAN INLINE
|
||||
#define INLINE_CHANCFG INLINE
|
||||
#define INLINE_COLLIDE INLINE
|
||||
#define INLINE_CULL INLINE
|
||||
#define INLINE_DEVICE INLINE
|
||||
#define INLINE_DGRAPH INLINE
|
||||
#define INLINE_DISPLAY INLINE
|
||||
#define INLINE_GOBJ INLINE
|
||||
#define INLINE_GRUTIL INLINE
|
||||
|
||||
#define INLINE_GSGBASE INLINE
|
||||
#define INLINE_GSGMISC INLINE
|
||||
#define INLINE_LIGHT INLINE
|
||||
#define INLINE_PARAMETRICS INLINE
|
||||
#define INLINE_SGRATTRIB INLINE
|
||||
#define INLINE_SGMANIP INLINE
|
||||
#define INLINE_SGRAPH INLINE
|
||||
#define INLINE_SGRAPHUTIL INLINE
|
||||
#define INLINE_SWITCHNODE INLINE
|
||||
#define INLINE_TEXT INLINE
|
||||
#define INLINE_TFORM INLINE
|
||||
#define INLINE_LERP INLINE
|
||||
#define INLINE_LOADER INLINE
|
||||
#define INLINE_PUTIL INLINE
|
||||
#define INLINE_EFFECTS INLINE
|
||||
#define INLINE_GUI INLINE
|
||||
#define INLINE_AUDIO INLINE
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue