Package ixagon.surface.mapper
Interface SuperSurface
-
- All Known Implementing Classes:
BezierSurface
,QuadSurface
public interface SuperSurface
-
-
Field Summary
Fields Modifier and Type Field Description static int
BEZIER
static int
DEFAULT_SIZE
static int
QUAD
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clearSurfaceMask()
void
decreaseHorizontalForce()
Decrease the amount of horizontal displacement force used for spherical mapping for bezier surfaces.void
decreaseResolution()
Decrease the amount of subdivisionvoid
decreaseVerticalForce()
Decrease the amount of horizontal displacement force used for spherical mapping for bezier surfaces.int
getActiveBezierPointIndex(int mX, int mY)
Returns index 0-7 if coordinates are on a bezier controlint
getActiveCornerPointIndex(int mX, int mY)
Returns index 0-3 if coordinates are near a corner or index -2 if on a surfaceint
getActivePoint()
Get the index of active corner (or surface)double
getArea()
Calculates and returns the surfaces area in squarepixels.Point3D
getBezierPoint(int index)
Get target Bezier control pointfloat
getBlendLeftSize()
Get the width of the left edge blendfloat
getBlendRightSize()
Get the width of the right edge blendPoint3D
getCenter()
Get the average center point of the surfaceint
getColor()
Get the surfaces current fill color in calibration modePoint3D
getCornerPoint(int index)
Get the target corner pointPoint3D[]
getCornerPoints()
Get all corner pointsint
getHorizontalForce()
Get the amount of horizontal displacement force used for spherical mapping for bezier surfaces.int
getId()
Get the surfaces IDdouble
getLongestSide()
File
getMaskFile()
Polygon
getPolygon()
Get the surfaces polygonint
getRes()
The the amount of subdivision currently usedint
getSelectedBezierControl()
Get the currently selected bezier controlint
getSelectedCorner()
Get the currently selected cornerSketch
getSketch()
int
getSketchIndex()
Get the actual sketch index.processing.core.PImage
getSurfaceMask()
String
getSurfaceName()
int
getSurfaceType()
See which type this surface isprocessing.core.PVector[]
getTextureWindow()
int
getVerticalForce()
Get the amount of vertical displacement force used for spherical mapping for bezier surfaces.void
increaseHorizontalForce()
Increase the amount of horizontal displacement force used for spherical mapping for bezier surfaces.void
increaseResolution()
Increase the amount of subdivisionvoid
increaseVerticalForce()
Increase the amount of vertical displacement force used for spherical mapping for bezier surfaces.boolean
isBlendLeft()
See if the surface has been set to blend on the leftboolean
isBlendRight()
See if the surface has been set to blend on the rightboolean
isCornerMovementAllowed()
See if we can move the cornerpoint of the surfaceboolean
isHidden()
See if surface is hiddenboolean
isInside(float mX, float mY)
Returns true if coordinates are inside a surfaceboolean
isLocked()
See if the surface is lockedboolean
isSelected()
See if the surface is selectedboolean
isUsingEdgeBlend()
See if the surface is using edge blendboolean
isUsingSurfaceMask()
void
render(processing.core.PGraphics g)
Renders the surface in calibration modevoid
render(processing.core.PGraphics g, processing.core.PImage tex)
Render the surface with texturevoid
rotateCornerPoints(int direction)
Rotate the corners of surface (0=ClockWise, 1=CounterClockWise) TODO Broken for Bezier SurfacesPoint3D
screenCoordinatesToQuad(float x, float y)
Translates a point on the screen into a point in the surface.void
setActivePoint(int activePoint)
Set index of which corner is activevoid
setBezierPoint(int pointIndex, float x, float y)
Set target bezier control point to coordinatesvoid
setBlendLeft(boolean blendLeft)
Set if the left side should be blendedvoid
setBlendLeftSize(float blendLeftSize)
Set the width of the left edge blendvoid
setBlendRight(boolean blendRight)
Set if the right side should be blendedvoid
setBlendRightSize(float blendRightSize)
Set the width of the right edge blendvoid
setBufferScreenWidth(int width)
Set the width of the buffer offscreenvoid
setColor(int ccolor)
Set the fill color of the surface in calibration modevoid
setCornerPoint(int pointIndex, float x, float y)
Set target corner point to coordinatesvoid
setCornerPoints(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)
Manually set coordinates for all corners of the surfacevoid
setHide(boolean hide)
Set if surface is hiddenvoid
setId(int id)
Set the ID of the surfacevoid
setLocked(boolean isLocked)
Set if the surface is lockedvoid
setMaskFile(File maskFile)
void
setModeCalibrate()
Set surface to calibration modevoid
setModeRender()
Set surface to render modevoid
setSelected(boolean selected)
Set if the surface is selectedvoid
setSelectedBezierControl(int selectedBezierControl)
Set target bezier control to selectedvoid
setSelectedCorner(int selectedCorner)
Set target corner to selectedvoid
setShake(int strength, int speed, int fallOfSpeed)
Set parameters for shaking the surface.void
setSketch(Sketch sketch)
void
setSketchIndex(int sketchIndex)
Set the actual sketch index.void
setSurfaceMask(processing.core.PImage mask)
void
setSurfaceName(String name)
Sets the name of the surfacevoid
setTextureWindow(float x, float y, float width, float height)
void
setZ(float z)
Set the Z displacement for all coordinates of the surfacevoid
shake()
Tells surface to shake (will only do something if setShake has been called quite recently)void
toggleLocked()
Toggle if surface is lockedvoid
toggleMode()
Toggle surface mode
-
-
-
Field Detail
-
QUAD
static final int QUAD
- See Also:
- Constant Field Values
-
BEZIER
static final int BEZIER
- See Also:
- Constant Field Values
-
DEFAULT_SIZE
static final int DEFAULT_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
clearSurfaceMask
void clearSurfaceMask()
-
decreaseHorizontalForce
void decreaseHorizontalForce()
Decrease the amount of horizontal displacement force used for spherical mapping for bezier surfaces. (using orthographic projection)
-
decreaseResolution
void decreaseResolution()
Decrease the amount of subdivision
-
decreaseVerticalForce
void decreaseVerticalForce()
Decrease the amount of horizontal displacement force used for spherical mapping for bezier surfaces. (using orthographic projection)
-
getActiveBezierPointIndex
int getActiveBezierPointIndex(int mX, int mY)
Returns index 0-7 if coordinates are on a bezier control- Parameters:
mX
-mY
-- Returns:
-
getActiveCornerPointIndex
int getActiveCornerPointIndex(int mX, int mY)
Returns index 0-3 if coordinates are near a corner or index -2 if on a surface- Parameters:
mX
-mY
-- Returns:
-
getActivePoint
int getActivePoint()
Get the index of active corner (or surface)- Returns:
-
getArea
double getArea()
Calculates and returns the surfaces area in squarepixels.- Returns:
-
getBezierPoint
Point3D getBezierPoint(int index)
Get target Bezier control point- Parameters:
index
-- Returns:
-
getBlendLeftSize
float getBlendLeftSize()
Get the width of the left edge blend- Returns:
-
getBlendRightSize
float getBlendRightSize()
Get the width of the right edge blend- Returns:
-
getCenter
Point3D getCenter()
Get the average center point of the surface- Returns:
-
getColor
int getColor()
Get the surfaces current fill color in calibration mode- Returns:
-
getCornerPoint
Point3D getCornerPoint(int index)
Get the target corner point- Parameters:
index
-- Returns:
-
getCornerPoints
Point3D[] getCornerPoints()
Get all corner points- Returns:
-
getHorizontalForce
int getHorizontalForce()
Get the amount of horizontal displacement force used for spherical mapping for bezier surfaces.
-
getId
int getId()
Get the surfaces ID- Returns:
-
getLongestSide
double getLongestSide()
-
getMaskFile
File getMaskFile()
-
getPolygon
Polygon getPolygon()
Get the surfaces polygon- Returns:
-
getRes
int getRes()
The the amount of subdivision currently used- Returns:
-
getSelectedBezierControl
int getSelectedBezierControl()
Get the currently selected bezier control- Returns:
-
getSelectedCorner
int getSelectedCorner()
Get the currently selected corner- Returns:
-
getSketch
Sketch getSketch()
-
getSurfaceMask
processing.core.PImage getSurfaceMask()
-
getSurfaceName
String getSurfaceName()
-
getSurfaceType
int getSurfaceType()
See which type this surface is- Returns:
-
getTextureWindow
processing.core.PVector[] getTextureWindow()
-
getVerticalForce
int getVerticalForce()
Get the amount of vertical displacement force used for spherical mapping for bezier surfaces.
-
increaseHorizontalForce
void increaseHorizontalForce()
Increase the amount of horizontal displacement force used for spherical mapping for bezier surfaces. (using orthographic projection)
-
increaseResolution
void increaseResolution()
Increase the amount of subdivision
-
increaseVerticalForce
void increaseVerticalForce()
Increase the amount of vertical displacement force used for spherical mapping for bezier surfaces. (using orthographic projection)
-
isBlendLeft
boolean isBlendLeft()
See if the surface has been set to blend on the left- Returns:
-
isBlendRight
boolean isBlendRight()
See if the surface has been set to blend on the right- Returns:
-
isCornerMovementAllowed
boolean isCornerMovementAllowed()
See if we can move the cornerpoint of the surface- Returns:
-
isHidden
boolean isHidden()
See if surface is hidden- Returns:
-
isInside
boolean isInside(float mX, float mY)
Returns true if coordinates are inside a surface- Parameters:
mX
-mY
-- Returns:
-
isLocked
boolean isLocked()
See if the surface is locked- Returns:
-
isSelected
boolean isSelected()
See if the surface is selected- Returns:
-
isUsingEdgeBlend
boolean isUsingEdgeBlend()
See if the surface is using edge blend- Returns:
-
isUsingSurfaceMask
boolean isUsingSurfaceMask()
-
render
void render(processing.core.PGraphics g)
Renders the surface in calibration mode- Parameters:
g
-
-
render
void render(processing.core.PGraphics g, processing.core.PImage tex)
Render the surface with texture- Parameters:
g
-tex
-
-
rotateCornerPoints
void rotateCornerPoints(int direction)
Rotate the corners of surface (0=ClockWise, 1=CounterClockWise) TODO Broken for Bezier Surfaces- Parameters:
direction
-
-
screenCoordinatesToQuad
Point3D screenCoordinatesToQuad(float x, float y)
Translates a point on the screen into a point in the surface. (not implemented in Bezier Surfaces)- Parameters:
x
-y
-- Returns:
-
setActivePoint
void setActivePoint(int activePoint)
Set index of which corner is active- Parameters:
activePoint
-
-
setBezierPoint
void setBezierPoint(int pointIndex, float x, float y)
Set target bezier control point to coordinates- Parameters:
pointIndex
-x
-y
-
-
setBlendLeft
void setBlendLeft(boolean blendLeft)
Set if the left side should be blended- Parameters:
blendLeft
-
-
setBlendLeftSize
void setBlendLeftSize(float blendLeftSize)
Set the width of the left edge blend
-
setBlendRight
void setBlendRight(boolean blendRight)
Set if the right side should be blended- Parameters:
blendRight
-
-
setBlendRightSize
void setBlendRightSize(float blendRightSize)
Set the width of the right edge blend
-
setBufferScreenWidth
void setBufferScreenWidth(int width)
Set the width of the buffer offscreen
-
setColor
void setColor(int ccolor)
Set the fill color of the surface in calibration mode- Parameters:
ccolor
-
-
setCornerPoint
void setCornerPoint(int pointIndex, float x, float y)
Set target corner point to coordinates- Parameters:
pointIndex
-x
-y
-
-
setCornerPoints
void setCornerPoints(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)
Manually set coordinates for all corners of the surface- Parameters:
x0
-y0
-x1
-y1
-x2
-y2
-x3
-y3
-
-
setHide
void setHide(boolean hide)
Set if surface is hidden- Parameters:
hide
-
-
setId
void setId(int id)
Set the ID of the surface- Parameters:
id
-
-
setLocked
void setLocked(boolean isLocked)
Set if the surface is locked- Parameters:
isLocked
-
-
setMaskFile
void setMaskFile(File maskFile)
-
setModeCalibrate
void setModeCalibrate()
Set surface to calibration mode
-
setModeRender
void setModeRender()
Set surface to render mode
-
setSelected
void setSelected(boolean selected)
Set if the surface is selected- Parameters:
selected
-
-
setSelectedBezierControl
void setSelectedBezierControl(int selectedBezierControl)
Set target bezier control to selected- Parameters:
selectedBezierControl
-
-
setSelectedCorner
void setSelectedCorner(int selectedCorner)
Set target corner to selected- Parameters:
selectedCorner
-
-
setShake
void setShake(int strength, int speed, int fallOfSpeed)
Set parameters for shaking the surface. Strength == max Z-displacement, Speed == vibration speed, FallOfSpeed 1-1000 == how fast strength is diminished- Parameters:
strength
-speed
-fallOfSpeed
-
-
setSketch
void setSketch(Sketch sketch)
-
setSurfaceMask
void setSurfaceMask(processing.core.PImage mask)
-
setSurfaceName
void setSurfaceName(String name)
Sets the name of the surface- Parameters:
name
-
-
setTextureWindow
void setTextureWindow(float x, float y, float width, float height)
-
setZ
void setZ(float z)
Set the Z displacement for all coordinates of the surface- Parameters:
z
-
-
shake
void shake()
Tells surface to shake (will only do something if setShake has been called quite recently)
-
getSketchIndex
int getSketchIndex()
Get the actual sketch index.
-
setSketchIndex
void setSketchIndex(int sketchIndex)
Set the actual sketch index.
-
toggleLocked
void toggleLocked()
Toggle if surface is locked
-
toggleMode
void toggleMode()
Toggle surface mode
-
-