35 #include <QtGui/QApplication> 59 te::map::FeatureLayer* f1 =
new te::map::FeatureLayer(
"1",
"DataSet Layer 1", rootLayer);
60 te::map::FeatureLayer* f11 =
new te::map::FeatureLayer(
"1.1",
"DataSet Layer 1.1", f1);
61 te::map::FeatureLayer* f12 =
new te::map::FeatureLayer(
"1.2",
"DataSet Layer 1.2", f1);
62 te::map::FeatureLayer* f13 =
new te::map::FeatureLayer(
"1.3",
"DataSet Layer 1.3", f1);
64 te::map::FeatureLayer* f2 =
new te::map::FeatureLayer(
"2",
"DataSet Layer 2", rootLayer);
65 te::map::FeatureLayer* f21 =
new te::map::FeatureLayer(
"2.1",
"DataSet Layer 2.1", f2);
66 te::map::FeatureLayer* f22 =
new te::map::FeatureLayer(
"2.2",
"DataSet Layer 2.2", f2);
67 te::map::FeatureLayer* f23 =
new te::map::FeatureLayer(
"2.3",
"DataSet Layer 2.3", f2);
68 te::map::FeatureLayer* f24 =
new te::map::FeatureLayer(
"2.4",
"DataSet Layer 2.4", f2);
71 te::qt::widgets::LayerExplorerModel* model =
new te::qt::widgets::LayerExplorerModel(rootLayer, 0);
74 te::qt::widgets::LayerExplorer explorer(0);
76 explorer.setModel(model);
78 QObject::connect(model, SIGNAL(dragDropEnded(
const QModelIndex&,
const QModelIndex&)),
79 &explorer, SLOT(updateCurrentIndex(
const QModelIndex&,
const QModelIndex&)));
81 explorer.setDragEnabled(
true);
82 explorer.setAcceptDrops(
true);
83 explorer.setDropIndicatorShown(
true);
108 const int maxi = 1000;
111 for(
int i = 1; i <= maxi; ++i)
114 std::string title =
"DataSet Layer " + id;
116 te::map::FeatureLayer* f =
new te::map::FeatureLayer(
id, title, rootLayer);
118 for(
int j = 1; j <= maxj; ++j)
121 title =
"DataSet Layer " + jid;
123 te::map::FeatureLayer* fj =
new te::map::FeatureLayer(jid, title, f);
125 for(
int k = 1; k <= maxk; ++k)
128 title =
"DataSet Layer " + kid;
130 te::map::FeatureLayer* fk =
new te::map::FeatureLayer(kid, title, fj);
137 std::cout << std::endl <<
"Time to create te::map::AbstractLayer hierarchical tree with " << maxi * maxj * maxk <<
" items in: " << end - begin <<
" miliseconds" << std:: endl;
142 te::qt::widgets::LayerExplorerModel* model =
new te::qt::widgets::LayerExplorerModel(rootLayer, 0);
146 std::cout << std::endl <<
"Time to create LayerExplorerModel for the hierarchical tree with " << maxi * maxj * maxk <<
" items in: " << end - begin <<
" miliseconds" << std:: endl;
151 te::qt::widgets::LayerExplorer explorer(0);
153 explorer.setModel(model);
155 QObject::connect(model, SIGNAL(dragDropEnded(
const QModelIndex&,
const QModelIndex&)),
156 &explorer, SLOT(updateCurrentIndex(
const QModelIndex&,
const QModelIndex&)));
158 explorer.setDragEnabled(
true);
159 explorer.setAcceptDrops(
true);
160 explorer.setDropIndicatorShown(
true);
166 std::cout << std::endl <<
"Time to show the LayerExplorer widget for the first time: " << end - begin <<
" miliseconds" << std:: endl;
A layer that can be used as a container for other kind of layers.
Test suite for the LayerExplorer framework.
void tcPerformanceExplorer()
Test Case: do some tests for performance measurement.
CPPUNIT_TEST_SUITE_REGISTRATION(TsLayerExplorer)
This file contains include headers for the TerraLib Common Runtime module.
std::string Convert2String(boost::int16_t value)
It converts a short integer value to a string.
Test suite for the LayerExplorer framework.
void tcCreateExplorer()
Test Case: creating a simple explorer for a set of in-memory layers.