Record Class Winding
java.lang.Object
java.lang.Record
com.j3d.engine.scene.nodes.geometry.base.Winding
- Record Components:
first- The first point in the winding.second- The second point in the winding.third- The third point in the winding.
Represents a winding of three
GPoints, typically used to define a triangle or a face in 2D geometry.
This record provides utility methods for converting the winding to lists of points or vectors, reversing its order,
and generating a string representation.- Author:
- Lehlogonolo Poole
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether some other object is "equal to" this one.first()Returns the value of thefirstrecord component.inthashCode()Returns a hash code value for this object.private StringHelper method to get a truncated string representation of aGPoint's ID.normal()reverse()Creates a newWindingwith the order of its points reversed.second()Returns the value of thesecondrecord component.stream()third()Returns the value of thethirdrecord component.toList()Converts the winding into an ordered list of its constituentGPoints.toString()Returns a string representation of the winding, showing the truncated IDs of its constituent points in the format "[first_id -> second_id -> third_id]".Converts the winding into an ordered list of its constituentVector3pivots.
-
Field Details
-
Constructor Details
-
Method Details
-
toList
Converts the winding into an ordered list of its constituentGPoints.- Returns:
- A
Listcontaining the first, second, and third points of the winding in order.
-
toVector3List
Converts the winding into an ordered list of its constituentVector3pivots. -
reverse
Creates a newWindingwith the order of its points reversed. The new winding will have the third point as its first, the second point remaining as second, and the first point as its third.- Returns:
- A new
Windinginstance with the points in reverse order.
-
normal
-
id
Helper method to get a truncated string representation of aGPoint's ID.- Parameters:
point- TheGPointwhose ID is to be truncated.- Returns:
- A string representing the first three characters of the point's ID.
-
toString
Returns a string representation of the winding, showing the truncated IDs of its constituent points in the format "[first_id -> second_id -> third_id]". -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
stream
-
first
Returns the value of thefirstrecord component.- Returns:
- the value of the
firstrecord component
-
second
Returns the value of thesecondrecord component.- Returns:
- the value of the
secondrecord component
-
third
Returns the value of thethirdrecord component.- Returns:
- the value of the
thirdrecord component
-