CompositionDrawer

class CompositionDrawer(documentBounds: CompositionDimensions, composition: Composition?, cursor: GroupNode?)

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

Constructors

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

Functions

circle
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?
circles
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?>
composition
Link copied to clipboard
fun composition(composition: Composition): CompositionNode
contour
Link copied to clipboard
fun contour(contour: ShapeContour, insert: Boolean = true): ShapeNode?
contours
Link copied to clipboard
fun contours(contours: List<ShapeContour>, insert: Boolean = true): List<ShapeNode?>
difference
Link copied to clipboard
fun difference(shape: Shape, searchFrom: CompositionNode = composition.root as GroupNode): Shape
distances
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)

duplicate
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.

group
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

image
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

intersections
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

isolated
Link copied to clipboard
fun isolated(draw: CompositionDrawer.() -> Unit)
lineLoop
Link copied to clipboard
fun lineLoop(points: List<Vector2>, insert: Boolean = true): ShapeNode?
lineSegment
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?
lineSegments
Link copied to clipboard
fun lineSegments(lineSegments: List<LineSegment>, insert: Boolean = true): List<ShapeNode?>
lineStrip
Link copied to clipboard
fun lineStrip(points: List<Vector2>, insert: Boolean = true): ShapeNode?
nearest
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

popModel
Link copied to clipboard
fun popModel()
popStyle
Link copied to clipboard
fun popStyle()
pushModel
Link copied to clipboard
fun pushModel()
pushStyle
Link copied to clipboard
fun pushStyle()
rectangle
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?
rectangles
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?>
rotate
Link copied to clipboard
fun rotate(rotationInDegrees: Double)
fun CompositionNode.rotate(angleInDegrees: Double, pivot: Vector2 = Vector2.ZERO)
scale
Link copied to clipboard
fun scale(s: Double)
fun scale(x: Double, y: Double)
fun CompositionNode.scale(scale: Double, pivot: Vector2 = Vector2.ZERO)
shape
Link copied to clipboard
fun shape(shape: Shape, insert: Boolean = true): ShapeNode?
shapes
Link copied to clipboard
fun shapes(shapes: List<Shape>, insert: Boolean = true): List<ShapeNode?>
text
Link copied to clipboard
fun text(text: String, position: Vector2, insert: Boolean = true): TextNode
textOnContour
Link copied to clipboard
fun textOnContour(text: String, contour: ShapeContour, insert: Boolean = true): TextNode
texts
Link copied to clipboard
fun texts(text: List<String>, positions: List<Vector2>): List<TextNode>
transform
Link copied to clipboard
fun CompositionNode.transform(builder: TransformBuilder.() -> Unit)
translate
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)
with
Link copied to clipboard
fun GroupNode.with(builder: CompositionDrawer.() -> Unit): GroupNode

Properties

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