|
degate 0.1.1
|
Base class for grid types. More...
#include <Grid.h>

Public Types | |
| enum | ORIENTATION { UNDEFINED = 0, HORIZONTAL = 1, VERTICAL = 2 } |
| Enum to declare the type of a grid. More... | |
| typedef std::list< int > | grid_set |
| typedef grid_set::const_iterator | grid_iter |
Public Member Functions | |
| Grid (ORIENTATION _orientation, bool _enabled=false) | |
| Create a new grid. | |
| virtual | ~Grid () |
| The destructor. | |
| virtual grid_iter | begin () const =0 |
| Get an iterator to iterate over grid offsets. | |
| virtual grid_iter | end () const =0 |
| Get an end marker for ther iteration. | |
| virtual void | clear ()=0 |
| Clear the grid. | |
| virtual void | set_enabled (bool state=true) |
| Set the state, whether a grid is enabled or not. | |
| virtual bool | is_enabled () const |
| Check the state, whether a grid is enabled or not. | |
| virtual int | snap_to_grid (int pos) const =0 |
| Get the nearest offset, that is on grid. | |
| virtual ORIENTATION | get_orientation () const |
| Get the grid orientation. | |
| virtual bool | is_horizontal () const |
| Check grid orientation: this is if the spacing is horizontal (vertical lines). | |
| virtual bool | is_vertical () const |
| Check grid orientation: this is if the spacing is vertical (horizontal lines.) | |
Private Attributes | |
| ORIENTATION | orientation |
| bool | enabled |
| typedef grid_set::const_iterator degate::Grid::grid_iter |
| typedef std::list<int> degate::Grid::grid_set |
Enum to declare the type of a grid.
Definition at line 42 of file Grid.h.
{
UNDEFINED = 0,
HORIZONTAL = 1,
VERTICAL = 2
};
| degate::Grid::Grid | ( | ORIENTATION | _orientation, |
| bool | _enabled = false |
||
| ) | [inline] |
Create a new grid.
| _orientation | This parameter defines the orientation. E.g. a horizontal grid that defines horizontal spacings. This means that lines are vertical. |
| _enabled | You can enable/disable grids. With this parameter you can control whether the grid is enabled od disabled. |
Definition at line 65 of file Grid.h.
:
orientation(_orientation),
enabled(_enabled) {}
| virtual degate::Grid::~Grid | ( | ) | [inline, virtual] |
| virtual grid_iter degate::Grid::begin | ( | ) | const [pure virtual] |
Get an iterator to iterate over grid offsets.
Implemented in degate::IrregularGrid, and degate::RegularGrid.
| virtual void degate::Grid::clear | ( | ) | [pure virtual] |
Clear the grid.
Implemented in degate::IrregularGrid, and degate::RegularGrid.
| virtual grid_iter degate::Grid::end | ( | ) | const [pure virtual] |
Get an end marker for ther iteration.
Implemented in degate::IrregularGrid, and degate::RegularGrid.
| virtual ORIENTATION degate::Grid::get_orientation | ( | ) | const [inline, virtual] |
Get the grid orientation.
Definition at line 115 of file Grid.h.
References orientation.
{ return orientation; }
| virtual bool degate::Grid::is_enabled | ( | ) | const [inline, virtual] |
| virtual bool degate::Grid::is_horizontal | ( | ) | const [inline, virtual] |
Check grid orientation: this is if the spacing is horizontal (vertical lines).
Definition at line 121 of file Grid.h.
References HORIZONTAL, and orientation.
{ return orientation == HORIZONTAL; }
| virtual bool degate::Grid::is_vertical | ( | ) | const [inline, virtual] |
Check grid orientation: this is if the spacing is vertical (horizontal lines.)
Definition at line 127 of file Grid.h.
References orientation, and VERTICAL.
{ return orientation == VERTICAL; }
| virtual void degate::Grid::set_enabled | ( | bool | state = true | ) | [inline, virtual] |
| virtual int degate::Grid::snap_to_grid | ( | int | pos | ) | const [pure virtual] |
Get the nearest offset, that is on grid.
Implemented in degate::IrregularGrid, and degate::RegularGrid.
bool degate::Grid::enabled [private] |
Definition at line 51 of file Grid.h.
Referenced by is_enabled(), and set_enabled().
ORIENTATION degate::Grid::orientation [private] |
Definition at line 50 of file Grid.h.
Referenced by get_orientation(), is_horizontal(), and is_vertical().
1.7.4