00001
00002
00012
00013
00014 #ifndef _BASESHAPE_H
00015 #define _BASESHAPE_H
00016
00017 #include "Template.h"
00018
00019
00022 struct SLIndexedVector2D
00023 {
00024 SI_Float m_fIndex;
00025 CSIBCVector2D m_Vector2D;
00026 };
00027
00028
00031 struct SLIndexedVector3D
00032 {
00033 SI_Float m_fIndex;
00034 CSIBCVector3D m_Vector3D;
00035 };
00036
00037
00040 struct SLIndexedColor
00041 {
00042 SI_Float m_fIndex;
00043 CSIBCColorf m_Color;
00044 };
00045
00046
00117 class XSIEXPORT CSLBaseShape
00118 : public CSLTemplate
00119 {
00120 public:
00123 typedef CSLArrayProxy<CSIBCVector2D, SI_Float, 2> CSLVector2DArray;
00124
00127 typedef CSLArrayProxy<CSIBCVector3D, SI_Float, 3> CSLVector3DArray;
00128
00131 typedef CSLArrayProxy<CSIBCColorf, SI_Float, 4> CSLColorArray;
00132
00135 typedef CSLArrayProxy<SLIndexedVector2D, SI_Float, 3> CSLIndexedVector2DArray;
00136
00139 typedef CSLArrayProxy<SLIndexedVector3D, SI_Float, 4> CSLIndexedVector3DArray;
00140
00143 typedef CSLArrayProxy<SLIndexedColor, SI_Float, 5> CSLIndexedColorArray;
00144
00147 enum EShapeType
00148 {
00149 SI_ORDERED,
00150 SI_INDEXED,
00151 };
00152
00155 virtual ~CSLBaseShape();
00156
00160 CSLVector3DArray* CreateNormals();
00161
00165 CSLIndexedVector3DArray* CreateIndexedNormals();
00166
00170 SI_Int GetNormalCount();
00171
00175 CSLVector3DArray* GetNormalList();
00176
00180 CSIBCVector3D* GetNormalListPtr();
00181
00185 CSLIndexedVector3DArray* GetIndexedNormalList();
00186
00190 SLIndexedVector3D* GetIndexedNormalListPtr();
00191
00195 SI_Error DestroyNormals();
00196
00200 CSLColorArray* CreateColors();
00201
00205 CSLIndexedColorArray* CreateIndexedColors();
00206
00210 SI_Int GetColorCount();
00211
00215 CSLColorArray* GetColorList();
00216
00220 CSIBCColorf* GetColorListPtr();
00221
00225 CSLIndexedColorArray* GetIndexedColorList();
00226
00230 SLIndexedColor* GetIndexedColorListPtr();
00231
00235 SI_Error DestroyColors();
00236
00240 SI_Int GetVertexCount();
00241
00245 CSLVector3DArray* GetVertexList();
00246
00250 CSIBCVector3D* GetVertexListPtr();
00251
00255 CSLIndexedVector3DArray* GetIndexedVertexList();
00256
00260 SLIndexedVector3D* GetIndexedVertexListPtr();
00261
00265 EShapeType ShapeType();
00266
00267 virtual SI_Error Fix();
00268 virtual SI_Error Synchronize();
00269
00270 protected:
00271
00278 CSLBaseShape(CSLScene* in_pScene, CSLModel *in_pModel, CdotXSITemplate* in_pTemplate, EShapeType in_Type);
00279
00280 CSLIntProxy m_NumArrays;
00281 CSLStringProxy m_ArrayType;
00282
00283 CSLVector3DArray* m_pPositions;
00284 CSLVector3DArray* m_pNormals;
00285 CSLColorArray* m_pVertexColors;
00286
00287 CSLIndexedVector3DArray* m_pIndexedPositions;
00288 CSLIndexedVector3DArray* m_pIndexedNormals;
00289 CSLIndexedColorArray* m_pIndexedVertexColors;
00290
00291 CSLIntProxy* m_iNbPositions;
00292 CSLIntProxy* m_iNbNormals;
00293 CSLIntProxy* m_iNbColors;
00294
00295 CSLStringProxy* m_pPositionStringProxy;
00296 CSLStringProxy* m_pNormalStringProxy;
00297 CSLStringProxy* m_pColorStringProxy;
00298
00299 EShapeType m_Type;
00300
00301 void *m_pReserved;
00302 };
00303
00304
00305
00306
00307
00308
00309
00310
00311 #endif
00312