fbsdk/fbcommand.h Source File

fbcommand.h
Go to the documentation of this file.
1 #ifndef __FBCOMMAND_H__
2 #define __FBCOMMAND_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 
51 #include <fbsdk/fbcomponent.h>
52 
53 #ifdef FBSDKUseNamespace
54  namespace FBSDKNamespace {
55 #endif
56 
58 // FBCommand
60 
67 #define FBRegisterCommand( UniqueNameStr, ClassName, Label, Description, IconFilename ) \
68  HIObject RegisterCommand##ClassName( HIObject /*pOwner*/,const char* pName,void * /*pData*/) \
69  { \
70  ClassName *Class = new ClassName( Label ); \
71  if (Class->FBCreate()) { \
72  return Class->GetHIObject(); \
73  } else { \
74  delete Class; \
75  return NULL; \
76  } \
77  } \
78  FBLibraryModule( ClassName ) \
79  { \
80  FBRegisterObject( ClassName##R1,"Commands",Label,Description,RegisterCommand##ClassName, true, IconFilename ); \
81  FBRegisterObject( ClassName##R2,"FbxStorable/Command",UniqueNameStr,Description,RegisterCommand##ClassName, true, IconFilename ); \
82  FBRegisterObject( ClassName##R3,"Browsing/Templates/Commands",Label,Description,RegisterCommand##ClassName, true, "object_command.tif" ); \
83  } \
84 
85 
89 #define FBCommandDeclare( ClassName, Parent ) \
90  FBClassDeclare( ClassName,Parent); \
91  public: \
92  ClassName(const char* pName):Parent(pName) { FBClassInit; } \
93  private:
94 
98 #define FBCommandImplementation( ThisComponent ) \
99  FBClassImplementation( ThisComponent )
100 
102 // FBCommand
104 __FB_FORWARD( FBCommand );
105 
112 };
113 
119 };
120 
121 
122 FB_DEFINE_ENUM ( FBSDK_DLL, CommandState );
123 FB_DEFINE_ENUM ( FBSDK_DLL, TimeReferential );
125 
129 public:
134  FBCommand(const char* pName = NULL, HIObject pObject = NULL);
135 
136  IObject_Declare(K_IMPLEMENTATION); // Interface to IObject.
137 
139 
143  virtual bool FbxStore ( FBFbxObject* pFbxObject, kFbxObjectStore pStoreWhat );
144  virtual bool FbxRetrieve ( FBFbxObject* pFbxObject, kFbxObjectStore pStoreWhat );
146 
148  virtual void ExecuteNotify();
149 
151  virtual void DragAndDropClearNotify();
152 
156  virtual void DragAndDropAddNotify( FBComponent* pComponent );
157 
161  virtual void RemoveNotify(HIObject pComponent);
162 
168 };
169 
170 #ifdef FBSDKUseNamespace
171  }
172 #endif
173 #endif /* __FBCOMMAND_H */
#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
FBPropertyTimeReferential TimeReferential
Property: What is the time referential of the command?
Definition: fbcommand.h:167
class FBPropertyBase< FBTime, kFBPT_Time > FBPropertyTime
Property: FBTime
#define NULL
Definition: kaydara.h:169
FBPropertyCommandState State
Property: Current state of the command.
Definition: fbcommand.h:166
class FBPropertyBaseEnum< enum FBTimeReferential > FBPropertyTimeReferential
Definition: fbcommand.h:123
#define K_IMPLEMENTATION
Definition: iobject.h:53
FBPropertyString Description
Property: Command description.
Definition: fbcommand.h:163
#define IObject_Declare(IsPure)
Definition: iobject.h:75
Property class: const char * (String).
FBPropertyTime StopTime
Property: Stop time for the command.
Definition: fbcommand.h:165
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
Definition: fbproperties.h:148
FBX file interface.
Definition: fbfbx.h:80
MotionBuilder SDK base class.
Definition: fbcomponent.h:668
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbcommand.h:48
FBCommandState
FBCommandState.
Definition: fbcommand.h:107
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68
#define FBSDKNamespace
FBSDKNamespace define.
Definition: fbversion.h:64
Basic class definitions.
class FBPropertyBaseEnum< enum FBCommandState > FBPropertyCommandState
Definition: fbcommand.h:122
Command class.
Definition: fbcommand.h:127
kFbxObjectStore
Description of the different store/retrieve passes of the FBX format.
Definition: fbtypes.h:74
FBTimeReferential
FBCommandState.
Definition: fbcommand.h:115
FBPropertyTime StartTime
Property: Start time for the command.
Definition: fbcommand.h:164