fbsdk/fbconstructionhistory.h Source File

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
64 __FB_FORWARD( FBConstructionHistory );
65 __FB_FORWARD( FBConstructionOperation );
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 
154  FBConstructionOperationArray& operator=( const FBConstructionHistory& );
155 
156 public:
157 
160  FBConstructionOperationArray();
161 
164  ~FBConstructionOperationArray();
165 };
166 
171 };
172 
177 {
178 public:
179 
184 
190  int GetCommandId();
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 
238  FBConstructionHistoryState GetState();
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 
273  static FBConstructionHistory& TheOne();
274 
275 };
276 
277 #ifdef FBSDKUseNamespace
278  }
279 #endif
280 #endif
281 
A template class for arrays.
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:132
#define FB_DEFINE_COMPONENT(DllTag, Type)
Define a component and give it the ability to be a property.
Definition: fbproperties.h:139
Simple wrapper for construction operation arrays.
PyObject * key
Definition: abstract.h:444
Basic string class.
Definition: fbstring.h:66
Construction history is currently listening and recording operations.
FBConstructionOperation is used to represent an operation in the construction history.
Access to global construction history functionality.
Base Event class.
Definition: fbcomponent.h:959
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
MotionBuilder SDK base class.
Definition: fbcomponent.h:668
FBPropertyEvent OnChange
Event: History changed.
Definition of the class FBPlug and related enums and utility functions.
#define FB_DEFINE_ARRAY(DllTag, Type)
Define an array (template) for a component (discard the FB..).
Definition: fbarray.h:360
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68
FBConstructionHistoryState
Construction history manager state.
Template class to contain an array of items.
Definition: fbarray.h:77
#define FBSDKNamespace
FBSDKNamespace define.
Definition: fbversion.h:64
Basic class definitions.
PropertyEvent: Base event class.
Definition: fbproperties.h:507
KEventBase * HKEventBase
Definition: fbcomponent.h:75
Event to retrieve the command id of a construction history change.
PyObject int operation
Definition: abstract.h:1205
const char const char * errors
Definition: codecs.h:64
String class.
Construction history is currently replaying an operation.