Open Reality Reference Guide
fbapplymanagerrule.h
Go to the documentation of this file.
1 #ifndef __FBAPPLYMANAGERRULE_H__
2 #define __FBAPPLYMANAGERRULE_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 
44 #include <kaydaradef.h>
45 #ifndef FBSDK_DLL
46 
49 #define FBSDK_DLL K_DLLIMPORT
50 #endif
51 
52 #include <fbsdk/fbcomponent.h>
53 
54 #ifdef FBSDKUseNamespace
55 namespace 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); \
90 public: \
91  ClassName( HIObject pO = NULL ):Parent(pO) { FBClassInit; } \
92 private:
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_ */
FBApplyManagerRule::FBApplyManagerRule
FBApplyManagerRule(HIObject pObject=NULL)
Constructor.
FBApplyManagerRule::MenuAction
virtual bool MenuAction(int pMenuId, FBComponent *pFocusedObject)
Perform action if the added menu item is clicked.
Definition: fbapplymanagerrule.h:158
FBAMMenu::FBAMMenu
FBAMMenu(const char *pName, HIObject pObject=NULL)
Constructor.
FBAMMenu
Context menu.
Definition: fbapplymanagerrule.h:168
__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
FBSDK_DLL
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbapplymanagerrule.h:49
FBApplyManagerRule::IsValidSrc
virtual bool IsValidSrc(FBComponent *)
Return true if pSrc is the type of custom object which this rule to be defined for.
Definition: fbapplymanagerrule.h:129
FBApplyManagerRule::MenuBuild
virtual bool MenuBuild(FBAMMenu *pAMMenu, FBComponent *pFocusedObject)
Build context menu for the type of custom object.
Definition: fbapplymanagerrule.h:150
fbcomponent.h
Basic class definitions.
FBApplyManagerRule
ApplyManagerRules are used to define custom rules for manipulating custom objects.
Definition: fbapplymanagerrule.h:115
FB_DEFINE_COMPONENT
FB_DEFINE_COMPONENT(K_DLLIMPORT, AnimationNode)
Animation node class.
FBAMMenu::AddOption
int AddOption(const char *pMenuOptions, int pId=-1, bool pEnable=false)
Add menu option item on this menu.
FBApplyManagerRule::IsValidConnection
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 ...
Definition: fbapplymanagerrule.h:142
FBComponent
MotionBuilder SDK base class.
Definition: fbcomponent.h:651