C# Class Revit.SDK.Samples.NewHostedSweep.CS.TrackBall

This class is intent to convenience the geometry transformations. It can produce rotation and scale transformations.
Mostra file Open project: AMEE/revit Class Usage Examples

Public Methods

Method Description
OnKeyDown ( KeyEventArgs e ) : void

Arrows key down will also yield the rotation transform.

OnMouseDown ( float width, float height, MouseEventArgs e ) : void

Mouse down, initialize the transformation to identity.

OnMouseMove ( MouseEventArgs e ) : void

Mouse move with left button press will yield the rotation transform, with right button press will yield scale transform.

Private Methods

Method Description
ProjectToTrackball ( double width, double height, Point point ) : XYZ

Project canvas 2D point to the track ball.

Track ( Point currentPosition ) : void

Yield the rotation transform according to current 2D point in canvas.

Zoom ( Point currentPosition ) : void

Yield the scale transform according to current 2D point in canvas.

Method Details

OnKeyDown() public method

Arrows key down will also yield the rotation transform.
public OnKeyDown ( KeyEventArgs e ) : void
e System.Windows.Forms.KeyEventArgs
return void

OnMouseDown() public method

Mouse down, initialize the transformation to identity.
public OnMouseDown ( float width, float height, MouseEventArgs e ) : void
width float Canvas width
height float Canvas height
e MouseEventArgs
return void

OnMouseMove() public method

Mouse move with left button press will yield the rotation transform, with right button press will yield scale transform.
public OnMouseMove ( MouseEventArgs e ) : void
e MouseEventArgs
return void