HOpConstructRectangle
-
class
HOpConstructRectangle The
HOpConstructRectangleclass draws a rectangle.HOpConstructRectangleimplements three of the mouse button event handlers and uses the event information to draw a rectangle. This provides the basic functionality for drawing a temporary, overlayed 2-D box outline in the view plane based on first and last pointer positions. The operation consists of the following steps:- Left Button Down: Registers the first point of the rectangle.
- Left Button Down and Drag: Rubberbands the rectangle to the desired dimensions.
- Left Button Up: The rectangle finalized and the polyline primitive used to represent the rectangle is flushed from the scene.
More Detailed Description: see event methods.
Inherits from:
HBaseOperator
Methods
-
HOpConstructRectangle::HOpConstructRectangle(HBaseView *view, int DoRepeat = 0, int DoCapture = 1, bool UseCenterMarker = true) Constructs an
HOpConstructRectangleobject.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.
UseCenterMarker: Pass true if you want HOOPS to render a mark at the center of the rectangle.
-
virtual
HOpConstructRectangle::~HOpConstructRectangle() virtual
-
virtual char const *
HOpConstructRectangle::GetName() virtual
Returns
A pointer to a character string denoting the name of the operator, which is ‘HOpConstructRectangle‘.
-
virtual HBaseOperator *
HOpConstructRectangle::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 createdHOpConstructRectangleobject.
-
virtual int
HOpConstructRectangle::OnLButtonDown(HEventInfo &hevent) virtual
OnLButtonDown records the first mouse position and initiates the rectangle-drawing mechanism.
Parameters
hevent: AnHEventInfoobject containing information about the current event.Returns
AnHOperatorReturnindicating the status of the event.
-
virtual int
HOpConstructRectangle::OnLButtonDownAndMove(HEventInfo &hevent) virtual
OnLButtonDownAndMove draws a rubberbanded line from the first point in the rectangle to the current mouse position. Note that the basic drawing work is done by
HUtility::InsertRectangle, while OnLButtonDownAndMove keeps track of the current points and draws the rubberband centroid.Parameters
hevent: AnHEventInfoobject containing information about the current event.Returns
AnHOperatorReturnindicating the status of the event.
-
virtual int
HOpConstructRectangle::OnLButtonUp(HEventInfo &hevent) virtual
OnLButtonUp finalizes the size of the rectangle and cleans up.
Parameters
hevent: AnHEventInfoobject containing information about the current event.Returns
AnHOperatorReturnindicating the status of the event.
-
virtual int
HOpConstructRectangle::OnRButtonUp(HEventInfo &hevent) virtual
OnRButtonUp passes a right-button up event to OnLButtonUp.
Parameters
hevent: AnHEventInfoobject containing information about the current event.Returns
AnHOperatorReturnindicating the status of the event.
Variables
-
bool
HOpConstructRectangle::m_bRectangleExists protected
boolThe boolean indicating whether the rectangle exists.
-
HPoint
HOpConstructRectangle::m_ptRectangle[2] protected
The first and last points in the rectangle stored in window space.
-
char
HOpConstructRectangle::m_pSavedVisibility[MVO_BUFFER_SIZE] protected
char
-
char
HOpConstructRectangle::m_pSavedColor[MVO_BUFFER_SIZE] protected
char
-
bool
HOpConstructRectangle::m_bUseCenterMarker private
bool