00001
00002
00003
00004
00005
00006
00007
00008 #ifndef _BASESHAPE_H
00009 #define _BASESHAPE_H
00010
00011 #include "Template.h"
00012
00013
00017 struct SLIndexedVector2D
00018 {
00019 SI_Float m_fIndex;
00020 CSIBCVector2D m_Vector2D;
00021 };
00022
00023
00027 struct SLIndexedVector3D
00028 {
00029 SI_Float m_fIndex;
00030 CSIBCVector3D m_Vector3D;
00031 };
00032
00033
00037 struct SLIndexedColor
00038 {
00039 SI_Float m_fIndex;
00040 CSIBCColorf m_Color;
00041 };
00042
00043
00120 class XSIEXPORT CSLBaseShape
00121 : public CSLTemplate
00122 {
00123 public:
00127 typedef CSLArrayProxy<CSIBCVector2D, SI_Float, 2> CSLVector2DArray;
00128
00132 typedef CSLArrayProxy<CSIBCVector3D, SI_Float, 3> CSLVector3DArray;
00133
00137 typedef CSLArrayProxy<CSIBCColorf, SI_Float, 4> CSLColorArray;
00138
00142 typedef CSLArrayProxy<SLIndexedVector2D, SI_Float, 3> CSLIndexedVector2DArray;
00143
00147 typedef CSLArrayProxy<SLIndexedVector3D, SI_Float, 4> CSLIndexedVector3DArray;
00148
00152 typedef CSLArrayProxy<SLIndexedColor, SI_Float, 5> CSLIndexedColorArray;
00153
00157 enum EShapeType
00158 {
00159 SI_ORDERED,
00160 SI_INDEXED,
00161 };
00162
00165 virtual ~CSLBaseShape();
00166
00170 CSLVector3DArray* CreateNormals();
00171
00175 CSLIndexedVector3DArray* CreateIndexedNormals();
00176
00180 SI_Int GetNormalCount();
00181
00185 CSLVector3DArray* GetNormalList();
00186
00190 CSIBCVector3D* GetNormalListPtr();
00191
00195 CSLIndexedVector3DArray* GetIndexedNormalList();
00196
00200 SLIndexedVector3D* GetIndexedNormalListPtr();
00201
00205 SI_Error DestroyNormals();
00206
00210 CSLColorArray* CreateColors();
00211
00215 CSLIndexedColorArray* CreateIndexedColors();
00216
00220 SI_Int GetColorCount();
00221
00225 CSLColorArray* GetColorList();
00226
00230 CSIBCColorf* GetColorListPtr();
00231
00235 CSLIndexedColorArray* GetIndexedColorList();
00236
00240 SLIndexedColor* GetIndexedColorListPtr();
00241
00245 SI_Error DestroyColors();
00246
00250 SI_Int GetVertexCount();
00251
00255 CSLVector3DArray* GetVertexList();
00256
00260 CSIBCVector3D* GetVertexListPtr();
00261
00265 CSLIndexedVector3DArray* GetIndexedVertexList();
00266
00270 SLIndexedVector3D* GetIndexedVertexListPtr();
00271
00275 EShapeType ShapeType();
00276
00277 virtual SI_Error Fix();
00278 virtual SI_Error Synchronize();
00279
00280 protected:
00281
00288 CSLBaseShape(CSLScene* in_pScene, CSLModel *in_pModel, CdotXSITemplate* in_pTemplate, EShapeType in_Type);
00289
00290 CSLIntProxy m_NumArrays;
00291 CSLStringProxy m_ArrayType;
00292
00293 CSLVector3DArray* m_pPositions;
00294 CSLVector3DArray* m_pNormals;
00295 CSLColorArray* m_pVertexColors;
00296
00297 CSLIndexedVector3DArray* m_pIndexedPositions;
00298 CSLIndexedVector3DArray* m_pIndexedNormals;
00299 CSLIndexedColorArray* m_pIndexedVertexColors;
00300
00301 CSLIntProxy* m_iNbPositions;
00302 CSLIntProxy* m_iNbNormals;
00303 CSLIntProxy* m_iNbColors;
00304
00305 CSLStringProxy* m_pPositionStringProxy;
00306 CSLStringProxy* m_pNormalStringProxy;
00307 CSLStringProxy* m_pColorStringProxy;
00308
00309 EShapeType m_Type;
00310
00311 void *m_pReserved;
00312 };
00313
00314
00315
00316
00317
00318
00319
00320
00321 #endif
00322