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
00081
00084 enum FBDisplayWhat {
00085 kFBDisplayNone = 0,
00086 kFBDisplayNull = (1 << 0),
00087 kFBDisplayMarker = (1 << 1),
00088 kFBDisplaySkeleton = (1 << 2),
00089 kFBDisplayCenter = (1 << 3),
00090 kFBDisplayLight = (1 << 4),
00091 kFBDisplayCamera = (1 << 5),
00092 kFBDisplay3dIcon = (1 << 6),
00093 kFBDisplayAll = 0xff
00094 };
00095
00097
00098 enum FBPickingMode {
00099 kFBPickingModeStandard = 0,
00100 kFBPickingModeXRay,
00101 kFBPickingModeModelsOnly,
00102 kFBPickingModeCount
00103 };
00104
00106
00107 enum FBZSortMode {
00108 kFBZSortNone,
00109 kFBZSortFirstLayer,
00110 kFBZSortFirstLayerFastBufferRegion,
00111 kFBZSortConvexGeometry,
00112 kFBZSortConvexGeometryFastBufferRegion,
00113 kFBZSortFrontToBack,
00114 kFBZSortBackToFront,
00115 kFBZSortCount
00116 };
00117
00119
00120 enum FBDeviceKeyboardKey {
00121 kFBDKeyPageUp,
00122 kFBDKeyPageDown,
00123 kFBDKeyEnd,
00124 kFBDKeyHome,
00125 kFBDKeyArrowLeft,
00126 kFBDKeyArrowUp,
00127 kFBDKeyArrowRight,
00128 kFBDKeyArrowDown,
00129 kFBDKeyReturn,
00130 kFBDKeyEscape,
00131 kFBDKeySpace,
00132 kFBDKey1,
00133 kFBDKey2,
00134 kFBDKey3,
00135 kFBDKey4,
00136 kFBDKey5,
00137 kFBDKey6,
00138 kFBDKey7,
00139 kFBDKey8,
00140 kFBDKey9,
00141 kFBDKey0,
00142 kFBDKeyF1,
00143 kFBDKeyF2,
00144 kFBDKeyF3,
00145 kFBDKeyF4,
00146 kFBDKeyF5,
00147 kFBDKeyF6,
00148 kFBDKeyF7,
00149 kFBDKeyF8,
00150 kFBDKeyF9,
00151 kFBDKeyF10,
00152 kFBDKeyF11,
00153 kFBDKeyF12
00154 };
00155
00156 FB_DEFINE_ENUM( FBSDK_DLL, DeviceKeyboardKey );
00157
00161 class FBSDK_DLL FBViewingOptions
00162 {
00163 public:
00167 FBModelShadingMode& ShadingMode();
00168
00172 int& DisplayWhat();
00173
00177 int& PickingMode();
00178
00181 bool& ShowTimeCode();
00182
00185 bool& ShowSafeArea();
00186
00189 bool& ShowCameraLabel();
00190
00191 private:
00192 FBViewingOptions();
00193 FBViewingOptions(const FBViewingOptions &);
00194 FBViewingOptions & operator =(const FBViewingOptions &);
00195 };
00196
00197 FB_DEFINE_ENUM( FBSDK_DLL, ZSortMode );
00198
00199
00200
00201
00202
00204
00206
00233
00234 struct FBPickInfos {
00239 FBPickInfos( HFBModel pModel, FBVector3d pPoint ) : mModel( pModel ), mPoint( pPoint ) {};
00240 HFBModel mModel;
00241 FBVector3d mPoint;
00242 };
00243
00244 bool operator==( const FBPickInfos& pLhs, const FBPickInfos& pRhs );
00245
00247 typedef class FBSDK_DLL FBArrayTemplate<FBPickInfos> FBPickInfosList;
00248
00250
00252 __FB_FORWARD( FBViewerInfos );
00253 FB_DEFINE_COMPONENT( FBSDK_DLL, ViewerInfos );
00254
00272 class FBSDK_DLL FBViewerInfos : public FBComponent
00273 {
00274
00275 __FBClassDeclare( FBViewerInfos, FBComponent );
00276
00281 FBViewerInfos( const FBViewerInfos& );
00282
00287 FBViewerInfos& operator=( const FBViewerInfos& );
00288
00289 public:
00290
00292 FBViewerInfos( HIObject pObject );
00293
00294 FBPropertyBool Visibility;
00295 };
00296
00297
00299
00301
00303 class FBSDK_DLL FBRenderer : public FBComponent
00304 {
00305
00306 __FBClassDeclare( FBRenderer,FBComponent );
00307 public:
00313 FBRenderer(HIObject pObject);
00314
00315
00323 void SetViewport(int pX,int pY,int pW,int pH);
00324
00334 bool RenderBegin(int pX,int pY,int pW,int pH);
00335
00341 bool RenderEnd(HFBView pView=NULL);
00342
00355 bool PreRender(int pLayer = -1);
00356
00361 bool Render(int pLayer = -1);
00362
00366 bool SetViewingOptions(FBViewingOptions & pOptions);
00367
00371 FBViewingOptions * GetViewingOptions();
00372
00377 bool FrameCurrentCameraWithModels(bool pAll);
00378
00379
00389 bool MouseInput(int pX,int pY,FBInputType pInputType,int pButtonKey,FBInputModifier pModifier,int pLayer = -1);
00390
00398 bool Pick(int pX, int pY, FBPickInfosList& pPickInfosList, bool pNeedIntersectPoistion = false );
00399
00405 void KeyboardInput(FBDeviceKeyboardKey pKeyIndex, bool pKeyState, bool pIsTrigger = false);
00406
00407
00408 FBPropertyCamera CurrentCamera;
00409 FBPropertyBool UseCameraSwitcher;
00410
00411 #if !defined(K_NO_MANIPULATOR)
00412 FBPropertyManipulatorTransform ManipulatorTransform;
00413 FBPropertyListManipulator Manipulators;
00414 #endif
00415
00416 FBPropertyScene Scene;
00417 FBPropertyBool AutoEvaluate;
00418 FBPropertyBool Background;
00419 FBPropertyZSortMode ZSortMode;
00420 FBPropertyInt LayerCount;
00421 FBPropertyColor ClearColor;
00422 FBPropertyViewerInfos ViewerInfos;
00423 };
00424
00425 #ifdef FBSDKUseNamespace
00426 }
00427 #endif
00428 #endif