00001 // Filename: eggFilenameNode.I 00002 // Created by: drose (11Feb99) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: EggFilenameNode::Default constructor 00022 // Access: Public 00023 // Description: 00024 //////////////////////////////////////////////////////////////////// 00025 INLINE EggFilenameNode:: 00026 EggFilenameNode() { 00027 } 00028 00029 //////////////////////////////////////////////////////////////////// 00030 // Function: EggFilenameNode::Constructor 00031 // Access: Public 00032 // Description: 00033 //////////////////////////////////////////////////////////////////// 00034 INLINE EggFilenameNode:: 00035 EggFilenameNode(const string &node_name, const Filename &filename) : 00036 EggNode(node_name), 00037 _filename(filename), 00038 _fullpath(filename) 00039 { 00040 } 00041 00042 //////////////////////////////////////////////////////////////////// 00043 // Function: EggFilenameNode::Copy constructor 00044 // Access: Public 00045 // Description: 00046 //////////////////////////////////////////////////////////////////// 00047 INLINE EggFilenameNode:: 00048 EggFilenameNode(const EggFilenameNode ©) : 00049 EggNode(copy), 00050 _filename(copy._filename), 00051 _fullpath(copy._fullpath) 00052 { 00053 } 00054 00055 //////////////////////////////////////////////////////////////////// 00056 // Function: EggFilenameNode::Copy assignment operator 00057 // Access: Public 00058 // Description: 00059 //////////////////////////////////////////////////////////////////// 00060 INLINE EggFilenameNode &EggFilenameNode:: 00061 operator = (const EggFilenameNode ©) { 00062 EggNode::operator = (copy); 00063 _filename = copy._filename; 00064 _fullpath = copy._fullpath; 00065 return *this; 00066 } 00067 00068 //////////////////////////////////////////////////////////////////// 00069 // Function: EggFilenameNode::get_filename 00070 // Access: Public 00071 // Description: Returns a nonmodifiable reference to the filename. 00072 //////////////////////////////////////////////////////////////////// 00073 INLINE const Filename &EggFilenameNode:: 00074 get_filename() const { 00075 return _filename; 00076 } 00077 00078 //////////////////////////////////////////////////////////////////// 00079 // Function: EggFilenameNode::set_filename 00080 // Access: Public 00081 // Description: 00082 //////////////////////////////////////////////////////////////////// 00083 INLINE void EggFilenameNode:: 00084 set_filename(const Filename &filename) { 00085 _filename = filename; 00086 _fullpath = filename; 00087 } 00088 00089 //////////////////////////////////////////////////////////////////// 00090 // Function: EggFilenameNode::get_fullpath 00091 // Access: Public 00092 // Description: Returns the full pathname to the file, if it is 00093 // known; otherwise, returns the same thing as 00094 // get_filename(). 00095 // 00096 // This function simply returns whatever was set by the 00097 // last call to set_fullpath(). This string is not 00098 // written to the egg file; its main purpose is to 00099 // record the full path to a filename (for instance, a 00100 // texture filename) if it is known, for egg structures 00101 // that are generated in-memory and then immediately 00102 // converted to a scene graph. 00103 //////////////////////////////////////////////////////////////////// 00104 INLINE const Filename &EggFilenameNode:: 00105 get_fullpath() const { 00106 return _fullpath; 00107 } 00108 00109 //////////////////////////////////////////////////////////////////// 00110 // Function: EggFilenameNode::set_fullpath 00111 // Access: Public 00112 // Description: Records the full pathname to the file, for the 00113 // benefit of get_fullpath(). 00114 //////////////////////////////////////////////////////////////////// 00115 INLINE void EggFilenameNode:: 00116 set_fullpath(const Filename &fullpath) { 00117 _fullpath = fullpath; 00118 }