22 #ifndef FIFE_MODEL_GRIDS_CELLGRID_H 23 #define FIFE_MODEL_GRIDS_CELLGRID_H 59 virtual const std::string&
getType()
const = 0;
63 virtual const std::string&
getName()
const = 0;
130 const std::vector<ModelCoordinate>& orig,
bool reverse =
false) = 0;
void setZScale(const double scale)
Set the cellgrid z-scaling.
virtual double getAdjacentCost(const ModelCoordinate &curpos, const ModelCoordinate &target)=0
Returns distance const from curpos to target point only cells adjacent to curpos are considered in th...
virtual std::vector< ModelCoordinate > toMultiCoordinates(const ModelCoordinate &position, const std::vector< ModelCoordinate > &orig, bool reverse=false)=0
Returns point vector with coordinates for a multi object.
const double getYShift() const
Get the cellgrid y shift.
virtual ~CellGrid()
Destructor.
void setZShift(const double zshift)
Set the cellgrid z shift.
Base class for all fife classes Used e.g.
virtual const std::string & getType() const =0
Type of cellgrid.
DoubleMatrix m_inverse_matrix
void setXShift(const double &xshift)
Set the cellgrid x shift.
void setYScale(const double scale)
Set the cellgrid y-scaling.
const double getZShift() const
Get the cellgrid z shift.
void setXScale(const double scale)
Set the cellgrid x-scaling.
virtual void getVertices(std::vector< ExactModelCoordinate > &vtx, const ModelCoordinate &cell)=0
Fills given point vector with vertices from selected cell.
const double getRotation() const
Get the cellgrid rotation.
virtual double getHeuristicCost(const ModelCoordinate &curpos, const ModelCoordinate &target)=0
Returns distance const from curpos to target point.
void setYShift(const double yshift)
Set the cellgrid y shift.
const bool getAllowDiagonals() const
Get whether diagonal cell access is allowed.
const double getXShift() const
Get the cellgrid x shift.
void setAllowDiagonals(const bool allow_diagonals)
Set whether diagonal cell access is allowed.
const double getXScale() const
Get the cellgrid x-scaling.
const double getYScale() const
Get the cellgrid y-scaling.
virtual CellGrid * clone()=0
Returns clone of this cellgrid.
int32_t orientation(const ExactModelCoordinate &pt, const ExactModelCoordinate &pt1, const ExactModelCoordinate &pt2)
virtual const std::string & getName() const =0
Name of the cellgrid (DEPRECATED? -jwt)
const double getZScale() const
Get the cellgrid z-scaling.
void setRotation(const double rotation)
Set the cellgrid rotation.
virtual uint32_t getCellSideCount() const =0
Gets the count of sides for a single cell.
virtual std::vector< ModelCoordinate > getCoordinatesInLine(const ModelCoordinate &start, const ModelCoordinate &end)=0
Returns point vector with coordinates for a line from start to end.
void getAccessibleCoordinates(const ModelCoordinate &curpos, std::vector< ModelCoordinate > &coordinates)
Gets the coordinates that are accesible from given point only cells adjacent to given cell are consid...
ExactModelCoordinate toMapCoordinates(const ModelCoordinate &layer_coords)
Transforms given point from layer coordinates to map coordinates.
virtual ExactModelCoordinate toExactLayerCoordinates(const ExactModelCoordinate &map_coord)=0
Transforms given point from map coordinates to layer coordinates.
bool ptInTriangle(const ExactModelCoordinate &pt, const ExactModelCoordinate &pt1, const ExactModelCoordinate &pt2, const ExactModelCoordinate &pt3)
virtual bool isAccessible(const ModelCoordinate &curpos, const ModelCoordinate &target)=0
Tells if given target point is accessible from curpos only cells adjacent to curpos are considered in...
virtual ModelCoordinate toLayerCoordinatesFromExactLayerCoordinates(const ExactModelCoordinate &exact_layer_coords)=0
Transforms given point from exact layer coordinates to cell precision layer coordinates.
virtual ModelCoordinate toLayerCoordinates(const ExactModelCoordinate &map_coord)=0
Transforms given point from map coordinates to layer coordinates.