Click or drag to resize
AB4D logo

AxisWithOverlayLabelsVisual3D Class

AxisWithOverlayLabelsVisual3D shows one 3D axis with axis title and value labels (and tick lines - when IsRenderingTickLinesOnOverlay is true) shown as 2D Text in the OverlayCanvas (a Canvas that should be defied on top of Viewport3D). The main axis line (and tick lines - when IsRenderingTickLinesOnOverlay is false) are shown as 3D lines.
Inheritance Hierarchy
SystemObject
  System.Windows.ThreadingDispatcherObject
    System.WindowsDependencyObject
      System.Windows.Media.Media3DVisual3D
        System.Windows.Media.Media3DModelVisual3D
          Ab3d.VisualsBaseVisual3D
            Ab3d.VisualsContentVisual3D
              Ab3d.VisualsBaseAxisWithLabelsVisual3D
                Ab3d.VisualsAxisWithOverlayLabelsVisual3D

Namespace: Ab3d.Visuals
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.2.9104.2045
Syntax
C#
public class AxisWithOverlayLabelsVisual3D : BaseAxisWithLabelsVisual3D

The AxisWithOverlayLabelsVisual3D type exposes the following members.

Constructors
Properties
 NameDescription
Public propertyAdjustFirstLabelPosition When true, then the first label is moved up to prevent overlapping the first label with adjacent axis. The amount of movement is calculated by multiplying font size and LabelXAdjustmentFactor (0.25 by default) or LabelYAdjustmentFactor (0.5 by default). Default value is false.
Public propertyAdjustLastLabelPosition When true, then the last label is moved down to prevent overlapping the last label with adjacent axis. The amount of movement is calculated by multiplying font size and LabelXAdjustmentFactor (0.25 by default) or LabelYAdjustmentFactor (0.5 by default). Default value is false.
Public propertyCustomizeValueLabelAction When set, this action is called so the user can customize the TextBlock before it is added to the axis. The first parameter is the index of the value label, the second is the TextBlock.
Public propertyIsRenderingTickLinesOnOverlay Gets or sets a Boolean that specifies if tick lines are rendered to Overlay as 2D lines. When true (by default) then thick lines are rendered as 2D lines on the Overlay Canvas. When false the tick lines are rendered as 3D lines.
Public propertyOverlayCanvas Gets or sets a Canvas that will show the axis numbers
Top
Methods
 NameDescription
Public methodClearOverlayElements ClearOverlayElements removes all elements (TextBlocks) that were added to the OverlayCanvas.
Public methodClone Returns a new BaseAxisWithOverlayLabels that is a clone of this BaseAxisWithOverlayLabels.
Protected methodGetTitleTextBlockPosition GetTitleTextBlockPosition returns the 2D position of the title TextBlock.
Protected methodOnAxisTitleSettingsChanged OnAxisTitleSettingsChanged method must be implemented by a derived class. The method is called when the font settings for axis title is changed.
(Overrides BaseAxisWithLabelsVisual3DOnAxisTitleSettingsChanged(DependencyPropertyChangedEventArgs))
Protected methodOnCameraChanged OnCameraChanged method is called when the camera is changed. The method can be overriden in a derived class.
(Overrides BaseAxisWithLabelsVisual3DOnCameraChanged)
Protected methodStatic memberOnIsRenderingTickLinesOnOverlayPropertyChanged OnIsRenderingTickLinesOnOverlayPropertyChanged
Protected methodOnIsVisibleChanged OnIsVisibleChanged is called when the value of IsActuallyVisible property is changed.
(Overrides BaseAxisWithLabelsVisual3DOnIsVisibleChanged(Boolean))
Protected methodOnTicksPositionsChanged OnTicksPositionsChanged method must be implemented by a derived class. The method is called when the tick positions are changed.
(Overrides BaseAxisWithLabelsVisual3DOnTicksPositionsChanged)
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.
(Overrides BaseAxisWithLabelsVisual3DOnUpdate)
Protected methodOnValueLabelsFontSettingsChanged OnValueLabelsFontSettingsChanged method must be implemented by a derived class. The method is called when the font settings for value labels is changed.
(Overrides BaseAxisWithLabelsVisual3DOnValueLabelsFontSettingsChanged(DependencyPropertyChangedEventArgs))
Protected methodOnViewport3DSizeChanged OnViewport3DSizeChanged is called when the size of Viewport3D is changed. The method can be overriden in a derived class.
(Overrides BaseAxisWithLabelsVisual3DOnViewport3DSizeChanged)
Protected methodUpdateLabelTextBlocksPosition UpdateLabelTextBlocksPosition is used to position the TextBloc objects in allDataTextBlocks list.
Top
Fields
 NameDescription
Public fieldStatic memberAdjustFirstLabelPositionProperty AdjustFirstLabelPositionProperty
Public fieldStatic memberAdjustLastLabelPositionProperty AdjustLastLabelPositionProperty
Protected fieldallDataTextBlocks List of TextBlock objects used to render value labels.
Public fieldStatic memberIsRenderingTickLinesOnOverlayProperty IsRenderingTicksOnOverlayProperty
Public fieldLabelXAdjustmentFactor Gets or sets a double that specifies a factor that is multiplied by FontSize and used to adjust the X position of the first or last label when AdjustFirstLabelPosition or are used.
Public fieldLabelYAdjustmentFactor Gets or sets a double that specifies a factor that is multiplied by FontSize and used to adjust the Y position of the first or last label when AdjustFirstLabelPosition or are used.
Protected fieldmajorTickOverlayLines List of 2D lines (WPF's Shapes.Line objects) used to render major ticks.
Protected fieldminorTickOverlayLines List of 2D lines (WPF's Shapes.Line objects) used to render minor ticks.
Public fieldStatic memberOverlayCanvasProperty OverlayCanvasProperty
Protected fieldtitleTextBlock TextBlock used to render axis title.
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