sexi.comp
Class ForestBasic
java.lang.Object
|
+--sexi.comp.ForestBasic
- All Implemented Interfaces:
- ForestBasicStand, java.io.Serializable
- Direct Known Subclasses:
- Forest
- public class ForestBasic
- extends java.lang.Object
- implements ForestBasicStand, java.io.Serializable
- See Also:
- Serialized Form
Method Summary |
void |
addTree(TreeBasic t)
|
void |
addTrees(TreeBasic[] tb)
|
void |
clear()
|
java.util.Collection |
cropTrees()
return the trees removed
cause by area size change. |
DimensionArea |
getArea()
Return the area of forest |
Point3f[] |
getCrownBottomMap()
|
Point3f[] |
getCrownCenterMap()
|
Point3f[] |
getCrownTopPosition()
|
long |
getCurrentID()
Return current active ID |
LightParameters |
getLightParameters()
return cloned GrowthParameters |
static java.util.Map |
getNeighbourMap(java.util.Collection trees,
DimensionArea area,
java.awt.geom.Point2D center,
float radius,
java.lang.String[] neighbourConstant)
|
java.util.Map |
getNeighbourMap(java.awt.geom.Point2D center,
float radius)
|
TreeBasic[] |
getTreeContains(java.awt.geom.Point2D p)
|
static TreeBasic[] |
getTreeContains(java.awt.geom.Point2D p,
TreeBasic[] source)
|
static TreeBasic[] |
getTreeContains(java.awt.geom.Rectangle2D r,
TreeBasic[] source)
|
static TreeBasic[] |
getTreeCrownsContains(java.awt.geom.Rectangle2D r,
TreeBasic[] source)
|
(package private) java.util.ArrayList |
getTreeList()
|
TreeBasic[] |
getTrees()
|
java.util.Collection |
getTreeSet()
|
static java.util.Collection |
getTreesOnRadius(TreeBasic[] trees,
DimensionArea area,
java.awt.geom.Point2D center,
float radius,
java.lang.String treeBasicConst)
return the subset of tress that contained in radius specified
relative from point p. |
static TreeBasic[] |
getTreesOutsideArea(TreeBasic[] t,
DimensionArea a)
|
boolean |
removeAllTrees(TreeBasic[] tArr)
|
void |
removeTree(TreeBasic t)
|
void |
resetNeighboursLink()
|
void |
setArea(DimensionArea a)
Set the area of forest |
void |
setLightParameters(LightParameters p)
|
static void |
setNeighbourLink(TreeBasic t1,
TreeBasic t2,
DimensionArea a,
float radius)
|
void |
setNeighboursLink(TreeBasic[] tb)
|
void |
setTrees(TreeBasic[] tb)
|
int |
size()
|
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
lightParam
LightParameters lightParam
ForestBasic
public ForestBasic()
ForestBasic
public ForestBasic(TreeBasic[] t)
ForestBasic
public ForestBasic(DimensionArea areaSize)
addTree
public void addTree(TreeBasic t)
addTrees
public void addTrees(TreeBasic[] tb)
setTrees
public void setTrees(TreeBasic[] tb)
getTreeContains
public TreeBasic[] getTreeContains(java.awt.geom.Point2D p)
getTreeContains
public static TreeBasic[] getTreeContains(java.awt.geom.Point2D p,
TreeBasic[] source)
getTreeContains
public static TreeBasic[] getTreeContains(java.awt.geom.Rectangle2D r,
TreeBasic[] source)
getTreeCrownsContains
public static TreeBasic[] getTreeCrownsContains(java.awt.geom.Rectangle2D r,
TreeBasic[] source)
setArea
public void setArea(DimensionArea a)
- Set the area of forest
cropTrees
public java.util.Collection cropTrees()
- return the trees removed
cause by area size change.
getTreesOutsideArea
public static TreeBasic[] getTreesOutsideArea(TreeBasic[] t,
DimensionArea a)
getArea
public DimensionArea getArea()
- Return the area of forest
- Specified by:
getArea
in interface ForestBasicStand
getCurrentID
public long getCurrentID()
- Return current active ID
setNeighboursLink
public void setNeighboursLink(TreeBasic[] tb)
resetNeighboursLink
public void resetNeighboursLink()
setNeighbourLink
public static void setNeighbourLink(TreeBasic t1,
TreeBasic t2,
DimensionArea a,
float radius)
getTreesOnRadius
public static java.util.Collection getTreesOnRadius(TreeBasic[] trees,
DimensionArea area,
java.awt.geom.Point2D center,
float radius,
java.lang.String treeBasicConst)
- return the subset of tress that contained in radius specified
relative from point p.
if "egde" false the space is considered as torus.
if the space is torus, the trees outside the area are cloned
from the opponent trees inside, otherwise it's the same object.
getNeighbourMap
public java.util.Map getNeighbourMap(java.awt.geom.Point2D center,
float radius)
- Specified by:
getNeighbourMap
in interface ForestBasicStand
getNeighbourMap
public static java.util.Map getNeighbourMap(java.util.Collection trees,
DimensionArea area,
java.awt.geom.Point2D center,
float radius,
java.lang.String[] neighbourConstant)
getCrownTopPosition
public Point3f[] getCrownTopPosition()
getCrownCenterMap
public Point3f[] getCrownCenterMap()
getCrownBottomMap
public Point3f[] getCrownBottomMap()
getTrees
public TreeBasic[] getTrees()
- Specified by:
getTrees
in interface ForestBasicStand
getTreeSet
public java.util.Collection getTreeSet()
getTreeList
java.util.ArrayList getTreeList()
size
public int size()
- Specified by:
size
in interface ForestBasicStand
clear
public void clear()
removeTree
public void removeTree(TreeBasic t)
removeAllTrees
public boolean removeAllTrees(TreeBasic[] tArr)
setLightParameters
public void setLightParameters(LightParameters p)
getLightParameters
public LightParameters getLightParameters()
- return cloned GrowthParameters
- Specified by:
getLightParameters
in interface ForestBasicStand