Open Reality Reference Guide
fbtool.h
Go to the documentation of this file.
1 #ifndef __FBTOOL_H__
2 #define __FBTOOL_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 <fbcontrols/fbcontrols.h>
52 
53 #ifdef FBSDKUseNamespace
54 namespace FBSDKNamespace {;
55 #endif
56 
58 // FBTool
60 
66 #define FBRegisterTool( ClassName, Label, Description, IconFilename ) \
67  static HIObject RegisterTool##ClassName( HIObject pOwner,const char* pName,void * pData) \
68 {\
69  ClassName *Class = new ClassName( Label ); \
70  Class->mAllocated = true; \
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,"UI/Tools",Label,Description,RegisterTool##ClassName, false, IconFilename );\
81 }
82 
87 #define FBToolDeclare( ClassName,Parent ) \
88  FBClassDeclare( ClassName,Parent ); \
89 public: \
90  ClassName(const char *pName=NULL):Parent(pName) { FBClassInit; } \
91 private:
92 
96 #define FBToolImplementation( ThisComponent ) \
97  FBClassImplementation( ThisComponent )
98 
101 
102 enum FBToolPossibleDockPosition
103 {
104  kFBToolPossibleDockPosNone = 0,
105  kFBToolPossibleDockPosTop = (1 << 0),
106  kFBToolPossibleDockPosLeft = (1 << 1),
107  kFBToolPossibleDockPosRight = (1 << 2),
108  kFBToolPossibleDockPosBottom = (1 << 3),
109 };
110 
112 class FBSDK_DLL FBTool : public FBLayout {
114 public:
118  FBTool(const char* pName = NULL);
119 
124  FBTool(const char* pName, bool pRegisterTool);
125 
129  virtual void Destroy(int pIsLocal) override;
131 
135  virtual bool FbxStore ( FBFbxObject* pFbxObject, kFbxObjectStore pStoreWhat );
136  virtual bool FbxRetrieve ( FBFbxObject* pFbxObject, kFbxObjectStore pStoreWhat );
138 
142  FBToolPossibleDockPosition GetPossibleDockPosition();
143 
147  void SetPossibleDockPosition(FBToolPossibleDockPosition pFlags);
148 
149  IQuery_Declare(override); // Interface to IObject.
150 
151  FBPropertyInt StartSize [2];
152  FBPropertyInt MaxSize [2];
153  FBPropertyInt MinSize [2];
154  FBPropertyInt StartPos [2];
157 private:
158 
159  void InitTool();
160 };
161 
167 FBSDK_DLL bool FBPopNormalTool( const char* pToolName, bool pSetFocus = true );
168 
174 FBSDK_DLL FBTool* FBShowToolByName( const char* pToolName, bool pResizeWnd = true );
175 
181 FBSDK_DLL FBTool* FBShowTool( FBTool* pTool, bool pResizeWnd = true );
182 
187 FBSDK_DLL bool FBCloseToolByName( const char* pToolName );
188 
193 FBSDK_DLL bool FBCloseTool( FBTool* pTool );
194 
198 FBSDK_DLL void FBDestroyToolByName( const char* pToolName );
199 
204 
210 FBSDK_DLL void FBSetToolSizeByName( const char* pToolName, int pWidth, int pHeight );
211 
217 FBSDK_DLL void FBSetToolSize( FBTool* pTool, int pWidth, int pHeight );
218 
224 FBSDK_DLL void FBGetToolSizeByName( const char* pToolName, int &pWidth, int &pHeight );
225 
231 FBSDK_DLL void FBGetToolSize( FBTool* pTool, int &pWidth, int &pHeight );
232 
238 FBSDK_DLL void FBSetToolPositionByName( const char* pToolName, int pPosX, int pPosY );
239 
245 FBSDK_DLL void FBSetToolPosition( FBTool* pTool, int pPosX, int pPosY );
246 
252 FBSDK_DLL void FBGetToolPositionByName( const char* pToolName, int &pPosX, int &pPosY );
253 
259 FBSDK_DLL void FBGetToolPosition( FBTool* pTool, int &pPosX, int &pPosY );
260 
261 #ifdef FBSDKUseNamespace
262 }
263 #endif
264 #endif /* __FBTOOL_H */
kFbxObjectStore
kFbxObjectStore
Description of the different store/retrieve passes of the FBX format.
Definition: fbtypes.h:74
FBDestroyToolByName
K_DLLIMPORT void FBDestroyToolByName(const char *pToolName)
This function will destroy a specific tool in the GUI.
FBPropertyInt
class K_DLLIMPORT FBPropertyBase< int, kFBPT_int > FBPropertyInt
Property: int
Definition: fbproperties.h:1331
FBSDK_DLL
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbtool.h:48
FBSetToolSizeByName
K_DLLIMPORT void FBSetToolSizeByName(const char *pToolName, int pWidth, int pHeight)
This function will set the size of a specific tool in the GUI.
FBTool::SetPossibleDockPosition
void SetPossibleDockPosition(FBToolPossibleDockPosition pFlags)
Set the possible docking position for the tool.
FBShowToolByName
K_DLLIMPORT FBTool * FBShowToolByName(const char *pToolName, bool pResizeWnd=true)
This function will show a specific tool in the GUI.
__FBClassDeclare
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:131
__FB_FORWARD
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68
FBTool::FBTool
FBTool(const char *pName=NULL)
Constructor.
FBCloseTool
K_DLLIMPORT bool FBCloseTool(FBTool *pTool)
This function will close a specific tool in the GUI.
FBShowTool
K_DLLIMPORT FBTool * FBShowTool(FBTool *pTool, bool pResizeWnd=true)
This function will show a specific tool in the GUI.
FBTool::GetPossibleDockPosition
FBToolPossibleDockPosition GetPossibleDockPosition()
Get the possible docking position for the tool (concatenated).
FBTool
Tool class.
Definition: fbtool.h:112
FBLayout
Used to build the user interface.
Definition: fbcontrols.h:781
FBSetToolPositionByName
K_DLLIMPORT void FBSetToolPositionByName(const char *pToolName, int pPosX, int pPosY)
This function will set the position of a specific tool.
FBTool::FBTool
FBTool(const char *pName, bool pRegisterTool)
Constructor used when creating tools not in the Tools menu of MotionBuilder.
FBTool::Destroy
virtual void Destroy(int pIsLocal) override
Redefine Custom Destroy function.
FBDestroyTool
K_DLLIMPORT void FBDestroyTool(FBTool *pTool)
This function will destroy a specific tool in the GUI.
FBGetToolPositionByName
K_DLLIMPORT void FBGetToolPositionByName(const char *pToolName, int &pPosX, int &pPosY)
This function will get the position of a specific tool.
FBTool::DisplayName
FBPropertyString DisplayName
Read Write Property: Tool Display Name (Caption on the tool's title bar)
Definition: fbtool.h:156
FBSetToolSize
K_DLLIMPORT void FBSetToolSize(FBTool *pTool, int pWidth, int pHeight)
This function will set the size of a specific tool in the GUI.
FBGetToolSizeByName
K_DLLIMPORT void FBGetToolSizeByName(const char *pToolName, int &pWidth, int &pHeight)
This function will get the size of a specific tool in the GUI.
FB_FORWARD
#define FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:62
fbcontrols.h
Contains the user interface components for the SDK.
FBGetToolSize
K_DLLIMPORT void FBGetToolSize(FBTool *pTool, int &pWidth, int &pHeight)
This function will get the size of a specific tool in the GUI.
FBTool::FbxStore
virtual bool FbxStore(FBFbxObject *pFbxObject, kFbxObjectStore pStoreWhat)
Storage/Retrieval of information into the FBX file format.
FBTool::Name
FBPropertyString Name
Read-Only Property: Tool Name
Definition: fbtool.h:155
FBCloseToolByName
K_DLLIMPORT bool FBCloseToolByName(const char *pToolName)
This function will close a specific tool in the GUI.
FBSetToolPosition
K_DLLIMPORT void FBSetToolPosition(FBTool *pTool, int pPosX, int pPosY)
This function will set the position of a specific tool.
FBPopNormalTool
K_DLLIMPORT bool FBPopNormalTool(const char *pToolName, bool pSetFocus=true)
This function is used to bring up a specific tool in the GUI.
FBFbxObject
FBX file interface.
Definition: fbfbx.h:80
FBPropertyString
Property class: const char * (String).
Definition: fbproperties.h:1281
FBGetToolPosition
K_DLLIMPORT void FBGetToolPosition(FBTool *pTool, int &pPosX, int &pPosY)
This function will get the position of a specific tool.