Package geomss.geom
Class LoftedSurface
- java.lang.Object
-
- geomss.geom.AbstractGeomElement<T>
-
- geomss.geom.AbstractSurface<LoftedSurface>
-
- geomss.geom.LoftedSurface
-
- All Implemented Interfaces:
GeomElement<LoftedSurface>,GeometryList<LoftedSurface,Curve>,ParametricGeometry<LoftedSurface>,Surface<LoftedSurface>,Transformable<LoftedSurface>,java.io.Serializable,java.lang.Cloneable,java.lang.Comparable,java.lang.Iterable<Curve>,java.util.Collection<Curve>,java.util.List<Curve>,javolution.lang.Reusable,javolution.xml.XMLSerializable
public class LoftedSurface extends AbstractSurface<LoftedSurface> implements GeometryList<LoftedSurface,Curve>
Represents a "lofted" or "skinned" surface defined from a list of definingcurvesthat each define a cross-section of the surface. Each curve defines the local parameterization in the "s" direction and the spacing between them defines the parameterization in the "t" direction. Any number of curves may be added to a lofted surface, but all curves must have the same physical dimensions.Modified by: Joseph A. Huwaldt
- Version:
- February 16, 2025
- Author:
- Joseph A. Huwaldt, Date: June 24, 2010
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class geomss.geom.AbstractSurface
GTOL
-
Fields inherited from class geomss.geom.AbstractGeomElement
RESOURCES
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, Curve value)Inserts the specifiedCurveat the specified position in this list.booleanadd(int index, Curve... array)Inserts all of theCurveobjects in the specified list of arguments into this list at the specified position.booleanadd(Curve value)Appends the specifiedCurveto the end of this surface's list of curves.booleanadd(Curve... array)Appends all of the elements in the specified list of arguments to this geometry element list.booleanaddAll(int index, Curve[] arr)Inserts all of theCurveobjects in the specified array into this list at the specified position.booleanaddAll(int index, java.util.Collection<? extends Curve> c)Inserts all of the curves in the specified collection into this surface at the specified position.booleanaddAll(Curve[] arr)Appends all of the curves in the specified array to this LoftedSurface.booleanaddAll(java.util.Collection<? extends Curve> c)Adds all of the curves in the specified collection to this surface.voidclear()Removes all of the curves from this surface.booleancontains(java.lang.Object o)Returns true if this collection contains the specified element.booleancontainsAll(java.util.Collection<?> c)Returns true if this collection contains all of the elements in the specified collection.booleancontainsGeometry()Returnstrueif this list actually contains any curves andfalseif this list is empty.LoftedSurfacecopy()Returns a copy of thisLoftedSurfaceinstanceallocatedby the calling thread (possibly on the stack).LoftedSurfacecopyToReal()Return a copy of this object with any transformations or subranges removed (applied).booleanequals(java.lang.Object obj)Compares the specified object with this list ofCurveobjects for equality.Curveget(int index)Returns the Curve at the specified position in this surface's list of curves.Curveget(java.lang.String name)Returns theCurvewith the specified name from this list.GeomList<Curve>getAll()Returns an newGeomListwith the elements in this list.PointgetBoundsMax()Return the coordinate point representing the maximum bounding box corner (e.g.: max X, max Y, max Z).PointgetBoundsMin()Return the coordinate point representing the minimum bounding box corner of this geometry element (e.g.: min X, min Y, min Z).CurvegetFirst()Returns the first curve from this surface's list of curves.intgetIndexFromName(java.lang.String name)Return the index to the 1st Curve in this list with the specified name.CurvegetLast()Returns the last curve from this surface's list of curves.intgetPhyDimension()Returns the number of physical dimensions of the geometry element.LoftedSurfacegetRange(int first, int last)Returns the range of Curves in this surface from the specified start and ending indexes as a new LoftedSurface.PointgetRealPoint(double s, double t)Calculate a point on the surface for the given parametric position on the surface.CurvegetS0Curve()Return the S=0 Boundary for this surface as a curve.CurvegetS1Curve()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 from0togradewith respect to parametric s-position on the surface for the given parametric position on the surface,d^{grade}p(s,t)/d^{grade}s.CurvegetT0Curve()Return the T=0 Boundary for this surface as a curve.CurvegetT1Curve()Return the T=1 Boundary for this surface as a curve.intgetTDegree()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 from0togradewith respect to parametric t-position on the surface for the given parametric position on the surface,d^{grade}p(s,t)/d^{grade}t.LoftedSurfacegetTransformed(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.inthashCode()Returns the hash code for thisLoftedSurface.intindexOf(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.booleanisDegenerate(Parameter<javax.measure.quantity.Length> tol)Returntrueif this surface is degenerate (i.e.: has area less than the specified tolerance squared).booleanisEmpty()Returnstrueif this collection contains no elements.booleanisValid()Returntrueif 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.intlastIndexOf(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 LoftedSurfacenewInstance(int q)Returns a new, empty, preallocated or recycledLoftedSurfaceinstance (on the stack when executing in aStackContext), that can store a list ofCurveobjects.static LoftedSurfacenewInstance(java.lang.String name, int q)Returns a new, empty, preallocated or recycledLoftedSurfaceinstance (on the stack when executing in aStackContext) with the specified name, that can store a list ofCurveobjects.static voidrecycle(LoftedSurface instance)Recycles a case instance immediately (on the stack when executing in a StackContext).Curveremove(int index)Removes the curve at the specified position in this surface's list of curves.booleanremove(java.lang.Object o)Removes a single instance of the specified element from this collection, if it is present.Curveremove(java.lang.String name)Removes the curve with the specified name from this list.booleanremoveAll(java.util.Collection<?> c)Removes from this list all the elements that are contained in the specified collection.voidreset()Resets the internal state of this object to its default values.booleanretainAll(java.util.Collection<?> c)Retains only the elements in this list that are contained in the specified collection.LoftedSurfacereverse()Returns an newLoftedSurfacewith the curves in this surface in reverse order.LoftedSurfacereverseS()Return a new surface that is identical to this one, but with the S-parameterization reversed.LoftedSurfacereverseT()Return a new surface that is identical to this one, but with the T-parameterization reversed.Curveset(int index, Curve element)Replaces the Curve at the specified position in this surface's list of curves with the specified element.intsize()Returns the number of elements in this surface (the number of defining curves that make up this surface).GeomList<LoftedSurface>splitAtS(double s)Split thisLoftedSurfaceat 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.LoftedSurfaceto(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.LoftedSurfacetoDimension(int newDim)Return the equivalent of this surface converted to the specified number of physical dimensions.NurbsSurfacetoNurbs(Parameter<javax.measure.quantity.Length> tol)Return a NURBS surface representation of this surface to within the specified tolerance.javolution.text.TexttoText()Returns the text representation of this geometry element.LoftedSurfacetranspose()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 LoftedSurfacevalueOf(int q, Curve... curves)Return a LoftedSurface made up of theCurveobjects in the specified array.static LoftedSurfacevalueOf(int q, java.util.Collection<? extends Curve> curves)Return a LoftedSurface made up of theCurveobjects in the specified collection.static LoftedSurfacevalueOf(java.lang.String name, int q, Curve... curves)Return a LoftedSurface made up of theCurveobjects in the specified array.static LoftedSurfacevalueOf(java.lang.String name, int q, java.util.Collection<? extends Curve> curves)Return a LoftedSurface made up of theCurveobjects in the specified collection.-
Methods inherited from class geomss.geom.AbstractSurface
extractGrid, getArea, getArea, getArea, getClosest, getClosest, getClosest, getClosest, getClosest, getClosest, getCurve, getDerivatives, getFarthest, getFarthest, getFarthest, getGaussianCurvature, getGaussianCurvature, getLimitPoint, getMeanCurvature, getMeanCurvature, getNormal, getNormal, getParDimension, getPoint, getPoint, getRealPoint, getSCurve, getSDerivative, getSDerivative, getSDerivatives, getSDerivatives, getTangentPlane, getTangentPlane, getTCurve, getTDerivative, getTDerivative, getTDerivatives, getTDerivatives, getTwistVector, getVolume, getVolume, getVolume, gridToTolerance, intersect, intersect, intersect, intersect, intersect, isPlanar, isPlanar, splitAtS, splitAtT
-
Methods inherited from class geomss.geom.AbstractGeomElement
addChangeListener, clone, compareTo, getAllUserData, getID, getName, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, setName, toString
-
Methods inherited from interface geomss.geom.GeomElement
addChangeListener, getAllUserData, getID, getLimitPoint, getName, getParDimension, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, setName
-
-
-
-
Method Detail
-
newInstance
public static LoftedSurface newInstance(int q)
Returns a new, empty, preallocated or recycledLoftedSurfaceinstance (on the stack when executing in aStackContext), that can store a list ofCurveobjects. 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 recycledLoftedSurfaceinstance (on the stack when executing in aStackContext) with the specified name, that can store a list ofCurveobjects. The list is initially empty and therefore the surface is initially undefined.- Parameters:
name- The name to be assigned to this surface (may benull).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 theCurveobjects in the specified collection.- Parameters:
name- The name to be assigned to this surface (may benull).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 theCurveobjects 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 theCurveobjects in the specified array.- Parameters:
name- The name to be assigned to this surface (may benull).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 theCurveobjects 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:
getRealPointin interfaceSurface<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 from0togradewith 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:
getSDerivativesin classAbstractSurface<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- Passtruefor properly scaled derivatives orfalseif 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 from0togradewith 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:
getTDerivativesin classAbstractSurface<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- Passtruefor properly scaled derivatives orfalseif 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:
getTwistVectorin interfaceSurface<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.
-
getT0Curve
public Curve getT0Curve()
Return the T=0 Boundary for this surface as a curve.- Specified by:
getT0Curvein interfaceSurface<LoftedSurface>- Returns:
- The T=0 Boundary for this surface as a curve.
-
getT1Curve
public Curve getT1Curve()
Return the T=1 Boundary for this surface as a curve.- Specified by:
getT1Curvein interfaceSurface<LoftedSurface>- Returns:
- The T=1 Boundary for this surface as a curve.
-
getS0Curve
public Curve getS0Curve()
Return the S=0 Boundary for this surface as a curve.- Specified by:
getS0Curvein interfaceSurface<LoftedSurface>- Returns:
- The S=0 Boundary for this surface as a curve.
-
getS1Curve
public Curve getS1Curve()
Return the S=1 Boundary for this surface as a curve.- Specified by:
getS1Curvein interfaceSurface<LoftedSurface>- Returns:
- The S=1 Boundary for this surface as a curve.
-
getPhyDimension
public int getPhyDimension()
Returns the number of physical dimensions of the geometry element. This implementation always returns the physical dimension of the underlyingCurveobjects or 0 if this list has no Curve objects in it.- Specified by:
getPhyDimensionin interfaceGeomElement<LoftedSurface>- Returns:
- The number of physical dimensions of the geometry element.
-
unmodifiableList
public java.util.List<Curve> unmodifiableList()
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:
unmodifiableListin interfaceGeometryList<LoftedSurface,Curve>- Returns:
- the unmodifiable view over this list of curves.
-
isEmpty
public boolean isEmpty()
Returnstrueif this collection contains no elements.
-
containsGeometry
public boolean containsGeometry()
Returnstrueif this list actually contains any curves andfalseif this list is empty.- Specified by:
containsGeometryin interfaceGeometryList<LoftedSurface,Curve>- Returns:
- true if this list actually contains geometry.
-
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:
sizein interfacejava.util.Collection<Curve>- Specified by:
sizein interfaceGeomElement<LoftedSurface>- Specified by:
sizein interfacejava.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:
getin interfacejava.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()
-
getFirst
public Curve getFirst()
Returns the first curve from this surface's list of curves.- Specified by:
getFirstin interfaceGeometryList<LoftedSurface,Curve>- Returns:
- the first curve in this list.
-
getLast
public Curve getLast()
Returns the last curve from this surface's list of curves.- Specified by:
getLastin interfaceGeometryList<LoftedSurface,Curve>- Returns:
- the last curve in this list.
-
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:
getRangein interfaceGeometryList<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 theCurvewith the specified name from this list.- Specified by:
getin interfaceGeometryList<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
nullis returned.
-
subList
public java.util.List<Curve> subList(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 forindexOfandlastIndexOf, and all of the algorithms in theCollectionsclass 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:
subListin interfacejava.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()
-
getAll
public GeomList<Curve> getAll()
Returns an newGeomListwith the elements in this list.- Specified by:
getAllin interfaceGeometryList<LoftedSurface,Curve>- Returns:
- A new GeomList with the elements in this list.
-
reverse
public LoftedSurface reverse()
Returns an newLoftedSurfacewith the curves in this surface in reverse order. This is identical to "reverseT()".- Specified by:
reversein interfaceGeometryList<LoftedSurface,Curve>- Returns:
- A new LoftedSurface with the curves in this surface in reverse order.
- See Also:
reverseT()
-
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:
indexOfin interfacejava.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:
lastIndexOfin interfacejava.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)).
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
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:
getIndexFromNamein interfaceGeometryList<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 specifiedCurveat 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:
addin interfacejava.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- ifindex > size()DimensionException- if the input value dimensions are different from this list's dimensions.
-
add
public boolean add(Curve value)
Appends the specifiedCurveto 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:
addin interfacejava.util.Collection<Curve>- Specified by:
addin interfacejava.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:
addin interfaceGeometryList<LoftedSurface,Curve>- Parameters:
array- elements to be inserted into this collection. May not be null.- Returns:
trueif 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 theCurveobjects 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:
addin interfaceGeometryList<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:
trueif 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:
addAllin interfacejava.util.Collection<Curve>- Specified by:
addAllin interfacejava.util.List<Curve>- Parameters:
c- curves to be inserted into this surface. May not be null.- Returns:
trueif 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:
addAllin interfacejava.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:
trueif 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:
addAllin interfaceGeometryList<LoftedSurface,Curve>- Parameters:
arr- curves to be appended onto this collection. May not be null.- Returns:
trueif 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 theCurveobjects 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:
addAllin interfaceGeometryList<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:
trueif 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:
setin interfacejava.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- - ifindex > 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.
-
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.
-
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).
-
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:
removein interfacejava.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:
removein interfaceGeometryList<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.
-
iterator
public java.util.Iterator<Curve> iterator()
Returns an iterator over the curves in this surface's list of curves.
-
listIterator
public java.util.ListIterator<Curve> listIterator()
Returns a list iterator over the curves in this surface.- Specified by:
listIteratorin interfacejava.util.List<Curve>- Returns:
- an iterator over this list values.
-
listIterator
public java.util.ListIterator<Curve> listIterator(int index)
Returns a list iterator from the specified position.- Specified by:
listIteratorin interfacejava.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.
-
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:
toArrayin interfacejava.util.Collection<Curve>- Specified by:
toArrayin interfacejava.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:
reverseTin interfaceSurface<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:
reverseSin interfaceSurface<LoftedSurface>- Returns:
- A new surface that is identical to this one, but with the S-parameterization reversed.
- See Also:
reverseT()
-
transpose
public LoftedSurface transpose()
Return a new surface that is identical to this one but with the transpose of the parameterization of this surface. The S and T directions will be swapped.- Specified by:
transposein interfaceSurface<LoftedSurface>- Overrides:
transposein classAbstractSurface<LoftedSurface>- Returns:
- A new surface that is identical to this one but with the transpose of the parameterization of this surface.
- See Also:
reverseT(),reverseS()
-
splitAtS
public GeomList<LoftedSurface> splitAtS(double s)
Split thisLoftedSurfaceat 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:
splitAtSin interfaceSurface<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<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). 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:
splitAtTin interfaceSurface<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:
toNurbsin interfaceSurface<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()
Returntrueif this LoftedSurface contains valid and finite numerical components. A value offalsewill be returned if any of the member curves are not valid.- Specified by:
isValidin interfaceGeomElement<LoftedSurface>- Returns:
- true if this LoftedSurface contains valid and finite numerical components.
-
isDegenerate
public boolean isDegenerate(Parameter<javax.measure.quantity.Length> tol)
Returntrueif this surface is degenerate (i.e.: has area less than the specified tolerance squared).- Specified by:
isDegeneratein interfaceParametricGeometry<LoftedSurface>- Specified by:
isDegeneratein interfaceSurface<LoftedSurface>- Overrides:
isDegeneratein classAbstractSurface<LoftedSurface>- Parameters:
tol- The tolerance for determining if this surface is degenerate. May not be null.- Returns:
- true if this surface is degenerate (i.e.: has area less than the specified tolerance squared).
-
copy
public LoftedSurface copy()
Returns a copy of thisLoftedSurfaceinstanceallocatedby the calling thread (possibly on the stack).- Specified by:
copyin interfaceGeomElement<LoftedSurface>- Specified by:
copyin interfaceParametricGeometry<LoftedSurface>- Specified by:
copyin interfaceSurface<LoftedSurface>- Returns:
- an identical and independent copy of this object.
-
copyToReal
public LoftedSurface copyToReal()
Return a copy of this object with any transformations or subranges removed (applied).- Specified by:
copyToRealin interfaceGeomElement<LoftedSurface>- Returns:
- A copy of this object with any transformations or subranges removed.
-
getTransformed
public LoftedSurface getTransformed(GTransform transform)
Returns a transformed version of this element. The returned list of objects implementGeomTransformand contains transformed versions of the contents of this list as children.- Specified by:
getTransformedin interfaceTransformable<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:
getBoundsMinin interfaceGeomElement<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:
getBoundsMaxin interfaceGeomElement<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:
getUnitin interfaceGeomElement<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:
toin interfaceGeomElement<LoftedSurface>- Specified by:
toin interfaceGeometryList<LoftedSurface,Curve>- Specified by:
toin interfaceParametricGeometry<LoftedSurface>- Specified by:
toin interfaceSurface<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:
toDimensionin interfaceGeomElement<LoftedSurface>- Specified by:
toDimensionin interfaceGeometryList<LoftedSurface,Curve>- Specified by:
toDimensionin interfaceParametricGeometry<LoftedSurface>- Specified by:
toDimensionin interfaceSurface<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 ofCurveobjects 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:
equalsin interfacejava.util.Collection<Curve>- Specified by:
equalsin interfacejava.util.List<Curve>- Overrides:
equalsin classAbstractGeomElement<LoftedSurface>- Parameters:
obj- the object to compare with.- Returns:
trueif this list is identical to that list;falseotherwise.
-
hashCode
public int hashCode()
Returns the hash code for thisLoftedSurface.- Specified by:
hashCodein interfacejava.util.Collection<Curve>- Specified by:
hashCodein interfacejava.util.List<Curve>- Overrides:
hashCodein classAbstractGeomElement<LoftedSurface>- Returns:
- the hash code value.
-
toText
public javolution.text.Text toText()
Returns the text representation of this geometry element.- Specified by:
toTextin interfaceGeomElement<LoftedSurface>- Overrides:
toTextin classAbstractGeomElement<LoftedSurface>- Returns:
- The text representation of this geometry element.
-
reset
public void reset()
Resets the internal state of this object to its default values. Subclasses that override this method must callsuper.reset();to ensure that the state is reset properly.- Specified by:
resetin interfacejavolution.lang.Reusable- Overrides:
resetin classAbstractGeomElement<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.
-
-