Cluster.h

00001 //***************************************************************************************
00002 //
00003 // File supervisor: Softimage 3D Games & 3D Bridge team
00004 //
00005 // (c) Copyright 2001-2002 Avid Technology, Inc. . All rights reserved.
00006 //
00007 //***************************************************************************************
00008 
00009 /****************************************************************************************
00010 THIS CODE IS PUBLISHED AS A SAMPLE ONLY AND IS PROVIDED "AS IS".
00011 IN NO EVENT SHALL SOFTIMAGE, AVID TECHNOLOGY, INC. AND/OR THEIR RESPECTIVE
00012 SUPPLIERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
00013 DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
00014 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
00015 CONNECTION WITH THE USE OR PERFORMANCE OF THIS CODE .
00016 
00017 COPYRIGHT NOTICE. Copyright © 1999-2002 Avid Technology Inc. . All rights reserved. 
00018  
00019 SOFTIMAGE is a registered trademark of Avid Technology Inc. or its subsidiaries 
00020 or divisions. Windows NT is a registered trademark of Microsoft Corp. All other
00021 trademarks contained herein are the property of their respective owners. 
00022 ****************************************************************************************/
00023 #ifndef _CLUSTER_H
00024 #define _CLUSTER_H
00025 
00026 #include "Template.h"
00027 #include "XSIClusterInfo.h"
00028 
00029 #ifndef _SL_INT_ARRAY_PROXY_EXPORT_
00030 #define _SL_INT_ARRAY_PROXY_EXPORT_
00031 
00032 //XSITEMPLATEEXP template class XSIEXPORT CSLArrayProxy<SI_Int, SI_Int, 1>;
00033 
00034 #endif // _SL_INT_ARRAY_PROXY_EXPORT_
00035 
00036 // Forward declaration
00037 class CSLWeightingType;
00038 class CLSModel;
00039 class CSLBaseShape;
00040 class CSLUserDataList;
00041 
00042 
00044 class XSIEXPORT CSLCluster
00045     : public CSLTemplate
00046 {
00047 public:
00051     typedef CSLArrayProxy<SI_Int, SI_Int, 1> CSLIntArray;
00052 
00056     enum EClusterWeightingType
00057     {
00058         SI_AVERAGE,     
00059         SI_ADDITIVE,    
00060     };
00061 
00066     virtual SI_Error Synchronize();
00067 
00071     virtual ETemplateType Type() { return SI_CLUSTER; }
00072     
00079     CSLCluster(CSLScene* in_pScene, CSLModel *in_pModel, CdotXSITemplate* in_pTemplate);
00080 
00083     virtual ~CSLCluster();
00084 
00088     CSLModel* GetReference();
00089 
00093     CSLModel* GetCenter();
00094 
00099     SI_Void SetCenter(CSLModel* in_pNewCenter);
00100 
00104     CSLBaseShape* CreateShape();
00105 
00109     CSLBaseShape* Shape();
00110 
00114     SI_Error DestroyShape();
00115 
00119     SI_Int GetVertexIndicesCount();
00120 
00124     CSLIntArray* GetVertexIndicesList();
00125 
00129     SI_Int* GetVertexIndicesListPtr();
00130 
00134     EClusterWeightingType GetWeightingType();
00135 
00140     SI_Void SetWeightingType(EClusterWeightingType in_Type);
00141 
00142     // Connection functions.
00147     CSLBaseShape* ConnectShape(CSLBaseShape* in_pNewShape);
00148 
00150     // UserDataList Functionality /////////////////////////////////////////////
00152 
00156     CSLUserDataList* AddUserDataList();
00157 
00162     SI_Error RemoveUserDataList( SI_Int in_nIndex );
00163 
00168     SI_Error RemoveUserDataList( CSLUserDataList* in_pToRemove );
00169 
00173     SI_Error ClearUserDataLists();
00174 
00179     CSLUserDataList* ConnectUserDataList( CSLUserDataList* in_pToConnect );
00180 
00184     CSLUserDataList** GetUserDataLists();
00185 
00189     SI_Int GetUserDataListCount();
00190 
00195     CSLUserDataList* FindUserDataList( SI_Char* in_szUserDataListName );
00196 
00197     CSLXSIClusterInfo* GetClusterInfo();
00198 
00199     CSLXSIClusterInfo* ConnectClusterInfo(CSLXSIClusterInfo* in_pClusterInfo);
00200 
00201     virtual SI_Error Fix();
00202 
00203 private:
00204     CSLStrEnumProxy<EClusterWeightingType, SI_ADDITIVE> m_WeightingType;
00205     
00206 /* 
00207     We might activate this once the cluster type are set to strings.  It is also possible
00208     that we will need to add a separate implementation of the whole class in 3.6.  If we do
00209     use the line below, the constructor will have to be updated as well.
00210     
00211      CSLStrEnumProxy<EClusterType, SI_SUB_CURVE> m_ClusterType;
00212 */
00213 
00214     CSLModel* m_pClusterCenter;
00215     CSLBaseShape* m_pShape;
00216     CSLIntArray m_VertexIndices;
00217     CSIBCArray<CSLUserDataList*> m_UserDataLists;
00218 
00219     void *m_pReserved;  // reserved for future extension
00220 };
00221 
00222 #endif