Skip to content

Edge

Under Construction

This documentation is auto-generated, and is a work in progress. Please see the source code at https://github.com/phetsims/kite/blob/main/js/ops/Edge.ts for the most up-to-date information.

Overview

Represents a segment in the graph (connects to vertices on both ends)

@author Jonathan Olson <jonathan.olson@colorado.edu>

Class Edge

import { Edge } from 'scenerystack/kite';

Instance Methods

serialize() : SerializedEdge

Returns an object form that can be turned back into a segment with the corresponding deserialize method.

dispose()

Removes references (so it can allow other objects to be GC'ed or pooled), and frees itself to the pool so it can be reused.

getOtherVertex( vertex : Vertex ) : Vertex

Returns the other vertex associated with an edge.

updateReferences()

Update possibly reversed vertex references (since they may be updated)

freeToPool()

Instance Properties

id : number

(readonly)

segment : Segment

Set in initialize, will be null when disposed (in pool)

startVertex : Vertex

endVertex : Vertex

signedAreaFragment

forwardHalf : HalfEdge

reversedHalf : HalfEdge

visited

Used for depth-first search

data : IntentionalAny

Available for arbitrary client usage. -- Keep JSONable

Static Properties

pool : Pool

Type SerializedEdge

import type { SerializedEdge } from 'scenerystack/kite';

Source Code

See the source for Edge.ts in the kite repository.