PShape

All Methods Instance Methods Concrete Methods  Modifier and Type Method and Description void addChild(PShape who)  void addChild(PShape who, int idx)  void addName(java.lang.String nom, PShape shape)

Add a shape to the name lookup table.

void ambient(float gray)  void ambient(float x, float y, float z)  void ambient(int rgb)  void applyMatrix(float n00, float n01, float n02, float n10, float n11, float n12)  void applyMatrix(float n00, float n01, float n02, float n03, float n10, float n11, float n12, float n13, float n20, float n21, float n22, float n23, float n30, float n31, float n32, float n33)  void applyMatrix(PMatrix source)  void applyMatrix(PMatrix2D source)  void applyMatrix(PMatrix3D source)  void attrib(java.lang.String name, boolean... values)  void attrib(java.lang.String name, float... values)  void attrib(java.lang.String name, int... values)  void attribColor(java.lang.String name, int color)  void attribNormal(java.lang.String name, float nx, float ny, float nz)  void attribPosition(java.lang.String name, float x, float y, float z)  void beginContour()  void beginShape()  void beginShape(int kind)  void bezierDetail(int detail)  void bezierVertex(float x2, float y2, float x3, float y3, float x4, float y4)  void bezierVertex(float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4)  void colorMode(int mode)

Set the pivot point for all transformations.

void colorMode(int mode, float max)  void colorMode(int mode, float maxX, float maxY, float maxZ)  void colorMode(int mode, float maxX, float maxY, float maxZ, float maxA)  boolean contains(float x, float y)

Return true if this x, y coordinate is part of this shape.

void curveDetail(int detail)  void curveTightness(float tightness)  void curveVertex(float x, float y)  void curveVertex(float x, float y, float z)  void disableStyle()

( begin auto-generated from PShape_disableStyle.xml ) Disables the shape's style data and uses Processing's current styles.

void draw(PGraphics g)

Called by the following (the shape() command adds the g) PShape s = loadShape("blah.svg"); shape(s);

void emissive(float gray)  void emissive(float x, float y, float z)  void emissive(int rgb)  void enableStyle()

( begin auto-generated from PShape_enableStyle.xml ) Enables the shape's style data and ignores Processing's current styles.

void endContour()  void endShape()  void endShape(int mode)  void fill(float gray)  void fill(float gray, float alpha)  void fill(float x, float y, float z)  void fill(float x, float y, float z, float a)  void fill(int rgb)  void fill(int rgb, float alpha)  PShape findChild(java.lang.String target)

Same as getChild(name), except that it first walks all the way up the hierarchy to the eldest grandparent, so that children can be found anywhere.

int getAmbient(int index)  PShape getChild(int index)

( begin auto-generated from PShape_getChild.xml ) Extracts a child shape from a parent shape.

PShape getChild(java.lang.String target)  int getChildCount()  int getChildIndex(PShape who)

Returns the index of child who.

PShape[] getChildren()  float getDepth()

Get the depth of the shape area (not necessarily the shape boundary).

int getEmissive(int index)  int getFamily()

The shape type, one of GROUP, PRIMITIVE, PATH, or GEOMETRY.

int getFill(int index)  float getHeight()

Get the height of the drawing area (not necessarily the shape boundary).

int getKind()  java.lang.String getName()  PVector getNormal(int index)  PVector getNormal(int index, PVector vec)  float getNormalX(int index)  float getNormalY(int index)  float getNormalZ(int index)  float getParam(int index)  float[] getParams()  float[] getParams(float[] target)  PShape getParent()  float getShininess(int index)  int getSpecular(int index)  int getStroke(int index)  float getStrokeWeight(int index)  PShape getTessellation()  float getTextureU(int index)  float getTextureV(int index)  int getTint(int index)  PVector getVertex(int index)  PVector getVertex(int index, PVector vec)  int getVertexCode(int index)

One of VERTEX, BEZIER_VERTEX, CURVE_VERTEX, or BREAK.

int getVertexCodeCount()  int[] getVertexCodes()  int getVertexCount()  float getVertexX(int index)  float getVertexY(int index)  float getVertexZ(int index)  float getWidth()

Get the width of the drawing area (not necessarily the shape boundary).

boolean is2D()

Return true if this shape is 2D.

boolean is3D()

Return true if this shape is 3D.

boolean isClosed()  boolean isVisible()

( begin auto-generated from PShape_isVisible.xml ) Returns a boolean value "true" if the image is set to be visible, "false" if not.

void noFill()  void normal(float nx, float ny, float nz)  void noStroke()  void noTexture()  void noTint()  void quadraticVertex(float cx, float cy, float x3, float y3)  void quadraticVertex(float cx, float cy, float cz, float x3, float y3, float z3)  void removeChild(int idx)

Remove the child shape with index idx.

void resetMatrix()

( begin auto-generated from PShape_resetMatrix.xml ) Replaces the current matrix of a shape with the identity matrix.

void rotate(float angle)

( begin auto-generated from PShape_rotate.xml ) Rotates a shape the amount specified by the angle parameter.

void rotate(float angle, float v0, float v1, float v2)  void rotateX(float angle)

( begin auto-generated from PShape_rotateX.xml ) Rotates a shape around the x-axis the amount specified by the angle parameter.

void rotateY(float angle)

( begin auto-generated from PShape_rotateY.xml ) Rotates a shape around the y-axis the amount specified by the angle parameter.

void rotateZ(float angle)

( begin auto-generated from PShape_rotateZ.xml ) Rotates a shape around the z-axis the amount specified by the angle parameter.

void scale(float s)

( begin auto-generated from PShape_scale.xml ) Increases or decreases the size of a shape by expanding and contracting vertices.

void scale(float x, float y)  void scale(float x, float y, float z)  void set3D(boolean val)  void setAmbient(int ambient)  void setAmbient(int index, int ambient)  void setAttrib(java.lang.String name, int index, boolean... values)  void setAttrib(java.lang.String name, int index, float... values)  void setAttrib(java.lang.String name, int index, int... values)  void setEmissive(int emissive)  void setEmissive(int index, int emissive)  void setFamily(int family)  void setFill(boolean fill)  void setFill(int fill)

( begin auto-generated from PShape_setFill.xml ) The setFill() method defines the fill color of a PShape.

void setFill(int index, int fill)  void setKind(int kind)  void setName(java.lang.String name)  void setNormal(int index, float nx, float ny, float nz)  void setPath(int vcount, float[][] verts)  void setShininess(float shine)  void setShininess(int index, float shine)  void setSpecular(int specular)  void setSpecular(int index, int specular)  void setStroke(boolean stroke)  void setStroke(int stroke)

( begin auto-generated from PShape_setStroke.xml ) The setStroke() method defines the outline color of a PShape.

void setStroke(int index, int stroke)  void setStrokeCap(int cap)  void setStrokeJoin(int join)  void setStrokeWeight(float weight)  void setStrokeWeight(int index, float weight)  void setTexture(PImage tex)  void setTextureMode(int mode)  void setTextureUV(int index, float u, float v)  void setTint(boolean tint)  void setTint(int fill)  void setTint(int index, int tint)  void setVertex(int index, float x, float y)  void setVertex(int index, float x, float y, float z)  void setVertex(int index, PVector vec)  void setVisible(boolean visible)

( begin auto-generated from PShape_setVisible.xml ) Sets the shape to be visible or invisible.

void shininess(float shine)  void specular(float gray)  void specular(float x, float y, float z)  void specular(int rgb)  void stroke(float gray)  void stroke(float gray, float alpha)  void stroke(float x, float y, float z)  void stroke(float x, float y, float z, float alpha)  void stroke(int rgb)  void stroke(int rgb, float alpha)  void strokeCap(int cap)  void strokeJoin(int join)  void strokeWeight(float weight)  void texture(PImage tex)  void textureMode(int mode)  void tint(float gray)  void tint(float gray, float alpha)  void tint(float x, float y, float z)  void tint(float x, float y, float z, float alpha)  void tint(int rgb)  void tint(int rgb, float alpha)  void translate(float x, float y)

( begin auto-generated from PShape_translate.xml ) Specifies an amount to displace the shape.

void translate(float x, float y, float z)  void vertex(float x, float y)  void vertex(float x, float y, float z)  void vertex(float x, float y, float u, float v)  void vertex(float x, float y, float z, float u, float v)