Open Reality Reference Guide
FBPlug Class Reference

Connections Basic Open Reality SDK Element. More...

#include <fbplug.h>

Inheritance diagram for FBPlug:

Protected Member Functions

bool IsSDKComponent ()
 Return whether or not item is an SDK component. More...
 
bool ConnectSrc (FBPlug *pSrc, FBConnectionType pConnectionType=kFBConnectionTypeNone)
 Add a source connection. More...
 
bool ConnectDst (FBPlug *pDst, FBConnectionType pConnectionType=kFBConnectionTypeNone)
 Add a destination connection. More...
 
bool ConnectSrcAt (int pDst_SrcIndex, FBPlug *pSrc, FBConnectionType pConnectionType=kFBConnectionTypeNone)
 Add a source connection. More...
 
bool ConnectDstAt (int pSrc_DstIndex, FBPlug *pDst, FBConnectionType pConnectionType=kFBConnectionTypeNone)
 Add a destination connection. More...
 
bool DisconnectDst (FBPlug *pDst)
 Remove a destination connection. More...
 
bool DisconnectSrc (FBPlug *pSrc)
 Remove a source connection. More...
 
void DisconnectAllSrc ()
 Remove all source connections. More...
 
void DisconnectAllDst ()
 Remove all destination connections. More...
 
bool DisconnectDstAt (int pIndex)
 Remove a destination connection at a specified index. More...
 
bool DisconnectSrcAt (int pIndex)
 Remove a source connection at a specified index. More...
 
bool ReplaceDstAt (int pIndex, FBPlug *pDst)
 Replace a destination connection at a specified index. More...
 
bool ReplaceSrcAt (int pIndex, FBPlug *pSrc)
 Replace a source connection at a specified index. More...
 
bool SwapSrc (int pIndexA, int pIndexB)
 Swap source connection at index A with source connection at index B. More...
 
bool MoveSrcAt (int pIndex, int pAtIndex)
 Move source connection at pIndex to pAtIndex. More...
 
bool MoveSrcAt (FBPlug *pSrc, FBPlug *pAtSrc)
 Move source connection pSrc to the position of pAtSrc. More...
 
int GetSrcCount ()
 Get source connection count. More...
 
FBPlugGetSrc (int pIndex)
 Get a source connection's plug at specified index. More...
 
FBConnectionType GetSrcType (int pIndex)
 Get a source connection's type at specified index. More...
 
int GetDstCount ()
 Get destination connection count. More...
 
FBPlugGetDst (int pIndex)
 Get a destination connection's plug at specified index. More...
 
FBConnectionType GetDstType (int pIndex)
 Get a destination connection's type at specified index. More...
 
bool BeginChange ()
 Begins a change on multiple plugs. More...
 
void EndChange ()
 Ends a change on multiple plugs. More...
 
void SetSelfModified (FBPlugModificationFlag pFlag, bool pBool)
 Set the plug's self modification flag. More...
 
bool GetSelfModified (FBPlugModificationFlag pFlag)
 Tell if the plug's self has changed. More...
 
void SetContentModified (FBPlugModificationFlag pFlag, bool pBool)
 Set the plug's owned property/object's modification flag. More...
 
bool GetContentModified (FBPlugModificationFlag pFlag)
 Tell if the plug's content has changed. More...
 
int GetPlugConnectionModifiedList (FBPlugList &pPlugList, FBPlugModificationFlag pConnectionModificatonFlag, bool pAddRemove)
 Get plug's modified src/dst property/object connection added/removed List. More...
 
bool RevertModification (FBPlugModificationFlag pFlag=kFBAllModifiedMask)
 Revert the plug's modification to original status. More...
 
void SetStatusFlag (FBPlugStatusFlag pStatus, bool pValue)
 Set the plug's status flag. More...
 
bool GetStatusFlag (FBPlugStatusFlag pStatus) const
 Tell if the plug's status has changed. More...
 
FBPlugGetOwner ()
 Get the owner of this plug. More...
 
FBPlugGetOwned (int pIndex)
 Get the owned plug at specified index. More...
 
int GetOwnedCount ()
 Get the owned plug count. More...
 
virtual const char * ClassName ()
 internal System vars. More...
 
virtual bool Is (int pTypeId)
 Is( int pTypeId ) More...
 
virtual int GetTypeId ()
 GetTypeId( int pTypeId ) More...
 
virtual bool PlugDataNotify (FBConnectionAction pAction, FBPlug *pThis, void *pData=NULL, void *pDataOld=NULL, int pDataSize=0)
 PlugDataNotify when overloaded is equivalent of FBSystem.OnConnectionDataNotify but in the context of the derived object only. More...
 
virtual bool PlugStateNotify (FBConnectionAction pAction, FBPlug *pThis, void *pData=NULL, void *pDataOld=NULL, int pDataSize=0)
 PlugStateNotify when overloaded is equivalent of FBSystem.OnConnectionStateNotify but in the context of the derived object only. More...
 
virtual bool PlugNotify (FBConnectionAction pAction, FBPlug *pThis, int pIndex, FBPlug *pPlug=NULL, FBConnectionType pConnectionType=kFBConnectionTypeNone, FBPlug *pNewPlug=NULL)
 PlugNotify when overloaded is equivalent of FBSystem.OnConnectionNotify but in the context of the derived object only. More...
 
virtual void FBDelete ()
 Actual destructor for a FBPlug. More...
 

Static Protected Member Functions

static int GetInternalClassId ()
 Internal class Id. More...
 

Protected Attributes

bool mAllocated
 Contain the Allocation State of the Component. More...
 
HIObject mObject
 Handle on the Plug. More...
 
bool mSDKComponent
 bool Plug is an SDK component.
More...
 

Static Protected Attributes

static const char * ClassGroupName
 ClassGroupName of the object. More...
 
static int TypeInfo
 TypeInfo. More...
 
static int mGlobalTypeInfo
 Represente the Type Index. More...
 

Additional Inherited Members

- Public Member Functions inherited from FBWrapperHolder
FBScriptWrapperGetWrapper ()
 Return the wrapper interface of this FBObject. More...
 
void AddWrapper (FBScriptWrapper *)
 
void RemoveWrapper (FBScriptWrapper *)
 

Detailed Description

Connections Basic Open Reality SDK Element.

Most elements that are available in the SDK inherit from this base class since FBComponent and FBProperty inherit from FBPlug. Basically, all objects can be connected together because they are all "plugs". To simplify the graph, you can think of a "source" connection as a child, and a "destination" connection as a parent. Also, it is correct to assume that a source affect/work on its destination. For example, a shader applied on an object would be seen as the source while the object is the destination. So FBPlug is a set of functions that enables you to control those connections with flexibility and ease.

Definition at line 220 of file fbplug.h.

Member Function Documentation

◆ BeginChange()

bool BeginChange ( )
protected

Begins a change on multiple plugs.

Returns
A boolean indicating success (True) or failure (False).

◆ ClassName()

virtual const char* ClassName ( )
protectedvirtual

internal System vars.

Reimplemented in FBCustomManager, and FBComponent.

◆ ConnectDst()

bool ConnectDst ( FBPlug pDst,
FBConnectionType  pConnectionType = kFBConnectionTypeNone 
)
protected

Add a destination connection.

Parameters
pDstDestination plug.
pConnectionTypeType of connection, taken from FBConnectionType. Default value should work in all cases.
Returns
A boolean indicating success (True) or failure (False)

◆ ConnectDstAt()

bool ConnectDstAt ( int  pSrc_DstIndex,
FBPlug pDst,
FBConnectionType  pConnectionType = kFBConnectionTypeNone 
)
protected

Add a destination connection.

Parameters
pSrc_DstIndexIndex that tells where to add this destination connection in the source's connection list. if index is out of bound, and this destination connection will be appended at the end.
pDstDestination plug.
pConnectionTypeType of connection, taken from FBConnectionType. Default value should work in all cases.
Returns
A boolean indicating success (True) or failure (False).

◆ ConnectSrc()

bool ConnectSrc ( FBPlug pSrc,
FBConnectionType  pConnectionType = kFBConnectionTypeNone 
)
protected

Add a source connection.

Parameters
pSrcSource plug.
pConnectionTypeType of connection, taken from FBConnectionType. Default value should work in all cases.
Returns
A boolean indicating success (True) or failure (False).

◆ ConnectSrcAt()

bool ConnectSrcAt ( int  pDst_SrcIndex,
FBPlug pSrc,
FBConnectionType  pConnectionType = kFBConnectionTypeNone 
)
protected

Add a source connection.

Parameters
pDst_SrcIndexIndex that tells where to add this source connection in the destination's connection list. if index is out of bound, and this source connection will be appended at the end.
pSrcSource plug.
pConnectionTypeType of connection, taken from FBConnectionType. Default value should work in all cases.
Returns
A boolean indicating success (True) or failure (False).

◆ DisconnectAllDst()

void DisconnectAllDst ( )
protected

Remove all destination connections.

◆ DisconnectAllSrc()

void DisconnectAllSrc ( )
protected

Remove all source connections.

◆ DisconnectDst()

bool DisconnectDst ( FBPlug pDst)
protected

Remove a destination connection.

Parameters
pDstDestination plug.
Returns
A boolean indicating success (True) or failure (False).

◆ DisconnectDstAt()

bool DisconnectDstAt ( int  pIndex)
protected

Remove a destination connection at a specified index.

Parameters
pIndexDestination plug index.
Returns
A boolean indicating success (True) or failure (False).

◆ DisconnectSrc()

bool DisconnectSrc ( FBPlug pSrc)
protected

Remove a source connection.

Parameters
pSrcSource plug.
Returns
A boolean indicating success (True) or failure (False).

◆ DisconnectSrcAt()

bool DisconnectSrcAt ( int  pIndex)
protected

Remove a source connection at a specified index.

Parameters
pIndexSource plug index.
Returns
A boolean indicating success (True) or failure (False).

◆ EndChange()

void EndChange ( )
protected

Ends a change on multiple plugs.

◆ FBDelete()

virtual void FBDelete ( )
protectedvirtual

◆ GetContentModified()

bool GetContentModified ( FBPlugModificationFlag  pFlag)
protected

Tell if the plug's content has changed.

Parameters
pFlagbitwise AND of content modification flags.
Returns
true if content connection changed.

◆ GetDst()

FBPlug* GetDst ( int  pIndex)
protected

Get a destination connection's plug at specified index.

Parameters
pIndexIndex of the destination connection's plug.
Returns
Destination plug at specified index.

◆ GetDstCount()

int GetDstCount ( )
protected

Get destination connection count.

Returns
Total destinations connections count.

◆ GetDstType()

FBConnectionType GetDstType ( int  pIndex)
protected

Get a destination connection's type at specified index.

Parameters
pIndexIndex of the destination connection's type.
Returns
Destination connection's type at specified index.

◆ GetInternalClassId()

static int GetInternalClassId ( )
staticprotected

Internal class Id.

◆ GetOwned()

FBPlug* GetOwned ( int  pIndex)
protected

Get the owned plug at specified index.

Parameters
pIndexIndex of the owned plug to get.
Returns
The owned plug at specified index.

◆ GetOwnedCount()

int GetOwnedCount ( )
protected

Get the owned plug count.

Returns
The owned plug count.

◆ GetOwner()

FBPlug* GetOwner ( )
protected

Get the owner of this plug.

Very useful for properties since they are plugs too.

Returns
The owner of this plug.

◆ GetPlugConnectionModifiedList()

int GetPlugConnectionModifiedList ( FBPlugList pPlugList,
FBPlugModificationFlag  pConnectionModificatonFlag,
bool  pAddRemove 
)
protected

Get plug's modified src/dst property/object connection added/removed List.

Parameters
pPlugListplug list to fill up.
pConnectionModificatonFlagSrc/Dst Property/Object connection modification flag.
pAddRemoveAsk for the added list if true, removed list if false.
Returns
count of list;

◆ GetSelfModified()

bool GetSelfModified ( FBPlugModificationFlag  pFlag)
protected

Tell if the plug's self has changed.

Parameters
pFlagbitwise AND of self modification flags.
Returns
true if self changed

◆ GetSrc()

FBPlug* GetSrc ( int  pIndex)
protected

Get a source connection's plug at specified index.

Parameters
pIndexIndex of the source connection's plug.
Returns
Source plug at specified index.

◆ GetSrcCount()

int GetSrcCount ( )
protected

Get source connection count.

Returns
Total sources connections count.

◆ GetSrcType()

FBConnectionType GetSrcType ( int  pIndex)
protected

Get a source connection's type at specified index.

Parameters
pIndexIndex of the source connection's type.
Returns
Source connection's type at specified index.

◆ GetStatusFlag()

bool GetStatusFlag ( FBPlugStatusFlag  pStatus) const
protected

Tell if the plug's status has changed.

Parameters
pStatusbitwise AND of self modification flags.
Returns
true if self changed

◆ GetTypeId()

virtual int GetTypeId ( )
protectedvirtual

GetTypeId( int pTypeId )

Returns
The TypeInfo of the object

Reimplemented in FBCustomManager, and FBComponent.

◆ Is()

virtual bool Is ( int  pTypeId)
protectedvirtual

Is( int pTypeId )

Parameters
pTypeIdType Identification.
Returns
True if Plug is a Instance of pTypeId.

Reimplemented in FBCustomManager, and FBComponent.

◆ IsSDKComponent()

bool IsSDKComponent ( )
protected

Return whether or not item is an SDK component.

◆ MoveSrcAt() [1/2]

bool MoveSrcAt ( FBPlug pSrc,
FBPlug pAtSrc 
)
protected

Move source connection pSrc to the position of pAtSrc.

Parameters
pSrcPlug.
pAtSrcPlug that mark where we want to insert (will insert before this one).
Returns
A boolean indicating success (True) or failure (False).
Remarks
This is not like the swap function since the connection at pAtSrc is untouched.

◆ MoveSrcAt() [2/2]

bool MoveSrcAt ( int  pIndex,
int  pAtIndex 
)
protected

Move source connection at pIndex to pAtIndex.

Parameters
pIndexPlug current index.
pAtIndexPlug new index.
Returns
A boolean indicating success (True) or failure (False).
Remarks
This is not like the swap function since the connection at pAtIndex is untouched.

◆ PlugDataNotify()

virtual bool PlugDataNotify ( FBConnectionAction  pAction,
FBPlug pThis,
void *  pData = NULL,
void *  pDataOld = NULL,
int  pDataSize = 0 
)
protectedvirtual

PlugDataNotify when overloaded is equivalent of FBSystem.OnConnectionDataNotify but in the context of the derived object only.

Parameters
pActionPlug action, the event type.
pThisPlug concerned.
pDataCurrent data, meaning depends of plug action.
pDataOldPrevious data, meaning depends of plug action.
pDataSizeSize of data.
Returns
unused should return true

◆ PlugNotify()

virtual bool PlugNotify ( FBConnectionAction  pAction,
FBPlug pThis,
int  pIndex,
FBPlug pPlug = NULL,
FBConnectionType  pConnectionType = kFBConnectionTypeNone,
FBPlug pNewPlug = NULL 
)
protectedvirtual

PlugNotify when overloaded is equivalent of FBSystem.OnConnectionNotify but in the context of the derived object only.

Parameters
pActionPlug action, the event type.
pThisPlug concerned.
pIndexIndex of the plug.
pPlugOther plug concerned.
pConnectionTypeConnection type between the plugs.
pNewPlugNew plug (for the replace event).
Returns
should by default return true except in the case of connection requests (kFBRequestConnectSrc or kFBRequestConnectDst)

◆ PlugStateNotify()

virtual bool PlugStateNotify ( FBConnectionAction  pAction,
FBPlug pThis,
void *  pData = NULL,
void *  pDataOld = NULL,
int  pDataSize = 0 
)
protectedvirtual

PlugStateNotify when overloaded is equivalent of FBSystem.OnConnectionStateNotify but in the context of the derived object only.

Parameters
pActionPlug action, the event type.
pThisPlug concerned.
pDataCurrent data, meaning depends of plug action.
pDataOldPrevious data, meaning depends of plug action.
pDataSizeSize of data.
Returns
unused should return true except in the case of property rename kFBRename

◆ ReplaceDstAt()

bool ReplaceDstAt ( int  pIndex,
FBPlug pDst 
)
protected

Replace a destination connection at a specified index.

Parameters
pIndexDestination plug index.
pDstPlug that will replace the other at index.
Returns
A boolean indicating success (True) or failure (False).

◆ ReplaceSrcAt()

bool ReplaceSrcAt ( int  pIndex,
FBPlug pSrc 
)
protected

Replace a source connection at a specified index.

Parameters
pIndexSource plug index.
pSrcPlug that will replace the other at index.
Returns
A boolean indicating success (True) or failure (False).

◆ RevertModification()

bool RevertModification ( FBPlugModificationFlag  pFlag = kFBAllModifiedMask)
protected

Revert the plug's modification to original status.

Parameters
pFlagthe type of modification to be reverted.
Returns
true if revert successfully.

◆ SetContentModified()

void SetContentModified ( FBPlugModificationFlag  pFlag,
bool  pBool 
)
protected

Set the plug's owned property/object's modification flag.

Parameters
pFlagbitwise AND of content modification flags.
pBooltrue if content has modification.

◆ SetSelfModified()

void SetSelfModified ( FBPlugModificationFlag  pFlag,
bool  pBool 
)
protected

Set the plug's self modification flag.

Parameters
pFlagbitwise AND of self modification flags.
pBooltrue if self changed.

◆ SetStatusFlag()

void SetStatusFlag ( FBPlugStatusFlag  pStatus,
bool  pValue 
)
protected

Set the plug's status flag.

Parameters
pStatusbitwise AND of status flags.
pValuetrue if status has modification.

◆ SwapSrc()

bool SwapSrc ( int  pIndexA,
int  pIndexB 
)
protected

Swap source connection at index A with source connection at index B.

Parameters
pIndexAPlug index.
pIndexBOther plug index.
Returns
A boolean indicating success (True) or failure (False).

Member Data Documentation

◆ ClassGroupName

const char* ClassGroupName
staticprotected

ClassGroupName of the object.

Definition at line 466 of file fbplug.h.

◆ mAllocated

bool mAllocated
protected

Contain the Allocation State of the Component.

Definition at line 472 of file fbplug.h.

◆ mGlobalTypeInfo

int mGlobalTypeInfo
staticprotected

Represente the Type Index.

Definition at line 522 of file fbplug.h.

◆ mObject

HIObject mObject
protected

Handle on the Plug.

Definition at line 524 of file fbplug.h.

◆ mSDKComponent

bool mSDKComponent
protected

bool Plug is an SDK component.

Definition at line 525 of file fbplug.h.

◆ TypeInfo

int TypeInfo
staticprotected

TypeInfo.

Definition at line 469 of file fbplug.h.


The documentation for this class was generated from the following file: