27 #include "../../../common/STLUtils.h" 28 #include "../../../maptools/Utils.h" 29 #include "../../../maptools/AbstractLayer.h" 30 #include "../../../se/Style.h" 39 #include <QApplication> 43 void RemoveImage(
const std::string lId, std::map<std::string, QImage*>& imgs)
45 std::map<std::string, QImage*>::iterator it = imgs.find(lId);
56 std::string lId = layer->
getId();
62 m_showFeedback(showFeedback),
66 setAttribute(Qt::WA_OpaquePaintEvent,
true);
75 setAttribute(Qt::WA_OpaquePaintEvent,
true);
108 double scale = std::round(
getScale());
165 std::map<std::string, QImage*> imgs;
171 std::string lId = (*it)->getId();
173 std::map<std::string, QImage*>::iterator imgIt =
m_images.find(lId);
177 imgs[lId] = imgIt->second;
182 QImage* img =
new QImage(size(), QImage::Format_ARGB32_Premultiplied);
205 QApplication::setOverrideCursor(Qt::WaitCursor);
250 for (std::size_t i = 0; i < layers.size(); ++i)
283 double widthByHeight =
static_cast<double>(width()) / static_cast<double>(height());
285 if(widthByHeight > ww / wh)
288 ww = wh * widthByHeight;
295 wh = ww / widthByHeight;
318 std::map<std::string, QImage*>::iterator img_it =
m_images.find(l->
getId());
325 painter.drawImage(0, 0, *img_it->second);
332 const int& ,
const QImage& )
342 QMap<QString, QString> errors;
344 for(std::vector<QRunnable*>::iterator it =
m_threads.begin(); it !=
m_threads.end(); ++it)
353 if(!errorm.isEmpty())
354 errors[lId] = errorm;
366 QApplication::restoreOverrideCursor();
virtual const std::string & getId() const
It returns the layer id.
This is the base class for layers.
te::map::AlignType m_hAlign
The display horizontal align.
Thread to draw a Layer in a PaintDevice.
double m_urx
Upper right corner x-coordinate.
te::map::AlignType m_vAlign
The display vertical align.
A multi thread Qt4 widget to control the display of a set of layers.
Manager for threads of rendering.
te::map::CompositionMode getCompositionMode() const
It returns the composition mode.
CompositionMode
The composition mode used to render the canvas.
double m_llx
Lower left corner x-coordinate.
An Envelope defines a 2D rectangular region.
int m_srid
The display SRS.
te::gm::Envelope m_extent
The display extent.
double m_lly
Lower left corner y-coordinate.
std::list< te::map::AbstractLayerPtr > m_layerList
The layer list to be displayed.
double m_ury
Upper right corner y-coordinate.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
void FreeContents(boost::unordered_map< K, V * > &m)
This function can be applied to a map of pointers. It will delete each pointer in the map...
void RemoveImage(const std::string lId, std::map< std::string, QImage * > &imgs)
bool isValid() const
It tells if the rectangle is valid or not.
TEMAPEXPORT void GetVisibleLayers(const std::list< te::map::AbstractLayerPtr > &layers, std::list< te::map::AbstractLayerPtr > &visibleLayers)
It gets the visible layers of the given layer list.