00001 //*************************************************************************************** 00002 // File supervisor: Crosswalk team 00012 //*************************************************************************************** 00013 00014 #ifndef _CLUSTER_H 00015 #define _CLUSTER_H 00016 00017 #include "Template.h" 00018 #include "XSIClusterInfo.h" 00019 00020 #ifndef _SL_INT_ARRAY_PROXY_EXPORT_ 00021 #define _SL_INT_ARRAY_PROXY_EXPORT_ 00022 00023 //XSITEMPLATEEXP template class XSIEXPORT CSLArrayProxy<SI_Int, SI_Int, 1>; 00024 00025 #endif // _SL_INT_ARRAY_PROXY_EXPORT_ 00026 00027 // Forward declaration 00028 class CSLWeightingType; 00029 class CLSModel; 00030 class CSLBaseShape; 00031 class CSLUserDataList; 00032 00033 00039 class XSIEXPORT CSLCluster 00040 : public CSLTemplate 00041 { 00042 public: 00045 typedef CSLArrayProxy<SI_Int, SI_Int, 1> CSLIntArray; 00046 00049 enum EClusterWeightingType 00050 { 00051 SI_AVERAGE, 00052 SI_ADDITIVE, 00053 }; 00054 00058 virtual SI_Error Synchronize(); 00059 00063 virtual ETemplateType Type() { return SI_CLUSTER; } 00064 00071 CSLCluster(CSLScene* in_pScene, CSLModel *in_pModel, CdotXSITemplate* in_pTemplate); 00072 00075 virtual ~CSLCluster(); 00076 00080 CSLModel* GetReference(); 00081 00085 CSLModel* GetCenter(); 00086 00090 SI_Void SetCenter(CSLModel* in_pNewCenter); 00091 00095 CSLBaseShape* CreateShape(); 00096 00100 CSLBaseShape* Shape(); 00101 00105 SI_Error DestroyShape(); 00106 00110 SI_Int GetVertexIndicesCount(); 00111 00115 CSLIntArray* GetVertexIndicesList(); 00116 00120 SI_Int* GetVertexIndicesListPtr(); 00121 00125 EClusterWeightingType GetWeightingType(); 00126 00130 SI_Void SetWeightingType(EClusterWeightingType in_Type); 00131 00132 // Connection functions. 00137 CSLBaseShape* ConnectShape(CSLBaseShape* in_pNewShape); 00138 00140 // UserDataList Functionality ///////////////////////////////////////////// 00142 00146 CSLUserDataList* AddUserDataList(); 00147 00152 SI_Error RemoveUserDataList( SI_Int in_nIndex ); 00153 00158 SI_Error RemoveUserDataList( CSLUserDataList* in_pToRemove ); 00159 00163 SI_Error ClearUserDataLists(); 00164 00169 CSLUserDataList* ConnectUserDataList( CSLUserDataList* in_pToConnect ); 00170 00174 CSLUserDataList** GetUserDataLists(); 00175 00179 SI_Int GetUserDataListCount(); 00180 00185 CSLUserDataList* FindUserDataList( SI_Char* in_szUserDataListName ); 00186 00187 CSLXSIClusterInfo* GetClusterInfo(); 00188 00189 CSLXSIClusterInfo* ConnectClusterInfo(CSLXSIClusterInfo* in_pClusterInfo); 00190 00191 virtual SI_Error Fix(); 00192 00193 private: 00194 CSLStrEnumProxy<EClusterWeightingType, SI_ADDITIVE> m_WeightingType; 00195 00196 /* 00197 We might activate this once the cluster type are set to strings. It is also possible 00198 that we will need to add a separate implementation of the whole class in 3.6. If we do 00199 use the line below, the constructor will have to be updated as well. 00200 00201 CSLStrEnumProxy<EClusterType, SI_SUB_CURVE> m_ClusterType; 00202 */ 00203 00204 CSLModel* m_pClusterCenter; 00205 CSLBaseShape* m_pShape; 00206 CSLIntArray m_VertexIndices; 00207 CSIBCArray<CSLUserDataList*> m_UserDataLists; 00208 00209 void *m_pReserved; // reserved for future extension 00210 }; 00211 00212 #endif