Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/egg/eggPolysetMaker.h

Go to the documentation of this file.
00001 // Filename: eggPolysetMaker.h
00002 // Created by:  drose (19Jun01)
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 EGGPOLYSETMAKER_H
00020 #define EGGPOLYSETMAKER_H
00021 
00022 #include "pandabase.h"
00023 
00024 #include "eggBinMaker.h"
00025 
00026 #include "dcast.h"
00027 
00028 ///////////////////////////////////////////////////////////////////
00029 //       Class : EggPolysetMaker
00030 // Description : A specialization on EggBinMaker for making polysets
00031 //               that share the same basic rendering characteristic.
00032 //               This really just defines the example functions
00033 //               described in the leading comment to EggBinMaker.
00034 //
00035 //               It makes some common assumptions about how polysets
00036 //               should be grouped; if these are not sufficient, you
00037 //               can always rederive your own further specialization
00038 //               of this class.
00039 ////////////////////////////////////////////////////////////////////
00040 class EXPCL_PANDAEGG EggPolysetMaker : public EggBinMaker {
00041 public:
00042   // The BinNumber serves to identify why a particular EggBin was
00043   // created.
00044   enum BinNumber {
00045     BN_none = 0,
00046     BN_polyset,
00047   };
00048 
00049   enum Properties {
00050     P_has_texture        = 0x001,
00051     P_texture            = 0x002,
00052     P_has_material       = 0x004,
00053     P_material           = 0x008,
00054     P_has_poly_color     = 0x010,
00055     P_poly_color         = 0x020,
00056     P_has_poly_normal    = 0x040,
00057     P_has_vertex_normal  = 0x080,
00058     P_has_vertex_color   = 0x100,
00059     P_bface              = 0x200,
00060   };
00061 
00062   EggPolysetMaker();
00063   void set_properties(int properties);
00064 
00065 public:
00066   virtual int
00067   get_bin_number(const EggNode *node);
00068 
00069   virtual bool
00070   sorts_less(int bin_number, const EggNode *a, const EggNode *b);
00071 
00072 private:
00073   int _properties;
00074 };
00075 
00076 
00077 #endif

Generated on Fri May 2 00:37:51 2003 for Panda by doxygen1.3