27 #include "../common/Exception.h"
28 #include "../common/Translator.h"
29 #include "../maptools/RendererFactory.h"
33 #include <boost/format.hpp>
41 : te::map::AbstractLayer(parent),
47 : te::map::AbstractLayer(id, parent),
53 const std::string& title,
55 : te::map::AbstractLayer(id, title, parent),
66 return std::auto_ptr<te::map::LayerSchema>(
static_cast<te::map::LayerSchema*
>(m_schema->clone()));
120 if(m_rendererType.empty())
121 throw te::common::Exception((boost::format(
TE_TR(
"Could not draw the layer %1%. The renderer type is empty!")) % getTitle()).str());
125 if(renderer.get() == 0)
126 throw te::common::Exception((boost::format(
TE_TR(
"Could not draw the layer %1%. The renderer %2% could not be created!")) % getTitle() % m_rendererType).str());
128 renderer->draw(
this, canvas, bbox, srid);
138 return m_rendererType;
void setSchema(te::map::LayerSchema *schema)
std::auto_ptr< te::da::DataSet > getData(te::common::TraverseType travType=te::common::FORWARDONLY, const te::common::AccessPolicy accessPolicy=te::common::RAccess) const
It gets the dataset identified by the layer name.
This is the base class for layers.
void setRendererType(const std::string &t)
A class that models the description of a dataset.
SpatialRelation
Spatial relations between geometric objects.
#define TE_TR(message)
It marks a string in order to get translated.
This is an abstract class that models a query expression.
const std::string & getRendererType() const
AccessPolicy
Supported data access policies (can be used as bitfield).
TraverseType
A dataset can be traversed in two ways:
An Envelope defines a 2D rectangular region.
This class represents a set of unique ids created in the same context. i.e. from the same data set...
static const std::string sm_type
A static data member used in the implementation of getType method.
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
static AbstractRenderer * make(const std::string &factoryKey)
It creates an object with the appropriated factory.
This class represents a layer being created from user-edition.
A canvas is an abstraction of a drawing area.
bool isValid() const
It returns true if the layer can be used for instance to draw, otherwise, it returns false...
~EditionLayer()
Destructor.
EditionLayer(te::map::AbstractLayer *parent=0)
It initializes a new layer.
void draw(te::map::Canvas *canvas, const te::gm::Envelope &bbox, int srid)
It draws the layer geographic objects in the given canvas using the informed SRS. ...
const std::string & getType() const
It returns the layer type: EDITIONLAYER.
std::auto_ptr< te::map::LayerSchema > getSchema() const
It returns the layer schema.