Adaptors Base Class

<< Click to Display Table of Contents >>

Navigation:  XStream® HDVR® SDK > Implementation Concepts > Mouse Adaptors >

Adaptors Base Class

Previous pageReturn to chapter overviewNext page

C++ C++ Java Java .NET .NET

Summary

 

The XStream® HDVR® SDK provides a number of user interface adaptors that enable use of a mouse (or other mouse-like interface device) to interact with the rendering engine. These adaptors provide functionality to manipulate the camera and lighting, implement some segmentation operations, and adjust some volume rendering parameters.

 

Under the C++ API, all mouse adaptors are derived from the IMouseAdaptor abstract base class. The mouse adaptors are attached to a class that implements the IRenderParamsReciever interface. This is generally either an IRenderEngineContext or IRenderQueue object, although the user may define the class that implements the IRenderParamsReciever interface. Once created, an adaptor is attached to the render class with the IMouseAdaptor::SetRenderParamsReciever() method. This allows the adaptor to modify the RENDER_PARAMS structure associated with that render object. In this way, the adaptors interact with the render settings to accomplish mouse driven interface actions.

 

The IMouseAdaptor base class should not be created directly; it should be treated as an abstract base class. Instead, a user should create one of the functional classes derived from this base class.

 

Under the Java/.NET APIs, all mouse adaptors are derived from the hdrcAdaptor abstract base class. The mouse adaptors are attached to a class that implements the hdrcIRenderParamsReciever interface. This is generally either an hdrcRenderEngineContext or hdrcRenderQueue object, although the user may define the class that implements the hdrcRenderParamsReciever interface. An adaptor is attached to the render class as in input parameter to the appropriate adaptor's constructor method. This allows the adaptor to modify the RENDER_PARAMS structure associated with that render object. In this way the adaptors interact with the render settings to accomplish mouse driven interface actions.

 

The hdrcAdaptor base class should not be created directly, it should be treated as an abstract base class. Instead, a user should create one of the functional classes derived from this base class.

 

MouseAdaptor Base Class

 

All of the adaptors derived from the IMouseAdaptor base class support the following mouse event handlers.

 

IMouseAdaptor::SetRenderParamsReciever()

 

This method attaches the adaptor object to a class that supports the IRenderParamsReciever interface, usually an IRenderEngineContext or IRenderQueue object, allowing the adaptor to manipulate the RENDER_PARAMS structure associated with that render object. This method must be called before the mouse event handlers described below can affect the render and volume state.

 

IMouseAdaptor::MouseClicked()

 

This method should be called when the mouse is clicked in a render window.

 

IMouseAdaptor::MousePressed()

 

This method should be called when the mouse is first pressed in a render window.

 

IMouseAdaptor::MouseReleased()

 

This method should be called when the mouse is released in a render window.

 

IMouseAdaptor::MouseDragged()

 

This method should be called when the mouse is dragged (mouse button is down and the mouse is moved) in a render window.

 

IMouseAdaptor::MouseEntered()

 

This method should be called when the mouse enters the active area of a render window region.

 

IMouseAdaptor::MouseExited()

 

This method should be called when the mouse exits the active area of a render window region.

 

IMouseAdaptor::MouseMoved()

 

This method should be called when the mouse is moved (mouse button is up and the mouse is moved) in a render window.

 

IMouseAdaptor::MouseManuallyMoved()

 

This method should be called when one wants to programmatically move the mouse pointer to a new location, allowing mouse position adjustment that prevents the adaptor from changing positions suddenly. Essentially, this method adds the offset to the last mouse position to keep things smooth. Following is a use case example of this method: the user moves the mouse to the edge of the screen and wants to wrap it around to the other side of the image.

 

All of the adaptors derived from hdrcAdaptor support the following mouse event handlers.

 

hdrcAdaptor constructor

 

This method attaches the adaptor object to a class that supports the hdrcIRenderParamsReciever interface, usually a hdrcRenderEngineContext or hdrcRenderQueue object, allowing the adaptor to manipulate the RENDER_PARAMS structure associated with that render object.

 

hdrcAdaptor::mouseClicked()

 

This method should be called when the mouse is clicked in a render window.

 

hdrcAdaptor::mousePressed()

 

This method should be called when the mouse is first pressed in a render window.

 

hdrcAdaptor::mouseReleased()

 

This method should be called when the mouse is released in a render window.

 

hdrcAdaptor::mouseDragged()

 

This method should be called when the mouse is dragged (mouse button is down and the mouse is moved) in a render window.

 

hdrcAdaptor::mouseEntered()

 

This method should be called when the mouse enters the active area of a render window region.

 

hdrcAdaptor::mouseExited()

 

This method should be called when the mouse exits the active area of a render window region.

 

hdrcAdaptor::mouseMoved()

 

This method should be called when the mouse is moved (mouse button is up and the mouse is moved) in a render window.

 

hdrcAdaptor::mouseManuallyMoved()

                 

This method should be called when one wants to programmatically move the mouse pointer to a new location, allowing mouse position adjustment that prevents the adaptor from changing positions suddenly. Essentially, this method adds the offset to the last mouse position to keep things smooth. Following is a use case example of this method: the user moves the mouse to the edge of the screen and wants to wrap it around to the other side of the image.