Package ixagon.surface.mapper
Class QuadSurface
- java.lang.Object
- 
- ixagon.surface.mapper.QuadSurface
 
- 
- All Implemented Interfaces:
- SuperSurface
 
 public class QuadSurface extends Object implements SuperSurface 
- 
- 
Field Summary- 
Fields inherited from interface ixagon.surface.mapper.SuperSurfaceBEZIER, DEFAULT_SIZE, QUAD
 
- 
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static floatCCW(Point3D p1, Point3D p2, Point3D p3)Three points are a counter-clockwise turn if ccw > 0, clockwise if ccw < 0, and collinear if ccw = 0 because ccw is a determinant that gives the signed area of the triangle formed by p1, p2 and p3.voidclearSurfaceMask()voiddecreaseHorizontalForce()Decrease the amount of horizontal displacement force used for spherical mapping for bezier surfaces.voiddecreaseResolution()Decrease the 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)Checks if the coordinates is close to any of the corners, and if not, checks if the coordinates are inside the surface.intgetActivePoint()Get the index of the active cornerdoublegetArea()Calculate the area in squarepixelsPoint3DgetBezierPoint(int index)Get target Bezier control pointfloatgetBlendLeftSize()Get the width of the left edge blendfloatgetBlendRightSize()Get the width of the right edge blendintgetBufferScreenWidth()Point3DgetCenter()Find the average position of all the control points, use that as the center point.intgetColor()Get the fill color of the surface in calibration modePoint3DgetCornerPoint(int index)Get a specific cornerPoint3D[]getCornerPoints()Get all cornersintgetHorizontalForce()Get the amount of horizontal displacement force used for spherical mapping for bezier surfaces.intgetId()Get the surfaces IDbooleangetLocked()See if the surface is lockeddoublegetLongestSide()Get the longest side as doubleFilegetMaskFile()PolygongetPolygon()Get the surface as a polygonintgetRes()Get the amount of subdivision used in the surfaceintgetSelectedBezierControl()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 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 the surface is hiddenbooleanisInside(float mX, float mY)Check if coordinates are inside the 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)Render method for rendering while in calibration modevoidrender(processing.core.PGraphics g, processing.core.PImage tex)Render method for rendering in RENDER mode.voidrotateCornerPoints(int direction)Rotate the cornerpoints in direction (0=ClockWise 1=CounterClockWise)Point3DscreenCoordinatesToQuad(float x, float y)Translate 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 bufferScreenWidth)Set the width of the buffer offscreenvoidsetColor(int ccolor)Sets the fill color of the surface in calibration modevoidsetCornerPoint(int pointIndex, float inX, float inY)Set the coordinates of one of the target corner points.voidsetCornerPoints(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)Set all four corners of the surfacevoidsetHide(boolean hidden)Set if the surface should be hiddenvoidsetId(int id)Set the surfaces IDvoidsetLocked(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 the currently selected cornervoidsetShake(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 surfaceName)Sets the name of the surfacevoidsetTextureWindow(float x, float y, float width, float height)Manually set coordinates for mapping the texture.voidsetZ(float currentZ)Set Z-displacement for all coordinates of surfacevoidshake()Tells surface to shake (will only do something if setShake has been called quite recently)voidtoggleLocked()Toggle if surface is locked (a locked surface cannot be moved or manipulated in calibration mode, but other surfaces still snap to it)voidtoggleMode()Toggle surface mode
 
- 
- 
- 
Method Detail- 
CCWpublic static float CCW(Point3D p1, Point3D p2, Point3D p3) Three points are a counter-clockwise turn if ccw > 0, clockwise if ccw < 0, and collinear if ccw = 0 because ccw is a determinant that gives the signed area of the triangle formed by p1, p2 and p3.
 - 
clearSurfaceMaskpublic void clearSurfaceMask() - Specified by:
- clearSurfaceMaskin interface- SuperSurface
 
 - 
decreaseHorizontalForcepublic void decreaseHorizontalForce() Description copied from interface:SuperSurfaceDecrease the amount of horizontal displacement force used for spherical mapping for bezier surfaces. (using orthographic projection)- Specified by:
- decreaseHorizontalForcein interface- SuperSurface
 
 - 
decreaseResolutionpublic void decreaseResolution() Decrease the subdivision- Specified by:
- decreaseResolutionin interface- SuperSurface
 
 - 
decreaseVerticalForcepublic void decreaseVerticalForce() Description copied from interface:SuperSurfaceDecrease the amount of horizontal displacement force used for spherical mapping for bezier surfaces. (using orthographic projection)- Specified by:
- decreaseVerticalForcein interface- SuperSurface
 
 - 
getActiveBezierPointIndexpublic int getActiveBezierPointIndex(int mX, int mY)Description copied from interface:SuperSurfaceReturns index 0-7 if coordinates are on a bezier control- Specified by:
- getActiveBezierPointIndexin interface- SuperSurface
- Returns:
 
 - 
getActiveCornerPointIndexpublic int getActiveCornerPointIndex(int mX, int mY)Checks if the coordinates is close to any of the corners, and if not, checks if the coordinates are inside the surface. Returns the index of the corner (0,1,2,3) or (4) if coordinates was inside the surface- Specified by:
- getActiveCornerPointIndexin interface- SuperSurface
- Parameters:
- mX-
- mY-
- Returns:
 
 - 
getActivePointpublic int getActivePoint() Get the index of the active corner- Specified by:
- getActivePointin interface- SuperSurface
- Returns:
 
 - 
getAreapublic double getArea() Calculate the area in squarepixels- Specified by:
- getAreain interface- SuperSurface
- Returns:
- returns the area as N squarepixels
 
 - 
getBezierPointpublic Point3D getBezierPoint(int index) Description copied from interface:SuperSurfaceGet target Bezier control point- Specified by:
- getBezierPointin interface- SuperSurface
- Returns:
 
 - 
getBlendLeftSizepublic float getBlendLeftSize() Description copied from interface:SuperSurfaceGet the width of the left edge blend- Specified by:
- getBlendLeftSizein interface- SuperSurface
- Returns:
 
 - 
getBlendRightSizepublic float getBlendRightSize() Description copied from interface:SuperSurfaceGet the width of the right edge blend- Specified by:
- getBlendRightSizein interface- SuperSurface
- Returns:
 
 - 
getBufferScreenWidthpublic int getBufferScreenWidth() 
 - 
getCenterpublic Point3D getCenter() Find the average position of all the control points, use that as the center point.- Specified by:
- getCenterin interface- SuperSurface
- Returns:
 
 - 
getColorpublic int getColor() Get the fill color of the surface in calibration mode- Specified by:
- getColorin interface- SuperSurface
- Returns:
 
 - 
getCornerPointpublic Point3D getCornerPoint(int index) Get a specific corner- Specified by:
- getCornerPointin interface- SuperSurface
- Parameters:
- index-
- Returns:
 
 - 
getCornerPointspublic Point3D[] getCornerPoints() Get all corners- Specified by:
- getCornerPointsin interface- SuperSurface
- Returns:
 
 - 
getHorizontalForcepublic int getHorizontalForce() Description copied from interface:SuperSurfaceGet the amount of horizontal displacement force used for spherical mapping for bezier surfaces.- Specified by:
- getHorizontalForcein interface- SuperSurface
 
 - 
getIdpublic int getId() Get the surfaces ID- Specified by:
- getIdin interface- SuperSurface
- Returns:
 
 - 
getLockedpublic boolean getLocked() See if the surface is locked- Returns:
 
 - 
getLongestSidepublic double getLongestSide() Get the longest side as double- Specified by:
- getLongestSidein interface- SuperSurface
- Returns:
 
 - 
getMaskFilepublic File getMaskFile() - Specified by:
- getMaskFilein interface- SuperSurface
 
 - 
getPolygonpublic Polygon getPolygon() Get the surface as a polygon- Specified by:
- getPolygonin interface- SuperSurface
- Returns:
 
 - 
getRespublic int getRes() Get the amount of subdivision used in the surface- Specified by:
- getResin interface- SuperSurface
- Returns:
 
 - 
getSelectedBezierControlpublic int getSelectedBezierControl() Get the currently selected bezier control- Specified by:
- getSelectedBezierControlin interface- SuperSurface
- Returns:
 
 - 
getSelectedCornerpublic int getSelectedCorner() Get the currently selected corner- Specified by:
- getSelectedCornerin interface- SuperSurface
- Returns:
 
 - 
getSketchpublic Sketch getSketch() - Specified by:
- getSketchin interface- SuperSurface
 
 - 
getSurfaceMaskpublic processing.core.PImage getSurfaceMask() - Specified by:
- getSurfaceMaskin interface- SuperSurface
 
 - 
getSurfaceNamepublic String getSurfaceName() - Specified by:
- getSurfaceNamein interface- SuperSurface
 
 - 
getSurfaceTypepublic int getSurfaceType() Description copied from interface:SuperSurfaceSee which type this surface is- Specified by:
- getSurfaceTypein interface- SuperSurface
- Returns:
 
 - 
getTextureWindowpublic processing.core.PVector[] getTextureWindow() - Specified by:
- getTextureWindowin interface- SuperSurface
 
 - 
getVerticalForcepublic int getVerticalForce() Description copied from interface:SuperSurfaceGet the amount of vertical displacement force used for spherical mapping for bezier surfaces.- Specified by:
- getVerticalForcein interface- SuperSurface
 
 - 
increaseHorizontalForcepublic void increaseHorizontalForce() Description copied from interface:SuperSurfaceIncrease the amount of horizontal displacement force used for spherical mapping for bezier surfaces. (using orthographic projection)- Specified by:
- increaseHorizontalForcein interface- SuperSurface
 
 - 
increaseResolutionpublic void increaseResolution() Increase the subdivision- Specified by:
- increaseResolutionin interface- SuperSurface
 
 - 
increaseVerticalForcepublic void increaseVerticalForce() Description copied from interface:SuperSurfaceIncrease the amount of vertical displacement force used for spherical mapping for bezier surfaces. (using orthographic projection)- Specified by:
- increaseVerticalForcein interface- SuperSurface
 
 - 
isBlendLeftpublic boolean isBlendLeft() Description copied from interface:SuperSurfaceSee if the surface has been set to blend on the left- Specified by:
- isBlendLeftin interface- SuperSurface
- Returns:
 
 - 
isBlendRightpublic boolean isBlendRight() Description copied from interface:SuperSurfaceSee if the surface has been set to blend on the right- Specified by:
- isBlendRightin interface- SuperSurface
- Returns:
 
 - 
isCornerMovementAllowedpublic boolean isCornerMovementAllowed() Description copied from interface:SuperSurfaceSee if we can move the cornerpoint of the surface- Specified by:
- isCornerMovementAllowedin interface- SuperSurface
- Returns:
 
 - 
isHiddenpublic boolean isHidden() See if the surface is hidden- Specified by:
- isHiddenin interface- SuperSurface
- Returns:
 
 - 
isInsidepublic boolean isInside(float mX, float mY)Check if coordinates are inside the surface- Specified by:
- isInsidein interface- SuperSurface
- Parameters:
- mX-
- mY-
- Returns:
 
 - 
isLockedpublic boolean isLocked() Description copied from interface:SuperSurfaceSee if the surface is locked- Specified by:
- isLockedin interface- SuperSurface
- Returns:
 
 - 
isSelectedpublic boolean isSelected() See if the surface is selected- Specified by:
- isSelectedin interface- SuperSurface
- Returns:
 
 - 
isUsingEdgeBlendpublic boolean isUsingEdgeBlend() Description copied from interface:SuperSurfaceSee if the surface is using edge blend- Specified by:
- isUsingEdgeBlendin interface- SuperSurface
- Returns:
 
 - 
isUsingSurfaceMaskpublic boolean isUsingSurfaceMask() - Specified by:
- isUsingSurfaceMaskin interface- SuperSurface
 
 - 
renderpublic void render(processing.core.PGraphics g) Render method for rendering while in calibration mode- Specified by:
- renderin interface- SuperSurface
- Parameters:
- g-
 
 - 
renderpublic void render(processing.core.PGraphics g, processing.core.PImage tex)Render method for rendering in RENDER mode. Takes one GLGraphicsOffScreen and one GLTexture. The GLTexture is the texture used for the surface, and is drawn to the offscreen buffer.- Specified by:
- renderin interface- SuperSurface
- Parameters:
- g-
- tex-
 
 - 
rotateCornerPointspublic void rotateCornerPoints(int direction) Rotate the cornerpoints in direction (0=ClockWise 1=CounterClockWise)- Specified by:
- rotateCornerPointsin interface- SuperSurface
- Parameters:
- direction-
 
 - 
screenCoordinatesToQuadpublic Point3D screenCoordinatesToQuad(float x, float y) Translate a point on the screen into a point in the surface.- Specified by:
- screenCoordinatesToQuadin interface- SuperSurface
- Parameters:
- x-
- y-
- Returns:
 
 - 
setActivePointpublic void setActivePoint(int activePoint) Set index of which corner is active- Specified by:
- setActivePointin interface- SuperSurface
- Parameters:
- activePoint-
 
 - 
setBezierPointpublic void setBezierPoint(int pointIndex, float x, float y)Description copied from interface:SuperSurfaceSet target bezier control point to coordinates- Specified by:
- setBezierPointin interface- SuperSurface
 
 - 
setBlendLeftpublic void setBlendLeft(boolean blendLeft) Description copied from interface:SuperSurfaceSet if the left side should be blended- Specified by:
- setBlendLeftin interface- SuperSurface
 
 - 
setBlendLeftSizepublic void setBlendLeftSize(float blendLeftSize) Description copied from interface:SuperSurfaceSet the width of the left edge blend- Specified by:
- setBlendLeftSizein interface- SuperSurface
 
 - 
setBlendRightpublic void setBlendRight(boolean blendRight) Description copied from interface:SuperSurfaceSet if the right side should be blended- Specified by:
- setBlendRightin interface- SuperSurface
 
 - 
setBlendRightSizepublic void setBlendRightSize(float blendRightSize) Description copied from interface:SuperSurfaceSet the width of the right edge blend- Specified by:
- setBlendRightSizein interface- SuperSurface
 
 - 
setBufferScreenWidthpublic void setBufferScreenWidth(int bufferScreenWidth) Description copied from interface:SuperSurfaceSet the width of the buffer offscreen- Specified by:
- setBufferScreenWidthin interface- SuperSurface
 
 - 
setColorpublic void setColor(int ccolor) Sets the fill color of the surface in calibration mode- Specified by:
- setColorin interface- SuperSurface
- Parameters:
- ccolor-
 
 - 
setCornerPointpublic void setCornerPoint(int pointIndex, float inX, float inY)Set the coordinates of one of the target corner points. But first check that all angles are clockwise, to avoid concave shapes (collinearity is not allowed either as it freaks out the matrix calculation)- Specified by:
- setCornerPointin interface- SuperSurface
- Parameters:
- pointIndex-
 
 - 
setCornerPointspublic void setCornerPoints(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)Set all four corners of the surface- Specified by:
- setCornerPointsin interface- SuperSurface
- Parameters:
- x0-
- y0-
- x1-
- y1-
- x2-
- y2-
- x3-
- y3-
 
 - 
setHidepublic void setHide(boolean hidden) Set if the surface should be hidden- Specified by:
- setHidein interface- SuperSurface
- Parameters:
- hidden-
 
 - 
setIdpublic void setId(int id) Set the surfaces ID- Specified by:
- setIdin interface- SuperSurface
- Parameters:
- id-
 
 - 
setLockedpublic void setLocked(boolean isLocked) Set if the surface is locked- Specified by:
- setLockedin interface- SuperSurface
- Parameters:
- isLocked-
 
 - 
setMaskFilepublic void setMaskFile(File maskFile) - Specified by:
- setMaskFilein interface- SuperSurface
 
 - 
setModeCalibratepublic void setModeCalibrate() Description copied from interface:SuperSurfaceSet surface to calibration mode- Specified by:
- setModeCalibratein interface- SuperSurface
 
 - 
setModeRenderpublic void setModeRender() Description copied from interface:SuperSurfaceSet surface to render mode- Specified by:
- setModeRenderin interface- SuperSurface
 
 - 
setSelectedpublic void setSelected(boolean selected) Set if the surface is selected- Specified by:
- setSelectedin interface- SuperSurface
- Parameters:
- selected-
 
 - 
setSelectedBezierControlpublic void setSelectedBezierControl(int selectedBezierControl) Description copied from interface:SuperSurfaceSet target bezier control to selected- Specified by:
- setSelectedBezierControlin interface- SuperSurface
 
 - 
setSelectedCornerpublic void setSelectedCorner(int selectedCorner) Set the currently selected corner- Specified by:
- setSelectedCornerin interface- SuperSurface
- Parameters:
- selectedCorner-
 
 - 
setShakepublic 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- Specified by:
- setShakein interface- SuperSurface
- Parameters:
- strength-
- speed-
- fallOfSpeed-
 
 - 
setSketchpublic void setSketch(Sketch sketch) - Specified by:
- setSketchin interface- SuperSurface
 
 - 
setSurfaceMaskpublic void setSurfaceMask(processing.core.PImage mask) - Specified by:
- setSurfaceMaskin interface- SuperSurface
 
 - 
setSurfaceNamepublic void setSurfaceName(String surfaceName) Description copied from interface:SuperSurfaceSets the name of the surface- Specified by:
- setSurfaceNamein interface- SuperSurface
 
 - 
setTextureWindowpublic void setTextureWindow(float x, float y, float width, float height)Manually set coordinates for mapping the texture. This allows for easy cropping and enables a single texture to span more than one surface. Use normalized values for the values! (i.e 0-1)- Specified by:
- setTextureWindowin interface- SuperSurface
 
 - 
setZpublic void setZ(float currentZ) Set Z-displacement for all coordinates of surface- Specified by:
- setZin interface- SuperSurface
- Parameters:
- currentZ-
 
 - 
getSketchIndexpublic int getSketchIndex() Description copied from interface:SuperSurfaceGet the actual sketch index.- Specified by:
- getSketchIndexin interface- SuperSurface
 
 - 
setSketchIndexpublic void setSketchIndex(int sketchIndex) Description copied from interface:SuperSurfaceSet the actual sketch index.- Specified by:
- setSketchIndexin interface- SuperSurface
 
 - 
shakepublic void shake() Tells surface to shake (will only do something if setShake has been called quite recently)- Specified by:
- shakein interface- SuperSurface
 
 - 
toggleLockedpublic void toggleLocked() Toggle if surface is locked (a locked surface cannot be moved or manipulated in calibration mode, but other surfaces still snap to it)- Specified by:
- toggleLockedin interface- SuperSurface
 
 - 
toggleModepublic void toggleMode() Description copied from interface:SuperSurfaceToggle surface mode- Specified by:
- toggleModein interface- SuperSurface
 
 
- 
 
-