27 #include "../../../dataaccess/dataset/DataSet.h"
28 #include "../../../dataaccess/dataset/DataSetType.h"
29 #include "../../../dataaccess/utils/Utils.h"
30 #include "../../../maptools/DataSetLayer.h"
31 #include "../../../maptools/RasterLayer.h"
32 #include "../../../se/ChannelSelection.h"
33 #include "../../../se/ColorMap.h"
34 #include "../../../se/CoverageStyle.h"
35 #include "../../../se/RasterSymbolizer.h"
36 #include "../../../se/SelectedChannel.h"
37 #include "../../../se/Utils.h"
41 #include "ui_GroupingDialogForm.h"
45 m_ui(new Ui::GroupingDialogForm),
52 m_ui->m_okPushButton->setEnabled(
false);
56 m_ui->m_helpPushButton->setPageReference(
"widgets/grouping/grouping.html");
68 std::auto_ptr<te::map::LayerSchema> dsType(layer->getSchema());
72 buildVectorialGroupingInteface();
74 m_groupingWidget->setLayer(layer);
76 else if(dsType->hasRaster())
78 buildRasterGroupingInteface();
80 if(layer->getType() ==
"DATASETLAYER")
88 std::auto_ptr<te::da::DataSet> ds = m_layer->getData();
93 m_raster.reset(ds->getRaster(rpos).release());
97 else if(layer->getType() ==
"RASTERLAYER")
111 if(m_rasterSymb->getColorMap())
113 m_colorMapWidget->
setColorMap(m_rasterSymb->getColorMap());
119 m_colorMapWidget->setColorMap(cm);
125 m_colorMapWidget->setRaster(m_raster.get());
135 connect(m_groupingWidget, SIGNAL(applyPushButtonClicked()),
this, SLOT(onApplyClicked()));
138 QGridLayout* layout =
new QGridLayout(m_ui->m_widget);
139 layout->setContentsMargins(0,0,0,0);
140 layout->addWidget(m_groupingWidget);
148 connect(m_colorMapWidget, SIGNAL(applyPushButtonClicked()),
this, SLOT(onApplyClicked()));
151 QGridLayout* layout =
new QGridLayout(m_ui->m_widget);
152 layout->setContentsMargins(0,0,0,0);
153 layout->addWidget(m_colorMapWidget);
162 m_layer->setGrouping(g);
169 m_rasterSymb->setColorMap(cm);
171 std::string band = m_colorMapWidget->getCurrentBand();
198 m_ui->m_okPushButton->setEnabled(
true);
void setSourceChannelName(const std::string &name)
A layer with reference to a dataset.
GroupingDialog(QWidget *parent=0, Qt::WindowFlags f=0)
Constructs a basic fill dialog which is a child of parent, with widget flags set to f...
ChannelSelection specifies the false-color channel selection for a multi-spectral raster source (such...
This class contains the parameters needed for grouping the values of a Property.
~GroupingDialog()
Destructor.
void onPushButtonClicked()
A selected channel to be display.
A dialog used to build a grouping.
void setColorMap(ColorMap *c)
A ColorMap defines either the colors of a pallette-type raster source or the mapping of numeric pixel...
void setLayer(te::map::AbstractLayerPtr layer)
void buildRasterGroupingInteface()
A dialog used to build a ColorMap element.
TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet *dataset, int datatype)
std::auto_ptr< Ui::GroupingDialogForm > m_ui
Dialog form.
virtual te::se::Style * getStyle() const
It returns the Style associated to the layer.
TESEEXPORT RasterSymbolizer * GetRasterSymbolizer(Style *s)
Try to get raster symbolizer from a style.
void buildVectorialGroupingInteface()
void setGrayChannel(SelectedChannel *c)
te::rst::Raster * getRaster() const
SelectedChannel * getGrayChannel() const
void setColorCompositionType(ColorCompositionType cct)
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
A widget used to build a grouping.
A layer with reference to a raster.
A widget used to build a grouping.