C# Class HelixToolkit.Wpf.CameraController

Provides a control that manipulates the camera by mouse and keyboard gestures.
Inheritance: System.Windows.Controls.Grid
Mostra file Open project: litdev1/LitDev Class Usage Examples

Public Properties

Property Type Description
BackViewCommand System.Windows.Input.RoutedCommand
BottomViewCommand System.Windows.Input.RoutedCommand
CameraModeProperty System.Windows.DependencyProperty
CameraProperty System.Windows.DependencyProperty
CameraRotationModeProperty System.Windows.DependencyProperty
ChangeFieldOfViewCommand System.Windows.Input.RoutedCommand
ChangeFieldOfViewCursorProperty System.Windows.DependencyProperty
ChangeLookAtCommand System.Windows.Input.RoutedCommand
DefaultCameraProperty System.Windows.DependencyProperty
EnabledProperty System.Windows.DependencyProperty
FrontViewCommand System.Windows.Input.RoutedCommand
InertiaFactorProperty System.Windows.DependencyProperty
InfiniteSpinProperty System.Windows.DependencyProperty
IsChangeFieldOfViewEnabledProperty System.Windows.DependencyProperty
IsInertiaEnabledProperty System.Windows.DependencyProperty
IsMoveEnabledProperty System.Windows.DependencyProperty
IsPanEnabledProperty System.Windows.DependencyProperty
IsRotationEnabledProperty System.Windows.DependencyProperty
IsTouchZoomEnabledProperty System.Windows.DependencyProperty
IsZoomEnabledProperty System.Windows.DependencyProperty
LeftRightPanSensitivityProperty System.Windows.DependencyProperty
LeftRightRotationSensitivityProperty System.Windows.DependencyProperty
LeftViewCommand System.Windows.Input.RoutedCommand
LookAtChangedEvent RoutedEvent
MaximumFieldOfViewProperty DependencyProperty
MinimumFieldOfViewProperty DependencyProperty
ModelUpDirectionProperty DependencyProperty
MoveSensitivityProperty DependencyProperty
PageUpDownZoomSensitivityProperty DependencyProperty
PanCommand RoutedCommand
PanCursorProperty DependencyProperty
ResetCameraCommand RoutedCommand
RightViewCommand RoutedCommand
RotateAroundMouseDownPointProperty DependencyProperty
RotateCommand RoutedCommand
RotateCursorProperty DependencyProperty
RotationSensitivityProperty DependencyProperty
ShowCameraTargetProperty DependencyProperty
SpinReleaseTimeProperty DependencyProperty
TopViewCommand RoutedCommand
TouchModeProperty DependencyProperty
UpDownPanSensitivityProperty DependencyProperty
UpDownRotationSensitivityProperty DependencyProperty
ViewportProperty DependencyProperty
ZoomAroundMouseDownPointProperty DependencyProperty
ZoomCommand RoutedCommand
ZoomCursorProperty DependencyProperty
ZoomExtentsCommand RoutedCommand
ZoomRectangleCommand RoutedCommand
ZoomRectangleCursorProperty DependencyProperty
ZoomSensitivityProperty DependencyProperty
ZoomedByRectangleEvent RoutedEvent

Public Methods

Method Description
AddMoveForce ( System.Windows.Media.Media3D.Vector3D delta ) : void

Adds the specified move force.

AddMoveForce ( double dx, double dy, double dz ) : void

Adds the specified move force.

AddPanForce ( System.Windows.Media.Media3D.Vector3D pan ) : void

The add pan force.

AddPanForce ( double dx, double dy ) : void

Adds the specified pan force.

AddRotateForce ( double dx, double dy ) : void

The add rotate force.

AddZoomForce ( double delta ) : void

Adds the zoom force.

AddZoomForce ( double delta, System.Windows.Media.Media3D.Point3D zoomOrigin ) : void

Adds the zoom force.

ChangeDirection ( System.Windows.Media.Media3D.Vector3D lookDir, System.Windows.Media.Media3D.Vector3D upDir, double animationTime = 500 ) : void

Changes the direction of the camera.

ChangeDirection ( System.Windows.Media.Media3D.Vector3D lookDir, double animationTime = 500 ) : void

Changes the direction of the camera.

HideRectangle ( ) : void

Hides the rectangle.

HideTargetAdorner ( ) : void

Hides the target adorner.

PushCameraSetting ( ) : void

Push the current camera settings on an internal stack.

ResetCamera ( ) : void

Resets the camera.

ResetCameraUpDirection ( ) : void

Resets the camera up direction.

RestoreCameraSetting ( ) : bool

Restores the most recent camera setting from the internal stack.

ShowRectangle ( Rect rect, Color color1, Color color2 ) : void

Shows the rectangle.

ShowTargetAdorner ( Point position ) : void

Shows the target adorner.

StartSpin ( Vector speed, Point position, Point3D aroundPoint ) : void

Starts the spin.

StopSpin ( ) : void

Stops the spin.

UpdateRectangle ( Rect rect ) : void

Updates the rectangle.

Zoom ( double delta ) : void

Zooms by the specified delta value.

ZoomExtents ( double animationTime = 200 ) : void

Zooms to the extents of the model.

Protected Methods

Method Description
OnLookAtChanged ( ) : void

Raises the LookAtChanged event.

OnMouseDown ( MouseButtonEventArgs e ) : void

DELETED BY SJT FOR .NET 3.5 Called when the E:System.Windows.UIElement.ManipulationCompleted event occurs.

DELETED BY SJT FOR .NET 3.5 Called when the E:System.Windows.UIElement.ManipulationDelta event occurs.

DELETED BY SJT FOR .NET 3.5 Called when the E:System.Windows.UIElement.ManipulationStarted event occurs.

Invoked when an unhandled MouseDown attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

OnStylusSystemGesture ( StylusSystemGestureEventArgs e ) : void

Invoked when an unhandled StylusSystemGesture attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

OnZoomedByRectangle ( ) : void

Raises the ZoomedByRectangle event.

Private Methods

Method Description
BackViewHandler ( object sender, System.Windows.Input.ExecutedRoutedEventArgs e ) : void

The back view event handler.

BottomViewHandler ( object sender, System.Windows.Input.ExecutedRoutedEventArgs e ) : void

The bottom view event handler.

CameraChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

The camera changed.

CameraController ( ) : System

Initializes static members of the CameraController class. Initializes static members of the CameraController class. Initializes static members of the class. Initializes static members of the CameraController class. Initializes static members of the class.

CameraControllerLoaded ( object sender, RoutedEventArgs e ) : void

The camera controller_ loaded.

CameraControllerUnloaded ( object sender, RoutedEventArgs e ) : void

Called when the CameraController is unloaded.

Clamp ( double value, double min, double max ) : double

Clamps the specified value between the limits.

FindPanVector ( double dx, double dy ) : System.Windows.Media.Media3D.Vector3D

Finds the pan vector.

FrontViewHandler ( object sender, System.Windows.Input.ExecutedRoutedEventArgs e ) : void

The front view event handler.

InitializeBindings ( ) : void

Initializes the input bindings.

LeftViewHandler ( object sender, System.Windows.Input.ExecutedRoutedEventArgs e ) : void

The left view event handler.

LookAt ( System.Windows.Media.Media3D.Point3D target, double animationTime ) : void
OnCameraChanged ( ) : void

The on camera changed.

OnCompositionTargetRendering ( object sender, RenderingEventArgs e ) : void

The rendering event handler.

OnKeyDown ( object sender, KeyEventArgs e ) : void

Called when a key is pressed.

OnMouseWheel ( object sender, MouseWheelEventArgs e ) : void

Called when the mouse wheel is moved.

OnTimeStep ( double time ) : void

The on time step.

OnViewportChanged ( ) : void

The on viewport changed.

RefreshViewport ( ) : void

The refresh viewport.

ResetCameraHandler ( object sender, ExecutedRoutedEventArgs e ) : void

The reset camera event handler.

RightViewHandler ( object sender, ExecutedRoutedEventArgs e ) : void

The right view event handler.

StopAnimations ( ) : void

The stop animations.

SubscribeEvents ( ) : void

The subscribe events.

TopViewHandler ( object sender, ExecutedRoutedEventArgs e ) : void

The top view event handler.

UnSubscribeEvents ( ) : void

The un subscribe events.

ViewportChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

The viewport changed.

ZoomExtentsHandler ( object sender, ExecutedRoutedEventArgs e ) : void

The Zoom extents event handler.

Method Details

AddMoveForce() public method

Adds the specified move force.
public AddMoveForce ( System.Windows.Media.Media3D.Vector3D delta ) : void
delta System.Windows.Media.Media3D.Vector3D /// The delta. ///
return void

AddMoveForce() public method

Adds the specified move force.
public AddMoveForce ( double dx, double dy, double dz ) : void
dx double /// The delta x. ///
dy double /// The delta y. ///
dz double /// The delta z. ///
return void

AddPanForce() public method

The add pan force.
public AddPanForce ( System.Windows.Media.Media3D.Vector3D pan ) : void
pan System.Windows.Media.Media3D.Vector3D /// The pan. ///
return void

AddPanForce() public method

Adds the specified pan force.
public AddPanForce ( double dx, double dy ) : void
dx double /// The delta x. ///
dy double /// The delta y. ///
return void

AddRotateForce() public method

The add rotate force.
public AddRotateForce ( double dx, double dy ) : void
dx double /// The delta x. ///
dy double /// The delta y. ///
return void

AddZoomForce() public method

Adds the zoom force.
public AddZoomForce ( double delta ) : void
delta double /// The delta. ///
return void

AddZoomForce() public method

Adds the zoom force.
public AddZoomForce ( double delta, System.Windows.Media.Media3D.Point3D zoomOrigin ) : void
delta double /// The delta. ///
zoomOrigin System.Windows.Media.Media3D.Point3D /// The zoom origin. ///
return void

ChangeDirection() public method

Changes the direction of the camera.
public ChangeDirection ( System.Windows.Media.Media3D.Vector3D lookDir, System.Windows.Media.Media3D.Vector3D upDir, double animationTime = 500 ) : void
lookDir System.Windows.Media.Media3D.Vector3D /// The look direction. ///
upDir System.Windows.Media.Media3D.Vector3D /// The up direction. ///
animationTime double /// The animation time. ///
return void

ChangeDirection() public method

Changes the direction of the camera.
public ChangeDirection ( System.Windows.Media.Media3D.Vector3D lookDir, double animationTime = 500 ) : void
lookDir System.Windows.Media.Media3D.Vector3D /// The look direction. ///
animationTime double /// The animation time. ///
return void

HideRectangle() public method

Hides the rectangle.
public HideRectangle ( ) : void
return void

HideTargetAdorner() public method

Hides the target adorner.
public HideTargetAdorner ( ) : void
return void

OnLookAtChanged() protected method

Raises the LookAtChanged event.
protected OnLookAtChanged ( ) : void
return void

OnMouseDown() protected method

DELETED BY SJT FOR .NET 3.5 Called when the E:System.Windows.UIElement.ManipulationCompleted event occurs. DELETED BY SJT FOR .NET 3.5 Called when the E:System.Windows.UIElement.ManipulationDelta event occurs. DELETED BY SJT FOR .NET 3.5 Called when the E:System.Windows.UIElement.ManipulationStarted event occurs. Invoked when an unhandled MouseDown attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected OnMouseDown ( MouseButtonEventArgs e ) : void
e MouseButtonEventArgs /// The data for the event. ///
return void

OnStylusSystemGesture() protected method

Invoked when an unhandled StylusSystemGesture attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected OnStylusSystemGesture ( StylusSystemGestureEventArgs e ) : void
e StylusSystemGestureEventArgs /// The that contains the event data. ///
return void

OnZoomedByRectangle() protected method

Raises the ZoomedByRectangle event.
protected OnZoomedByRectangle ( ) : void
return void

PushCameraSetting() public method

Push the current camera settings on an internal stack.
public PushCameraSetting ( ) : void
return void

ResetCamera() public method

Resets the camera.
public ResetCamera ( ) : void
return void

ResetCameraUpDirection() public method

Resets the camera up direction.
public ResetCameraUpDirection ( ) : void
return void

RestoreCameraSetting() public method

Restores the most recent camera setting from the internal stack.
public RestoreCameraSetting ( ) : bool
return bool

ShowRectangle() public method

Shows the rectangle.
public ShowRectangle ( Rect rect, Color color1, Color color2 ) : void
rect Rect /// The rectangle. ///
color1 Color /// The color 1. ///
color2 Color /// The color 2. ///
return void

ShowTargetAdorner() public method

Shows the target adorner.
public ShowTargetAdorner ( Point position ) : void
position Point /// The position. ///
return void

StartSpin() public method

Starts the spin.
public StartSpin ( Vector speed, Point position, Point3D aroundPoint ) : void
speed Vector /// The speed. ///
position Point /// The position. ///
aroundPoint Point3D /// The spin around point. ///
return void

StopSpin() public method

Stops the spin.
public StopSpin ( ) : void
return void

UpdateRectangle() public method

Updates the rectangle.
public UpdateRectangle ( Rect rect ) : void
rect Rect /// The rectangle. ///
return void

Zoom() public method

Zooms by the specified delta value.
public Zoom ( double delta ) : void
delta double /// The delta value. ///
return void

ZoomExtents() public method

Zooms to the extents of the model.
public ZoomExtents ( double animationTime = 200 ) : void
animationTime double /// The animation time (milliseconds). ///
return void

Property Details

BackViewCommand public_oe static_oe property

The back view command.
public static RoutedCommand,System.Windows.Input BackViewCommand
return System.Windows.Input.RoutedCommand

BottomViewCommand public_oe static_oe property

The bottom view command.
public static RoutedCommand,System.Windows.Input BottomViewCommand
return System.Windows.Input.RoutedCommand

CameraModeProperty public_oe static_oe property

Identifies the CameraMode dependency property.
public static DependencyProperty,System.Windows CameraModeProperty
return System.Windows.DependencyProperty

CameraProperty public_oe static_oe property

Identifies the Camera dependency property.
public static DependencyProperty,System.Windows CameraProperty
return System.Windows.DependencyProperty

CameraRotationModeProperty public_oe static_oe property

Identifies the CameraRotationMode dependency property.
public static DependencyProperty,System.Windows CameraRotationModeProperty
return System.Windows.DependencyProperty

ChangeFieldOfViewCommand public_oe static_oe property

The change fov command.
public static RoutedCommand,System.Windows.Input ChangeFieldOfViewCommand
return System.Windows.Input.RoutedCommand

ChangeFieldOfViewCursorProperty public_oe static_oe property

Identifies the ChangeFieldOfViewCursor dependency property.
public static DependencyProperty,System.Windows ChangeFieldOfViewCursorProperty
return System.Windows.DependencyProperty

ChangeLookAtCommand public_oe static_oe property

The change look at command.
public static RoutedCommand,System.Windows.Input ChangeLookAtCommand
return System.Windows.Input.RoutedCommand

DefaultCameraProperty public_oe static_oe property

Identifies the DefaultCamera dependency property.
public static DependencyProperty,System.Windows DefaultCameraProperty
return System.Windows.DependencyProperty

EnabledProperty public_oe static_oe property

Identifies the Enabled dependency property.
public static DependencyProperty,System.Windows EnabledProperty
return System.Windows.DependencyProperty

FrontViewCommand public_oe static_oe property

The front view command.
public static RoutedCommand,System.Windows.Input FrontViewCommand
return System.Windows.Input.RoutedCommand

InertiaFactorProperty public_oe static_oe property

Identifies the InertiaFactor dependency property.
public static DependencyProperty,System.Windows InertiaFactorProperty
return System.Windows.DependencyProperty

InfiniteSpinProperty public_oe static_oe property

Identifies the InfiniteSpin dependency property.
public static DependencyProperty,System.Windows InfiniteSpinProperty
return System.Windows.DependencyProperty

IsChangeFieldOfViewEnabledProperty public_oe static_oe property

Identifies the IsChangeFieldOfViewEnabled dependency property.
public static DependencyProperty,System.Windows IsChangeFieldOfViewEnabledProperty
return System.Windows.DependencyProperty

IsInertiaEnabledProperty public_oe static_oe property

Identifies the IsInertiaEnabled dependency property.
public static DependencyProperty,System.Windows IsInertiaEnabledProperty
return System.Windows.DependencyProperty

IsMoveEnabledProperty public_oe static_oe property

Identifies the IsMoveEnabled dependency property.
public static DependencyProperty,System.Windows IsMoveEnabledProperty
return System.Windows.DependencyProperty

IsPanEnabledProperty public_oe static_oe property

Identifies the IsPanEnabled dependency property.
public static DependencyProperty,System.Windows IsPanEnabledProperty
return System.Windows.DependencyProperty

IsRotationEnabledProperty public_oe static_oe property

Identifies the IsRotationEnabled dependency property.
public static DependencyProperty,System.Windows IsRotationEnabledProperty
return System.Windows.DependencyProperty

IsTouchZoomEnabledProperty public_oe static_oe property

Identifies the IsTouchZoomEnabled dependency property.
public static DependencyProperty,System.Windows IsTouchZoomEnabledProperty
return System.Windows.DependencyProperty

IsZoomEnabledProperty public_oe static_oe property

Identifies the IsZoomEnabled dependency property.
public static DependencyProperty,System.Windows IsZoomEnabledProperty
return System.Windows.DependencyProperty

LeftRightPanSensitivityProperty public_oe static_oe property

Identifies the LeftRightPanSensitivity dependency property.
public static DependencyProperty,System.Windows LeftRightPanSensitivityProperty
return System.Windows.DependencyProperty

LeftRightRotationSensitivityProperty public_oe static_oe property

Identifies the LeftRightRotationSensitivity dependency property.
public static DependencyProperty,System.Windows LeftRightRotationSensitivityProperty
return System.Windows.DependencyProperty

LeftViewCommand public_oe static_oe property

The left view command.
public static RoutedCommand,System.Windows.Input LeftViewCommand
return System.Windows.Input.RoutedCommand

LookAtChangedEvent public_oe static_oe property

The look at (target) point changed event
public static RoutedEvent LookAtChangedEvent
return RoutedEvent

MaximumFieldOfViewProperty public_oe static_oe property

Identifies the MaximumFieldOfView dependency property.
public static DependencyProperty MaximumFieldOfViewProperty
return DependencyProperty

MinimumFieldOfViewProperty public_oe static_oe property

Identifies the MinimumFieldOfView dependency property.
public static DependencyProperty MinimumFieldOfViewProperty
return DependencyProperty

ModelUpDirectionProperty public_oe static_oe property

Identifies the ModelUpDirection dependency property.
public static DependencyProperty ModelUpDirectionProperty
return DependencyProperty

MoveSensitivityProperty public_oe static_oe property

Identifies the MoveSensitivity dependency property.
public static DependencyProperty MoveSensitivityProperty
return DependencyProperty

PageUpDownZoomSensitivityProperty public_oe static_oe property

Identifies the PageUpDownZoomSensitivity dependency property.
public static DependencyProperty PageUpDownZoomSensitivityProperty
return DependencyProperty

PanCommand public_oe static_oe property

The pan command.
public static RoutedCommand PanCommand
return RoutedCommand

PanCursorProperty public_oe static_oe property

Identifies the PanCursor dependency property.
public static DependencyProperty PanCursorProperty
return DependencyProperty

ResetCameraCommand public_oe static_oe property

The reset camera command.
public static RoutedCommand ResetCameraCommand
return RoutedCommand

RightViewCommand public_oe static_oe property

The right view command.
public static RoutedCommand RightViewCommand
return RoutedCommand

RotateAroundMouseDownPointProperty public_oe static_oe property

Identifies the RotateAroundMouseDownPoint dependency property.
public static DependencyProperty RotateAroundMouseDownPointProperty
return DependencyProperty

RotateCommand public_oe static_oe property

The rotate command.
public static RoutedCommand RotateCommand
return RoutedCommand

RotateCursorProperty public_oe static_oe property

Identifies the RotateCursor dependency property.
public static DependencyProperty RotateCursorProperty
return DependencyProperty

RotationSensitivityProperty public_oe static_oe property

Identifies the RotationSensitivity dependency property.
public static DependencyProperty RotationSensitivityProperty
return DependencyProperty

ShowCameraTargetProperty public_oe static_oe property

Identifies the ShowCameraTarget dependency property.
public static DependencyProperty ShowCameraTargetProperty
return DependencyProperty

SpinReleaseTimeProperty public_oe static_oe property

Identifies the SpinReleaseTime dependency property.
public static DependencyProperty SpinReleaseTimeProperty
return DependencyProperty

TopViewCommand public_oe static_oe property

The top view command.
public static RoutedCommand TopViewCommand
return RoutedCommand

TouchModeProperty public_oe static_oe property

Identifies the TouchMode dependency property.
public static DependencyProperty TouchModeProperty
return DependencyProperty

UpDownPanSensitivityProperty public_oe static_oe property

Identifies the UpDownPanSensitivity dependency property.
public static DependencyProperty UpDownPanSensitivityProperty
return DependencyProperty

UpDownRotationSensitivityProperty public_oe static_oe property

Identifies the UpDownRotationSensitivity dependency property.
public static DependencyProperty UpDownRotationSensitivityProperty
return DependencyProperty

ViewportProperty public_oe static_oe property

Identifies the Viewport dependency property.
public static DependencyProperty ViewportProperty
return DependencyProperty

ZoomAroundMouseDownPointProperty public_oe static_oe property

Identifies the ZoomAroundMouseDownPoint dependency property.
public static DependencyProperty ZoomAroundMouseDownPointProperty
return DependencyProperty

ZoomCommand public_oe static_oe property

The zoom command.
public static RoutedCommand ZoomCommand
return RoutedCommand

ZoomCursorProperty public_oe static_oe property

Identifies the ZoomCursor dependency property.
public static DependencyProperty ZoomCursorProperty
return DependencyProperty

ZoomExtentsCommand public_oe static_oe property

The zoom extents command.
public static RoutedCommand ZoomExtentsCommand
return RoutedCommand

ZoomRectangleCommand public_oe static_oe property

The zoom rectangle command.
public static RoutedCommand ZoomRectangleCommand
return RoutedCommand

ZoomRectangleCursorProperty public_oe static_oe property

Identifies the ZoomRectangleCursor dependency property.
public static DependencyProperty ZoomRectangleCursorProperty
return DependencyProperty

ZoomSensitivityProperty public_oe static_oe property

Identifies the ZoomSensitivity dependency property.
public static DependencyProperty ZoomSensitivityProperty
return DependencyProperty

ZoomedByRectangleEvent public_oe static_oe property

The zoomed by rectangle event
public static RoutedEvent ZoomedByRectangleEvent
return RoutedEvent