00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100 #ifndef VRS_OPENGL_VERTEXATTRIBUTESHAPEGL_H
00101 #define VRS_OPENGL_VERTEXATTRIBUTESHAPEGL_H
00102
00103 #include <vrs/shape.h>
00104 #include <vrs/opengl/vertexattributebufferobjectgl.h>
00105
00106 namespace VRS {
00107
00108 class EngineGL;
00109 class VertexAttributeDataGL;
00110 class VertexAttributeIndexGL;
00111 class VertexAttributeShapeSimplifierGL;
00112
00113 class VRS_CORE_API VertexAttributeShapeGL :
00114 public Shape
00115 {
00117 public:
00118 VRS_TYPEINFO(VertexAttributeShapeGL, Shape);
00119
00120 enum Type {
00121 VERTEX, NORMAL, COLOR, SECONDARY_COLOR,
00122 FOG_COORD, EDGE_FLAG, VERTEX_WEIGHT,
00123 TEX_COORD_0, TEX_COORD_1, TEX_COORD_2, TEX_COORD_3,
00124 TEX_COORD_4, TEX_COORD_5, TEX_COORD_6, TEX_COORD_7,
00125 TEX_COORD_8, TEX_COORD_9, TEX_COORD_10, TEX_COORD_11,
00126 TEX_COORD_12, TEX_COORD_13, TEX_COORD_14, TEX_COORD_15,
00127 INDEX, RANGE, PRIMITIVE,
00128 NOT_USED
00129 };
00130 VRS_SERIALIZABLE_CLASS_ENUM(Type);
00132
00133 VertexAttributeShapeGL(
00134 GLenum primitiveType,
00135 const Bounds& bbox = Bounds(),
00136 Type type1 = NOT_USED, SO<BaseVertexAttributeBufferObjectGL> object1 = NULL,
00137 Type type2 = NOT_USED, SO<BaseVertexAttributeBufferObjectGL> object2 = NULL,
00138 Type type3 = NOT_USED, SO<BaseVertexAttributeBufferObjectGL> object3 = NULL,
00139 Type type4 = NOT_USED, SO<BaseVertexAttributeBufferObjectGL> object4 = NULL,
00140 Type type5 = NOT_USED, SO<BaseVertexAttributeBufferObjectGL> object5 = NULL,
00141 Type type6 = NOT_USED, SO<BaseVertexAttributeBufferObjectGL> object6 = NULL,
00142 Type type7 = NOT_USED, SO<BaseVertexAttributeBufferObjectGL> object7 = NULL,
00143 Type type8 = NOT_USED, SO<BaseVertexAttributeBufferObjectGL> object8 = NULL,
00144 Type type9 = NOT_USED, SO<BaseVertexAttributeBufferObjectGL> object9 = NULL,
00145 Type type10 = NOT_USED, SO<BaseVertexAttributeBufferObjectGL> object10 = NULL,
00146 Type type11 = NOT_USED, SO<BaseVertexAttributeBufferObjectGL> object11 = NULL,
00147 Type type12 = NOT_USED, SO<BaseVertexAttributeBufferObjectGL> object12 = NULL
00148 );
00150
00151 VertexAttributeShapeGL(
00152 const Bounds& bbox = Bounds(),
00153 Type type1 = NOT_USED, SO<BaseVertexAttributeBufferObjectGL> object1 = NULL,
00154 Type type2 = NOT_USED, SO<BaseVertexAttributeBufferObjectGL> object2 = NULL,
00155 Type type3 = NOT_USED, SO<BaseVertexAttributeBufferObjectGL> object3 = NULL,
00156 Type type4 = NOT_USED, SO<BaseVertexAttributeBufferObjectGL> object4 = NULL,
00157 Type type5 = NOT_USED, SO<BaseVertexAttributeBufferObjectGL> object5 = NULL,
00158 Type type6 = NOT_USED, SO<BaseVertexAttributeBufferObjectGL> object6 = NULL,
00159 Type type7 = NOT_USED, SO<BaseVertexAttributeBufferObjectGL> object7 = NULL,
00160 Type type8 = NOT_USED, SO<BaseVertexAttributeBufferObjectGL> object8 = NULL,
00161 Type type9 = NOT_USED, SO<BaseVertexAttributeBufferObjectGL> object9 = NULL,
00162 Type type10 = NOT_USED, SO<BaseVertexAttributeBufferObjectGL> object10 = NULL,
00163 Type type11 = NOT_USED, SO<BaseVertexAttributeBufferObjectGL> object11 = NULL,
00164 Type type12 = NOT_USED, SO<BaseVertexAttributeBufferObjectGL> object12 = NULL
00165 );
00167
00168 SO<BaseVertexAttributeBufferObjectGL> getBufferObject(Type type) const;
00173 void setBufferObject(Type type, SO<BaseVertexAttributeBufferObjectGL> object);
00177 GLenum getPrimitiveType() const;
00183 void setPrimitiveType(GLenum primitiveType);
00185
00186 void clear();
00188
00191 void setBoundingBox(const Bounds& bbox);
00193 virtual Bounds boundingBox() const;
00195
00196 unsigned int usedMemory() const;
00200
00201
00202
00203 virtual SO<Iterator<Matrix> > getInstanceTransformationIterator() const;
00207 virtual void setInstanceTransformationIterator(SO<Iterator<Matrix> > instanceTransforms);
00208
00209 private:
00210 friend class VertexAttributeShapeSimplifierGL;
00211
00212 SO<VertexAttributeDataGL> m_dataObject;
00213 SO<VertexAttributeIndexGL> m_indexObject;
00214 };
00215
00216 }
00217
00218 #endif // VRS_OPENGL_VERTEXATTRIBUTESHAPEGL_H