Class: cTTAPIListener


When using the Motive API, you can attach or detach cTTAPIListener class to a project by using the following functions.

Member Functions[edit]


TTAPIFrameAvailable[edit]

TTAPIFrameAvailable callback is called when a new synchronized group of camera frames has been delivered to the TTAPI and is ready for processing. You can use this notification to then call TT_Update() without having to poll blindly for new data.

TTAPICameraConnected[edit]

This callback function is called when a new camera is connected to the system.

TTAPICameraDisconnected[edit]

This callback function is called when a camera is disconnected from the system.

InitialPointCloud[edit]

InitialPointCloud is called when the initial point cloud is calculated from the connected cameras. During this callback 3D markers can be added (up to MaxMarkers) or removed by modifying the Markers list as well as the MarkerCount variable. After this callback the marker list is passed onto the rigid body solver.

ApplyContinuousCalibrationResult[edit]

By overriding this function in the attached listener class, you can control when the continuous calibration gets applied. The continuous calibration will continue to call this callback function when the updated calibration is available. You can check parameters in this functions and simply return True to accept the updated calibration, and return False to discard the updated calibration.

Declaration: cTTAPIListener[edit]

 class TTAPI cTTAPIListener
{
public:
    cTTAPIListener();
    virtual ~cTTAPIListener();

    //== TTAPIFrameAvailable callback is called when a new synchronized group of camera frames has been delivered
    //== to the TTAPI and is ready for processing.  You can use this notification to then call TT_Update() without
    //== having to poll blindly for new data.

    virtual void TTAPIFrameAvailable();

    //== TTAPICameraConnected callback is called when a camera is connected.

    virtual void TTAPICameraConnected( int serialNumber );

    //== TTAPICameraConnected callback is called when a camera is connected.

    virtual void TTAPICameraDisconnected( int serialNumber );

    //== InitialPointCloud is called when the initial point cloud is calculated from the connected cameras. During
    //== this callback 3D markers can be added (up to MaxMarkers) or removed by modifying the Markers list as well
    //== as the MarkerCount variable.  After this callback the marker list is passed onto the rigid body solver.

    virtual void InitialPointCloud( Core::cMarker* markers, int &markerCount, int maxMarkers );

    //== When Continuous Calibration is enabled, this callback when an updated calibration is ready to be applied
    //== to the cameras.  This callback can be used to prevent the application of the updated calibration. Return
    //== true to apply the updated calibration. Return false to toss the updated calibration.  Continuous Calibration
    //== if enabled will continue and will call this callback when the next updated calibration is ready for application.

    virtual bool ApplyContinuousCalibrationResult();
};