Open Reality Reference Guide
fbconstructionhistory.h
Go to the documentation of this file.
1 #ifndef __FBCONSTRUCTIONHISTORY_H__
2 #define __FBCONSTRUCTIONHISTORY_H__
3 /**************************************************************************
4  Copyright (c) 1994 - 2009 Autodesk, Inc. and/or its licensors.
5  All Rights Reserved.
6 
7  The coded instructions, statements, computer programs, and/or related
8  material (collectively the "Data") in these files contain unpublished
9  information proprietary to Autodesk, Inc. and/or its licensors, which is
10  protected by Canada and United States of America federal copyright law
11  and by international treaties.
12 
13  The Data may not be disclosed or distributed to third parties, in whole
14  or in part, without the prior written consent of Autodesk, Inc.
15  ("Autodesk").
16 
17  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
18  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
19  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR
20  ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES
21  OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
22  PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT
23  WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR
24  FREE.
25 
26  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
27  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR
28  EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE
29  DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS
30  OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR
31  DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF
32  LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT
33  LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE
34  DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS
35  BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
36 
37 **************************************************************************/
38 
43 #include <kaydaradef.h>
44 #ifndef FBSDK_DLL
48  #define FBSDK_DLL K_DLLIMPORT
49 #endif
50 #include <fbsdk/fbcomponent.h>
51 #include <fbsdk/fbarray.h>
52 #include <fbsdk/fbplug.h>
53 #include <fbsdk/fbstring.h>
54 
55 class KConstructionOperation;
56 
57 #ifdef FBSDKUseNamespace
58  namespace FBSDKNamespace {
59 #endif
60 
62 // FBConstructionHistory
66 FB_DEFINE_COMPONENT( FBSDK_DLL, ConstructionHistory );
67 
69 
77 {
78  friend class FBConstructionHistory;
79 public:
80 
85 
86  const char* GetLanguage();
87  int GetLanguageVersion();
88  const char* GetScript();
89  const char* GetOrigin();
90  int GetCommandId();
91  bool GetExecuteAsLocalOperation();
92 
98  void SetLanguage( const char* language );
99 
105  void SetLanguageVersion( int version );
106 
112  void SetScript( const char* script );
113 
119  void SetCommandId( int commandId );
120 
126  void SetOrigin( const char* origin );
127 
134  void SetExecuteAsLocalOperation( bool bIsLocal );
135 
136 private:
137  KConstructionOperation* mOperation;
138  bool mExecuteAsLocal;
139 };
140 
144 class FBSDK_DLL FBConstructionOperationArray : public FBArrayTemplate<FBConstructionOperation*>
145 {
150 
155 
156 public:
157 
161 
165 };
166 
171 };
172 
177 {
178 public:
179 
183  FBEventConstructionHistoryChange( HKEventBase pEvent );
184 
191 };
192 
197 {
199 
204 
208  FBConstructionHistory& operator=( const FBConstructionHistory& );
209 
210 public:
211 
215 
222  void GetDeltaOperations( FBConstructionOperationArray* pOperations, int sinceCommandId = -1);
223 
231  int RunOperation ( FBConstructionOperation& operation, FBString& out_errors );
232 
239 
244 
251  void NetDelete ( FBComponent* component, kInt64 key );
252 
258  void NetUndo ( kInt64 key );
259 
267  void GetScriptOutput ( FBString& script, FBString& errors );
268 
269 
274 
275 };
276 
277 #ifdef FBSDKUseNamespace
278  }
279 #endif
280 #endif
281 
Template class to contain an array of items.
Definition: fbarray.h:78
MotionBuilder SDK base class.
Definition: fbcomponent.h:651
Access to global construction history functionality.
FBConstructionHistoryState GetState()
GetState returns the current state of the construction history manager.
void NetDelete(FBComponent *component, kInt64 key)
NetDelete Network delete with support for Network Undo.
void GetScriptOutput(FBString &script, FBString &errors)
GetScriptOutput Returns the output from the scripting engine.
void GetDeltaOperations(FBConstructionOperationArray *pOperations, int sinceCommandId=-1)
GetDeltaOperations Get the list of delta operations in the construction history.
FBConstructionHistory()
Constructor.
void NetUndo(kInt64 key)
NetUndo Perform network undo operation.
int RunOperation(FBConstructionOperation &operation, FBString &out_errors)
RunOperation Runs an operation.
static FBConstructionHistory & TheOne()
Get the global construction history.
FBPropertyEvent OnChange
Event: History changed.
Simple wrapper for construction operation arrays.
FBConstructionOperationArray()
Constructor.
~FBConstructionOperationArray()
Destructor.
FBConstructionOperation is used to represent an operation in the construction history.
FBConstructionOperation()
Constructor.
void SetExecuteAsLocalOperation(bool bIsLocal)
SetExecuteAsLocalOperation Whether to execute this operation as local or remote.
void SetScript(const char *script)
SetScript Set the script content for this operation.
void SetCommandId(int commandId)
SetCommandId Set the operation's Id so that operation transactions can be resolved properly (eg: comm...
void SetLanguage(const char *language)
SetLanguage Set the script language for this operation.
void SetOrigin(const char *origin)
SetOrigin Set operation's original creator.
void SetLanguageVersion(int version)
SetLanguageVersion Set the script language interpreter's version that this operation should be interp...
Event to retrieve the command id of a construction history change.
int GetCommandId()
GetCommandId Returns the index of the command that was executed in the construction history.
FBEventConstructionHistoryChange(HKEventBase pEvent)
Constructor.
Base Event class.
Definition: fbcomponent.h:940
PropertyEvent: Base event class.
Definition: fbproperties.h:515
Basic string class.
Definition: fbstring.h:67
A template class for arrays.
#define FB_DEFINE_ARRAY(DllTag, Type)
Define an array (template) for a component (discard the FB..).
Definition: fbarray.h:360
Basic class definitions.
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:131
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
FBConstructionHistoryState
Construction history manager state.
@ kFBConstructionHistory_Listening
Construction history is currently listening and recording operations.
@ kFBConstructionHistory_Replaying
Construction history is currently replaying an operation.
FB_DEFINE_COMPONENT(K_DLLIMPORT, AnimationNode)
Animation node class.
Definition of the class FBPlug and related enums and utility functions.
String class.
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68