HOpCameraZoomBox

Functions

HOpCameraZoomBox

~HOpCameraZoomBox

char const *

GetName

int

OnLButtonUp

int

OnLButtonDblClk

void

SetLightFollowsCamera

bool

GetLightFollowsCamera

HBaseOperator *

Clone

bool

EnforceMinCameraSize

void

SetEnforceMinCameraSize

Detailed Description

class HOpCameraZoomBox : public HOpConstructRectangle

The HOpCameraZoomBox class zooms the camera to a selected area.

HOpCameraZoomBox utilizes the drawing functionality of HOpConstructRectangle to define a selection rectangle, and then extends HOpConstructRectangle::OnLButtonUp to calculate a zoom factor and direction.

The operation consists of the following steps:

  1. Left Button Down: Registers the first point of the selection rectangle.

  2. Left Button Down and Drag: Rubberbands the rectangle to desired dimensions.

  3. Left Button Up: The is viewpoint calculated, camera position changed and the operation ends.

IMPORTANT:

Internally, this operator uses single-precision calculations. When using this operator in a scene with very large coordinates (such as GPS coordinates), you may experience irregular behavior due to precision errors. The issue arises when the size of the camera is very small relative to the distance of the geometry from the origin. When comparing a very large number to a very small number using single precision float math, the small number can effectively “disappear”, leading to errors in calculations.

3DF provides a double-precision API to get around these issues, but the double-precision portion of the API does not extend to MVO operators. Therefore, to address the problem using this operator, you can set the m_enforceMinCameraSize flag to “false” using the SetEnforceMinCameraSize function.

Public Functions

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

Constructs an HOpCameraZoomBox 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 ~HOpCameraZoomBox()
virtual char const *GetName()
Returns

A pointer to a character string denoting the name of the operator which is ‘HOpCameraZoomBox’.

virtual int OnLButtonUp(HEventInfo &hevent)

OnLButtonUp passes rectangle information from HOpConstructRectangle to the HOOPS routine #HC_Compute_Selection_By_Area, then uses the information from the selection list to move the camera and point it in the right direction.

Parameters

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

Returns

An HOperatorReturn indicating the status of the event.

virtual int OnLButtonDblClk(HEventInfo &hevent)

OnLButtonDblClk points the camera at the location where the mouse is double clicked.

Parameters

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

Returns

An HOperatorReturn indicating the status of the event.

inline void 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.

inline bool GetLightFollowsCamera()
Returns

True if the light follows the camera or false if it doesn’t.

virtual HBaseOperator *Clone()

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 HOpCameraZoom object.

inline bool EnforceMinCameraSize() const

Returns the current ‘EnforceMinCameraSize’ setting.

inline void SetEnforceMinCameraSize(bool enforceMinCameraSize)

Specifies whether the zoom calculation should attempt to prevent camera field from becoming too small. This mode is enabled by default.