math.geom2d.grid
Class TriangleGrid2D

Package class diagram package TriangleGrid2D
java.lang.Object
  extended by math.geom2d.grid.TriangleGrid2D
All Implemented Interfaces:
Grid2D

public class TriangleGrid2D
extends Object
implements Grid2D

Defines a triangle grid, with various size and orientation. The grid contains triangle with all edges the same length.

Author:
dlegland

Constructor Summary
TriangleGrid2D()
           
TriangleGrid2D(double s)
           
TriangleGrid2D(double x0, double y0)
           
TriangleGrid2D(double x0, double y0, double s)
           
TriangleGrid2D(double x0, double y0, double s, double theta)
           
TriangleGrid2D(Point2D point)
          Assumes unit grid.
TriangleGrid2D(Point2D point, double s)
           
TriangleGrid2D(Point2D point, double s, double theta)
           
 
Method Summary
 Point2D getClosestVertex(Point2D point)
           
 Collection<LineSegment2D> getEdges(Box2D box)
           
 Point2D getOrigin()
           
 double getSize()
           
 double getTheta()
           
 PointSet2D getVertices(Box2D box)
           
 void setAngle(double theta)
          Deprecated. grids are supposed to be immutable (0.8.0)
 void setOrigin(Point2D point)
          Deprecated. grids are supposed to be immutable (0.8.0)
 void setSize(double s)
          Deprecated. grids are supposed to be immutable (0.8.0)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TriangleGrid2D

public TriangleGrid2D()

TriangleGrid2D

public TriangleGrid2D(double s)
Parameters:
s - size of the triangle tile

TriangleGrid2D

public TriangleGrid2D(double x0,
                      double y0)
Parameters:
x0 - x-coord of grid origin
y0 - y-coord of grid origin

TriangleGrid2D

public TriangleGrid2D(double x0,
                      double y0,
                      double s)
Parameters:
x0 - x-coord of grid origin
y0 - y-coord of grid origin
s - size of the triangle tile

TriangleGrid2D

public TriangleGrid2D(double x0,
                      double y0,
                      double s,
                      double theta)
Parameters:
x0 - x-coord of grid origin
y0 - y-coord of grid origin
s - size of the triangle tile
theta - orientation of the grid with horizontal

TriangleGrid2D

public TriangleGrid2D(Point2D point)
Assumes unit grid.

Parameters:
point - the grid origin

TriangleGrid2D

public TriangleGrid2D(Point2D point,
                      double s)
Parameters:
point - the grid origin
s - size of the triangle tile

TriangleGrid2D

public TriangleGrid2D(Point2D point,
                      double s,
                      double theta)
Parameters:
point - the grid origin
s - size of the triangle tile
theta - orientation of the grid with horizontal
Method Detail

setOrigin

@Deprecated
public void setOrigin(Point2D point)
Deprecated. grids are supposed to be immutable (0.8.0)


getOrigin

public Point2D getOrigin()
Specified by:
getOrigin in interface Grid2D

getSize

public double getSize()

setSize

@Deprecated
public void setSize(double s)
Deprecated. grids are supposed to be immutable (0.8.0)


setAngle

@Deprecated
public void setAngle(double theta)
Deprecated. grids are supposed to be immutable (0.8.0)


getTheta

public double getTheta()

getClosestVertex

public Point2D getClosestVertex(Point2D point)
Specified by:
getClosestVertex in interface Grid2D

getEdges

public Collection<LineSegment2D> getEdges(Box2D box)
Specified by:
getEdges in interface Grid2D

getVertices

public PointSet2D getVertices(Box2D box)
Specified by:
getVertices in interface Grid2D


Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.