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