26 const double HexagonalTile::g_side_length = 5.0;
27 const double HexagonalTile::g_half_height = std::sqrt(3.0) * g_side_length / 2;
28 const QPolygonF HexagonalTile::g_start_polygon(QPolygonF() << QPointF(0, 0) << QPointF(g_side_length / 2, g_half_height) << QPointF(3 * g_side_length / 2, g_half_height) << QPointF(2 * g_side_length, 0) << QPointF(3 * g_side_length / 2, -g_half_height) << QPointF(g_side_length / 2, -g_half_height));
32 QPainterPath PolygonToPath(
const QPolygonF &polygon)
35 path.moveTo(polygon.first());
36 path.lineTo(polygon.at(1));
37 path.lineTo(polygon.at(2));
38 path.lineTo(polygon.at(3));
55 return new HexagonalTile(m_polygon.translated(-3 * g_side_length, 0), parentItem());
60 return new HexagonalTile(m_polygon.translated(3 * g_side_length, 0), parentItem());
65 return new HexagonalTile(m_polygon.translated(-3 * g_side_length / 2, -g_half_height), parentItem());
70 return new HexagonalTile(m_polygon.translated(3 * g_side_length / 2, g_half_height), parentItem());
74 :
Tile(polygon, PolygonToPath(polygon))
76 setParentItem(parentItem);
Namespace for SimPT tissue editor package.
HexagonalTile()
Constructor.
virtual HexagonalTile * Left() const
Creates a new tile to the left of this tile (should normally be the opposite of Tile::Right()) Parent...
virtual ~HexagonalTile()
Destructor.
Interface for HexagonalTile.
virtual HexagonalTile * Right() const
Creates a new tile to the right of this tile (should normally be the opposite of Tile::Left()) Parent...
virtual HexagonalTile * Up() const
Creates a new tile on the row under this tile (should normally be the opposite of Tile::Down()) Paren...
Abstract base class for cell pattern tiles.
virtual HexagonalTile * Down() const
Creates a new tile on the row under this tile (should normally be the opposite of Tile::Up()) Parent ...
see the online Qt documentation