IVisualisationContext Class Referenceabstract

Visualisation manager interface for plugin objects. More...

Inherits IKernelObject.

Public Member Functions

virtual OpenViBE::boolean setToolbar (::GtkWidget *pToolbarWidget)=0
 Set toolbar widget used by a plugin. More...
 
virtual OpenViBE::boolean setWidget (::GtkWidget *pTopmostWidget)=0
 Set topmost widget used by a plugin. More...
 
virtual OpenViBE::CIdentifier create3DWidget (::GtkWidget *&p3DWidget)=0
 Create a 3D widget. More...
 
virtual OpenViBE::boolean is3DWidgetRealized (const OpenViBE::CIdentifier &rWidgetIdentifier) const =0
 Request 3D widget realization status. More...
 
virtual OpenViBE::boolean createResourceGroup (OpenViBE::CIdentifier &rResourceGroupIdentifier, const OpenViBE::CString &rResourceGroupName)=0
 Create a resource group. More...
 
virtual OpenViBE::boolean addResourceLocation (const OpenViBE::CIdentifier &rResourceGroupIdentifier, const OpenViBE::CString &rPath, OpenViBE::Kernel::EResourceType type, bool bRecursive)=0
 Add a resource location. More...
 
virtual OpenViBE::boolean addResourceLocationFromFile (const OpenViBE::CIdentifier &rResourceGroupIdentifier, const OpenViBE::CString &rResourcesFileName)=0
 Add resource locations from a file. More...
 
virtual OpenViBE::boolean initializeResourceGroup (const OpenViBE::CIdentifier &rResourceGroupIdentifier)=0
 Initialize resource group. More...
 
virtual OpenViBE::boolean destroyResourceGroup (const OpenViBE::CIdentifier &rResourceGroupIdentifier)=0
 Destroy resource group. More...
 
virtual OpenViBE::boolean update3DWidget (const OpenViBE::CIdentifier &rWidgetIdentifier)=0
 Update 3D window. More...
 
virtual OpenViBE::boolean setBackgroundColor (const OpenViBE::CIdentifier &rWidgetIdentifier, OpenViBE::float32 f32ColorRed, OpenViBE::float32 f32ColorGreen, OpenViBE::float32 f32ColorBlue)=0
 Set background color of a 3D widget. More...
 
virtual OpenViBE::boolean setCameraToEncompassObjects (const OpenViBE::CIdentifier &rWidgetIdentifier)=0
 Set camera position so that it encompasses all scene objects. More...
 
virtual OpenViBE::boolean setCameraSphericalCoordinates (const OpenViBE::CIdentifier &rWidgetIdentifier, OpenViBE::float32 f32Theta, OpenViBE::float32 f32Phi, OpenViBE::float32 f32Radius)=0
 Set camera spherical coordinates. More...
 
virtual OpenViBE::CIdentifier createObject (const OpenViBE::CString &rObjectFileName, const CNameValuePairList *pObjectParams=NULL)=0
 Create a new 3D object. More...
 
virtual OpenViBE::CIdentifier createObject (const OpenViBE::Kernel::EStandard3DObject eStandard3DObject, const CNameValuePairList *pObjectParams=NULL)=0
 Create a new 3D object. More...
 
virtual OpenViBE::boolean removeObject (const OpenViBE::CIdentifier &rIdentifier)=0
 Remove a 3D object. More...
 
virtual OpenViBE::boolean setObjectVisible (const OpenViBE::CIdentifier &rIdentifier, OpenViBE::boolean bVisible)=0
 Set visibility of a 3D object. More...
 
virtual OpenViBE::boolean setObjectPosition (const OpenViBE::CIdentifier &rIdentifier, OpenViBE::float32 f32PositionX, OpenViBE::float32 f32PositionY, OpenViBE::float32 f32PositionZ)=0
 Set the position of an object. More...
 
virtual OpenViBE::boolean setObjectOrientation (const OpenViBE::CIdentifier &rIdentifier, OpenViBE::float32 f32OrientationX, OpenViBE::float32 f32OrientationY, OpenViBE::float32 f32OrientationZ, OpenViBE::float32 f32OrientationW)=0
 Set the orientation of an object. More...
 
virtual OpenViBE::boolean setObjectScale (const OpenViBE::CIdentifier &rIdentifier, OpenViBE::float32 f32ScaleX, OpenViBE::float32 f32ScaleY, OpenViBE::float32 f32ScaleZ)=0
 Set the scale of an object. More...
 
virtual OpenViBE::boolean setObjectScale (const OpenViBE::CIdentifier &rIdentifier, OpenViBE::float32 f32Scale)=0
 Set the uniform scale of an object. More...
 
virtual OpenViBE::boolean setObjectColor (const OpenViBE::CIdentifier &rIdentifier, OpenViBE::float32 f32ColorRed, OpenViBE::float32 f32ColorGreen, OpenViBE::float32 f32ColorBlue)=0
 Set the color of an object. More...
 
virtual OpenViBE::boolean setObjectTransparency (const OpenViBE::CIdentifier &rIdentifier, OpenViBE::float32 f32Transparency)=0
 Set the transparency of an object. More...
 
virtual OpenViBE::boolean setObjectVertexColorArray (const OpenViBE::CIdentifier &rIdentifier, OpenViBE::uint32 ui32VertexColorCount, const OpenViBE::float32 *pVertexColorArray)=0
 Set vertex colors of an object. More...
 
virtual OpenViBE::boolean getCameraSphericalCoordinates (const OpenViBE::CIdentifier &rWidgetIdentifier, OpenViBE::float32 &rTheta, OpenViBE::float32 &rPhi, OpenViBE::float32 &rRadius)=0
 Get camera spherical coordinates. More...
 
virtual OpenViBE::boolean getObjectAxisAlignedBoundingBox (const OpenViBE::CIdentifier &rIdentifier, OpenViBE::float32 *pMinimum, OpenViBE::float32 *pMaximum)=0
 Get object axis aligned bounding box. More...
 
virtual OpenViBE::boolean getObjectVertexCount (const OpenViBE::CIdentifier &rIdentifier, OpenViBE::uint32 &ui32VertexCount) const =0
 Get object vertex count. More...
 
virtual OpenViBE::boolean getObjectVertexPositionArray (const OpenViBE::CIdentifier &rIdentifier, OpenViBE::uint32 ui32VertexPositionCount, OpenViBE::float32 *pVertexPositionArray) const =0
 Get vertex position array. More...
 

Detailed Description

Visualisation manager interface for plugin objects.

Author
Vincent Delannoy (INRIA/IRISA)
Date
2007-11

Member Function Documentation

virtual OpenViBE::boolean setToolbar ( ::GtkWidget *  pToolbarWidget)
pure virtual

Set toolbar widget used by a plugin.

Parameters
pToolbarWidgetPointer to toolbar widget
Returns
True if widget was successfully set, false otherwise
virtual OpenViBE::boolean setWidget ( ::GtkWidget *  pTopmostWidget)
pure virtual

Set topmost widget used by a plugin.

Parameters
pTopmostWidgetPointer to topmost widget
Returns
True if widget was successfully set, false otherwise
virtual OpenViBE::CIdentifier create3DWidget ( ::GtkWidget *&  p3DWidget)
pure virtual

Create a 3D widget.

Parameters
[out]p3DWidgetPointer to a 3D widget
Returns
True if 3D widget was successfully created, false otherwise
virtual OpenViBE::boolean is3DWidgetRealized ( const OpenViBE::CIdentifier rWidgetIdentifier) const
pure virtual

Request 3D widget realization status.

Parameters
[in]rWidgetIdentifieridentifier of the 3D widget which has to be tested
Returns
True if the widget has been realized.
False if the widget has not been realized.
virtual OpenViBE::boolean createResourceGroup ( OpenViBE::CIdentifier rResourceGroupIdentifier,
const OpenViBE::CString rResourceGroupName 
)
pure virtual

Create a resource group.

Parameters
[out]rResourceGroupIdentifierIdentifier of resource group created
[in]rResourceGroupNameResource group name
Returns
True if resource group could be created, false otherwise
virtual OpenViBE::boolean addResourceLocation ( const OpenViBE::CIdentifier rResourceGroupIdentifier,
const OpenViBE::CString rPath,
OpenViBE::Kernel::EResourceType  type,
bool  bRecursive 
)
pure virtual

Add a resource location.

Remarks
Resources can't be added once Resource Group has been initialized
Parameters
rResourceGroupIdentifierResource group identifier
rPathResources location path
typeResources type (path or zip file)
bRecursiveResources are added recursively from location passed in parameter if true
Returns
True if resource location could be added, false otherwise
virtual OpenViBE::boolean addResourceLocationFromFile ( const OpenViBE::CIdentifier rResourceGroupIdentifier,
const OpenViBE::CString rResourcesFileName 
)
pure virtual

Add resource locations from a file.

Remarks
Resources can't be added once Resource Group has been initialized
Parameters
rResourceGroupIdentifierResource group identifier
rResourcesFileNameResources file in OV format
Returns
True if location could be added, false otherwise
virtual OpenViBE::boolean initializeResourceGroup ( const OpenViBE::CIdentifier rResourceGroupIdentifier)
pure virtual

Initialize resource group.

Remarks
Each call to this method increments the group's internal reference counter. When it is set to one (upon first call to this method) the group is actually initialized, but isn't upon subsequent calls. It has to be destroyed (its ref count set back to 0) and recreated to be reinitialized.
Parameters
rResourceGroupIdentifierResource group identifier
Returns
True if resource group could be initialized (or was initialized already), false if an error occurred
virtual OpenViBE::boolean destroyResourceGroup ( const OpenViBE::CIdentifier rResourceGroupIdentifier)
pure virtual

Destroy resource group.

Remarks
Each call to this method decrements the group's internal reference counter. Only when this counter reaches 0 is the group actually destroyed.
Parameters
rResourceGroupIdentifierResource group identifier
Returns
True if resource group could be destroyed (or was initialized already), false if an error occurred
virtual OpenViBE::boolean update3DWidget ( const OpenViBE::CIdentifier rWidgetIdentifier)
pure virtual

Update 3D window.

Parameters
rWidgetIdentifierIdentifier of 3D widget to be refreshed
Returns
True if widget could be refreshed
virtual OpenViBE::boolean setBackgroundColor ( const OpenViBE::CIdentifier rWidgetIdentifier,
OpenViBE::float32  f32ColorRed,
OpenViBE::float32  f32ColorGreen,
OpenViBE::float32  f32ColorBlue 
)
pure virtual

Set background color of a 3D widget.

Parameters
rWidgetIdentifierIdentifier of 3D widget
f32ColorRedRed component (0 to 1)
f32ColorGreenGreen component (0 to 1)
f32ColorBlueBlue component (0 to 1)
Returns
True if background color could be set, false otherwise
virtual OpenViBE::boolean setCameraToEncompassObjects ( const OpenViBE::CIdentifier rWidgetIdentifier)
pure virtual

Set camera position so that it encompasses all scene objects.

Remarks
This method also sets translation speed so that it is proportionate to scene size
Parameters
rWindowIdentifierIdentifier of 3D widget whose camera is to be set
Returns
True if camera could be set, false otherwise
virtual OpenViBE::boolean setCameraSphericalCoordinates ( const OpenViBE::CIdentifier rWidgetIdentifier,
OpenViBE::float32  f32Theta,
OpenViBE::float32  f32Phi,
OpenViBE::float32  f32Radius 
)
pure virtual

Set camera spherical coordinates.

Parameters
rWindowIdentifierIdentifier of 3D widget whose camera is to be set
rThetaCamera theta angle, in degrees
rPhiCamera phi angle, in degrees
rRadiusDistance of camera from origin
Returns
True if camera parameters could be set
virtual OpenViBE::CIdentifier createObject ( const OpenViBE::CString rObjectFileName,
const CNameValuePairList pObjectParams = NULL 
)
pure virtual

Create a new 3D object.

Possible parameters to store in pObjectParams include :

  • "CloneMesh" (true/false, false by default) : set to true to clone object mesh. This avoids mesh-level changes (e.g. vertex color modification) to affect more than a single object.
  • "CloneMaterials" (true/false, false by default) : set to true to clone object materials. This avoids material-level changes to affect more than a single object.
  • "VertexBufferUsage" ("Static"/"Dynamic", "Static" by default). Set to "Dynamic" in case vertex buffers must be accessed regularly for reading or writing (e.g. to get vertex array or set vertex colors).
  • "IndexBufferUsage" ("Static"/"Dynamic", "Static" by default). Set to "Dynamic" in case index buffers must be accessed regularly for reading or writing (e.g. to get triangle indices).
    Parameters
    rObjectFileNameFilename (without extension) from which to load object In practice, filename must refer to a .mesh file since 3D rendering is based on the Ogre render engine.
    pObjectParamsOptional object parameters
    Returns
    Identifier of newly created object, or OV_UndefinedIdentifier if failed
virtual OpenViBE::CIdentifier createObject ( const OpenViBE::Kernel::EStandard3DObject  eStandard3DObject,
const CNameValuePairList pObjectParams = NULL 
)
pure virtual

Create a new 3D object.

Possible parameters to store in pObjectParams include :

  • "CloneMesh" (true/false, false by default) : set to true to clone object mesh. This avoids mesh-level changes (e.g. vertex color modification) to affect more than a single object.
  • "CloneMaterials" (true/false, false by default) : set to true to clone object materials. This avoids material-level changes to affect more than a single object.
  • "VertexBufferUsage" ("Static"/"Dynamic", "Static" by default). Set to "Dynamic" in case vertex buffers must be accessed regularly for reading or writing (e.g. to get vertex array or set vertex colors).
  • "IndexBufferUsage" ("Static"/"Dynamic", "Static" by default). Set to "Dynamic" in case index buffers must be accessed regularly for reading or writing (e.g. to get triangle indices).
    Parameters
    rObjectFileNameFilename (without extension) from which to load object In practice, filename must refer to a .mesh file since 3D rendering is based on the Ogre render engine.
    pObjectParamsOptional object parameters
    Returns
    Identifier of newly created object, or OV_UndefinedIdentifier if failed
    Parameters
    eStandard3DObjectEnumeration member of standard object to create
    pObjectParamsOptional object parameters (see CString-based createObject method for details)
    Returns
    Identifier of newly created object, or OV_UndefinedIdentifier if failed
virtual OpenViBE::boolean removeObject ( const OpenViBE::CIdentifier rIdentifier)
pure virtual

Remove a 3D object.

Parameters
rIdentifierIdentifier of object to remove from 3D scene
Returns
True if object was successfully removed, false otherwise
virtual OpenViBE::boolean setObjectVisible ( const OpenViBE::CIdentifier rIdentifier,
OpenViBE::boolean  bVisible 
)
pure virtual

Set visibility of a 3D object.

Parameters
rIdentifierIdentifier of object which visibility is to be set
bVisibleVisibility flag
Returns
True if object visibility could be set, false otherwise
virtual OpenViBE::boolean setObjectPosition ( const OpenViBE::CIdentifier rIdentifier,
OpenViBE::float32  f32PositionX,
OpenViBE::float32  f32PositionY,
OpenViBE::float32  f32PositionZ 
)
pure virtual

Set the position of an object.

Parameters
rIdentifierIdentifier of the object the position of which is to be set
f32PositionXX coordinate of position
f32PositionYY coordinate of position
f32PositionZZ coordinate of position
Returns
True if object position could be set, false otherwise
virtual OpenViBE::boolean setObjectOrientation ( const OpenViBE::CIdentifier rIdentifier,
OpenViBE::float32  f32OrientationX,
OpenViBE::float32  f32OrientationY,
OpenViBE::float32  f32OrientationZ,
OpenViBE::float32  f32OrientationW 
)
pure virtual

Set the orientation of an object.

Parameters
rIdentifierIdentifier of the object the orientation of which is to be set
f32OrientationXX component of a quaternion
f32OrientationYY component of a quaternion
f32OrientationZZ component of a quaternion
f32OrientationWW component of a quaternion
Returns
True if orientation could be set, false otherwise
virtual OpenViBE::boolean setObjectScale ( const OpenViBE::CIdentifier rIdentifier,
OpenViBE::float32  f32ScaleX,
OpenViBE::float32  f32ScaleY,
OpenViBE::float32  f32ScaleZ 
)
pure virtual

Set the scale of an object.

Parameters
rIdentifierIdentifier of the object the scale of which is to be set
f32ScaleXX component of scale
f32ScaleYY component of scale
f32ScaleZZ component of scale
Returns
True if scale could be set, false otherwise
virtual OpenViBE::boolean setObjectScale ( const OpenViBE::CIdentifier rIdentifier,
OpenViBE::float32  f32Scale 
)
pure virtual

Set the uniform scale of an object.

Parameters
rIdentifierIdentifier of the object the scale of which is to be set
f32ScaleUniform scale to be set
Returns
True if uniform scale could be set, false otherwise
virtual OpenViBE::boolean setObjectColor ( const OpenViBE::CIdentifier rIdentifier,
OpenViBE::float32  f32ColorRed,
OpenViBE::float32  f32ColorGreen,
OpenViBE::float32  f32ColorBlue 
)
pure virtual

Set the color of an object.

Parameters
rIdentifierIdentifier of the object the color of which is to be set
f32ColorRedRed component (0 to 1)
f32ColorGreenGreen component (0 to 1)
f32ColorBlueBlue component (0 to 1)
Returns
True if color could be set, false otherwise
virtual OpenViBE::boolean setObjectTransparency ( const OpenViBE::CIdentifier rIdentifier,
OpenViBE::float32  f32Transparency 
)
pure virtual

Set the transparency of an object.

Parameters
rIdentifierIdentifier of the object the transparency of which is to be set
f32TransparencyTransparency (0 to 1, 1 being totally transparent)
Returns
True if transparency could be set, false otherwise
virtual OpenViBE::boolean setObjectVertexColorArray ( const OpenViBE::CIdentifier rIdentifier,
OpenViBE::uint32  ui32VertexColorCount,
const OpenViBE::float32 *  pVertexColorArray 
)
pure virtual

Set vertex colors of an object.

Remarks
This method applies vertex colors to the first mesh of the first Ogre::Entity encountered in the object hierarchy only. For it to work, the Ogre::Mesh needs to have been flagged as using vertex colors in authoring tools.
Parameters
rIdentifierIdentifier of the object whose vertex colors are to be set
ui32VertexColorCountNumber of colors contained in pVertexColorArray
pVertexColorArrayArray of color triplets
Returns
True if colors could be set, false otherwise
virtual OpenViBE::boolean getCameraSphericalCoordinates ( const OpenViBE::CIdentifier rWidgetIdentifier,
OpenViBE::float32 &  rTheta,
OpenViBE::float32 &  rPhi,
OpenViBE::float32 &  rRadius 
)
pure virtual

Get camera spherical coordinates.

Parameters
rWindowIdentifierIdentifier of 3D widget whose camera is to be set
rThetaCamera theta angle, in degrees
rPhiCamera phi angle, in degrees
rRadiusDistance of camera from origin
Returns
True if camera parameters could be retrieved
virtual OpenViBE::boolean getObjectAxisAlignedBoundingBox ( const OpenViBE::CIdentifier rIdentifier,
OpenViBE::float32 *  pMinimum,
OpenViBE::float32 *  pMaximum 
)
pure virtual

Get object axis aligned bounding box.

Parameters
rIdentifierIdentifier of the object whose AABB is to be retrieved
pMinimumXYZ vector of AABB minimum boundaries
pMaximumXYZ vector of AABB maximum boundaries
Returns
True if vertex count could be retrieved, false otherwise
virtual OpenViBE::boolean getObjectVertexCount ( const OpenViBE::CIdentifier rIdentifier,
OpenViBE::uint32 &  ui32VertexCount 
) const
pure virtual

Get object vertex count.

Remarks
This method returns the number of vertices in the first mesh of the first Ogre::Entity encountered in the object hierarchy only.
Parameters
rIdentifierIdentifier of the object whose vertex count is to be retrieved
ui32VertexCountNumber of vertices found in first mesh of first entity
Returns
True if vertex count could be retrieved, false otherwise
virtual OpenViBE::boolean getObjectVertexPositionArray ( const OpenViBE::CIdentifier rIdentifier,
OpenViBE::uint32  ui32VertexPositionCount,
OpenViBE::float32 *  pVertexPositionArray 
) const
pure virtual

Get vertex position array.

Remarks
This method returns vertex positions of the first mesh of the first Ogre::Entity encountered in the object hierarchy only.
Parameters
rIdentifierIdentifier of the object whose vertex positions are to be retrieved
pVertexPositionArrayPreallocated array destined to store vertex position triplets
Returns
True if vertex positions could be retrieved, false otherwise