Open Reality Reference Guide
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 
59 
60 FB_DEFINE_COMPONENT( FBSDK_DLL, Manipulator );
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  Class->mAllocated = true; \
74  if (Class->FBCreate()) { \
75  return Class->GetHIObject(); \
76  } else { \
77  delete Class; \
78  return NULL; \
79  } \
80  } \
81  FBLibraryModule( ClassName ) \
82  { \
83  FBRegisterObject( ClassName,"Manipulators",Label,Description,RegisterManipulator##ClassName,true, IconFilename ); \
84  }
85 
90 #define FBManipulatorDeclare( ClassName, Parent ) \
91  FBClassDeclare( ClassName,Parent); \
92  public: \
93  ClassName(const char* pName):Parent(pName) { FBClassInit; } \
94  private:
95 
99 #define FBManipulatorImplementation( ThisComponent ) \
100  FBClassImplementation( ThisComponent )
101 
103 // FBManipulator
110 };
111 
113 
117 public:
122  FBManipulator(const char* pName, HIObject pObject=NULL);
123 
124  virtual bool FBCreate () override;
125 
126  // ***** Picking routines ******
127  //---- Rectangle -----
128 
133 
136 
138  void PickRectStop();
139 
140  //---- Single Pick -----
141 
146 
147  //---- Pick Result -----
148 
153 
158  FBModel* PickGetModel(int pIndex);
159 
164  FBVertex PickGetPoint(int pIndex);
165 
170 
175 
179  int GetPanePosX();
180 
184  int GetPanePosY();
185 
190 
195 
196  // Render begin/end
203 
206 
216  virtual bool ViewInput(int pMouseX, int pMouseY, FBInputType pAction, int pButtonKey,int pModifier); // same as FBView
217 
221  virtual void ViewExpose();
222 
223 public:
229  FBPropertyCamera CurrentCamera;
231  // Custom manipulators will be called first, before the standard MotionBuilder manipulators.
232  // Remark: If your manipulator consumes an event, it must consumes all the event until the transaction is finished.
233  // For example, if you consume the mouse down but not the mouse up, the other manipulator might be in an inconsistent state.
234 };
235 
237 // Property list
239 FB_DEFINE_LIST( FBSDK_DLL, Manipulator );
240 
243 {
248  virtual int Add ( FBManipulator* pItem );
252  virtual void RemoveAt( int pIndex );
253 public:
258  virtual FBManipulator* operator[](int pIndex);
262  virtual int GetCount();
263 };
264 
266 // FBManipulatorTransform
269 
270 FB_DEFINE_COMPONENT( FBSDK_DLL, ManipulatorTransform );
271 
278 };
279 
280 FB_DEFINE_ENUM( FBSDK_DLL, ManipulatorTransformType );
281 
285 public:
290  FBManipulatorTransform(const char *pName,HIObject pObject=NULL);
291 
292  FBPropertyManipulatorTransformType Type;
296 };
297 
298 #ifdef FBSDKUseNamespace
299  }
300 #endif
301 #endif
FBVertex
class K_DLLIMPORT FBVector4< float > FBVertex
Vertex.
Definition: fbtypes.h:597
kFBManipulatorTransformRotation
@ kFBManipulatorTransformRotation
Rotation manipulator.
Definition: fbmanipulator.h:276
FB_DEFINE_ENUM
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
Definition: fbproperties.h:150
FBManipulator::ViewerText
FBPropertyString ViewerText
Read Write Property: Text displayed in view.
Definition: fbmanipulator.h:228
FBManipulator::FBModelRenderBegin
void FBModelRenderBegin(FBModel *pModel)
Transform the current matrix to the reference of a given model.
FBManipulatorTransform::VertexSelectionEnabled
FBPropertyBool VertexSelectionEnabled
Property: Is vertex selection enabled?
Definition: fbmanipulator.h:294
FBPickObjects
@ FBPickObjects
Pick objects.
Definition: fbmanipulator.h:107
FBManipulator::GetPanePosY
int GetPanePosY()
Get sub-pane origin Y offset from the viewer origin.
FBManipulatorPickType
FBManipulatorPickType
Types of manipulator picking.
Definition: fbmanipulator.h:106
FBManipulator::PickRectStart
void PickRectStart(FBManipulatorPickType pType)
Pick rectangle start.
FBManipulator::PickGetCount
int PickGetCount()
Get number of items picked.
FBSDK_DLL
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbmanipulator.h:48
FBManipulator::Active
FBPropertyBool Active
Read Write Property: Is manipulator active?
Definition: fbmanipulator.h:224
FBManipulator::FBModelRenderEnd
void FBModelRenderEnd()
End model matrix sequence.
FBManipulator::GetPanePosX
int GetPanePosX()
Get sub-pane origin X offset from the viewer origin.
FBManipulatorTransform::Type
FBPropertyManipulatorTransformType Type
Property: Type of selection event.
Definition: fbmanipulator.h:292
FBManipulator::Visible
FBPropertyBool Visible
Read Write Property: Is manipulator visible?
Definition: fbmanipulator.h:226
FBManipulator::DefaultBehavior
FBPropertyBool DefaultBehavior
Read Write Property: Using default manipulator behavior?
Definition: fbmanipulator.h:227
FBManipulator::FBManipulator
FBManipulator(const char *pName, HIObject pObject=NULL)
Constructor.
__FBClassDeclare
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:131
FBPropertyListManipulator
PropertyList: Manipulator.
Definition: fbmanipulator.h:243
FBManipulator::PickRectMotion
void PickRectMotion()
Pick rectangle motion.
__FB_FORWARD
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68
FBPropertyBaseList
Definition: fbproperties.h:893
FBManipulator::GetPaneWidth
int GetPaneWidth()
Get sub-pane width.
FBManipulator::ViewInput
virtual bool ViewInput(int pMouseX, int pMouseY, FBInputType pAction, int pButtonKey, int pModifier)
Input function.
FBManipulatorTransform::VertexManipulationEnabled
FBPropertyBool VertexManipulationEnabled
Property: Is vertex manipulation enabled?
Definition: fbmanipulator.h:295
FBManipulator::FBCreate
virtual bool FBCreate() override
Open Reality Creation function.
FBInputType
FBInputType
Types of input events.
Definition: fbcontrols.h:123
FBManipulator::PickRectStop
void PickRectStop()
Stop rectangle pick.
FBManipulator::ViewExpose
virtual void ViewExpose()
Expose function.
FBManipulator::PickGetPoint
FBVertex PickGetPoint(int pIndex)
Get point at pIndex on pick path in 3D.
FBManipulator::CurrentCamera
FBPropertyCamera CurrentCamera
Read Only Property: Current camera.
Definition: fbmanipulator.h:229
FBPropertyBool
class K_DLLIMPORT FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
Definition: fbproperties.h:1308
FBManipulatorTransform::FBManipulatorTransform
FBManipulatorTransform(const char *pName, HIObject pObject=NULL)
Constructor.
fbcomponent.h
Basic class definitions.
FBManipulatorTransformType
FBManipulatorTransformType
Manipulator transform stles.
Definition: fbmanipulator.h:273
FBManipulator::PickGetModel
FBModel * PickGetModel(int pIndex)
Get model at index pIndex in list of picked items.
FBManipulator::GetViewerWidth
int GetViewerWidth()
Get rendering area width.
FB_DEFINE_LIST
#define FB_DEFINE_LIST(DllTag, Type)
Define a component list.
Definition: fbproperties.h:163
FBPropertyListManipulator::GetCount
virtual int GetCount()
Get the number of manipulators.
FBManipulator
Manipulator class.
Definition: fbmanipulator.h:115
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.
FBManipulator::Pick
void Pick(FBManipulatorPickType pType)
Single pick.
FB_DEFINE_COMPONENT
FB_DEFINE_COMPONENT(K_DLLIMPORT, AnimationNode)
Animation node class.
FBManipulator::GetPaneHeight
int GetPaneHeight()
Get sub-pane height.
FBManipulatorTransform::IconVisible
FBPropertyBool IconVisible
Property: Is icon visible?
Definition: fbmanipulator.h:293
FBManipulator::ConsumeEvent
FBPropertyBool ConsumeEvent
Read Write Property: Is manipulator consuming event? If true, this will prevent other manipulators fr...
Definition: fbmanipulator.h:230
kFBManipulatorTransformScaling
@ kFBManipulatorTransformScaling
Scaling manipulator.
Definition: fbmanipulator.h:277
FBPropertyString
Property class: const char * (String).
Definition: fbproperties.h:1281
FBModel
Model class.
Definition: fbmodel.h:274
FBPropertyListManipulator::operator[]
virtual FBManipulator * operator[](int pIndex)
Get the manipulator at a given index.
FBComponent
MotionBuilder SDK base class.
Definition: fbcomponent.h:651
FBManipulator::AlwaysActive
FBPropertyBool AlwaysActive
Read Write Property: Is manipulator always active?
Definition: fbmanipulator.h:225
kFBManipulatorTransformNone
@ kFBManipulatorTransformNone
No manipulator.
Definition: fbmanipulator.h:274
FBPickPoints
@ FBPickPoints
Pick points.
Definition: fbmanipulator.h:108
FBManipulator::GetViewerHeight
int GetViewerHeight()
Get rendering area height.
FBManipulatorTransform
Manipulator class.
Definition: fbmanipulator.h:283
FBPickSurfaces
@ FBPickSurfaces
Pick surfaces.
Definition: fbmanipulator.h:109
kFBManipulatorTransformTranslation
@ kFBManipulatorTransformTranslation
Translation manipulator.
Definition: fbmanipulator.h:275