Search Results for

    Show / Hide Table of Contents

    Class HotPixel

    Implements a "hot pixel" as used in the Snap Rounding algorithm. A hot pixel is a square region centred on the rounded valud of the coordinate given, and of width equal to the size of the scale factor. It is a partially open region, which contains the interior of the tolerance square and the boundary minus the top and right segments. This ensures that every point of the space lies in a unique hot pixel. It also matches the rounding semantics for numbers.

    The hot pixel operations are all computed in the integer domain to avoid rounding problems.

    Hot Pixels support being marked as nodes. This is used to prevent introducing nodes at line vertices which do not have other lines snapped to them.
    Inheritance
    object
    HotPixel
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: NetTopologySuite.Noding.Snapround
    Assembly: NetTopologySuite.dll
    Syntax
    public class HotPixel

    Constructors

    | Edit this page View Source

    HotPixel(Coordinate, double)

    Creates a new hot pixel centered on a rounded point, using a given scale factor. The scale factor must be strictly positive(non-zero).

    Declaration
    public HotPixel(Coordinate pt, double scaleFactor)
    Parameters
    Type Name Description
    Coordinate pt

    The coordinate at the center of the hot pixel (already rounded)

    double scaleFactor

    The scale factor determining the pixel size

    | Edit this page View Source

    HotPixel(Coordinate, double, LineIntersector)

    Initializes a new instance of the HotPixel class.

    Declaration
    [Obsolete("LineIntersector is no longer used.")]
    public HotPixel(Coordinate pt, double scaleFactor, LineIntersector li)
    Parameters
    Type Name Description
    Coordinate pt

    The coordinate at the center of the hot pixel

    double scaleFactor

    The scale factor determining the pixel size

    LineIntersector li

    The intersector to use for testing intersection with line segments

    Properties

    | Edit this page View Source

    Coordinate

    Gets the coordinate this hot pixel is based at.

    Declaration
    public Coordinate Coordinate { get; }
    Property Value
    Type Description
    Coordinate
    | Edit this page View Source

    IsNode

    Gets or sets a value indicating whether this pixel has been marked as a node.

    Declaration
    public bool IsNode { get; set; }
    Property Value
    Type Description
    bool

    true if the pixel is marked as a node

    | Edit this page View Source

    ScaleFactor

    Gets the scale factor for the precision grid for this pixel.

    Declaration
    public double ScaleFactor { get; }
    Property Value
    Type Description
    double
    | Edit this page View Source

    Width

    Gets the width of the hot pixel in the original coordinate system.

    Declaration
    public double Width { get; }
    Property Value
    Type Description
    double

    Methods

    | Edit this page View Source

    AddSnappedNode(INodableSegmentString, int)

    Adds a new node (equal to the snap pt) to the specified segment if the segment passes through the hot pixel

    Declaration
    [Obsolete("Moved to MCIndexPointSnapper")]
    public bool AddSnappedNode(INodableSegmentString segStr, int segIndex)
    Parameters
    Type Name Description
    INodableSegmentString segStr
    int segIndex
    Returns
    Type Description
    bool

    true if a node was added to the segment

    | Edit this page View Source

    GetSafeEnvelope()

    Returns a "safe" envelope that is guaranteed to contain the hot pixel. The envelope returned will be larger than the exact envelope of the pixel.

    Declaration
    [Obsolete("Moved to MCIndexPointSnapper")]
    public Envelope GetSafeEnvelope()
    Returns
    Type Description
    Envelope

    An envelope which contains the pixel

    | Edit this page View Source

    Intersects(Coordinate)

    Tests whether a coordinate lies in (intersects) this hot pixel.

    Declaration
    public bool Intersects(Coordinate p)
    Parameters
    Type Name Description
    Coordinate p

    The coordinate to test

    Returns
    Type Description
    bool

    true if the coordinate intersects this hot pixel

    | Edit this page View Source

    Intersects(Coordinate, Coordinate)

    Tests whether the line segment (p0-p1) intersects this hot pixel.

    Declaration
    public bool Intersects(Coordinate p0, Coordinate p1)
    Parameters
    Type Name Description
    Coordinate p0

    The first coordinate of the line segment to test

    Coordinate p1

    The second coordinate of the line segment to test

    Returns
    Type Description
    bool

    true if the line segment intersects this hot pixel.

    | Edit this page View Source

    IntersectsScaled(Coordinate, Coordinate)

    Declaration
    [Obsolete("This method was never intended to be public and will be removed in a future release.")]
    public bool IntersectsScaled(Coordinate p0, Coordinate p1)
    Parameters
    Type Name Description
    Coordinate p0
    Coordinate p1
    Returns
    Type Description
    bool
    | Edit this page View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX