Package geomss.geom

Class LinearComboCurve

    • 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 with a default weight of 1.0.
      boolean add​(int index, Curve... array)
      Inserts all of the Curve objects in the specified list of arguments into this LinearComboCurve at the specified position with a default weight of 1.0 assigned to each.
      void add​(int index, Curve curve, java.lang.Double weight)
      Inserts the specified Curve at the specified position in this list.
      boolean add​(Curve curve)
      Appends the specified Curve to the end of this LinearComboCurve with a default weight of 1.0.
      boolean add​(Curve... array)
      Appends all of the elements in the specified list of arguments to this LinearComboCurve with a default weight of 1.0 assigned to each.
      boolean add​(Curve curve, java.lang.Double weight)
      Appends the specified Curve to the end of this list of curves.
      boolean addAll​(int index, Curve[] arr)
      Inserts all of the Curve objects in the specified array into this LinearComboCurve at the specified position with a default weight of 1.0 assigned to each.
      boolean addAll​(int index, java.util.Collection<? extends Curve> curves)
      Inserts all of the curves in the specified collection of curves into this LinearComboCurve with default weights of 1.0 for each.
      boolean addAll​(int index, java.util.Collection<? extends Curve> curves, java.util.Collection<java.lang.Double> weights)
      Inserts all of the curves in the specified collection and their associated weights into this LinearComboCurve at the specified position.
      boolean addAll​(Curve[] arr)
      Appends all of the curves in the specified array to this LinearComboCurve with a default weight of 1.0 assigned to each.
      boolean addAll​(java.util.Collection<? extends Curve> curves)
      Adds all of the curves in the specified collection to this LinearComboCurve with a default weight of 1.0 for each.
      boolean addAll​(java.util.Collection<? extends Curve> curves, java.util.Collection<java.lang.Double> weights)
      Appends all of the curves in the specified collection to this LinearComboCurve.
      void clear()
      Removes all of the curves from this linear combination.
      boolean contains​(java.lang.Object o)
      Returns true if this LinearComboCurve contains the specified Curve.
      boolean containsAll​(java.util.Collection<?> c)
      Returns true if this collection contains all of the Curve objects in the specified collection.
      boolean containsGeometry()
      Returns true if this list actually contains any curves and false if this list is empty.
      LinearComboCurve copy()
      Returns a copy of this LinearComboCurve instance allocated by the calling thread (possibly on the stack).
      LinearComboCurve 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 LinearComboCurve.
      Curve get​(java.lang.String name)
      Returns the Curve with the specified name from this list.
      GeomList<Curve> getAll()
      Returns an new GeomList with all the curves 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 LinearComboCurve.
      java.lang.Double getFirstWeight()
      Returns the first linear combination weight from this LinearComboCurve.
      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 LinearComboCurve list of curves.
      java.lang.Double getLastWeight()
      Returns the last linear combination weight from this LinearComboCurve.
      int getPhyDimension()
      Returns the number of physical dimensions of the geometry element.
      LinearComboCurve getRange​(int first, int last)
      Returns the range of Curves in this LinearComboCurve from the specified start and ending indexes as a new LinearComboCurve.
      Point getRealPoint​(double s)
      Calculate a point on the curve for the given parametric distance along the curve.
      java.util.List<Vector<javax.measure.quantity.Length>> getSDerivatives​(double s, int grade)
      Calculate all the derivatives from 0 to grade with respect to parametric distance on the curve for the given parametric distance along the curve, d^{grade}p(s)/d^{grade}s.
      LinearComboCurve getTransformed​(GTransform transform)
      Returns a transformed version of this element.
      javax.measure.unit.Unit<javax.measure.quantity.Length> getUnit()
      Returns the unit in which the curves in this linear combination curve are stated.
      java.lang.Double getWeight​(int index)
      Returns the linear combination weight at the specified position in this LinearComboCurve.
      java.util.List<java.lang.Double> getWeightRange​(int first, int last)
      Returns the range of linear combination weights in this LinearComboCurve from the specified start and ending indexes as a List of double values.
      int hashCode()
      Returns the hash code for this LinearComboCurve.
      int indexOf​(java.lang.Object element)
      Returns the index in this list of the first occurrence of the specified Curve, or -1 if the list does not contain this curve.
      boolean isEmpty()
      Returns true if this collection contains no elements.
      boolean isValid()
      Return true if this LinearComboCurve contains valid and finite numerical components.
      java.util.Iterator<Curve> iterator()
      Returns an iterator over the curves in this LinearComboCurve.
      int lastIndexOf​(java.lang.Object element)
      Returns the index in this list of the last occurrence of the specified Curve, or -1 if the list does not contain this curve.
      java.util.ListIterator<Curve> listIterator()
      Returns a list iterator over the curves in this LinearComboCurve.
      java.util.ListIterator<Curve> listIterator​(int index)
      Returns a Curve list iterator from the specified position.
      static LinearComboCurve newInstance()
      Returns a new, empty, preallocated or recycled LinearComboCurve instance (on the stack when executing in a StackContext), that can store a list of Curve objects and associated weighting factors.
      static LinearComboCurve newInstance​(java.lang.String name)
      Returns a new, empty, preallocated or recycled LinearComboCurve instance (on the stack when executing in a StackContext), that can store a list of Curve objects and associated weighting factors.
      static void recycle​(LinearComboCurve instance)
      Recycles a case instance immediately (on the stack when executing in a StackContext).
      Curve remove​(int index)
      Removes the curve (and its associated weight) at the specified position in this LinearComboCurve.
      boolean remove​(java.lang.Object o)
      Removes a single instance of the specified Curve (and its associated weight) 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 Curve objects 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 curves in this list that are contained in the specified collection.
      LinearComboCurve reverse()
      Return a new curve that is identical to this one, but with the parameterization reversed.
      Curve set​(int index, Curve curve)
      Replaces the Curve at the specified position in this list of curves with the specified Curve.
      Curve set​(int index, Curve curve, java.lang.Double weight)
      Replaces the Curve and weight at the specified position in this LinearComboCurve with the specified curve and weight.
      java.lang.Double setWeight​(int index, java.lang.Double weight)
      Replaces the weight at the specified position in this LinearComboCurve with the specified weight.
      int size()
      Returns the number of Curve objects that make up this linear combination curve.
      GeomList<LinearComboCurve> splitAt​(double s)
      Split this curve at the specified parametric position returning a list containing two curves (a lower curve with smaller parametric positions than "s" and an upper curve with larger parametric positions).
      LinearComboCurve subList​(int fromIndex, int toIndex)
      Returns a view of the portion of this LinearComboCurve between fromIndex, inclusive, and toIndex, exclusive.
      LinearComboCurve to​(javax.measure.unit.Unit<javax.measure.quantity.Length> unit)
      Returns the equivalent to this LinearComboCurve but stated in the specified unit.
      Curve[] toArray()
      Returns an array containing all of the curves in this collection.
      <T> T[] toArray​(T[] a)
      Returns an array containing all of the curves in this collection.
      LinearComboCurve toDimension​(int newDim)
      Return the equivalent of this LinearComboCurve converted to the specified number of physical dimensions.
      NurbsCurve toNurbs​(Parameter<javax.measure.quantity.Length> tol)
      Return a NURBS curve representation of this curve to within the specified tolerance.
      javolution.text.Text toText()
      Returns the text representation of this geometry element.
      java.util.List<Curve> unmodifiableList()
      Returns an unmodifiable list view of the curves in this list.
      java.util.List<java.lang.Double> unmodifiableWeightList()
      Returns an unmodifiable list view of the weights in this list.
      static LinearComboCurve valueOf​(Curve... curves)
      Return a LinearComboCurve made up of the Curve objects in the specified array each with a default weight of 1.0.
      static LinearComboCurve valueOf​(java.util.Collection<? extends Curve> curves, java.util.Collection<java.lang.Double> weights)
      Return a LinearComboCurve made up of the Curve and weight objects in the specified collections.
      • 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 LinearComboCurve newInstance()
        Returns a new, empty, preallocated or recycled LinearComboCurve instance (on the stack when executing in a StackContext), that can store a list of Curve objects and associated weighting factors. The list is initially empty and therefore the linear combination is initially undefined.
        Returns:
        A new empty LinearComboCurve.
      • newInstance

        public static LinearComboCurve newInstance​(java.lang.String name)
        Returns a new, empty, preallocated or recycled LinearComboCurve instance (on the stack when executing in a StackContext), that can store a list of Curve objects and associated weighting factors. The list is initially empty and therefore the linear combination is initially undefined.
        Parameters:
        name - The name to be assigned to this LinearComboCurve (may be null).
        Returns:
        A new empty LinearComboCurve.
      • valueOf

        public static LinearComboCurve valueOf​(java.util.Collection<? extends Curve> curves,
                                               java.util.Collection<java.lang.Double> weights)
        Return a LinearComboCurve made up of the Curve and weight objects in the specified collections.
        Parameters:
        curves - A collection of curves that define the LinearComboCurve. May not be null.
        weights - A collection of weights (one for each curve). May not be null and must have the same size as "curves".
        Returns:
        A new LinearComboCurve made up of the curves and weights in the specified collections.
      • valueOf

        public static LinearComboCurve valueOf​(Curve... curves)
        Return a LinearComboCurve made up of the Curve objects in the specified array each with a default weight of 1.0.
        Parameters:
        curves - An array of curves that define the LinearComboCurve. May not be null.
        Returns:
        A new LinearComboCurve made up of the curves in the specified array each with a default weight of 1.0.
      • unmodifiableList

        public java.util.List<CurveunmodifiableList()
        Returns an unmodifiable list view of the curves in this list. Attempts to modify the returned collection result in an UnsupportedOperationException being thrown.
        Specified by:
        unmodifiableList in interface GeometryList<LinearComboCurve,​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 Curve objects that make up this linear combination curve. 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<LinearComboCurve>
        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 LinearComboCurve.
        Specified by:
        get in interface java.util.List<Curve>
        Parameters:
        index - index of curve 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 LinearComboCurve.
        Throws:
        java.lang.IndexOutOfBoundsException - if the given index is out of range: index > size()
      • getWeight

        public java.lang.Double getWeight​(int index)
        Returns the linear combination weight at the specified position in this LinearComboCurve.
        Specified by:
        getWeight in interface LinearCombination<LinearComboCurve,​Curve>
        Parameters:
        index - index of weight to return (0 returns the 1st element, -1 returns the last, -2 returns the 2nd from last, etc).
        Returns:
        the linear combination weight at the specified position in this LinearComboCurve.
        Throws:
        java.lang.IndexOutOfBoundsException - if the given index is out of range: index > size()
      • getRange

        public LinearComboCurve getRange​(int first,
                                         int last)
        Returns the range of Curves in this LinearComboCurve from the specified start and ending indexes as a new LinearComboCurve.
        Specified by:
        getRange in interface GeometryList<LinearComboCurve,​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 LinearComboCurve made up of the curves in the given range from this LinearComboCurve.
        Throws:
        java.lang.IndexOutOfBoundsException - if the given index is out of range: index ≥ size()
      • getWeightRange

        public java.util.List<java.lang.Double> getWeightRange​(int first,
                                                               int last)
        Returns the range of linear combination weights in this LinearComboCurve from the specified start and ending indexes as a List of double values.
        Specified by:
        getWeightRange in interface LinearCombination<LinearComboCurve,​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 List made up of the weights in the given range from this LinearComboCurve.
        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<LinearComboCurve,​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 LinearComboCurve subList​(int fromIndex,
                                        int toIndex)
        Returns a view of the portion of this LinearComboCurve between fromIndex, inclusive, and toIndex, exclusive. (If fromIndex and toIndex are equal, the returned LinearComboCurve is empty.) The returned LinearComboCurve is backed by this LinearComboCurve, so changes in the returned LinearComboCurve are reflected in this LinearComboCurve, and vice-versa. 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 LinearComboCurve.
        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 Curve, or -1 if the list does not contain this curve.
        Specified by:
        indexOf in interface java.util.List<Curve>
        Parameters:
        element - The Curve to search for.
        Returns:
        the index in this List of the first occurrence of the specified curve, or -1 if the List does not contain this curve.
      • lastIndexOf

        public int lastIndexOf​(java.lang.Object element)
        Returns the index in this list of the last occurrence of the specified Curve, or -1 if the list does not contain this curve. 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 Curve to search for.
        Returns:
        the index in this list of the last occurrence of the specified curve, or -1 if the list does not contain this curve.
      • contains

        public boolean contains​(java.lang.Object o)
        Returns true if this LinearComboCurve contains the specified Curve. More formally, returns true if and only if this LinearComboCurve's curves 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 Curve objects 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 of curves to be checked for containment in this collection.
        Returns:
        true if this collection contains all of the curves 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<LinearComboCurve,​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 with a default weight of 1.0. 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 Curve to be inserted with a default weight of 1.0.
        Throws:
        java.lang.IndexOutOfBoundsException - if index > size()
        DimensionException - if the input value dimensions are different from this list's dimensions.
      • add

        public void add​(int index,
                        Curve curve,
                        java.lang.Double weight)
        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 curve 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 LinearCombination<LinearComboCurve,​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).
        curve - The Curve to be inserted. May not be null.
        weight - The linear combination weight of the curve to be inserted. May not be null.
        Throws:
        java.lang.IndexOutOfBoundsException - if index > size()
        DimensionException - if the input curve dimensions are different from this list's dimensions.
      • add

        public boolean add​(Curve curve)
        Appends the specified Curve to the end of this LinearComboCurve with a default weight of 1.0. Null values are ignored. The input curve 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:
        curve - The curve to be appended to this list with a default weight of 1.0. May not be null.
        Returns:
        true if this list changed as a result of this call.
        Throws:
        DimensionException - if the input element's dimensions are different from this list's dimensions.
        DimensionException - if the input curve dimensions are different from this list's dimensions.
      • add

        public boolean add​(Curve curve,
                           java.lang.Double weight)
        Appends the specified Curve to the end of this list of curves. Null values are ignored. The input curve 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 LinearCombination<LinearComboCurve,​Curve>
        Parameters:
        curve - The curve to be appended to this list. May not be null.
        weight - The linear combination weight of the curve to be appended. May not be null.
        Returns:
        true if this list changed as a result of this call.
        Throws:
        DimensionException - if the input element's dimensions are different from this list's dimensions.
        DimensionException - if the input curve 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 LinearComboCurve with a default weight of 1.0 assigned to each. The input curve must have the same physical dimensions as the other items in this list, or an exception is thrown.
        Specified by:
        add in interface GeometryList<LinearComboCurve,​Curve>
        Parameters:
        array - the curves to be inserted into this collection with a default weight of 1.0 assigned to each. May not be null.
        Returns:
        true if this collection changed as a result of the call.
        Throws:
        DimensionException - if the input curve 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 LinearComboCurve at the specified position with a default weight of 1.0 assigned to each. 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 curve must have the same physical dimensions as the other items in this list, or an exception is thrown.
        Specified by:
        add in interface GeometryList<LinearComboCurve,​Curve>
        Parameters:
        index - index at which to insert first element from the specified array.
        array - the curves to be inserted into this collection with a default weight of 1.0 for each. May not be null.
        Returns:
        true if this collection changed as a result of the call.
        Throws:
        DimensionException - if the input curve dimensions are different from this list's dimensions.
      • addAll

        public boolean addAll​(java.util.Collection<? extends Curve> curves)
        Adds all of the curves in the specified collection to this LinearComboCurve with a default weight of 1.0 for each. 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 curves 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:
        curves - curves to be inserted into this list with a default of 1.0 for each. May not be null.
        Returns:
        true if this LinearComboCurve changed as a result of the call
        Throws:
        DimensionException - if the input curve dimensions are different from this list's dimensions.
      • addAll

        public boolean addAll​(int index,
                              java.util.Collection<? extends Curve> curves)
        Inserts all of the curves in the specified collection of curves into this LinearComboCurve with default weights of 1.0 for each. 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 curves 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.
        curves - curves to be inserted into this list with default weights of 1.0 for each. May not be null.
        Returns:
        true if this LinearComboCurve changed as a result of the call
        Throws:
        DimensionException - if the input curve dimensions are different from this list's dimensions.
      • addAll

        public boolean addAll​(java.util.Collection<? extends Curve> curves,
                              java.util.Collection<java.lang.Double> weights)
        Appends all of the curves in the specified collection to this LinearComboCurve. 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 curves must have the same physical dimensions as the other items in this list, or an exception is thrown.
        Specified by:
        addAll in interface LinearCombination<LinearComboCurve,​Curve>
        Parameters:
        curves - the curves to be appended onto this list of curves. May not be null.
        weights - the linear combination weights associated with all of the curves being appended. May not be null and must be the same size as "curves".
        Returns:
        true if this LinearComboCurve changed as a result of the call
        Throws:
        DimensionException - if the input curve dimensions are different from this list's dimensions.
      • addAll

        public boolean addAll​(int index,
                              java.util.Collection<? extends Curve> curves,
                              java.util.Collection<java.lang.Double> weights)
        Inserts all of the curves in the specified collection and their associated weights into this LinearComboCurve 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 curves must have the same physical dimensions as the other items in this list, or an exception is thrown.
        Specified by:
        addAll in interface LinearCombination<LinearComboCurve,​Curve>
        Parameters:
        index - index at which to insert first curve from the specified collection.
        curves - the curves to be inserted into this linear combination. May not be null.
        weights - the linear combination weights associated with each curve being inserted. May not be null and must be the same size as "curves".
        Returns:
        true if this LinearComboCurve changed as a result of the call
        Throws:
        DimensionException - if the input curve 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 LinearComboCurve with a default weight of 1.0 assigned to each. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. The input curves must have the same physical dimensions as the other items in this list, or an exception is thrown.
        Specified by:
        addAll in interface GeometryList<LinearComboCurve,​Curve>
        Parameters:
        arr - curves to be appended onto this collection with a default weight of 1.0 for each. May not be null.
        Returns:
        true if this collection changed as a result of the call.
        Throws:
        DimensionException - if the input curve 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 LinearComboCurve at the specified position with a default weight of 1.0 assigned to each. 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 curves must have the same physical dimensions as the other items in this list, or an exception is thrown.
        Specified by:
        addAll in interface GeometryList<LinearComboCurve,​Curve>
        Parameters:
        index - index at which to insert first element from the specified array.
        arr - the curves to be inserted into this collection with a default weight of 1.0 for each. May not be null.
        Returns:
        true if this collection changed as a result of the call.
        Throws:
        DimensionException - if the input curve dimensions are different from this list's dimensions.
      • set

        public Curve set​(int index,
                         Curve curve)
        Replaces the Curve at the specified position in this list of curves with the specified Curve. The weight at that position is left unchanged. Null elements are ignored. The input curve 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 curve to replace (0 returns the 1st curve, -1 returns the last, -2 returns the 2nd from last, etc).
        curve - The curve to be stored at the specified position. The weight at that position is left unchanged. 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 curve dimensions are different from this list's dimensions.
      • setWeight

        public java.lang.Double setWeight​(int index,
                                          java.lang.Double weight)
        Replaces the weight at the specified position in this LinearComboCurve with the specified weight. The curve at that position is left unchanged. Null elements are ignored.
        Specified by:
        setWeight in interface LinearCombination<LinearComboCurve,​Curve>
        Parameters:
        index - The index of the weight to replace (0 returns the 1st element, -1 returns the last, -2 returns the 2nd from last, etc).
        weight - The weight to be stored at the specified position. The curve at that position is left unchanged. May not be null.
        Returns:
        The weight previously at the specified position in this list.
        Throws:
        java.lang.IndexOutOfBoundsException - - if index > size()
      • set

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

        public boolean removeAll​(java.util.Collection<?> c)
        Removes from this list all the Curve objects 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 curves 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 curves in this list that are contained in the specified collection. In other words, removes from this LinearComboCurve all the Curve objects 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 curves 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 Curve (and its associated weight) 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 curve (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 - Curve to be removed from this collection (along with its associated weight), if present.
        Returns:
        true if this collection changed as a result of the call
      • remove

        public Curve remove​(int index)
        Removes the curve (and its associated weight) at the specified position in this LinearComboCurve. Shifts any subsequent curves and weights to the left (subtracts one from their indices). Returns the curve that was removed from the list; the removed weight is lost.
        Specified by:
        remove in interface java.util.List<Curve>
        Parameters:
        index - the index of the curve and weight 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<LinearComboCurve,​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 linear combination. The linear combination 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 LinearComboCurve.
        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 of curves.
      • listIterator

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

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

        public Curve[] toArray()
        Returns an array containing all of the curves 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 curves 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 LinearComboCurve (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 curves of this collection.
      • 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<LinearComboCurve>
        Returns:
        The number of physical dimensions of the geometry element.
      • getRealPoint

        public Point getRealPoint​(double s)
        Calculate a point on the curve for the given parametric distance along the curve.
        Specified by:
        getRealPoint in interface Curve<LinearComboCurve>
        Parameters:
        s - parametric distance to calculate a point for (0.0 to 1.0 inclusive).
        Returns:
        the calculated point
      • getSDerivatives

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

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

        Specified by:
        getSDerivatives in interface Curve<LinearComboCurve>
        Parameters:
        s - Parametric distance to calculate derivatives for (0.0 to 1.0 inclusive).
        grade - The maximum grade to calculate the derivatives for (1=1st derivative, 2=2nd derivative, etc)
        Returns:
        A list of derivatives up to the specified grade of the curve at the specified parametric position.
        Throws:
        java.lang.IllegalArgumentException - if the grade is < 0.
      • splitAt

        public GeomList<LinearComboCurvesplitAt​(double s)
        Split this curve at the specified parametric position returning a list containing two curves (a lower curve with smaller parametric positions than "s" and an upper curve with larger parametric positions).
        Specified by:
        splitAt in interface Curve<LinearComboCurve>
        Parameters:
        s - The parametric position where this curve should be split (must not be 0 or 1!).
        Returns:
        A list containing two curves: 0 == the lower curve, 1 == the upper curve.
      • isValid

        public boolean isValid()
        Return true if this LinearComboCurve contains valid and finite numerical components. A value of false will be returned if any of the coordinate values or weights are NaN or Inf.
        Specified by:
        isValid in interface GeomElement<LinearComboCurve>
        Returns:
        true if this line segment contains valid and finite data.
      • getTransformed

        public LinearComboCurve 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<LinearComboCurve>
        Parameters:
        transform - The transformation to apply to this geometry. May not be null.
        Returns:
        A new LinearCombonCurve 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<LinearComboCurve>
        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<LinearComboCurve>
        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 curves in this linear combination curve are stated.
        Specified by:
        getUnit in interface GeomElement<LinearComboCurve>
        Returns:
        The unit in which the curves in this LinearComboCurve are stated or the default unit if this surface has no member curves.
      • to

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

        public NurbsCurve toNurbs​(Parameter<javax.measure.quantity.Length> tol)
        Return a NURBS curve representation of this curve to within the specified tolerance.
        Specified by:
        toNurbs in interface Curve<LinearComboCurve>
        Parameters:
        tol - The greatest possible difference between this curve and the NURBS representation returned. May not be null.
        Returns:
        A NURBS curve that represents this curve to within the specified tolerance.
      • 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<LinearComboCurve>
        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 LinearComboCurve.
        Specified by:
        hashCode in interface java.util.Collection<Curve>
        Specified by:
        hashCode in interface java.util.List<Curve>
        Overrides:
        hashCode in class AbstractGeomElement<LinearComboCurve>
        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<LinearComboCurve>
      • recycle

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