00001 //*************************************************************************************** 00002 // 00003 // File supervisor: Crosswalk team 00004 // 00005 // Copyright 2008 Autodesk, Inc. All rights reserved. 00006 // Use of this software is subject to the terms of the Autodesk license agreement 00007 // provided at the time of installation or download, or which otherwise accompanies 00008 // this software in either electronic or hard copy form. 00009 // 00010 //*************************************************************************************** 00011 00012 #ifndef _CLUSTER_H 00013 #define _CLUSTER_H 00014 00015 #include "Template.h" 00016 #include "XSIClusterInfo.h" 00017 00018 #ifndef _SL_INT_ARRAY_PROXY_EXPORT_ 00019 #define _SL_INT_ARRAY_PROXY_EXPORT_ 00020 00021 //XSITEMPLATEEXP template class XSIEXPORT CSLArrayProxy<SI_Int, SI_Int, 1>; 00022 00023 #endif // _SL_INT_ARRAY_PROXY_EXPORT_ 00024 00025 // Forward declaration 00026 class CSLWeightingType; 00027 class CLSModel; 00028 class CSLBaseShape; 00029 class CSLUserDataList; 00030 00031 00035 class XSIEXPORT CSLCluster 00036 : public CSLTemplate 00037 { 00038 public: 00042 typedef CSLArrayProxy<SI_Int, SI_Int, 1> CSLIntArray; 00043 00047 enum EClusterWeightingType 00048 { 00049 SI_AVERAGE, 00050 SI_ADDITIVE, 00051 }; 00052 00057 virtual SI_Error Synchronize(); 00058 00062 virtual ETemplateType Type() { return SI_CLUSTER; } 00063 00070 CSLCluster(CSLScene* in_pScene, CSLModel *in_pModel, CdotXSITemplate* in_pTemplate); 00071 00074 virtual ~CSLCluster(); 00075 00079 CSLModel* GetReference(); 00080 00084 CSLModel* GetCenter(); 00085 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 00131 SI_Void SetWeightingType(EClusterWeightingType in_Type); 00132 00133 // Connection functions. 00138 CSLBaseShape* ConnectShape(CSLBaseShape* in_pNewShape); 00139 00141 // UserDataList Functionality ///////////////////////////////////////////// 00143 00147 CSLUserDataList* AddUserDataList(); 00148 00153 SI_Error RemoveUserDataList( SI_Int in_nIndex ); 00154 00159 SI_Error RemoveUserDataList( CSLUserDataList* in_pToRemove ); 00160 00164 SI_Error ClearUserDataLists(); 00165 00170 CSLUserDataList* ConnectUserDataList( CSLUserDataList* in_pToConnect ); 00171 00175 CSLUserDataList** GetUserDataLists(); 00176 00180 SI_Int GetUserDataListCount(); 00181 00186 CSLUserDataList* FindUserDataList( SI_Char* in_szUserDataListName ); 00187 00188 CSLXSIClusterInfo* GetClusterInfo(); 00189 00190 CSLXSIClusterInfo* ConnectClusterInfo(CSLXSIClusterInfo* in_pClusterInfo); 00191 00192 virtual SI_Error Fix(); 00193 00194 private: 00195 CSLStrEnumProxy<EClusterWeightingType, SI_ADDITIVE> m_WeightingType; 00196 00197 /* 00198 We might activate this once the cluster type are set to strings. It is also possible 00199 that we will need to add a separate implementation of the whole class in 3.6. If we do 00200 use the line below, the constructor will have to be updated as well. 00201 00202 CSLStrEnumProxy<EClusterType, SI_SUB_CURVE> m_ClusterType; 00203 */ 00204 00205 CSLModel* m_pClusterCenter; 00206 CSLBaseShape* m_pShape; 00207 CSLIntArray m_VertexIndices; 00208 CSIBCArray<CSLUserDataList*> m_UserDataLists; 00209 00210 void *m_pReserved; // reserved for future extension 00211 }; 00212 00213 #endif