Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HOpConstructSphere Class Reference

The HOpConstructSphere class provides support for constructing a sphere and inserting it into the model. More...

#include <HOpConstructSphere.h>

List of all members.

Public Member Functions

virtual HBaseOperatorClone ()
virtual const char * GetName ()
 HOpConstructSphere (HBaseView *view, int DoRepeat=0, int DoCapture=1)
virtual int OnLButtonDown (HEventInfo &hevent)
virtual int OnLButtonDownAndMove (HEventInfo &hevent)
virtual int OnLButtonUp (HEventInfo &hevent)

Protected Member Functions

void ConstructWireframeSphere (HPoint const &center, float radius)

Protected Attributes

float m_radius

Detailed Description

The HOpConstructSphere class provides support for constructing a sphere and inserting it into the model.

HOpConstructSphere implements three of the mouse event handlers defined on the base class and maps the events to local methods that rubberband a sphere and insert a corresponding HOOPS shell into the HOOPS database. This provides the basic functionality for drawing a three-dimensional, tesselated sphere. The operation consists of the following steps:

  1. Left Button Down: Registers the center point of the sphere.
  2. Left Button Down and Drag: Rubberbands the sphere to the desired circumference.
  3. Left Button Up: Circumference is finalized, the scene is cleared and the operation ends.

More Detailed Description: see event methods.


Constructor & Destructor Documentation

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

Constructs an HOpConstructSphere 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.

Member Function Documentation

virtual HBaseOperator* HOpConstructSphere::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 HOpConstructSphere object.

Reimplemented from HBaseOperator.

Reimplemented in HOpCreateSphere.

void HOpConstructSphere::ConstructWireframeSphere ( HPoint const &  center,
float  radius 
) [protected]

ConstructWireframeSphere generates a wireframe sphere using three circles. Note that the work done in this function is accomplished by three calls to HUtility::CreateAxisCircle. ConstructWireframeSphere is repeatedly called internally by OnLButtonDownAndMove.

Parameters:
centerAn HPoint object.
radiusLength of the sphere's radius.
virtual const char* HOpConstructSphere::GetName ( ) [virtual]
Returns:
A pointer to a character string denoting the name of the operator which is 'Construct Sphere'.

Reimplemented from HBaseOperator.

Reimplemented in HOpCreateSphere.

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

OnLButtonDown records the first pointer position and initiates the sphere-drawing mechanism.

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

Reimplemented from HBaseOperator.

virtual int HOpConstructSphere::OnLButtonDownAndMove ( HEventInfo hevent) [virtual]

OnLButtonDownAndMove draws rubberbanded lines along the circumference of three great circles centered on the first pointer position: one equatorial, one along the prime meridian, and one 90-degrees from the prime meridian. Note that the basic dynamic drawing work is done by repeated calls to the protected function HOpConstructSphere::ConstructWireframeSphere.

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

Reimplemented from HBaseOperator.

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

OnLButtonUp finalizes the size of the sphere 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 HOpCreateSphere.


Member Data Documentation

float HOpConstructSphere::m_radius [protected]

Magnitude of the sphere's radius


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