|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.miv.pherd.ntree.NTree
public class NTree
n-Tree.
Cell| Nested Class Summary | |
|---|---|
static class |
NTree.OutOfUniverseMode
How to handle particles that go out of the root cell space ?. |
| Field Summary | |
|---|---|
protected int |
depthmax
Maximum depth of the n-tree. |
protected Cell |
laMama
The root cell. |
protected ArrayList<NTreeListener> |
listeners
The set of listeners. |
protected Point3 |
max
The minimum and maximum points of the universe when growing the root cell, if a resize of the root cell space is needed. |
protected Point3 |
min
The minimum and maximum points of the universe when growing the root cell, if a resize of the root cell space is needed. |
protected boolean |
needResize
Set to true each time some particles left the root cell space and this space needs to be resized. |
protected NTree.OutOfUniverseMode |
oum
How to handle particles that leave the universe initial bounding box. |
protected ParticleBox |
pbox
The particle set. |
protected int |
pmax
Maximum number of particles by cell. |
| Constructor Summary | |
|---|---|
NTree(int pmax,
CellData data,
ParticleBox pbox)
New n-Tree with a universe of (-1,-1,-1) to (1,1,1). |
|
NTree(int pmax,
CellSpace space,
CellData data,
ParticleBox pbox)
New n-Tree with a universe defined by the given space. |
|
| Method Summary | |
|---|---|
void |
addListener(NTreeListener listener)
Add a listener that will receive events abound the ntree. |
void |
addParticle(Particle particle)
Add a particle in the tree. |
void |
checkDivisions()
Recursively check if cells need subdivision or fusion. |
protected void |
delete(Particle particle)
Ask a particle to remove itself from the particle box. |
protected void |
describeTheCurrentState(NTreeListener listener)
Send events for all already existing cells to the newly added listener. |
String |
generateCellIdentifier(Cell parent,
int index)
Generate an identifier for a cell given its parent and index in this parent. |
Point3 |
getHighestPoint()
The highest coordinate used by a particle. |
ArrayList<NTreeListener> |
getListeners()
The set of listeners of this tree. |
Point3 |
getLowestPoint()
The lowest coordinate used by a particle. |
int |
getMaxDepth()
Maximum number of subdivisions of a cell. |
int |
getMaxParticlePerCell()
Maximum number of particles per cell. |
NTree.OutOfUniverseMode |
getOutOfUniverseMode()
What to do if a particle leaves the root cell ?. |
Cell |
getRootCell()
The tree root cell. |
protected void |
handleOutParticle(Particle particle)
Decide what to do for a particle that moved out of the root cell space. |
protected boolean |
isValid()
Make a recursive check of each cell of the tree. |
void |
removeListener(NTreeListener listener)
Remove a listener. |
void |
removeParticle(Particle particle)
Remove a particle from the tree. |
protected void |
resize(Particle particle)
Specify that a particle is out of the root cell space. |
void |
setDepthMax(int max)
Set the maximum depth of the tree. |
void |
setOutOfUniverseMode(NTree.OutOfUniverseMode mode)
Tell what to do when a particle leaves the root cell. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ParticleBox pbox
protected Cell laMama
protected int pmax
protected int depthmax
protected ArrayList<NTreeListener> listeners
protected NTree.OutOfUniverseMode oum
protected boolean needResize
checkDivisions()protected Point3 min
checkDivisions()protected Point3 max
checkDivisions()| Constructor Detail |
|---|
public NTree(int pmax,
CellData data,
ParticleBox pbox)
pmax - Maximum number of particle by cell, once this number is
superseded, the cell subdivides itself.data - The data specific to each cell.pbox - The particle set.
public NTree(int pmax,
CellSpace space,
CellData data,
ParticleBox pbox)
pmax - Maximum number of particle by cell, once this number is
superseded, the cell subdivides itself.space - The universe bounding box.data - The data specific to each cell.pbox - The particle set.| Method Detail |
|---|
public Cell getRootCell()
public int getMaxParticlePerCell()
public int getMaxDepth()
public ArrayList<NTreeListener> getListeners()
public NTree.OutOfUniverseMode getOutOfUniverseMode()
public Point3 getLowestPoint()
public Point3 getHighestPoint()
public void setDepthMax(int max)
max - The maximum number of decomposition of space (>0).public void addListener(NTreeListener listener)
listener - The listener to add.public void removeListener(NTreeListener listener)
listener - The listener to remove.protected void describeTheCurrentState(NTreeListener listener)
listener - The newly added listener.public void removeParticle(Particle particle)
particle - The particle to remove.public void addParticle(Particle particle)
particle - The particle to add.public void checkDivisions()
public String generateCellIdentifier(Cell parent,
int index)
parent - The parent.index - The cell index.
public void setOutOfUniverseMode(NTree.OutOfUniverseMode mode)
mode - The mode to follow.protected void handleOutParticle(Particle particle)
protected void delete(Particle particle)
particle - The particle to remove.protected void resize(Particle particle)
particle - The outrageous particle.protected boolean isValid()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||