org.vizzini.ui.graphics
Interface IShape

All Superinterfaces:
Comparable, IStateful
All Known Subinterfaces:
IPhysicalObjectUI
All Known Implementing Classes:
AbstractShape, AnchorShape, BishopShape, BoardShape, Box, BoxExtruded, BoxTokenUI, Cone, ConeTokenUI, Cylinder, Ellipse, Ellipsoid, EllipsoidTokenUI, ExtrudedShape, KingShape, KnightShape, MaceShape, PawnShape, PieceShape, PolygonShape, QueenShape, RookShape

public interface IShape
extends Comparable, IStateful

Defines methods required by 3D shapes.

Since:
v0.2
Version:
v0.3
Author:
Jeffrey M. Thompson

Method Summary
 void add(IShape shape)
          Add the given shape as a child of this.
 void clear()
          Clear all child shapes.
 double computeNormalZComponent(int i1, int i2, int i3)
          Compute the normal z component of the plane define by the points with the given indices in screen coordinates.
 void computeScreenPoints(Quaternion q, Vector v, double magnify, int offsetX, int offsetY, double d)
          Compute the points of this shape in screen coordinates.
 boolean contains(Point point)
          Return true if the given point is within this shape.
 void drawOn(Graphics g, double magnify)
          Draw this shape on the given graphics with the given magnification.
 Rectangle getBounds()
          Return the bounding box of the screen coordinates.
 ShapeGroup getChildren()
          Return the child shapes.
 Color getColor()
          Return the color of this shape.
 double getDepth()
           
 Vector getDimensions()
          Return the dimensions in world coordinates.
 double getHeight()
           
 double getMinDimension()
          Return the minimum dimension.
 String getName()
           
 Vector getScreenCenter()
          Return this shape's center in screen coordinates.
 String getTextureFilepath()
          Return the texture filepath.
 double getWidth()
           
 boolean isLightSource()
           
 boolean isTextureFilepathSet()
          Return true if a texture filepath is set.
 boolean isVisible()
          Return true if this is visible.
 boolean isWireframe()
          Return true if this is wireframe.
 void remove(IShape shape)
          Remove the given child shape.
 void setColor(Color color)
          Set the color.
 void setLightSource(boolean isLightSource)
           
 void setName(String name)
           
 void setTextureFilepath(String textureFilepath)
          Set the texture filepath.
 void setVisible(boolean isVisible)
          Set the visibility flag.
 void setWireframe(boolean isWireframe)
          Set the wireframe flag.
 String toString()
          Return a string representation of this object.
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.vizzini.math.IStateful
getAbsoluteState, getState, getStatefulParent, setStatefulParent
 

Method Detail

add

void add(IShape shape)
Add the given shape as a child of this.

Parameters:
shape - The new child shape.
Since:
v0.2

clear

void clear()
Clear all child shapes.

Since:
v0.2

computeNormalZComponent

double computeNormalZComponent(int i1,
                               int i2,
                               int i3)
Compute the normal z component of the plane define by the points with the given indices in screen coordinates.

Since:
v0.2

computeScreenPoints

void computeScreenPoints(Quaternion q,
                         Vector v,
                         double magnify,
                         int offsetX,
                         int offsetY,
                         double d)
Compute the points of this shape in screen coordinates.

Parameters:
q - Rotation of the parent to world coordinates.
v - The parent position in world coordinates..
magnify - The magnification.
offsetX - The offset X coordinate.
offsetY - The offset Y coordinate.
d - Perspective constant.
Since:
v0.2

contains

boolean contains(Point point)
Return true if the given point is within this shape.

Since:
v0.2

drawOn

void drawOn(Graphics g,
            double magnify)
Draw this shape on the given graphics with the given magnification.

Parameters:
g - The graphics.
magnify - The magnification.
Since:
v0.2

getBounds

Rectangle getBounds()
Return the bounding box of the screen coordinates.

Since:
v0.2

getChildren

ShapeGroup getChildren()
Return the child shapes.

Since:
v0.2

getColor

Color getColor()
Return the color of this shape.

Since:
v0.2

getDepth

double getDepth()
Returns:
Return depth.
Since:
v0.3

getDimensions

Vector getDimensions()
Return the dimensions in world coordinates.

Since:
v0.3

getHeight

double getHeight()
Returns:
Return height.
Since:
v0.3

getMinDimension

double getMinDimension()
Return the minimum dimension.

Since:
v0.3

getName

String getName()
Returns:
Return name.
Since:
v0.3

getScreenCenter

Vector getScreenCenter()
Return this shape's center in screen coordinates.

Since:
v0.2

getTextureFilepath

String getTextureFilepath()
Return the texture filepath.

Since:
v0.3

getWidth

double getWidth()
Returns:
Return width.
Since:
v0.3

isLightSource

boolean isLightSource()
Returns:
Return isLightSource.
Since:
v0.3

isTextureFilepathSet

boolean isTextureFilepathSet()
Return true if a texture filepath is set.

Since:
v0.3

isVisible

boolean isVisible()
Return true if this is visible.

Since:
v0.2

isWireframe

boolean isWireframe()
Return true if this is wireframe.

Since:
v0.2

remove

void remove(IShape shape)
Remove the given child shape.

Since:
v0.2

setColor

void setColor(Color color)
Set the color.

Since:
v0.2

setLightSource

void setLightSource(boolean isLightSource)
Parameters:
isLightSource - the isLightSource to set
Since:
v0.3

setName

void setName(String name)
Parameters:
name - the name to set
Since:
v0.3

setTextureFilepath

void setTextureFilepath(String textureFilepath)
Set the texture filepath.

Parameters:
textureFilepath - Texture filepath.
Since:
v0.3

setVisible

void setVisible(boolean isVisible)
Set the visibility flag. If false, neither this shape nor its children are drawn.

Since:
v0.2

setWireframe

void setWireframe(boolean isWireframe)
Set the wireframe flag.

Since:
v0.2

toString

String toString()
Return a string representation of this object.

Overrides:
toString in class Object
Since:
v0.2


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02