28 #include "ui_LayerSearchDialogForm.h" 30 #include "../../dataaccess/datasource/DataSourceInfoManager.h" 31 #include "../../dataaccess/utils/Utils.h" 32 #include "../../geometry/GeometryProperty.h" 35 #include <QFileDialog> 36 #include <QMessageBox> 41 m_ui(new
Ui::MNTLayerSearchDialogForm)
48 connect(
m_ui->m_startsRadioButton, SIGNAL(toggled(
bool)),
this, SLOT(
onstartsEnabled(
bool)));
49 connect(
m_ui->m_endsRadioButton, SIGNAL(toggled(
bool)),
this, SLOT(
onendsEnabled(
bool)));
51 connect(
m_ui->m_equalsRadioButton, SIGNAL(toggled(
bool)),
this, SLOT(
onequalsEnabled(
bool)));
56 connect(
m_ui->m_gridRadioButton, SIGNAL(toggled(
bool)),
this, SLOT(
ongridEnabled(
bool)));
57 connect(
m_ui->m_tinRadioButton, SIGNAL(toggled(
bool)),
this, SLOT(
ontinEnabled(
bool)));
58 connect(
m_ui->m_othersRadioButton, SIGNAL(toggled(
bool)),
this, SLOT(
onothersEnabled(
bool)));
59 connect(
m_ui->m_allRadioButton, SIGNAL(toggled(
bool)),
this, SLOT(
onallEnabled(
bool)));
66 m_ui->m_helpPushButton->setNameSpace(
"dpi.inpe.br.plugins");
67 m_ui->m_helpPushButton->setPageReference(
"plugins/mnt/DTM_LayerSearch.html");
70 m_geom_name <<
"Samples" <<
"Isolines" <<
"TIN" <<
"Undefined" <<
"Grid";
72 m_geom_name <<
"Points" <<
"Lines" <<
"Polygons" <<
"Undefined" <<
"Raster";
81 m_ui->m_layersTable->clear();
83 std::list<te::map::AbstractLayerPtr>::iterator it =
m_layers.begin();
92 item->setData(0, Qt::DisplayRole, i);
94 item->setText(1, it->get()->getTitle().c_str());
96 std::unique_ptr<te::da::DataSetType> dsType(it->get()->getSchema());
98 if (dsType->hasRaster())
100 else if (dsType->hasGeom())
105 item->setText(2,
"");
109 item->setText(3, info->getConnInfoAsString().c_str());
114 m_ui->m_layersTable->resizeColumnToContents(0);
115 m_ui->m_layersTable->resizeColumnToContents(1);
116 m_ui->m_layersTable->resizeColumnToContents(2);
117 m_ui->m_layersTable->resizeColumnToContents(3);
118 m_ui->m_layersTable->sortItems(0, Qt::AscendingOrder);
124 m_ui->m_isolinesRadioButton->setDisabled(
true);
125 m_ui->m_samplesRadioButton->setDisabled(
true);
126 m_ui->m_gridRadioButton->setDisabled(
true);
127 m_ui->m_tinRadioButton->setDisabled(
true);
128 m_ui->m_othersRadioButton->setDisabled(
true);
129 m_ui->m_allRadioButton->setDisabled(
true);
131 for (
int i = 0; i < types.size(); i++)
137 m_ui->m_samplesRadioButton->setDisabled(
false);
138 m_ui->m_samplesRadioButton->setChecked(
true);
141 m_ui->m_isolinesRadioButton->setDisabled(
false);
142 m_ui->m_isolinesRadioButton->setChecked(
true);
145 m_ui->m_gridRadioButton->setDisabled(
false);
146 m_ui->m_gridRadioButton->setChecked(
true);
149 m_ui->m_tinRadioButton->setDisabled(
false);
150 m_ui->m_tinRadioButton->setChecked(
true);
153 m_ui->m_othersRadioButton->setDisabled(
false);
154 m_ui->m_othersRadioButton->setChecked(
true);
158 if (types.size() < 2)
159 m_ui->m_represbuttonGroup->setVisible(
false);
162 m_ui->m_represbuttonGroup->setVisible(
true);
163 m_ui->m_allRadioButton->setDisabled(
false);
227 QTreeWidgetItemIterator it(
m_ui->m_layersTable);
229 (*it)->setHidden(
false);
235 QTreeWidgetItemIterator it(
m_ui->m_layersTable);
237 (*it)->setHidden(
true);
241 QList<QTreeWidgetItem *> select_itens1 =
m_namefilter.isEmpty() ?
m_ui->m_layersTable->findItems(
"*", Qt::MatchWildcard, 1) : \
243 QList<QTreeWidgetItem *> select_itens2 =
m_geomfilter.isEmpty() ?
m_ui->m_layersTable->findItems(
"*", Qt::MatchWildcard, 2) : \
244 m_ui->m_layersTable->findItems(
m_geomfilter, Qt::MatchRegExp, 2);
245 for (
int i = 0; i < select_itens1.size(); i++)
248 if (select_itens2.contains(item))
249 item->setHidden(
false);
321 if (
m_ui->m_isolinesRadioButton->isEnabled())
327 if (
m_ui->m_samplesRadioButton->isEnabled())
335 if (
m_ui->m_gridRadioButton->isEnabled())
342 if (
m_ui->m_tinRadioButton->isEnabled())
349 if (
m_ui->m_othersRadioButton->isEnabled())
367 std::list<te::map::AbstractLayerPtr>::iterator it =
m_layers.begin();
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
void onnameLineEditEditingFinished()
te::map::AbstractLayerPtr m_selectLayer
Selected Layer.
void onisolinesEnabled(bool)
void onstartsEnabled(bool)
static DataSourceInfoManager & getInstance()
It returns a reference to the singleton instance.
void setLayers(std::list< te::map::AbstractLayerPtr > layers)
void onCancelPushButtonClicked()
te::map::AbstractLayerPtr getLayer()
Qt::MatchFlags m_matchflags
std::list< te::map::AbstractLayerPtr > m_layers
List of layers.
void onOkPushButtonClicked()
const QString & GetGeometryName(te::gm::GeomType t)
void onsamplesEnabled(bool)
void oncontainsEnabled(bool)
void setActive(const QList< mntType > &types)
void onequalsEnabled(bool)
void onothersEnabled(bool)
TEDATAACCESSEXPORT te::gm::GeometryProperty * GetFirstGeomProperty(const DataSetType *dt)
std::unique_ptr< Ui::MNTLayerSearchDialogForm > m_ui
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
LayerSearchDialog(QWidget *parent=0, Qt::WindowFlags f=0, bool mnt=true)
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr