Panda3D

nodePathComponent.I

00001 // Filename: nodePathComponent.I
00002 // Created by:  drose (25Feb02)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 
00016 ////////////////////////////////////////////////////////////////////
00017 //     Function: NodePathComponent::CData::Constructor
00018 //       Access: Public
00019 //  Description:
00020 ////////////////////////////////////////////////////////////////////
00021 INLINE NodePathComponent::CData::
00022 CData() {
00023   _length = 1;
00024 }
00025 
00026 ////////////////////////////////////////////////////////////////////
00027 //     Function: NodePathComponent::CData::Copy Constructor
00028 //       Access: Public
00029 //  Description:
00030 ////////////////////////////////////////////////////////////////////
00031 INLINE NodePathComponent::CData::
00032 CData(const NodePathComponent::CData &copy) :
00033   _next(copy._next),
00034   _length(copy._length)
00035 {
00036 }
00037 
00038 ////////////////////////////////////////////////////////////////////
00039 //     Function: NodePathComponent::Copy Constructor
00040 //       Access: Private
00041 //  Description: NodePathComponents should not be copied.
00042 ////////////////////////////////////////////////////////////////////
00043 INLINE NodePathComponent::
00044 NodePathComponent(const NodePathComponent &copy) {
00045   nassertv(false);
00046 }
00047 
00048 ////////////////////////////////////////////////////////////////////
00049 //     Function: NodePathComponent::Copy Assignment Operator
00050 //       Access: Private
00051 //  Description: NodePathComponents should not be copied.
00052 ////////////////////////////////////////////////////////////////////
00053 INLINE void NodePathComponent::
00054 operator = (const NodePathComponent &copy) {
00055   nassertv(false);
00056 }
00057 
00058 
00059 ////////////////////////////////////////////////////////////////////
00060 //     Function: NodePathComponent::Destructor
00061 //       Access: Public
00062 //  Description:
00063 ////////////////////////////////////////////////////////////////////
00064 INLINE NodePathComponent::
00065 ~NodePathComponent() {
00066   nassertv(_node != (PandaNode *)NULL);
00067   _node->delete_component(this);
00068 }
00069 
00070 ////////////////////////////////////////////////////////////////////
00071 //     Function: NodePathComponent::get_node
00072 //       Access: Public
00073 //  Description: Returns the node referenced by this component.
00074 ////////////////////////////////////////////////////////////////////
00075 INLINE PandaNode *NodePathComponent::
00076 get_node() const {
00077   nassertr(_node != (PandaNode *)NULL, _node);
00078   return _node;
00079 }
00080 
00081 ////////////////////////////////////////////////////////////////////
00082 //     Function: NodePathComponent::has_key
00083 //       Access: Public
00084 //  Description: Returns true if the key for this component has
00085 //               already been generated, false otherwise.  Even if
00086 //               this returns false, calling get_key() will still
00087 //               return a valid key; that will simply cause the key to
00088 //               be generated on-the-fly.
00089 ////////////////////////////////////////////////////////////////////
00090 INLINE bool NodePathComponent::
00091 has_key() const {
00092   return (_key != 0);
00093 }
00094 
00095 INLINE ostream &operator << (ostream &out, const NodePathComponent &comp) {
00096   comp.output(out);
00097   return out;
00098 }
00099 
 All Classes Functions Variables Enumerations