27 #include "../../Config.h" 48 #include <QApplication> 62 #ifdef TERRALIB_MOD_OGR_ENABLED 71 std::cout << std::endl <<
"Failed to load the data source OGR driver: unknown exception!" << std::endl;
78 std::string renda =
"densidade";
82 std::unique_ptr<te::da::DataSetType>
dt = transactor->
getDataSetType(
"sp_cities");
93 chartStyle->
setTitle(QString::fromUtf8(
"Histogram"));
94 chartStyle->
setAxisX(QString::fromUtf8(renda.c_str()));
95 chartStyle->
setAxisY(QString::fromUtf8(
"Frequency"));
100 chart->
attach(chartDisplay);
104 displayWidget->show();
105 displayWidget->setWindowTitle(
"Histogram");
106 displayWidget->setAttribute(Qt::WA_DeleteOnClose,
true);
112 std::string renda =
"densidade";
113 std::string anosest =
"codmicro";
118 std::unique_ptr<te::da::DataSetType>
dt = transactor->
getDataSetType(
"sp_cities");
126 chartStyle->
setTitle(QString::fromUtf8(
"Scatter"));
127 chartStyle->
setAxisX(QString::fromUtf8(renda.c_str()));
128 chartStyle->
setAxisY(QString::fromUtf8(anosest.c_str()));
133 chart->attach(chartDisplay);
137 displayWidget->show();
138 displayWidget->setWindowTitle(
"Scatter");
139 displayWidget->setAttribute(Qt::WA_DeleteOnClose,
true);
152 std::string connInfo(
"file://");
154 std::string data_dir = TERRALIB_DATA_DIR;
155 connInfo += data_dir +
"/shape";
160 std::unique_ptr<te::da::DataSourceTransactor> transactor = ds->getTransactor();
162 std::unique_ptr<te::da::DataSet> dataset = transactor->getDataSet(
"sp_cities");
170 QString title(
"Testing Chart Widgets");
178 catch(
const std::exception& e)
180 std::cout << std::endl <<
"An exception has occurred: " << e.what() << std::endl;
186 std::cout << std::endl <<
"An unexpected exception has occurred!" << std::endl;
static std::unique_ptr< DataSource > make(const std::string &driver, const te::core::URI &connInfo)
void generateHistogram(te::da::DataSet *dataset, std::string datasourceId, te::da::DataSourceTransactor *transactor)
Include files for Core Plugin Library.
boost::shared_ptr< DataSetType > DataSetTypePtr
void generateScatter(te::da::DataSet *dataset, te::da::DataSourceTransactor *transactor)
void insert(const PluginInfo &pinfo)
Adds plugin with its plugin information to the list of unloaded plugins.
This is the base class for Layers.
TEDATAACCESSEXPORT std::size_t GetPropertyPos(const DataSet *dataset, const std::string &name)
Basic information about a plugin.
static te::dt::Date ds(2010, 01, 01)
void load(const std::string &plugin_name, const bool start=true)
It tries to load the informed plugin.
A class to represent a histogram.
std::string name
The plugin name: an internal value used to identify the plugin in the system. Must be a unique value...
static PluginManager & instance()
Access the singleton.
void finalize()
It finalizes the TerraLib Platform.
static TerraLib & getInstance()
It returns a reference to the singleton instance.
static te::dt::TimeDuration dt(20, 30, 50, 11)
A class to represent a histogram chart.
A DataSourceTransactor can be viewed as a connection to the data source for reading/writing things in...
A class to represent a scatter's chart.
A class to represent a scatter.
void initialize()
It initializes the TerraLib Platform.
A dataset is the unit of information manipulated by the data access module of TerraLib.
TECOREEXPORT PluginInfo JSONPluginInfoSerializer(const std::string &file_name)
A plugin finder that search for plugins in some special directories defined by compile time macros...
TECOREEXPORT std::string FindInTerraLibPath(const std::string &path)
Returns the path relative to a directory or file in the context of TerraLib.
This file contains include headers for the TerraLib Common Runtime module.
A class used to define a chartDisplay's style.
void clear()
Stop and unload all plugins, then clear the internal list of plugins.
virtual std::unique_ptr< te::da::DataSetType > getDataSetType(const std::string &name)=0
It gets information about the given dataset.
This file contains include headers for the Data Access module of TerraLib.
A class to represent a chart display.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr