Panda3D
 All Classes Functions Variables Enumerations
eggPoolUniquifier.cxx
1 // Filename: eggPoolUniquifier.cxx
2 // Created by: drose (09Nov00)
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 #include "eggPoolUniquifier.h"
16 #include "eggNode.h"
17 #include "eggTexture.h"
18 #include "eggMaterial.h"
19 #include "eggVertexPool.h"
20 
21 #include "pnotify.h"
22 
23 TypeHandle EggPoolUniquifier::_type_handle;
24 
25 
26 ////////////////////////////////////////////////////////////////////
27 // Function: EggPoolUniquifier::Constructor
28 // Access: Public
29 // Description:
30 ////////////////////////////////////////////////////////////////////
31 EggPoolUniquifier::
32 EggPoolUniquifier() {
33 }
34 
35 ////////////////////////////////////////////////////////////////////
36 // Function: EggPoolUniquifier::get_category
37 // Access: Public
38 // Description: Returns the category name into which the given node
39 // should be collected, or the empty string if the
40 // node's name should be left alone.
41 ////////////////////////////////////////////////////////////////////
44  if (node->is_of_type(EggTexture::get_class_type())) {
45  return "tex";
46  } else if (node->is_of_type(EggMaterial::get_class_type())) {
47  return "mat";
48  } else if (node->is_of_type(EggVertexPool::get_class_type())) {
49  return "vpool";
50  }
51 
52  return string();
53 }
bool is_of_type(TypeHandle handle) const
Returns true if the current object is or derives from the indicated type.
Definition: typedObject.I:63
virtual string get_category(EggNode *node)
Returns the category name into which the given node should be collected, or the empty string if the n...
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