VertexList

优质
小牛编辑
125浏览
2023-12-01

A doubly linked list of vertices.

Constructor

VertexList()

Creates a new instance of VertexList.

Properties

.head : VertexNode

Reference to the first vertex of the linked list. Default is null.

.tail : VertexNode

Reference to the last vertex of the linked list. Default is null.

Methods

.first () : VertexNode

Returns the head reference.

.last () : VertexNode

Returns the tail reference.

.clear () : VertexList

Clears the linked list.

.insertBefore ( target : Vertex, vertex : Vertex ) : VertexList

target - The target vertex. It's assumed that this vertex belongs to the linked list.
vertex - The vertex to insert.

Inserts a vertex before a target vertex.

.insertAfter ( target : Vertex, vertex : Vertex ) : VertexList

target - The target vertex. It's assumed that this vertex belongs to the linked list.
vertex - The vertex to insert.

Inserts a vertex after a target vertex.

.append ( vertex : Vertex ) : VertexList

vertex - The vertex to append.

Appends a vertex to the end of the linked list.

.appendChain ( vertex : Vertex ) : VertexList

vertex - The head vertex of a chain of vertices.

Appends a chain of vertices where the given vertex is the head.

.remove ( vertex : Vertex ) : VertexList

vertex - The vertex to remove.

Removes a vertex from the linked list.

.removeSubList ( a : Vertex, b : Vertex ) : VertexList

a - The head of the sublist.
b - The tail of the sublist.

Removes a sublist of vertices from the linked list.

.isEmpty () : Boolean

Returns true if the linked list is empty.

Source

examples/jsm/math/ConvexHull.js