DISPLACE  1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
ObjectTreeModel Class Reference

#include <objecttreemodel.h>

Inheritance diagram for ObjectTreeModel:

Public Types

enum  Category {
  Layers = 0, ShapefileLayers, EnvLayers, OutputLayers,
  TariffsLayers, Nodes, Populations, SizeGroups,
  Benthos, BenthosFunctionalGroups, Nations, Firms,
  Metiers, Harbours, Vessels, Ships,
  ShipsTypes, Fishfarms, FishfarmsTypes, Windmills,
  WindfarmsTypes, LastCategory
}
 

Public Member Functions

 ObjectTreeModel (MapObjectsController *map, StatsController *stats, QObject *parent=0)
 
int columnCount (const QModelIndex &parent) const
 
int rowCount (const QModelIndex &parent) const
 
QModelIndex parent (const QModelIndex &child) const
 
QModelIndex index (int row, int column, const QModelIndex &parent) const
 
QVariant data (const QModelIndex &index, int role) const
 
Qt::ItemFlags flags (const QModelIndex &index) const
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
 
void setCurrentModel (int idx, DisplaceModel *model)
 
int getModelIdx () const
 
DisplaceModelgetModel () const
 
MapObjectsControllergetMapControl () const
 
StatsControllergetStatsController () const
 
QModelIndex createCategoryEntity (int row, int column, Category cat) const
 
QModelIndex createCategoryEntityFromChild (Category cat) const
 
QModelIndex createEntity (int row, int column, objecttree::ObjectTreeEntity *entity) const
 
bool isObject (QModelIndex index) const
 
Category getCategory (QModelIndex index) const
 
objecttree::ObjectTreeEntityentity (const QModelIndex &index) const
 
void refresh ()
 

Protected Member Functions

bool isRootLevel (const QModelIndex &level) const
 
bool isCategoryLevel (const QModelIndex &level) const
 

Static Protected Attributes

static QList< objecttree::ObjectTreeEntity * > entityTemplates
 
static QString entityNames []
 

Member Enumeration Documentation

◆ Category

Enumerator
Layers 
ShapefileLayers 
EnvLayers 
OutputLayers 
TariffsLayers 
Nodes 
Populations 
SizeGroups 
Benthos 
BenthosFunctionalGroups 
Nations 
Firms 
Metiers 
Harbours 
Vessels 
Ships 
ShipsTypes 
Fishfarms 
FishfarmsTypes 
Windmills 
WindfarmsTypes 
LastCategory 

Constructor & Destructor Documentation

◆ ObjectTreeModel()

ObjectTreeModel::ObjectTreeModel ( MapObjectsController map,
StatsController stats,
QObject *  parent = 0 
)
explicit

Member Function Documentation

◆ columnCount()

int ObjectTreeModel::columnCount ( const QModelIndex &  parent) const

◆ createCategoryEntity()

QModelIndex ObjectTreeModel::createCategoryEntity ( int  row,
int  column,
Category  cat 
) const

◆ createCategoryEntityFromChild()

QModelIndex ObjectTreeModel::createCategoryEntityFromChild ( ObjectTreeModel::Category  cat) const

◆ createEntity()

QModelIndex ObjectTreeModel::createEntity ( int  row,
int  column,
objecttree::ObjectTreeEntity entity 
) const

◆ data()

QVariant ObjectTreeModel::data ( const QModelIndex &  index,
int  role 
) const

◆ entity()

objecttree::ObjectTreeEntity * ObjectTreeModel::entity ( const QModelIndex &  index) const

◆ flags()

Qt::ItemFlags ObjectTreeModel::flags ( const QModelIndex &  index) const

◆ getCategory()

ObjectTreeModel::Category ObjectTreeModel::getCategory ( QModelIndex  index) const

◆ getMapControl()

MapObjectsController* ObjectTreeModel::getMapControl ( ) const
inline

◆ getModel()

DisplaceModel* ObjectTreeModel::getModel ( ) const
inline

◆ getModelIdx()

int ObjectTreeModel::getModelIdx ( ) const
inline

◆ getStatsController()

StatsController* ObjectTreeModel::getStatsController ( ) const
inline

◆ index()

QModelIndex ObjectTreeModel::index ( int  row,
int  column,
const QModelIndex &  parent 
) const

◆ isCategoryLevel()

bool ObjectTreeModel::isCategoryLevel ( const QModelIndex &  level) const
inlineprotected

◆ isObject()

bool ObjectTreeModel::isObject ( QModelIndex  index) const

◆ isRootLevel()

bool ObjectTreeModel::isRootLevel ( const QModelIndex &  level) const
inlineprotected

◆ parent()

QModelIndex ObjectTreeModel::parent ( const QModelIndex &  child) const

◆ refresh()

void ObjectTreeModel::refresh ( )

◆ rowCount()

int ObjectTreeModel::rowCount ( const QModelIndex &  parent) const

◆ setCurrentModel()

void ObjectTreeModel::setCurrentModel ( int  idx,
DisplaceModel model 
)

◆ setData()

bool ObjectTreeModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)

Member Data Documentation

◆ entityNames

QString ObjectTreeModel::entityNames
staticprotected
Initial value:
= {
QT_TR_NOOP_UTF8("Layers"),
QT_TR_NOOP_UTF8("GIS Shapefile Layers"),
QT_TR_NOOP_UTF8("Environmental Forcing"),
QT_TR_NOOP_UTF8("Monthly Output Layers"),
QT_TR_NOOP_UTF8("Monthly Fishing Tariffs"),
QT_TR_NOOP_UTF8("Nodes"),
QT_TR_NOOP_UTF8("Fish Populations"),
QT_TR_NOOP_UTF8("Fish Size Groups or Age"),
QT_TR_NOOP_UTF8("Benthos"),
QT_TR_NOOP_UTF8("Benthos Functional Groups"),
QT_TR_NOOP_UTF8("Fishing Nations"),
QT_TR_NOOP_UTF8("Fishing Firms"),
QT_TR_NOOP_UTF8("Fishing Metiers"),
QT_TR_NOOP_UTF8("Fishing Harbours"),
QT_TR_NOOP_UTF8("Fishing Vessels"),
QT_TR_NOOP_UTF8("Commercial Shipping"),
QT_TR_NOOP_UTF8("Commercial Shipping Types"),
QT_TR_NOOP_UTF8("Fish Farms"),
QT_TR_NOOP_UTF8("Fish Farm Types"),
QT_TR_NOOP_UTF8("Wind Farms"),
QT_TR_NOOP_UTF8("Wind Farms Types"),
}

◆ entityTemplates

QList< objecttree::ObjectTreeEntity * > ObjectTreeModel::entityTemplates
staticprotected

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