27 #include "../../../../common/Translator.h" 
   28 #include "../../../../dataaccess/datasource/DataSourceInfoManager.h" 
   29 #include "../../../../maptools/DataSetLayer.h" 
   30 #include "../../../../se/RasterSymbolizer.h" 
   31 #include "../../../../se/Style.h" 
   32 #include "../../../../se/Utils.h" 
   33 #include "../../Exception.h" 
   64   if(role == Qt::DecorationRole)
 
   66     if(m_layer->isValid())
 
   68       std::auto_ptr<te::da::DataSetType> schema = m_layer->getSchema();
 
   70       if(!schema->hasGeom() && !schema->hasRaster())
 
   71         return QVariant(QIcon::fromTheme(
"dataset-layer-tabular"));
 
   73         return QVariant(QIcon::fromTheme(
"dataset-layer"));
 
   77       return QVariant(QIcon::fromTheme(
"dataset-layer-invalid"));
 
   81   if(role == Qt::DisplayRole)
 
   82     return QVariant(QString::fromStdString(m_layer->getTitle()));
 
   84   if(role == Qt::CheckStateRole)
 
   85     return QVariant(m_layer->getVisibility() == 
te::map::VISIBLE ? Qt::Checked : Qt::Unchecked);
 
   87   if(role == Qt::ToolTipRole)
 
   88     return buildToolTip();
 
  100   return (((m_layer->getStyle() != 0) && (!m_layer->getStyle()->getRules().empty())) || m_layer->getGrouping() != 0 || m_layer->getChart() != 0);
 
  105   return Qt::ItemIsUserCheckable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled;
 
  110   if(m_layer->getStyle() && children().empty())
 
  112     const std::vector<te::se::Rule*>& rules = m_layer->getStyle()->getRules();
 
  114     for(std::size_t i = 0; i != rules.size(); ++i)
 
  118   if(m_layer->getStyle())
 
  126   if(m_layer->getGrouping() && !hasGroupingItem())
 
  129   if(m_layer->getChart() && !hasChartItem())
 
  130     new ChartItem(m_layer->getChart(), 
this);
 
  135   return ((m_layer->getStyle() != 0) && (!m_layer->getStyle()->getRules().empty())) || m_layer->getGrouping() != 0 || m_layer->getChart() != 0;
 
  140   if(role == Qt::CheckStateRole)
 
  142     Qt::CheckState checkState = 
static_cast<Qt::CheckState
>(value.toInt());
 
  144     if(checkState == Qt::Checked)
 
  146     else if(checkState == Qt::Unchecked)
 
  149     m_layer->updateVisibilityOfAncestors();
 
  164   return "DATASET_LAYER_ITEM";
 
  169   GroupingItem* groupingItem = findChild<GroupingItem*>();
 
  171   return groupingItem != 0;
 
  176   ChartItem* chartItem = findChild<ChartItem*>();
 
  178   return chartItem != 0;
 
  190   if(!m_layer->isValid())
 
  191     return tr(
"Invalid Layer");
 
  196   toolTip += tr(
"DataSet") + 
": " + m_layer->getDataSetName().c_str() + 
"\n";
 
  199   const std::string& 
id = m_layer->getDataSourceId();
 
  201   const std::map<std::string, std::string>& connInfo = info->getConnInfo();
 
  203   toolTip += tr(
"Connection Info") + 
":\n";
 
  206   std::map<std::string, std::string>::const_iterator it;
 
  207   for(it = connInfo.begin(); it != connInfo.end(); ++it)
 
  209     toolTip += it->first.c_str();
 
  211     toolTip += it->second.c_str();
 
  213     if(i != connInfo.size())
 
TESEEXPORT RasterSymbolizer * GetRasterSymbolizer(Style *s)
Try to get raster symbolizer from a style. 
 
The class that represents a dataset layer item in a LayerTreeModel. 
 
static DataSourceInfoManager & getInstance()
It returns a reference to the singleton instance. 
 
The RasterSymbolizer describes how to render raster/matrix-coverage data (e.g., satellite photos...
 
A class that represents a chart of a layer in a LayerTreeModel. 
 
te::se::ColorMap * getColorMap() const 
 
A layer with reference to a dataset. 
 
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
 
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr
 
A class that represents a color map of rastersymbolizer of a layer in a LayerTreeModel.