Package heronarts.lx.model
Class GridModel
java.lang.Object
heronarts.lx.model.LXNormalizationBounds
heronarts.lx.model.LXModel
heronarts.lx.model.GridModel
- All Implemented Interfaces:
LXSerializable
Model of points in a simple grid.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
class
Nested classes/interfaces inherited from class heronarts.lx.model.LXModel
LXModel.Geometry, LXModel.GeometryFunction, LXModel.Listener, LXModel.Tag
Nested classes/interfaces inherited from interface heronarts.lx.LXSerializable
LXSerializable.Utils
-
Field Summary
Modifier and TypeFieldDescriptionfinal List<GridModel.Strip>
All the columns in this modelfinal int
Height of the gridfinal GridModel.Metrics
Metrics for the gridfinal GridModel.Point[]
Points in the modelfinal List<GridModel.Strip>
All the rows in this modelfinal int
Width of the gridfinal float
Spacing on the x-axisfinal float
Spacing on the y-axis -
Constructor Summary
ConstructorDescriptionGridModel
(int width, int height) Constructs a uniformly spaced grid model of the given size with all pixels apart by a unit of 1.GridModel
(int width, int height, float xSpacing, float ySpacing) Constructs a grid model with specified x and y spacingGridModel
(GridModel.Metrics metrics) Constructs a grid model with the given metrics -
Method Summary
Methods inherited from class heronarts.lx.model.LXModel
addListener, ancestor, bang, children, computeGeometry, contains, debugPrint, dispose, getGeneration, getGeometry, getGeometry, getNormalizationBounds, getParent, getPath, getPoints, getRoot, load, meta, normalizePoints, reindexPoints, removeListener, save, sub, toIndexBuffer, toIndexBuffer, update, update, update, validateTags
-
Field Details
-
points
Points in the model -
rows
All the rows in this model -
columns
All the columns in this model -
metrics
Metrics for the grid -
width
public final int widthWidth of the grid -
height
public final int heightHeight of the grid -
xSpacing
public final float xSpacingSpacing on the x-axis -
ySpacing
public final float ySpacingSpacing on the y-axis
-
-
Constructor Details
-
GridModel
Constructs a grid model with the given metrics- Parameters:
metrics
- Metrics
-
GridModel
public GridModel(int width, int height) Constructs a uniformly spaced grid model of the given size with all pixels apart by a unit of 1.- Parameters:
width
- Width in pixelsheight
- Height in pixels
-
GridModel
public GridModel(int width, int height, float xSpacing, float ySpacing) Constructs a grid model with specified x and y spacing- Parameters:
width
- Number of nodes in x dimensionheight
- Number of nodes in y dimensionxSpacing
- Spacing of nodes in x dimensionySpacing
- Spacing of nodes in y dimension
-
-
Method Details
-
getPoint
-