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 _MODEL_H 00024 #define _MODEL_H 00025 00026 #include "Template.h" 00027 #include "ConstrainableType.h" 00028 00029 // Forward declaration 00030 class CSLVisibility; 00031 class CSLCluster; 00032 class CSLTransform; 00033 class CSLGlobalMaterial; 00034 class CSLPrimitive; 00035 class CSLMixer; 00036 class CSLEnvelope; 00037 class CSLFXTree; 00038 class CSLXSITransform; 00039 class CSLXSIBasePose; 00040 00042 class XSIEXPORT CSLModel 00043 : public CSLTemplate 00044 , public CSLConstrainableType 00045 { 00046 public: 00053 CSLModel(CSLScene* in_pScene, CSLModel *in_pModel, CdotXSITemplate* in_pTemplate); 00054 00056 virtual ~CSLModel(); 00057 00061 virtual SI_Error Synchronize(); 00062 00066 virtual ETemplateType Type(); 00067 00072 virtual CSLAnimatableType* ParameterFromName(SI_Char *in_szName); 00073 00077 virtual SI_Error Fix(); 00078 00082 CSLCluster* AddCluster(); 00083 00087 CSLConstraint* AddConstraint(CSLConstraint::EConstraintType in_ConstraintType); 00088 00093 SI_Error RemoveCluster( SI_Int in_nIndex ); 00094 00099 SI_Error RemoveCluster( CSLCluster *in_pToRemove ); 00100 00104 SI_Int GetClusterCount(); 00105 00109 SI_Int GetEnvelopeCount(); 00110 00114 CSLCluster** GetClusterList(); 00115 00119 CSLEnvelope** GetEnvelopeList(); 00120 00124 SI_Error ClearClusters(); 00125 00130 SI_Error UnconnectEnvelope( CSLEnvelope* in_pToUnconnect ); 00131 00136 CSLCluster* ConnectCluster( CSLCluster* in_pNewCluster ); 00137 00142 CSLEnvelope* ConnectEnvelope( CSLEnvelope* in_pNewEnvelope ); 00143 00147 CSLTransform* GetBasePose(); 00148 00152 CSLTransform* CreateBasePose(); 00153 00157 SI_Error DestroyBasePose(); 00158 00162 CSLGlobalMaterial* GlobalMaterial(); 00163 00167 SI_Error AddGlobalMaterial(); 00168 00172 CSLTransform* Transform(); 00173 00177 CSLVisibility* Visibility(); 00178 00182 CSLModel* Parent(); 00183 00187 CSLPrimitive* Primitive(); 00188 00193 CSLMixer* ConnectMixer(CSLMixer *in_pNewMixer); 00194 00198 virtual CSLMixer* CreateMixer(); 00199 00203 SI_Error DestroyMixer(); 00204 00208 CSLMixer* Mixer(); 00209 00214 CSLModel* ConnectModel(CSLModel *in_pNewModel); 00215 00220 CSLVisibility* ConnectVisibility(CSLVisibility *in_pNewVisibility); 00221 00226 CSLTransform* ConnectTransform(CSLTransform *in_pNewTransform); 00227 00232 CSLTransform* ConnectBasePose(CSLTransform *in_pNewBasePose); 00233 00238 CSLPrimitive* ConnectPrimitive(CSLPrimitive *in_pNewPrimitive); 00239 00244 CSLGlobalMaterial* ConnectGlobalMaterial(CSLGlobalMaterial* in_pNewGlobalMaterial); 00245 00246 // Primitive and children manipulation. 00247 00251 ETemplateType GetPrimitiveType(); 00252 00256 virtual CSLModel* AddCamera(); 00257 00261 virtual CSLModel* AddXSICamera(); 00262 00266 CSLModel* AddCurveList(); 00267 00271 virtual CSLModel* AddDirectionalLight(); 00272 00276 CSLModel* AddIKChain(SI_Int in_nNbJoints); 00277 00281 CSLModel* AddIKRoot(); 00282 00286 CSLModel* AddIKJoint(); 00287 00291 CSLModel* AddIKEffector(); 00292 00296 virtual CSLModel* AddInfiniteLight(); 00297 00301 virtual CSLModel* AddInstance(); 00302 00306 CSLModel* AddMesh(); 00307 00311 virtual CSLModel* AddXSIMesh(); 00312 00316 virtual CSLModel* AddModel(); 00317 00321 CSLModel* AddNull(); 00322 00326 CSLModel* AddPatch(); 00327 00331 virtual CSLModel* AddPointLight(); 00332 00336 virtual CSLModel* AddSpotLight(); 00337 00341 CSLModel* AddSurfaceMesh(); 00342 00346 CSLModel** GetChildrenList(); 00347 00351 SI_Error ClearChildren(); 00352 00356 SI_Int GetChildrenCount(); 00357 00362 SI_Error RemoveChild(CSLModel* in_pChild); 00363 00368 SI_Error RemoveChild(SI_Int in_nIndex); 00369 00374 SI_Error Reparent(CSLModel *in_pNewParent); 00375 00379 CSLFXTree* AddFXTree(); 00380 00385 SI_Error RemoveFXTree( SI_Int in_nIndex ); 00386 00391 SI_Error RemoveFXTree( CSLFXTree* in_pToRemove ); 00392 00396 SI_Error ClearFXTrees(); 00397 00402 CSLFXTree* ConnectFXTree( CSLFXTree* in_pToConnect ); 00403 00407 CSLFXTree** GetFXTreeList(); 00408 00412 SI_Int GetFXTreeCount(); 00413 00418 CSLFXTree* FindFXTree( SI_Char* in_szFXTreeName ); 00419 00423 CSLXSITransform* XSITransform(); 00424 00429 CSLXSITransform* ConnectXSITransform(CSLXSITransform *in_pNewTransform); 00430 00434 CSLXSIBasePose* GetXSIBasePose(); 00435 00440 CSLXSIBasePose* ConnectXSIBasePose(CSLXSIBasePose *in_pNewBasePose); 00441 00445 CSLXSIBasePose* CreateXSIBasePose(); 00446 00450 SI_Error DestroyXSIBasePose(); 00451 00456 virtual const SI_Char* GetParameterName(CSLAnimatableType* in_pParameter); 00457 00462 SI_Error UnconnectModel(CSLModel *in_pModel); 00463 00464 protected: 00465 00466 CSLModel* CreateLightTemplate(CdotXSITemplate **out_ppLightTemplate); 00467 SI_Bool FindSpecificChildrenRecursively(CSLModel *in_pSource, CSLModel *in_pTarget); 00468 00469 CSLVisibility* m_pVisibility; 00470 CSIBCArray<CSLCluster*> m_Clusters; 00471 CSLMixer* m_pMixer; 00472 CSIBCArray<CSLEnvelope*> m_Envelopes; 00473 CSLTransform* m_pLocalTransform; 00474 CSLTransform* m_pBasepose; 00475 CSLGlobalMaterial* m_pGlobalMaterial; 00476 CSLPrimitive* m_pPrimitive; 00477 CSIBCArray<CSLModel*> m_Children; 00478 CSIBCArray<CSLFXTree*> m_FXTrees; 00479 CSLXSITransform* m_pXSITransform; 00480 CSLXSIBasePose* m_pXSIBasePose; 00481 }; 00482 00483 #endif