Go to the
documentation of this file.
00001 #ifndef __FBMANIPULATOR_H__
00002 #define __FBMANIPULATOR_H__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00043 #include <kaydaradef.h>
00044 #ifndef FBSDK_DLL
00045
00048 #define FBSDK_DLL K_DLLIMPORT
00049 #endif
00050
00051 #include <fbsdk/fbcomponent.h>
00052 #include <fbcontrols/fbcontrols.h>
00053
00054 #ifdef FBSDKUseNamespace
00055 namespace FBSDKNamespace {
00056 #endif
00057
00058 FB_FORWARD( FBModel );
00059
00060 FB_DEFINE_COMPONENT( FBSDK_DLL, Manipulator );
00061 FB_DEFINE_COMPONENT( FBSDK_DLL, Camera );
00062
00069 #define FBRegisterManipulator( ClassName, Label, Description, IconFilename ) \
00070 HIObject RegisterManipulator##ClassName( HIObject ,char * pName,void * ) \
00071 { \
00072 ClassName *Class = new ClassName( Label ); \
00073 if (Class->FBCreate()) { \
00074 return Class->GetHIObject(); \
00075 } else { \
00076 delete Class; \
00077 return NULL; \
00078 } \
00079 } \
00080 FBLibraryModule( ClassName ) \
00081 { \
00082 FBRegisterObject( ClassName,"Manipulators",Label,Description,RegisterManipulator##ClassName,true, IconFilename ); \
00083 }
00084
00089 #define FBManipulatorDeclare( ClassName, Parent ) \
00090 FBClassDeclare( ClassName,Parent); \
00091 public: \
00092 ClassName(char * pName):Parent(pName) { FBClassInit; } \
00093 private:
00094
00098 #define FBManipulatorImplementation( ThisComponent ) \
00099 FBClassImplementation( ThisComponent )
00100
00102
00105 enum FBManipulatorPickType {
00106 FBPickObjects,
00107 FBPickPoints,
00108 FBPickSurfaces
00109 };
00110
00111 __FB_FORWARD( FBManipulator );
00112
00114 class FBSDK_DLL FBManipulator : public FBComponent {
00115 __FBClassDeclare( FBManipulator,FBComponent );
00116 public:
00121 FBManipulator(char *pName, HIObject pObject=NULL);
00122
00123 virtual bool FBCreate ();
00124
00125
00126
00127
00131 void PickRectStart(FBManipulatorPickType pType);
00132
00134 void PickRectMotion();
00135
00137 void PickRectStop();
00138
00139
00140
00144 void Pick(FBManipulatorPickType pType);
00145
00146
00147
00151 int PickGetCount();
00152
00157 HFBModel PickGetModel(int pIndex);
00158
00163 FBVertex PickGetPoint(int pIndex);
00164
00168 int GetViewerWidth();
00169
00173 int GetViewerHeight();
00174
00178 int GetPanePosX();
00179
00183 int GetPanePosY();
00184
00188 int GetPaneWidth();
00189
00193 int GetPaneHeight();
00194
00195
00201 void FBModelRenderBegin(HFBModel pModel);
00202
00204 void FBModelRenderEnd();
00205
00215 virtual bool ViewInput(int pMouseX, int pMouseY, FBInputType pAction, int pButtonKey,int pModifier);
00216
00220 virtual void ViewExpose();
00221
00222 public:
00223 FBPropertyBool Active;
00224 FBPropertyBool AlwaysActive;
00225 FBPropertyBool Visible;
00226 FBPropertyBool DefaultBehavior;
00227 FBPropertyString ViewerText;
00228 FBPropertyCamera CurrentCamera;
00229 };
00230
00232
00234 FB_DEFINE_LIST( FBSDK_DLL, Manipulator );
00235
00237 class FBSDK_DLL FBPropertyListManipulator : public FBPropertyBaseList< HFBManipulator >
00238 {
00243 virtual int Add ( HFBManipulator pItem );
00247 virtual void RemoveAt( int pIndex );
00248 public:
00253 virtual HFBManipulator operator[](int pIndex);
00257 virtual int GetCount();
00258 };
00259
00261
00263 __FB_FORWARD( FBManipulatorTransform );
00264
00265 FB_DEFINE_COMPONENT( FBSDK_DLL, ManipulatorTransform );
00266
00268 enum FBManipulatorTransformType {
00269 kFBManipulatorTransformNone,
00270 kFBManipulatorTransformTranslation,
00271 kFBManipulatorTransformRotation,
00272 kFBManipulatorTransformScaling
00273 };
00274
00275 FB_DEFINE_ENUM( FBSDK_DLL, ManipulatorTransformType );
00276
00278 class FBSDK_DLL FBManipulatorTransform : public FBManipulator {
00279 __FBClassDeclare( FBManipulatorTransform,FBManipulator );
00280 public:
00285 FBManipulatorTransform(char *pName,HIObject pObject=NULL);
00286
00287 FBPropertyManipulatorTransformType Type;
00288 FBPropertyBool IconVisible;
00289 FBPropertyBool VertexSelectionEnabled;
00290 FBPropertyBool VertexManipulationEnabled;
00291 };
00292
00293 #ifdef FBSDKUseNamespace
00294 }
00295 #endif
00296 #endif