CubeTwister 2.0alpha142 2012-02-11

ch.randelshofer.rubik
Class RubiksCuboctahedronGeom3D

java.lang.Object
  extended by ch.randelshofer.rubik.AbstractCube3D
      extended by ch.randelshofer.rubik.AbstractCubeGeom3D
          extended by ch.randelshofer.rubik.AbstractRubiksCubeGeom3D
              extended by ch.randelshofer.rubik.RubiksCuboctahedronGeom3D
All Implemented Interfaces:
Cube3D, CubeListener, java.beans.PropertyChangeListener, java.util.EventListener, javax.swing.event.ChangeListener

public class RubiksCuboctahedronGeom3D
extends AbstractRubiksCubeGeom3D

Geometrical representation of a Rubik's Cuboctahedron in three dimensions using the Geom3D engine.

Version:
2.1 2010-01-30 Completed color scheme.
2.0 2009-01-04 Added support for twisting the cube by swiping over its faces.
1.1.4 2002-07-14 Cube draws more border lines.
1.1.3 2002-04-07 Actions were not properly assigned to the hexagonal stickers of the cube.
1.1.2 2001-08-16 Inner faces which are never visible removed.
1.1.1 2001-07-30 Colors adapted to fit original Rubik's Cube.
1.1 2001-07-23 Inner faces have no borders to speed up the painting process.
1.0 2000-03-11
Author:
Werner Randelshofer, Hausmatt 10, CH-6405 Immensee

Nested Class Summary
 
Nested classes/interfaces inherited from class ch.randelshofer.rubik.AbstractCube3D
AbstractCube3D.PartAction, AbstractCube3D.SwipeAction
 
Field Summary
 
Fields inherited from class ch.randelshofer.rubik.AbstractRubiksCubeGeom3D
CORNER_EXPLODE_TRANSLATION, EDGE_EXPLODE_TRANSLATION, SIDE_EXPLODE_TRANSLATION
 
Fields inherited from class ch.randelshofer.rubik.AbstractCubeGeom3D
centerCount, centerOffset, cornerCount, cornerOffset, edgeCount, edgeOffset, HALF_PI, identityTransforms, isInStartedPlayer, mode, partCount, PARTS_MODE, PI, scene, shapes, sideCount, sideOffset, transforms, TWIST_MODE
 
Fields inherited from class ch.randelshofer.rubik.AbstractCube3D
attributes, changeEvent, dispatcher, isAnimated, layerCount, listenerList
 
Constructor Summary
RubiksCuboctahedronGeom3D()
           
 
Method Summary
 CubeAttributes createAttributes()
          Creates cube attributes (e.g.
 CubeKind getKind()
          Gets the kind of the cube.
 java.lang.String getName()
           
protected  int getPartFaceIndexForStickerIndex(int stickerIndex)
           
 int getPartIndexForStickerIndex(int stickerIndex)
          Updates the fill color of the stickers.
 int getStickerCount()
           
protected  int getStickerIndexForPart(int part, int orientation)
           
protected  float getUnitScaleFactor()
           
protected  void initActions()
           
protected  void initCorners()
           
protected  void initEdges()
           
protected  void updatePartsFillColor()
          Updates the fill color of the parts.
protected  void updatePartsOutlineColor()
          Updates the outline color of the parts.
 
Methods inherited from class ch.randelshofer.rubik.AbstractRubiksCubeGeom3D
computeTransformation, createCube, cubeTwisted, initCenter, initSides, initTransforms
 
Methods inherited from class ch.randelshofer.rubik.AbstractCubeGeom3D
getPart, getPartCount, getScene, init, isInStartedPlayer, setInStartedPlayer, setMode, setStickerBeveling, updateAlphaBeta, updateAttributes, updateCube, updateExplosionFactor, updatePartsVisibility, updatePartVisibility, updateScaleFactor, updateStickersFillColor, updateStickersImage, updateStickerVisibility, validateTwist
 
Methods inherited from class ch.randelshofer.rubik.AbstractCube3D
addChangeListener, addCube3DListener, cubeChanged, dispatch, dispose, fireActionPerformed, fireMouseEntered, fireMouseExited, fireMousePressed, fireMouseReleased, fireStateChanged, getAnimator, getAttributes, getCube, getDispatcher, getLock, isAdjusting, isAnimated, isAnimating, isShowGhostParts, propertyChange, removeChangeListener, removeCube3DListener, setAnimated, setAnimator, setAttributes, setCube, setDispatcher, setLock, setShowGhostParts, stateChanged, stopAnimation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RubiksCuboctahedronGeom3D

public RubiksCuboctahedronGeom3D()
Method Detail

getPartIndexForStickerIndex

public int getPartIndexForStickerIndex(int stickerIndex)
Updates the fill color of the stickers. The sticker Index is interpreted according to this scheme:
                     --+--+--
                    /45|46|47\
                   +---+--+---+
                   | 48|49| 50|
                   +---+--+---+
                    \51|52|53/
 +----------++----------++----------++----------+
  \62/63\64/  \66/67\68/  \54/55\56/  \58/59\60/
    +----+      +----+      +----+      +----+
     \65/        \69/        \57/        \61/
      \/          \/          \/          \/
        --+---+--   --+---+--   --+---+--   --+---+--
       /36| 37|38\ /0 | 1 | 2\ /9 | 10|11\ /27| 28|29\
      +---+---+---+---+---+---+---+---+---+---+---+---+
      | 39| 40| 41| 3 | 4 | 5 | 12| 13| 14| 30| 31| 32|
      +---+---+---+---+---+---+---+---+---+---+---+---+
       \42| 43|44/ \6 | 7 | 8/ \15| 16|17/ \33| 34|35/
        --+---+--   --+---+--   --+---+--   --+---+--
      /\          /\          /\          /\
     /78\        /82\        /70\        /74\
    +----+      +----+      +----+      +----+
  /79/80\81\  /83/84\85\  /71/72\73\  /75/76\77\
 +----------++----------++----------++----------+
                    /18|19|20\
                   +---+--+---+
                   | 21|22| 23|
                   +---+--+---+
                    \24|25|26/
                     --+--+--
 

Specified by:
getPartIndexForStickerIndex in interface Cube3D
Specified by:
getPartIndexForStickerIndex in class AbstractCube3D

getUnitScaleFactor

protected float getUnitScaleFactor()

createAttributes

public CubeAttributes createAttributes()
Description copied from class: AbstractCube3D
Creates cube attributes (e.g. colors, sticker pictures, ...).

Specified by:
createAttributes in class AbstractCube3D

getPartFaceIndexForStickerIndex

protected int getPartFaceIndexForStickerIndex(int stickerIndex)
Specified by:
getPartFaceIndexForStickerIndex in class AbstractCube3D

getStickerIndexForPart

protected int getStickerIndexForPart(int part,
                                     int orientation)

getStickerCount

public int getStickerCount()
Specified by:
getStickerCount in class AbstractCube3D

updatePartsOutlineColor

protected void updatePartsOutlineColor()
Updates the outline color of the parts.

Specified by:
updatePartsOutlineColor in class AbstractCubeGeom3D

updatePartsFillColor

protected final void updatePartsFillColor()
Updates the fill color of the parts.

Specified by:
updatePartsFillColor in class AbstractCubeGeom3D

initCorners

protected void initCorners()
Specified by:
initCorners in class AbstractCubeGeom3D

initEdges

protected void initEdges()
Specified by:
initEdges in class AbstractCubeGeom3D

initActions

protected void initActions()
Specified by:
initActions in class AbstractCubeGeom3D

getName

public java.lang.String getName()

getKind

public CubeKind getKind()
Description copied from interface: Cube3D
Gets the kind of the cube.


(c) Werner Randelshofer.
All rights reserved.