00001 #ifndef __FBRENDERER_H__
00002 #define __FBRENDERER_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 #if !defined(K_NO_MANIPULATOR)
00052 #include <fbsdk/fbmanipulator.h>
00053 #endif
00054
00055 #include <fbsdk/fbcomponent.h>
00056 #include <fbsdk/fbmodel.h>
00057 #include <fbcontrols/fbcontrols.h>
00058
00059 #ifdef FBSDKUseNamespace
00060 namespace FBSDKNamespace {
00061 #endif
00062
00063 __FB_FORWARD( FBRenderer );
00064 FB_FORWARD( FBView );
00065
00066 FB_DEFINE_COMPONENT( FBSDK_DLL, Renderer );
00067
00068 FB_FORWARD( FBViewingOptions );
00069
00071 enum FBDisplayMode {
00072 kFBDisplayModeDefault = 0,
00073 kFBDisplayModeTexture,
00074 kFBDisplayModeHardShade,
00075 kFBDisplayModeFlatShade,
00076 kFBDisplayModeWireFrame,
00077 kFBDisplayModeCount
00078 };
00079
00080 enum FBStereoDisplayMode
00081 {
00082 kFBStereoDisplayCenterEye = 0,
00083 kFBStereoDisplayLeftEye,
00084 kFBStereoDisplayRightEye,
00085 kFBStereoDisplayActive,
00086 kFBStereoDisplayHorizontalInterlace,
00087 kFBStereoDisplayCheckerboard,
00088 kFBStereoDisplayAnaglyph,
00089 kFBStereoDisplayAnaglyphLuminance,
00090 kFBStereoDisplayFreeviewParallel,
00091 kFBStereoDisplayFreeviewCrossed,
00092 kFBStereoDisplayModeCount = 10
00093 };
00094
00096
00099 enum FBDisplayWhat {
00100 kFBDisplayNone = 0,
00101 kFBDisplayNull = (1 << 0),
00102 kFBDisplayMarker = (1 << 1),
00103 kFBDisplaySkeleton = (1 << 2),
00104 kFBDisplayCenter = (1 << 3),
00105 kFBDisplayLight = (1 << 4),
00106 kFBDisplayCamera = (1 << 5),
00107 kFBDisplay3dIcon = (1 << 6),
00108 kFBDisplayAll = 0xff
00109 };
00110
00112
00113 enum FBPickingMode {
00114 kFBPickingModeStandard = 0,
00115 kFBPickingModeXRay,
00116 kFBPickingModeModelsOnly,
00117 kFBPickingModeCount
00118 };
00119
00121
00122 enum FBDeviceKeyboardKey {
00123 kFBDKeyPageUp,
00124 kFBDKeyPageDown,
00125 kFBDKeyEnd,
00126 kFBDKeyHome,
00127 kFBDKeyArrowLeft,
00128 kFBDKeyArrowUp,
00129 kFBDKeyArrowRight,
00130 kFBDKeyArrowDown,
00131 kFBDKeyReturn,
00132 kFBDKeyEscape,
00133 kFBDKeySpace,
00134 kFBDKey1,
00135 kFBDKey2,
00136 kFBDKey3,
00137 kFBDKey4,
00138 kFBDKey5,
00139 kFBDKey6,
00140 kFBDKey7,
00141 kFBDKey8,
00142 kFBDKey9,
00143 kFBDKey0,
00144 kFBDKeyF1,
00145 kFBDKeyF2,
00146 kFBDKeyF3,
00147 kFBDKeyF4,
00148 kFBDKeyF5,
00149 kFBDKeyF6,
00150 kFBDKeyF7,
00151 kFBDKeyF8,
00152 kFBDKeyF9,
00153 kFBDKeyF10,
00154 kFBDKeyF11,
00155 kFBDKeyF12
00156 };
00157
00158 FB_DEFINE_ENUM( FBSDK_DLL, DeviceKeyboardKey );
00159
00163 class FBSDK_DLL FBViewingOptions
00164 {
00165 public:
00169 FBModelShadingMode& ShadingMode();
00170
00174 FBStereoDisplayMode& StereoDisplayMode();
00175
00179 int& DisplayWhat();
00180
00184 FBPickingMode& PickingMode();
00185
00188 bool& ShowTimeCode();
00189
00192 bool& ShowSafeArea();
00193
00196 bool& ShowCameraLabel();
00197
00198 private:
00199 FBViewingOptions();
00200 FBViewingOptions(const FBViewingOptions &);
00201 FBViewingOptions & operator =(const FBViewingOptions &);
00202 };
00203
00204
00206
00208
00235
00236 struct FBPickInfos {
00241 FBPickInfos( HFBModel pModel, FBVector3d pPoint ) : mModel( pModel ), mPoint( pPoint ) {};
00242 HFBModel mModel;
00243 FBVector3d mPoint;
00244 };
00245
00246 bool operator==( const FBPickInfos& pLhs, const FBPickInfos& pRhs );
00247
00249 typedef class FBSDK_DLL FBArrayTemplate<FBPickInfos> FBPickInfosList;
00250
00252
00254 __FB_FORWARD( FBViewerInfos );
00255 FB_DEFINE_COMPONENT( FBSDK_DLL, ViewerInfos );
00256
00274 class FBSDK_DLL FBViewerInfos : public FBComponent
00275 {
00276
00277 __FBClassDeclare( FBViewerInfos, FBComponent );
00278
00283 FBViewerInfos( const FBViewerInfos& );
00284
00289 FBViewerInfos& operator=( const FBViewerInfos& );
00290
00291 public:
00292
00294 FBViewerInfos( HIObject pObject );
00295
00296 FBPropertyBool Visibility;
00297 };
00298
00299
00301
00303
00305 class FBSDK_DLL FBRenderer : public FBComponent
00306 {
00307
00308 __FBClassDeclare( FBRenderer,FBComponent );
00309 public:
00315 FBRenderer(HIObject pObject);
00316
00317
00325 void SetViewport(int pX,int pY,int pW,int pH);
00326
00336 bool RenderBegin(int pX,int pY,int pW,int pH);
00337
00343 bool RenderEnd(HFBView pView=NULL);
00344
00357 bool PreRender(int pLayer = -1);
00358
00363 bool Render(int pLayer = -1);
00364
00368 bool SetViewingOptions(FBViewingOptions & pOptions);
00369
00373 FBViewingOptions * GetViewingOptions();
00374
00379 bool FrameCurrentCameraWithModels(bool pAll);
00380
00381
00391 bool MouseInput(int pX,int pY,FBInputType pInputType,int pButtonKey,FBInputModifier pModifier,int pLayer = -1);
00392
00400 bool Pick(int pX, int pY, FBPickInfosList& pPickInfosList, bool pNeedIntersectPoistion = false );
00401
00407 void KeyboardInput(FBDeviceKeyboardKey pKeyIndex, bool pKeyState, bool pIsTrigger = false);
00408
00409
00410 FBPropertyCamera CurrentCamera;
00411 FBPropertyBool UseCameraSwitcher;
00412
00413 #if !defined(K_NO_MANIPULATOR)
00414 FBPropertyManipulatorTransform ManipulatorTransform;
00415 FBPropertyListManipulator Manipulators;
00416 #endif
00417
00418 FBPropertyScene Scene;
00419 FBPropertyBool AutoEvaluate;
00420 FBPropertyBool Background;
00421 FBPropertyBool ShowStats;
00422 FBPropertyBool DisplayNormals;
00423 FBPropertyViewerInfos ViewerInfos;
00424 };
00425
00426 #ifdef FBSDKUseNamespace
00427 }
00428 #endif
00429 #endif