org.opensourcephysics.drawing3d
Class ElementCylinder

java.lang.Object
  extended by org.opensourcephysics.drawing3d.Element
      extended by org.opensourcephysics.drawing3d.ElementCylinder
All Implemented Interfaces:
InteractionSource
Direct Known Subclasses:
ElementDisk

public class ElementCylinder
extends Element

Title: ElementCylinder

Description: A 3D cylinder

Version:
August 2009
Author:
Francisco Esquembre, Carlos Jara Bravo (CJB)

Field Summary
 
Fields inherited from class org.opensourcephysics.drawing3d.Element
CHANGE_COLOR, CHANGE_GROUP, CHANGE_INTERACTION_POINTS, CHANGE_NONE, CHANGE_POSITION, CHANGE_POSITION_AND_SIZE, CHANGE_PROJECTION, CHANGE_RESOLUTION, CHANGE_SHAPE, CHANGE_SIZE, CHANGE_TRANSFORMATION, CHANGE_VISIBILITY, STD_CENTERED_END, STD_CENTERED_ORIGIN, STD_END, STD_ORIGIN, TARGET_POSITION, TARGET_SIZE, TO_RADIANS, X_UNIT_VECTOR, Y_UNIT_VECTOR, Z_UNIT_VECTOR
 
Constructor Summary
ElementCylinder()
           
 
Method Summary
 boolean checkStandarCylinder()
          Returns true if the cylinder is a complete primitive shape.
static double[][][] createStandardCylinder(int nr, int nu, int nz, double angle1, double angle2, boolean top, boolean bottom, boolean left, boolean right)
          Returns the data for a standard cylinder (from (-0.5,-0.5,-0.5) to (0.5,0.5,0.5) ) with the given parameters
 int getMaximumAngle()
          Returns the end angle for a possible non-360 degrees cylinder.
 int getMinimumAngle()
          Returns the starting angle for a possible non-360 degrees cylinder.
 boolean isClosedBottom()
          Whether the cylinder is closed at its bottom.
 boolean isClosedLeft()
          Whether the (non-360 degrees) cylinder is closed at its left side.
 boolean isClosedRight()
          Whether the (non-360 degrees) cylinder is closed at its right side.
 boolean isClosedTop()
          Whether the (truncated) cylinder is closed at its top.
 void setClosedBottom(boolean close)
          Whether the cylinder should be closed at its bottom.
 void setClosedLeft(boolean close)
          Whether the (non-360 degrees) cylinder should be closed at its left side.
 void setClosedRight(boolean close)
          Whether the (non-360 degrees) cylinder should be closed at its right side.
 void setClosedTop(boolean close)
          Whether the (truncated) cylinder should be closed at its top.
 void setMaximumAngle(int angle)
          Sets the end angle for a non-360 degrees cylinder.
 void setMinimumAngle(int angle)
          Sets the starting angle for a non-360 degrees cylinder.
 
Methods inherited from class org.opensourcephysics.drawing3d.Element
addChange, addInteractionListener, addSecondaryTransformation, addSecondaryTransformation, addSecondaryTransformations, getCanBeMeasured, getDataObject, getDiagonalSize, getGroup, getHotSpot, getImplementingObject, getInteractionTarget, getName, getPanel, getPosition, getPreviousImplementingObject, getScaledPosition, getScaledSize, getSecondaryTransformations, getSize, getSizeX, getSizeY, getSizeZ, getStyle, getTransformation, getX, getY, getZ, hasChanged, isEnabled, isVisible, processChanges, removeAllSecondaryTransformations, removeInteractionListener, removePanel, removeSecondaryTransformation, setCanBeMeasured, setDataObject, setEnabled, setName, setPanel, setPosition, setSize, setSizeX, setSizeXYZ, setSizeY, setSizeZ, setTransformation, setVisible, setX, setXYZ, setY, setZ, sizeAndToSpaceFrame, styleChanged, toBodyFrame, toSpaceFrame
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementCylinder

public ElementCylinder()
Method Detail

setClosedBottom

public void setClosedBottom(boolean close)
Whether the cylinder should be closed at its bottom.

Parameters:
close - the desired value

isClosedBottom

public boolean isClosedBottom()
Whether the cylinder is closed at its bottom.

Returns:
the value

setClosedTop

public void setClosedTop(boolean close)
Whether the (truncated) cylinder should be closed at its top.

Parameters:
close - the desired value

isClosedTop

public boolean isClosedTop()
Whether the (truncated) cylinder is closed at its top.

Returns:
the value

setClosedLeft

public void setClosedLeft(boolean close)
Whether the (non-360 degrees) cylinder should be closed at its left side.

Parameters:
close - the desired value

isClosedLeft

public boolean isClosedLeft()
Whether the (non-360 degrees) cylinder is closed at its left side.

Returns:
the value

setClosedRight

public void setClosedRight(boolean close)
Whether the (non-360 degrees) cylinder should be closed at its right side.

Parameters:
close - the desired value

isClosedRight

public boolean isClosedRight()
Whether the (non-360 degrees) cylinder is closed at its right side.

Returns:
the value

setMinimumAngle

public void setMinimumAngle(int angle)
Sets the starting angle for a non-360 degrees cylinder.

Parameters:
angle - the start angle in degrees, between 0 and 360

getMinimumAngle

public int getMinimumAngle()
Returns the starting angle for a possible non-360 degrees cylinder.

Returns:
int the minimum angle

setMaximumAngle

public void setMaximumAngle(int angle)
Sets the end angle for a non-360 degrees cylinder.

Parameters:
angle - the end angle in degrees, between 0 and 360, and usually bigger than the minimum angle

getMaximumAngle

public int getMaximumAngle()
Returns the end angle for a possible non-360 degrees cylinder.

Returns:
int the maximum angle

checkStandarCylinder

public boolean checkStandarCylinder()
Returns true if the cylinder is a complete primitive shape.

Returns:
boolean whether the cylinder is complete

createStandardCylinder

public static double[][][] createStandardCylinder(int nr,
                                                  int nu,
                                                  int nz,
                                                  double angle1,
                                                  double angle2,
                                                  boolean top,
                                                  boolean bottom,
                                                  boolean left,
                                                  boolean right)
Returns the data for a standard cylinder (from (-0.5,-0.5,-0.5) to (0.5,0.5,0.5) ) with the given parameters