|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--cad.simcad.maps.CellGroup
A CellGroup is a set of cell
| Field Summary | |
protected MapUnit[] |
_art
|
protected CellMap |
_cellMap
|
protected int |
_cellNum
|
protected Cell[][] |
_cells
|
protected int |
_maxHeight
|
protected int |
_maxWidth
|
protected Cell |
_ref
This is the Cell from which any Cell from this CellGroup can be reached by adding to a maximum of _maxHeight and _maxWidth |
protected double |
_value
|
protected double |
_z
|
| Constructor Summary | |
CellGroup(CellMap cellMap,
Cell[][] cells)
Creates new CellGroup Ref = lower and west cell of group cell The array given represents a rectangle of cells |
|
CellGroup(CellMap cellMap,
Cell[][] cells,
Cell ref)
|
|
| Method Summary | |
boolean |
belongsTo(Cell c)
This method should be constant time O(c) PRE : A Cell POST : True if the cell belongs to the Cellgroup, false otherwise. |
boolean |
contained(PathPlace pp)
|
boolean |
contains(PathPlace pp)
|
boolean |
containsMapUnit(MapUnit mu)
Returns true if the PathPlace contains the MapUnit given in argument |
abstract CellGroup |
createInstance(CellMap cellMap,
Cell[][] newCells)
|
abstract CellGroup |
createInstance(CellMap cellMap,
Cell[][] newCells,
Cell ref)
|
PathPlace[] |
getAdjacentPathPlaces()
Returns the array of adjacent PathPlace to this one. |
int |
getAverageAltitude()
|
int |
getBiggestXLength()
|
int |
getBiggestYLength()
|
Cell[][] |
getCells()
|
abstract double |
getCostToReachFrom(PathPlace pp,
PathUser pu)
|
MapUnit[] |
getDifference(PathPlace pp)
Return the MapUnits of the PathPlace that are not contained in the given PathPlace |
int |
getEastX()
|
double |
getElevation()
|
int |
getGroupHeight()
|
int |
getGroupWidth()
return the width of the group cells |
java.lang.Object |
getImplementingObject()
|
abstract MapUnit[] |
getInnerMapUnitBoundary()
Returns an Array of MapUnits that make the inner boundary of the PathPlace This method applied to a MapUnit PathPlace returns itself |
MapUnit[] |
getIntersection(PathPlace pp)
Return the MapUnit contained in both PathPlaces( argument and object) |
AbstractMap |
getMap()
|
MapUnit[] |
getMyAdjacentMapUnits(PathPlace pp)
Returns the MapUnits of this PathPlace adjacent to the PathPlace given in argument |
int |
getNorthY()
POST : the biggest Y position of the CellGroup |
MapUnit[] |
getNotMyAdjacentMapUnits(PathPlace pp)
Returns the MapUnits of the PathPlace given in argument adjacent to this PathPlace If the PathPlace in argument contains |
int |
getNumberOfCells()
|
MapUnit[] |
getOuterMapUnitBoundary()
Returns an Array of MapUnits that make the outer boundary of the PathPlace This method applied to a MapUnit PathPlace returns the same MapUnits |
int |
getRatio(double d)
Returns the steepness of the slope as a percentage It is rounded down. |
int |
getResolution()
|
int |
getSouthY()
|
abstract int |
getSteepRatio(MapUnit mu)
|
MapUnit[] |
getUnits()
Returns an array of the MapUnit making up the PathPlace |
double |
getValue()
|
int |
getWestX()
|
int |
getX()
|
int |
getY()
|
MapUnit[] |
intersection(PathPlace pp)
Return the MapUnit contained in both PathPlaces( argument and object) |
boolean |
isAdjacent(PathPlace pp)
Returns true if the PathPlace given in argument is adjacent returns false otherwise |
CellGroup |
moveEast()
|
CellGroup |
moveNorth()
Return a new CellGroup. |
CellGroup |
moveNorthEast()
|
CellGroup |
moveNorthWest()
|
CellGroup |
moveSouth()
Return a new CellGroup. |
CellGroup |
moveSouthEast()
|
CellGroup |
moveSouthWest()
|
CellGroup |
moveWest()
For performance reason, this method does not check for consistency |
void |
setValue(double value)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface cad.simcad.objectserver.spec.pathfinding.PathPlace |
equals, getNumberOfUnits |
| Methods inherited from interface java.util.Comparator |
compare, equals |
| Field Detail |
protected int _cellNum
protected CellMap _cellMap
protected Cell[][] _cells
protected int _maxHeight
protected int _maxWidth
protected double _value
protected double _z
protected MapUnit[] _art
protected Cell _ref
| Constructor Detail |
public CellGroup(CellMap cellMap,
Cell[][] cells)
public CellGroup(CellMap cellMap,
Cell[][] cells,
Cell ref)
| Method Detail |
public int getNumberOfCells()
public boolean belongsTo(Cell c)
public Cell[][] getCells()
public int getGroupWidth()
public int getGroupHeight()
public int getNorthY()
getNorthY in interface PathPlacepublic int getX()
getX in interface PathPlacepublic int getY()
getY in interface PathPlacepublic int getEastX()
getEastX in interface PathPlacepublic int getSouthY()
getSouthY in interface PathPlacepublic int getWestX()
getWestX in interface PathPlace
public abstract CellGroup createInstance(CellMap cellMap,
Cell[][] newCells,
Cell ref)
public abstract CellGroup createInstance(CellMap cellMap,
Cell[][] newCells)
public CellGroup moveWest()
public CellGroup moveNorth()
public CellGroup moveSouth()
public CellGroup moveEast()
public CellGroup moveNorthWest()
public CellGroup moveSouthEast()
public CellGroup moveNorthEast()
public CellGroup moveSouthWest()
public abstract MapUnit[] getInnerMapUnitBoundary()
getInnerMapUnitBoundary in interface PathPlacepublic boolean containsMapUnit(MapUnit mu)
containsMapUnit in interface PathPlacepublic MapUnit[] intersection(PathPlace pp)
public MapUnit[] getMyAdjacentMapUnits(PathPlace pp)
getMyAdjacentMapUnits in interface PathPlacepublic MapUnit[] getIntersection(PathPlace pp)
getIntersection in interface PathPlacepublic boolean contains(PathPlace pp)
contains in interface PathPlacepublic boolean contained(PathPlace pp)
contained in interface PathPlacepublic int getRatio(double d)
public int getResolution()
public java.lang.Object getImplementingObject()
public void setValue(double value)
setValue in interface PathPlacepublic double getValue()
public double getElevation()
public abstract int getSteepRatio(MapUnit mu)
public abstract double getCostToReachFrom(PathPlace pp,
PathUser pu)
getCostToReachFrom in interface PathPlacepublic int getAverageAltitude()
public boolean isAdjacent(PathPlace pp)
PathPlace
isAdjacent in interface PathPlacepublic PathPlace[] getAdjacentPathPlaces()
PathPlace
getAdjacentPathPlaces in interface PathPlacepublic MapUnit[] getNotMyAdjacentMapUnits(PathPlace pp)
getNotMyAdjacentMapUnits in interface PathPlacepublic MapUnit[] getUnits()
getUnits in interface PathPlacepublic AbstractMap getMap()
getMap in interface PathPlacepublic MapUnit[] getOuterMapUnitBoundary()
getOuterMapUnitBoundary in interface PathPlacepublic int getBiggestXLength()
getBiggestXLength in interface PathPlacepublic int getBiggestYLength()
getBiggestYLength in interface PathPlacepublic MapUnit[] getDifference(PathPlace pp)
getDifference in interface PathPlace
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||