Package geomss.geom

Class SubrangePoint

    • Method Detail

      • newInstance

        public static SubrangePoint newInstance​(Curve child,
                                                double s)
        Returns a SubrangePoint instance referring to the specified Curve and parametric location.
        Parameters:
        child - The Curve object that this point is subranged onto (may not be null).
        s - The parametric s-position (between 0 and 1) along curve where the point is located (may not be null).
        Returns:
        the subrange point having the specified values.
      • newInstance

        public static SubrangePoint newInstance​(Surface child,
                                                double s,
                                                double t)
        Returns a SubrangePoint instance referring to the specified Surface and parametric location.
        Parameters:
        child - The Surface object that this point is subranged onto (may not be null).
        s - The parametric s-position (between 0 and 1) along surface where the point is located.
        t - The parametric t-position (between 0 and 1) along surface where the point is located.
        Returns:
        the subrange point having the specified values.
      • newInstance

        public static SubrangePoint newInstance​(ParametricGeometry child,
                                                GeomPoint par)
        Returns a SubrangePoint instance referring to the specified ParametricGeometry and parametric location.
        Parameters:
        child - The ParametricGeometry object that this point is subranged onto (may not be null).
        par - The parametric position (between 0 and 1) along each parametric dimension where the point is located (may not be null).
        Returns:
        the subrange point having the specified values.
        Throws:
        DimensionException - if the input child object's parametric dimension is not compatible with the input parametric distance point.
      • getParPosition

        public GeomPoint getParPosition()
        Returns the parametric position on the child object that this point refers to.
        Specified by:
        getParPosition in interface Subrange<GeomPoint>
        Returns:
        The parametric position on the child object that this subrange refers to.
      • setParPosition

        public void setParPosition​(GeomPoint par)
        Sets the parametric position on the child object that this point refers to.
        Specified by:
        setParPosition in interface Subrange<GeomPoint>
        Parameters:
        par - The parametric position (between 0 and 1) along each parametric dimension where the point is located (may not be null).
      • copyToReal

        public Point copyToReal()
        Return a copy of the child object transformed into a concrete GeomPoint object (information on the parametric position on the child parametric geometry is removed).
        Specified by:
        copyToReal in interface GeomElement<GeomPoint>
        Specified by:
        copyToReal in class GeomPoint
        Returns:
        A copy of this object with the subrange removed (applied).
      • recycle

        public static void recycle​(SubrangePoint instance)
        Recycles a SubrangePoint instance immediately (on the stack when executing in a StackContext).
        Parameters:
        instance - The instance to be recycled.
      • immutable

        public Point immutable()
        Return an immutable version of this point.
        Specified by:
        immutable in class GeomPoint
        Returns:
        An immutable version of this point.
      • getPhyDimension

        public int getPhyDimension()
        Returns the number of physical dimensions of the geometry element.
        Specified by:
        getPhyDimension in interface GeomElement<GeomPoint>
        Returns:
        The number of physical dimensions of the geometry element.
      • getValue

        public double getValue​(int i)
        Returns the value of a coordinate in this point as a double, stated in this point's unit.
        Specified by:
        getValue in class GeomPoint
        Parameters:
        i - the dimension index.
        Returns:
        the value of the Parameter at i.
        Throws:
        java.lang.IndexOutOfBoundsException - (i < 0) || (i ≥ getPhyDimension())
      • getValue

        public double getValue​(int i,
                               javax.measure.unit.Unit<javax.measure.quantity.Length> unit)
        Returns the value of a coordinate in this point as a double, stated in the specified unit.
        Specified by:
        getValue in class GeomPoint
        Parameters:
        i - the dimension index.
        unit - the unit to return the value in. May not be null.
        Returns:
        the value of the Parameter at i in the specified unit.
        Throws:
        java.lang.IndexOutOfBoundsException - (i < 0) || (i ≥ getPhyDimension())
      • normSqValue

        public double normSqValue()
        Returns the square of the Euclidean norm, magnitude, or length value of the vector from the origin to this point (the dot product of the origin-to-this-point vector and itself). This is slightly faster than calling normValue if the squared value is all that is needed.
        Specified by:
        normSqValue in class GeomPoint
        Returns:
        this.normSq().getValue().
        See Also:
        GeomPoint.normValue()
      • plus

        public Point plus​(GeomPoint that)
        Returns the sum of this point with the one specified. The unit of the output point will be the units of this point.
        Specified by:
        plus in class GeomPoint
        Parameters:
        that - the point to be added. May not be null.
        Returns:
        this + that.
        Throws:
        DimensionException - if point dimensions are different.
      • plus

        public Point plus​(Parameter<javax.measure.quantity.Length> that)
        Adds the specified parameter to each component of this point. The unit of the output point will be the units of this point.
        Specified by:
        plus in class GeomPoint
        Parameters:
        that - the parameter to be added to each component of this point. May not be null.
        Returns:
        this + that.
      • minus

        public Point minus​(GeomPoint that)
        Returns the difference between this point and the one specified. The unit of the output point will be the units of this point.
        Specified by:
        minus in class GeomPoint
        Parameters:
        that - the point to be subtracted from this point. May not be null.
        Returns:
        this - that.
        Throws:
        DimensionException - if point dimensions are different.
      • minus

        public Point minus​(Parameter<javax.measure.quantity.Length> that)
        Subtracts the specified parameter from each component of this point. The unit of the output point will be the units of this point.
        Specified by:
        minus in class GeomPoint
        Parameters:
        that - the parameter to be subtracted from each component of this point. May not be null.
        Returns:
        this - that.
      • opposite

        public Point opposite()
        Returns the negation of this point (all the values of each dimension negated).
        Specified by:
        opposite in class GeomPoint
        Returns:
        -this
      • times

        public Point times​(double k)
        Returns the product of this point with the specified coefficient.
        Specified by:
        times in class GeomPoint
        Parameters:
        k - the coefficient multiplier.
        Returns:
        this ยท k
      • isValid

        public boolean isValid()
        Return true if this point contains valid and finite numerical components. A value of false will be returned if any of the coordinate values are NaN or Inf.
        Specified by:
        isValid in interface GeomElement<GeomPoint>
        Overrides:
        isValid in class GeomPoint
        Returns:
        true if this point contains valid and finite numerical components.
      • copy

        public SubrangePoint copy()
        Returns a copy of this SubrangePoint instance allocated by the calling thread (possibly on the stack).
        Specified by:
        copy in interface GeomElement<GeomPoint>
        Specified by:
        copy in class GeomPoint
        Returns:
        an identical and independent copy of this point.
      • getUnit

        public javax.measure.unit.Unit<javax.measure.quantity.Length> getUnit()
        Returns the unit in which the values in this point are stated in.
        Specified by:
        getUnit in interface GeomElement<GeomPoint>
        Returns:
        The unit in which the coordinate values in this point are stated in.
      • to

        public GeomPoint to​(javax.measure.unit.Unit<javax.measure.quantity.Length> unit)
                     throws javax.measure.converter.ConversionException
        Returns the equivalent to this point but stated in the specified unit.
        Specified by:
        to in interface GeomElement<GeomPoint>
        Specified by:
        to in interface PointGeometry<GeomPoint>
        Parameters:
        unit - the length unit of the point to be returned. May not be null.
        Returns:
        an equivalent to this point but stated in the specified unit.
        Throws:
        javax.measure.converter.ConversionException - if the the input unit is not a length unit.
      • toVector3D

        public Vector3D<javax.measure.quantity.Length> toVector3D()
        Returns a Vector3D representation of this transformed point if possible.
        Overrides:
        toVector3D in class GeomPoint
        Returns:
        A Vector3D that is equivalent to this transformed point
        Throws:
        DimensionException - if this point has any number of dimensions other than 3.
      • toFloat64Vector

        public Float64Vector toFloat64Vector()
        Returns the values stored in this transformed point, stated in this point's unit, as a Float64Vector.
        Specified by:
        toFloat64Vector in class GeomPoint
        Returns:
        A Float64Vector containing the coordinate values in this point.
      • toDimension

        public GeomPoint toDimension​(int newDim)
        Return the equivalent of this point converted to the specified number of physical dimensions. If the number of dimensions is greater than this element, then zeros are added to the additional dimensions. If the number of dimensions is less than this element, then the extra dimensions are simply dropped (truncated). If the new dimensions are the same as the dimension of this element, then this element is simply returned. NOTE: The returned point is no longer a SubrangePoint.
        Specified by:
        toDimension in interface GeomElement<GeomPoint>
        Parameters:
        newDim - The dimension of the point to return.
        Returns:
        The equivalent of this point converted to the new dimensions.
      • equals

        public boolean equals​(java.lang.Object obj)
        Compares this SubrangePoint against the specified object for strict equality (same values and same units).
        Overrides:
        equals in class AbstractGeomElement<GeomPoint>
        Parameters:
        obj - the object to compare with.
        Returns:
        true if this point is identical to that point; false otherwise.