fbsdk/fbmanipulator.h Source File

fbmanipulator.h
Go to the documentation of this file.
1 #ifndef __FBMANIPULATOR_H__
2 #define __FBMANIPULATOR_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 <fbsdk/fbcomponent.h>
52 #include <fbcontrols/fbcontrols.h>
53 
54 #ifdef FBSDKUseNamespace
55  namespace FBSDKNamespace {
56 #endif
57 
58 FB_FORWARD( FBModel );
59 
62 
69 #define FBRegisterManipulator( ClassName, Label, Description, IconFilename ) \
70  HIObject RegisterManipulator##ClassName( HIObject /*pOwner*/,const char* pName,void * /*pData*/) \
71  { \
72  ClassName *Class = new ClassName( Label ); \
73  if (Class->FBCreate()) { \
74  return Class->GetHIObject(); \
75  } else { \
76  delete Class; \
77  return NULL; \
78  } \
79  } \
80  FBLibraryModule( ClassName ) \
81  { \
82  FBRegisterObject( ClassName,"Manipulators",Label,Description,RegisterManipulator##ClassName,true, IconFilename ); \
83  }
84 
89 #define FBManipulatorDeclare( ClassName, Parent ) \
90  FBClassDeclare( ClassName,Parent); \
91  public: \
92  ClassName(const char* pName):Parent(pName) { FBClassInit; } \
93  private:
94 
98 #define FBManipulatorImplementation( ThisComponent ) \
99  FBClassImplementation( ThisComponent )
100 
102 // FBManipulator
109 };
110 
111 __FB_FORWARD( FBManipulator );
112 
116 public:
121  FBManipulator(const char* pName, HIObject pObject=NULL);
122 
123  virtual bool FBCreate ();
124 
125  // ***** Picking routines ******
126  //---- Rectangle -----
127 
131  void PickRectStart(FBManipulatorPickType pType);
132 
134  void PickRectMotion();
135 
137  void PickRectStop();
138 
139  //---- Single Pick -----
140 
144  void Pick(FBManipulatorPickType pType);
145 
146  //---- Pick Result -----
147 
151  int PickGetCount();
152 
157  FBModel* PickGetModel(int pIndex);
158 
163  FBVertex PickGetPoint(int pIndex);
164 
168  int GetViewerWidth();
169 
173  int GetViewerHeight();
174 
178  int GetPanePosX();
179 
183  int GetPanePosY();
184 
188  int GetPaneWidth();
189 
193  int GetPaneHeight();
194 
195  // Render begin/end
201  void FBModelRenderBegin(FBModel* pModel);
202 
204  void FBModelRenderEnd();
205 
215  virtual bool ViewInput(int pMouseX, int pMouseY, FBInputType pAction, int pButtonKey,int pModifier); // same as FBView
216 
220  virtual void ViewExpose();
221 
222 public:
230  // Custom manipulators will be called first, before the standard MotionBuilder manipulators.
231  // Remark: If your manipulator consumes an event, it must consumes all the event until the transaction is finished.
232  // For example, if you consume the mouse down but not the mouse up, the other manipulator might be in an inconsistent state.
233 };
234 
236 // Property list
238 FB_DEFINE_LIST( FBSDK_DLL, Manipulator );
239 
242 {
247  virtual int Add ( FBManipulator* pItem );
251  virtual void RemoveAt( int pIndex );
252 public:
257  virtual FBManipulator* operator[](int pIndex);
261  virtual int GetCount();
262 };
263 
265 // FBManipulatorTransform
268 
269 FB_DEFINE_COMPONENT( FBSDK_DLL, ManipulatorTransform );
270 
277 };
278 
279 FB_DEFINE_ENUM( FBSDK_DLL, ManipulatorTransformType );
280 
284 public:
289  FBManipulatorTransform(const char *pName,HIObject pObject=NULL);
290 
295 };
296 
297 #ifdef FBSDKUseNamespace
298  }
299 #endif
300 #endif
Model class.
Definition: fbmodel.h:273
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:132
FBPropertyBool VertexManipulationEnabled
Property: Is vertex manipulation enabled?
FBPropertyBool AlwaysActive
Read Write Property: Is manipulator always active?
#define FB_DEFINE_COMPONENT(DllTag, Type)
Define a component and give it the ability to be a property.
Definition: fbproperties.h:139
#define FB_DEFINE_LIST(DllTag, Type)
Define a component list.
Definition: fbproperties.h:161
class FBPropertyBaseComponent< FBCamera * > FBPropertyCamera
Definition: fbcamera.h:58
FBPropertyCamera CurrentCamera
Read Only Property: Current camera.
FBPropertyBool VertexSelectionEnabled
Property: Is vertex selection enabled?
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbmanipulator.h:48
FBManipulatorPickType
Types of manipulator picking.
#define NULL
Definition: kaydara.h:169
FBPropertyString ViewerText
Read Write Property: Text displayed in view.
FBInputType
Types of input events.
Definition: fbcontrols.h:117
PropertyList: Manipulator.
Property class: const char * (String).
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
Definition: fbproperties.h:148
Contains the user interface components for the SDK.
MotionBuilder SDK base class.
Definition: fbcomponent.h:668
FBManipulatorTransformType
Manipulator transform stles.
FBPropertyBool Active
Read Write Property: Is manipulator active?
class FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
FBPropertyBool Visible
Read Write Property: Is manipulator visible?
Definition: Python-ast.h:18
FBPropertyBool DefaultBehavior
Read Write Property: Using default manipulator behavior?
class FBVector4< float > FBVertex
Vertex.
Definition: fbtypes.h:597
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68
#define FBSDKNamespace
FBSDKNamespace define.
Definition: fbversion.h:64
class FBPropertyBaseEnum< enum FBManipulatorTransformType > FBPropertyManipulatorTransformType
Basic class definitions.
#define FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:62
FBPropertyManipulatorTransformType Type
Property: Type of selection event.
Manipulator class.
FBPropertyBool IconVisible
Property: Is icon visible?
FBPropertyBool ConsumeEvent
Read Write Property: Is manipulator consuming event? If true, this will prevent other manipulators fr...