Panda3D
 All Classes Functions Variables Enumerations
eggFilenameNode.h
1 // Filename: eggFilenameNode.h
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 #ifndef EGGFILENAMENODE_H
16 #define EGGFILENAMENODE_H
17 
18 #include "pandabase.h"
19 
20 #include "eggNode.h"
21 #include "filename.h"
22 
23 ////////////////////////////////////////////////////////////////////
24 // Class : EggFilenameNode
25 // Description : This is an egg node that contains a filename. It
26 // references a physical file relative to the directory
27 // the egg file was loaded in. It is a base class for
28 // EggTexture and EggExternalReference.
29 ////////////////////////////////////////////////////////////////////
30 class EXPCL_PANDAEGG EggFilenameNode : public EggNode {
31 PUBLISHED:
32  INLINE EggFilenameNode();
33  INLINE EggFilenameNode(const string &node_name, const Filename &filename);
34  INLINE EggFilenameNode(const EggFilenameNode &copy);
35  INLINE EggFilenameNode &operator = (const EggFilenameNode &copy);
36 
37  virtual string get_default_extension() const;
38 
39  INLINE const Filename &get_filename() const;
40  INLINE void set_filename(const Filename &filename);
41 
42  INLINE const Filename &get_fullpath() const;
43  INLINE void set_fullpath(const Filename &fullpath);
44 
45 public:
47  public:
48  bool operator () (const EggFilenameNode *a, const EggFilenameNode *b) const {
49  return a->get_filename().get_basename() < b->get_filename().get_basename();
50  }
51  };
52 
53 protected:
54  Filename _filename;
55  Filename _fullpath;
56 
57 public:
58  static TypeHandle get_class_type() {
59  return _type_handle;
60  }
61  static void init_type() {
62  EggNode::init_type();
63  register_type(_type_handle, "EggFilenameNode",
64  EggNode::get_class_type());
65  }
66  virtual TypeHandle get_type() const {
67  return get_class_type();
68  }
69  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
70 
71 private:
72  static TypeHandle _type_handle;
73 };
74 
75 #include "eggFilenameNode.I"
76 
77 #endif
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_filename() const
Returns a nonmodifiable reference to the filename.
string get_basename() const
Returns the basename part of the filename.
Definition: filename.I:436
A base class for things that may be directly added into the egg hierarchy.
Definition: eggNode.h:38
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85