Package geomss.geom

Class LoftedSurface

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int index, Curve value)
      Inserts the specified Curve at the specified position in this list.
      boolean add​(int index, Curve... array)
      Inserts all of the Curve objects in the specified list of arguments into this list at the specified position.
      boolean add​(Curve value)
      Appends the specified Curve to the end of this surface's list of curves.
      boolean add​(Curve... array)
      Appends all of the elements in the specified list of arguments to this geometry element list.
      boolean addAll​(int index, Curve[] arr)
      Inserts all of the Curve objects in the specified array into this list at the specified position.
      boolean addAll​(int index, java.util.Collection<? extends Curve> c)
      Inserts all of the curves in the specified collection into this surface at the specified position.
      boolean addAll​(Curve[] arr)
      Appends all of the curves in the specified array to this LoftedSurface.
      boolean addAll​(java.util.Collection<? extends Curve> c)
      Adds all of the curves in the specified collection to this surface.
      void clear()
      Removes all of the curves from this surface.
      boolean contains​(java.lang.Object o)
      Returns true if this collection contains the specified element.
      boolean containsAll​(java.util.Collection<?> c)
      Returns true if this collection contains all of the elements in the specified collection.
      boolean containsGeometry()
      Returns true if this list actually contains any curves and false if this list is empty.
      LoftedSurface copy()
      Returns a copy of this LoftedSurface instance allocated by the calling thread (possibly on the stack).
      LoftedSurface copyToReal()
      Return a copy of this object with any transformations or subranges removed (applied).
      boolean equals​(java.lang.Object obj)
      Compares the specified object with this list of Curve objects for equality.
      Curve get​(int index)
      Returns the Curve at the specified position in this surface's list of curves.
      Curve get​(java.lang.String name)
      Returns the Curve with the specified name from this list.
      GeomList<Curve> getAll()
      Returns an new GeomList with the elements in this list.
      Point getBoundsMax()
      Return the coordinate point representing the maximum bounding box corner (e.g.: max X, max Y, max Z).
      Point getBoundsMin()
      Return the coordinate point representing the minimum bounding box corner of this geometry element (e.g.: min X, min Y, min Z).
      Curve getFirst()
      Returns the first curve from this surface's list of curves.
      int getIndexFromName​(java.lang.String name)
      Return the index to the 1st Curve in this list with the specified name.
      Curve getLast()
      Returns the last curve from this surface's list of curves.
      int getPhyDimension()
      Returns the number of physical dimensions of the geometry element.
      LoftedSurface getRange​(int first, int last)
      Returns the range of Curves in this surface from the specified start and ending indexes as a new LoftedSurface.
      Point getRealPoint​(double s, double t)
      Calculate a point on the surface for the given parametric position on the surface.
      Curve getS0Curve()
      Return the S=0 Boundary for this surface as a curve.
      Curve getS1Curve()
      Return the S=1 Boundary for this surface as a curve.
      java.util.List<Vector<javax.measure.quantity.Length>> getSDerivatives​(double s, double t, int grade, boolean scaled)
      Calculate all the derivatives from 0 to grade with respect to parametric s-position on the surface for the given parametric position on the surface, d^{grade}p(s,t)/d^{grade}s.
      Curve getT0Curve()
      Return the T=0 Boundary for this surface as a curve.
      Curve getT1Curve()
      Return the T=1 Boundary for this surface as a curve.
      int getTDegree()
      Return the degree of the surface in the t-direction (across the defining curves).
      java.util.List<Vector<javax.measure.quantity.Length>> getTDerivatives​(double s, double t, int grade, boolean scaled)
      Calculate all the derivatives from 0 to grade with respect to parametric t-position on the surface for the given parametric position on the surface, d^{grade}p(s,t)/d^{grade}t.
      LoftedSurface getTransformed​(GTransform transform)
      Returns a transformed version of this element.
      Vector<javax.measure.quantity.Length> getTwistVector​(double s, double t)
      Calculate the twist vector (d^2P/(ds*dt) = d(dP/ds)/dt) for this surface at the specified position on this surface.
      javax.measure.unit.Unit<javax.measure.quantity.Length> getUnit()
      Returns the unit in which the first curve in this list is stated.
      int hashCode()
      Returns the hash code for this LoftedSurface.
      int indexOf​(java.lang.Object element)
      Returns the index in this list of the first occurrence of the specified element, or -1 if the list does not contain this element.
      boolean isDegenerate​(Parameter<javax.measure.quantity.Length> tol)
      Return true if this surface is degenerate (i.e.: has area less than the specified tolerance squared).
      boolean isEmpty()
      Returns true if this collection contains no elements.
      boolean isValid()
      Return true if this LoftedSurface contains valid and finite numerical components.
      java.util.Iterator<Curve> iterator()
      Returns an iterator over the curves in this surface's list of curves.
      int lastIndexOf​(java.lang.Object element)
      Returns the index in this list of the last occurrence of the specified element, or -1 if the list does not contain this element.
      java.util.ListIterator<Curve> listIterator()
      Returns a list iterator over the curves in this surface.
      java.util.ListIterator<Curve> listIterator​(int index)
      Returns a list iterator from the specified position.
      static LoftedSurface newInstance​(int q)
      Returns a new, empty, preallocated or recycled LoftedSurface instance (on the stack when executing in a StackContext), that can store a list of Curve objects.
      static LoftedSurface newInstance​(java.lang.String name, int q)
      Returns a new, empty, preallocated or recycled LoftedSurface instance (on the stack when executing in a StackContext) with the specified name, that can store a list of Curve objects.
      static void recycle​(LoftedSurface instance)
      Recycles a case instance immediately (on the stack when executing in a StackContext).
      Curve remove​(int index)
      Removes the curve at the specified position in this surface's list of curves.
      boolean remove​(java.lang.Object o)
      Removes a single instance of the specified element from this collection, if it is present.
      Curve remove​(java.lang.String name)
      Removes the curve with the specified name from this list.
      boolean removeAll​(java.util.Collection<?> c)
      Removes from this list all the elements that are contained in the specified collection.
      void reset()
      Resets the internal state of this object to its default values.
      boolean retainAll​(java.util.Collection<?> c)
      Retains only the elements in this list that are contained in the specified collection.
      LoftedSurface reverse()
      Returns an new LoftedSurface with the curves in this surface in reverse order.
      LoftedSurface reverseS()
      Return a new surface that is identical to this one, but with the S-parameterization reversed.
      LoftedSurface reverseT()
      Return a new surface that is identical to this one, but with the T-parameterization reversed.
      Curve set​(int index, Curve element)
      Replaces the Curve at the specified position in this surface's list of curves with the specified element.
      int size()
      Returns the number of elements in this surface (the number of defining curves that make up this surface).
      GeomList<LoftedSurface> splitAtS​(double s)
      Split this LoftedSurface at the specified parametric S-position returning a list containing two new surfaces (a lower surface with smaller S-parametric positions than "s" and an upper surface with larger S-parametric positions).
      GeomList<LoftedSurface> splitAtT​(double t)
      Split this surface at the specified parametric T-position returning a list containing two new surfaces (a lower surface with smaller T-parametric positions than "t" and an upper surface with larger T-parametric positions).
      java.util.List<Curve> subList​(int fromIndex, int toIndex)
      Returns a view of the portion of this list between fromIndex, inclusive, and toIndex, exclusive.
      LoftedSurface to​(javax.measure.unit.Unit<javax.measure.quantity.Length> unit)
      Returns the equivalent to this surface but stated in the specified unit.
      Curve[] toArray()
      Returns an array containing all of the elements in this collection.
      <T> T[] toArray​(T[] a)
      Returns an array containing all of the elements in this collection.
      LoftedSurface toDimension​(int newDim)
      Return the equivalent of this surface converted to the specified number of physical dimensions.
      NurbsSurface toNurbs​(Parameter<javax.measure.quantity.Length> tol)
      Return a NURBS surface representation of this surface to within the specified tolerance.
      javolution.text.Text toText()
      Returns the text representation of this geometry element.
      LoftedSurface transpose()
      Return a new surface that is identical to this one but with the transpose of the parameterization of this surface.
      java.util.List<Curve> unmodifiableList()
      Returns an unmodifiable list view of the curves in this surface.
      static LoftedSurface valueOf​(int q, Curve... curves)
      Return a LoftedSurface made up of the Curve objects in the specified array.
      static LoftedSurface valueOf​(int q, java.util.Collection<? extends Curve> curves)
      Return a LoftedSurface made up of the Curve objects in the specified collection.
      static LoftedSurface valueOf​(java.lang.String name, int q, Curve... curves)
      Return a LoftedSurface made up of the Curve objects in the specified array.
      static LoftedSurface valueOf​(java.lang.String name, int q, java.util.Collection<? extends Curve> curves)
      Return a LoftedSurface made up of the Curve objects in the specified collection.
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Comparable

        compareTo
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        replaceAll, sort, spliterator
    • Method Detail

      • newInstance

        public static LoftedSurface newInstance​(int q)
        Returns a new, empty, preallocated or recycled LoftedSurface instance (on the stack when executing in a StackContext), that can store a list of Curve objects. The list is initially empty and therefore the surface is initially undefined.
        Parameters:
        q - The degree of the surface across the defining curves (in the "t" direction).
        Returns:
        A new empty LoftedSurface.
      • newInstance

        public static LoftedSurface newInstance​(java.lang.String name,
                                                int q)
        Returns a new, empty, preallocated or recycled LoftedSurface instance (on the stack when executing in a StackContext) with the specified name, that can store a list of Curve objects. The list is initially empty and therefore the surface is initially undefined.
        Parameters:
        name - The name to be assigned to this surface (may be null).
        q - The degree of the surface across the defining curves (in the "t" direction).
        Returns:
        A new empty LoftedSurface.
      • valueOf

        public static LoftedSurface valueOf​(java.lang.String name,
                                            int q,
                                            java.util.Collection<? extends Curve> curves)
        Return a LoftedSurface made up of the Curve objects in the specified collection.
        Parameters:
        name - The name to be assigned to this surface (may be null).
        q - The degree of the surface across the defining curves (in the "t" direction).
        curves - A collection of curves that define the surface. May not be null.
        Returns:
        A new LoftedSurface made up of the curves in the specified collection.
      • valueOf

        public static LoftedSurface valueOf​(int q,
                                            java.util.Collection<? extends Curve> curves)
        Return a LoftedSurface made up of the Curve objects in the specified collection.
        Parameters:
        q - The degree of the surface across the defining curves (in the "t" direction).
        curves - A collection of curves that define the surface. May not be null.
        Returns:
        A new LoftedSurface made up of the curves in the specified collection.
      • valueOf

        public static LoftedSurface valueOf​(java.lang.String name,
                                            int q,
                                            Curve... curves)
        Return a LoftedSurface made up of the Curve objects in the specified array.
        Parameters:
        name - The name to be assigned to this surface (may be null).
        q - The degree of the surface across the defining curves (in the "t" direction).
        curves - An array of curves that define the surface. May not be null.
        Returns:
        A new LoftedSurface made up of the curves in the specified array.
      • valueOf

        public static LoftedSurface valueOf​(int q,
                                            Curve... curves)
        Return a LoftedSurface made up of the Curve objects in the specified array.
        Parameters:
        q - The degree of the surface across the defining curves (in the "t" direction).
        curves - An array of curves that define the surface. May not be null.
        Returns:
        A new LoftedSurface made up of the curves in the specified array.
      • getTDegree

        public int getTDegree()
        Return the degree of the surface in the t-direction (across the defining curves).
        Returns:
        degree of surface in t-direction
      • getRealPoint

        public Point getRealPoint​(double s,
                                  double t)
        Calculate a point on the surface for the given parametric position on the surface.
        Specified by:
        getRealPoint in interface Surface<LoftedSurface>
        Parameters:
        s - 1st parametric dimension distance to calculate a point for (0.0 to 1.0 inclusive).
        t - 2nd parametric dimension distance to calculate a point for (0.0 to 1.0 inclusive).
        Returns:
        The calculated point on the surface at the specified parameter values.
        Throws:
        java.lang.IllegalArgumentException - if there is any problem with the parameter values.
      • getSDerivatives

        public java.util.List<Vector<javax.measure.quantity.Length>> getSDerivatives​(double s,
                                                                                     double t,
                                                                                     int grade,
                                                                                     boolean scaled)
        Calculate all the derivatives from 0 to grade with respect to parametric s-position on the surface for the given parametric position on the surface, d^{grade}p(s,t)/d^{grade}s.

        Example:
        1st derivative (grade = 1), this returns [p(s,t), dp(s,t)/ds];
        2nd derivative (grade = 2), this returns [p(s,t), dp(s,t)/ds, d^2p(s,t)/d^2s]; etc.

        Specified by:
        getSDerivatives in class AbstractSurface<LoftedSurface>
        Parameters:
        s - 1st parametric dimension distance to calculate derivative for (0.0 to 1.0 inclusive).
        t - 2nd parametric dimension distance to calculate derivative for (0.0 to 1.0 inclusive).
        grade - The maximum grade to calculate the u-derivatives for (1=1st derivative, 2=2nd derivative, etc)
        scaled - Pass true for properly scaled derivatives or false if the magnitude of the derivative vector is not required -- this sometimes results in faster calculation times.
        Returns:
        A list of s-derivatives up to the specified grade of the surface at the specified parametric position.
        Throws:
        java.lang.IllegalArgumentException - if the grade is < 0 or the parameter values are invalid.
      • getTDerivatives

        public java.util.List<Vector<javax.measure.quantity.Length>> getTDerivatives​(double s,
                                                                                     double t,
                                                                                     int grade,
                                                                                     boolean scaled)
        Calculate all the derivatives from 0 to grade with respect to parametric t-position on the surface for the given parametric position on the surface, d^{grade}p(s,t)/d^{grade}t.

        Example:
        1st derivative (grade = 1), this returns [p(s,t), dp(s,t)/dt];
        2nd derivative (grade = 2), this returns [p(s,t), dp(s,t)/dt, d^2p(s,t)/d^2t]; etc.

        Specified by:
        getTDerivatives in class AbstractSurface<LoftedSurface>
        Parameters:
        s - 1st parametric dimension distance to calculate derivative for (0.0 to 1.0 inclusive).
        t - 2nd parametric dimension distance to calculate derivative for (0.0 to 1.0 inclusive).
        grade - The maximum grade to calculate the v-derivatives for (1=1st derivative, 2=2nd derivative, etc)
        scaled - Pass true for properly scaled derivatives or false if the magnitude of the derivative vector is not required -- this sometimes results in faster calculation times.
        Returns:
        A list of t-derivatives up to the specified grade of the surface at the specified parametric position.
        Throws:
        java.lang.IllegalArgumentException - if the grade is < 0 or the parameter values are invalid.
      • getTwistVector

        public Vector<javax.measure.quantity.Length> getTwistVector​(double s,
                                                                    double t)
        Calculate the twist vector (d^2P/(ds*dt) = d(dP/ds)/dt) for this surface at the specified position on this surface.
        Specified by:
        getTwistVector in interface Surface<LoftedSurface>
        Parameters:
        s - 1st parametric dimension distance to calculate twist vector for (0.0 to 1.0 inclusive).
        t - 2nd parametric dimension distance to calculate twist vector for (0.0 to 1.0 inclusive).
        Returns:
        The twist vector of this surface at the specified parametric position.
        Throws:
        java.lang.IllegalArgumentException - if the parameter values are invalid.
      • getPhyDimension

        public int getPhyDimension()
        Returns the number of physical dimensions of the geometry element. This implementation always returns the physical dimension of the underlying Curve objects or 0 if this list has no Curve objects in it.
        Specified by:
        getPhyDimension in interface GeomElement<LoftedSurface>
        Returns:
        The number of physical dimensions of the geometry element.
      • unmodifiableList

        public java.util.List<CurveunmodifiableList()
        Returns an unmodifiable list view of the curves in this surface. Attempts to modify the returned collection result in an UnsupportedOperationException being thrown.
        Specified by:
        unmodifiableList in interface GeometryList<LoftedSurface,​Curve>
        Returns:
        the unmodifiable view over this list of curves.
      • isEmpty

        public boolean isEmpty()
        Returns true if this collection contains no elements.
        Specified by:
        isEmpty in interface java.util.Collection<Curve>
        Specified by:
        isEmpty in interface java.util.List<Curve>
      • size

        public int size()
        Returns the number of elements in this surface (the number of defining curves that make up this surface). If the surface contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.
        Specified by:
        size in interface java.util.Collection<Curve>
        Specified by:
        size in interface GeomElement<LoftedSurface>
        Specified by:
        size in interface java.util.List<Curve>
        Returns:
        the number of elements in this list of curves.
      • get

        public Curve get​(int index)
        Returns the Curve at the specified position in this surface's list of curves.
        Specified by:
        get in interface java.util.List<Curve>
        Parameters:
        index - index of element to return (0 returns the 1st element, -1 returns the last, -2 returns the 2nd from last, etc).
        Returns:
        the Curve at the specified position in this surface.
        Throws:
        java.lang.IndexOutOfBoundsException - if the given index is out of range: index > size()
      • getRange

        public LoftedSurface getRange​(int first,
                                      int last)
        Returns the range of Curves in this surface from the specified start and ending indexes as a new LoftedSurface.
        Specified by:
        getRange in interface GeometryList<LoftedSurface,​Curve>
        Parameters:
        first - index of the first element to return (0 returns the 1st element, -1 returns the last, etc).
        last - index of the last element to return (0 returns the 1st element, -1 returns the last, etc).
        Returns:
        A LoftedSurface made up of the curves in the given range from this surface.
        Throws:
        java.lang.IndexOutOfBoundsException - if the given index is out of range: index ≥ size()
      • get

        public Curve get​(java.lang.String name)
        Returns the Curve with the specified name from this list.
        Specified by:
        get in interface GeometryList<LoftedSurface,​Curve>
        Parameters:
        name - The name of the curve we are looking for in the list.
        Returns:
        The curve matching the specified name. If the specified element name isn't found in the list, then null is returned.
      • subList

        public java.util.List<CurvesubList​(int fromIndex,
                                             int toIndex)
        Returns a view of the portion of this list between fromIndex, inclusive, and toIndex, exclusive. (If fromIndex and toIndex are equal, the returned list is empty.) The returned list is backed by this list, so changes in the returned list are reflected in this list, and vice-versa. The returned list supports all of the optional list operations supported by this list. This method eliminates the need for explicit range operations (of the sort that commonly exist for arrays). Any operation that expects a list can be used as a range operation by passing a subList view instead of a whole list. For example, the following idiom removes a range of values from a list: list.subList(from, to).clear(); Similar idioms may be constructed for indexOf and lastIndexOf, and all of the algorithms in the Collections class can be applied to a subList. The semantics of the list returned by this method become undefined if the backing list (i.e., this list) is structurally modified in any way other than via the returned list (structural modifications are those that change the size of this list, or otherwise perturb it in such a fashion that iterations in progress may yield incorrect results).
        Specified by:
        subList in interface java.util.List<Curve>
        Parameters:
        fromIndex - low endpoint (inclusive) of the subList.
        toIndex - high endpoint (exclusive) of the subList.
        Returns:
        a view of the specified range within this list.
        Throws:
        java.lang.IndexOutOfBoundsException - if the given index is out of range: index > size()
      • indexOf

        public int indexOf​(java.lang.Object element)
        Returns the index in this list of the first occurrence of the specified element, or -1 if the list does not contain this element.
        Specified by:
        indexOf in interface java.util.List<Curve>
        Parameters:
        element - The element to search for.
        Returns:
        the index in this List of the first occurrence of the specified element, or -1 if the List does not contain this element.
      • lastIndexOf

        public int lastIndexOf​(java.lang.Object element)
        Returns the index in this list of the last occurrence of the specified element, or -1 if the list does not contain this element. More formally, returns the highest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.
        Specified by:
        lastIndexOf in interface java.util.List<Curve>
        Parameters:
        element - The element to search for.
        Returns:
        the index in this list of the last occurrence of the specified element, or -1 if the list does not contain this element.
      • contains

        public boolean contains​(java.lang.Object o)
        Returns true if this collection contains the specified element. More formally, returns true if and only if this collection contains at least one element e such that (o==null ? e==null : o.equals(e)).
        Specified by:
        contains in interface java.util.Collection<Curve>
        Specified by:
        contains in interface java.util.List<Curve>
        Parameters:
        o - object to be checked for containment in this collection.
        Returns:
        true if this collection contains the specified element.
      • containsAll

        public boolean containsAll​(java.util.Collection<?> c)
        Returns true if this collection contains all of the elements in the specified collection.
        Specified by:
        containsAll in interface java.util.Collection<Curve>
        Specified by:
        containsAll in interface java.util.List<Curve>
        Parameters:
        c - collection to be checked for containment in this collection.
        Returns:
        true if this collection contains all of the elements in the specified collection.
      • getIndexFromName

        public int getIndexFromName​(java.lang.String name)
        Return the index to the 1st Curve in this list with the specified name.
        Specified by:
        getIndexFromName in interface GeometryList<LoftedSurface,​Curve>
        Parameters:
        name - The name of the Curve to find in this list
        Returns:
        The index to the named Curve or -1 if it is not found.
      • add

        public void add​(int index,
                        Curve value)
        Inserts the specified Curve at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices). Null values are ignored. The input value must have the same physical dimensions as the other items in this list, or an exception is thrown.

        Note: If this method is used concurrent access must be synchronized (the table is not thread-safe).

        Specified by:
        add in interface java.util.List<Curve>
        Parameters:
        index - the index at which the specified element is to be inserted. (0 returns the 1st element, -1 returns the last, -2 returns the 2nd from last, etc).
        value - the element to be inserted. May not be null.
        Throws:
        java.lang.IndexOutOfBoundsException - if index > size()
        DimensionException - if the input value dimensions are different from this list's dimensions.
      • add

        public boolean add​(Curve value)
        Appends the specified Curve to the end of this surface's list of curves. Null values are ignored. The input value must have the same physical dimensions as the other items in this list, or an exception is thrown.

        Note: If this method is used concurrent access must be synchronized (the table is not thread-safe).

        Specified by:
        add in interface java.util.Collection<Curve>
        Specified by:
        add in interface java.util.List<Curve>
        Parameters:
        value - the curve to be appended to this list. May not be null.
        Throws:
        DimensionException - if the input element's dimensions are different from this list's dimensions.
      • add

        public boolean add​(Curve... array)
        Appends all of the elements in the specified list of arguments to this geometry element list. The input values must have the same physical dimensions as the other items in this list, or an exception is thrown.
        Specified by:
        add in interface GeometryList<LoftedSurface,​Curve>
        Parameters:
        array - elements to be inserted into this collection. May not be null.
        Returns:
        true if this collection changed as a result of the call.
        Throws:
        DimensionException - if the input element's dimensions are different from this list's dimensions.
      • add

        public boolean add​(int index,
                           Curve... array)
        Inserts all of the Curve objects in the specified list of arguments into this list at the specified position. Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in this list in the order that they are appeared in the array. The input values must have the same physical dimensions as the other items in this list, or an exception is thrown.
        Specified by:
        add in interface GeometryList<LoftedSurface,​Curve>
        Parameters:
        index - index at which to insert first element from the specified array.
        array - elements to be inserted into this collection. May not be null.
        Returns:
        true if this collection changed as a result of the call.
        Throws:
        DimensionException - if the input element's dimensions are different from this list's dimensions.
      • addAll

        public boolean addAll​(java.util.Collection<? extends Curve> c)
        Adds all of the curves in the specified collection to this surface. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. This implies that the behavior of this call is undefined if the specified collection is this collection, and this collection is nonempty. The input elements must have the same physical dimensions as the other items in this list, or an exception is thrown.
        Specified by:
        addAll in interface java.util.Collection<Curve>
        Specified by:
        addAll in interface java.util.List<Curve>
        Parameters:
        c - curves to be inserted into this surface. May not be null.
        Returns:
        true if this surface changed as a result of the call
        Throws:
        DimensionException - if the input element's dimensions are different from this list's dimensions.
      • addAll

        public boolean addAll​(int index,
                              java.util.Collection<? extends Curve> c)
        Inserts all of the curves in the specified collection into this surface at the specified position. Shifts the curve currently at that position (if any) and any subsequent curves to the right (increases their indices). The new curves will appear in this list in the order that they are returned by the specified collection's iterator. The behavior of this operation is unspecified if the specified collection is modified while the operation is in progress. Note that this will occur if the specified collection is this list, and it's nonempty. The input elements must have the same physical dimensions as the other items in this list, or an exception is thrown.
        Specified by:
        addAll in interface java.util.List<Curve>
        Parameters:
        index - index at which to insert first curve from the specified collection.
        c - curves to be inserted into this collection. May not be null.
        Returns:
        true if this surface changed as a result of the call
        Throws:
        DimensionException - if the input element's dimensions are different from this list's dimensions.
      • addAll

        public boolean addAll​(Curve[] arr)
        Appends all of the curves in the specified array to this LoftedSurface. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. The input array elements must have the same physical dimensions as the other items in this list, or an exception is thrown.
        Specified by:
        addAll in interface GeometryList<LoftedSurface,​Curve>
        Parameters:
        arr - curves to be appended onto this collection. May not be null.
        Returns:
        true if this collection changed as a result of the call.
        Throws:
        DimensionException - if the input element's dimensions are different from this list's dimensions.
      • addAll

        public boolean addAll​(int index,
                              Curve[] arr)
        Inserts all of the Curve objects in the specified array into this list at the specified position. Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in this list in the order that they are returned by the specified collection's iterator. The input array elements must have the same physical dimensions as the other items in this list, or an exception is thrown.
        Specified by:
        addAll in interface GeometryList<LoftedSurface,​Curve>
        Parameters:
        index - index at which to insert first element from the specified array.
        arr - elements to be inserted into this collection. May not be null.
        Returns:
        true if this collection changed as a result of the call.
        Throws:
        DimensionException - if the input element's dimensions are different from this list's dimensions.
      • set

        public Curve set​(int index,
                         Curve element)
        Replaces the Curve at the specified position in this surface's list of curves with the specified element. Null elements are ignored. The input element must have the same physical dimensions as the other items in this list, or an exception is thrown.
        Specified by:
        set in interface java.util.List<Curve>
        Parameters:
        index - The index of the element to replace (0 returns the 1st element, -1 returns the last, -2 returns the 2nd from last, etc).
        element - The curve to be stored at the specified position. May not be null.
        Returns:
        The curve previously at the specified position in this list.
        Throws:
        java.lang.IndexOutOfBoundsException - - if index > size()
        DimensionException - if the input element's dimensions are different from this list's dimensions.
      • removeAll

        public boolean removeAll​(java.util.Collection<?> c)
        Removes from this list all the elements that are contained in the specified collection.
        Specified by:
        removeAll in interface java.util.Collection<Curve>
        Specified by:
        removeAll in interface java.util.List<Curve>
        Parameters:
        c - collection that defines which elements will be removed from this list. May not be null.
        Returns:
        true if this list changed as a result of the call.
      • retainAll

        public boolean retainAll​(java.util.Collection<?> c)
        Retains only the elements in this list that are contained in the specified collection. In other words, removes from this list all the elements that are not contained in the specified collection.
        Specified by:
        retainAll in interface java.util.Collection<Curve>
        Specified by:
        retainAll in interface java.util.List<Curve>
        Parameters:
        c - collection that defines which elements this set will retain. May not be null.
        Returns:
        true if this list changed as a result of the call.
      • remove

        public boolean remove​(java.lang.Object o)
        Removes a single instance of the specified element from this collection, if it is present. More formally, removes an element e such that (o==null ? e==null : o.equals(e)), if this collection contains one or more such elements. Returns true if this collection contained the specified element (or equivalently, if this collection changed as a result of the call).
        Specified by:
        remove in interface java.util.Collection<Curve>
        Specified by:
        remove in interface java.util.List<Curve>
        Parameters:
        o - element to be removed from this collection, if present.
        Returns:
        true if this collection changed as a result of the call
      • remove

        public Curve remove​(int index)
        Removes the curve at the specified position in this surface's list of curves. Shifts any subsequent curves to the left (subtracts one from their indices). Returns the curve that was removed from the list.
        Specified by:
        remove in interface java.util.List<Curve>
        Parameters:
        index - the index of the curve to remove. (0 returns the 1st element, -1 returns the last, -2 returns the 2nd from last, etc).
        Returns:
        the curve previously at the specified position.
      • remove

        public Curve remove​(java.lang.String name)
        Removes the curve with the specified name from this list. Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.
        Specified by:
        remove in interface GeometryList<LoftedSurface,​Curve>
        Parameters:
        name - the name of the element to remove.
        Returns:
        the element previously at the specified position.
      • clear

        public void clear()
        Removes all of the curves from this surface. The surface will be empty and undefined after this call returns.
        Specified by:
        clear in interface java.util.Collection<Curve>
        Specified by:
        clear in interface java.util.List<Curve>
      • iterator

        public java.util.Iterator<Curveiterator()
        Returns an iterator over the curves in this surface's list of curves.
        Specified by:
        iterator in interface java.util.Collection<Curve>
        Specified by:
        iterator in interface java.lang.Iterable<Curve>
        Specified by:
        iterator in interface java.util.List<Curve>
        Returns:
        an iterator over this list values.
      • listIterator

        public java.util.ListIterator<CurvelistIterator()
        Returns a list iterator over the curves in this surface.
        Specified by:
        listIterator in interface java.util.List<Curve>
        Returns:
        an iterator over this list values.
      • listIterator

        public java.util.ListIterator<CurvelistIterator​(int index)
        Returns a list iterator from the specified position.
        Specified by:
        listIterator in interface java.util.List<Curve>
        Parameters:
        index - the index of first value to be returned from the list iterator (by a call to the next method).
        Returns:
        a list iterator of the values in this list starting at the specified position in this list.
      • toArray

        public Curve[] toArray()
        Returns an array containing all of the elements in this collection.
        Specified by:
        toArray in interface java.util.Collection<Curve>
        Specified by:
        toArray in interface java.util.List<Curve>
      • toArray

        public <T> T[] toArray​(T[] a)
        Returns an array containing all of the elements in this collection. If the collection fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this collection.
        Specified by:
        toArray in interface java.util.Collection<Curve>
        Specified by:
        toArray in interface java.util.List<Curve>
        Type Parameters:
        T - The type of elements in this LoftedSurface (curve type).
        Parameters:
        a - the array into which the elements of the collection are to be stored, if it is big enough; otherwise, a new array of the same type is allocated for this purpose.
        Returns:
        an array containing the elements of the collection.
      • reverseT

        public LoftedSurface reverseT()
        Return a new surface that is identical to this one, but with the T-parameterization reversed. This is identical to "reverse()".
        Specified by:
        reverseT in interface Surface<LoftedSurface>
        Returns:
        A new surface that is identical to this one, but with the T-parameterization reversed.
        See Also:
        reverse(), reverseS()
      • reverseS

        public LoftedSurface reverseS()
        Return a new surface that is identical to this one, but with the S-parameterization reversed.
        Specified by:
        reverseS in interface Surface<LoftedSurface>
        Returns:
        A new surface that is identical to this one, but with the S-parameterization reversed.
        See Also:
        reverseT()
      • splitAtS

        public GeomList<LoftedSurfacesplitAtS​(double s)
        Split this LoftedSurface at the specified parametric S-position returning a list containing two new surfaces (a lower surface with smaller S-parametric positions than "s" and an upper surface with larger S-parametric positions). This method splits all the defining section curves to create two new lofted surfaces.
        Specified by:
        splitAtS in interface Surface<LoftedSurface>
        Parameters:
        s - The S-parametric position where this surface should be split (must not be 0 or 1!).
        Returns:
        A list containing two surfaces: 0 == the lower surface, 1 == the upper surface.
      • splitAtT

        public GeomList<LoftedSurfacesplitAtT​(double t)
        Split this surface at the specified parametric T-position returning a list containing two new surfaces (a lower surface with smaller T-parametric positions than "t" and an upper surface with larger T-parametric positions). This method interpolates a new defining section at "t" and uses the defining sections below it and above it to create two new lofted surfaces.
        Specified by:
        splitAtT in interface Surface<LoftedSurface>
        Parameters:
        t - The T-parametric position where this surface should be split (must not be 0 or 1!).
        Returns:
        A list containing two surfaces: 0 == the lower surface, 1 == the upper surface.
      • toNurbs

        public NurbsSurface toNurbs​(Parameter<javax.measure.quantity.Length> tol)
        Return a NURBS surface representation of this surface to within the specified tolerance. If the curves making up this surface are NURBS curves, then the resulting NURBS surface is an exact representation of this surface (and tol is ignored). However, if any of the member curves are not NURBS curves, then tol is used to make a NURBS approximation of that curve (and this surface).
        Specified by:
        toNurbs in interface Surface<LoftedSurface>
        Parameters:
        tol - The greatest possible difference between this surface and the NURBS representation returned. May not be null.
        Returns:
        A NURBS surface that represents this surface to within the specified tolerance.
      • isValid

        public boolean isValid()
        Return true if this LoftedSurface contains valid and finite numerical components. A value of false will be returned if any of the member curves are not valid.
        Specified by:
        isValid in interface GeomElement<LoftedSurface>
        Returns:
        true if this LoftedSurface contains valid and finite numerical components.
      • getTransformed

        public LoftedSurface getTransformed​(GTransform transform)
        Returns a transformed version of this element. The returned list of objects implement GeomTransform and contains transformed versions of the contents of this list as children.
        Specified by:
        getTransformed in interface Transformable<LoftedSurface>
        Parameters:
        transform - The transformation to apply to this geometry. May not be null.
        Returns:
        A new LoftedSurface that is identical to this one with the specified transformation applied to member curves.
        Throws:
        DimensionException - if this surface is not 3D.
      • getBoundsMin

        public Point getBoundsMin()
        Return the coordinate point representing the minimum bounding box corner of this geometry element (e.g.: min X, min Y, min Z).
        Specified by:
        getBoundsMin in interface GeomElement<LoftedSurface>
        Returns:
        The minimum bounding box coordinate for this geometry element.
        Throws:
        java.lang.IndexOutOfBoundsException - if this list contains no geometry.
      • getBoundsMax

        public Point getBoundsMax()
        Return the coordinate point representing the maximum bounding box corner (e.g.: max X, max Y, max Z).
        Specified by:
        getBoundsMax in interface GeomElement<LoftedSurface>
        Returns:
        The maximum bounding box coordinate for this geometry element.
        Throws:
        java.lang.IndexOutOfBoundsException - if this list contains no elements.
      • getUnit

        public javax.measure.unit.Unit<javax.measure.quantity.Length> getUnit()
        Returns the unit in which the first curve in this list is stated. If the list contains no curves, then the default unit is returned.
        Specified by:
        getUnit in interface GeomElement<LoftedSurface>
        Returns:
        The unit in which the first curve in this surface is stated or the default unit if this surface has no defining curves.
      • to

        public LoftedSurface to​(javax.measure.unit.Unit<javax.measure.quantity.Length> unit)
                         throws javax.measure.converter.ConversionException
        Returns the equivalent to this surface but stated in the specified unit.
        Specified by:
        to in interface GeomElement<LoftedSurface>
        Specified by:
        to in interface GeometryList<LoftedSurface,​Curve>
        Specified by:
        to in interface ParametricGeometry<LoftedSurface>
        Specified by:
        to in interface Surface<LoftedSurface>
        Parameters:
        unit - the length unit of the surface to be returned. May not be null.
        Returns:
        an equivalent to this surface but stated in the specified unit.
        Throws:
        javax.measure.converter.ConversionException - if the the input unit is not a length unit.
      • toDimension

        public LoftedSurface toDimension​(int newDim)
        Return the equivalent of this surface 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.
        Specified by:
        toDimension in interface GeomElement<LoftedSurface>
        Specified by:
        toDimension in interface GeometryList<LoftedSurface,​Curve>
        Specified by:
        toDimension in interface ParametricGeometry<LoftedSurface>
        Specified by:
        toDimension in interface Surface<LoftedSurface>
        Parameters:
        newDim - The dimension of the surface to return.
        Returns:
        This surface converted to the new dimensions.
      • equals

        public boolean equals​(java.lang.Object obj)
        Compares the specified object with this list of Curve objects for equality. Returns true if and only if both collections are of the same type and both collections contain equal elements in the same order.
        Specified by:
        equals in interface java.util.Collection<Curve>
        Specified by:
        equals in interface java.util.List<Curve>
        Overrides:
        equals in class AbstractGeomElement<LoftedSurface>
        Parameters:
        obj - the object to compare with.
        Returns:
        true if this list is identical to that list; false otherwise.
      • hashCode

        public int hashCode()
        Returns the hash code for this LoftedSurface.
        Specified by:
        hashCode in interface java.util.Collection<Curve>
        Specified by:
        hashCode in interface java.util.List<Curve>
        Overrides:
        hashCode in class AbstractGeomElement<LoftedSurface>
        Returns:
        the hash code value.
      • reset

        public void reset()
        Resets the internal state of this object to its default values. Subclasses that override this method must call super.reset(); to ensure that the state is reset properly.
        Specified by:
        reset in interface javolution.lang.Reusable
        Overrides:
        reset in class AbstractGeomElement<LoftedSurface>
      • recycle

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