Panda3D
|
00001 // Filename: cullBinUnsorted.h 00002 // Created by: drose (28Feb02) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef CULLBINUNSORTED_H 00016 #define CULLBINUNSORTED_H 00017 00018 #include "pandabase.h" 00019 00020 #include "cullBin.h" 00021 #include "pointerTo.h" 00022 00023 //////////////////////////////////////////////////////////////////// 00024 // Class : CullBinUnsorted 00025 // Description : A specific kind of CullBin that does not reorder the 00026 // geometry; it simply passes it through to the GSG in 00027 // the same order it was encountered, which will be in 00028 // scene-graph order. 00029 //////////////////////////////////////////////////////////////////// 00030 class EXPCL_PANDA_CULL CullBinUnsorted : public CullBin { 00031 public: 00032 INLINE CullBinUnsorted(const string &name, 00033 GraphicsStateGuardianBase *gsg, 00034 const PStatCollector &draw_region_pcollector); 00035 ~CullBinUnsorted(); 00036 00037 static CullBin *make_bin(const string &name, 00038 GraphicsStateGuardianBase *gsg, 00039 const PStatCollector &draw_region_pcollector); 00040 00041 virtual void add_object(CullableObject *object, Thread *current_thread); 00042 virtual void draw(bool force, Thread *current_thread); 00043 00044 protected: 00045 virtual void fill_result_graph(ResultGraphBuilder &builder); 00046 00047 private: 00048 typedef pvector<CullableObject *> Objects; 00049 Objects _objects; 00050 00051 public: 00052 static TypeHandle get_class_type() { 00053 return _type_handle; 00054 } 00055 static void init_type() { 00056 CullBin::init_type(); 00057 register_type(_type_handle, "CullBinUnsorted", 00058 CullBin::get_class_type()); 00059 } 00060 virtual TypeHandle get_type() const { 00061 return get_class_type(); 00062 } 00063 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00064 00065 private: 00066 static TypeHandle _type_handle; 00067 }; 00068 00069 #include "cullBinUnsorted.I" 00070 00071 #endif 00072 00073 00074