Class MeshElement3D
- Namespace
- HelixToolkit.Wpf
- Assembly
- HelixToolkit.Wpf.dll
Represents a base class for elements that contain one GeometryModel3D and front and back Materials.
public abstract class MeshElement3D : ModelVisual3D, IAnimatable, IAddChild, IEditableObject
- Inheritance
-
MeshElement3D
- Implements
- Derived
- Inherited Members
- Extension Methods
Remarks
Derived classes should override the Tessellate method to generate the geometry.
Constructors
MeshElement3D()
Initializes a new instance of the MeshElement3D class.
protected MeshElement3D()
Fields
BackMaterialProperty
Identifies the BackMaterial dependency property.
public static readonly DependencyProperty BackMaterialProperty
Field Value
FillProperty
Identifies the Fill dependency property.
public static readonly DependencyProperty FillProperty
Field Value
MaterialProperty
Identifies the Material dependency property.
public static readonly DependencyProperty MaterialProperty
Field Value
VisibleProperty
The visibility property.
public static readonly DependencyProperty VisibleProperty
Field Value
Properties
BackMaterial
Gets or sets the back material.
public Material BackMaterial { get; set; }
Property Value
- Material
The back material.
Fill
Gets or sets the fill brush. This brush will be used for both the Material and BackMaterial.
public Brush Fill { get; set; }
Property Value
- Brush
The fill brush.
Material
Gets or sets the material.
public Material Material { get; set; }
Property Value
- Material
The material.
Model
Gets the geometry model.
public GeometryModel3D? Model { get; }
Property Value
- GeometryModel3D
The geometry model.
Visible
Gets or sets a value indicating whether this MeshElement3D is visible.
public bool Visible { get; set; }
Property Value
- bool
trueif the element is visible; otherwise,false.
Methods
BeginEdit()
Begins an edit on the object.
public void BeginEdit()
CancelEdit()
Discards changes since the last BeginEdit() call.
public void CancelEdit()
EndEdit()
Pushes changes since the last BeginEdit() or AddNew() call into the underlying object.
public void EndEdit()
GeometryChanged(DependencyObject, DependencyPropertyChangedEventArgs)
The geometry was changed.
protected static void GeometryChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
Parameters
dDependencyObjectThe d.
eDependencyPropertyChangedEventArgsThe event arguments.
MaterialChanged(DependencyObject, DependencyPropertyChangedEventArgs)
The Material or BackMaterial property was changed.
protected static void MaterialChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
Parameters
dDependencyObjectThe d.
eDependencyPropertyChangedEventArgsThe event arguments.
OnFillChanged()
The Fill property was changed.
protected virtual void OnFillChanged()
OnGeometryChanged()
Handles changes in geometry or visible state.
protected virtual void OnGeometryChanged()
OnMaterialChanged()
Handles changes in material/back material.
protected virtual void OnMaterialChanged()
Tessellate()
Do the tessellation and return the MeshGeometry3D.
protected abstract MeshGeometry3D? Tessellate()
Returns
- MeshGeometry3D
A triangular mesh geometry.
UpdateModel()
Forces an update of the geometry and materials.
public void UpdateModel()
VisibleChanged(DependencyObject, DependencyPropertyChangedEventArgs)
The visible flag changed.
protected static void VisibleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
Parameters
dDependencyObjectThe d.
eDependencyPropertyChangedEventArgsThe event arguments.