Open Reality Reference Guide
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
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  Class->mAllocated = true; \
72  if (Class->FBCreate()) { \
73  return Class->GetHIObject(); \
74  } else { \
75  delete Class; \
76  return NULL; \
77  } \
78  } \
79  FBLibraryModule( ClassName ) \
80  { \
81  FBRegisterObject( ClassName##R1,"Commands",Label,Description,RegisterCommand##ClassName, true, IconFilename ); \
82  FBRegisterObject( ClassName##R2,"FbxStorable/Command",UniqueNameStr,Description,RegisterCommand##ClassName, true, IconFilename ); \
83  FBRegisterObject( ClassName##R3,"Browsing/Templates/Commands",Label,Description,RegisterCommand##ClassName, true, "object_command.tif" ); \
84  } \
85 
90 #define FBCommandDeclare( ClassName, Parent ) \
91  FBClassDeclare( ClassName,Parent); \
92  public: \
93  ClassName(const char* pName):Parent(pName) { FBClassInit; } \
94  private:
95 
99 #define FBCommandImplementation( ThisComponent ) \
100  FBClassImplementation( ThisComponent )
101 
103 // FBCommand
106 
113 };
114 
120 };
121 
122 
123 FB_DEFINE_ENUM ( FBSDK_DLL, CommandState );
124 FB_DEFINE_ENUM ( FBSDK_DLL, TimeReferential );
125 FB_DEFINE_COMPONENT ( FBSDK_DLL, Command );
126 
130 public:
135  FBCommand(const char* pName = NULL, HIObject pObject = NULL);
136 
137  IObject_Declare(override); // Interface to IObject.
138 
140 
144  virtual bool FbxStore ( FBFbxObject* pFbxObject, kFbxObjectStore pStoreWhat );
145  virtual bool FbxRetrieve ( FBFbxObject* pFbxObject, kFbxObjectStore pStoreWhat );
147 
149  virtual void ExecuteNotify();
150 
152  virtual void DragAndDropClearNotify();
153 
157  virtual void DragAndDropAddNotify( FBComponent* pComponent );
158 
162  virtual void RemoveNotify(HIObject pComponent);
163 
167  FBPropertyCommandState State;
168  FBPropertyTimeReferential TimeReferential;
169 };
170 
171 #ifdef FBSDKUseNamespace
172  }
173 #endif
174 #endif /* __FBCOMMAND_H */
Command class.
Definition: fbcommand.h:128
virtual bool FbxStore(FBFbxObject *pFbxObject, kFbxObjectStore pStoreWhat)
Storage/Retrieval of information into the FBX file format.
virtual void RemoveNotify(HIObject pComponent)
Remove an item that was added with drag and drop.
FBPropertyTime StopTime
Property: Stop time for the command.
Definition: fbcommand.h:166
virtual void DragAndDropAddNotify(FBComponent *pComponent)
Add an item with drag and drop.
FBPropertyString Description
Property: Command description.
Definition: fbcommand.h:164
FBPropertyTimeReferential TimeReferential
Property: What is the time referential of the command?
Definition: fbcommand.h:168
FBCommand(const char *pName=NULL, HIObject pObject=NULL)
Constructor.
FBPropertyTime StartTime
Property: Start time for the command.
Definition: fbcommand.h:165
virtual void ExecuteNotify()
Execute the command.
virtual void DragAndDropClearNotify()
Clear the command from the dropped items.
FBPropertyCommandState State
Property: Current state of the command.
Definition: fbcommand.h:167
MotionBuilder SDK base class.
Definition: fbcomponent.h:651
FBX file interface.
Definition: fbfbx.h:80
Property class: const char * (String).
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbcommand.h:48
FBCommandState
FBCommandState.
Definition: fbcommand.h:108
@ kFBCommandStateMuteBecauseSolo
Mute because of solo.
Definition: fbcommand.h:112
@ kFBCommandStateSolo
Solo.
Definition: fbcommand.h:111
@ kFBCommandStateStandard
Standard.
Definition: fbcommand.h:109
@ kFBCommandStateMute
Mute.
Definition: fbcommand.h:110
FBTimeReferential
FBCommandState.
Definition: fbcommand.h:116
@ kFBTimeReferentialShot
Shot.
Definition: fbcommand.h:118
@ kFBTimeReferentialEdit
Edit.
Definition: fbcommand.h:119
@ kFBTimeReferentialAction
Action.
Definition: fbcommand.h:117
Basic class definitions.
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:131
FB_DEFINE_COMPONENT(K_DLLIMPORT, AnimationNode)
Animation node class.
class K_DLLIMPORT FBPropertyBase< FBTime, kFBPT_Time > FBPropertyTime
Property: FBTime
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
Definition: fbproperties.h:150
kFbxObjectStore
Description of the different store/retrieve passes of the FBX format.
Definition: fbtypes.h:74
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68