fbscene.h

Go to the documentation of this file.
00001 #ifndef __FBSCENE_H__
00002 #define __FBSCENE_H__
00003 /**************************************************************************
00004  Copyright (c) 1994 - 2009 Autodesk, Inc. and/or its licensors.
00005  All Rights Reserved.
00006  
00007  The coded instructions, statements, computer programs, and/or related 
00008  material (collectively the "Data") in these files contain unpublished 
00009  information proprietary to Autodesk, Inc. and/or its licensors, which is 
00010  protected by Canada and United States of America federal copyright law 
00011  and by international treaties.
00012  
00013  The Data may not be disclosed or distributed to third parties, in whole 
00014  or in part, without the prior written consent of Autodesk, Inc. 
00015  ("Autodesk").
00016  
00017  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00018  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO 
00019  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR 
00020  ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES 
00021  OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR 
00022  PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT 
00023  WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR 
00024  FREE.
00025  
00026  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS 
00027  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR 
00028  EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE 
00029  DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS 
00030  OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR 
00031  DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF 
00032  LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT 
00033  LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE 
00034  DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS 
00035  BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
00036  
00037 **************************************************************************/
00038 
00044 #include <kaydaradef.h>
00045 #ifndef FBSDK_DLL 
00046 
00049     #define FBSDK_DLL K_DLLIMPORT
00050 #endif
00051 
00052 #include <fbsdk/fbcomponent.h>
00053 #include <fbsdk/fbcore.h>
00054 #include <fbsdk/fbdata.h>
00055 #include <fbsdk/fbfolder.h>
00056 #include <fbsdk/fbrenderer.h>
00057 #include <fbsdk/fbshader.h>
00058 #include <fbsdk/fbmodel.h>
00059 #include <fbsdk/fbhud.h>
00060 #include <fbsdk/fbvideo.h>
00061 #include <fbsdk/fbmotion.h>
00062 #include <fbsdk/fbgroup.h>
00063 #include <fbsdk/fbnamespace.h>
00064 #include <fbsdk/fbobjectpose.h>
00065 
00066 #if !defined(K_NO_CHARACTER)
00067     #include <fbsdk/fbcharacter.h>
00068     #include <fbsdk/fbcharacterface.h>
00069     #include <fbsdk/fbcharacterpose.h>
00070     #include <fbsdk/fbcharacterextension.h>
00071 #endif
00072 
00073 #if !defined(K_NO_DECK)
00074     #include <fbsdk/fbdeck.h>
00075 #endif
00076 
00077 #if !defined(K_NO_AUDIO)
00078     #include <fbsdk/fbaudio.h>
00079 #endif
00080 
00081 #if !defined(K_NO_MANIPULATOR)
00082     #include <fbsdk/fbmanipulator.h>
00083 #endif
00084 
00085 #if !defined(K_NO_NOTE)
00086     #include <fbsdk/fbnote.h>
00087 #endif
00088 
00089 #if !defined(K_NO_POSE)
00090     #include <fbsdk/fbpose.h>
00091 #endif
00092 
00093 #if !defined(K_NO_STORY)
00094     #include <fbsdk/fbcommand.h>
00095 #endif
00096 
00097 #if !defined(K_NO_PROJECTSETTINGS)
00098     #include <fbsdk/fbprojectsettings.h>
00099 #endif
00100 
00101 #ifndef FBSDK_LEAN_AND_MEAN
00102     #include <fbsdk/fbuserobject.h>
00103 #endif
00104 
00105 #include <fbsdk/fbconstraint.h>
00106 
00107 #ifdef FBSDKUseNamespace
00108     namespace FBSDKNamespace {
00109 #endif
00110 
00111 
00112 
00114 // FBSceneEvent
00117 enum FBSceneChangeType
00118 {
00119     kFBSceneChangeNone,                 
00120     kFBSceneChangeDestroy,              
00121     kFBSceneChangeAttach,               
00122     kFBSceneChangeDetach,               
00123     kFBSceneChangeAddChild,             
00124     kFBSceneChangeRemoveChild,          
00125     kFBSceneChangeSelect,               
00126     kFBSceneChangeUnselect,             
00127     kFBSceneChangeRename,               
00128     kFBSceneChangeRenamePrefix,         
00129     kFBSceneChangeRenameUnique,         
00130     kFBSceneChangeRenameUniquePrefix,   
00131     kFBSceneChangeRenamed,              
00132     kFBSceneChangeRenamedPrefix,        
00133     kFBSceneChangeRenamedUnique,        
00134     kFBSceneChangeRenamedUniquePrefix,  
00135     kFBSceneChangeSoftSelect,           
00136     kFBSceneChangeSoftUnselect,         
00137     kFBSceneChangeHardSelect,           
00138     kFBSceneChangeActivate,             
00139     kFBSceneChangeDeactivate,           
00140     kFBSceneChangeLoadBegin,            
00141     kFBSceneChangeLoadEnd,              
00142     kFBSceneChangeClearBegin,           
00143     kFBSceneChangeClearEnd,             
00144     kFBSceneChangeTransactionBegin,     
00145     kFBSceneChangeTransactionEnd,       
00146     kFBSceneChangeMergeTransactionBegin,
00147     kFBSceneChangeMergeTransactionEnd,  
00148     kFBSceneChangeReSelect,             
00149     kFBSceneChangeChangeName,           
00150     kFBSceneChangeChangedName,          
00151     kFBSceneChangePreParent,            
00152     kFBSceneChangePreUnparent,          
00153     kFBSceneChangeFocus,                
00154     kFBSceneChangeChangedParent,        
00155     kFBSceneChangeReorder,              
00156     kFBSceneChangeReordered,            
00157 };
00158 
00159 FB_DEFINE_ENUM( FBSDK_DLL, SceneChangeType );
00160 
00161 __FB_FORWARD( FBEventSceneChange );
00162 
00170 class FBSDK_DLL FBEventSceneChange: public FBEvent 
00171 {
00172 public:
00176     FBEventSceneChange( HKEventBase pEvent );       
00177 
00178     FBPropertySceneChangeType   Type;            
00179     FBPropertyComponent         Component;       
00180     FBPropertyComponent         ChildComponent;  
00181 };
00182 
00184 // FBEventTakeChange
00187 enum FBTakeChangeType   
00188 {
00189     kFBTakeChangeAdded,         
00190     kFBTakeChangeRemoved,       
00191     kFBTakeChangeOpened,        
00192     kFBTakeChangeClosed,        
00193     kFBTakeChangeRenamed,       
00194     kFBTakeChangeUpdated,       
00195     kFBTakeChangeMoved,         
00196     kFBTakeChangeNone           
00197 };
00198 
00199 FB_DEFINE_ENUM( FBSDK_DLL, TakeChangeType );
00200 
00201 __FB_FORWARD( FBEventTakeChange );
00202 
00210 class FBSDK_DLL FBEventTakeChange: public FBEvent 
00211 {
00212   public:
00213 
00217     FBEventTakeChange( HKEventBase pEvent );        
00218 
00219     FBPropertyTakeChangeType    Type;        
00220     FBPropertyTake              Take;        
00221 };
00222 
00224 // FBSceneList
00226 FB_FORWARD      ( FBPropertyListScene );
00227 __FB_FORWARD( FBScene );
00228 FB_DEFINE_LIST  ( FBSDK_DLL, Scene );
00229 
00232 class FBSDK_DLL FBPropertyListScene : public FBPropertyBaseList< FBScene* >
00233 {
00234   private:
00235   public:
00240     virtual int Add( FBScene* pItem );
00244     virtual void RemoveAt( int pIndex );
00249     virtual FBScene* operator[](int pIndex);
00253     virtual int GetCount();
00254 };
00255 
00257 // FBScene
00259 
00276 class FBSDK_DLL FBScene : public FBComponent {
00277     __FBClassDeclare( FBScene,FBComponent );
00278 
00279     // We want to disallow the use of the copy constructor and operator for FBScene.
00280     FBScene( const FBScene* );
00281     FBScene( const FBScene& );
00282     FBScene& operator=( const FBScene& );
00283 
00284 public:
00285 
00291     FBScene(HIObject pObject);
00292 
00295     virtual void FBDelete();
00296 
00299     void Clear();
00300 
00304     bool Evaluate();
00305 
00309     bool CandidateEvaluationAndResolve();
00310 
00314     bool EvaluateDeformations();
00315 
00320 
00327     int NamespaceGetChildrenList(FBStringList& pNamespaceList, const char* pNamespace = NULL, bool pRecursive = true );
00328 
00329 
00334     HFBNamespace NamespaceGet(const char* pNamespace);
00335 
00340     bool NamespaceExist(const char* pNamespace);
00341 
00346     bool NamespaceEmpty(const char* pNamespace);
00347 
00356     void NamespaceGetContentList(FBComponentList& pContentList, const char* pNamespace, FBPlugModificationFlag pModificationFlags = kFBPlugAllContent, bool pRecursive = true, int pTypeInfo = FBPlug::TypeInfo, bool pExactTypeMatch = false);
00357 
00366     void NamespaceSelectContent(const char* pNamespace, bool pSelect, FBPlugModificationFlag pModificationFlags = kFBPlugAllContent, bool pRecursive = true, int pTypeInfo = FBPlug::TypeInfo, bool pExactTypeMatch = false);
00367 
00376     bool NamespaceRename(const char* pNameSpace, const char* pNewNamespace, bool pRecursive = true, int pTypeInfo = FBPlug::TypeInfo, bool pExactTypeMatch = false);
00377 
00382     bool NamespaceDelete(const char* pNamespace);
00383 
00392     bool NamespaceDeleteContent(const char* pNamespace, FBPlugModificationFlag pModificationFlags = kFBPlugAllContent, bool pRecursive = true, int pTypeInfo = FBPlug::TypeInfo, bool pExactTypeMatch = false);
00398     bool NamespaceImport(const char* pNamespace, const char* pFilePath);
00399 
00405     bool NamespaceImportToMultiple(const FBStringList& pDstNamespaceList, const char* pFilePath);
00412     bool NamespaceExport(const char* pNamespace, const char* pFilePath, bool pASCIIFormat = false);
00414 
00415     FBPropertyListTake              Takes;          
00416     FBPropertyModel                 RootModel;      
00417     FBPropertyListCamera            Cameras;        
00418     FBPropertyListMaterial          Materials;      
00419     FBPropertyListTexture           Textures;       
00420     FBPropertyListShader            Shaders;        
00421     FBPropertyListDeformer          Deformers;      
00422     FBPropertyListDevice            Devices;        
00423     FBPropertyListConstraint        Constraints;    
00424 
00425     FBPropertyListLight             Lights;         
00426 #if !defined(K_NO_AUDIO)
00427     FBPropertyListAudioClip         AudioClips;     
00428 #endif
00429 #if !defined(K_NO_VIDEO)
00430     FBPropertyListVideoClip         VideoClips;     
00431 #endif
00432 
00433     FBPropertyListMotionClip        MotionClips;    
00434 
00435 #if !defined(K_NO_FOLDER)
00436     FBPropertyListFolder            Folders;        
00437 #endif
00438 
00439 #if !defined(K_NO_NOTE)
00440     FBPropertyListNote              Notes;          
00441 #endif
00442 
00443 #if !defined(K_NO_POSE)
00444     FBPropertyListPose              Poses;          
00445     FBPropertyListObjectPose        ObjectPoses;    
00446 #endif
00447 
00448 #if !defined(K_NO_ACTOR)
00449     FBPropertyListActor             Actors;         
00450     FBPropertyListActorFace         ActorFaces;     
00451 #endif
00452 
00453 #if !defined(K_NO_CHARACTER)
00454     FBPropertyListMarkerSet         MarkerSets;     
00455     FBPropertyListControlSet        ControlSets;    
00456     FBPropertyListCharacter         Characters;     
00457     FBPropertyListCharacterFace     CharacterFaces; 
00458     FBPropertyListCharacterPose     CharacterPoses; 
00459     FBPropertyListCharacterExtension CharacterExtensions;   
00460 #endif
00461 
00462 #ifndef FB_KERNEL 
00463     FBPropertyListUserObject        UserObjects;    
00464 #endif
00465 
00466 #if !defined(K_NO_PROJECTSETTINGS)
00467     FBPropertyProjectSettings       ProjectSettings;
00468 #endif
00469 
00470     FBPropertyRenderer              Renderer;       
00471     FBPropertyListComponent         Components;     
00472     FBPropertyListGroup             Groups;         
00473     FBPropertyListSet               Sets;           
00474     FBPropertyListNamespace         Namespaces;     
00475 
00476 #ifndef FB_KERNEL 
00477     FBPropertyListHandle            Handles;        
00478 #endif
00479 #ifndef K_NO_HUD 
00480     FBPropertyListHUD               HUDs;           
00481 #endif
00482 
00483     FBPropertyListConstraintSolver      ConstraintSolvers;      
00484     FBPropertyListPhysicalProperties    PhysicalProperties;     
00485 
00486     FBPropertyString                FilePath;       
00487 
00488     FBPropertyEvent                 OnChange;       
00489     FBPropertyEvent                 OnTakeChange;   
00490 };
00491 
00492 #ifndef __FB_COMPONENT_SCENE
00493     #define __FB_COMPONENT_SCENE
00494     FB_DEFINE_COMPONENT( FBSDK_DLL, Scene );
00495 #endif
00496 
00497 
00498 #ifdef FBSDKUseNamespace
00499     }
00500 #endif
00501 #endif
00502