net.aerith.misao.util
Class TriangleMatchingSolver.TriangleMap

java.lang.Object
  |
  +--net.aerith.misao.util.PositionMap
        |
        +--net.aerith.misao.util.TriangleMatchingSolver.TriangleMap
Enclosing class:
TriangleMatchingSolver

protected class TriangleMatchingSolver.TriangleMap
extends PositionMap

The TriangleMap represents a map of triangles based on the ratio of edges.


Field Summary
protected  double unit_ratio
          The unit of ratio, which must be greater than 1.0.
 
Fields inherited from class net.aerith.misao.util.PositionMap
accept_out_of_bounds, bottom_right, list, table, table_columns, table_rows, top_left
 
Constructor Summary
TriangleMatchingSolver.TriangleMap(Triangle[] triangles, int division_count, double unit_ratio)
          Constructs a TriangleMap with a list of Triangles, the number to divide this map and the unit of ratio, and divides this map into some parts for fast search.
 
Method Summary
protected  Position convertPosition(Position position)
          Converts the (x,y) position into the proper system for this map.
 
Methods inherited from class net.aerith.misao.util.PositionMap
acceptOutOfBounds, addPosition, addPosition, divide, divideByCircleCoverage, divideByUnit, exceptOutOfBounds, getAllPositions, getArea, getBottomLeftCorner, getBottomRightCorner, getCenter, getDividedPositionMapList, getHeight, getPartialList, getPartialListWithinRadius, getPartialListWithinSteps, getTopLeftCorner, getTopRightCorner, getWidth, isOutOfBounds, paramString, removePosition, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

unit_ratio

protected double unit_ratio
The unit of ratio, which must be greater than 1.0.
Constructor Detail

TriangleMatchingSolver.TriangleMap

public TriangleMatchingSolver.TriangleMap(Triangle[] triangles,
                                          int division_count,
                                          double unit_ratio)
                                   throws java.lang.IllegalArgumentException
Constructs a TriangleMap with a list of Triangles, the number to divide this map and the unit of ratio, and divides this map into some parts for fast search.

This map is divided into division_count x division_count parts. The unit of ratio must be greater than 1.0.

Parameters:
triangles - the list of triangles.
division_count - the number to divide this map.
unit_ratio - the unit of ratio to divide.
Throws:
java.lang.IllegalArgumentException - if the specified division count is not greater than 1.0.
Method Detail

convertPosition

protected Position convertPosition(Position position)
Converts the (x,y) position into the proper system for this map.
Overrides:
convertPosition in class PositionMap
Parameters:
position - the original (x,y).
Returns:
the converted position in the system of this map.