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 #ifndef _MODEL_H 00012 #define _MODEL_H 00013 00014 #include "Template.h" 00015 #include "ConstrainableType.h" 00016 00017 // Forward declaration 00018 class CSLVisibility; 00019 class CSLCluster; 00020 class CSLTransform; 00021 class CSLGlobalMaterial; 00022 class CSLPrimitive; 00023 class CSLMixer; 00024 class CSLEnvelope; 00025 class CSLFXTree; 00026 class CSLXSITransform; 00027 class CSLXSIBasePose; 00028 00032 class XSIEXPORT CSLModel 00033 : public CSLTemplate 00034 , public CSLConstrainableType 00035 { 00036 public: 00043 CSLModel(CSLScene* in_pScene, CSLModel *in_pModel, CdotXSITemplate* in_pTemplate); 00044 00046 virtual ~CSLModel(); 00047 00051 virtual SI_Error Synchronize(); 00052 00056 virtual ETemplateType Type(); 00057 00062 virtual CSLAnimatableType* ParameterFromName(SI_Char *in_szName); 00063 00067 virtual SI_Error Fix(); 00068 00072 CSLCluster* AddCluster(); 00073 00077 CSLConstraint* AddConstraint(CSLConstraint::EConstraintType in_ConstraintType); 00078 00083 SI_Error RemoveCluster( SI_Int in_nIndex ); 00084 00089 SI_Error RemoveCluster( CSLCluster *in_pToRemove ); 00090 00094 SI_Int GetClusterCount(); 00095 00099 SI_Int GetEnvelopeCount(); 00100 00104 CSLCluster** GetClusterList(); 00105 00109 CSLEnvelope** GetEnvelopeList(); 00110 00114 SI_Error ClearClusters(); 00115 00120 SI_Error UnconnectEnvelope( CSLEnvelope* in_pToUnconnect ); 00121 00126 CSLCluster* ConnectCluster( CSLCluster* in_pNewCluster ); 00127 00132 CSLEnvelope* ConnectEnvelope( CSLEnvelope* in_pNewEnvelope ); 00133 00137 CSLTransform* GetBasePose(); 00138 00142 CSLTransform* CreateBasePose(); 00143 00147 SI_Error DestroyBasePose(); 00148 00152 CSLGlobalMaterial* GlobalMaterial(); 00153 00157 SI_Error AddGlobalMaterial(); 00158 00162 CSLTransform* Transform(); 00163 00167 CSLVisibility* Visibility(); 00168 00172 CSLModel* Parent(); 00173 00177 CSLPrimitive* Primitive(); 00178 00183 CSLMixer* ConnectMixer(CSLMixer *in_pNewMixer); 00184 00188 virtual CSLMixer* CreateMixer(); 00189 00193 SI_Error DestroyMixer(); 00194 00198 CSLMixer* Mixer(); 00199 00204 CSLModel* ConnectModel(CSLModel *in_pNewModel); 00205 00210 CSLVisibility* ConnectVisibility(CSLVisibility *in_pNewVisibility); 00211 00216 CSLTransform* ConnectTransform(CSLTransform *in_pNewTransform); 00217 00222 CSLTransform* ConnectBasePose(CSLTransform *in_pNewBasePose); 00223 00228 CSLPrimitive* ConnectPrimitive(CSLPrimitive *in_pNewPrimitive); 00229 00234 CSLGlobalMaterial* ConnectGlobalMaterial(CSLGlobalMaterial* in_pNewGlobalMaterial); 00235 00236 // Primitive and children manipulation. 00237 00241 ETemplateType GetPrimitiveType(); 00242 00246 virtual CSLModel* AddCamera(); 00247 00251 virtual CSLModel* AddXSICamera(); 00252 00256 CSLModel* AddCurveList(); 00257 00261 virtual CSLModel* AddDirectionalLight(); 00262 00266 CSLModel* AddIKChain(SI_Int in_nNbJoints); 00267 00271 CSLModel* AddIKRoot(); 00272 00276 CSLModel* AddIKJoint(); 00277 00281 CSLModel* AddIKEffector(); 00282 00286 virtual CSLModel* AddInfiniteLight(); 00287 00291 virtual CSLModel* AddInstance(); 00292 00296 CSLModel* AddMesh(); 00297 00301 virtual CSLModel* AddXSIMesh(); 00302 00306 virtual CSLModel* AddModel(); 00307 00311 CSLModel* AddNull(); 00312 00316 CSLModel* AddPatch(); 00317 00321 virtual CSLModel* AddPointLight(); 00322 00326 virtual CSLModel* AddSpotLight(); 00327 00331 CSLModel* AddSurfaceMesh(); 00332 00336 CSLModel** GetChildrenList(); 00337 00341 SI_Error ClearChildren(); 00342 00346 SI_Int GetChildrenCount(); 00347 00352 SI_Error RemoveChild(CSLModel* in_pChild); 00353 00358 SI_Error RemoveChild(SI_Int in_nIndex); 00359 00364 SI_Error Reparent(CSLModel *in_pNewParent); 00365 00369 CSLFXTree* AddFXTree(); 00370 00375 SI_Error RemoveFXTree( SI_Int in_nIndex ); 00376 00381 SI_Error RemoveFXTree( CSLFXTree* in_pToRemove ); 00382 00386 SI_Error ClearFXTrees(); 00387 00392 CSLFXTree* ConnectFXTree( CSLFXTree* in_pToConnect ); 00393 00397 CSLFXTree** GetFXTreeList(); 00398 00402 SI_Int GetFXTreeCount(); 00403 00408 CSLFXTree* FindFXTree( SI_Char* in_szFXTreeName ); 00409 00413 CSLXSITransform* XSITransform(); 00414 00419 CSLXSITransform* ConnectXSITransform(CSLXSITransform *in_pNewTransform); 00420 00424 CSLXSIBasePose* GetXSIBasePose(); 00425 00430 CSLXSIBasePose* ConnectXSIBasePose(CSLXSIBasePose *in_pNewBasePose); 00431 00435 CSLXSIBasePose* CreateXSIBasePose(); 00436 00440 SI_Error DestroyXSIBasePose(); 00441 00446 virtual const SI_Char* GetParameterName(CSLAnimatableType* in_pParameter); 00447 00452 SI_Error UnconnectModel(CSLModel *in_pModel); 00453 00454 protected: 00455 00456 CSLModel* CreateLightTemplate(CdotXSITemplate **out_ppLightTemplate); 00457 SI_Bool FindSpecificChildrenRecursively(CSLModel *in_pSource, CSLModel *in_pTarget); 00458 00459 CSLVisibility* m_pVisibility; 00460 CSIBCArray<CSLCluster*> m_Clusters; 00461 CSLMixer* m_pMixer; 00462 CSIBCArray<CSLEnvelope*> m_Envelopes; 00463 CSLTransform* m_pLocalTransform; 00464 CSLTransform* m_pBasepose; 00465 CSLGlobalMaterial* m_pGlobalMaterial; 00466 CSLPrimitive* m_pPrimitive; 00467 CSIBCArray<CSLModel*> m_Children; 00468 CSIBCArray<CSLFXTree*> m_FXTrees; 00469 CSLXSITransform* m_pXSITransform; 00470 CSLXSIBasePose* m_pXSIBasePose; 00471 }; 00472 00473 #endif