Click or drag to resize
AB4D logo

CameraControlPanel Class

CameraControlPanel is a predefined control panel that shows buttons to manipulate the Ab3d.Camera.
Inheritance Hierarchy

Namespace:  Ab3d.Controls
Assembly:  Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 10.1.8147.1045
Syntax
C#
public class CameraControlPanel : BaseControllerControl

The CameraControlPanel type exposes the following members.

Constructors
  NameDescription
Public methodCameraControlPanel
Constructor
Top
Properties
  NameDescription
Public propertyDelay
Gets or sets the amount of time, in milliseconds, the buttons on CameraControlPanel wait while they begin to repeatedly change the camera. Default value is 250.
Public propertyInterval
Gets or sets the amount of time, in milliseconds, between repeats once repeating starts.
Public propertyMoveAmount
When MoveAmount is set to a value that is not 0 or double.NaN, then the camera is moved for this value when the left, right, up or down button is pressed. When MoveAmount is 0 or NaN, then the move amount is calculated based on the current camera's Distance or CameraWidth and the size of the Viewport3D. Default value is 0.
Public propertyMoveChangeFactor
Gets or sets the value that is used on each Change Interval to move the camera forward or backward. The value is multiplied with the current Camera Distance. Default value is 1.05.
Public propertyRotationChange
Gets or sets the value in degrees that is used on each Change Interval to rotate the camera. Default value is 5.
Public propertyShowMoveButtons
Gets or sets a Boolean that specifies if the move buttons are shown. Default value is false.
Public propertyShowRotateButtons
Gets or sets a Boolean that specifies if the rotate buttons are shown. Default value is true.
Public propertyShowZoomButtons
Gets or sets a Boolean that specifies if the move forward and move backward buttons are shown. Default value is true.
Top
Methods
  NameDescription
Public methodChangeCameraDistance
ChangeCameraDistance method change the distance of the TargetCamera by multiplying it by the changeFactor
Protected methodGetSelectedBitmapForImageName
GetSelectedBitmapForImageName method gets the Selected BitmapSource for the Image with imageName. If null is returned, the original image is not changed.
Protected methodGetUnSelectedBitmapForImageName
GetUnSelectedBitmapForImageName method gets the Un-Selected BitmapSource for the Image with imageName. If null is returned, the original image is not changed.
Protected methodMeasureOverride
MeasureOverride
(Overrides ControlMeasureOverride(Size).)
Public methodMoveCamera
MoveCamera method moves the camera for the mouse change defined by offsetXChange and offsetYChange parameters.
Public methodOnApplyTemplate
OnApplyTemplate
(Overrides FrameworkElementOnApplyTemplate.)
Public methodRotateCamera
RotateCamera method rotates the camera for the mouse change defined by headingChange and attitudeChange parameters.
Protected methodSubscribeImageEvents
SubscribeImageEvents method subscribes mouse events to Images used in CameraControlPanel
Protected methodUpdateShownButtons
UpdateShownButtons method shows or hides the shown buttons based on the ShowMoveButtons, ShowRotateButtons and ShowZoomButtons properties.
Top
Fields
  NameDescription
Public fieldStatic memberDelayProperty
DelayProperty
Public fieldStatic memberIntervalProperty
IntervalProperty
Public fieldStatic memberMoveAmountProperty
MoveAmountProperty
Protected fieldmoveBackImage
backImage
Protected fieldmoveCanvas
Canvas that hosts move buttons
Public fieldStatic memberMoveChangeFactorProperty
MoveChangeFactorProperty
Protected fieldmoveDownImage
move down Image
Protected fieldmoveForwardImage
forwardImage
Protected fieldmoveLeftImage
move left Image
Protected fieldmoveRightImage
move right Image
Protected fieldmoveUpImage
move up Image
Protected fieldrootStackPanel
StackPanel control that hosts all three Canvases
Protected fieldrootViewbox
rootViewbox control
Protected fieldrotateCanvas
Canvas that hosts rotate buttons
Protected fieldrotateDownImage
rotate down Image
Protected fieldrotateLeftImage
rotate left Image
Protected fieldrotateRightImage
rotate right Image
Protected fieldrotateUpImage
rotate up Image
Public fieldStatic memberRotationChangeProperty
RotationChangeProperty
Public fieldStatic memberShowMoveButtonsProperty
ShowMoveButtonsProperty
Public fieldStatic memberShowRotateButtonsProperty
ShowRotateButtonsProperty
Public fieldStatic memberShowZoomButtonsProperty
ShowZoomButtonsProperty
Protected fieldzoomCanvas
Canvas that hosts zoom buttons
Top
Remarks

The Ab3d.Camera that is controlled by the CameraControlPanel is defined by the TargetCamera or TargetCameraName properties.

If the Ab3d.Camera is not set manually and the IsAutoCameraFindingEnabled property is set to true, the contoller try to find the first Ab3d.Camera by looking at controls parents.

The amount of the camera change is defined by the following properties:
RotationChange, MoveChangeFactor, Interval and Delay.

It is also possible to control the camera by the ChangeCameraDistance(Double) and RotateCamera(Double, Double) helper methods.

See Also