00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef BUILDERBUCKET_H
00020 #define BUILDERBUCKET_H
00021
00022 #include "pandabase.h"
00023
00024 #include "builderProperties.h"
00025
00026 #include "namable.h"
00027 #include "pointerToArray.h"
00028 #include "luse.h"
00029 #include "pta_Vertexf.h"
00030 #include "pta_Normalf.h"
00031 #include "pta_Colorf.h"
00032 #include "pta_TexCoordf.h"
00033 #include "renderState.h"
00034
00035 #include "stdlib.h"
00036
00037 class Geom;
00038 class PandaNode;
00039 class GeomNode;
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 class EXPCL_PANDAEGG BuilderBucket : public BuilderProperties, public Namable {
00060 public:
00061 BuilderBucket();
00062 BuilderBucket(const BuilderBucket ©);
00063 BuilderBucket &operator = (const BuilderBucket ©);
00064 virtual ~BuilderBucket();
00065
00066 virtual BuilderBucket *make_copy() const;
00067 virtual GeomNode *make_geom_node();
00068 virtual Geom *done_geom(Geom *geom);
00069 void add_attrib(const RenderAttrib *attrib);
00070
00071 virtual bool operator < (const BuilderBucket &other) const;
00072
00073 INLINE void set_coords(const PTA_Vertexf &coords);
00074 INLINE PTA_Vertexf get_coords() const;
00075
00076 INLINE void set_normals(const PTA_Normalf &normals);
00077 INLINE PTA_Normalf get_normals() const;
00078
00079 INLINE void set_texcoords(const PTA_TexCoordf &texcoords);
00080 INLINE PTA_TexCoordf get_texcoords() const;
00081
00082 INLINE void set_colors(const PTA_Colorf &colors);
00083 INLINE PTA_Colorf get_colors() const;
00084
00085 INLINE static BuilderBucket *get_default_bucket();
00086
00087 virtual void output(ostream &out) const;
00088
00089 PandaNode *_node;
00090
00091 short _drawBin;
00092 unsigned int _drawOrder;
00093
00094 CPT(RenderState) _state;
00095
00096 protected:
00097 PTA_Vertexf _coords;
00098 PTA_Normalf _normals;
00099 PTA_TexCoordf _texcoords;
00100 PTA_Colorf _colors;
00101
00102 static BuilderBucket *_default_bucket;
00103
00104 private:
00105 BuilderBucket(int);
00106 };
00107
00108 INLINE ostream &operator << (ostream &out, const BuilderBucket &bucket) {
00109 bucket.output(out);
00110 return out;
00111 }
00112
00113 #include "builderBucket.I"
00114
00115 #endif
00116