|
JavaView® v2.00.008 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--jv.object.PsObject
|
+--jv.project.PjProject
|
+--jvx.geom.PnCellOperator
Implements a cellular automata on the triangles of an element set.
| Field Summary | |
static int |
CORONA
|
protected int |
influence
|
static int |
LIFE
|
protected boolean |
m_bHasElementColors
Flag, if the geometry has elementColors before calling CellOperator. |
protected boolean |
m_bMarkGlider
|
protected boolean |
m_bShowTaggedElements
Flag, if ShowTaggedElements was switched on before calling CellOperator. |
protected boolean |
m_bUpdateSender
|
protected boolean |
m_bUseGlobalElementColor
Flag, if global element color of geometry was used before calling CellOperator. |
protected java.awt.Color[] |
m_color
|
protected int |
m_currLoop
|
protected PnCellOperator_Dialog |
m_dialog
|
protected PgElementSet |
m_geom
|
protected PiVector[] |
m_geomElement
|
protected PiVector[] |
m_geomNeighbour
|
protected PiVector[] |
m_infCell
|
protected PiVector |
m_markI
|
protected int |
m_numLoops
|
protected int |
m_numStates
|
protected java.awt.Color[] |
m_originalColors
Original element colors of geometry before calling CellOperator. |
protected int |
m_outputType
|
protected PnCellOperator_IP |
m_panel
|
protected int |
m_sleepTime
|
protected java.lang.Thread |
m_thread
|
protected PgVertexStar |
m_vertexStar
|
static int |
MAJORITY
|
static int |
NEIGHBOUR
|
protected int |
rule
|
protected static int |
SET_COLOR
|
protected static int |
SET_ELEMENT_TAG
|
| Fields inherited from class jv.project.PjProject |
m_anim, m_bAutoFit, m_display, m_displayList, m_geometry, m_parm, m_rootGeometry |
| Fields inherited from class jv.object.PsObject |
HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_MATERIAL_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_SELECTED, IS_USED, m_infoPanel, m_name, m_panelList, m_parent, m_tag, m_updateList, NUM_TAGS |
| Constructor Summary | |
PnCellOperator(PgElementSet anElementSet)
Constructor |
|
| Method Summary | |
int |
cellOperator(int index)
Call the appointed operating rule for a given cell. |
void |
clear()
Set all elements to state "0". |
void |
compute()
For all cells call cell operating method. |
void |
evaluate()
For all elements of the ElementSet show the cell values. |
java.awt.Color |
getColor(int i)
Return color for a given cell state. |
PnCellOperator_Dialog |
getDialog()
Open a new dialog window for cell operator. |
int |
getNumStates()
return number of possible states of a cell. |
int |
getState(int elemNr)
Return state number of a given element. |
void |
init()
Initialisation |
void |
makeCoronaInfluence()
For all cells store all cells touching vertices of the cell itself. |
void |
makeInfluence()
Set list of influencing cells for all cells of the elementSet. |
void |
makeNeighbourInfluence()
For all cells store cell itself and all neighbour cells. |
void |
markElement(int elemNr)
Set an element to the next state. |
void |
markElement(int elemNr,
int value)
Set an element to a given state. |
void |
markGlider(int elemNr,
int dir)
Set a glider upon an elementSet with quadrilateral connectivity. |
void |
pickInitial(PvPickEvent pos)
Mark picked element to be a living cell. |
void |
releasePick()
Remove pick focus from cell operator. |
void |
requestPick()
Set pick focus upon cell operator. |
void |
restoreColors()
Reset the ElementSet's element colors to state before calling cell operator. |
int |
ruleOfLife(int index)
Evaluate rule of life: Dead cells with exactly three living influencing cells are set alive, living cells with three or four living influencing cells stay alive, all other cells are dead. |
int |
ruleOfMajority(int index)
Every cell is set to the state of the majority state in the influence area. |
void |
run()
Do cell operating until m_numLoops are done or until a call of stop(). |
void |
setColor(int i,
java.awt.Color aColor)
Define color for a cell state. |
void |
setColors()
Set colors of all elements of the elementSet according to their states. |
void |
setCurrLoop(int currLoop)
Set number of current operating loop. |
void |
setElementTags()
Set tag for all elements of the elementSet according to their states. |
void |
setInfluence(java.lang.String aString)
Choose an influence area. |
void |
setNumLoops(int numLoops)
Appoint number of operating loops. |
void |
setNumStates(int anInt)
Define number of possible states of a cell. |
void |
setOutputType(int aType)
Appoint the way of viewing element states. |
void |
setRule(java.lang.String aString)
Choose a operating rule. |
void |
start()
Start cell operator in separate thread. |
void |
stop()
Stop cell operator in separate thread. |
boolean |
update(java.lang.Object event)
Update the class whenever a child has changed. |
| Methods inherited from class jv.project.PjProject |
addDisplay, addGeometry, addGeometry, dispose, dragDisplay, dragInitial, dragVertex, fitDisplays, getAnimation, getDisplay, getDisplays, getGeometry, getGeometry, getNumGeometries, getParameter, getViewer, hasAnimation, hasDisplay, isEnabledAutoFit, markVertices, pickDisplay, pickVertex, removeDisplay, removeGeometries, removeGeometry, selectDisplay, selectGeometry, setAnimation, setDisplay, setEnabledAutoFit, setParameter, setTime, setViewer, unmarkVertices |
| Methods inherited from class jv.object.PsObject |
addInspector, addUpdateListener, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, removeInspector, removeUpdateListener, setName, setParent, setTag, toString, updatePanels |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface jv.anim.PsTimeListenerIf |
getName |
| Methods inherited from interface jv.project.PvPickListenerIf |
getName |
| Methods inherited from interface jv.object.PsUpdateIf |
getFather, getName, setParent |
| Field Detail |
public static final int LIFE
public static final int MAJORITY
protected int rule
public static final int NEIGHBOUR
public static final int CORONA
protected int influence
protected int m_sleepTime
protected PgElementSet m_geom
protected java.awt.Color[] m_color
protected static final int SET_ELEMENT_TAG
protected static final int SET_COLOR
protected int m_outputType
protected PiVector m_markI
protected int m_numStates
protected PiVector[] m_infCell
protected PgVertexStar m_vertexStar
protected PiVector[] m_geomElement
protected PiVector[] m_geomNeighbour
protected java.lang.Thread m_thread
protected int m_numLoops
protected int m_currLoop
protected PnCellOperator_IP m_panel
protected PnCellOperator_Dialog m_dialog
protected boolean m_bUpdateSender
protected boolean m_bMarkGlider
protected boolean m_bUseGlobalElementColor
protected boolean m_bHasElementColors
protected boolean m_bShowTaggedElements
protected java.awt.Color[] m_originalColors
| Constructor Detail |
public PnCellOperator(PgElementSet anElementSet)
| Method Detail |
public void init()
init in class PjProjectpublic void requestPick()
public void releasePick()
public void pickInitial(PvPickEvent pos)
pickInitial in class PjProjectjv.project.PjProjectpos - Pick event issued by the displayPvPickListenerIfpublic void setNumStates(int anInt)
public int getNumStates()
public void setRule(java.lang.String aString)
public void setInfluence(java.lang.String aString)
public java.awt.Color getColor(int i)
public void setColor(int i,
java.awt.Color aColor)
public void setNumLoops(int numLoops)
public void setCurrLoop(int currLoop)
public void markElement(int elemNr)
public void markElement(int elemNr,
int value)
public void markGlider(int elemNr,
int dir)
public void clear()
public int getState(int elemNr)
public void makeInfluence()
public void makeNeighbourInfluence()
public void makeCoronaInfluence()
public void compute()
public void evaluate()
public void setOutputType(int aType)
public void setColors()
public void restoreColors()
public void setElementTags()
public int cellOperator(int index)
public int ruleOfLife(int index)
public int ruleOfMajority(int index)
public boolean update(java.lang.Object event)
update in class PsObjectjv.object.PsUpdateIfevent - carries a lot of informationPsObject,
PsUpdateIf.getFather(),
PsUpdateIf.setParent(PsUpdateIf)public void start()
start in class PjProjectjv.project.PjProjectPvViewerIf.start(),
#isEnabledAutoFit(boolean)public void stop()
stop in class PjProjectjv.project.PjProjectPvViewerIf.stop()public void run()
m_numLoops are done or until a call of stop().run in interface java.lang.Runnablepublic PnCellOperator_Dialog getDialog()
|
JavaView® v2.00.008 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||