Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HOpConstructRectangle Class Reference

The HOpConstructRectangle class draws a rectangle. More...

#include <HOpConstructRectangle.h>

List of all members.

Public Member Functions

virtual HBaseOperatorClone ()
virtual const char * GetName ()
 HOpConstructRectangle (HBaseView *view, int DoRepeat=0, int DoCapture=1, bool UseCenterMarker=true)
virtual int OnLButtonDown (HEventInfo &hevent)
virtual int OnLButtonDownAndMove (HEventInfo &hevent)
virtual int OnLButtonUp (HEventInfo &hevent)
virtual int OnRButtonUp (HEventInfo &hevent)

Protected Attributes

bool m_bRectangleExists
char m_pSavedColor [MVO_BUFFER_SIZE]
char m_pSavedVisibility [MVO_BUFFER_SIZE]
HPoint m_ptRectangle [2]

Detailed Description

The HOpConstructRectangle class draws a rectangle.

HOpConstructRectangle implements 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:

  1. Left Button Down: Registers the first point of the rectangle.
  2. Left Button Down and Drag: Rubberbands the rectangle to the desired dimensions.
  3. 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.


Constructor & Destructor Documentation

HOpConstructRectangle::HOpConstructRectangle ( HBaseView view,
int  DoRepeat = 0,
int  DoCapture = 1,
bool  UseCenterMarker = true 
)

Constructs an HOpConstructRectangle object.

Parameters:
viewA pointer to an HBaseView object.
DoRepeatAn integer denoting whether this is a repeatable operator. This parameter has been deprecated.
DoCaptureAn 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.
UseCenterMarkerPass true if you want HOOPS to render a mark at the center of the rectangle.

Member Function Documentation

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 created HOpConstructRectangle object.

Reimplemented from HBaseOperator.

Reimplemented in HOpCameraZoomBox, HOpSelectArea, HOpCreateRectangle, and HOpMarkupRectangle.

virtual const char* HOpConstructRectangle::GetName ( ) [virtual]
Returns:
A pointer to a character string denoting the name of the operator which is 'Construct Rectangle'.

Reimplemented from HBaseOperator.

Reimplemented in HOpSelectArea, HOpCreateRectangle, HOpCameraZoomBox, and HOpMarkupRectangle.

virtual int HOpConstructRectangle::OnLButtonDown ( HEventInfo hevent) [virtual]

OnLButtonDown records the first mouse position and initiates the rectangle-drawing mechanism.

Parameters:
heventAn HEventInfo object containing information about the current event.
Returns:
An HOperatorReturn indicating the status of the event.

Reimplemented from HBaseOperator.

Reimplemented in HOpSelectArea.

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:
heventAn HEventInfo object containing information about the current event.
Returns:
An HOperatorReturn indicating the status of the event.

Reimplemented from HBaseOperator.

virtual int HOpConstructRectangle::OnLButtonUp ( HEventInfo hevent) [virtual]

OnLButtonUp finalizes the size of the rectangle and cleans up.

Parameters:
heventAn HEventInfo object containing information about the current event.
Returns:
An HOperatorReturn indicating the status of the event.

Reimplemented from HBaseOperator.

Reimplemented in HOpSelectArea, HOpCreateRectangle, HOpCameraZoomBox, and HOpMarkupRectangle.

virtual int HOpConstructRectangle::OnRButtonUp ( HEventInfo hevent) [virtual]

OnRButtonUp passes a right-button up event to OnLButtonUp.

Parameters:
heventAn HEventInfo object containing information about the current event.
Returns:
An HOperatorReturn indicating the status of the event.

Reimplemented from HBaseOperator.


Member Data Documentation

The boolean indicating whether the rectangle exists.

The first and last points in the rectangle stored in window space.


The documentation for this class was generated from the following file: