Panda3D
eggGroupUniquifier.h
1 // Filename: eggGroupUniquifier.h
2 // Created by: drose (22Feb01)
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 EGGGROUPUNIQUIFIER_H
16 #define EGGGROUPUNIQUIFIER_H
17 
18 #include "pandabase.h"
19 
20 #include "eggNameUniquifier.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : EggGroupUniquifier
24 // Description : This is a specialization of EggNameUniquifier to
25 // generate unique names for EggGroup nodes. It's not
26 // called automatically; you must invoke it yourself if
27 // you want it.
28 ////////////////////////////////////////////////////////////////////
29 class EXPCL_PANDAEGG EggGroupUniquifier : public EggNameUniquifier {
30 PUBLISHED:
31  EggGroupUniquifier(bool filter_names = true);
32 
33  virtual string get_category(EggNode *node);
34  virtual string filter_name(EggNode *node);
35  virtual string generate_name(EggNode *node,
36  const string &category, int index);
37 
38 private:
39  bool _filter_names;
40 
41 public:
42  static TypeHandle get_class_type() {
43  return _type_handle;
44  }
45  static void init_type() {
46  EggNameUniquifier::init_type();
47  register_type(_type_handle, "EggGroupUniquifier",
48  EggNameUniquifier::get_class_type());
49  }
50  virtual TypeHandle get_type() const {
51  return get_class_type();
52  }
53  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
54 
55 private:
56  static TypeHandle _type_handle;
57 
58 };
59 
60 #endif
61 
62 
This is a specialization of EggNameUniquifier to generate unique names for EggGroup nodes...
This is a handy class for guaranteeing unique node names in an egg hierarchy.
virtual string filter_name(EggNode *node)
Returns the name of the given node, or at least the name it should be.
virtual string generate_name(EggNode *node, const string &category, int index)
Generates a new name for the given node when its existing name clashes with some other node...
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