Click or drag to resize
AB4D logo

Extensions Class

Extensions class provides extension methods to convert WPF types to SharpDX types and vice versa.
Inheritance Hierarchy
SystemObject
  Ab3d.DirectXExtensions

Namespace: Ab3d.DirectX
Assembly: Ab3d.DXEngine.Wpf (in Ab3d.DXEngine.Wpf.dll) Version: 7.1.9105.2048
Syntax
C#
public static class Extensions

The Extensions type exposes the following members.

Methods
 NameDescription
Public Extension MethodClearDXAttribute(Geometry3D, DXAttributeType) Clears the value from DXAttributeType so that IsDXAttributeSet(Geometry3D, DXAttributeType) method returns false for that DXAttributeType.
Public Extension MethodClearDXAttribute(Material, DXAttributeType) Clears the value from DXAttributeType so that IsDXAttributeSet(Material, DXAttributeType) method returns false for that DXAttributeType.
Public Extension MethodClearDXAttribute(Model3D, DXAttributeType) Clears the value from DXAttributeType so that IsDXAttributeSet(Model3D, DXAttributeType) method returns false for that DXAttributeType.
Public Extension MethodClearDXAttribute(Visual3D, DXAttributeType) Clears the value from DXAttributeType so that IsDXAttributeSet(Visual3D, DXAttributeType) method returns false for that DXAttributeType.
Public Extension MethodClearUsedDXMaterial Clears a cached DXEngine's Material that is used for the WPF material. This means that next time the WPF material will be used a new instance of DXEngine's Material will be created.
Public Extension MethodFastEquals FastEquals compares two 4x4 matrices and returns true if they are exactly equal. To find results faster the FastEquals checks the fields that are usually different first (Offset, then scale, the others).
Public Extension MethodGetDXAttribute(Geometry3D, DXAttributeType) Gets the value of the specified DXAttributeType from the specified Geometry3D. If the attributeType does not exists then an exception is thrown. Use GetDXAttributeOrDefaultT(Geometry3D, DXAttributeType) or GetDXAttributeOrDefaultT(Geometry3D, DXAttributeType, T) to prevent throwing exception when the value is not set.
Public Extension MethodGetDXAttribute(Material, DXAttributeType) Gets the value of the specified DXAttributeType from the specified System.Windows.Media.Media3D.Material. If the attributeType does not exists then an exception is thrown. Use GetDXAttributeOrDefaultT(Material, DXAttributeType) or GetDXAttributeOrDefaultT(Material, DXAttributeType, T) to prevent throwing exception when the value is not set.
Public Extension MethodGetDXAttribute(Model3D, DXAttributeType) Gets the value of the specified DXAttributeType from the specified Model3D. If the attributeType does not exists then an exception is thrown. Use GetDXAttributeOrDefaultT(Model3D, DXAttributeType) or GetDXAttributeOrDefaultT(Model3D, DXAttributeType, T) to prevent throwing exception when the value is not set.
Public Extension MethodGetDXAttribute(Visual3D, DXAttributeType) Gets the value of the specified DXAttributeType from the specified Visual3D. If the attributeType does not exists then an exception is thrown. Use GetDXAttributeOrDefaultT(Visual3D, DXAttributeType) or GetDXAttributeOrDefaultT(Visual3D, DXAttributeType, T) to prevent throwing exception when the value is not set.
Public Extension MethodGetDXAttributeCollection(Geometry3D) Gets a DXAttributeCollection will a collection of all DXEngine's attributes set to the specified WPF's object. Returns null when no DXAttributeCollection was attached to the WPF object.
Public Extension MethodGetDXAttributeCollection(Material) Gets a DXAttributeCollection will a collection of all DXEngine's attributes set to the specified WPF's object. Returns null when no DXAttributeCollection was attached to the WPF object.
Public Extension MethodGetDXAttributeCollection(Model3D) Gets a DXAttributeCollection will a collection of all DXEngine's attributes set to the specified WPF's object. Returns null when no DXAttributeCollection was attached to the WPF object.
Public Extension MethodGetDXAttributeCollection(Visual3D) Gets a DXAttributeCollection will a collection of all DXEngine's attributes set to the specified WPF's object. Returns null when no DXAttributeCollection was attached to the WPF object.
Public Extension MethodGetDXAttributeOrDefaultT(Geometry3D, DXAttributeType) Gets the value of the specified DXAttributeType from the specified Geometry3D. If the attributeType does not exists then a default value for the type T is returned.
Public Extension MethodGetDXAttributeOrDefaultT(Material, DXAttributeType) Gets the value of the specified DXAttributeType from the specified System.Windows.Media.Media3D.Material. If the attributeType does not exists then a default value for the type T is returned.
Public Extension MethodGetDXAttributeOrDefaultT(Model3D, DXAttributeType) Gets the value of the specified DXAttributeType from the specified Model3D. If the attributeType does not exists then a default value for the type T is returned.
Public Extension MethodGetDXAttributeOrDefaultT(Visual3D, DXAttributeType) Gets the value of the specified DXAttributeType from the specified Visual3D. If the attributeType does not exists then a default value for the type T is returned.
Public Extension MethodGetDXAttributeOrDefaultT(Geometry3D, DXAttributeType, T) Gets the value of the specified DXAttributeType from the specified Geometry3D. If the attributeType does not exists then the specified defaultValue is returned.
Public Extension MethodGetDXAttributeOrDefaultT(Material, DXAttributeType, T) Gets the value of the specified DXAttributeType from the specified System.Windows.Media.Media3D.Material. If the attributeType does not exists then the specified defaultValue is returned.
Public Extension MethodGetDXAttributeOrDefaultT(Model3D, DXAttributeType, T) Gets the value of the specified DXAttributeType from the specified Model3D. If the attributeType does not exists then the specified defaultValue is returned.
Public Extension MethodGetDXAttributeOrDefaultT(Visual3D, DXAttributeType, T) Gets the value of the specified DXAttributeType from the specified Visual3D. If the attributeType does not exists then the specified defaultValue is returned.
Public Extension MethodGetGeometryModel3D Returns a WPF's GeometryModel3D that was used to create the specified sceneNode. If the sceneNode does not define a GeometryModel3D object, then null is returned.
Public Extension MethodGetModel3D Returns a WPF's Model3D that was used to create the specified sceneNode. If the sceneNode does not define a Model3D object, then null is returned.
Public Extension MethodGetModelVisual3D Returns a WPF's ModelVisual3D that was used to create the specified sceneNode or any parent SceneNode (in case searchParentSceneNodes is true). If a SceneNode that defines a ModelVisual3D is not found, then null is returned.
Public Extension MethodGetUsedDXMaterial GetUsedDXMaterial method returns a DXEngine's Material that was created from the WPF material (or null if no DXMaterial was created for the WPF material) parentDXDevice is requireed to check if the created DXMeshGeometry3D was created for the same device.
Public Extension MethodGetUsedDXMeshGeometry3D GetUsedDXMeshGeometry3D method checks if DXMeshGeometry3D object was already created for the specified meshGeometry and returns it in that case. Else null is returned. parentDXDevice is requireed to check if the created DXMeshGeometry3D was created for the same device.
Public Extension MethodGetVisual3D Returns a WPF's Visual3D that was used to create the specified sceneNode or any parent SceneNode (in case searchParentSceneNodes is true). If a SceneNode that defines a Visual3D is not found, then null is returned.
Public Extension MethodIsDXAttributeSet(Geometry3D, DXAttributeType) Returns true if the specified attributeType was set (result is true even if the value is null).
Public Extension MethodIsDXAttributeSet(Material, DXAttributeType) Returns true if the specified attributeType was set (result is true even if the value is null).
Public Extension MethodIsDXAttributeSet(Model3D, DXAttributeType) Returns true if the specified attributeType was set (result is true even if the value is null).
Public Extension MethodIsDXAttributeSet(Visual3D, DXAttributeType) Returns true if the specified attributeType was set (result is true even if the value is null).
Public Extension MethodSaturate(Color3) Ensures that the color components are within 0 and 1 - if smaller than 0 than the value is set to 0; if bigger than 1 the value is set to 1. This is the same as saturate function in HLSL.
Public Extension MethodSaturate(Color4) Ensures that the color components are within 0 and 1 - if smaller than 0 than the value is set to 0; if bigger than 1 the value is set to 1. This is the same as saturate function in HLSL.
Public Extension MethodSetDXAttribute(Geometry3D, DXAttributeType, Object) Annotates the specified wpfObject with adding or updating a DXEngine's attribute to it. The attribute is specified with attributeType and its value. This can be used to annotate WPF's objects with DXEngine's attributes.
Public Extension MethodSetDXAttribute(Material, DXAttributeType, Object) Annotates the specified wpfObject with adding or updating a DXEngine's attribute to it. The attribute is specified with attributeType and its value. This can be used to annotate WPF's objects with DXEngine's attributes.
Public Extension MethodSetDXAttribute(Model3D, DXAttributeType, Object) Annotates the specified wpfObject with adding or updating a DXEngine's attribute to it. The attribute is specified with attributeType and its value. This can be used to annotate WPF's objects with DXEngine's attributes.
Public Extension MethodSetDXAttribute(Visual3D, DXAttributeType, Object) Annotates the specified wpfObject with adding or updating a DXEngine's attribute to it. The attribute is specified with attributeType and its value. This can be used to annotate WPF's objects with DXEngine's attributes.
Public Extension MethodSetUsedDXMaterial(Material, Material) Sets the specified DXEngine's Material (dxMaterial) to be used when rendering the specified WPF material (wpfMaterial). It will be used when the WPF material will be shown in DXEngine (must be set before the objects are initialized in DXEngine).
Public Extension MethodSetUsedDXMaterial(Material, Material, DXDevice)Obsolete.
Sets the specified DXEngine's Material (dxMaterial) to be used when rendering the specified WPF material (wpfMaterial). It will be used when the WPF material will be shown in DXEngine (must be set before the objects are initialized in DXEngine).
Public Extension MethodSetUsedDXMeshGeometry3D Sets a DXMeshGeometry3D that will be used when showing WPF MeshGeometry3D in DXEngine.
Public Extension MethodToBoundingBox Converts WPF Rect3D to SharpDX BoundingBox
Public Extension MethodToColor3(Color) Converts WPF Color to SharpDX Color3
Public Extension MethodToColor3(Color4) Converts Color4 to Color3
Public Extension MethodToColor4(Color) Converts WPF Color to SharpDX Color4
Public Extension MethodToColor4(Color3) Converts Color3 to Color4
Public Extension MethodToColor4(Color3, Single) Converts Color3 with alpha to Color4
Public Extension MethodToDXEngineBounds Converts SharpDX BoundingBox to DXEngine's Bounds object
Public Extension MethodToDXTransform Converts WPF Transform to DXEngine Transformation
Public Extension MethodToMatrix Converts WPF Matrix3D to SharpDX Matrix
Public Extension MethodToPoint3DCollection Converts the SharpDX's Vector3 array to WPF's Point3DCollection.
Public Extension MethodToPremultipliedColor3(Color) Converts WPF Color to premultipled SharpDX Color3 (premultipled color is color where R, G and B color values are multiplied with alpha value)
Public Extension MethodToPremultipliedColor3(Color, Single) Converts WPF Color to premultipled SharpDX Color3 (premultipled color is color where R, G and B color values are multiplied with alpha value)
Public Extension MethodToPremultipliedColor4 Converts WPF Color to premultipled SharpDX Color4 (premultipled color is color where R, G and B color values are multiplied with alpha value)
Public Extension MethodToRect3D(BoundingBox) Converts SharpDX BoundingBox to WPF Rect3D
Public Extension MethodToRect3D(Bounds) Converts DXEngine's Bounds object to WPF Rect3D
Public Extension MethodToVector2 Converts WPF Point to SharpDX Vector2
Public Extension MethodToVector3(Point3D) Converts WPF Point3D to SharpDX Vector3
Public Extension MethodToVector3(Vector3D) Converts WPF Vector3D to SharpDX Vector3
Public Extension MethodToVector3Array Converts the WPF's Point3DCollection to SharpDX's Vector3 array.
Public Extension MethodToWpfColor(Color) Converts SharpDX Color to WPF Color
Public Extension MethodToWpfColor(Color3) Converts SharpDX Color3 to WPF color
Public Extension MethodToWpfColor(Color4) Converts SharpDX Color4 to WPF color
Public Extension MethodToWpfMatrix3D Converts SharpDX Matrix to WPF Matrix3D
Public Extension MethodToWpfPoint3D Converts SharpDX Vector3 to WPF Point3D
Public Extension MethodToWpfVector3D Converts SharpDX Vector3 to WPF Vector3D
Public Extension MethodUpdate Updates the DXEngine's Transformation to the value of WPF Transform3D
Public Extension MethodUpdateDXBounds(Bounds, Rect3D) Checks if wpfBounds is not the same as dxBounds and in this case updates the values in dxBounds
Public Extension MethodUpdateDXBounds(Bounds, Rect3D) Checks if wpfBounds is not the same as dxBounds and in this case updates the values in dxBounds
Top
See Also