Package spacefiller.shapemapper
Class ShapeMapper
java.lang.Object
spacefiller.shapemapper.ShapeMapper
Top level class for the Shape Mapper library. Allows configuration of
mapped shapes and control over the Shape Mapper GUI.
-
Constructor Summary
ConstructorDescriptionShapeMapper
(processing.core.PApplet parent) Initialize the library with no starting shape.ShapeMapper
(processing.core.PApplet parent, processing.core.PShape shape) Initialize the library with a single shape. -
Method Summary
Modifier and TypeMethodDescriptionAdd the passed shape, assigning it the passed name, and attaching 1 mapping.Add the passed shape, assigning it the passed name, and attaching the provided number of mappings.addShape
(processing.core.PShape shape) Add the passed shape with the default name and attaching 1 mapping.void
Apply the estimated projection mapping.void
Switch to calibration mode.void
Clear all calibration data from memory and disk.void
Stop applying the estimated projection mappping.Returns all the shapes currently managed by library.void
hideGui()
Hide the library GUI.void
Switch to render mode.void
showGui()
Show the library GUI.
-
Constructor Details
-
ShapeMapper
public ShapeMapper(processing.core.PApplet parent) Initialize the library with no starting shape. Shapes can be subsequently added viaaddShape(PShape)
.- Parameters:
parent
-
-
ShapeMapper
public ShapeMapper(processing.core.PApplet parent, processing.core.PShape shape) Initialize the library with a single shape. The shape will have a single mapping automatically attached. If you want to create more than one mapping, useShapeMapper(PApplet)
followed byaddShape(String, PShape, int)
.- Parameters:
parent
-shape
-
-
-
Method Details
-
addShape
Add the passed shape with the default name and attaching 1 mapping.- Parameters:
shape
-- Returns:
-
addShape
Add the passed shape, assigning it the passed name, and attaching 1 mapping.- Parameters:
name
-shape
-- Returns:
-
addShape
Add the passed shape, assigning it the passed name, and attaching the provided number of mappings. These mappings can then be calibrated at runtime.- Parameters:
name
-shape
-mappings
-- Returns:
-
getShape
- Parameters:
name
-- Returns:
- Shape with the passed name, if it exists.
-
clearCalibrations
public void clearCalibrations()Clear all calibration data from memory and disk. -
calibrateMode
public void calibrateMode()Switch to calibration mode. Reveals the GUI and enabled key event listening. -
renderMode
public void renderMode()Switch to render mode. Disables GUI. -
getShapes
Returns all the shapes currently managed by library.- Returns:
-
hideGui
public void hideGui()Hide the library GUI. -
showGui
public void showGui()Show the library GUI. -
beginMapping
public void beginMapping()Apply the estimated projection mapping. Any calls to Processing graphics functions after a call tobeginMapping()
will be transformed according to the projection mapping. Note that you must also callendMapping()
after.This version of
beginMapping()
only works if you are mapping a single shape with a single projector. If you are mapping multiple shapes, then you must callMappedShape.beginMapping()
on each mapped shape individually. If you are mapping with multiple projectors, you must callMapping.beginMapping()
on each mapping separately. See example code packaged with the library or how-to docs for examples. -
endMapping
public void endMapping()Stop applying the estimated projection mappping.
-