1 #ifndef __FBRENDERER_H__
2 #define __FBRENDERER_H__
43 #include <kaydaradef.h>
48 #define FBSDK_DLL K_DLLIMPORT
51 #if !defined(K_NO_MANIPULATOR)
57 #include <fbsdk/fbcamera.h>
58 #include <fbsdk/fblight.h>
62 #ifdef FBSDKUseNamespace
63 namespace FBSDKNamespace {
279 : mModel( pModel ), mPoint( pPoint ), mNormal (pNormal), mSubItemIndex(pSubItemIndex) {};
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 )
729 #if !defined(K_NO_MANIPULATOR)
883 #ifdef FBSDKUseNamespace
Template class to contain an array of items.
Creates custom cameras and manages system cameras.
MotionBuilder SDK base class.
PropertyList: Concrete class for PropertyList of component
PropertyList: Manipulator.
virtual int Add(FBRendererCallback *pItem)
Add a RendererCallback to the property list.
FBRendererCallback * operator[](int pIndex)
Get the texture at a specific index.
Open Reality renderer callback interface.
virtual const char * GetCallbackDesc() const =0
Return Callback Desc Name.
FBPropertyBool DefaultLightGroundProjectionRendering
Read write Property: Set true to use default light ground projection rendering; set false to disable ...
virtual void Attach()
Callback when attach RendererCallback This callback occurs when attach this renderer callback instanc...
virtual const char * GetCallbackPrefName(unsigned int pIndex) const
Return Callback Preference Name.
FBPropertyBool DefaultCameraFrontPlateRendering
Read write Property: Set true to use default camera front plate rendering; set false to disable it.
virtual const char * GetCallbackName() const =0
Return Callback Name.
FBRendererCallback(const char *pName)
Constructor.
virtual void Render(FBRenderOptions *pRenderOptions)
Callback for rendering.
FBPropertyBool DefaultCameraBackPlateRendering
Read write Property: Set true to use default camera back plate rendering; set false to disable it.
FBPropertyBool SupportIDBufferPicking
Read write Property: Can this Renderer Callback support IDBuffer Picking.
virtual void Detach()
Callback when detach RendererCallback This callback occurs when detach this renderer callback instanc...
virtual void DetachDisplayContext(FBViewingOptions *pViewOption)
Callback to ask invalidate GL resources.
FBPropertyBool DefaultLightVolumeRendering
Read write Property: Set true to use default light volume rendering; set false to disable it.
virtual unsigned int GetCallbackPrefCount() const
Return Callback Preference Count, For adjust render settings, quality, performance and etc....
Open Reality renderer interface.
const char * GetCurrentSchematicBookmarkName() const
Return the current bookmark name used by the Schematic View.
bool Render(int pLayer=-1)
Renders one frame.
bool SelectSchematicBookmark(const char *pBookmarkName)
Select an existing bookmark in the Schematic View and use it as the current bookmark.
bool PreRender(int pLayer=-1)
PreRenders one frame (needed for some shaders) This functions destroys the frame buffer content and m...
FBPropertyInt CurrentPaneCallbackPrefIndex
Read Write Property: Current Pane's Renderer Callback Preference Index.
FBPropertyInt RegisteredCallbackCount
Read Only Property: Registered Renderer Callback Count.
FBPropertyBool SelectionForceSnapPointsDisplay
Read write Property: Force show all feature points (pivots and etc) on selected models if true,...
void SetSchematicViewInPane(unsigned int pPaneIndex, bool pActive)
Set/Remove the Schematic View in the given pane index.
bool UpdateCurrentSchematicBookmark()
Update the current bookmark in the Schematic View.
bool RectPickNormalized(float pX1, float pY1, float pX2, float pY2, FBPickInfosList &pPickInfosList, int pPaneId=-1)
Object rectangle selection.
void CloneViewAdd(FBView *pView)
Add a new clone view to call when rendering main viewer.
bool FrameCurrentCameraWithModels(bool pAll)
Frame the current camera either with all models or with the currently selected models.
void SetViewport(int pX, int pY, int pW, int pH)
Must be called before inputing if the same renderer is used on multiple views/cameras in the same app...
unsigned int GetSelectedPaneIndex() const
Return the pane index associated with the selected pane in the active viewer's layout.
FBPropertyBool Background
Read Write Property: The renderer.
FBPropertyBool HideManipulatorsOnManip
Read Write Property: Hide manipulators UI elements while manipulating.
FBPropertyBool FrustumCulling
Read Write Property: Turn on/off the early frustum culling optimization.
bool GetSchematicNodesBoundingBox(bool pConsiderCollapsedNodes, int &pTop, int &pLeft, int &pBottom, int &pRight)
Returns the bounding box (top, left, bottom, right) used by all the Schematic View nodes.
FBPropertyManipulatorTransform ManipulatorTransform
Read Only Property: Manipulator responsible of moving objects
void OGLSetupSceneLights(FBRenderOptions &pRenderOptions)
Setup the scene lights in OpenGL.
void SetPaneCount(unsigned int pPaneCount)
Set the number of panes to display in the viewer's layout.
int GetLastPickInfoList(FBPickInfosList &pPickInfosList)
Return the last picking info list in the current view pane.
bool CreateSchematicBookmark(const char *pBookmarkName)
Create a new bookmark in the Schematic View.
FBPropertyInt DisplayableGeometryCount
Read Only Property: Displayable geometry count.
const FBModelList & GetDisplayableGeometryInCameraFrustum(FBModelList *pModelList=NULL, FBCamera *pCamera=NULL)
Get a list of displayable geometry inside given camera's frustum.
FBPropertyBool AdvancedLightingMode
Read write Property: Turn on/off advanced lighting setting UI widgets.
FBPropertyDouble SelectionOverrideTransparency
Read write Property: Selection override layer transparency.
FBPropertyBool IDBufferDisplay
Read write Property: Render Model's unique Color ID into color Buffer (used for picking)
bool DeleteSchematicBookmark(const char *pBookmarkName)
Delete a bookmark from the Schematic View.
FBPropertyCamera CurrentCamera
bool MouseInputNormalized(float pX, float pY, FBInputType pInputType, int pButtonKey, FBInputModifier pModifier, int pWheelDeltaValue, int pLayer=-1, int pPaneId=-1)
Mouse input.
FBPropertyColor SelectionOverrideColor
Read write Property: Selection override layer color.
bool IsCurrentSchematicBookmarkDirty() const
Return if the current bookmark used by the Schematic View is dirty or not.
bool GetSchematicNodesBoundingBoxFromModel(FBModel *pModel, bool pConsiderCollapsedNodes, int &pTop, int &pLeft, int &pBottom, int &pRight)
Returns the bounding box (top, left, bottom, right) of a node's tree in the Schematic View,...
FBPropertyInt DisplayableLightCount
Read Only Property: Displayable light count.
FBPropertyInt DisplaySetUpdateId
Read Only Property: Current DisplaySet Update Id. Add/Delete models, Show/Hide models will affect Dis...
FBPropertyBool IDBufferPicking
Read write Property: Use ID (Color) Buffer for picking, instead of OpenGl selection buffer picking.
bool IsCameraSwitcherInPane(unsigned int pPaneIndex)
Return the Camera Switcher activeness in the given pane index.
void CloneViewRender(int pWidth, int pHeight)
Viewer texture Id.
bool SetViewingOptions(FBViewingOptions &pOptions)
Set the viewing options.
void SetCameraSwitcherInPane(unsigned int pPaneIndex, bool pActive)
Set/Remove the Camera Switcher in the given pane index.
void KeyboardInput(FBDeviceKeyboardKey pKeyIndex, bool pKeyState, bool pIsTrigger=false)
Keyboard input.
FBPropertyListManipulator Manipulators
List: of manipulators.
bool Pick(int pX, int pY, FBPickInfosList &pPickInfosList, bool pNeedIntersectPosition=false)
Object picking selection.
bool RectPick(int pX1, int pY1, int pX2, int pY2, FBPickInfosList &pPickInfosList)
Object rectangle selection.
FBPropertyBool AdvancedMaterialMode
Read write Property: Turn on/off advanced material setting UI widgets.
FBCamera * GetCameraInPane(unsigned int pPaneIndex)
Return the camera displayed in the given pane index.
void SetCameraInPane(FBCamera *pCamera, unsigned int pPaneIndex)
Set the camera to display in the given pane index.
void ArrangeAllInSchematic(FBArrangeMode pMode)
Request to arrange all objects in schematic view .
FBPropertyInt CurrentPaneCallbackIndex
Read Write Property: Current Pane's Renderer Callback Index.
bool RenderBegin(int pX, int pY, int pW, int pH)
RenderBegin.
FBPropertyBool HideManipulatorsOnPlayback
Read Write Property: Hide manipulators UI elements during playback.
FBPropertyBool SelectionOverride
Read write Property: Add transparent color override layer on selected models if true.
void ArrangeSelectedObjectsInSchematic()
Request to arrange selected objects in schematic view .
FBPropertyInt RendererUpdateId
Read Only Property: Current Render Update Id. DisplaySet update, material change, texture changes and...
FBPropertyBool AutoEvaluate
Read Write Property: Indicate if a call to RenderBegin will also cause a re-evaluation of the scene.
FBPropertyBool ShowStats
Read Write Property: Show the stats about FPS, Evaluation rate ... like when using Shift-F in main vi...
bool SetSelectedPaneIndex(unsigned int pPaneIndex)
Select the pane associated with the given pane index in the active viewer's layout.
int GetViewerTextureId()
Viewer texture Id.
FBLight * GetDisplayableLight(int pIndex)
Get the displayable light.
FBPropertyBool PickingEnabled
Read Write Property: Is picking in the viewer enabled?
bool RenderEnd(FBView *pView=NULL)
RenderEnd.
void CloneViewRemove(FBView *pView)
Remove a new clone view to call when rendering main viewer.
FBStringList GetSchematicBookmarkNames() const
Return the bookmark names available in the Schematic View.
FBRenderer(HIObject pObject)
Constructor.
bool RenameSchematicBookmark(const char *pOldBookmarkName, const char *pNewBookmarkName)
Rename a bookmark in the Schematic View.
FBPropertyBool DisplayNormals
Read Write Property: Display model normals in main viewer.
FBPropertyScene Scene
Read Write Property: Scene that the renderer will use/draw
bool ArrangeObjectsInSchematicFromModel(const FBModel &pModel)
Request to arrange a node's tree in the Schematic View, given a starting node.
FBPropertyBool EvaluateMode
Read Write Property: When true (default), call to Render will perform evaluation. Useful when renderi...
FBPropertyListRendererCallback RendererCallbacks
List: Renderer Callbacks attached.
bool MouseInput(int pX, int pY, FBInputType pInputType, int pButtonKey, FBInputModifier pModifier, int pWheelDeltaValue=0, int pLayer=-1)
Mouse input.
bool IsModelInsideCameraFrustum(FBModel *pGeometry, FBCamera *pCamera=NULL)
To tell if given model is located inside camera's frustum.
bool PickNormalized(float pX, float pY, FBPickInfosList &pPickInfosList, bool pNeedIntersectPosition=false, int pPaneId=-1)
Object picking selection.
FBPropertyDouble IDBufferPickingAlpha
Read write Property: Those Semi-transparent (Alpha Blend) geometry(region) contribute less than this ...
FBModel * GetDisplayableGeometry(int pIndex)
Get the displayable geometry model.
FBViewingOptions * GetViewingOptions()
Obtain the current viewing options.
FBPropertyBool UseCameraSwitcher
int GetSchematicViewPaneIndex()
Return the pane index of the pane displaying the Schematic View.
unsigned int GetPaneCount()
Return the number of panes displayed in the viewer's layout.
Viewing options for rendering.
FBCamera * GetViewingCamera()
Get a reference to the current viewing camera.
FBPickingMode & PickingMode()
Get a reference to the picking mode.
FBStereoDisplayMode & StereoDisplayMode()
Get a reference to the stereo display mode.
unsigned int RenderCallbackPrefIndex() const
Current Render callback Settings Index.
FBModelShadingMode & ShadingMode()
Get a reference to the display mode.
bool IsInSelectionBufferPicking() const
Is the rendering routine during picking status with GL selection buffer method.
bool IsInColorBufferPicking() const
Is the rendering routine during picking status with GL color buffer method.
bool & ShowCameraLabel()
Show Camera Label when rendering.
bool & ShowSafeArea()
Show Safe Area when rendering.
int PaneIndex() const
Current Viewer Pane being rendered.
bool & ShowTimeCode()
Show Time Code when rendering.
int & DisplayWhat()
Get a reference to the display mask.
class K_DLLIMPORT FBArrayTemplate< FBModel * > FBModelList
typedef class FBSDK_DLL FBArrayTemplate<FBModel*> FBModelList;
#define __FBClassDeclare(Name, Parent)
For internal use only.
Contains the user interface components for the SDK.
FBInputModifier
Input Modifiers (Ctrl, Alt, Shift).
FBInputType
Types of input events.
FB_DEFINE_COMPONENT(K_DLLIMPORT, AnimationNode)
Animation node class.
Create new manipulators using the FBManipulator class.
FBModelShadingMode
Modes for model shading.
class K_DLLIMPORT FBPropertyBase< int, kFBPT_int > FBPropertyInt
Property: int
class K_DLLIMPORT FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
class K_DLLIMPORT FBPropertyBase< FBColor, kFBPT_ColorRGB > FBPropertyColor
FBPropertyColor type definition.
class K_DLLIMPORT FBPropertyBase< double, kFBPT_double > FBPropertyDouble
Property: double
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
class K_DLLIMPORT FBArrayTemplate< FBPickInfos > FBPickInfosList
typedef class FBSDK_DLL FBArrayTemplate<FBPickInfos> FBPickInfosList
FBArrangeMode
Modes for arranging objects in schematic view.
@ kVerticalMode
Arrange all objects vertically.
@ kHorizontalMode
Arrange all objects horizontally.
K_DLLIMPORT FBPickInfosList * FBCreatePickInfosList()
Create a FBPickInfosList object.
FBDeviceKeyboardKey
Keyboard keys (for input).
@ kFBDKeyArrowRight
Right.
@ kFBDKeyPageDown
Page Down.
K_DLLIMPORT void FBDestroyPickInfosList(FBPickInfosList *pPickInfosList)
Delete a FBPickInfosList object.
@ kFBStereoDisplayAnaglyph
Display in Analygh stereo mode.
@ kFBStereoDisplayActive
Display in active mode. User must enable OpenGL quad stereo buffer, and choose approriate stereo mode...
@ kFBStereoDisplayRightEye
Display in Right Eye Caerma, No Stereo effect.
@ kFBStereoDisplayHorizontalInterlace
Display in Horizontal Interlace stereo mode.
@ kFBStereoDisplayAnaglyphLuminance
Display in Luminance Analygh stereo mode.
@ kFBStereoDisplayFreeviewCrossed
Display in crossed free view stereo mode.
@ kFBStereoDisplayCheckerboard
Display in Checkboard Interlace stereo mode.
@ kFBStereoDisplayCenterEye
Display in Center Eye Camera, No Stereo effect.
@ kFBStereoDisplayModeCount
update this count value when add new mode
@ kFBStereoDisplayFreeviewParallel
Display in parallel free view stereo mode.
@ kFBStereoDisplayLeftEye
Display in Left Eye Caerma, No Stereo effect.
FBDisplayMode
Model display options.
@ kFBDisplayModeHardShade
Hard shading.
@ kFBDisplayModeTexture
Textures are displayed.
@ kFBDisplayModeFlatShade
Flat shading.
@ kFBDisplayModeWireFrame
Wire-frame rendering.
@ kFBDisplayModeDefault
Use default display mode.
@ kFBDisplayModeCount
End of enum, this value indicates the number of display modes available.
FBPickingMode
3D picking mode.
@ kFBPickingModeStandard
Standard picking mode.
@ kFBPickingModeCount
End of enum, this valued indicates the number of picking modes available.
@ kFBPickingModeXRay
X-Ray picking mode (obstructed models are displayed in overlay).
@ kFBPickingModeModelsOnly
Models-only mode (no nulls or skeletons are displayed).
FBDisplayWhat
Model display mask This mask determines what types of models are displayed by the renderer.
@ kFBDisplayCamera
Cameras are displayed.
@ kFBDisplayMarker
Markers are displayed.
@ kFBDisplayNull
Null models are displayed.
@ kFBDisplayCenter
Centers are displayed.
@ kFBDisplaySkeleton
Skeletons and bones are displayed.
@ kFBDisplayLight
Lights are displayed.
@ kFBDisplayAll
Everything is displayed.
@ kFBDisplay3dIcon
3D icons are displayed (3D icons are 3D elements that do not exist in the scene).
@ kFBDisplayNone
Nothing is displayed.
Declaration for the classes FBShaderManager, FBShader, FBPropertyListShader and other subclasses.
#define FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
class K_DLLIMPORT FBVector3< double > FBVector3d
3D vector.
Picking information structure.
int mSubItemIndex
Picked sub item index, -1 for whole object.
FBVector3d mNormal
Normal of the pick on the model's surface in world space.
FBVector3d mPoint
Location of the pick on the model's surface in world space.
FBPickInfos(FBModel *pModel, FBVector3d pPoint, FBVector3d pNormal, int pSubItemIndex)
FBPickInfos.
FBModel * mModel
Model picked.