OpenMW
|
Model for the region map. More...
#include <regionmap.hpp>
Classes | |
struct | CellDescription |
Public Types | |
typedef std::pair< int, int > | CellIndex |
Public Member Functions | |
RegionMap (Data &data) | |
virtual int | rowCount (const QModelIndex &parent=QModelIndex()) const |
virtual int | columnCount (const QModelIndex &parent=QModelIndex()) const |
virtual QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const |
virtual Qt::ItemFlags | flags (const QModelIndex &index) const |
Private Slots | |
void | regionsAboutToBeRemoved (const QModelIndex &parent, int start, int end) |
void | regionsInserted (const QModelIndex &parent, int start, int end) |
void | regionsChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight) |
void | cellsAboutToBeRemoved (const QModelIndex &parent, int start, int end) |
void | cellsInserted (const QModelIndex &parent, int start, int end) |
void | cellsChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight) |
Private Member Functions | |
CellIndex | getIndex (const QModelIndex &index) const |
Translates a Qt model index into a cell index (which can contain negative components) | |
QModelIndex | getIndex (const CellIndex &index) const |
void | buildRegions () |
void | buildMap () |
void | addCell (const CellIndex &index, const CellDescription &description) |
May be called on a cell that is already in the map (in which case an update is. | |
void | addCells (int start, int end) |
void | removeCell (const CellIndex &index) |
May be called on a cell that is not in the map (in which case the call is ignored) | |
void | addRegion (const std::string ®ion, unsigned int colour) |
void | removeRegion (const std::string ®ion) |
void | updateRegions (const std::vector< std::string > ®ions) |
Update cells affected by the listed regions. | |
void | updateSize () |
std::pair< CellIndex, CellIndex > | getSize () const |
Private Attributes | |
Data & | mData |
std::map< CellIndex, CellDescription > | mMap |
CellIndex | mMin |
inclusive | |
CellIndex | mMax |
exclusive | |
std::map< std::string, unsigned int > | mColours |
region ID, colour (RGBA) |
Model for the region map.
This class does not holds any record data (other than for the purpose of buffering).
typedef std::pair<int, int> CSMWorld::RegionMap::CellIndex |
CSMWorld::RegionMap::RegionMap | ( | Data & | data | ) |
void CSMWorld::RegionMap::addCell | ( | const CellIndex & | index, |
const CellDescription & | description | ||
) | [private] |
May be called on a cell that is already in the map (in which case an update is.
void CSMWorld::RegionMap::addCells | ( | int | start, |
int | end | ||
) | [private] |
void CSMWorld::RegionMap::addRegion | ( | const std::string & | region, |
unsigned int | colour | ||
) | [private] |
May be called on a region that is already listed (in which case an update is performed)
void CSMWorld::RegionMap::buildMap | ( | ) | [private] |
void CSMWorld::RegionMap::buildRegions | ( | ) | [private] |
void CSMWorld::RegionMap::cellsAboutToBeRemoved | ( | const QModelIndex & | parent, |
int | start, | ||
int | end | ||
) | [private, slot] |
void CSMWorld::RegionMap::cellsChanged | ( | const QModelIndex & | topLeft, |
const QModelIndex & | bottomRight | ||
) | [private, slot] |
void CSMWorld::RegionMap::cellsInserted | ( | const QModelIndex & | parent, |
int | start, | ||
int | end | ||
) | [private, slot] |
int CSMWorld::RegionMap::columnCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const [virtual] |
QVariant CSMWorld::RegionMap::data | ( | const QModelIndex & | index, |
int | role = Qt::DisplayRole |
||
) | const [virtual] |
Qt::ItemFlags CSMWorld::RegionMap::flags | ( | const QModelIndex & | index | ) | const [virtual] |
CSMWorld::RegionMap::CellIndex CSMWorld::RegionMap::getIndex | ( | const QModelIndex & | index | ) | const [private] |
Translates a Qt model index into a cell index (which can contain negative components)
QModelIndex CSMWorld::RegionMap::getIndex | ( | const CellIndex & | index | ) | const [private] |
std::pair< CSMWorld::RegionMap::CellIndex, CSMWorld::RegionMap::CellIndex > CSMWorld::RegionMap::getSize | ( | ) | const [private] |
void CSMWorld::RegionMap::regionsAboutToBeRemoved | ( | const QModelIndex & | parent, |
int | start, | ||
int | end | ||
) | [private, slot] |
void CSMWorld::RegionMap::regionsChanged | ( | const QModelIndex & | topLeft, |
const QModelIndex & | bottomRight | ||
) | [private, slot] |
void CSMWorld::RegionMap::regionsInserted | ( | const QModelIndex & | parent, |
int | start, | ||
int | end | ||
) | [private, slot] |
void CSMWorld::RegionMap::removeCell | ( | const CellIndex & | index | ) | [private] |
May be called on a cell that is not in the map (in which case the call is ignored)
void CSMWorld::RegionMap::removeRegion | ( | const std::string & | region | ) | [private] |
May be called on a region that is not listed (in which case the call is ignored)
int CSMWorld::RegionMap::rowCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const [virtual] |
void CSMWorld::RegionMap::updateRegions | ( | const std::vector< std::string > & | regions | ) | [private] |
Update cells affected by the listed regions.
void CSMWorld::RegionMap::updateSize | ( | ) | [private] |
std::map<std::string, unsigned int> CSMWorld::RegionMap::mColours [private] |
region ID, colour (RGBA)
Data& CSMWorld::RegionMap::mData [private] |
std::map<CellIndex, CellDescription> CSMWorld::RegionMap::mMap [private] |
CellIndex CSMWorld::RegionMap::mMax [private] |
exclusive
CellIndex CSMWorld::RegionMap::mMin [private] |
inclusive