Package geomss.geom
Interface GeomElement<T extends GeomElement>
-
- Type Parameters:
T
- The type of this geometry element.
- All Superinterfaces:
java.lang.Cloneable
,java.lang.Comparable
,java.io.Serializable
,javolution.xml.XMLSerializable
- All Known Subinterfaces:
Curve<T>
,GeometryList<T,E>
,GeomTransform<T>
,LinearCombination<T,E>
,ParametricGeometry<T>
,PointGeometry<T>
,Surface<T>
,Transformable<T>
- All Known Implementing Classes:
AbstractCurve
,AbstractGeomElement
,AbstractGeomList
,AbstractNote
,AbstractPointGeomList
,AbstractSurface
,BasicCSTCurve
,BasicNurbsCurve
,BasicNurbsSurface
,CSTCurve
,CSTCurveTrans
,GenModelNote
,GenScreenNote
,GeomList
,GeomPlane
,GeomPlaneTrans
,GeomPoint
,GeomPointTrans
,GeomTriangle
,GeomVector
,LinearComboCurve
,LineSeg
,LineSegment
,LineSegTrans
,LoftedSurface
,ModelNote
,ModelNoteTrans
,MutablePoint
,MutableVector
,Note
,NoteTrans
,NurbsCurve
,NurbsCurveTrans
,NurbsSurface
,NurbsSurfaceTrans
,Plane
,Point
,PointArray
,PointComponent
,PointString
,PointVehicle
,SubrangeCurve
,SubrangePoint
,SubrangeSurface
,TFISurface
,Triangle
,TriangleList
,TriangleTrans
,Vector
,VectorTrans
public interface GeomElement<T extends GeomElement> extends java.lang.Cloneable, java.lang.Comparable, javolution.xml.XMLSerializable
Defines the interface in common to all geometry elements.Modified by: Joseph A. Huwaldt
- Version:
- February 17, 2025
- Author:
- Joseph A. Huwaldt, Date: March 31, 2000
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addChangeListener(javax.swing.event.ChangeListener listener)
Add a listener that is notified of changes to the state of this element.T
copy()
Returns a copy of this GeomElement instanceallocated
by the calling thread (possibly on the stack).T
copyToReal()
Return a copy of this object with any transformations or subranges removed (applied).java.util.Map
getAllUserData()
Returns a new Map containing all the user objects associated with this geometry element.Point
getBoundsMax()
Return the coordinate point representing the maximum bounding box corner of this geometry element (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).long
getID()
Return the unique ID number of this geometry element.GeomPoint
getLimitPoint(int dim, boolean max, double tol)
Returns the most extreme point, either minimum or maximum, in the specified coordinate direction on this geometry element.java.lang.String
getName()
Return the name of this geometry element.int
getParDimension()
Returns the number of parametric dimensions of this geometry element.int
getPhyDimension()
Returns the number of physical dimensions of this geometry element.javax.measure.unit.Unit<javax.measure.quantity.Length>
getUnit()
Returns the unit in which the geometry in this element are stated.java.lang.Object
getUserData(java.lang.Object key)
Return any user defined object associated with this geometry element and the specified key.boolean
isValid()
Returntrue
if this GeomElement contains valid and finite numerical components.void
putAllUserData(java.util.Map data)
Add all the user defined data in the supplied Map to this objects map of user defined data.void
putUserData(java.lang.Object key, java.lang.Object value)
Set the user defined object associated with this geometry element and the specified key.void
removeChangeListener(javax.swing.event.ChangeListener listener)
Remove a listener from receiving notifications of changes to the state of this element.void
removeUserData(java.lang.Object key)
Removes the entry for the specified user object key if present.void
setName(java.lang.String name)
Change the name of this geometry element to the specified name (may benull
to clear the name and make it undefined).int
size()
Returns the number of child-elements that make up this geometry element.T
to(javax.measure.unit.Unit<javax.measure.quantity.Length> unit)
Returns the equivalent to this element but stated in the specified unit.T
toDimension(int newDim)
Return a copy of this element converted to the specified number of physical dimensions.javolution.text.Text
toText()
Returns the text representation of this geometry element.
-
-
-
Method Detail
-
getID
long getID()
Return the unique ID number of this geometry element.- Returns:
- The unique ID of this geometry element.
-
getName
java.lang.String getName()
Return the name of this geometry element. If the name is not defined, thennull
is returned.- Returns:
- The name of this geometry element.
-
setName
void setName(java.lang.String name)
Change the name of this geometry element to the specified name (may benull
to clear the name and make it undefined).- Parameters:
name
- The name of this geometry element.
-
size
int size()
Returns the number of child-elements that make up this geometry element.- Returns:
- The number of child-elements that make up this geometry element.
-
toText
javolution.text.Text toText()
Returns the text representation of this geometry element.- Returns:
- The text representation of this geometry element.
-
getPhyDimension
int getPhyDimension()
Returns the number of physical dimensions of this geometry element.- Returns:
- The number of physical dimensions of this geometry element.
-
toDimension
T toDimension(int newDim)
Return a copy of this element 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.- Parameters:
newDim
- The dimension of the element to return.- Returns:
- A copy of this geometry element converted to the new dimensions.
-
getParDimension
int getParDimension()
Returns the number of parametric dimensions of this geometry element.- Returns:
- The number of parametric dimensions of this geometry element.
-
getBoundsMin
Point getBoundsMin()
Return the coordinate point representing the minimum bounding box corner of this geometry element (e.g.: min X, min Y, min Z).- Returns:
- The minimum bounding box coordinate for this geometry element.
-
getBoundsMax
Point getBoundsMax()
Return the coordinate point representing the maximum bounding box corner of this geometry element (e.g.: max X, max Y, max Z).- Returns:
- The maximum bounding box coordinate for this geometry element.
-
getLimitPoint
GeomPoint getLimitPoint(int dim, boolean max, double tol)
Returns the most extreme point, either minimum or maximum, in the specified coordinate direction on this geometry element. This is more accurate thangetBoundsMax
&getBoundsMin
, but also typically takes longer to compute.- Parameters:
dim
- An index indicating the dimension to find the min/max point for (0=X, 1=Y, 2=Z, etc).max
- Set totrue
to return the maximum value,false
to return the minimum.tol
- Fractional tolerance to refine the min/max point position to if necessary.- Returns:
- The point found on this element that is the min or max in the specified coordinate direction.
- See Also:
getBoundsMin()
,getBoundsMax()
-
isValid
boolean isValid()
Returntrue
if this GeomElement contains valid and finite numerical components. A value offalse
will be returned if any of the evaluations of this element are NaN or Inf.- Returns:
- true if this geometry element contains valid and finite data.
-
getUnit
javax.measure.unit.Unit<javax.measure.quantity.Length> getUnit()
Returns the unit in which the geometry in this element are stated.- Returns:
- The unit in which the geometry in this element are stated.
-
to
T to(javax.measure.unit.Unit<javax.measure.quantity.Length> unit) throws javax.measure.converter.ConversionException
Returns the equivalent to this element but stated in the specified unit.- Parameters:
unit
- the length unit of the element to be returned.- Returns:
- an equivalent to this element but stated in the specified unit.
- Throws:
javax.measure.converter.ConversionException
- if the the input unit is not a length unit.
-
copy
T copy()
Returns a copy of this GeomElement instanceallocated
by the calling thread (possibly on the stack).- Returns:
- an identical and independent copy of this object.
-
copyToReal
T copyToReal()
Return a copy of this object with any transformations or subranges removed (applied).- Returns:
- A copy of this object with any transformations removed (applied).
-
getUserData
java.lang.Object getUserData(java.lang.Object key)
Return any user defined object associated with this geometry element and the specified key. If there is no user data with the specified key, thennull
is returned.- Parameters:
key
- the key whose associated value is to be returned ornull
if the specified key could not be found.- Returns:
- Any user defined data associated with this geometry and the specified key.
- Throws:
java.lang.NullPointerException
- ifkey
isnull
.
-
getAllUserData
java.util.Map getAllUserData()
Returns a new Map containing all the user objects associated with this geometry element.- Returns:
- A new Map containing all the user objects associated with this geometry element.
-
putUserData
void putUserData(java.lang.Object key, java.lang.Object value)
Set the user defined object associated with this geometry element and the specified key. This can be used to store any type of information with a geometry element that could be useful.- Parameters:
key
- the key with which the specified value is to be associated.value
- the value to be associated with the specified key.- Throws:
java.lang.NullPointerException
- if thekey
isnull
.
-
putAllUserData
void putAllUserData(java.util.Map data)
Add all the user defined data in the supplied Map to this objects map of user defined data.- Parameters:
data
- The Map of user defined data to be added to this object's map of user defined data.
-
removeUserData
void removeUserData(java.lang.Object key)
Removes the entry for the specified user object key if present.- Parameters:
key
- the key whose mapping is to be removed from the map.- Throws:
java.lang.NullPointerException
- if thekey
isnull
.
-
addChangeListener
void addChangeListener(javax.swing.event.ChangeListener listener)
Add a listener that is notified of changes to the state of this element.- Parameters:
listener
- The listener to be notified of changes to the state of this element.
-
removeChangeListener
void removeChangeListener(javax.swing.event.ChangeListener listener)
Remove a listener from receiving notifications of changes to the state of this element.- Parameters:
listener
- The listener to be removed from those being notified of changes to the state of this element.
-
-