Click or drag to resize
AB4D logo

BaseAxisWithLabelsVisual3D Class

BaseAxisWithLabelsVisual3D is a base class for AxisWith3DLabelsVisual3D and AxisWithOverlayLabelsVisual3D and defines many common properties that define the value ranges, size and style of the value labels and title and other common axis properties.
Inheritance Hierarchy
SystemObject
  System.Windows.ThreadingDispatcherObject
    System.WindowsDependencyObject
      System.Windows.Media.Media3DVisual3D
        System.Windows.Media.Media3DModelVisual3D
          Ab3d.VisualsBaseVisual3D
            Ab3d.VisualsContentVisual3D
              Ab3d.VisualsBaseAxisWithLabelsVisual3D
                Ab3d.VisualsAxisWith3DLabelsVisual3D
                Ab3d.VisualsAxisWithOverlayLabelsVisual3D

Namespace: Ab3d.Visuals
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.1.8864.1045
Syntax
C#
public abstract class BaseAxisWithLabelsVisual3D : ContentVisual3D

The BaseAxisWithLabelsVisual3D type exposes the following members.

Constructors
 NameDescription
Public methodBaseAxisWithLabelsVisual3D Constructor
Public methodBaseAxisWithLabelsVisual3D(String) Constructor
Top
Properties
 NameDescription
Public propertyAxisEndPosition Gets or sets the axis's end position. Default value is (0, 100, 0).
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 propertyAxisLineVisual3D Gets LineVisual3D that is used to show axis line.
Public propertyAxisStartPosition Gets or sets axis's start position. Default value is (0, 0, 0).
Public propertyAxisTitle Gets or sets the title of this axis.
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. Default value is Normal.
Public propertyAxisTitlePadding Gets or sets a double value that how much are the axis title text is positioned away from the longest value label. Default value is 3.
Public propertyCamera Gets or sets the camera from Ab3d.PowerToys library that is showing the 3D scene.
Public propertyFontFamily Gets or sets the FontFamily of the text.
Public propertyIsAutomaticallySubscribedToCameraChanges When true (by default) the Update method is automatically called on each change of the Camera.
Public propertyIsRenderingOnRightSideOfAxis Gets or sets a Boolean that specifies if Ticks and Labels are rendered on the right side of the axis (when true) or on the left side of the axis (when false). Default value is false.
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 propertyMajorTicksStep Gets or sets a double value that defines the step (difference) between two major ticks makers and labels (labels are rendered next to major tick markers). When set to zero or negative value, then major ticks and labels are not shown. Default value is 1.
Public propertyMaximumValue Gets or sets a double that defines the maximum value on the graph. When SnapMaximumValueToMajorTicks is set to true, the actually used maximum value can be bigger then this value. Default value is 10.
Public propertyMinimumValue Gets or sets a double that defines the minimum value on the graph. Default value is 0.
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 propertyMinorTicksStep Gets or sets a double value that defines the step (difference) between two minor ticks makers. When set to zero, negative value or when the value is smaller then MajorTicksStep, then minor ticks are not shown. Default value is 0.5.
Public propertyRightDirectionVector3D Gets or sets the Vector3D that specifies the right direction of the axis - the direction in which the text is drawn. The axis up direction is defined by the AxisStartPosition and AxisEndPosition. Default value is (1, 0, 0).
Public propertySnapMaximumValueToMajorTicks When true (by default) then the used maximum value is always snapped to the value with major ticks marker. This way the label for maximum value is always shown. When false then the value that is set to the MaximumValue is always used.
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 propertyTicksMultiLineVisual3D Gets MultiLineVisual3D that is used to show major and minor tick lines.
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. Default value is Normal.
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.
Top
Methods
 NameDescription
Protected methodCloneInt Returns a new AxisWithLabelsBase that is a clone of this AxisWithLabelsBase.
Public methodGetMajorTickValues Returns an array of double value that represents the major tick values. By default major tick values are calculated based on MinimumValue, MaximumValue and MajorTicksStep properties.
Public methodGetMinorTickValues Returns an array of double value that represents the minor tick values. By default minor tick values are calculated based on MinimumValue, MaximumValue and MinorTicksStep properties.
Public methodGetRelativeValue GetRelativeValue returns a relative value in range from 0 to 1 from the specified absoluteValue (where the value lies between the AxisStartPosition and AxisEndPosition). Value 0 is returned when absoluteValue is set to MinimumValue. Value 1 is returned when absoluteValue is set to the value returned by the GetUsedMaximumValue method. Returned value is negative when absoluteValue is smaller then MinimumValue and bigger then 1 when the absoluteValue is bigger then used maximum value.
Public methodGetUsedMaximumValue Returns the used maximum value. This value can be different from MaximumValue when SnapMaximumValueToMajorTicks is set to true.
Public methodGetValueLabels Returns an array of strings that represents the value labels.
Protected methodGetValuesRange GetValuesRange returns the difference between used maximum value and used minimum value. Note that used maximum value can be different from MaximumValue when SnapMaximumValueToMajorTicks is set to true
Protected methodOnAxisTitleSettingsChanged(DependencyPropertyChangedEventArgs) OnAxisTitleSettingsChanged method must be implemented by a derived class. The method is called when the font settings for axis title is changed.
Protected methodStatic memberOnAxisTitleSettingsChanged(DependencyObject, DependencyPropertyChangedEventArgs) OnAxisTitleSettingsChanged
Protected methodOnCameraChanged OnCameraChanged method is called when the camera is changed. The method can be overriden in a derived class.
Protected methodStatic memberOnCameraPropertyChanged OnCameraPropertyChanged
Protected methodStatic memberOnFontFamilyPropertyChanged OnFontFamilyPropertyChanged
Protected methodOnIsVisibleChanged OnIsVisibleChanged is called when the value of IsActuallyVisible property is changed.
(Overrides ContentVisual3DOnIsVisibleChanged(Boolean))
Protected methodStatic memberOnLinePropertyChanged OnLinePropertyChanged
Protected methodStatic memberOnTicksMultiLinePropertyChanged OnTicksMultiLinePropertyChanged
Protected methodOnTicksPositionsChanged OnTicksPositionsChanged method must be implemented by a derived class. The method is called when the tick positions are changed.
Protected methodStatic memberOnTicksSettingsChanged OnTicksSettingsChanged
Protected methodOnUpdate OnUpdate method must be implemented by a derived class. The method is called when the Update method is called and should update the axis.
Protected methodOnValueLabelsFontSettingsChanged(DependencyPropertyChangedEventArgs) OnValueLabelsFontSettingsChanged method must be implemented by a derived class. The method is called when the font settings for value labels is changed.
Protected methodStatic memberOnValueLabelsFontSettingsChanged(DependencyObject, DependencyPropertyChangedEventArgs) OnValueLabelsFontSettingsChanged
Protected methodOnViewport3DSizeChanged OnViewport3DSizeChanged is called when the size of Viewport3D is changed. The method can be overriden in a derived class.
Public methodSetCustomMajorTickValues SetCustomMajorTickValues method sets custom double values that represents custom major tick values. The tick values should be between MinimumValue and MaximumValue (values outside of this range will not be shown). The values define the text for the shown labels (when custom labels are not used) and also define the positions of the major tick lines and value labels - if the value is in the middle between MinimumValue and MaximumValue, the tick and label will be also shown in the middle between AxisStartPosition and AxisEndPosition. When customMajorTickValues is null, then major thick lines and value labels will not be shown.
Public methodSetCustomMinorTickValues SetCustomMinorTickValues method sets custom double values that represents custom minor tick values. The tick values should be between MinimumValue and MaximumValue (values outside of this range will not be shown). The values define the positions of the minor tick lines. When customMinorTickValues is null, then minor thick lines will not be shown.
Public methodSetCustomValueLabels SetCustomValueLabels method sets custom texts that will be used as value labels. One value label is displayed for one major tick. The number of elements in the customValueLabels array should be the same as number of displayed major ticks (to get this number call GetValueLabels method). To skip a value label set the array element to null or empty string.
Public methodUpdate Update method is called to update this axis.
Protected methodUpdateContentIfNotInitializing Recreates the models if the Visual3D is visible (IsVisible is true) and it is not initializing (between BeginInit and EndInit)
(Overrides BaseVisual3DUpdateContentIfNotInitializing)
Protected methodUpdateTicksMultiLinePositions UpdateTicksMultiLinePositions method sets various 3D positions (majorTickPositions, minorTickPositions, valueLabelPositions) that represent positions of ticks and value labels in 3D space. The values are calculated based on majorTickValues, minorTickValues and valueLabels lists. The method is virtual and can be overriden to provide custom positioning of ticks and value labels.
Protected methodUpdateTickValues UpdateTickValues method sets values of each major and minor tick and writes them into majorTickValues, minorTickValues lists. The method also for each major tick sets the value label text and set that to valueLabels list. The method is virtual and can be overriden to provide custom calculation of ticks and value label texts.
Protected methodStatic memberValidatePositiveNumberPropertyValue Returns true if value is valid double and bigger or equal to 0
Protected methodStatic memberValidateValidDoublePropertyValue Returns true if value is valid double
Top
Fields
 NameDescription
Public fieldStatic memberAxisEndPositionProperty AxisEndPositionProperty
Public fieldStatic memberAxisLineColorProperty AxisLineColorProperty
Public fieldStatic memberAxisLineThicknessProperty AxisLineThicknessProperty
Public fieldStatic memberAxisStartPositionProperty AxisStartPositionProperty
Public fieldStatic memberAxisTitleBrushProperty AxisTitleBrushProperty
Public fieldStatic memberAxisTitleFontSizeSizeProperty FontSizeProperty
Public fieldStatic memberAxisTitleFontWeightProperty AxisTitleFontWeightProperty
Public fieldStatic memberAxisTitlePaddingProperty AxisTitlePaddingProperty
Public fieldStatic memberAxisTitleProperty AxisTitleProperty
Public fieldStatic memberCameraProperty CameraProperty
Public fieldStatic memberFontFamilyProperty FontSizeProperty
Public fieldStatic memberIsRenderingOnRightSideOfAxisProperty IsRenderingOnRightSideOfAxisProperty
Protected fieldmajorTickPositions A list of Point3D values that define the positions for each minor tick. Those positions lie on the axis.
Public fieldStatic memberMajorTicksLengthProperty MajorTicksLengthProperty
Public fieldStatic memberMajorTicksStepProperty MajorTicksStepProperty
Protected fieldmajorTickValues A list of double value that define the major tick values. The values are stored as offsets from MinimumValue.
Public fieldStatic memberMaximumValueProperty MaximumValueProperty
Public fieldStatic memberMinimumValueProperty MinimumValueProperty
Protected fieldminorTickPositions A list of Point3D values that define the positions for each major tick. Those positions lie on the axis.
Public fieldStatic memberMinorTicksLengthProperty MinorTicksLengthProperty
Public fieldStatic memberMinorTicksStepProperty MajorTicksStepProperty
Protected fieldminorTickValues A list of double value that define the minor tick values. The values are stored as offsets from MinimumValue.
Public fieldStatic memberRightDirectionVector3DProperty RightDirectionVector3DProperty
Public fieldStatic memberSnapMaximumValueToMajorTicksProperty SnapShownMaximumValueToMajorTicksProperty
Public fieldStatic memberTicksLineColorProperty TicksLineColorProperty
Public fieldStatic memberTicksLineThicknessProperty TicksLineThicknessProperty
Protected fielduseCustomMajorTickValues When true, then custom major tick values are used and are not defined by interpolating between MinimumValue and MaximumValue. Custom value labels are set by SetCustomMajorTickValues(Double).
Protected fielduseCustomMinorTickValues When true, then custom minor tick values are used and are not defined by interpolating between MinimumValue and MaximumValue. Custom value labels are set by SetCustomMinorTickValues(Double).
Protected fielduseCustomValueLabels When true, then custom value labels are used and are not defined by calling string.Format for each major tick value. Custom value labels are set by SetCustomValueLabels(String).
Public fieldStatic memberValueDisplayFormatStringProperty ValueDisplayFormatStringProperty
Protected fieldvalueLabelPositions A list of Point3D values that define the positions for each value label - text that shows the value for each major tick. Those positions are defined away from the axis based on ValueLabelsPadding.
Protected fieldvalueLabels A list of strings that define the text for value label that is shown for each major value. Indexes of texts are the same as indexes in majorTickValues.
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