graph:add-vertex
List of: Scheme Extensions
Subjects: Graph Theory
Contents: Kernel

Action: Adds a vertex to a graph.

Filename: kern/kern_scm/graph_scm.cxx

Syntax: (graph:add-vertex in-graph in-name)

Arg Types: in-graph graph

in-name string

Returns: graph

Description: This adds the in-name string as a vertex in in-graph.


in-graph specifies a graph.


in-name is a string specifying the vertex that has to be added to the in-graph.

Example: ; graph:add-vertex

; Create a simple example

(define g1 (graph "me-you us-them"))

;; g1

; Add a vertex.

(define g2 (graph:add-vertex g1 "NEW_ONE"))

;; g2

; CAREFUL: The order of the graph output may

; not be the same each time.

; Create an example using entities.

(define b1 (solid:block (position -5 -10 -20)


(position 5 10 15)))

;; b1

(define faces1 (entity:faces b1))

;; faces1

; Turn the block faces into vertices of the graph.

(define g3 (graph faces1))

;; g3

; Add a vertex.

(define g4 (graph:add-vertex g3 "NEW_ONE"))

;; g4
PDF/KERN/13SCF.PDF
HTM/DATA/KERN/KERN/13SCF/0030.HTM