HOpCameraOrbitTurntable

class HOpCameraOrbitTurntable

The HOpCameraOrbitTurntable class orbits the camera around a predefined vertical and horizontal axis.

HOpCameraOrbitTurntable takes the fixed “Top Axis” of its associated view and allows the user to rotate around it by dragging the mouse horizontally across the screen. With the mouse wheel the user can also rotate the scene around the horizontal view axis which is dependent on the current camera position

HOpCameraOrbitTurntable implements three mouse event methods defined on the base class and maps the event information to HOOPS camera routines. This operation consists of the following steps:

  1. Left Button Down: The orbit is initiated.
  2. Left Button Down and Drag: The camera orbits.
  3. Left Button Up: The operation ends.

More Detailed Description: see event methods

Inherits from: HBaseOperator

Methods

HOpCameraOrbitTurntable::HOpCameraOrbitTurntable(HBaseView *view, int DoRepeat = 0, int DoCapture = 1)

Constructs an HOpCameraOrbitTurntable object.

Parameters

view: A pointer to an HBaseView object.

DoRepeat: An integer denoting whether this is a repeatable operator. This parameter has been deprecated.

DoCapture: An integer denoting whether the mouse state should be captured, which means that all mouse events should be received after a mousedown, even if it leaves the window. This parameter has been deprecated.

virtual HOpCameraOrbitTurntable::~HOpCameraOrbitTurntable()

virtual

virtual char const *HOpCameraOrbitTurntable::GetName()

virtual

Returns

A pointer to a character string denoting the name of the operator which is ‘HOpCameraOrbitTurntable‘.
virtual int HOpCameraOrbitTurntable::OnLButtonDown(HEventInfo &hevent)

virtual

OnLButtonDown records the initial mouse position.

Parameters

hevent: An HEventInfo object containing information about the current event.

Returns

An HOperatorReturn indicating the status of the event.
virtual int HOpCameraOrbitTurntable::OnLButtonDownAndMove(HEventInfo &hevent)

virtual

OnLButtonDownAndMove records points as the mouse is moved and calculates the values used for rotating the camera by modifying the camera’s target and position.

Parameters

hevent: An HEventInfo object containing information about the current event.

Returns

An HOperatorReturn indicating the status of the event.
virtual int HOpCameraOrbitTurntable::OnLButtonUp(HEventInfo &hevent)

virtual

OnLButtonUp Clean up.

Parameters

hevent: An HEventInfo object containing information about the current event.

Returns

An HOperatorReturn indicating the status of the event.
virtual int HOpCameraOrbitTurntable::OnMouseWheel(HEventInfo &hevent)

virtual

OnMouseWheel OnMouseWheel performs rotation around the horizontal view axis

Parameters

hevent: An HEventInfo object containing information about the current event.

Returns

An HOperatorReturn indicating the status of the event.
void HOpCameraOrbitTurntable::SetLightFollowsCamera(bool follow)

SetLightFollowsCamera sets the lights to follow the camera or to stay in one place during orbit. This has the effect of either lighting the scene during orbit or allowing the camera to move through shadow. The default is off.

Parameters

follow: Pass true to have the light follow the camera.
bool HOpCameraOrbitTurntable::GetLightFollowsCamera()

Returns

True if the light follows the camera or false if it doesn’t.
void HOpCameraOrbitTurntable::SetCenter(HPoint center)

Sets the center of rotation for the horizontal and vertical rotation

Parameters

center: Center Point
void HOpCameraOrbitTurntable::UnSetCenter()

Indicates if center of rotation is set externally. If not set center of rotation will be calculated based on scene bounding box

virtual HBaseOperator *HOpCameraOrbitTurntable::Clone()

virtual

Creates a new operator which is a copy of the current operator. The user is responsible for deleting the newly created operator.

Returns

A pointer to the newly created HOpCameraOrbitTurntable object.
void HOpCameraOrbitTurntable::RotateAroundAxis(HPoint axis, float rf)

protected

Rotates camera around given axis

Parameters

axis: Axis to rotate around

rf: Angle of rotation

Variables

bool HOpCameraOrbitTurntable::m_LightFollowsCamera

private

bool
bool HOpCameraOrbitTurntable::m_bDoOnce

private

bool
bool HOpCameraOrbitTurntable::m_bCenterPointSet

private

bool
HPoint HOpCameraOrbitTurntable::m_Center

private