00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __GEO_AttribDict_h__
00021 #define __GEO_AttribDict_h__
00022
00023 #include "GEO_API.h"
00024 #include <GB/GB_Attribute.h>
00025
00026 class GEO_Point;
00027 class GEO_PointList;
00028 class GEO_PrimList;
00029 class GEO_Primitive;
00030 class GEO_Vertex;
00031
00032 class GEO_VertexAttribDict;
00033
00034
00035 class GEO_API GEO_PointAttribDict : public GB_AttributeDict {
00036 public:
00037 GEO_PointAttribDict(GEO_PointList &pointList);
00038 virtual ~GEO_PointAttribDict();
00039
00040 virtual void sortAs(const GB_AttributeDict &table);
00041
00042
00043
00044
00045
00046
00047 int append(const char *n, int s, GB_AttribType type,
00048 const void *defValue);
00049 int append(const char *n, int s,
00050 GB_AttribType type,
00051 GB_AttribTypeInfo type_info,
00052 const void *defValue);
00053 int appendClone(const GB_Attribute *src);
00054
00055 void destroy(const char *name, int size,GB_AttribType type);
00056
00057 void destroy(const char *name, GB_AttribType type);
00058 int grow(const char *n, int oldsize, GB_AttribType type,
00059 unsigned int addedsize);
00060
00061
00062 void fillPoint(GEO_Point &pt) const;
00063 void setVertexDict(GEO_VertexAttribDict *vd)
00064 {
00065 vtxDict = vd;
00066 }
00067
00068
00069
00070 void destroyIndex(const char *name, const char *label);
00071
00072 void cleanIndex(const char *name);
00073
00074 void collapseIndex();
00075
00076 void resetIndex();
00077
00078 private:
00079 void resizeAttribData(int new_size);
00080 template<typename T> friend void
00081 geoCopyAttribDict(T *me, const GB_AttributeDict &src);
00082
00083 private:
00084 GEO_PointList &ptList;
00085 GEO_VertexAttribDict *vtxDict;
00086 };
00087
00088
00089 class GEO_API GEO_VertexAttribDict : public GB_AttributeDict {
00090 public:
00091 GEO_VertexAttribDict(GEO_PrimList &primList);
00092 virtual ~GEO_VertexAttribDict();
00093
00094 virtual void sortAs(const GB_AttributeDict &table);
00095 int append(const char *n, int s, GB_AttribType type,
00096 const void *defValue);
00097 int append(const char *n, int s, GB_AttribType type,
00098 GB_AttribTypeInfo type_info,
00099 const void *defValue);
00100 int appendClone(const GB_Attribute *src);
00101 void destroy(const char *name, int size,GB_AttribType type);
00102
00103 void destroy(const char *name, GB_AttribType type);
00104 int grow(const char *n, int oldsize, GB_AttribType type,
00105 unsigned int addedsize);
00106
00107
00108 void promoteAttrib(const char *n, int s, GB_AttribType type);
00109
00110
00111 void demoteAttrib(const char *n, int s, GB_AttribType type);
00112 void fillVertex(GEO_Vertex &vtx) const;
00113 void setPointDict(GEO_PointAttribDict *pd) { ptDict = pd; }
00114
00115
00116
00117 void destroyIndex(const char *name, const char *label);
00118
00119 void cleanIndex(const char *name);
00120
00121 void collapseIndex();
00122
00123 void resetIndex();
00124
00125 private:
00126 void resizeAttribData(int new_size);
00127 template<typename T> friend void
00128 geoCopyAttribDict(T *me, const GB_AttributeDict &src);
00129
00130 private:
00131 GEO_PrimList &prList;
00132 GEO_PointAttribDict *ptDict;
00133 };
00134
00135
00136 class GEO_API GEO_PrimAttribDict : public GB_AttributeDict {
00137 public:
00138 GEO_PrimAttribDict(GEO_PrimList &primList);
00139 virtual ~GEO_PrimAttribDict();
00140
00141 virtual void sortAs(const GB_AttributeDict &table);
00142 int append(const char *n, int s, GB_AttribType type,
00143 const void *defValue);
00144 int append(const char *n, int s, GB_AttribType type,
00145 GB_AttribTypeInfo type_info,
00146 const void *defValue);
00147 int appendClone(const GB_Attribute *src);
00148 void destroy(const char *name, int size,GB_AttribType type);
00149
00150 void destroy(const char *name, GB_AttribType type);
00151 int grow(const char *n, int oldsize, GB_AttribType type,
00152 unsigned int addedsize);
00153
00154
00155 void fillPrimitive(GEO_Primitive &pr) const;
00156
00157
00158 void destroyIndex(const char *name, const char *label);
00159
00160 void cleanIndex(const char *name);
00161
00162 void collapseIndex();
00163
00164 void resetIndex();
00165
00166 private:
00167 void resizeAttribData(int new_size);
00168 template<typename T> friend void
00169 geoCopyAttribDict(T *me, const GB_AttributeDict &src);
00170
00171 private:
00172 GEO_PrimList &prList;
00173 };
00174
00175 #endif
00176