Click or drag to resize
AB4D logo

AxesBoxVisual3D Class

AxesBoxVisual3D can show all 6 axes with tick lines and value labels. It automatically switches and orients the shown axes. AxesBoxVisual3D can show axis title and value labels as 3D text (when Is3DTextShown is true) or as 2D text (when Is3DTextShown is false). To set the value ranges and tick steps, call the SetAxisDataRange(AxesBoxVisual3DAxisTypes, Double, Double, Double, Double, Boolean) method. The individual axes can be get by XAxis1, XAxis2, YAxis1, YAxis2, ZAxis1 and ZAxis2. Setting properties that are the same for all axes (for example AxisLineThickness) will change the same property on all 6 axes. Individual properties can be changed by setting the XAxis1Title, IsXAxis1Visible or directly properties on the axis - for example: XAxis1.AxisTitle.
Inheritance Hierarchy

Namespace: Ab3d.Visuals
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.1.8864.1045
Syntax
C#
public class AxesBoxVisual3D : ContentVisual3D, 
	IDisposable

The AxesBoxVisual3D type exposes the following members.

Constructors
 NameDescription
Public methodAxesBoxVisual3D Constructor
Public methodAxesBoxVisual3D(String) Constructor
Top
Properties
 NameDescription
Public propertyAdjustFirstAndLastLabelPositions When true, then the last label is moved down to prevent overlapping the last label with adjacent axis. Default value is false.
Public propertyAxisLineColor Gets or sets the color of the axis line.
Public propertyAxisLineThickness Gets or sets the thickness of the axis line in screen coordinates. Default value is 2.
Public propertyAxisShowingStrategy Gets or sets one of AxisShowingStrategies that defines how the axes will be automatically shown, hidden and positioned (StartAxisPosition and EndAxisPosition will be changed). Default value is FrontFacingPlanes.
Public propertyAxisTitleBrush Gets or sets the brush of the value labels text.
Public propertyAxisTitleFontSize Gets or sets the size of the value axis text. Default value is 6.
Public propertyAxisTitleFontWeight Gets or sets the FontWeight of the axis title text.
Public propertyBackConnectionLinesVisual3D Gets a MultiLineVisual3D that is used to show 3D lines that connect major ticks in the bottom and back rectangles.
Public propertyBottomRectangleVisual3D Gets a RectangleVisual3D that is used to show the bottom rectangle.
Public propertyCamera Gets or sets an Ab3d Camera that is used by this AxesBoxVisual3D.
Public propertyCenterPosition Gets or sets the center position of the 3D box used to create the lines
Public propertyConnectionLinesColor Gets or sets the color of the connection lines that show major tick value on the bottom and back rectangles. Default value is Black.
Public propertyConnectionLinesThickness Gets or sets the thickness of the connection lines that show major tick value on the bottom and back rectangles. Default value is 1.
Public propertyFontFamily Gets or sets the FontFamily of the text.
Public propertyIs3DTextShown Is3DTextShown specifies if the 3D axes are shows as AxisWith3DLabelsVisual3D (when true; by default) or as AxisWithOverlayLabelsVisual3D (when false).
Public propertyIsAutomaticallySubscribedToCameraChanges When true (by default) the Update method is automatically called on each change of the Camera.
Public propertyIsWireBoxFullyClosed IsWireBoxFullyClosed specifies if the the 3D lines are also drawn to the top front corner of the box to make the wire box fully closed. Default value is false. This draws only the side and back lines of the wire box and make the box appear opened.
Public propertyIsXAxis1Visible Gets or sets a Boolean that specified is XAxis1 is visible. This is a shortcut for XAxis1.IsVisible property.
Public propertyIsXAxis2Visible Gets or sets a Boolean that specified is XAxis2 is visible. This is a shortcut for XAxis2.IsVisible property.
Public propertyIsYAxis1Visible Gets or sets a Boolean that specified is YAxis1 is visible. This is a shortcut for YAxis1.IsVisible property.
Public propertyIsYAxis2Visible Gets or sets a Boolean that specified is YAxis2 is visible. This is a shortcut for YAxis2.IsVisible property.
Public propertyIsZAxis1Visible Gets or sets a Boolean that specified is ZAxis1 is visible. This is a shortcut for ZAxis1.IsVisible property.
Public propertyIsZAxis2Visible Gets or sets a Boolean that specified is ZAxis2 is visible. This is a shortcut for ZAxis2.IsVisible property.
Public propertyMajorTicksLength Gets or sets a double value that defines the length of major tick lines. Default value is 5. When set to 0, then major tick lines are not shown (but labels are still shown).
Public propertyMinorTicksLength Gets or sets a double value that defines the length of minor tick lines. Default value is 2.5. When set to 0, then minor tick lines are not shown.
Public propertyOverlayCanvas Gets or sets a Canvas that will show the axis numbers
Public propertyShowBackConnectionLines Gets or sets a Boolean that specifies if connection lines that connect major ticks on X and Y axes are shown in the two back rectangle. Default value is false. To show the lines the ShowXAxisConnectionLines and ShowYAxisConnectionLines must be true.
Public propertyShowBottomConnectionLines Gets or sets a Boolean that specifies if connection lines that connect major ticks on X and Y axes are shown in the bottom rectangle. Default value is true. To show the lines the ShowXAxisConnectionLines and ShowYAxisConnectionLines must be true.
Public propertyShowXAxisConnectionLines Gets or sets a Boolean that specifies if vertical connection lines that show major ticks on X axis are shown in the background rectangles. Default value is true. To define where to show the connection lines set ShowBackConnectionLines or ShowBackConnectionLines to true.
Public propertyShowYAxisConnectionLines Gets or sets a Boolean that specifies if vertical connection lines that show major ticks on Y axis are shown in the background rectangles. Default value is true. To define where to show the connection lines set ShowBackConnectionLines or ShowBackConnectionLines to true.
Public propertyShowZAxisConnectionLines Gets or sets a Boolean that specifies if horizontal connection lines that show major ticks on Z axis are shown in the background rectangles. Default value is true.
Public propertySize Gets or sets the size of the 3D box used to create the lines. Default value is (100, 100, 100).
Public propertyTicksLineColor Gets or sets the color of ticks lines.
Public propertyTicksLineThickness Gets or sets the thickness of the ticks lines in screen coordinates. Default value is 1.
Public propertyTitleRenderBitmapSize Gets or sets a Size that is used as the RenderBitmapSize in the TextBlockVisual3D object that is used to render the axes titles. When Ab3d.DXEngine assembly is present in the application, then the default value is set to (512, 64); otherwise the default value is Size.Empty that uses VisualBrush to render the text. This property sets the TitleRenderBitmapSize for all axes. To set Size for rendered value labels set the ValueLabelsRenderBitmapSize.
Public propertyValueDisplayCulture Gets the culture that is used to format value labels. Default value is null (using current culture).
Public propertyValueDisplayFormatString Gets or sets the string that defines the format string that is used to format the displayed values. When this string is empty, then values are not displayed. Default value is "#,##0". Culture that is used to format the value is defined by the ValueDisplayCulture property (InvariantCulture by default).
Public propertyValueLabelsBrush Gets or sets the brush of the value labels text.
Public propertyValueLabelsFontSize Gets or sets the size of the value labels text. Default value is 6.
Public propertyValueLabelsFontWeight Gets or sets the FontWeight of the value labels text.
Public propertyValueLabelsPadding Gets or sets a double value that how much are the value labels texts positioned away from the major tick markers. Default value is 3.
Public propertyValueLabelsRenderBitmapSize Gets or sets a Size that is used as the RenderBitmapSize in all used TextBlockVisual3D objects that display value labels. When Ab3d.DXEngine assembly is present in the application, then the default value is set to (128, 64); otherwise the default value is Size.Empty that uses VisualBrush to render the text. This property sets the ValueLabelsRenderBitmapSize for all axes. To set Size for rendered axis title set the TitleRenderBitmapSize.
Public propertyWireBoxLinesVisual3D Gets a MultiLineVisual3D that is used to show major 3D lines for wire box. When IsWireBoxFullyClosed is false, then only the two back rectangles (between both Z axes) are rendered; when true all 3D lines are shown.
Public propertyXAxis1 Gets the AxisWith3DLabelsVisual3D or AxisWithOverlayLabelsVisual3D that is used to render first x axis.
Public propertyXAxis1Title Gets or sets the title for XAxis1. This is a shortcut for XAxis1.AxisTitle property.
Public propertyXAxis2 Gets the AxisWith3DLabelsVisual3D or AxisWithOverlayLabelsVisual3D that is used to render second x axis.
Public propertyXAxis2Title Gets or sets the title for XAxis2. This is a shortcut for XAxis2.AxisTitle property.
Public propertyYAxis1 Gets the AxisWith3DLabelsVisual3D or AxisWithOverlayLabelsVisual3D that is used to render first y axis.
Public propertyYAxis1Title Gets or sets the title for YAxis1. This is a shortcut for YAxis1.AxisTitle property.
Public propertyYAxis2 Gets the AxisWith3DLabelsVisual3D or AxisWithOverlayLabelsVisual3D that is used to render second y axis.
Public propertyYAxis2Title Gets or sets the title for YAxis2. This is a shortcut for YAxis2.AxisTitle property.
Public propertyZAxis1 Gets the AxisWith3DLabelsVisual3D or AxisWithOverlayLabelsVisual3D that is used to render first z axis.
Public propertyZAxis1Title Gets or sets the title for ZAxis1. This is a shortcut for ZAxis1.AxisTitle property.
Public propertyZAxis2 Gets the AxisWith3DLabelsVisual3D or AxisWithOverlayLabelsVisual3D that is used to render second z axis.
Public propertyZAxis2Title Gets or sets the title for ZAxis2. This is a shortcut for ZAxis2.AxisTitle property.
Top
Methods
 NameDescription
Public methodDispose Dispose method frees the TextBlockVisual3D objects that are created by this AxesBoxVisual3D.
Public methodGetAllAxes Returns an array of all AxisWithLabelsBase objects.
Public methodGetAllVisibleAxes Returns an array of all AxisWithLabelsBase objects that have IsVisible set to true.
Protected methodStatic memberOnAdjustFirstAndLastLabelPositionsPropertyChanged OnAdjustFirstAndLastLabelPositionsPropertyChanged
Protected methodStatic memberOnAxesPropertyChanged OnAxesPropertyChanged
Protected methodStatic memberOnCameraPropertyChanged OnCameraPropertyChanged
Protected methodStatic memberOnConnectionLinesPropertyChanged OnConnectionLinesPropertyChanged
Protected methodStatic memberOnOverlayCanvasPropertyChanged OnOverlayCanvasPropertyChanged
Protected methodStatic memberOnPositionSizePropertyChanged OnPositionSizePropertyChanged
Public methodSetAxisDataRange SetAxisDataRange method sets the data range and ticks step for the specified axis.
Public methodUpdate Update method updates the shown axes.
Protected methodStatic memberValidatePositiveNumberPropertyValue Returns true if value is valid double and bigger or equal to 0
Top
Fields
 NameDescription
Public fieldStatic memberAdjustFirstAndLastLabelPositionsProperty AdjustFirstAndLastLabelPositionsProperty
Public fieldStatic memberAxisLineColorProperty AxisLineColorProperty
Public fieldStatic memberAxisLineThicknessProperty AxisLineThicknessProperty
Public fieldStatic memberAxisShowingStrategyProperty AxisShowingStrategyProperty
Public fieldStatic memberAxisTitleBrushProperty AxisTitleBrushProperty
Public fieldStatic memberAxisTitleFontSizeSizeProperty FontSizeProperty
Public fieldStatic memberAxisTitleFontWeightProperty AxisTitleFontWeightProperty
Public fieldStatic memberCameraProperty CameraProperty
Public fieldStatic memberCenterPositionProperty CenterPositionProperty
Public fieldStatic memberConnectionLinesColorProperty ConnectionLinesColorProperty
Public fieldStatic memberConnectionLinesThicknessProperty ConnectionLinesThicknessProperty
Public fieldStatic memberFontFamilyProperty FontSizeProperty
Public fieldStatic memberIs3DTextShownProperty Is3DTextShownProperty
Public fieldStatic memberIsWireBoxFullyClosedProperty IsWireBoxFullyClosedProperty
Public fieldStatic memberMajorTicksLengthProperty MajorTicksLengthProperty
Public fieldStatic memberMinorTicksLengthProperty MinorTicksLengthProperty
Public fieldStatic memberOverlayCanvasProperty OverlayCanvasProperty
Public fieldStatic memberShowBackConnectionLinesProperty ShowBackConnectionLinesProperty
Public fieldStatic memberShowBottomConnectionLinesProperty ShowBottomConnectionLinesProperty
Public fieldStatic memberShowXAxisConnectionLinesProperty ShowXAxisConnectionLinesProperty
Public fieldStatic memberShowYAxisConnectionLinesProperty ShowYAxisConnectionLinesProperty
Public fieldStatic memberShowZAxisConnectionLinesProperty ShowZAxisConnectionLinesProperty
Public fieldStatic memberSizeProperty SizeProperty
Public fieldStatic memberTicksLineColorProperty TicksLineColorProperty
Public fieldStatic memberTicksLineThicknessProperty TicksLineThicknessProperty
Public fieldStatic memberValueDisplayFormatStringProperty ValueDisplayFormatStringProperty
Public fieldStatic memberValueLabelsBrushProperty ValueLabelsBrushProperty
Public fieldStatic memberValueLabelsFontSizeProperty FontSizeProperty
Public fieldStatic memberValueLabelsFontWeightProperty ValueLabelsFontWeightProperty
Public fieldStatic memberValueLabelsPaddingProperty ValueLabelsPaddingProperty
Top
Extension Methods
 NameDescription
Public Extension MethodDumpHierarchy Display details about the hierarchy of Visual3D children to Debug console (for example to Visual Studio's Immediate window).
(Defined by Extensions)
Public Extension MethodForEachGeometryModel3D Performs the specified action on each GeometryModel3D inside the rootModelVisual3D.
(Defined by Extensions)
Public Extension MethodForEachVisual3D Performs the specified action on each ModelVisual3D inside the rootModelVisual3D.
(Defined by Extensions)
Public Extension MethodGetName Gets name of the Visual3D that was previously set by SetName extension method.
(Defined by Extensions)
Public Extension MethodSetName Sets Name property to Visual3D. Note that if name is not correct for WPF, it can be corrected (name must start with a letter or the underscore character (_), and must contain only letters, digits, or underscores). In this case the SetName method will set the corrected name to the object and return false (in this case you can call GetName to get the corrected name). True is returned when the original name is set to the object.
(Defined by Extensions)
Top
See Also