Open Reality Reference Guide
fbtool.h
Go to the documentation of this file.
1#ifndef __FBTOOL_H__
2#define __FBTOOL_H__
3/**************************************************************************
4Copyright (c) 1994 - 2009 Autodesk, Inc. and/or its licensors.
5All Rights Reserved.
6
7The coded instructions, statements, computer programs, and/or related
8material (collectively the "Data") in these files contain unpublished
9information proprietary to Autodesk, Inc. and/or its licensors, which is
10protected by Canada and United States of America federal copyright law
11and by international treaties.
12
13The Data may not be disclosed or distributed to third parties, in whole
14or in part, without the prior written consent of Autodesk, Inc.
15("Autodesk").
16
17THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
18ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
19WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR
20ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES
21OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
22PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT
23WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR
24FREE.
25
26IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
27OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR
28EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE
29DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS
30OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR
31DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF
32LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT
33LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE
34DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS
35BEEN 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
52
53#ifdef FBSDKUseNamespace
54namespace 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 ); \
89public: \
90 ClassName(const char *pName=NULL):Parent(pName) { FBClassInit; } \
91private:
92
96#define FBToolImplementation( ThisComponent ) \
97 FBClassImplementation( ThisComponent )
98
101
102enum FBToolPossibleDockPosition
103{
104 kFBToolPossibleDockPosNone = 0,
105 kFBToolPossibleDockPosTop = (1 << 0),
106 kFBToolPossibleDockPosLeft = (1 << 1),
107 kFBToolPossibleDockPosRight = (1 << 2),
108 kFBToolPossibleDockPosBottom = (1 << 3),
109};
110
112class FBSDK_DLL FBTool : public FBLayout {
114public:
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];
157private:
158
159 void InitTool();
160};
161
167FBSDK_DLL bool FBPopNormalTool( const char* pToolName, bool pSetFocus = true );
168
174FBSDK_DLL FBTool* FBShowToolByName( const char* pToolName, bool pResizeWnd = true );
175
181FBSDK_DLL FBTool* FBShowTool( FBTool* pTool, bool pResizeWnd = true );
182
187FBSDK_DLL bool FBCloseToolByName( const char* pToolName );
188
194
198FBSDK_DLL void FBDestroyToolByName( const char* pToolName );
199
204
210FBSDK_DLL void FBSetToolSizeByName( const char* pToolName, int pWidth, int pHeight );
211
217FBSDK_DLL void FBSetToolSize( FBTool* pTool, int pWidth, int pHeight );
218
224FBSDK_DLL void FBGetToolSizeByName( const char* pToolName, int &pWidth, int &pHeight );
225
231FBSDK_DLL void FBGetToolSize( FBTool* pTool, int &pWidth, int &pHeight );
232
238FBSDK_DLL void FBSetToolPositionByName( const char* pToolName, int pPosX, int pPosY );
239
245FBSDK_DLL void FBSetToolPosition( FBTool* pTool, int pPosX, int pPosY );
246
252FBSDK_DLL void FBGetToolPositionByName( const char* pToolName, int &pPosX, int &pPosY );
253
259FBSDK_DLL void FBGetToolPosition( FBTool* pTool, int &pPosX, int &pPosY );
260
261#ifdef FBSDKUseNamespace
262}
263#endif
264#endif /* __FBTOOL_H */
FBX file interface.
Definition: fbfbx.h:80
Used to build the user interface.
Definition: fbcontrols.h:781
Property class: const char * (String).
Tool class.
Definition: fbtool.h:112
virtual void Destroy(int pIsLocal) override
Redefine Custom Destroy function.
FBTool(const char *pName, bool pRegisterTool)
Constructor used when creating tools not in the Tools menu of MotionBuilder.
FBTool(const char *pName=NULL)
Constructor.
FBPropertyString DisplayName
Read Write Property: Tool Display Name (Caption on the tool's title bar)
Definition: fbtool.h:156
FBPropertyString Name
Read-Only Property: Tool Name
Definition: fbtool.h:155
virtual bool FbxStore(FBFbxObject *pFbxObject, kFbxObjectStore pStoreWhat)
Storage/Retrieval of information into the FBX file format.
FBToolPossibleDockPosition GetPossibleDockPosition()
Get the possible docking position for the tool (concatenated).
void SetPossibleDockPosition(FBToolPossibleDockPosition pFlags)
Set the possible docking position for the tool.
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:131
Contains the user interface components for the SDK.
class K_DLLIMPORT FBPropertyBase< int, kFBPT_int > FBPropertyInt
Property: int
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbtool.h:48
K_DLLIMPORT void FBGetToolPositionByName(const char *pToolName, int &pPosX, int &pPosY)
This function will get the position of a specific tool.
K_DLLIMPORT void FBGetToolSize(FBTool *pTool, int &pWidth, int &pHeight)
This function will get the size of a specific tool in the GUI.
K_DLLIMPORT void FBSetToolSize(FBTool *pTool, int pWidth, int pHeight)
This function will set the size of a specific tool in the GUI.
K_DLLIMPORT void FBGetToolPosition(FBTool *pTool, int &pPosX, int &pPosY)
This function will get the position of a specific tool.
K_DLLIMPORT bool FBCloseToolByName(const char *pToolName)
This function will close a specific tool in the GUI.
K_DLLIMPORT bool FBCloseTool(FBTool *pTool)
This function will close a specific tool in the GUI.
K_DLLIMPORT FBTool * FBShowTool(FBTool *pTool, bool pResizeWnd=true)
This function will show a specific tool in the GUI.
K_DLLIMPORT void FBDestroyToolByName(const char *pToolName)
This function will destroy a specific tool in the GUI.
K_DLLIMPORT void FBSetToolPosition(FBTool *pTool, int pPosX, int pPosY)
This function will set the position of a specific tool.
K_DLLIMPORT void FBSetToolPositionByName(const char *pToolName, int pPosX, int pPosY)
This function will set the position of a specific tool.
K_DLLIMPORT void FBSetToolSizeByName(const char *pToolName, int pWidth, int pHeight)
This function will set the size of a specific tool in the GUI.
K_DLLIMPORT void FBGetToolSizeByName(const char *pToolName, int &pWidth, int &pHeight)
This function will get the size of a specific tool in the GUI.
K_DLLIMPORT void FBDestroyTool(FBTool *pTool)
This function will destroy a specific tool in the GUI.
K_DLLIMPORT FBTool * FBShowToolByName(const char *pToolName, bool pResizeWnd=true)
This function will show a specific tool in the GUI.
K_DLLIMPORT bool FBPopNormalTool(const char *pToolName, bool pSetFocus=true)
This function is used to bring up a specific tool in the GUI.
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:62
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68