Click or drag to resize
AB4D logo

CameraNavigationCircles Class

CameraNavigationCircles is a camera controller that shows a 3D axes with axis circles and can be used to rotate the camera.
Inheritance Hierarchy
SystemObject
  System.Windows.ThreadingDispatcherObject
    System.WindowsDependencyObject
      System.Windows.MediaVisual
        System.WindowsUIElement
          System.WindowsFrameworkElement
            System.Windows.ControlsControl
              Ab3d.ControlsBaseControllerControl
                Ab3d.ControlsCameraNavigationCircles

Namespace: Ab3d.Controls
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.1.8864.1045
Syntax
C#
[ContentPropertyAttribute("Content")]
public class CameraNavigationCircles : BaseControllerControl

The CameraNavigationCircles type exposes the following members.

Constructors
 NameDescription
Public methodCameraNavigationCircles Constructor
Top
Properties
 NameDescription
Public propertyAxisCircleRadius CircleRadius defines the radius of the axis circles. When zero, then the radius is calculated by multiplying FontSize by 0.7. Default value is 0.
Public propertyAxisClickAnimationDuration Gets or sets a double value that specifies duration in seconds of the camera animation that is started when user clicks on axis circle. When the value is 0, then camera change is immediate and not animated. When the value is less then 0, then plane clicking is disabled (but the AxisClicked event is still triggered). Default value is 0.3 seconds.
Public propertyAxisTextSize AxisTextSize defines the font size of the axis text. When AxisCircleRadius is zero (by default), then this also changes the radius of the axis circles. Default value is 13.
Public propertyAxisType AxisType defines how the axis lines are shown. Default value is Lines that shows standard lines without arrows.
Public propertyBackgroundCircleBrush BackgroundCircleBrush defines the Brush that is used for the background circle. Default value is semi-transparent light gray (#66CCCCCC).
Public propertyBackgroundCircleVisibility BackgroundCircleVisibility defines when the background circle is visible. Default value is OnMouseOver.
Public propertyContent Content
Public propertyIsCameraRotationEnabled IsCameraRotationEnabled defines if camera rotation is enabled when user drags the mouse with left mouse button when over the CameraNavigationCircles. Default value is true.
Public propertyIsRotateToAxisEnabled IsRotateToAxisEnabled defines if camera is rotated to the selected axis when user clicks on it. Default value is true.
Public propertyModifierKeyForOppositeAxis Gets or sets a modifier key that will rotate to the opposite axis when clicked on axis. Default value is Shift. This means that if user holds down Shift key and clicks on +X axis, the camera will rotate to -X axis. To disable this functionality set this property to None.
Public propertyModifierKeyToPreserveAttitude Gets or sets a modified key that will preserve the Attitude angle when clicked on a horizontal axis (X and Y in the common setup). Default value is Control. This means that if user holds down Control key and clicks on +X axis, the camera will rotate to X axis while preserving the existing Attitude (will not set Attitude to zero). To disable this functionality set this property to None.
Public propertyNegativeAxisCircleFillBrush NegativeAxisCircleFillBrush defines the Fill Brush for the axis circles on the negative axes (-x, -y, -z). When the Brush is null, then the color of the axis is used (each axis circle is colored by the color of the axis). Default value is White brush with 80% opacity.
Public propertyNegativeAxisCircleVisibility NegativeAxisCircleVisibility defines when the axis circles for the negative axes (-x, -y, -z) are shown. Default value is Always.
Public propertyNegativeAxisNameVisibility PositiveAxisNameNegativeAxisNameVisibilityVisibility defines when the axis names ("X", "Y", "Z") for the negative axes (-x, -y, -z) are shown. Default value is OnMouseOver.
Public propertyNegativeAxisTextBrush NegativeAxisTextBrush defines the color of the axis name on the negative axes (-x, -y, -z). When the Brush is null, then the color of the axis is used (each axis circle is colored by the color of the axis). Default value is Black.
Public propertyPositiveAxisCircleFillBrush PositiveCircleFillBrush defines the Fill Brush for the axis circles on the positive axes (+x, +y, +z). When the Brush is null, then the color of the axis is used (each axis circle is colored by the color of the axis). Default value is null.
Public propertyPositiveAxisCircleVisibility PositiveAxisCircleVisibility defines when the axis circles for the positive axes (+x, +y, +z) are shown. Default value is Always.
Public propertyPositiveAxisNameVisibility PositiveAxisNameVisibility defines when the axis names ("X", "Y", "Z") for the positive axes (+x, +y, +z) are shown. Default value is Always.
Public propertyPositiveAxisTextBrush PositiveAxisTextBrush defines the color of the axis name on the positive axes (+x, +y, +z). When the Brush is null, then the color of the axis is used (each axis circle is colored by the color of the axis). Default value is Black.
Public propertyShowOppositeAxisWhenClickedOnCurrentAxis When true (by default), then when user clicks on an existing axis (the one in the center), then the camera will rotate to the opposite axis.
Public propertyXAxisColor Gets the color of X axis. To change the color, call the CustomizeAxes method. Default value is Colors.Red.
Public propertyYAxisColor Gets the color of Y axis. To change the color, call the CustomizeAxes method. Default value is Colors.ForestGreen.
Public propertyZAxisColor Gets the color of Z axis. To change the color, call the CustomizeAxes method. Default value is Colors.RoyalBlue.
Top
Methods
 NameDescription
Public methodCustomizeAxes(Vector3D, Vector3D, Vector3D) CustomizeAxes customizes the show axes with specify custom axis orientation.
Public methodCustomizeAxes(String, String, Color, Vector3D, String, String, Color, Vector3D, String, String, Color, Vector3D) CustomizeAxes customizes the show axes with specify custom Vector3D, axis name and axis color for each axis. To customize axis length, set AxisLength3D before calling this method.
Public methodOnApplyTemplate OnApplyTemplate
(Overrides FrameworkElementOnApplyTemplate)
Protected methodOnAxisClicked OnAxisClicked
Protected methodOnAxisDeselected(String, Vector3D) OnAxisDeselected
Protected methodOnAxisDeselected(String, Boolean, Boolean, Brush, Line, Shape, TextBlock) OnAxisDeselected method is called after initialization and when the axis is not longer selected by the mouse. This method can be overridden in a derived class to customize the behaviour.
Protected methodOnAxisSelected(String, Vector3D) OnAxisSelected
Protected methodOnAxisSelected(String, Boolean, Boolean, Brush, Line, Shape, TextBlock) OnAxisSelected method is called when the axis is selected by the mouse. This method can be overridden in a derived class to customize the behaviour.
Protected methodOnBackgroundCircleEnter OnBackgroundCircleEnter
Protected methodOnBackgroundCircleLeave OnBackgroundCircleEnter
Protected methodOnControlUpdated OnControlUpdated
Protected methodOnCreateAxisCircle OnCreateAxisCircle method creates an Ellipse shape that will show the circle behind the axis name. This method can be overridden in a derived class to create a different Shape (note: the created Shape should have IsHitTestVisible set to false).
Protected methodOnCreateAxisLine OnCreateAxisLine method creates a TextBlock that will show the axis name (for example "X" or "-X"). This method can be overridden in a derived class to customize the behaviour (note: the created Line should have IsHitTestVisible set to false).
Protected methodOnCreateAxisNameTextBlock OnCreateAxisNameTextBlock method creates a TextBlock that will show the axis name (for example "X" or "-X") This method can be overridden in a derived class to customize the behaviour (note: the created TextBlock should have IsHitTestVisible set to false).
Protected methodOnMouseEnter OnMouseEnter method is called when the mouse enters the circular area of the CameraNavigationCircles. This method can be overridden in a derived class to customize the behaviour.
Protected methodOnMouseLeave OnMouseLeave method is called when the mouse leaves the circular area of the CameraNavigationCircles. This method can be overridden in a derived class to customize the behaviour.
Protected methodOnTargetCameraChanged OnTargetCameraChanged
(Overrides BaseControllerControlOnTargetCameraChanged(BaseCamera, BaseCamera))
Public methodUseYUpAxis

UseYUpAxis method calls the CustomizeAxes method with the following parameters: xAxisVector: new Vector3D(1, 0, 0), yAxisVector: new Vector3D(0, 1, 0), zAxisVector: new Vector3D(0, 0, 1)

This sets common WPF 3D axis with the Y axis up and Z axis away from the screen.

Public methodUseZUpAxis

UseZUpAxis method calls the CustomizeAxes method with the following parameters: xAxisVector: new Vector3D(1, 0, 0), yAxisVector: new Vector3D(0, 0, -1), zAxisVector: new Vector3D(0, 1, 0)

This sets the Z axis up and Y axis into the screen.

Top
Events
 NameDescription
Public eventAxisClicked ViewCubePlaneClicked event is fired when user clicks on ViewCube's Plane. The click is created when user presses mouse button and released it withing 1 second and does not move mouse for more than 2 pixels. Event handler can prevent processing click event with setting CancelEventHandling in ViewCubePlaneEventArgs to true.
Public eventAxisDeselected ViewCubePlaneLeave event is fired when mouse leaves one of the ViewCube's Planes.
Public eventAxisSelected ViewCubePlaneEnter event is fired when mouse enters one of the ViewCube's Planes.
Public eventBackgroundCircleEnter RotationCircleEnter event is fired when mouse enters of the ViewCube's rotation circle. When and event handler is subscribed to this event, then the default code that sets the selection brush to the rotation circle is not executed.
Public eventBackgroundCircleLeave RotationCircleLeave event is fired when mouse leaves of the ViewCube's rotation circle. When and event handler is subscribed to this event, then the default code that restores the selection brush to the rotation circle is not executed.
Public eventControlUpdated ControlUpdated event is fired after each change of this control. This can be used when we need to render this control to a bitmap to show it on an DXViewportView with DirectXOverview PresentationType.
Top
Fields
 NameDescription
Protected fieldaxisCanvas axisCanvas from the template
Public fieldStatic memberAxisCircleRadiusProperty AxisCircleRadiusProperty
Public fieldAxisLength3D Axis length in the 3D space shown by this control. Default value is 100. After changing this value call CustomizeAxes method.
Public fieldAxisLineThickness Axis line thickness for the axis lines. Default value is 2. After changing this value call CustomizeAxes method.
Public fieldStatic memberAxisTextSizeProperty AxisTextSizeProperty
Public fieldStatic memberAxisTypeProperty AxisTypeProperty
Protected fieldbackCanvas backCanvas from the template
Public fieldStatic memberBackgroundCircleBrushProperty BackgroundCircleBrushProperty
Public fieldStatic memberBackgroundCircleVisibilityProperty BackgroundCircleVisibilityProperty
Protected fieldbackgroundEllipse backgroundEllipse from the template
Public fieldCameraRotationAmount Gets or sets a number of degrees for how much the camera will be rotated when user moves the mouse from one end of the CameraNavigationCircles to the other. Default value is 180.
Protected fieldcontentPresenter contentPresenter from the template
Public fieldStatic memberContentProperty ContentProperty
Protected fieldfrontCanvas frontCanvas from the template
Public fieldStatic memberIsCameraRotationEnabledProperty IsCameraRotationEnabledProperty
Public fieldStatic memberIsRotateToAxisEnabledProperty IsRotateToAxisEnabledProperty
Public fieldMouseMoveThreshold Gets or sets a double value that specifies how much user needs to move the mouse when pressing the button before rotation is started. If mouse if moved for the specified amount or less and the mouse button is released, this this is considers a mouse click. Default value is 1.
Public fieldMouseOverCursor Gets or sets a Cursor that is used when the mouse is over this control. Default value is Hand.
Public fieldStatic memberNegativeAxisCircleFillBrushProperty NegativeAxisCircleFillBrushProperty
Public fieldStatic memberNegativeAxisCircleVisibilityProperty NegativeAxisNameVisibilityProperty
Public fieldStatic memberNegativeAxisNameVisibilityProperty NegativeAxisNameVisibilityProperty
Public fieldStatic memberNegativeAxisTextBrushProperty NegativeAxisTextBrushProperty
Public fieldStatic memberPositiveAxisCircleFillBrushProperty PositiveAxisCircleFillBrushProperty
Public fieldStatic memberPositiveAxisCircleVisibilityProperty NegativeAxisNameVisibilityProperty
Public fieldStatic memberPositiveAxisNameVisibilityProperty PositiveAxisNameVisibilityProperty
Public fieldStatic memberPositiveAxisTextBrushProperty PositiveAxisTextBrushProperty
Protected fieldrootGrid rootGrid from the template
Public fieldSelectClosestAxis Gets or sets a Boolean that specifies if the closest axis to the mouse is selected (when true). When false, then axis is selected only when mouse is over the axis circle.
Protected fieldtargetPositionCamera Camera used to show the axes
Top
See Also