Package HAL.Interfaces
Interface Grid3D
-
- All Known Implementing Classes:
AgentGrid3D
,Grid3Ddouble
,Grid3Dint
,Grid3Dlong
,Grid3Dobject
,OpenGL3DWindow
,PDEGrid3D
,PopulationGrid3D
,PopulationGrid3DLong
public interface Grid3D
holds functions that all 3D Grids share
-
-
Method Summary
Modifier and Type Method Description default int
ApplyHood(int[] hood, int centerX, int centerY, int centerZ, Coords3DAction Action)
applies the action function to all positions in the neighborhooddefault int
ApplyHood(int[] hood, int centerI, Coords3DAction Action)
applies the action function to all positions in the neighborhooddefault void
ApplyHoodMapped(int[] hood, int validCount, IndexAction Action)
applies the action function to all positions in the neighborhood up to validCount, assumes the neighborhood is already mappeddefault void
ApplyRectangle(int startX, int startY, int startZ, int width, int height, int depth, Coords3DAction Action)
applies the action function to all positions in the rectangle, will use wraparound if appropriatedefault int[]
BoundaryIs()
returns a list of indices, where each index maps to one square on the boundary of the griddefault boolean
ContainsValidI(int[] hood, int centerX, int centerY, int centerZ, Coords3DBool IsValid)
returns whether a valid index exists in the neighborhooddefault boolean
ContainsValidI(int[] hood, int centerI, Coords3DBool IsValid)
returns whether a valid index exists in the neighborhooddefault int
ConvI(int i, Grid3D other)
returns the index of the center of the square in otherGrid that the coordinate maps to.default double
ConvXpt(double x, Grid3D other)
returns the position that x rescales to in the other griddefault int
ConvXsq(int x, Grid3D other)
returns the index of the center of the square in otherGrid that the coordinate maps to.default double
ConvYpt(double y, Grid3D other)
returns the position that y rescales to in the other griddefault int
ConvYsq(int y, Grid3D other)
returns the index of the center of the square in otherGrid that the coordinate maps to.default double
ConvZpt(double z, Grid3D other)
returns the position that z rescales to in the other griddefault int
ConvZsq(int z, Grid3D other)
returns the index of the center of the square in otherGrid that the coordinate maps to.default double
DispX(double x1, double x2)
gets the displacement from the first coorinate to the second.default double
DispY(double y1, double y2)
gets the displacement from the first coorinate to the second.default double
DispZ(double z1, double z2)
gets the displacement from the first coorinate to the second.default double
Dist(double x1, double y1, double z1, double x2, double y2, double z2)
gets the distance between two positions with or without grid wrap around (if wraparound is enabled, the shortest distance taking this into account will be returned)default double
DistSquared(double x1, double y1, double z1, double x2, double y2, double z2)
gets the distance squared between two positions with or without grid wrap around (if wraparound is enabled, the shortest distance taking this into account will be returned) more efficient than the Dist function above as it skips a square-root calculation.default int
GetHoodI(int[] hood, int centerX, int centerY, int centerZ, int entryIndex)
gets one mapped index from the neighborhooddefault int
I(double x, double y, double z)
gets the index of the square that contains the specified coordinatesdefault int
I(int x, int y, int z)
gets the index of the voxel at the specified coordinatesdefault boolean
In(double x, double y, double z)
returns whether the specified coordinates are inside the typeGrid boundsdefault boolean
In(int x, int y, int z)
returns whether the specified coordinates are inside the typeGrid boundsdefault boolean
InWrap(double x, double y, double z)
returns whether the specified coordinates are inside the Grid bounds with wraparounddefault boolean
InWrap(int x, int y, int z)
returns whether the specified coordinates are inside the Grid bounds with wraparoundboolean
IsWrapX()
boolean
IsWrapY()
boolean
IsWrapZ()
default int
ItoX(int i)
gets the xDim component of the voxel at the specified indexdefault int
ItoY(int i)
gets the yDim component of the voxel at the specified indexdefault int
ItoZ(int i)
gets the z component of the voxel at the specified indexint
Length()
default int
MapHood(int[] hood, int centerI)
This function is very similar to the previous definition of MapHood, only it additionally takes as argument an EvaluationFunctoin.default int
MapHood(int[] hood, int centerX, int centerY, int centerZ)
This function is very similar to the previous definition of MapHood, only it additionally takes as argument an EvaluationFunctoin.default int
MapHood(int[] hood, int centerX, int centerY, int centerZ, IndexCoords3DBool Eval)
This function is very similar to the previous definition of MapHood, only it additionally takes as argument an EvaluationFunctoin.default int
MapHood(int[] hood, int centerI, IndexCoords3DBool Eval)
This function takes a neighborhood centered around the origin, translates the set of coordinates to be centered around a particular central location, and computes which indices the translated coordinates map to.default int
RandomHoodI(int[] hood, int centerX, int centerY, int centerZ, Rand rng)
gets a random index from the full neighborhood, if the index does not map, returns -1default int
WrapI(int x, int y, int z)
gets the index of the square at the specified coordinates with wrap aroundint
Xdim()
int
Ydim()
int
Zdim()
-
-
-
Method Detail
-
WrapI
default int WrapI(int x, int y, int z)
gets the index of the square at the specified coordinates with wrap around
-
I
default int I(int x, int y, int z)
gets the index of the voxel at the specified coordinates
-
ItoX
default int ItoX(int i)
gets the xDim component of the voxel at the specified index
-
ItoY
default int ItoY(int i)
gets the yDim component of the voxel at the specified index
-
ItoZ
default int ItoZ(int i)
gets the z component of the voxel at the specified index
-
I
default int I(double x, double y, double z)
gets the index of the square that contains the specified coordinates
-
In
default boolean In(int x, int y, int z)
returns whether the specified coordinates are inside the typeGrid bounds
-
In
default boolean In(double x, double y, double z)
returns whether the specified coordinates are inside the typeGrid bounds
-
InWrap
default boolean InWrap(int x, int y, int z)
returns whether the specified coordinates are inside the Grid bounds with wraparound
-
InWrap
default boolean InWrap(double x, double y, double z)
returns whether the specified coordinates are inside the Grid bounds with wraparound
-
MapHood
default int MapHood(int[] hood, int centerX, int centerY, int centerZ)
This function is very similar to the previous definition of MapHood, only it additionally takes as argument an EvaluationFunctoin. this function should take as argument (i,x,y) of a location and return a boolean that decides whether that location should be included as a valid one.
-
MapHood
default int MapHood(int[] hood, int centerX, int centerY, int centerZ, IndexCoords3DBool Eval)
This function is very similar to the previous definition of MapHood, only it additionally takes as argument an EvaluationFunctoin. this function should take as argument (i,x,y) of a location and return a boolean that decides whether that location should be included as a valid one.
-
MapHood
default int MapHood(int[] hood, int centerI)
This function is very similar to the previous definition of MapHood, only it additionally takes as argument an EvaluationFunctoin. this function should take as argument (i,x,y) of a location and return a boolean that decides whether that location should be included as a valid one.
-
MapHood
default int MapHood(int[] hood, int centerI, IndexCoords3DBool Eval)
This function takes a neighborhood centered around the origin, translates the set of coordinates to be centered around a particular central location, and computes which indices the translated coordinates map to. The function returns the number of valid locations it set. this function differs from HoodToIs and CoordsToIs in that it takes no ret[], MapHood instead puts the result of the mapping back into the hood array.
-
BoundaryIs
default int[] BoundaryIs()
returns a list of indices, where each index maps to one square on the boundary of the grid
-
ConvXsq
default int ConvXsq(int x, Grid3D other)
returns the index of the center of the square in otherGrid that the coordinate maps to.
-
ConvYsq
default int ConvYsq(int y, Grid3D other)
returns the index of the center of the square in otherGrid that the coordinate maps to.
-
ConvZsq
default int ConvZsq(int z, Grid3D other)
returns the index of the center of the square in otherGrid that the coordinate maps to.
-
ConvI
default int ConvI(int i, Grid3D other)
returns the index of the center of the square in otherGrid that the coordinate maps to.
-
ConvXpt
default double ConvXpt(double x, Grid3D other)
returns the position that x rescales to in the other grid
-
ConvYpt
default double ConvYpt(double y, Grid3D other)
returns the position that y rescales to in the other grid
-
ConvZpt
default double ConvZpt(double z, Grid3D other)
returns the position that z rescales to in the other grid
-
ApplyRectangle
default void ApplyRectangle(int startX, int startY, int startZ, int width, int height, int depth, Coords3DAction Action)
applies the action function to all positions in the rectangle, will use wraparound if appropriate
-
ApplyHood
default int ApplyHood(int[] hood, int centerI, Coords3DAction Action)
applies the action function to all positions in the neighborhood
-
ApplyHood
default int ApplyHood(int[] hood, int centerX, int centerY, int centerZ, Coords3DAction Action)
applies the action function to all positions in the neighborhood
-
ApplyHoodMapped
default void ApplyHoodMapped(int[] hood, int validCount, IndexAction Action)
applies the action function to all positions in the neighborhood up to validCount, assumes the neighborhood is already mapped
-
ContainsValidI
default boolean ContainsValidI(int[] hood, int centerI, Coords3DBool IsValid)
returns whether a valid index exists in the neighborhood
-
ContainsValidI
default boolean ContainsValidI(int[] hood, int centerX, int centerY, int centerZ, Coords3DBool IsValid)
returns whether a valid index exists in the neighborhood
-
RandomHoodI
default int RandomHoodI(int[] hood, int centerX, int centerY, int centerZ, Rand rng)
gets a random index from the full neighborhood, if the index does not map, returns -1
-
GetHoodI
default int GetHoodI(int[] hood, int centerX, int centerY, int centerZ, int entryIndex)
gets one mapped index from the neighborhood
-
DispX
default double DispX(double x1, double x2)
gets the displacement from the first coorinate to the second. using wraparound if allowed over the given axis to find the shortest displacement.
-
DispY
default double DispY(double y1, double y2)
gets the displacement from the first coorinate to the second. using wraparound if allowed over the given axis to find the shortest displacement.
-
DispZ
default double DispZ(double z1, double z2)
gets the displacement from the first coorinate to the second. using wraparound if allowed over the given axis to find the shortest displacement.
-
Dist
default double Dist(double x1, double y1, double z1, double x2, double y2, double z2)
gets the distance between two positions with or without grid wrap around (if wraparound is enabled, the shortest distance taking this into account will be returned)
-
DistSquared
default double DistSquared(double x1, double y1, double z1, double x2, double y2, double z2)
gets the distance squared between two positions with or without grid wrap around (if wraparound is enabled, the shortest distance taking this into account will be returned) more efficient than the Dist function above as it skips a square-root calculation.
-
Xdim
int Xdim()
-
Ydim
int Ydim()
-
Zdim
int Zdim()
-
Length
int Length()
-
IsWrapX
boolean IsWrapX()
-
IsWrapY
boolean IsWrapY()
-
IsWrapZ
boolean IsWrapZ()
-
-