Click or drag to resize
AB4D logo

BaseVisual3D Class

BaseVisual3D is a base class for all Visual3D classes in Ab3d.PowerToys. It adds IsVisible property and support for ISupportInitialize interface.
Inheritance Hierarchy

Namespace: Ab3d.Visuals
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.2.9104.2045
Syntax
C#
public abstract class BaseVisual3D : ModelVisual3D, 
	ISupportInitialize

The BaseVisual3D type exposes the following members.

Constructors
 NameDescription
Protected methodBaseVisual3D Constructor
Protected methodBaseVisual3D(String) Constructor
Top
Properties
 NameDescription
Public propertyIsActuallyVisible Gets a Boolean that specifies if this object is actually visible taking parent's visibility into account - this.IsVisible is true and also the parent is visible. Note: when this Visual3D or any parent Visual3D is connected to a ModelVisual3D, then the value of IsActuallyVisible may not be correct (in case the parent ModelVisual3D is not connected to Viewport3D, then this IsActuallyVisible may still be true). When parents of Visual3D are only ContentVisual3D objects and Viewport3D, then the value of IsActuallyVisible is correct.
Public propertyIsVisible Gets or sets a Boolean that specify if the object is visible. Note that if parent is not visible, then this object is also not visible even if IsVisible is true. See IsActuallyVisible to get the value if this object is actually visible.
Public propertyParent Gets the DependencyObject that is parent of this BaseVisual3D. When this BaseVisual3D is added to a Viewport3D then Parent is set to Viewport3DVisual, otherwise it is set to a parent Visual3D or to null (when no parent is assigned).
Public propertyTag Gets or sets any object as a Tag to this object (using FrameworkElement.TagProperty).
Top
Methods
 NameDescription
Public methodBeginInit Signals the line 3D that initialization is starting.
Protected methodCreateModel Creates this Model3D
Public methodEndInit Signals the line 3D that initialization is complete.
Public methodGetContent GetContent return the Model3D from the Content property (when this Visual3D is visible) or from the protected savedHiddenContent field (when this Visual3D is hidden, then the Model3D from the Content is set to savedHiddenContent field so that Content can be set to null to hide this Visual3D).
Protected methodOnIsVisibleChanged OnIsVisibleChanged is called when the value of IsActuallyVisible property is changed.
Protected methodOnParentChanged OnParentChanged
Protected methodStatic memberOnPropertyChanged OnPropertyChanged method calls UpdateContentIfNotInitializing that recreates the model is visible (IsVisible is true) and if not initializing (between BeginInit and EndInit).
Protected methodOnVisualParentChanged OnVisualParentChanged
(Overrides Visual3DOnVisualParentChanged(DependencyObject))
Public methodSetContent SetContent method sets the specified model3D to the Content property (when this Visual3D is visible), or to the savedHiddenContent field (when this Visual3D is hidden, then the Model3D from the Content is set to savedHiddenContent field so that Content can be set to null to hide this Visual3D).
Protected methodUpdateContentIfNotInitializing Recreates the models if the Visual3D is visible (IsVisible is true) and it is not initializing (between BeginInit and EndInit)
Protected methodStatic memberValidateDoublePropertyValue Returns true if value is valid double
Protected methodStatic memberValidatePositiveDoublePropertyValue Returns true if value is valid double and is positive
Protected methodStatic memberValidatePositiveIntPropertyValue Returns true if value is positive integer
Protected methodStatic memberValidateSize3DOneZeroAllowedPropertyValue Returns true if the value is a valid Size3D object used for Box3D (one size component is allowed to be zero)
Protected methodStatic memberValidateSize3DPropertyValue Returns true if the value is a valid Size3D object
Protected methodStatic memberValidateSizePropertyValue Returns true if the value is a valid Size object
Top
Events
 NameDescription
Public eventIsVisibleChanged Notify that the value of IsActuallyVisible property is changed. When true is returned from event handler, this prevents handling the change in this class. This is used when rendering in DXEngine. There handling IsVisible changes is optimized and does not require to remove the content of this Visual3D from visual 3D tree.
Public eventParentChanged ParentChanged event is triggered when the Parent of this BaseVisual3D is changed.
Top
Fields
 NameDescription
Protected fieldisInitializing if true the Visual3D is initializing (between BeginInit and EndInit)
Public fieldStatic memberIsVisibleProperty IsVisibleProperty
Protected fieldsavedHiddenContent savedHiddenContent stores the content of this model when it is hidden so that Content can be null. When this Visual3D is visible again, the Model3D that is set to this savedHiddenContent is set back to the Content property. To get or set Content or savedHiddenContent use GetContent and SetContent(Model3D) methods.
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
Inheritance Hierarchy
SystemObject
  System.Windows.ThreadingDispatcherObject
    System.WindowsDependencyObject
      System.Windows.Media.Media3DVisual3D
        System.Windows.Media.Media3DModelVisual3D
          Ab3d.VisualsBaseVisual3D
            Ab3d.VisualsBaseLineVisual3D
            Ab3d.VisualsBaseModelVisual3D
            Ab3d.VisualsBaseTextVisual3D
            Ab3d.VisualsColoredAxisVisual3D
            Ab3d.VisualsContentVisual3D
            Ab3d.VisualsModelDecoratorVisual3D
            Ab3d.VisualsMultiMaterialBoxVisual3D
            Ab3d.VisualsObjModelVisual3D
            Ab3d.VisualsTextBlockVisual3D
            Ab3d.VisualsWireframeVisual3D