00001 // Filename: eggBinner.h 00002 // Created by: drose (17Feb00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef EGGBINNER_H 00020 #define EGGBINNER_H 00021 00022 #include "pandabase.h" 00023 00024 #include "eggBinMaker.h" 00025 00026 /////////////////////////////////////////////////////////////////// 00027 // Class : EggBinner 00028 // Description : A special binner used only within this package to 00029 // pre-process the egg tree for the loader and group 00030 // things together as appropriate. 00031 // 00032 // Presently, it only groups related LOD children 00033 // together under a single LOD node. 00034 //////////////////////////////////////////////////////////////////// 00035 class EggBinner : public EggBinMaker { 00036 public: 00037 00038 // The BinNumber serves to identify why a particular EggBin was 00039 // created. 00040 enum BinNumber { 00041 BN_none = 0, 00042 BN_lod, 00043 }; 00044 00045 virtual int 00046 get_bin_number(const EggNode *node); 00047 00048 virtual bool 00049 sorts_less(int bin_number, const EggNode *a, const EggNode *b); 00050 00051 virtual bool 00052 collapse_group(const EggGroup *group, int bin_number); 00053 }; 00054 00055 00056 #endif