Open Reality Reference Guide
 
Loading...
Searching...
No Matches
fbapplymanagerrule.h
Go to the documentation of this file.
1#ifndef __FBAPPLYMANAGERRULE_H__
2#define __FBAPPLYMANAGERRULE_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
44#include <kaydaradef.h>
45#ifndef FBSDK_DLL
49#define FBSDK_DLL K_DLLIMPORT
50#endif
51
52#include <fbsdk/fbcomponent.h>
53
54#ifdef FBSDKUseNamespace
55namespace FBSDKNamespace {
56#endif
57
60
61 FB_DEFINE_COMPONENT( FBSDK_DLL, ApplyManagerRule);
62
68#define FBRegisterApplyManagerRule( ClassName, Label, Description ) \
69 HIObject RegisterApplyManagerRule##ClassName( HIObject pOwner,const char * /*pName*/,void * /*pData*/) \
70 { \
71 ClassName *Class = new ClassName( ); \
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,"Browsing/Apply",Label,Description,RegisterApplyManagerRule##ClassName,false, NULL ); \
82 }
83
88#define FBApplyManagerRuleDeclare( ClassName, Parent ) \
89 FBClassDeclare( ClassName,Parent); \
90public: \
91 ClassName( HIObject pO = NULL ):Parent(pO) { FBClassInit; } \
92private:
93
97#define FBApplyManagerRuleImplementation( ThisComponent ) \
98 FBClassImplementation( ThisComponent )
99
100
102 // FBApplyManagerRule - ApplyManagerRule layer on top of internals.
104
115 {
116 //--- Open Reality declaration.
118
119 public:
123 FBApplyManagerRule( HIObject pObject = NULL );
124
129 virtual bool IsValidSrc( FBComponent* /*pSrc*/) { return false; }
130
142 virtual bool IsValidConnection( FBComponent* pSrc, FBComponent*& pDst, bool& pAllowMultiple) { return false; }
143
150 virtual bool MenuBuild( FBAMMenu* pAMMenu, FBComponent* pFocusedObject) { return false; }
151
158 virtual bool MenuAction( int pMenuId, FBComponent* pFocusedObject) { return false; }
159 };
160
162 // FBAMMenu
164
168 {
169 //--- Open Reality declaration.
171 public:
172
177 FBAMMenu(const char* pName, HIObject pObject=NULL);
178
186 int AddOption( const char* pMenuOptions, int pId = -1, bool pEnable = false );
187 };
188
189#ifdef FBSDKUseNamespace
190}
191#endif
192#endif /* _FB_FILTER_H_ */
Context menu.
int AddOption(const char *pMenuOptions, int pId=-1, bool pEnable=false)
Add menu option item on this menu.
FBAMMenu(const char *pName, HIObject pObject=NULL)
Constructor.
ApplyManagerRules are used to define custom rules for manipulating custom objects.
virtual bool MenuAction(int pMenuId, FBComponent *pFocusedObject)
Perform action if the added menu item is clicked.
virtual bool IsValidSrc(FBComponent *)
Return true if pSrc is the type of custom object which this rule to be defined for.
virtual bool IsValidConnection(FBComponent *pSrc, FBComponent *&pDst, bool &pAllowMultiple)
Return true if pDst is the type of custom or MB object which your custom object pSrc will be applied ...
virtual bool MenuBuild(FBAMMenu *pAMMenu, FBComponent *pFocusedObject)
Build context menu for the type of custom object.
FBApplyManagerRule(HIObject pObject=NULL)
Constructor.
MotionBuilder SDK base class.
Basic class definitions.
#define __FBClassDeclare(Name, Parent)
For internal use only.
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
#define FB_DEFINE_COMPONENT(DllTag, Type)
Define a component and give it the ability to be a property.
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition fbtypes.h:68