00001 // Filename: builderBucketNode.h 00002 // Created by: drose (10Sep97) 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 BUILDERBUCKETNODE_H 00020 #define BUILDERBUCKETNODE_H 00021 00022 #include <pandabase.h> 00023 00024 #include "builderPrim.h" 00025 #include "builderBucket.h" 00026 00027 #include "pset.h" 00028 00029 class GeomNode; 00030 class GeomNode; 00031 00032 00033 /////////////////////////////////////////////////////////////////// 00034 // Class : BuilderBucketNode 00035 // Description : This is a wrapper class around BuilderBucket, used by 00036 // the Builder class. It stores a pointer to a 00037 // BuilderBucket object, as well as lists of the 00038 // primitives that have been added to it. 00039 // 00040 // There are no functions in this class that are 00041 // intended to be called directly by user code; instead, 00042 // use the interface provided by Builder. 00043 //////////////////////////////////////////////////////////////////// 00044 class EXPCL_PANDAEGG BuilderBucketNode { 00045 public: 00046 INLINE BuilderBucketNode(BuilderBucket *bucket); 00047 INLINE BuilderBucketNode(const BuilderBucketNode ©); 00048 INLINE void operator = (const BuilderBucketNode ©); 00049 00050 bool add_prim(BuilderPrim prim); 00051 bool add_prim(const BuilderPrimI &prim); 00052 INLINE bool add_prim_nonindexed(const BuilderPrimI &prim); 00053 00054 INLINE BuilderBucket *get_bucket() const; 00055 00056 INLINE bool operator < (const BuilderBucketNode &other) const; 00057 INLINE bool operator == (const BuilderBucketNode &other) const; 00058 INLINE bool operator != (const BuilderBucketNode &other) const; 00059 00060 int build(GeomNode *geom_node) const; 00061 00062 protected: 00063 typedef pmultiset<BuilderPrim, less<BuilderPrim> > Prims; 00064 typedef pmultiset<BuilderPrimI, less<BuilderPrimI> > IPrims; 00065 00066 BuilderBucket *_bucket; 00067 Prims _prims; 00068 IPrims _iprims; 00069 }; 00070 00071 #include "builderBucketNode.I" 00072 00073 #endif