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
45 
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 
FBConstructionOperation::FBConstructionOperation
FBConstructionOperation()
Constructor.
FBConstructionOperation::SetOrigin
void SetOrigin(const char *origin)
SetOrigin Set operation's original creator.
kFBConstructionHistory_Listening
@ kFBConstructionHistory_Listening
Construction history is currently listening and recording operations.
Definition: fbconstructionhistory.h:169
FBConstructionOperation::SetScript
void SetScript(const char *script)
SetScript Set the script content for this operation.
FBConstructionHistory::NetUndo
void NetUndo(kInt64 key)
NetUndo Perform network undo operation.
FBConstructionHistory::GetState
FBConstructionHistoryState GetState()
GetState returns the current state of the construction history manager.
FBConstructionHistory::OnChange
FBPropertyEvent OnChange
Event: History changed.
Definition: fbconstructionhistory.h:243
FBConstructionHistory::NetDelete
void NetDelete(FBComponent *component, kInt64 key)
NetDelete Network delete with support for Network Undo.
FBConstructionHistory::GetDeltaOperations
void GetDeltaOperations(FBConstructionOperationArray *pOperations, int sinceCommandId=-1)
GetDeltaOperations Get the list of delta operations in the construction history.
FBSDK_DLL
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbconstructionhistory.h:48
FBConstructionHistory
Access to global construction history functionality.
Definition: fbconstructionhistory.h:197
FBEventConstructionHistoryChange::GetCommandId
int GetCommandId()
GetCommandId Returns the index of the command that was executed in the construction history.
FBConstructionOperation::SetLanguage
void SetLanguage(const char *language)
SetLanguage Set the script language for this operation.
FBConstructionHistory::RunOperation
int RunOperation(FBConstructionOperation &operation, FBString &out_errors)
RunOperation Runs an operation.
FBString
Basic string class.
Definition: fbstring.h:67
FB_DEFINE_ARRAY
#define FB_DEFINE_ARRAY(DllTag, Type)
Define an array (template) for a component (discard the FB..).
Definition: fbarray.h:360
FBConstructionHistory::TheOne
static FBConstructionHistory & TheOne()
Get the global construction history.
__FBClassDeclare
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:131
FBEventConstructionHistoryChange
Event to retrieve the command id of a construction history change.
Definition: fbconstructionhistory.h:177
__FB_FORWARD
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68
FBEvent
Base Event class.
Definition: fbcomponent.h:940
fbarray.h
A template class for arrays.
FBConstructionHistoryState
FBConstructionHistoryState
Construction history manager state.
Definition: fbconstructionhistory.h:168
FBConstructionOperation::SetLanguageVersion
void SetLanguageVersion(int version)
SetLanguageVersion Set the script language interpreter's version that this operation should be interp...
FBConstructionOperation
FBConstructionOperation is used to represent an operation in the construction history.
Definition: fbconstructionhistory.h:77
FBConstructionHistory::GetScriptOutput
void GetScriptOutput(FBString &script, FBString &errors)
GetScriptOutput Returns the output from the scripting engine.
FBPropertyEvent
PropertyEvent: Base event class.
Definition: fbproperties.h:515
FBConstructionOperationArray
Simple wrapper for construction operation arrays.
Definition: fbconstructionhistory.h:145
fbstring.h
String class.
fbcomponent.h
Basic class definitions.
FBConstructionOperationArray::FBConstructionOperationArray
FBConstructionOperationArray()
Constructor.
FBArrayTemplate
Template class to contain an array of items.
Definition: fbarray.h:78
fbplug.h
Definition of the class FBPlug and related enums and utility functions.
FB_DEFINE_COMPONENT
FB_DEFINE_COMPONENT(K_DLLIMPORT, AnimationNode)
Animation node class.
FBConstructionOperation::SetExecuteAsLocalOperation
void SetExecuteAsLocalOperation(bool bIsLocal)
SetExecuteAsLocalOperation Whether to execute this operation as local or remote.
FBConstructionHistory::FBConstructionHistory
FBConstructionHistory()
Constructor.
kFBConstructionHistory_Replaying
@ kFBConstructionHistory_Replaying
Construction history is currently replaying an operation.
Definition: fbconstructionhistory.h:170
FBConstructionOperationArray::~FBConstructionOperationArray
~FBConstructionOperationArray()
Destructor.
FBComponent
MotionBuilder SDK base class.
Definition: fbcomponent.h:651
FBConstructionOperation::SetCommandId
void SetCommandId(int commandId)
SetCommandId Set the operation's Id so that operation transactions can be resolved properly (eg: comm...
FBEventConstructionHistoryChange::FBEventConstructionHistoryChange
FBEventConstructionHistoryChange(HKEventBase pEvent)
Constructor.