HOpCameraZoomBox
-
class
HOpCameraZoomBox The
HOpCameraZoomBoxclass zooms the camera to a selected area.HOpCameraZoomBoxutilizes the drawing functionality ofHOpConstructRectangleto define a selection rectangle, and then extendsHOpConstructRectangle::OnLButtonUpto calculate a zoom factor and direction.The operation consists of the following steps:
- Left Button Down: Registers the first point of the selection rectangle.
- Left Button Down and Drag: Rubberbands the rectangle to desired dimensions.
- 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.
Inherits from:
HOpConstructRectangle
Methods
-
HOpCameraZoomBox::HOpCameraZoomBox(HBaseView *view, int DoRepeat = 0, int DoCapture = 1) Constructs an
HOpCameraZoomBoxobject.Parameters
view: A pointer to an
HBaseViewobject.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::~HOpCameraZoomBox() virtual
-
virtual char const *
HOpCameraZoomBox::GetName() virtual
Returns
A pointer to a character string denoting the name of the operator which is ‘HOpCameraZoomBox‘.
-
virtual int
HOpCameraZoomBox::OnLButtonUp(HEventInfo &hevent) virtual
OnLButtonUp passes rectangle information from
HOpConstructRectangleto 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: AnHEventInfoobject containing information about the current event.Returns
AnHOperatorReturnindicating the status of the event.
-
virtual int
HOpCameraZoomBox::OnLButtonDblClk(HEventInfo &hevent) virtual
OnLButtonDblClk points the camera at the location where the mouse is double clicked.
Parameters
hevent: AnHEventInfoobject containing information about the current event.Returns
AnHOperatorReturnindicating the status of the event.
-
void
HOpCameraZoomBox::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
HOpCameraZoomBox::GetLightFollowsCamera() Returns
True if the light follows the camera or false if it doesn’t.
-
virtual HBaseOperator *
HOpCameraZoomBox::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 createdHOpCameraZoomobject.
-
bool
HOpCameraZoomBox::EnforceMinCameraSize() const const
Returns the current ‘EnforceMinCameraSize’ setting.
-
void
HOpCameraZoomBox::SetEnforceMinCameraSize(bool enforceMinCameraSize) Specifies whether the zoom calculation should attempt to prevent camera field from becoming too small. This mode is enabled by default.
-
bool
HOpCameraZoomBox::ComputeReasonableTarget(HPoint &new_tar, HPoint const &min, HPoint const &max, HPoint const &tar_orig) protected
-
void
HOpCameraZoomBox::ComputeNewField(float &width, float &height, HPoint min, HPoint max, HPoint const &new_tar) protected
Variables
-
bool
HOpCameraZoomBox::m_LightFollowsCamera protected
bool
-
bool
HOpCameraZoomBox::m_enforceMinCameraSize protected
bool