// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using SharpDX.Mathematics.Interop; namespace SharpDX.Direct2D1 { public partial class Geometry { private float _flatteningTolerance = DefaultFlatteningTolerance; /// /// Default flattening tolerance used for all methods that are not explicitly using it. Default is set to 0.25f. /// public const float DefaultFlatteningTolerance = 0.25f; /// /// Get or set the default flattening tolerance used for all methods that are not explicitly using it. Default is set to 0.25f. /// public float FlatteningTolerance { get { return _flatteningTolerance; } set { _flatteningTolerance = value; } } /// /// Combines this geometry with the specified geometry and stores the result in an . /// /// The geometry to combine with this instance. /// The type of combine operation to perform. /// The result of the combine operation. /// If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. /// HRESULT CombineWithGeometry([In] ID2D1Geometry* inputGeometry,[None] D2D1_COMBINE_MODE combineMode,[In, Optional] const D2D1_MATRIX_3X2_F* inputGeometryTransform,[None] FLOAT flatteningTolerance,[In] ID2D1SimplifiedGeometrySink* geometrySink) public void Combine(SharpDX.Direct2D1.Geometry inputGeometry, SharpDX.Direct2D1.CombineMode combineMode, GeometrySink geometrySink) { this.Combine(inputGeometry, combineMode, null, FlatteningTolerance, geometrySink); } /// /// Combines this geometry with the specified geometry and stores the result in an . /// /// The geometry to combine with this instance. /// The type of combine operation to perform. /// The maximum bounds on the distance between points in the polygonal approximation of the geometries. Smaller values produce more accurate results but cause slower execution. /// The result of the combine operation. /// If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. /// HRESULT CombineWithGeometry([In] ID2D1Geometry* inputGeometry,[None] D2D1_COMBINE_MODE combineMode,[In, Optional] const D2D1_MATRIX_3X2_F* inputGeometryTransform,[None] FLOAT flatteningTolerance,[In] ID2D1SimplifiedGeometrySink* geometrySink) public void Combine(SharpDX.Direct2D1.Geometry inputGeometry, SharpDX.Direct2D1.CombineMode combineMode, float flatteningTolerance, GeometrySink geometrySink) { this.Combine(inputGeometry, combineMode, null, flatteningTolerance, geometrySink); } /// /// Describes the intersection between this geometry and the specified geometry. The comparison is performed by using the specified flattening tolerance. /// /// /// When interpreting the returned relation value, it is important to remember that the member of the D2D1_GEOMETRY_RELATION enumeration type means that this geometry is contained inside inputGeometry, not that this geometry contains inputGeometry. For more information about how to interpret other possible return values, see . /// /// The geometry to test. /// When this method returns, contains a reference to a value that describes how this geometry is related to inputGeometry. You must allocate storage for this parameter. /// HRESULT ID2D1Geometry::CompareWithGeometry([In] ID2D1Geometry* inputGeometry,[In, Optional] const D2D1_MATRIX_3X2_F* inputGeometryTransform,[None] float flatteningTolerance,[Out] D2D1_GEOMETRY_RELATION* relation) public GeometryRelation Compare(Geometry inputGeometry) { return Compare(inputGeometry, null, FlatteningTolerance); } /// /// Describes the intersection between this geometry and the specified geometry. The comparison is performed by using the specified flattening tolerance. /// /// /// When interpreting the returned relation value, it is important to remember that the member of the D2D1_GEOMETRY_RELATION enumeration type means that this geometry is contained inside inputGeometry, not that this geometry contains inputGeometry. For more information about how to interpret other possible return values, see . /// /// The geometry to test. /// The maximum bounds on the distance between points in the polygonal approximation of the geometries. Smaller values produce more accurate results but cause slower execution. /// When this method returns, contains a reference to a value that describes how this geometry is related to inputGeometry. You must allocate storage for this parameter. /// HRESULT ID2D1Geometry::CompareWithGeometry([In] ID2D1Geometry* inputGeometry,[In, Optional] const D2D1_MATRIX_3X2_F* inputGeometryTransform,[None] float flatteningTolerance,[Out] D2D1_GEOMETRY_RELATION* relation) public GeometryRelation Compare(Geometry inputGeometry, float flatteningTolerance) { return Compare(inputGeometry, null, flatteningTolerance); } /// /// Computes the area of the geometry after it has been transformed by the specified matrix and flattened using the specified tolerance. /// /// When this this method returns, contains a reference to the area of the transformed, flattened version of this geometry. You must allocate storage for this parameter. /// HRESULT ID2D1Geometry::ComputeArea([In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] float flatteningTolerance,[Out] float* area) public float ComputeArea() { return ComputeArea(null, FlatteningTolerance); } /// /// Computes the area of the geometry after it has been transformed by the specified matrix and flattened using the specified tolerance. /// /// The maximum bounds on the distance between points in the polygonal approximation of the geometry. Smaller values produce more accurate results but cause slower execution. /// When this this method returns, contains a reference to the area of the transformed, flattened version of this geometry. You must allocate storage for this parameter. /// HRESULT ID2D1Geometry::ComputeArea([In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] float flatteningTolerance,[Out] float* area) public float ComputeArea(float flatteningTolerance) { return ComputeArea(null, flatteningTolerance); } /// /// Calculates the length of the geometry as though each segment were unrolled into a line. /// /// When this method returns, contains a reference to the length of the geometry. For closed geometries, the length includes an implicit closing segment. You must allocate storage for this parameter. /// HRESULT ID2D1Geometry::ComputeLength([In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] float flatteningTolerance,[Out] float* length) public float ComputeLength() { return ComputeLength(null, FlatteningTolerance); } /// /// Calculates the length of the geometry as though each segment were unrolled into a line. /// /// The maximum bounds on the distance between points in the polygonal approximation of the geometry. Smaller values produce more accurate results but cause slower execution. /// When this method returns, contains a reference to the length of the geometry. For closed geometries, the length includes an implicit closing segment. You must allocate storage for this parameter. /// HRESULT ID2D1Geometry::ComputeLength([In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] float flatteningTolerance,[Out] float* length) public float ComputeLength(float flatteningTolerance) { return ComputeLength(null, flatteningTolerance); } /// /// Calculates the point and tangent vector at the specified distance along the geometry after it has been transformed by the specified matrix and flattened using the specified tolerance. /// /// The distance along the geometry of the point and tangent to find. If this distance is less then 0, this method calculates the first point in the geometry. If this distance is greater than the length of the geometry, this method calculates the last point in the geometry. /// When this method returns, contains a reference to the tangent vector at the specified distance along the geometry. If the geometry is empty, this vector contains NaN as its x and y values. You must allocate storage for this parameter. /// The location at the specified distance along the geometry. If the geometry is empty, this point contains NaN as its x and y values. /// HRESULT ID2D1Geometry::ComputePointAtLength([None] float length,[In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] float flatteningTolerance,[Out, Optional] D2D1_POINT_2F* point,[Out, Optional] D2D1_POINT_2F* unitTangentVector) public RawVector2 ComputePointAtLength(float length, out RawVector2 unitTangentVector) { return ComputePointAtLength(length, null, FlatteningTolerance, out unitTangentVector); } /// /// Calculates the point and tangent vector at the specified distance along the geometry after it has been transformed by the specified matrix and flattened using the specified tolerance. /// /// The distance along the geometry of the point and tangent to find. If this distance is less then 0, this method calculates the first point in the geometry. If this distance is greater than the length of the geometry, this method calculates the last point in the geometry. /// The maximum bounds on the distance between points in the polygonal approximation of the geometry. Smaller values produce more accurate results but cause slower execution. /// When this method returns, contains a reference to the tangent vector at the specified distance along the geometry. If the geometry is empty, this vector contains NaN as its x and y values. You must allocate storage for this parameter. /// The location at the specified distance along the geometry. If the geometry is empty, this point contains NaN as its x and y values. /// HRESULT ID2D1Geometry::ComputePointAtLength([None] float length,[In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] float flatteningTolerance,[Out, Optional] D2D1_POINT_2F* point,[Out, Optional] D2D1_POINT_2F* unitTangentVector) public RawVector2 ComputePointAtLength(float length, float flatteningTolerance, out RawVector2 unitTangentVector) { return ComputePointAtLength(length, null, flatteningTolerance, out unitTangentVector); } /// /// Indicates whether the area filled by the geometry would contain the specified point given the specified flattening tolerance. /// /// The point to test. /// When this method returns, contains a bool value that is true if the area filled by the geometry contains point; otherwise, false.You must allocate storage for this parameter. /// HRESULT ID2D1Geometry::FillContainsPoint([None] D2D1_POINT_2F point,[In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] float flatteningTolerance,[Out] BOOL* contains) public bool FillContainsPoint(RawPoint point) { return FillContainsPoint(new RawVector2() { X = point.X, Y = point.Y }, null, FlatteningTolerance); } /// /// Indicates whether the area filled by the geometry would contain the specified point given the specified flattening tolerance. /// /// The point to test. /// When this method returns, contains a bool value that is true if the area filled by the geometry contains point; otherwise, false.You must allocate storage for this parameter. /// HRESULT ID2D1Geometry::FillContainsPoint([None] D2D1_POINT_2F point,[In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] float flatteningTolerance,[Out] BOOL* contains) public bool FillContainsPoint(RawVector2 point) { return FillContainsPoint(point, null, FlatteningTolerance); } /// /// Indicates whether the area filled by the geometry would contain the specified point given the specified flattening tolerance. /// /// The point to test. /// The numeric accuracy with which the precise geometric path and path intersection is calculated. Points missing the fill by less than the tolerance are still considered inside. Smaller values produce more accurate results but cause slower execution. /// When this method returns, contains a bool value that is true if the area filled by the geometry contains point; otherwise, false.You must allocate storage for this parameter. /// HRESULT ID2D1Geometry::FillContainsPoint([None] D2D1_POINT_2F point,[In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] float flatteningTolerance,[Out] BOOL* contains) public bool FillContainsPoint(RawPoint point, float flatteningTolerance) { return FillContainsPoint(new RawVector2 { X = point.X, Y = point.Y}, null, flatteningTolerance); } /// /// Indicates whether the area filled by the geometry would contain the specified point given the specified flattening tolerance. /// /// The point to test. /// The numeric accuracy with which the precise geometric path and path intersection is calculated. Points missing the fill by less than the tolerance are still considered inside. Smaller values produce more accurate results but cause slower execution. /// When this method returns, contains a bool value that is true if the area filled by the geometry contains point; otherwise, false.You must allocate storage for this parameter. /// HRESULT ID2D1Geometry::FillContainsPoint([None] D2D1_POINT_2F point,[In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] float flatteningTolerance,[Out] BOOL* contains) public bool FillContainsPoint(RawVector2 point, float flatteningTolerance) { return FillContainsPoint(point, null, flatteningTolerance); } /// /// Indicates whether the area filled by the geometry would contain the specified point given the specified flattening tolerance. /// /// The point to test. /// The transform to apply to the geometry prior to testing for containment, or NULL. /// The numeric accuracy with which the precise geometric path and path intersection is calculated. Points missing the fill by less than the tolerance are still considered inside. Smaller values produce more accurate results but cause slower execution. /// When this method returns, contains a bool value that is true if the area filled by the geometry contains point; otherwise, false.You must allocate storage for this parameter. /// HRESULT ID2D1Geometry::FillContainsPoint([None] D2D1_POINT_2F point,[In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] float flatteningTolerance,[Out] BOOL* contains) public bool FillContainsPoint(RawPoint point, RawMatrix3x2 worldTransform, float flatteningTolerance) { return FillContainsPoint(new RawVector2 {X = point.X, Y = point.Y}, worldTransform, flatteningTolerance); } /// /// Retrieves the bounds of the geometry. /// /// When this method returns, contains the bounds of this geometry. If the bounds are empty, this will be a rect where bounds.left > bounds.right. You must allocate storage for this parameter. /// HRESULT ID2D1Geometry::GetBounds([In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[Out] D2D1_RECT_F* bounds) public RawRectangleF GetBounds() { return GetBounds(null); } /// /// Gets the bounds of the geometry after it has been widened by the specified stroke width and style and transformed by the specified matrix. /// /// The amount by which to widen the geometry by stroking its outline. /// When this method returns, contains the bounds of the widened geometry. You must allocate storage for this parameter. /// HRESULT ID2D1Geometry::GetWidenedBounds([None] float strokeWidth,[In, Optional] ID2D1StrokeStyle* strokeStyle,[In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] float flatteningTolerance,[Out] D2D1_RECT_F* bounds) public RawRectangleF GetWidenedBounds(float strokeWidth) { return GetWidenedBounds(strokeWidth, null, null, FlatteningTolerance); } /// /// Gets the bounds of the geometry after it has been widened by the specified stroke width and style and transformed by the specified matrix. /// /// The amount by which to widen the geometry by stroking its outline. /// The maximum bounds on the distance between points in the polygonal approximation of the geometry. Smaller values produce more accurate results but cause slower execution. /// When this method returns, contains the bounds of the widened geometry. You must allocate storage for this parameter. /// HRESULT ID2D1Geometry::GetWidenedBounds([None] float strokeWidth,[In, Optional] ID2D1StrokeStyle* strokeStyle,[In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] float flatteningTolerance,[Out] D2D1_RECT_F* bounds) public RawRectangleF GetWidenedBounds(float strokeWidth, float flatteningTolerance) { return GetWidenedBounds(strokeWidth, null, null, flatteningTolerance); } /// /// Gets the bounds of the geometry after it has been widened by the specified stroke width and style and transformed by the specified matrix. /// /// The amount by which to widen the geometry by stroking its outline. /// The style of the stroke that widens the geometry. /// The maximum bounds on the distance between points in the polygonal approximation of the geometry. Smaller values produce more accurate results but cause slower execution. /// When this method returns, contains the bounds of the widened geometry. You must allocate storage for this parameter. /// HRESULT ID2D1Geometry::GetWidenedBounds([None] float strokeWidth,[In, Optional] ID2D1StrokeStyle* strokeStyle,[In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] float flatteningTolerance,[Out] D2D1_RECT_F* bounds) public RawRectangleF GetWidenedBounds(float strokeWidth, StrokeStyle strokeStyle, float flatteningTolerance) { return GetWidenedBounds(strokeWidth, strokeStyle, null, flatteningTolerance); } /// /// Computes the outline of the geometry and writes the result to an . /// /// /// The {{Outline}} method allows the caller to produce a geometry with an equivalent fill to the input geometry, with the following additional properties: The output geometry contains no transverse intersections; that is, segments may touch, but they never cross.The outermost figures in the output geometry are all oriented counterclockwise. The output geometry is fill-mode invariant; that is, the fill of the geometry does not depend on the choice of the fill mode. For more information about the fill mode, see .Additionally, the {{Outline}} method can be useful in removing redundant portions of said geometries to simplify complex geometries. It can also be useful in combination with to create unions among several geometries simultaneously. /// /// The to which the geometry's transformed outline is appended. /// If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. /// HRESULT Outline([In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] FLOAT flatteningTolerance,[In] ID2D1SimplifiedGeometrySink* geometrySink) public void Outline(GeometrySink geometrySink) { this.Outline(null, FlatteningTolerance, geometrySink); } /// /// Computes the outline of the geometry and writes the result to an . /// /// /// The {{Outline}} method allows the caller to produce a geometry with an equivalent fill to the input geometry, with the following additional properties: The output geometry contains no transverse intersections; that is, segments may touch, but they never cross.The outermost figures in the output geometry are all oriented counterclockwise. The output geometry is fill-mode invariant; that is, the fill of the geometry does not depend on the choice of the fill mode. For more information about the fill mode, see .Additionally, the {{Outline}} method can be useful in removing redundant portions of said geometries to simplify complex geometries. It can also be useful in combination with to create unions among several geometries simultaneously. /// /// The maximum bounds on the distance between points in the polygonal approximation of the geometry. Smaller values produce more accurate results but cause slower execution. /// The to which the geometry's transformed outline is appended. /// If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. /// HRESULT Outline([In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] FLOAT flatteningTolerance,[In] ID2D1SimplifiedGeometrySink* geometrySink) public void Outline(float flatteningTolerance, GeometrySink geometrySink) { this.Outline(null, flatteningTolerance, geometrySink); } /// /// Creates a simplified version of the geometry that contains only lines and (optionally) cubic Bezier curves and writes the result to an . /// /// A value that specifies whether the simplified geometry should contain curves. /// The to which the simplified geometry is appended. /// If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. /// HRESULT Simplify([None] D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption,[In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] FLOAT flatteningTolerance,[In] ID2D1SimplifiedGeometrySink* geometrySink) public void Simplify(SharpDX.Direct2D1.GeometrySimplificationOption simplificationOption, SimplifiedGeometrySink geometrySink) { Simplify(simplificationOption, null, FlatteningTolerance, geometrySink); } /// /// Creates a simplified version of the geometry that contains only lines and (optionally) cubic Bezier curves and writes the result to an . /// /// A value that specifies whether the simplified geometry should contain curves. /// The maximum bounds on the distance between points in the polygonal approximation of the geometry. Smaller values produce more accurate results but cause slower execution. /// The to which the simplified geometry is appended. /// If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. /// HRESULT Simplify([None] D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption,[In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] FLOAT flatteningTolerance,[In] ID2D1SimplifiedGeometrySink* geometrySink) public void Simplify(SharpDX.Direct2D1.GeometrySimplificationOption simplificationOption, float flatteningTolerance, SimplifiedGeometrySink geometrySink) { Simplify(simplificationOption, null, flatteningTolerance, geometrySink); } /// /// Determines whether the geometry's stroke contains the specified point given the specified stroke thickness, style, and transform. /// /// The point to test for containment. /// The thickness of the stroke to apply. /// When this method returns, contains a boolean value set to true if the geometry's stroke contains the specified point; otherwise, false. You must allocate storage for this parameter. /// HRESULT ID2D1Geometry::StrokeContainsPoint([None] D2D1_POINT_2F point,[None] float strokeWidth,[In, Optional] ID2D1StrokeStyle* strokeStyle,[In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] float flatteningTolerance,[Out] BOOL* contains) public bool StrokeContainsPoint(RawPoint point, float strokeWidth) { return StrokeContainsPoint(point, strokeWidth, null); } /// /// Determines whether the geometry's stroke contains the specified point given the specified stroke thickness, style, and transform. /// /// The point to test for containment. /// The thickness of the stroke to apply. /// When this method returns, contains a boolean value set to true if the geometry's stroke contains the specified point; otherwise, false. You must allocate storage for this parameter. /// HRESULT ID2D1Geometry::StrokeContainsPoint([None] D2D1_POINT_2F point,[None] float strokeWidth,[In, Optional] ID2D1StrokeStyle* strokeStyle,[In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] float flatteningTolerance,[Out] BOOL* contains) public bool StrokeContainsPoint(RawVector2 point, float strokeWidth) { return StrokeContainsPoint(point, strokeWidth, null); } /// /// Determines whether the geometry's stroke contains the specified point given the specified stroke thickness, style, and transform. /// /// The point to test for containment. /// The thickness of the stroke to apply. /// The style of stroke to apply. /// When this method returns, contains a boolean value set to true if the geometry's stroke contains the specified point; otherwise, false. You must allocate storage for this parameter. /// HRESULT ID2D1Geometry::StrokeContainsPoint([None] D2D1_POINT_2F point,[None] float strokeWidth,[In, Optional] ID2D1StrokeStyle* strokeStyle,[In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] float flatteningTolerance,[Out] BOOL* contains) public bool StrokeContainsPoint(RawPoint point, float strokeWidth, StrokeStyle strokeStyle) { return StrokeContainsPoint(new RawVector2 { X = point.X, Y = point.Y }, strokeWidth, strokeStyle); } /// /// Determines whether the geometry's stroke contains the specified point given the specified stroke thickness, style, and transform. /// /// The point to test for containment. /// The thickness of the stroke to apply. /// The style of stroke to apply. /// When this method returns, contains a boolean value set to true if the geometry's stroke contains the specified point; otherwise, false. You must allocate storage for this parameter. /// HRESULT ID2D1Geometry::StrokeContainsPoint([None] D2D1_POINT_2F point,[None] float strokeWidth,[In, Optional] ID2D1StrokeStyle* strokeStyle,[In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] float flatteningTolerance,[Out] BOOL* contains) public bool StrokeContainsPoint(RawVector2 point, float strokeWidth, StrokeStyle strokeStyle) { return StrokeContainsPoint(point, strokeWidth, strokeStyle, null, FlatteningTolerance); } /// /// Determines whether the geometry's stroke contains the specified point given the specified stroke thickness, style, and transform. /// /// The point to test for containment. /// The thickness of the stroke to apply. /// The style of stroke to apply. /// The transform to apply to the stroked geometry. /// When this method returns, contains a boolean value set to true if the geometry's stroke contains the specified point; otherwise, false. You must allocate storage for this parameter. /// HRESULT ID2D1Geometry::StrokeContainsPoint([None] D2D1_POINT_2F point,[None] float strokeWidth,[In, Optional] ID2D1StrokeStyle* strokeStyle,[In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] float flatteningTolerance,[Out] BOOL* contains) public bool StrokeContainsPoint(RawPoint point, float strokeWidth, StrokeStyle strokeStyle, RawMatrix3x2 transform) { return StrokeContainsPoint(point, strokeWidth, strokeStyle, transform, FlatteningTolerance); } /// /// Determines whether the geometry's stroke contains the specified point given the specified stroke thickness, style, and transform. /// /// The point to test for containment. /// The thickness of the stroke to apply. /// The style of stroke to apply. /// The transform to apply to the stroked geometry. /// When this method returns, contains a boolean value set to true if the geometry's stroke contains the specified point; otherwise, false. You must allocate storage for this parameter. /// HRESULT ID2D1Geometry::StrokeContainsPoint([None] D2D1_POINT_2F point,[None] float strokeWidth,[In, Optional] ID2D1StrokeStyle* strokeStyle,[In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] float flatteningTolerance,[Out] BOOL* contains) public bool StrokeContainsPoint(RawVector2 point, float strokeWidth, StrokeStyle strokeStyle, RawMatrix3x2 transform) { return StrokeContainsPoint(point, strokeWidth, strokeStyle, transform, FlatteningTolerance); } /// /// Determines whether the geometry's stroke contains the specified point given the specified stroke thickness, style, and transform. /// /// The point to test for containment. /// The thickness of the stroke to apply. /// The style of stroke to apply. /// The transform to apply to the stroked geometry. /// The numeric accuracy with which the precise geometric path and path intersection is calculated. Points missing the stroke by less than the tolerance are still considered inside. Smaller values produce more accurate results but cause slower execution. /// When this method returns, contains a boolean value set to true if the geometry's stroke contains the specified point; otherwise, false. You must allocate storage for this parameter. /// HRESULT ID2D1Geometry::StrokeContainsPoint([None] D2D1_POINT_2F point,[None] float strokeWidth,[In, Optional] ID2D1StrokeStyle* strokeStyle,[In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] float flatteningTolerance,[Out] BOOL* contains) public bool StrokeContainsPoint(RawPoint point, float strokeWidth, StrokeStyle strokeStyle, RawMatrix3x2 transform, float flatteningTolerance) { return StrokeContainsPoint(new RawVector2 { X = point.X, Y = point.Y}, strokeWidth, strokeStyle, transform, flatteningTolerance); } /// /// Creates a set of clockwise-wound triangles that cover the geometry after it has been transformed using the specified matrix and flattened using the specified tolerance /// /// The to which the tessellated is appended. /// If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. /// HRESULT Tessellate([In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] FLOAT flatteningTolerance,[In] ID2D1TessellationSink* tessellationSink) public void Tessellate(TessellationSink tessellationSink) { this.Tessellate(null, FlatteningTolerance, tessellationSink); } /// /// Creates a set of clockwise-wound triangles that cover the geometry after it has been transformed using the specified matrix and flattened using the specified tolerance /// /// The maximum bounds on the distance between points in the polygonal approximation of the geometry. Smaller values produce more accurate results but cause slower execution. /// The to which the tessellated is appended. /// If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. /// HRESULT Tessellate([In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] FLOAT flatteningTolerance,[In] ID2D1TessellationSink* tessellationSink) public void Tessellate(float flatteningTolerance, TessellationSink tessellationSink) { Tessellate(null, flatteningTolerance, tessellationSink); } /// /// Widens the geometry by the specified stroke and writes the result to an after it has been transformed by the specified matrix and flattened using the specified tolerance. /// /// The amount by which to widen the geometry. /// The to which the widened geometry is appended. /// If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. /// HRESULT Widen([None] FLOAT strokeWidth,[In, Optional] ID2D1StrokeStyle* strokeStyle,[In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] FLOAT flatteningTolerance,[In] ID2D1SimplifiedGeometrySink* geometrySink) public void Widen(float strokeWidth, GeometrySink geometrySink) { this.Widen(strokeWidth, null, null, FlatteningTolerance, geometrySink); } /// /// Widens the geometry by the specified stroke and writes the result to an after it has been transformed by the specified matrix and flattened using the specified tolerance. /// /// The amount by which to widen the geometry. /// The maximum bounds on the distance between points in the polygonal approximation of the geometry. Smaller values produce more accurate results but cause slower execution. /// The to which the widened geometry is appended. /// If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. /// HRESULT Widen([None] FLOAT strokeWidth,[In, Optional] ID2D1StrokeStyle* strokeStyle,[In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] FLOAT flatteningTolerance,[In] ID2D1SimplifiedGeometrySink* geometrySink) public void Widen(float strokeWidth, float flatteningTolerance, GeometrySink geometrySink) { this.Widen(strokeWidth, null, null, flatteningTolerance, geometrySink); } /// /// Widens the geometry by the specified stroke and writes the result to an after it has been transformed by the specified matrix and flattened using the specified tolerance. /// /// The amount by which to widen the geometry. /// The style of stroke to apply to the geometry, or NULL. /// The maximum bounds on the distance between points in the polygonal approximation of the geometry. Smaller values produce more accurate results but cause slower execution. /// The to which the widened geometry is appended. /// If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. /// HRESULT Widen([None] FLOAT strokeWidth,[In, Optional] ID2D1StrokeStyle* strokeStyle,[In, Optional] const D2D1_MATRIX_3X2_F* worldTransform,[None] FLOAT flatteningTolerance,[In] ID2D1SimplifiedGeometrySink* geometrySink) public void Widen(float strokeWidth, SharpDX.Direct2D1.StrokeStyle strokeStyle, float flatteningTolerance, GeometrySink geometrySink) { this.Widen(strokeWidth, strokeStyle, null, flatteningTolerance, geometrySink); } } }