JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.graph.geom.Outline Class Reference

Define a single continuous stroke by control vertices. More...

Inheritance diagram for com.jogamp.graph.geom.Outline:
Collaboration diagram for com.jogamp.graph.geom.Outline:

Public Member Functions

 Outline ()
 Create an outline defined by control vertices. More...
 
 Outline (final Outline src)
 Copy ctor. More...
 
 Outline (final Outline src, final Winding enforce)
 Copy ctor w/ enforced Winding. More...
 
final void setWinding (final Winding enforce)
 Sets Winding to this outline. More...
 
final Winding getWinding ()
 Returns the cached or computed winding of this Outlines polyline using VectorUtil#area(ArrayList). More...
 
boolean isComplex ()
 Returns cached or computed result if whether this Outlines polyline is a complex shape. More...
 
final int getVertexCount ()
 
final void addVertex (final Vertex vertex) throws NullPointerException
 Appends a vertex to the outline loop/strip. More...
 
final void addVertex (final int position, final Vertex vertex) throws NullPointerException, IndexOutOfBoundsException
 Insert the Vertex element at the given position to the outline loop/strip. More...
 
final void setVertex (final int position, final Vertex vertex) throws NullPointerException, IndexOutOfBoundsException
 Replaces the Vertex element at the given position. More...
 
final Vertex getVertex (final int index)
 
int getVertexIndex (final Vertex vertex)
 
final Vertex removeVertex (final int position) throws IndexOutOfBoundsException
 Removes the Vertex element at the given position. More...
 
final boolean isEmpty ()
 
final Vertex getLastVertex ()
 
final ArrayList< VertexgetVertices ()
 
final void setVertices (final ArrayList< Vertex > vertices)
 Use the given outline loop/strip. More...
 
final boolean isClosed ()
 
final boolean setClosed (final boolean closeTail)
 Ensure this outline is closed. More...
 
final Outline transform (final AffineTransform t)
 Return a transformed instance with all vertices are copied and transformed. More...
 
final AABBox getBounds ()
 
final int compareTo (final Outline other)
 Compare two outline's Bounding Box size. More...
 
boolean equals (final Object obj)
 
final int hashCode ()
 
String toString ()
 
void print (final PrintStream out)
 

Detailed Description

Define a single continuous stroke by control vertices.

The vertices define the shape of the region defined by this outline. The Outline can contain a list of off-curve and on-curve vertices which define curved regions.

Note: An outline should be closed to be rendered as a region.

See also
OutlineShape
Region

Definition at line 53 of file Outline.java.

Constructor & Destructor Documentation

◆ Outline() [1/3]

com.jogamp.graph.geom.Outline.Outline ( )

Create an outline defined by control vertices.

An outline can contain off Curve vertices which define curved regions in the outline.

Definition at line 70 of file Outline.java.

Here is the caller graph for this function:

◆ Outline() [2/3]

com.jogamp.graph.geom.Outline.Outline ( final Outline  src)

Copy ctor.

Definition at line 83 of file Outline.java.

◆ Outline() [3/3]

com.jogamp.graph.geom.Outline.Outline ( final Outline  src,
final Winding  enforce 
)

Copy ctor w/ enforced Winding.

If the enforced Winding doesn't match the source Outline, the vertices reversed copied into this new instance.

Parameters
srcthe source Outline
enforceWinding to be enforced on this copy

Definition at line 113 of file Outline.java.

Here is the call graph for this function:

Member Function Documentation

◆ addVertex() [1/2]

final void com.jogamp.graph.geom.Outline.addVertex ( final int  position,
final Vertex  vertex 
) throws NullPointerException, IndexOutOfBoundsException

Insert the Vertex element at the given position to the outline loop/strip.

Parameters
positionof the added Vertex
vertexVertex object to be added
Exceptions
NullPointerExceptionif the Vertex element is null
IndexOutOfBoundsExceptionif position is out of range (position < 0 || position > getVertexNumber())

Definition at line 220 of file Outline.java.

Here is the call graph for this function:

◆ addVertex() [2/2]

final void com.jogamp.graph.geom.Outline.addVertex ( final Vertex  vertex) throws NullPointerException

Appends a vertex to the outline loop/strip.

Parameters
vertexVertex to be added
Exceptions
NullPointerExceptionif the Vertex element is null

Definition at line 209 of file Outline.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compareTo()

final int com.jogamp.graph.geom.Outline.compareTo ( final Outline  other)

Compare two outline's Bounding Box size.

See also
AABBox::getSize()
java.lang.Comparable::compareTo(java.lang.Object)

Definition at line 361 of file Outline.java.

Here is the call graph for this function:

◆ equals()

boolean com.jogamp.graph.geom.Outline.equals ( final Object  obj)
Parameters
objthe Object to compare this Outline with
Returns
true if obj is an Outline, not null, equals bounds and equal vertices in the same order

Definition at line 378 of file Outline.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBounds()

final AABBox com.jogamp.graph.geom.Outline.getBounds ( )

Definition at line 348 of file Outline.java.

Here is the caller graph for this function:

◆ getLastVertex()

final Vertex com.jogamp.graph.geom.Outline.getLastVertex ( )

Definition at line 272 of file Outline.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getVertex()

final Vertex com.jogamp.graph.geom.Outline.getVertex ( final int  index)

Definition at line 248 of file Outline.java.

Here is the caller graph for this function:

◆ getVertexCount()

final int com.jogamp.graph.geom.Outline.getVertexCount ( )

Definition at line 200 of file Outline.java.

Here is the caller graph for this function:

◆ getVertexIndex()

int com.jogamp.graph.geom.Outline.getVertexIndex ( final Vertex  vertex)

Definition at line 252 of file Outline.java.

◆ getVertices()

final ArrayList< Vertex > com.jogamp.graph.geom.Outline.getVertices ( )

Definition at line 279 of file Outline.java.

Here is the caller graph for this function:

◆ getWinding()

final Winding com.jogamp.graph.geom.Outline.getWinding ( )

Returns the cached or computed winding of this Outlines polyline using VectorUtil#area(ArrayList).

The result is cached.

Returns
Winding#CCW or Winding#CW

Definition at line 167 of file Outline.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hashCode()

final int com.jogamp.graph.geom.Outline.hashCode ( )

Definition at line 400 of file Outline.java.

◆ isClosed()

final boolean com.jogamp.graph.geom.Outline.isClosed ( )

Definition at line 294 of file Outline.java.

◆ isComplex()

boolean com.jogamp.graph.geom.Outline.isComplex ( )

Returns cached or computed result if whether this Outlines polyline is a complex shape.

A polyline with less than 3 elements is marked a simple shape for simplicity.

The result is cached.

Definition at line 190 of file Outline.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isEmpty()

final boolean com.jogamp.graph.geom.Outline.isEmpty ( )

Definition at line 268 of file Outline.java.

Here is the caller graph for this function:

◆ print()

void com.jogamp.graph.geom.Outline.print ( final PrintStream  out)

Definition at line 409 of file Outline.java.

Here is the call graph for this function:

◆ removeVertex()

final Vertex com.jogamp.graph.geom.Outline.removeVertex ( final int  position) throws IndexOutOfBoundsException

Removes the Vertex element at the given position.

Sets the bounding box dirty, hence a next call to getBounds() will validate it.

Parameters
positionof the to be removed Vertex
Exceptions
IndexOutOfBoundsExceptionif position is out of range (position < 0 || position >= getVertexNumber())

Definition at line 262 of file Outline.java.

◆ setClosed()

final boolean com.jogamp.graph.geom.Outline.setClosed ( final boolean  closeTail)

Ensure this outline is closed.

Checks whether the last vertex equals to the first. If not equal, it either appends a copy of the first vertex or prepends a copy of the last vertex, depending on closeTail.

Parameters
closeTailif true, a copy of the first vertex will be appended, otherwise a copy of the last vertex will be prepended.
Returns
true if closing performed, otherwise false for NOP

Definition at line 309 of file Outline.java.

Here is the call graph for this function:

◆ setVertex()

final void com.jogamp.graph.geom.Outline.setVertex ( final int  position,
final Vertex  vertex 
) throws NullPointerException, IndexOutOfBoundsException

Replaces the Vertex element at the given position.

Sets the bounding box dirty, hence a next call to getBounds() will validate it.

Parameters
positionof the replaced Vertex
vertexreplacement Vertex object
Exceptions
NullPointerExceptionif the Outline element is null
IndexOutOfBoundsExceptionif position is out of range (position < 0 || position >= getVertexNumber())

Definition at line 239 of file Outline.java.

◆ setVertices()

final void com.jogamp.graph.geom.Outline.setVertices ( final ArrayList< Vertex vertices)

Use the given outline loop/strip.

Validates the bounding box.

Parameters
verticesthe new outline loop/strip

Definition at line 289 of file Outline.java.

◆ setWinding()

final void com.jogamp.graph.geom.Outline.setWinding ( final Winding  enforce)

Sets Winding to this outline.

If the enforced Winding doesn't match this Outline, the vertices are reversed.

Parameters
enforceto be enforced Winding

Definition at line 146 of file Outline.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toString()

String com.jogamp.graph.geom.Outline.toString ( )

Definition at line 404 of file Outline.java.

◆ transform()

final Outline com.jogamp.graph.geom.Outline.transform ( final AffineTransform  t)

Return a transformed instance with all vertices are copied and transformed.

Definition at line 329 of file Outline.java.

Here is the call graph for this function:

The documentation for this class was generated from the following file: