27 #include "../../../../common/Config.h" 
   28 #include "../../../../common/Translator.h" 
   29 #include "../../../../common/Logger.h" 
   31 #include "../../../../dataaccess/dataset/DataSetType.h" 
   32 #include "../../../../dataaccess/datasource/DataSourceInfoManager.h" 
   33 #include "../../../../dataaccess/datasource/DataSourceManager.h" 
   35 #include "../../../../dataaccess/datasource/DataSourceCapabilities.h" 
   36 #include "../../../../maptools/AbstractLayer.h" 
   37 #include "../../../widgets/datasource/core/DataSourceTypeManager.h" 
   38 #include "../../../widgets/layer/utils/DataSet2Layer.h" 
   39 #include "../../../widgets/Utils.h" 
   41 #include "../../../af/ApplicationController.h" 
   42 #include "../../../af/Project.h" 
   43 #include "../../../af/Utils.h" 
   44 #include "../../../af/events/LayerEvents.h" 
   48 #include "../../../../cellspace/CellSpaceOperations.h" 
   51 #include <boost/uuid/random_generator.hpp> 
   52 #include <boost/uuid/uuid_io.hpp> 
   53 #include <boost/filesystem.hpp> 
   57 #include <QFileDialog> 
   60 #include <QMessageBox> 
   64   std::list<te::da::DataSetTypePtr> res;
 
   68   std::vector<std::string> dsets = ds->getDataSetNames();
 
   70   std::vector<std::string>::iterator it;
 
   72   for(it = dsets.begin(); it != dsets.end(); ++it)
 
   80   std::list<te::map::AbstractLayerPtr> res;
 
   89  te::plugin::
Plugin(pluginInfo),
 
  107   m_initialized = 
true;
 
  113   if(act != 0 && mnu != 0)
 
  115     QWidget* parent = act->parentWidget();
 
  116     m_openFile = 
new QAction(QIcon::fromTheme(
"file-raster"), tr(
"Raster File..."), parent);
 
  117     m_openFile->setObjectName(
"Project.Add Layer.Raster File");
 
  118     mnu->insertAction(act, m_openFile);
 
  123     connect (m_openFile, SIGNAL(triggered()), SLOT(openFileDialog()));
 
  137   m_initialized = 
false;
 
  144   QStringList fileNames = QFileDialog::getOpenFileNames(
 
  149   if(fileNames.isEmpty())
 
  152   QFileInfo info(fileNames.value(0));
 
  156   std::list<te::map::AbstractLayerPtr> layers;
 
  158   for(QStringList::iterator it = fileNames.begin(); it != fileNames.end(); ++it)
 
  162     ds->setAccessDriver(
"GDAL");
 
  164     std::map<std::string, std::string> dsinfo;
 
  165     dsinfo[
"URI"] = it->toLatin1().data();
 
  167     ds->setConnInfo(dsinfo);
 
  169     ds->setDescription(
"A single raster file");
 
  171     boost::uuids::basic_random_generator<boost::mt19937> gen;
 
  172     boost::uuids::uuid u = gen();
 
  173     std::string 
id = boost::uuids::to_string(u);
 
  177     boost::filesystem::path mpath(it->toStdString());
 
  179     std::string fileBaseName = mpath.stem().string();
 
  181     ds->setTitle(fileBaseName);
 
  196   if(selectedLayers.size() == 1 && selectedLayers.front()->getType() == 
"FOLDERLAYER")
 
  197     parentLayer = selectedLayers.front();
 
  199   std::list<te::map::AbstractLayerPtr>::iterator it;
 
  200   for(it = layers.begin(); it != layers.end(); ++it)
 
#define TE_LOG_TRACE(msg)
Use this tag in order to log a message to a specified logger with the TRACE level. 
 
This event signals that a new layer was created. 
 
boost::shared_ptr< DataSetType > DataSetTypePtr
 
boost::shared_ptr< DataSource > DataSourcePtr
 
Plugin(const te::plugin::PluginInfo &pluginInfo)
 
void startup()
Do nothing! Just set plugin as started. 
 
void GetLayers(const te::da::DataSourceInfoPtr &info, std::list< te::map::AbstractLayerPtr > &layers)
 
#define TE_TR(message)
It marks a string in order to get translated. 
 
#define PLUGIN_CALL_BACK_IMPL(PLUGIN_CLASS_NAME)
This macro should be used by C++ plugins in order to declare the exportable/callable DLL function...
 
TEQTAFEXPORT void AddActionToCustomToolbars(QAction *act)
Check QSettings for existance of act and adds it if necessary. 
 
Plugin implementation for the GDAL data source widget. 
 
static DataSourceManager & getInstance()
It returns a reference to the singleton instance. 
 
~Plugin()
Virtual destructor. 
 
void shutdown()
Do nothing! Just set plugin as stopped. 
 
A class that represents a data source component. 
 
The basic information about a plugin. 
 
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
 
std::list< te::da::DataSetTypePtr > GetDataSetsInfo(const te::da::DataSourceInfoPtr &info)
 
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr