Atavism Version 2018.1AGIS API

atavism.server.math
Class Geometry

java.lang.Object
  extended by atavism.server.math.Geometry
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class Geometry
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Class used in the Quad Tree representing a 2 dimensional area works with java bean xml serialization

See Also:
Serialized Form

Field Summary
static float GEO_MAX_X
           
static float GEO_MAX_Z
           
static float GEO_MIN_X
           
static float GEO_MIN_Z
           
 
Constructor Summary
Geometry()
           
Geometry(float minX, float maxX, float minZ, float maxZ)
           
 
Method Summary
 java.lang.Object clone()
           
 boolean contains(Geometry g)
          Is g entirely contained within this Geometry
 boolean contains(Point pt)
          Is pt within this Geometry (edge included)
 Geometry[] divide()
          divides this geometry into 4 equal squares(does not change this obj) and returns the 4 element array 0 1 2 3
 boolean equals(Geometry other)
           
 java.util.Collection<Point> getCorners()
          returns the 4 corners for this geometry
 float getMaxX()
           
 float getMaxZ()
           
 void getMaxZ(int z)
           
 float getMinX()
           
 float getMinZ()
           
 void getMinZ(int z)
           
 boolean isAdjacent(Geometry gOther)
           
static Geometry maxGeometry()
           
 boolean overlaps(Geometry g)
          Does g overlap with this Geometry
 void setMaxX(int x)
           
 void setMinX(int x)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GEO_MIN_X

public static float GEO_MIN_X

GEO_MAX_X

public static float GEO_MAX_X

GEO_MIN_Z

public static float GEO_MIN_Z

GEO_MAX_Z

public static float GEO_MAX_Z
Constructor Detail

Geometry

public Geometry()

Geometry

public Geometry(float minX,
                float maxX,
                float minZ,
                float maxZ)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

equals

public boolean equals(Geometry other)

getMinX

public float getMinX()

getMaxX

public float getMaxX()

getMinZ

public float getMinZ()

getMaxZ

public float getMaxZ()

setMinX

public void setMinX(int x)

setMaxX

public void setMaxX(int x)

getMinZ

public void getMinZ(int z)

getMaxZ

public void getMaxZ(int z)

contains

public boolean contains(Point pt)
Is pt within this Geometry (edge included)


contains

public boolean contains(Geometry g)
Is g entirely contained within this Geometry


overlaps

public boolean overlaps(Geometry g)
Does g overlap with this Geometry


getCorners

public java.util.Collection<Point> getCorners()
returns the 4 corners for this geometry


divide

public Geometry[] divide()
divides this geometry into 4 equal squares(does not change this obj) and returns the 4 element array 0 1 2 3


isAdjacent

public boolean isAdjacent(Geometry gOther)

maxGeometry

public static Geometry maxGeometry()


Copyright © 2018 Dragonsan Studios Sp. z o.o.