1 #ifndef __FBRENDERER_H__
2 #define __FBRENDERER_H__
48 #define FBSDK_DLL K_DLLIMPORT
51 #if !defined(K_NO_MANIPULATOR)
62 #ifdef FBSDKUseNamespace
180 FBCamera* GetViewingCamera();
204 bool& ShowTimeCode();
208 bool& ShowSafeArea();
212 bool& ShowCameraLabel();
216 bool IsInSelectionBufferPicking()
const;
220 bool IsInColorBufferPicking()
const;
224 unsigned int RenderCallbackPrefIndex()
const;
229 int PaneIndex()
const;
233 FBViewingOptions(
const FBViewingOptions &);
234 FBViewingOptions & operator =(
const FBViewingOptions &);
279 : mModel( pModel ), mPoint( pPoint ), mNormal (pNormal), mSubItemIndex(pSubItemIndex) {};
298 FBSDK_DLL FBPickInfosList* FBCreatePickInfosList();
303 FBSDK_DLL void FBDestroyPickInfosList( FBPickInfosList* pPickInfosList );
318 FBRendererCallback(
const char* pName);
323 virtual const char* GetCallbackName()
const = 0;
329 virtual const char* GetCallbackDesc()
const = 0;
336 virtual unsigned int GetCallbackPrefCount()
const;
341 virtual const char* GetCallbackPrefName(
unsigned int pIndex)
const;
351 virtual void Attach();
356 virtual void Detach();
363 virtual void DetachDisplayContext(FBViewingOptions* pViewOption);
381 #define FBRegisterRendererCallback( UniqueNameStr, ClassName, Label, Description, IconFilename ) \
382 HIObject CreateRendererCallback##ClassName( HIObject ,const char* pName,void * ) \
384 ClassName *Class = new ClassName( pName ); \
385 if (Class->FBCreate()) { \
386 return Class->GetHIObject(); \
392 FBLibraryModule( ClassName ) \
394 FBRegisterObject( ClassName##R1,"renderer/callback/ogl",Label,Description,CreateRendererCallback##ClassName,true, IconFilename ); \
401 #define FBRendererCallbackDeclare( ClassName, Parent ) \
402 FBClassDeclare( ClassName,Parent); \
404 ClassName(const char* pName):Parent(pName) { FBClassInit; } \
410 #define FBRendererCallbackImplementation( ThisComponent ) \
411 FBClassImplementation( ThisComponent )
419 class FBSDK_DLL FBPropertyListRendererCallback :
public FBPropertyListComponent
422 FBPropertyListRendererCallback();
429 virtual int Add( FBRendererCallback* pItem );
434 FBRendererCallback* operator[](
int pIndex);
437 inline virtual int Add ( FBComponent* pItem ) {
return Add((FBRendererCallback*)pItem); }
445 class FBSDK_DLL FBRenderer :
public FBComponent
465 void SetViewport(
int pX,
int pY,
int pW,
int pH);
476 bool RenderBegin(
int pX,
int pY,
int pW,
int pH);
483 bool RenderEnd(FBView* pView=
NULL);
497 bool PreRender(
int pLayer = -1);
503 bool Render(
int pLayer = -1);
508 void OGLSetupSceneLights(FBRenderOptions& pRenderOptions);
515 void OGLModelDisplay(FBRenderOptions& pRenderOptions, FBModel& pModel);
520 bool SetViewingOptions(FBViewingOptions & pOptions);
525 FBViewingOptions * GetViewingOptions();
531 bool FrameCurrentCameraWithModels(
bool pAll);
534 void ArrangeSelectedObjectsInSchematic();
540 bool ArrangeObjectsInSchematicFromModel(
const FBModel& pModel );
555 bool GetSchematicNodesBoundingBox(
bool pConsiderCollapsedNodes,
int& pTop,
int& pLeft,
int& pBottom,
int& pRight );
566 bool GetSchematicNodesBoundingBoxFromModel( FBModel* pModel,
bool pConsiderCollapsedNodes,
int& pTop,
int& pLeft,
int& pBottom,
int& pRight );
579 bool MouseInput(
int pX,
int pY,
FBInputType pInputType,
int pButtonKey,
FBInputModifier pModifier,
int pWheelDeltaValue=0,
int pLayer = -1);
592 bool MouseInputNormalized(
float pX,
float pY,
FBInputType pInputType,
int pButtonKey,
FBInputModifier pModifier,
int pWheelDeltaValue,
int pLayer = -1,
int pPaneId = -1);
601 bool Pick(
int pX,
int pY, FBPickInfosList& pPickInfosList,
bool pNeedIntersectPosition =
false );
611 bool PickNormalized(
float pX,
float pY, FBPickInfosList& pPickInfosList,
bool pNeedIntersectPosition =
false,
int pPaneId = -1);
620 bool RectPick(
int pX1,
int pY1,
int pX2,
int pY2, FBPickInfosList& pPickInfosList);
630 bool RectPickNormalized(
float pX1,
float pY1,
float pX2,
float pY2, FBPickInfosList& pPickInfosList,
int pPaneId = -1);
636 int GetLastPickInfoList(FBPickInfosList& pPickInfosList);
643 void KeyboardInput(
FBDeviceKeyboardKey pKeyIndex,
bool pKeyState,
bool pIsTrigger =
false);
650 FBModel* GetDisplayableGeometry(
int pIndex );
657 FBLight* GetDisplayableLight(
int pIndex );
678 bool IsModelInsideCameraFrustum(FBModel* pGeometry, FBCamera* pCamera =
NULL);
684 #if !defined(K_NO_MANIPULATOR)
685 FBPropertyManipulatorTransform ManipulatorTransform;
686 FBPropertyListManipulator Manipulators;
708 FBPropertyListRendererCallback RendererCallbacks;
736 int GetViewerTextureId();
741 void CloneViewAdd(FBView* pView);
746 void CloneViewRemove(FBView* pView);
769 void SetCameraInPane( FBCamera* pCamera,
unsigned int pPaneIndex );
783 FBCamera* GetCameraInPane(
unsigned int pPaneIndex );
788 void SetPaneCount(
unsigned int pPaneCount );
793 unsigned int GetPaneCount();
799 bool SetSelectedPaneIndex(
unsigned int pPaneIndex );
804 unsigned int GetSelectedPaneIndex()
const;
812 void SetSchematicViewInPane(
unsigned int pPaneIndex,
bool pActive );
817 int GetSchematicViewPaneIndex();
826 void SetCameraSwitcherInPane(
unsigned int pPaneIndex,
bool pActive );
834 bool IsCameraSwitcherInPane(
unsigned int pPaneIndex );
837 #ifdef FBSDKUseNamespace
#define __FBClassDeclare(Name, Parent)
For internal use only.
FBDisplayWhat
Model display mask This mask determines what types of models are displayed by the renderer...
class FBPropertyBaseComponent< FBScene * > FBPropertyScene
FBVector3d mPoint
Location of the pick on the model's surface in world space.
int mSubItemIndex
Picked sub item index, -1 for whole object.
#define FB_DEFINE_COMPONENT(DllTag, Type)
Define a component and give it the ability to be a property.
FBDeviceKeyboardKey
Keyboard keys (for input).
Display in Horizontal Interlace stereo mode.
class FBVector3< double > FBVector3d
3D vector.
Template class to contain an array of items.
Null models are displayed.
class FBPropertyBase< int, kFBPT_int > FBPropertyInt
Property: int
3D icons are displayed (3D icons are 3D elements that do not exist in the scene). ...
class FBPropertyBase< FBColor, kFBPT_ColorRGB > FBPropertyColor
FBPropertyColor type definition.
Display in Luminance Analygh stereo mode.
End of enum, this value indicates the number of display modes available.
End of enum, this valued indicates the number of picking modes available.
Display in Checkboard Interlace stereo mode.
Display in Analygh stereo mode.
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
Contains the user interface components for the SDK.
FBPickInfos(FBModel *pModel, FBVector3d pPoint, FBVector3d pNormal, int pSubItemIndex)
FBPickInfos.
update this count value when add new mode
FBPickingMode
3D picking mode.
Arrange all objects vertically.
FBModelShadingMode
Modes for model shading.
FBArrangeMode
Modes for arranging objects in schematic view.
Create new manipulators using the FBManipulator class.
X-Ray picking mode (obstructed models are displayed in overlay).
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
class FBArrayTemplate< FBModel * > FBModelList
typedef class FBSDK_DLL FBArrayTemplate FBModelList;
#define FBSDKNamespace
FBSDKNamespace define.
Display in Center Eye Camera, No Stereo effect.
FBInputType
Types of input events.
Arrange all objects horizontally.
Use default display mode.
class FBPropertyBaseComponent< FBCamera * > FBPropertyCamera
MotionBuilder SDK base class.
bool operator==(const FBPickInfos &pLhs, const FBPickInfos &pRhs)
Models-only mode (no nulls or skeletons are displayed).
class FBPropertyBase< double, kFBPT_double > FBPropertyDouble
Property: double
#define FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Picking information structure.
Display in parallel free view stereo mode.
Display in Right Eye Caerma, No Stereo effect.
Display in Left Eye Caerma, No Stereo effect.
FBInputModifier
Input Modifiers (Ctrl, Alt, Shift).
Skeletons and bones are displayed.
Declaration for the classes FBShaderManager, FBShader, FBPropertyListShader and other subclasses...
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
FBVector3d mNormal
Normal of the pick on the model's surface in world space.
class FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
Display in crossed free view stereo mode.
FBDisplayMode
Model display options.