Panda3D

eggFilenameNode.I

00001 // Filename: eggFilenameNode.I
00002 // Created by:  drose (11Feb99)
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: EggFilenameNode::Default constructor
00018 //       Access: Public
00019 //  Description:
00020 ////////////////////////////////////////////////////////////////////
00021 INLINE EggFilenameNode::
00022 EggFilenameNode() {
00023 }
00024 
00025 ////////////////////////////////////////////////////////////////////
00026 //     Function: EggFilenameNode::Constructor
00027 //       Access: Public
00028 //  Description:
00029 ////////////////////////////////////////////////////////////////////
00030 INLINE EggFilenameNode::
00031 EggFilenameNode(const string &node_name, const Filename &filename) :
00032   EggNode(node_name),
00033   _filename(filename),
00034   _fullpath(filename)
00035 {
00036 }
00037 
00038 ////////////////////////////////////////////////////////////////////
00039 //     Function: EggFilenameNode::Copy constructor
00040 //       Access: Public
00041 //  Description:
00042 ////////////////////////////////////////////////////////////////////
00043 INLINE EggFilenameNode::
00044 EggFilenameNode(const EggFilenameNode &copy) :
00045   EggNode(copy),
00046   _filename(copy._filename),
00047   _fullpath(copy._fullpath)
00048 {
00049 }
00050 
00051 ////////////////////////////////////////////////////////////////////
00052 //     Function: EggFilenameNode::Copy assignment operator
00053 //       Access: Public
00054 //  Description:
00055 ////////////////////////////////////////////////////////////////////
00056 INLINE EggFilenameNode &EggFilenameNode::
00057 operator = (const EggFilenameNode &copy) {
00058   EggNode::operator = (copy);
00059   _filename = copy._filename;
00060   _fullpath = copy._fullpath;
00061   return *this;
00062 }
00063 
00064 ////////////////////////////////////////////////////////////////////
00065 //     Function: EggFilenameNode::get_filename
00066 //       Access: Public
00067 //  Description: Returns a nonmodifiable reference to the filename.
00068 ////////////////////////////////////////////////////////////////////
00069 INLINE const Filename &EggFilenameNode::
00070 get_filename() const {
00071   return _filename;
00072 }
00073 
00074 ////////////////////////////////////////////////////////////////////
00075 //     Function: EggFilenameNode::set_filename
00076 //       Access: Public
00077 //  Description:
00078 ////////////////////////////////////////////////////////////////////
00079 INLINE void EggFilenameNode::
00080 set_filename(const Filename &filename) {
00081   _filename = filename;
00082   _fullpath = filename;
00083 }
00084 
00085 ////////////////////////////////////////////////////////////////////
00086 //     Function: EggFilenameNode::get_fullpath
00087 //       Access: Public
00088 //  Description: Returns the full pathname to the file, if it is
00089 //               known; otherwise, returns the same thing as
00090 //               get_filename().
00091 //
00092 //               This function simply returns whatever was set by the
00093 //               last call to set_fullpath().  This string is not
00094 //               written to the egg file; its main purpose is to
00095 //               record the full path to a filename (for instance, a
00096 //               texture filename) if it is known, for egg structures
00097 //               that are generated in-memory and then immediately
00098 //               converted to a scene graph.
00099 ////////////////////////////////////////////////////////////////////
00100 INLINE const Filename &EggFilenameNode::
00101 get_fullpath() const {
00102   return _fullpath;
00103 }
00104 
00105 ////////////////////////////////////////////////////////////////////
00106 //     Function: EggFilenameNode::set_fullpath
00107 //       Access: Public
00108 //  Description: Records the full pathname to the file, for the
00109 //               benefit of get_fullpath().
00110 ////////////////////////////////////////////////////////////////////
00111 INLINE void EggFilenameNode::
00112 set_fullpath(const Filename &fullpath) {
00113   _fullpath = fullpath;
00114 }
 All Classes Functions Variables Enumerations