Class Vertex

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected byte auxiliary
      The auxiliary index used for graph coloring algorithms and other applications.
      static int BIT_CONSTRAINT
      A bit flag indicating that the vertex is a member of a constraint edge.
      static int BIT_REFINEMENT
      A bit flag indication that the vertex was created by a Delaunay refinement algorithm or other technique used to improve the quality of the triangular mesh.
      static int BIT_SYNTHETIC
      A bit flag indicating that the vertex is synthetic and was created through some form of mesh processing rather than being supplied as a data sample.
      static int BIT_WITHHELD
      A bit flag indicating that the vertex is to be treated as "withheld" and should not be processed as part of a Delaunay triangulation (TIN).
      protected byte reserved0
      An unused field reserved for use by applications and derived classes
      protected byte reserved1
      An unused field reserved for use by applications and derived classes
      protected byte status
      The bit-mapped status flags for the vertex.
      double x
      The Cartesian coordinate of the vertex (immutable).
      double y
      The Cartesian coordinate of the vertex (immutable).
    • Constructor Summary

      Constructors 
      Constructor Description
      Vertex​(double x, double y, double z)
      Construct a vertex with the specified coordinates and z value.
      Vertex​(double x, double y, double z, int index)
      Construct a vertex with the specified coordinates and ID value.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getAuxiliaryIndex()
      Gets the auxiliary index for the vertex.
      double getDistance​(double x, double y)
      Gets the distance from the vertex to an arbitrary point.
      double getDistance​(Vertex v)
      Get the distance to the vertex.
      double getDistanceSq​(double x, double y)
      Gets the square of the distance from the vertex to an arbitrary point.
      double getDistanceSq​(Vertex v)
      Get the square of the distance to the vertex.
      int getIndex()
      Gets the arbitrary index associated with the vertex.
      String getLabel()
      Gets a string intended for labeling the vertex in images or reports.
      int getStatus()
      Gets the current value of the status flags for this vertex.
      double getX()
      Get the x coordinate associated with the vertex.
      double getY()
      Get the y coordinate associated with the vertex.
      double getZ()
      Get the z value associated with the vertex.
      boolean isConstraintMember()
      Indicates whether a vertex is part of a constraint definition or lies on the border of an area constraint.
      boolean isNull()
      Indicates whether the vertex has been marked as having a null data value.
      boolean isRefinementProduct()
      Indicates whether a vertex is a refinement product (was created through a Delaunay refinement procedure rather than supplied by an application).
      boolean isSynthetic()
      Indicates whether a vertex is synthetic (was created through a Tinfour procedure rather than supplied by an application).
      boolean isWithheld()
      Indicates whether a vertex is marked as withheld.
      void setAuxiliaryIndex​(int auxiliaryIndex)
      Sets the auxiliary index for the vertex.
      void setConstraintMember​(boolean constraintMember)
      Sets or clears the is-constraint-member status of a vertex.
      void setIndex​(int index)
      Sets the arbitrary index associated with the vertex.
      void setRefinementProduct​(boolean refinement)
      Sets or clears the is-refinement-product status of a vertex.
      void setStatus​(int status)
      Sets the status value of the vertex.
      void setSynthetic​(boolean synthetic)
      Sets or clears the is-synthetic status of a vertex.
      void setWithheld​(boolean synthetic)
      Sets or clears the is-withheld status of a vertex.
      String toString()  
    • Field Detail

      • BIT_SYNTHETIC

        public static final int BIT_SYNTHETIC
        A bit flag indicating that the vertex is synthetic and was created through some form of mesh processing rather than being supplied as a data sample.
        See Also:
        Constant Field Values
      • BIT_CONSTRAINT

        public static final int BIT_CONSTRAINT
        A bit flag indicating that the vertex is a member of a constraint edge.
        See Also:
        Constant Field Values
      • BIT_WITHHELD

        public static final int BIT_WITHHELD
        A bit flag indicating that the vertex is to be treated as "withheld" and should not be processed as part of a Delaunay triangulation (TIN). This flag is used in support of data filtering and similar operations.
        See Also:
        Constant Field Values
      • BIT_REFINEMENT

        public static final int BIT_REFINEMENT
        A bit flag indication that the vertex was created by a Delaunay refinement algorithm or other technique used to improve the quality of the triangular mesh.
        See Also:
        Constant Field Values
      • x

        public final double x
        The Cartesian coordinate of the vertex (immutable).
      • y

        public final double y
        The Cartesian coordinate of the vertex (immutable).
      • status

        protected byte status
        The bit-mapped status flags for the vertex. The assignment of meaning to the bits for this field are defined by static members of this class.
      • reserved0

        protected byte reserved0
        An unused field reserved for use by applications and derived classes
      • reserved1

        protected byte reserved1
        An unused field reserved for use by applications and derived classes
      • auxiliary

        protected byte auxiliary
        The auxiliary index used for graph coloring algorithms and other applications.
    • Constructor Detail

      • Vertex

        public Vertex​(double x,
                      double y,
                      double z)
        Construct a vertex with the specified coordinates and z value. Intended for use with DataMode.Continuous. If the z value is Nan then the vertex will be treated as a "null data value"
        Parameters:
        x - the coordinate on the surface on which the vertex is defined
        y - the coordinate on the surface on which the vertex is defined
        z - the data value (z coordinate of the surface)
      • Vertex

        public Vertex​(double x,
                      double y,
                      double z,
                      int index)
        Construct a vertex with the specified coordinates and ID value. If the z value is NaN then the vertex will be treated as a "null data value".
        Parameters:
        x - the coordinate on the surface on which the vertex is defined
        y - the coordinate on the surface on which the vertex is defined
        z - the data value (z coordinate of the surface)
        index - the ID of the vertex (intended as a diagnostic)
    • Method Detail

      • getLabel

        public String getLabel()
        Gets a string intended for labeling the vertex in images or reports. The default label is the index of the vertex preceeded by the letter S if the vertex is synthetic. Note that the index of a vertex is not necessarily unique but left to the requirements of the application that constructs it.
        Returns:
        a valid, non-empty string.
      • getDistanceSq

        public double getDistanceSq​(Vertex v)
        Get the square of the distance to the vertex.
        Parameters:
        v - a valid vertex
        Returns:
        the square of the distance
      • getDistanceSq

        public double getDistanceSq​(double x,
                                    double y)
        Gets the square of the distance from the vertex to an arbitrary point.
        Specified by:
        getDistanceSq in interface ISamplePoint
        Parameters:
        x - coordinate of arbitrary point
        y - coordinate of arbitrary point
        Returns:
        a distance in units squared
      • getDistance

        public double getDistance​(double x,
                                  double y)
        Gets the distance from the vertex to an arbitrary point.
        Parameters:
        x - coordinate of arbitrary point
        y - coordinate of arbitrary point
        Returns:
        the distance in the applicable coordinate system
      • getDistance

        public double getDistance​(Vertex v)
        Get the distance to the vertex.
        Parameters:
        v - a valid vertex
        Returns:
        the distance to the vertex
      • getX

        public double getX()
        Get the x coordinate associated with the vertex. The x coordinate is immutable and established when the vertex is constructed. it is populated whether the vertex contains a null data value (Z value or I value).
        Specified by:
        getX in interface ISamplePoint
        Returns:
        a valid floating point value.
      • getY

        public double getY()
        Get the y coordinate associated with the vertex. The y coordinate is inmmutable and established when the vertex is constructed. it is populated whether the vertex contains a null data value (Z value or I value).
        Specified by:
        getY in interface ISamplePoint
        Returns:
        a valid floating point value.
      • getZ

        public double getZ()
        Get the z value associated with the vertex. If the vertex is null, the return value for this method is Double.NaN ("not a number").
        Specified by:
        getZ in interface ISamplePoint
        Returns:
        a floating point value or Double.NaN if z value is null.
      • isNull

        public boolean isNull()
        Indicates whether the vertex has been marked as having a null data value.
        Returns:
        true if vertex is marked as null; otherwise, false.
      • getIndex

        public int getIndex()
        Gets the arbitrary index associated with the vertex. Indexes allow vertices to be associated with an array of values and are also used internally for diagnostic purposes.

        This method permits public readonly access to the index.

        Returns:
        an integer value.
      • setIndex

        public void setIndex​(int index)
        Sets the arbitrary index associated with the vertex. Indexes allow vertices to be associated with an array of values and are also used internally for diagnostic purposes.
        Parameters:
        index - an integer value.
      • isSynthetic

        public boolean isSynthetic()
        Indicates whether a vertex is synthetic (was created through a Tinfour procedure rather than supplied by an application).
        Returns:
        true if vertex is synthetic; otherwise, false
      • setSynthetic

        public void setSynthetic​(boolean synthetic)
        Sets or clears the is-synthetic status of a vertex.
        Parameters:
        synthetic - true if vertex is synthetic; otherwise, false
      • setConstraintMember

        public void setConstraintMember​(boolean constraintMember)
        Sets or clears the is-constraint-member status of a vertex.
        Parameters:
        constraintMember - true if vertex is a part of a constraint definition or lies on the border of an area constraint; otherwise, false
      • isWithheld

        public boolean isWithheld()
        Indicates whether a vertex is marked as withheld. This setting is typically set by application code or other utilities rather than by Tinfour internal operations.
        Returns:
        true if vertex is withheld; otherwise, false
      • setWithheld

        public void setWithheld​(boolean synthetic)
        Sets or clears the is-withheld status of a vertex.
        Parameters:
        synthetic - true if vertex is withheld; otherwise, false
      • setStatus

        public void setStatus​(int status)
        Sets the status value of the vertex. This method is intended to provide an efficient way of setting multiple status flags at once.
        Parameters:
        status - a valid status value. Because the status is defined as a single byte, higher-order bytes will be ignored.
      • getStatus

        public int getStatus()
        Gets the current value of the status flags for this vertex.
        Returns:
        a positive integer in the range 0 to 255.
      • isConstraintMember

        public boolean isConstraintMember()
        Indicates whether a vertex is part of a constraint definition or lies on the border of an area constraint.
        Returns:
        true if vertex is a constraint member; otherwise, false
      • getAuxiliaryIndex

        public int getAuxiliaryIndex()
        Gets the auxiliary index for the vertex. The auxiliary index field is one byte in size and supports integer values in the range 0 to 255. It is used to support graph-coloring algorithms but is available for other uses as well.
        Returns:
        an integer value in the range 0 to 255
      • setAuxiliaryIndex

        public void setAuxiliaryIndex​(int auxiliaryIndex)
        Sets the auxiliary index for the vertex. The auxiliary index field is one byte in size and supports integer values in the range 0 to 255. It is used to support graph-coloring algorithms but is available for other uses as well.
        Parameters:
        auxiliaryIndex - a value in the range 0 to 255
      • isRefinementProduct

        public boolean isRefinementProduct()
        Indicates whether a vertex is a refinement product (was created through a Delaunay refinement procedure rather than supplied by an application).

        Note: When one of the Tinfour Incremental TIN classes performs a restore-Delaunay operation for added constraints, any artificially created vertices will be marked as "synthetic" but not as a "refinement product". The designation refinement product applies only in cases where a Delaunay refiner class creates vertices based on it own independent algorithms.

        Returns:
        true if vertex is a refinement product; otherwise, false
      • setRefinementProduct

        public void setRefinementProduct​(boolean refinement)
        Sets or clears the is-refinement-product status of a vertex.
        Parameters:
        refinement - true if vertex is synthetic; otherwise, false