All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MapModel.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file MapModel.cpp
22 
23  \brief
24 
25  \ingroup layout
26 */
27 
28 // TerraLib
29 #include "MapModel.h"
30 #include "../core/ContextItem.h"
31 #include "../../maptools/Canvas.h"
32 #include "../../srs/SpatialReferenceSystemManager.h"
33 #include "../../common/StringUtils.h"
34 #include "../core/pattern/singleton/Context.h"
35 #include "../core/Systematic.h"
36 #include "../core/property/Property.h"
37 #include "../core/property/Properties.h"
38 #include "../core/WorldTransformer.h"
39 #include "../../common/STLUtils.h"
40 #include "../../geometry/Polygon.h"
41 #include "../../geometry/LinearRing.h"
42 #include "../core/enum/Enums.h"
43 #include "../core/property/SharedProperties.h"
44 
45 // STL
46 #include <vector>
47 #include <string>
48 #include <sstream>
49 
51  m_mapDisplacementX(0),
52  m_mapDisplacementY(0),
53  m_systematic(0),
54  m_fixedScale(false),
55  m_loadedLayer(false)
56 {
57  m_type = Enums::getInstance().getEnumObjectType()->getMapItem();
58 
59  m_box = te::gm::Envelope(0., 0., 150., 120.);
60  m_mapBoxMM = m_box;
61 
62  m_backgroundColor = te::color::RGBAColor(255, 255, 255, 0);
63 
64  m_mapbackgroundColor = te::color::RGBAColor(255, 255, 255, 0);
65  m_enableChildren = true;
66 }
67 
69 {
70  if(m_systematic)
71  {
72  delete m_systematic;
73  m_systematic = 0;
74  }
75 }
76 
78 {
79  te::color::RGBAColor** pixmap = 0;
80 
81  te::map::Canvas* canvas = context.getCanvas();
82  Utils* utils = context.getUtils();
83 
84  if((!canvas) || (!utils))
85  return;
86 
87  if(context.isResizeCanvas())
88  utils->configCanvas(m_box);
89 
90  drawBackground(context);
91 
92  if(context.isResizeCanvas())
93  pixmap = utils->getImageW(m_box);
94 
95  context.setPixmap(pixmap);
96  notifyAll(context);
97 }
98 
100 {
102 
104 
105  std::string name = "";
106  if(m_layer)
107  {
108  name = m_layer->getTitle();
109  }
110 
111  Property pro_layer(m_hashCode);
112  pro_layer.setName("layer");
113  pro_layer.setValue(name, dataType->getDataTypeString());
114  pro_layer.setEditable(false);
115  m_properties->addProperty(pro_layer);
116 
117  Property pro_mapbackgroundcolor(m_hashCode);
118  pro_mapbackgroundcolor.setName("map_color");
119  pro_mapbackgroundcolor.setValue(m_mapbackgroundColor, dataType->getDataTypeColor());
120  pro_mapbackgroundcolor.setMenu(true);
121  m_properties->addProperty(pro_mapbackgroundcolor);
122 
123  Property pro_fixed(m_hashCode);
124  pro_fixed.setName("fixedScale");
125  pro_fixed.setValue(m_fixedScale, dataType->getDataTypeBool());
126  m_properties->addProperty(pro_fixed);
127 
128  Property pro_mapDisplacementX(m_hashCode);
129  pro_mapDisplacementX.setName("map_displacementX");
130  pro_mapDisplacementX.setValue(m_mapDisplacementX, dataType->getDataTypeDouble());
131  m_properties->addProperty(pro_mapDisplacementX);
132 
133  Property pro_mapDisplacementY(m_hashCode);
134  pro_mapDisplacementY.setName("map_displacementY");
135  pro_mapDisplacementY.setValue(m_mapDisplacementY, dataType->getDataTypeDouble());
136  m_properties->addProperty(pro_mapDisplacementY);
137 
138  return m_properties;
139 }
140 
142 {
144 
145  Properties* vectorProps = const_cast<Properties*>(properties);
146 
147  Property pro_layer = vectorProps->contains("layer");
148  if(!pro_layer.isNull())
149  {
150  m_nameLayer = pro_layer.getValue().toString();
151  }
152 
153  Property pro_mapbackgroundcolor = vectorProps->contains("map_color");
154  if(!pro_mapbackgroundcolor.isNull())
155  {
156  m_mapbackgroundColor = pro_mapbackgroundcolor.getValue().toColor();
157  }
158 
159  Property pro_fixed = vectorProps->contains("fixedScale");
160  if(!pro_fixed.isNull())
161  {
162  m_fixedScale = pro_fixed.getValue().toBool();
163  }
164 
165  Property pro_mapDisplacementX = vectorProps->contains("map_displacementX");
166  if(!pro_mapDisplacementX.isNull())
167  {
168  double d_differenceX = 0;
169  if(m_mapDisplacementX < pro_mapDisplacementX.getValue().toDouble())
170  {
171  d_differenceX = pro_mapDisplacementX.getValue().toDouble() - m_mapDisplacementX;
172  m_box.m_urx = m_box.m_urx + d_differenceX;
173  m_mapBoxMM.m_urx = m_mapBoxMM.m_urx + d_differenceX;
174  }
175  else
176  {
177  d_differenceX = m_mapDisplacementX - pro_mapDisplacementX.getValue().toDouble();
178  m_box.m_urx = m_box.m_urx - d_differenceX;
179  m_mapBoxMM.m_urx = m_mapBoxMM.m_urx - d_differenceX;
180  }
181  m_mapDisplacementX = pro_mapDisplacementX.getValue().toDouble();
182  }
183 
184  Property pro_mapDisplacementY = vectorProps->contains("map_displacementY");
185  if(!pro_mapDisplacementY.isNull())
186  {
187  double d_differenceY = 0;
188  if(m_mapDisplacementY < pro_mapDisplacementY.getValue().toDouble())
189  {
190  d_differenceY = pro_mapDisplacementY.getValue().toDouble() - m_mapDisplacementY;
191  m_box.m_ury = m_box.m_ury + d_differenceY;
192  m_mapBoxMM.m_ury = m_mapBoxMM.m_ury + d_differenceY;
193  }
194  else
195  {
196  d_differenceY = m_mapDisplacementY - pro_mapDisplacementY.getValue().toDouble();
197  m_box.m_ury = m_box.m_ury - d_differenceY;
198  m_mapBoxMM.m_ury = m_mapBoxMM.m_ury - d_differenceY;
199  }
200  m_mapDisplacementY = pro_mapDisplacementY.getValue().toDouble();
201  }
202 
203  updateVisitors();
204 }
205 
207 {
208  if(!layer)
209  return false;
210 
211  if(m_layer)
212  {
213  if(m_layer->getId() == layer->getId())
214  return false;
215  }
216 
217  m_layer = layer;
218 
219  m_loadedLayer = true;
220 
221  updateVisitors();
222 
223  return true;
224 }
225 
227 {
228  return m_layer;
229 }
230 
232 {
233  if(!m_layer)
234  return 0;
235 
236  if(m_layer.get() == 0)
237  return 0;
238 
239  // World box: coordinates in the same SRS as the layer
240  te::gm::Envelope worldBox = m_layer->getExtent();
241 
242  //About units names (SI): terralib5\resources\json\uom.json
243  te::common::UnitOfMeasurePtr unitPtr = unitMeasureLayer();
244 
245  if(!unitPtr)
246  return 0;
247 
248  std::string nameUnit = unitPtr->getName();
249  nameUnit = te::common::Convert2UCase(nameUnit);
250 
251  double fx;
252  double fy;
253  double wMM;
254  double factor;
255  double area;
256 
257  wMM = m_box.getWidth();
258  fx = m_box.getWidth()/worldBox.getWidth();
259  fy = m_box.getHeight()/worldBox.getHeight();
260 
261  if (fx > fy)
262  {
263  factor = fy;
264  area = (int)(factor * worldBox.getWidth() + .5);
265  }
266  else
267  {
268  factor = fx;
269  area = (int)(factor * worldBox.getHeight() + .5);
270  }
271 
272  if (nameUnit.compare("METRE") == 0)
273  wMM /= 1000.;
274  else if (nameUnit.compare("KILOMETRE") == 0)
275  wMM /= 1000000.;
276  else if (nameUnit.compare("FOOT") == 0)
277  wMM /= (12. * 25.4);
278  else if (nameUnit.compare("DEGREE") == 0)
279  wMM /= 110000000.;
280 
281  double scale = (1. / factor ) /(wMM / area);
282  if(m_systematic && m_fixedScale)
283  {
284  scale = m_systematic->getScale();
285  }
286  return scale;
287 }
288 
290 {
291  te::gm::Envelope worldBox;
292 
293  if(!m_layer)
294  return worldBox;
295 
296  if(m_layer.get() == 0)
297  return worldBox;
298 
299  // World box: coordinates in the same SRS as the layer
300  worldBox = m_layer->getExtent();
301  int srid = m_layer->getSRID();
302 
303  //About units names (SI): terralib5\resources\json\uom.json
304  te::common::UnitOfMeasurePtr unitPtr = unitMeasureLayer();
305 
306  if(!unitPtr)
307  return worldBox;
308 
309  std::string unitPtrStr = unitPtr->getName();
310  unitPtrStr = te::common::Convert2UCase(unitPtrStr);
311 
312  if(unitPtrStr.compare("DEGREE") == 0)
313  {
314 
315  Utils* utils = Context::getInstance().getUtils();
316 
317  int zone = utils->calculatePlanarZone(worldBox);
318  std::string proj4 = utils->proj4DescToPlanar(zone);
319 
320  // Get the id of the projection of destination
321  std::pair<std::string, unsigned int> projMeters = te::srs::SpatialReferenceSystemManager::getInstance().getIdFromP4Txt(proj4);
322 
323  // Remapping
324  worldBox.transform(srid, projMeters.second);
325  }
326 
327  return worldBox;
328 }
329 
331 {
333 
334  if(!m_layer)
335  return unitPtr;
336 
337  //About units names (SI): terralib5\resources\json\uom.json
338 
339  int srid = m_layer->getSRID();
340 
341  Utils* utils = Context::getInstance().getUtils();
342  unitPtr = utils->unitMeasure(srid);
343  return unitPtr;
344 }
345 
347 {
348  te::gm::Envelope worldBox;
349 
350  if(!m_layer)
351  return worldBox;
352 
353  if(m_layer.get() == 0)
354  return worldBox;
355 
356  // World box: coordinates in the same SRS as the layer
357  worldBox = m_layer->getExtent();
358  int srid = m_layer->getSRID();
359 
360  //About units names (SI): terralib5\resources\json\uom.json
361  te::common::UnitOfMeasurePtr unitPtr = unitMeasureLayer();
362 
363  if(!unitPtr)
364  return worldBox;
365 
366  std::string unitPtrStr = unitPtr->getName();
367  unitPtrStr = te::common::Convert2UCase(unitPtrStr);
368 
369  if(unitPtrStr.compare("DEGREE") != 0)
370  {
371  Utils* utils = Context::getInstance().getUtils();
372  std::string proj4 = utils->proj4DescToGeodesic();
373 
374  // Get the id of the projection of destination
375  std::pair<std::string, unsigned int> projMeters = te::srs::SpatialReferenceSystemManager::getInstance().getIdFromP4Txt(proj4);
376 
377  // Remapping
378  worldBox.transform(srid, projMeters.second);
379  }
380 
381  return worldBox;
382 }
383 
385 {
387 
388  m_mapBoxMM.m_llx = box.m_llx + m_mapDisplacementX;
389  m_mapBoxMM.m_lly = box.m_lly + m_mapDisplacementY;
390  m_mapBoxMM.m_urx = box.m_urx - m_mapDisplacementX;
391  m_mapBoxMM.m_ury = box.m_ury - m_mapDisplacementY;
392 }
393 
395 {
396  return m_mapBoxMM;
397 }
398 
399 void te::layout::MapModel::setPosition( const double& x, const double& y )
400 {
402 
403  m_mapBoxMM.m_llx = m_box.m_llx + m_mapDisplacementX;
404  m_mapBoxMM.m_lly = m_box.m_lly + m_mapDisplacementY;
405  m_mapBoxMM.m_urx = m_box.m_urx - m_mapDisplacementX;
406  m_mapBoxMM.m_ury = m_box.m_ury - m_mapDisplacementY;
407 }
408 
410 {
411  return m_mapDisplacementX;
412 }
413 
415 {
416  return m_mapDisplacementY;
417 }
418 
420 {
421  if(m_systematic)
422  {
423  delete m_systematic;
424  m_systematic = 0;
425  }
426 
427  m_systematic = systematic;
428 }
429 
431 {
432  if(!m_systematic)
433  return;
434 
435  if(!m_layer)
436  return;
437 
438  if(m_layer.get() == 0)
439  return;
440 
441  int srid = m_layer->getSRID();
442  if(srid == 0)
443  return;
444 
445  setFixedScale(true);
446 
447  double height = 0.;
448  double width = 0.;
449  double x = coord.x;
450  double y = coord.y;
451  te::gm::Coord2D lowerLeft;
452  te::gm::Coord2D upperRight;
453 
454  height = m_systematic->getHeight();
455  width = m_systematic->getWidth();
456 
457  te::gm::Envelope worldBox = getWorldInMeters();
458 
459  Utils* utils = Context::getInstance().getUtils();
460  WorldTransformer transf = utils->getTransformGeo(worldBox, m_mapBoxMM);
461  transf.setMirroring(false);
462 
463  transf.system2Tosystem1(x, y, x, y);
464 
465  x = floor(x/width);
466  y = floor(y/height);
467 
468  lowerLeft = te::gm::Coord2D(x * width, y * height);
469  upperRight = te::gm::Coord2D((x + 1) * width, (y + 1) * height);
470 
472  lneOut0->setPointN(0, te::gm::Point(lowerLeft.x, upperRight.y));
473  lneOut0->setPointN(1, te::gm::Point(lowerLeft.x, lowerLeft.y));
474  lneOut0->setPointN(2, te::gm::Point(upperRight.x, lowerLeft.y));
475  lneOut0->setPointN(3, te::gm::Point(upperRight.x, upperRight.y));
476  lneOut0->setPointN(4, te::gm::Point(lowerLeft.x, upperRight.y));
477 
478  te::gm::Polygon* pol = new te::gm::Polygon(1, te::gm::PolygonType, 0, &worldBox);
479  pol->setRingN(0, lneOut0);
480 
481  const te::gm::Envelope* polEnv = pol->getMBR();
482 
483  m_worldBox.m_llx = polEnv->m_llx;
484  m_worldBox.m_lly = polEnv->m_lly;
485  m_worldBox.m_urx = polEnv->m_urx;
486  m_worldBox.m_ury = polEnv->m_ury;
487 
488  updateVisitors();
489 }
490 
492 {
493  return m_fixedScale;
494 }
495 
497 {
498  m_fixedScale = fixed;
499 }
500 
502 {
503  bool result = false;
504 
505  if(!m_layer)
506  return result;
507 
508  if(m_layer.get() == 0)
509  return result;
510 
511  //About units names (SI): terralib5\resources\json\uom.json
512  te::common::UnitOfMeasurePtr unitPtr = unitMeasureLayer();
513 
514  if(!unitPtr)
515  return result;
516 
517  std::string unitPtrStr = unitPtr->getName();
518  unitPtrStr = te::common::Convert2UCase(unitPtrStr);
519 
520  if(unitPtrStr.compare("DEGREE") != 0)
521  {
522  result = true;
523  }
524 
525  return result;
526 }
527 
529 {
530  te::gm::Envelope worldBox;
531 
532  if(!m_layer)
533  return worldBox;
534 
535  if(m_layer.get() == 0)
536  return worldBox;
537 
538  // World box: coordinates in the same SRS as the layer
539  worldBox = m_layer->getExtent();
540  int srid = m_layer->getSRID();
541 
542  if(!m_worldBox.isValid())
543  return worldBox;
544 
545  //Planar World
546  worldBox = m_worldBox;
547 
548  if(!isPlanar())
549  {
550  Utils* utils = Context::getInstance().getUtils();
551  std::string proj4 = utils->proj4DescToGeodesic();
552 
553  // Get the id of the projection of destination
554  std::pair<std::string, unsigned int> projMeters = te::srs::SpatialReferenceSystemManager::getInstance().getIdFromP4Txt(proj4);
555 
556  // Remapping
557  worldBox.transform(srid, projMeters.second);
558  }
559 
560  return worldBox;
561 }
562 
563 std::map<te::gm::Point*, std::string> te::layout::MapModel::getTextMapAsObjectInfo()
564 {
565  std::map<te::gm::Point*, std::string> map;
566 
567  return map;
568 }
569 
571 {
572  m_mapbackgroundColor = color;
573 }
574 
576 {
577  return m_mapbackgroundColor;
578 }
579 
581 {
582  return m_nameLayer;
583 }
584 
586 {
587  return m_loadedLayer;
588 }
virtual void setPosition(const double &x, const double &y)
Change coordinate llx,lly of the MVC component.
Class responsible for maintaining the drawing context of a MVC component. It is always used by the "M...
Definition: ContextItem.h:49
virtual std::map< te::gm::Point *, std::string > getTextMapAsObjectInfo()
Definition: MapModel.cpp:563
virtual bool isLoadedLayer()
Definition: MapModel.cpp:585
virtual std::string getNameLayer()
Definition: MapModel.cpp:580
virtual double getDisplacementX()
Definition: MapModel.cpp:409
virtual te::gm::Envelope getWorldInMeters()
Definition: MapModel.cpp:289
virtual te::layout::Properties * getProperties() const
Reimplemented from Observable.
Definition: MapModel.cpp:99
virtual double getScale()
Definition: MapModel.cpp:231
virtual void setPixmap(te::color::RGBAColor **pixmap)
Stores pixmap generated after drawing.
Definition: ContextItem.cpp:85
Variant getValue()
Returns stored value.
Definition: Property.cpp:72
double y
y-coordinate.
Definition: Coord2D.h:114
virtual EnumDataType * getEnumDataType()
Returns data type enumeration.
Definition: Enums.cpp:52
virtual te::gm::Envelope getWorldInDegrees()
Definition: MapModel.cpp:346
virtual EnumType * getDataTypeBool() const
Returns value that represents type bool belonging to enumeration.
te::layout::WorldTransformer getTransformGeo(te::gm::Envelope boxgeo, te::gm::Envelope boxmm)
Returns a WorldTransformer object to transformations between geo coordinates and millimeter coordinat...
Definition: Utils.cpp:298
double x
x-coordinate.
Definition: Coord2D.h:113
void system2Tosystem1(double &dx, double &dy) const
It transforms the coordinate dx and dy from system 2 coordinates to syste 1 coordinates without using...
virtual EnumType * getDataTypeDouble() const
Returns value that represents type double belonging to enumeration.
std::string proj4DescToPlanar(int zone)
Returns string wkt with UTM projection in the specified zone.
Definition: Utils.cpp:376
bool isNull()
Returns true if no value has been set, false otherwise.
Definition: Property.cpp:146
te::gm::Envelope m_mapBoxMM
Definition: MapModel.h:128
double m_urx
Upper right corner x-coordinate.
Definition: Envelope.h:346
virtual void generateSystematic(te::gm::Coord2D coord)
Definition: MapModel.cpp:430
std::string Convert2UCase(const std::string &value)
It converts a string to upper case.
Definition: StringUtils.h:163
double getWidth() const
It returns the envelope width.
Definition: Envelope.h:443
std::string proj4DescToGeodesic()
Returns string wkt with non-planar projection.
Definition: Utils.cpp:408
The Properties class represents a persistent set of properties. The Properties can be saved to a file...
Definition: Properties.h:52
An utility struct for representing 2D coordinates.
Definition: Coord2D.h:40
virtual void setPosition(const double &x, const double &y)
Change coordinate llx,lly of the MVC component.
Definition: MapModel.cpp:399
EnumType * m_type
type of the MVC component
virtual void updateProperties(te::layout::Properties *properties)
Reimplemented from Observable.
virtual void setSystematic(Systematic *systematic)
Definition: MapModel.cpp:419
te::common::UnitOfMeasurePtr unitMeasure(int srid)
Returns a UnitOfMeasurePtr pointer.
Definition: Utils.cpp:435
virtual void setMapBackgroundColor(te::color::RGBAColor color)
Definition: MapModel.cpp:570
virtual void updateProperties(te::layout::Properties *properties)
Reimplemented from Observable.
Definition: MapModel.cpp:141
A LinearRing is a LineString that is both closed and simple.
Definition: LinearRing.h:53
te::color::RGBAColor m_mapbackgroundColor
Definition: MapModel.h:134
double m_llx
Lower left corner x-coordinate.
Definition: Envelope.h:344
static Enums & getInstance()
It returns a reference to the singleton instance.
A point with x and y coordinate values.
Definition: Point.h:50
int calculatePlanarZone(te::gm::Envelope latLongBox)
Calculates the area from a box in coordinated latlong.
Definition: Utils.cpp:419
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
virtual Utils * getUtils()
Class to represent a data type enumeration. Ex.: int, double, bool, te::color::RGBAColor (color)...
Definition: EnumDataType.h:48
te::gm::Envelope m_box
bounding rectangle
virtual te::map::AbstractLayerPtr getLayer()
Definition: MapModel.cpp:226
Class that represents a "Model" part of Map MVC component. Its coordinate system is the same of scene...
Utils * getUtils()
Returns pointer with functions to manipulate the canvas and conversion between projections.
Definition: Context.cpp:153
virtual void setFixedScale(bool fixed)
Definition: MapModel.cpp:496
virtual te::gm::Envelope getWorldBox()
Definition: MapModel.cpp:528
virtual EnumType * getDataTypeColor() const
Returns value that represents type te::color::RGBAColor** (color) belonging to enumeration.
MapModel()
Constructor.
Definition: MapModel.cpp:50
te::color::RGBAColor m_backgroundColor
background color
virtual bool isPlanar()
Definition: MapModel.cpp:501
virtual te::map::Canvas * getCanvas()
Return canvas.
virtual ~MapModel()
Destructor.
Definition: MapModel.cpp:68
double toDouble()
Returns the value of double type. (The setValue method received a double)
Definition: Variant.cpp:316
double m_lly
Lower left corner y-coordinate.
Definition: Envelope.h:345
This class implements the logic for transforming from System 1 coordinate to other type of coordinate...
bool m_enableChildren
true if MVC component can have children, false otherwise
virtual te::gm::Envelope getMapBox()
Definition: MapModel.cpp:394
virtual te::color::RGBAColor getMapBackgroundColor()
Definition: MapModel.cpp:575
A canvas is an abstraction of a drawing area.
Definition: Canvas.h:91
boost::shared_ptr< UnitOfMeasure > UnitOfMeasurePtr
virtual Properties * getProperties() const
Reimplemented from Observable.
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
Definition: Polygon.h:50
void setValue(ValueType value, EnumType *type)
Stores a copy of value.
Definition: Property.h:298
double m_ury
Upper right corner y-coordinate.
Definition: Envelope.h:347
virtual te::color::RGBAColor ** getImageW(te::gm::Envelope boxmm)
Returns a pointer RGBA colors that representing an image.
Definition: Utils.cpp:111
virtual void draw(ContextItem context)
Drawing method of the MVC component.
Definition: MapModel.cpp:77
virtual double getDisplacementY()
Definition: MapModel.cpp:414
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
Definition: RGBAColor.h:57
std::string toString()
Returns the value of string type. (The setValue method received a string)
Definition: Variant.cpp:311
void setEditable(bool editable)
Sets true if property is editable, false otherwise.
Definition: Property.cpp:119
virtual void configCanvas(te::gm::Envelope box, bool resize=true, bool applyZoom=true)
Sets the viewport and window of the canvas. The viewport is only changed if the resize parameter is t...
Definition: Utils.cpp:138
void setName(std::string name)
Sets the name of this property.
Definition: Property.cpp:62
virtual bool refreshLayer(te::map::AbstractLayerPtr layer)
Definition: MapModel.cpp:206
void setPointN(std::size_t i, const Point &p)
It sets the value of the specified point to this new one.
Definition: LineString.cpp:339
virtual void setMenu(bool menu)
Sets true if property will be used in a menu, false otherwise.
Definition: Property.cpp:228
virtual void setBox(te::gm::Envelope box)
Change the bounding rectangle.
Definition: MapModel.cpp:384
te::color::RGBAColor toColor()
Returns the value of te::color::RGBAColor type. (The setValue method received a te::color::RGBAColor)...
Definition: Variant.cpp:341
virtual EnumType * getDataTypeString() const
Returns value that represents type string belonging to enumeration.
Utility class with functions to manipulate the canvas and conversion between projections.
Definition: Utils.h:61
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
void transform(int oldsrid, int newsrid)
It will transform the coordinates of the Envelope from the old SRS to the new one.
Definition: Envelope.cpp:92
virtual void setBox(te::gm::Envelope box)
Change the bounding rectangle.
virtual bool isResizeCanvas()
Returns whether the canvas should or should not be resized.
Definition: ContextItem.cpp:95
virtual te::common::UnitOfMeasurePtr unitMeasureLayer()
Definition: MapModel.cpp:330
double getHeight() const
It returns the envelope height.
Definition: Envelope.h:448
const Envelope * getMBR() const
It returns the minimum bounding rectangle for the geometry in an internal representation.
Definition: Geometry.cpp:104
virtual bool contains(Property property)
Checks if the property is contained within the set of properties.
Definition: Properties.h:251
A property acts like a attribute member of a object and stores the state of this attribute. A set of properties stores the state of an object. Any data type, not included in the convertValue method in the class te::layout::Variant, it will be by default "std::string" value.
Definition: Property.h:47
virtual bool isFixedScale()
Definition: MapModel.cpp:491
void setRingN(std::size_t i, Curve *r)
It sets the informed position ring to the new one.
bool toBool()
Returns the value of boolean type. (The setValue method received a boolean)
Definition: Variant.cpp:336