degate  0.1.2
Public Types | Public Member Functions | Private Attributes
degate::Grid Class Reference

Base class for grid types. More...

#include <Grid.h>

Inheritance diagram for degate::Grid:
Inheritance graph
[legend]

List of all members.

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

Detailed Description

Base class for grid types.

Definition at line 34 of file Grid.h.


Member Typedef Documentation

typedef grid_set::const_iterator degate::Grid::grid_iter

Definition at line 55 of file Grid.h.

typedef std::list<int> degate::Grid::grid_set

Definition at line 54 of file Grid.h.


Member Enumeration Documentation

Enum to declare the type of a grid.

Enumerator:
UNDEFINED 
HORIZONTAL 
VERTICAL 

Definition at line 42 of file Grid.h.

                     {
      UNDEFINED = 0,
      HORIZONTAL = 1,
      VERTICAL = 2
    };

Constructor & Destructor Documentation

degate::Grid::Grid ( ORIENTATION  _orientation,
bool  _enabled = false 
) [inline]

Create a new grid.

Parameters:
_orientationThis parameter defines the orientation. E.g. a horizontal grid that defines horizontal spacings. This means that lines are vertical.
_enabledYou 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]

The destructor.

Definition at line 73 of file Grid.h.

{}

Member Function Documentation

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]

Check the state, whether a grid is enabled or not.

Definition at line 103 of file Grid.h.

References enabled.

{ return enabled; }
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]

Set the state, whether a grid is enabled or not.

Definition at line 97 of file Grid.h.

References enabled.

{ enabled = state; }
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.


Member Data Documentation

bool degate::Grid::enabled [private]

Definition at line 51 of file Grid.h.

Referenced by is_enabled(), and set_enabled().

Definition at line 50 of file Grid.h.

Referenced by get_orientation(), is_horizontal(), and is_vertical().


The documentation for this class was generated from the following file: