Package ixagon.surface.mapper
Interface SuperSurface
-
- All Known Implementing Classes:
BezierSurface,QuadSurface
public interface SuperSurface
-
-
Field Summary
Fields Modifier and Type Field Description static intBEZIERstatic intDEFAULT_SIZEstatic intQUAD
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclearSurfaceMask()voiddecreaseHorizontalForce()Decrease the amount of horizontal displacement force used for spherical mapping for bezier surfaces.voiddecreaseResolution()Decrease the amount of subdivisionvoiddecreaseVerticalForce()Decrease the amount of horizontal displacement force used for spherical mapping for bezier surfaces.intgetActiveBezierPointIndex(int mX, int mY)Returns index 0-7 if coordinates are on a bezier controlintgetActiveCornerPointIndex(int mX, int mY)Returns index 0-3 if coordinates are near a corner or index -2 if on a surfaceintgetActivePoint()Get the index of active corner (or surface)doublegetArea()Calculates and returns the surfaces area in squarepixels.Point3DgetBezierPoint(int index)Get target Bezier control pointfloatgetBlendLeftSize()Get the width of the left edge blendfloatgetBlendRightSize()Get the width of the right edge blendPoint3DgetCenter()Get the average center point of the surfaceintgetColor()Get the surfaces current fill color in calibration modePoint3DgetCornerPoint(int index)Get the target corner pointPoint3D[]getCornerPoints()Get all corner pointsintgetHorizontalForce()Get the amount of horizontal displacement force used for spherical mapping for bezier surfaces.intgetId()Get the surfaces IDdoublegetLongestSide()FilegetMaskFile()PolygongetPolygon()Get the surfaces polygonintgetRes()The the amount of subdivision currently usedintgetSelectedBezierControl()Get the currently selected bezier controlintgetSelectedCorner()Get the currently selected cornerSketchgetSketch()intgetSketchIndex()Get the actual sketch index.processing.core.PImagegetSurfaceMask()StringgetSurfaceName()intgetSurfaceType()See which type this surface isprocessing.core.PVector[]getTextureWindow()intgetVerticalForce()Get the amount of vertical displacement force used for spherical mapping for bezier surfaces.voidincreaseHorizontalForce()Increase the amount of horizontal displacement force used for spherical mapping for bezier surfaces.voidincreaseResolution()Increase the amount of subdivisionvoidincreaseVerticalForce()Increase the amount of vertical displacement force used for spherical mapping for bezier surfaces.booleanisBlendLeft()See if the surface has been set to blend on the leftbooleanisBlendRight()See if the surface has been set to blend on the rightbooleanisCornerMovementAllowed()See if we can move the cornerpoint of the surfacebooleanisHidden()See if surface is hiddenbooleanisInside(float mX, float mY)Returns true if coordinates are inside a surfacebooleanisLocked()See if the surface is lockedbooleanisSelected()See if the surface is selectedbooleanisUsingEdgeBlend()See if the surface is using edge blendbooleanisUsingSurfaceMask()voidrender(processing.core.PGraphics g)Renders the surface in calibration modevoidrender(processing.core.PGraphics g, processing.core.PImage tex)Render the surface with texturevoidrotateCornerPoints(int direction)Rotate the corners of surface (0=ClockWise, 1=CounterClockWise) TODO Broken for Bezier SurfacesPoint3DscreenCoordinatesToQuad(float x, float y)Translates a point on the screen into a point in the surface.voidsetActivePoint(int activePoint)Set index of which corner is activevoidsetBezierPoint(int pointIndex, float x, float y)Set target bezier control point to coordinatesvoidsetBlendLeft(boolean blendLeft)Set if the left side should be blendedvoidsetBlendLeftSize(float blendLeftSize)Set the width of the left edge blendvoidsetBlendRight(boolean blendRight)Set if the right side should be blendedvoidsetBlendRightSize(float blendRightSize)Set the width of the right edge blendvoidsetBufferScreenWidth(int width)Set the width of the buffer offscreenvoidsetColor(int ccolor)Set the fill color of the surface in calibration modevoidsetCornerPoint(int pointIndex, float x, float y)Set target corner point to coordinatesvoidsetCornerPoints(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)Manually set coordinates for all corners of the surfacevoidsetHide(boolean hide)Set if surface is hiddenvoidsetId(int id)Set the ID of the surfacevoidsetLocked(boolean isLocked)Set if the surface is lockedvoidsetMaskFile(File maskFile)voidsetModeCalibrate()Set surface to calibration modevoidsetModeRender()Set surface to render modevoidsetSelected(boolean selected)Set if the surface is selectedvoidsetSelectedBezierControl(int selectedBezierControl)Set target bezier control to selectedvoidsetSelectedCorner(int selectedCorner)Set target corner to selectedvoidsetShake(int strength, int speed, int fallOfSpeed)Set parameters for shaking the surface.voidsetSketch(Sketch sketch)voidsetSketchIndex(int sketchIndex)Set the actual sketch index.voidsetSurfaceMask(processing.core.PImage mask)voidsetSurfaceName(String name)Sets the name of the surfacevoidsetTextureWindow(float x, float y, float width, float height)voidsetZ(float z)Set the Z displacement for all coordinates of the surfacevoidshake()Tells surface to shake (will only do something if setShake has been called quite recently)voidtoggleLocked()Toggle if surface is lockedvoidtoggleMode()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
-
-