Panda3D
eggFilenameNode.I
1 // Filename: eggFilenameNode.I
2 // Created by: drose (11Feb99)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: EggFilenameNode::Default constructor
18 // Access: Public
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE EggFilenameNode::
22 EggFilenameNode() {
23 }
24 
25 ////////////////////////////////////////////////////////////////////
26 // Function: EggFilenameNode::Constructor
27 // Access: Public
28 // Description:
29 ////////////////////////////////////////////////////////////////////
30 INLINE EggFilenameNode::
31 EggFilenameNode(const string &node_name, const Filename &filename) :
32  EggNode(node_name),
33  _filename(filename),
34  _fullpath(filename)
35 {
36 }
37 
38 ////////////////////////////////////////////////////////////////////
39 // Function: EggFilenameNode::Copy constructor
40 // Access: Public
41 // Description:
42 ////////////////////////////////////////////////////////////////////
43 INLINE EggFilenameNode::
44 EggFilenameNode(const EggFilenameNode &copy) :
45  EggNode(copy),
46  _filename(copy._filename),
47  _fullpath(copy._fullpath)
48 {
49 }
50 
51 ////////////////////////////////////////////////////////////////////
52 // Function: EggFilenameNode::Copy assignment operator
53 // Access: Public
54 // Description:
55 ////////////////////////////////////////////////////////////////////
56 INLINE EggFilenameNode &EggFilenameNode::
57 operator = (const EggFilenameNode &copy) {
58  EggNode::operator = (copy);
59  _filename = copy._filename;
60  _fullpath = copy._fullpath;
61  return *this;
62 }
63 
64 ////////////////////////////////////////////////////////////////////
65 // Function: EggFilenameNode::get_filename
66 // Access: Public
67 // Description: Returns a nonmodifiable reference to the filename.
68 ////////////////////////////////////////////////////////////////////
69 INLINE const Filename &EggFilenameNode::
70 get_filename() const {
71  return _filename;
72 }
73 
74 ////////////////////////////////////////////////////////////////////
75 // Function: EggFilenameNode::set_filename
76 // Access: Public
77 // Description:
78 ////////////////////////////////////////////////////////////////////
79 INLINE void EggFilenameNode::
80 set_filename(const Filename &filename) {
81  _filename = filename;
82  _fullpath = filename;
83 }
84 
85 ////////////////////////////////////////////////////////////////////
86 // Function: EggFilenameNode::get_fullpath
87 // Access: Public
88 // Description: Returns the full pathname to the file, if it is
89 // known; otherwise, returns the same thing as
90 // get_filename().
91 //
92 // This function simply returns whatever was set by the
93 // last call to set_fullpath(). This string is not
94 // written to the egg file; its main purpose is to
95 // record the full path to a filename (for instance, a
96 // texture filename) if it is known, for egg structures
97 // that are generated in-memory and then immediately
98 // converted to a scene graph.
99 ////////////////////////////////////////////////////////////////////
100 INLINE const Filename &EggFilenameNode::
101 get_fullpath() const {
102  return _fullpath;
103 }
104 
105 ////////////////////////////////////////////////////////////////////
106 // Function: EggFilenameNode::set_fullpath
107 // Access: Public
108 // Description: Records the full pathname to the file, for the
109 // benefit of get_fullpath().
110 ////////////////////////////////////////////////////////////////////
111 INLINE void EggFilenameNode::
112 set_fullpath(const Filename &fullpath) {
113  _fullpath = fullpath;
114 }
void set_fullpath(const Filename &fullpath)
Records the full pathname to the file, for the benefit of get_fullpath().
const Filename & get_filename() const
Returns a nonmodifiable reference to the filename.
This is an egg node that contains a filename.
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44
const Filename & get_fullpath() const
Returns the full pathname to the file, if it is known; otherwise, returns the same thing as get_filen...
A base class for things that may be directly added into the egg hierarchy.
Definition: eggNode.h:38