Panda3D
eggBinner.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file eggBinner.h
10  * @author drose
11  * @date 2000-02-17
12  */
13 
14 #ifndef EGGBINNER_H
15 #define EGGBINNER_H
16 
17 #include "pandabase.h"
18 
19 #include "eggBinMaker.h"
20 
21 class EggLoader;
22 
23 /**
24  * A special binner used only within this package to pre-process the egg tree
25  * for the loader and group things together as appropriate.
26  *
27  * It is used to collect similar polygons together for a Geom, as well as to
28  * group related LOD children together under a single LOD node.
29  */
30 class EXPCL_PANDA_EGG2PG EggBinner : public EggBinMaker {
31 public:
32  // The BinNumber serves to identify why a particular EggBin was created.
33  enum BinNumber {
34  BN_none = 0,
35  BN_polyset,
36  BN_lod,
37  BN_nurbs_surface,
38  BN_nurbs_curve,
39  BN_patches,
40  };
41 
42  EggBinner(EggLoader &loader);
43 
44  virtual void
45  prepare_node(EggNode *node);
46 
47  virtual int
48  get_bin_number(const EggNode *node);
49 
50  virtual std::string
51  get_bin_name(int bin_number, const EggNode *child);
52 
53  virtual bool
54  sorts_less(int bin_number, const EggNode *a, const EggNode *b);
55 
56  EggLoader &_loader;
57 };
58 
59 
60 #endif
virtual void prepare_node(EggNode *node)
May be overridden in derived classes to perform some setup work as each node is encountered.
Definition: eggBinMaker.cxx:87
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual bool sorts_less(int bin_number, const EggNode *a, const EggNode *b)
May be overridden in derived classes to create additional bins within a particular bin number,...
Definition: eggBinMaker.cxx:98
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is a handy class for collecting related nodes together.
Definition: eggBinMaker.h:161
A special binner used only within this package to pre-process the egg tree for the loader and group t...
Definition: eggBinner.h:30
virtual std::string get_bin_name(int bin_number, const EggNode *child)
May be overridden in derived classes to define a name for each new bin, based on its bin number,...
A base class for things that may be directly added into the egg hierarchy.
Definition: eggNode.h:35
Converts an egg data structure, possibly read from an egg file but not necessarily,...
Definition: eggLoader.h:67