CompositionDrawer

class CompositionDrawer(    documentBounds: CompositionDimensions = defaultCompositionDimensions,     composition: Composition? = null,     cursor: GroupNode? = composition?.root as? GroupNode)

A Drawer-like interface for the creation of Compositions This should be easier than creating Compositions manually

Constructors

Link copied to clipboard
fun CompositionDrawer(    documentBounds: CompositionDimensions = defaultCompositionDimensions,     composition: Composition? = null,     cursor: GroupNode? = composition?.root as? GroupNode)

Functions

Link copied to clipboard
fun circle(    circle: Circle,     closed: Boolean = true,     insert: Boolean = true): ShapeNode?
fun circle(    position: Vector2,     radius: Double,     closed: Boolean = true,     insert: Boolean = true): ShapeNode?
fun circle(    x: Double,     y: Double,     radius: Double,     closed: Boolean = true,     insert: Boolean = true): ShapeNode?
Link copied to clipboard
fun circles(circles: List<Circle>, insert: Boolean = true): List<ShapeNode?>
fun circles(    positions: List<Vector2>,     radius: Double,     insert: Boolean = true): List<ShapeNode?>
fun circles(    positions: List<Vector2>,     radii: List<Double>,     insert: Boolean = true): List<ShapeNode?>
Link copied to clipboard
fun composition(composition: Composition): CompositionNode
Link copied to clipboard
fun contour(contour: ShapeContour, insert: Boolean = true): ShapeNode?
Link copied to clipboard
fun contours(contours: List<ShapeContour>, insert: Boolean = true): List<ShapeNode?>
Link copied to clipboard
fun difference(shape: Shape, searchFrom: CompositionNode = composition.root as GroupNode): Shape
Link copied to clipboard
fun CompositionNode.distances(point: Vector2): List<ShapeNodeNearestContour>

fun distances(point: Vector2, searchFrom: CompositionNode = composition.root as GroupNode): List<ShapeNodeNearestContour>

Find distances to each contour in the composition tree (or starting node)

Link copied to clipboard
fun CompositionNode.duplicate(insert: Boolean = true): CompositionNode

Returns a deep copy of a CompositionNode. If insert is true the copy is inserted at cursor.

Link copied to clipboard
fun group(    insert: Boolean = true,     id: String? = null,     builder: CompositionDrawer.() -> Unit): GroupNode

Create a group node and run builder inside its context

Link copied to clipboard
fun image(    image: ColorBuffer,     x: Double = 0.0,     y: Double = 0.0,     insert: Boolean = true): ImageNode

Adds an image to the composition tree

Link copied to clipboard
fun CompositionNode.intersections(shape: Shape, mergeThreshold: Double = 0.5): List<ShapeNodeIntersection>
fun CompositionNode.intersections(contour: ShapeContour, mergeThreshold: Double = 0.5): List<ShapeNodeIntersection>

fun intersections(    shape: Shape,     searchFrom: CompositionNode = composition.root as GroupNode,     mergeThreshold: Double = 0.5): List<ShapeNodeIntersection>

Test a given shape against org.openrndr.shape.contours in the composition tree

fun intersections(    contour: ShapeContour,     searchFrom: CompositionNode = composition.root as GroupNode,     mergeThreshold: Double = 0.5): List<ShapeNodeIntersection>

Test a given contour against org.openrndr.shape.contours in the composition tree

Link copied to clipboard
fun isolated(draw: CompositionDrawer.() -> Unit)
Link copied to clipboard
fun lineLoop(points: List<Vector2>, insert: Boolean = true): ShapeNode?
Link copied to clipboard
fun lineSegment(lineSegment: LineSegment, insert: Boolean = true): ShapeNode?
fun lineSegment(    start: Vector2,     end: Vector2,     insert: Boolean = true): ShapeNode?
fun lineSegment(    startX: Double,     startY: Double,     endX: Double,     endY: Double,     insert: Boolean = true): ShapeNode?
Link copied to clipboard
fun lineSegments(lineSegments: List<LineSegment>, insert: Boolean = true): List<ShapeNode?>
Link copied to clipboard
fun lineStrip(points: List<Vector2>, insert: Boolean = true): ShapeNode?
Link copied to clipboard
fun CompositionNode.nearest(point: Vector2): ShapeNodeNearestContour?

fun nearest(point: Vector2, searchFrom: CompositionNode = composition.root as GroupNode): ShapeNodeNearestContour?

Search for a point on a contour in the composition tree that's nearest to point

Link copied to clipboard
fun popModel()
Link copied to clipboard
fun popStyle()
Link copied to clipboard
fun pushModel()
Link copied to clipboard
fun pushStyle()
Link copied to clipboard
fun rectangle(    rectangle: Rectangle,     closed: Boolean = true,     insert: Boolean = true): ShapeNode?
fun rectangle(    x: Double,     y: Double,     width: Double,     height: Double,     closed: Boolean = true,     insert: Boolean = true): ShapeNode?
Link copied to clipboard
fun rectangles(rectangles: List<Rectangle>, insert: Boolean = true): List<ShapeNode?>
fun rectangles(    positions: List<Vector2>,     dimensions: List<Vector2>,     insert: Boolean): List<ShapeNode?>
fun rectangles(    positions: List<Vector2>,     width: Double,     height: Double,     insert: Boolean = true): List<ShapeNode?>
Link copied to clipboard
fun rotate(rotationInDegrees: Double)
fun CompositionNode.rotate(angleInDegrees: Double, pivot: Vector2 = Vector2.ZERO)
Link copied to clipboard
fun scale(s: Double)
fun scale(x: Double, y: Double)
fun CompositionNode.scale(scale: Double, pivot: Vector2 = Vector2.ZERO)
Link copied to clipboard
fun segment(segment: Segment, insert: Boolean = true): ShapeNode?
fun segment(    start: Vector2,     end: Vector2,     insert: Boolean = true): ShapeNode?
fun segment(    start: Vector2,     c0: Vector2,     end: Vector2,     insert: Boolean = true): ShapeNode?
fun segment(    start: Vector2,     c0: Vector2,     c1: Vector2,     end: Vector2,     insert: Boolean = true): ShapeNode?
Link copied to clipboard
fun segments(segments: List<Segment>, insert: Boolean = true): List<ShapeNode?>
Link copied to clipboard
fun shape(shape: Shape, insert: Boolean = true): ShapeNode?
Link copied to clipboard
fun shapes(shapes: List<Shape>, insert: Boolean = true): List<ShapeNode?>
Link copied to clipboard
fun text(    text: String,     position: Vector2,     insert: Boolean = true): TextNode
Link copied to clipboard
fun textOnContour(    text: String,     contour: ShapeContour,     insert: Boolean = true): TextNode
Link copied to clipboard
fun texts(text: List<String>, positions: List<Vector2>): List<TextNode>
Link copied to clipboard
fun CompositionNode.transform(builder: TransformBuilder.() -> Unit)
Link copied to clipboard
fun translate(t: Vector2)
fun translate(x: Double, y: Double)
fun CompositionNode.translate(    x: Double,     y: Double,     z: Double = 0.0)
Link copied to clipboard
fun GroupNode.with(builder: CompositionDrawer.() -> Unit): GroupNode

Properties

Link copied to clipboard
var clipMode: ClipMode
Link copied to clipboard
val composition: Composition
Link copied to clipboard
var cursor: GroupNode
Link copied to clipboard
var fill: ColorRGBa?
Link copied to clipboard
var fillOpacity: Double
Link copied to clipboard
var lineCap: LineCap
Link copied to clipboard
var lineJoin: LineJoin
Link copied to clipboard
var mask: Shape?
Link copied to clipboard
var miterlimit: Double
Link copied to clipboard
var model: Matrix44
Link copied to clipboard
var opacity: Double
Link copied to clipboard
val root: GroupNode
Link copied to clipboard
var stroke: ColorRGBa?
Link copied to clipboard
var strokeOpacity: Double
Link copied to clipboard
var strokeWeight: Double
Link copied to clipboard
var transformMode: TransformMode
Link copied to clipboard
var visibility: Visibility

Sources

Link copied to clipboard