30 #include "../core/ContextItem.h"
31 #include "../../geometry/Envelope.h"
32 #include "../../geometry/Coord2D.h"
33 #include "../../color/RGBAColor.h"
34 #include "../../maptools/Canvas.h"
35 #include "../../srs/Config.h"
36 #include "../core/enum/Enums.h"
38 #include "../core/property/Property.h"
39 #include "../core/property/Properties.h"
40 #include "../core/property/SharedProperties.h"
41 #include "../core/property/GridSettingsConfigProperties.h"
48 m_mapDisplacementX(0),
49 m_mapDisplacementY(0),
53 m_initialGridPointX(0),
54 m_initialGridPointY(0),
60 m_visibleAllTexts(true),
62 m_superscriptText(false),
63 m_lneVrtDisplacement(7),
64 m_lneHrzDisplacement(7),
69 m_bottomRotateText(false),
70 m_leftRotateText(false),
71 m_rightRotateText(false),
72 m_topRotateText(false)
79 m_settingsConfig(settingsConfig),
82 m_mapDisplacementX(0),
83 m_mapDisplacementY(0),
87 m_initialGridPointX(0),
88 m_initialGridPointY(0),
94 m_visibleAllTexts(true),
96 m_superscriptText(false),
97 m_lneVrtDisplacement(7),
98 m_lneHrzDisplacement(7),
103 m_bottomRotateText(false),
104 m_leftRotateText(false),
105 m_rightRotateText(false),
106 m_topRotateText(false)
125 if(!m_settingsConfig)
163 m_boundingBoxItemMM = box;
173 m_visibleAllTexts = visible;
175 m_bottomText = visible;
176 m_leftText = visible;
177 m_rightText = visible;
183 std::map<te::gm::Point*, std::string>::iterator it;
184 for(it = m_gridTexts.begin() ; it != m_gridTexts.end() ; ++it)
203 m_mapDisplacementX = displacement;
208 m_mapDisplacementY = displacement;
220 m_srid = map->
getLayer()->getSRID();
237 pro_grid_name.
setName(
"GridSettings");
241 m_properties->addProperty(pro_grid_name);
244 pro_mapName.
setName(m_sharedProps->getMapName());
251 m_properties->addProperty(pro_mapName);
256 pro_visible.
setName(m_settingsConfig->getVisible());
259 m_properties->addProperty(pro_visible);
262 pro_lneHrzGap.
setName(m_settingsConfig->getLneHrzGap());
265 m_properties->addProperty(pro_lneHrzGap);
268 pro_lneVrtGap.
setName(m_settingsConfig->getLneVrtGap());
271 m_properties->addProperty(pro_lneVrtGap);
273 Property pro_initialGridPointX(m_hashCode);
274 pro_initialGridPointX.
setName(m_settingsConfig->getInitialGridPointX());
277 m_properties->addProperty(pro_initialGridPointX);
279 Property pro_initialGridPointY(m_hashCode);
280 pro_initialGridPointY.
setName(m_settingsConfig->getInitialGridPointY());
283 m_properties->addProperty(pro_initialGridPointY);
287 pro_gridStyle.
setName(m_settingsConfig->getStyle());
290 m_properties->addProperty(pro_gridStyle);
294 pro_lineStyle.
setName(m_settingsConfig->getLineStyle());
297 m_properties->addProperty(pro_lineStyle);
300 pro_lineColor.
setName(m_settingsConfig->getLineColor());
303 m_properties->addProperty(pro_lineColor);
306 pro_lineWidth.
setName(m_settingsConfig->getLineWidth());
309 m_properties->addProperty(pro_lineWidth);
312 Property pro_pointTextSize(m_hashCode);
313 pro_pointTextSize.
setName(m_settingsConfig->getPointTextSize());
316 m_properties->addProperty(pro_pointTextSize);
319 pro_fontText.
setName(m_settingsConfig->getFontText());
322 m_properties->addProperty(pro_fontText);
325 pro_textColor.
setName(m_settingsConfig->getTextColor());
328 m_properties->addProperty(pro_textColor);
331 Property pro_visibleAllTexts(m_hashCode);
332 pro_visibleAllTexts.
setName(m_settingsConfig->getVisibleAllTexts());
335 m_properties->addProperty(pro_visibleAllTexts);
337 Property pro_superscriptText(m_hashCode);
338 pro_superscriptText.
setName(m_settingsConfig->getSuperscriptText());
341 m_properties->addProperty(pro_superscriptText);
343 Property pro_lneVrtDisplacement(m_hashCode);
344 pro_lneVrtDisplacement.
setName(m_settingsConfig->getLneVrtDisplacement());
347 m_properties->addProperty(pro_lneVrtDisplacement);
349 Property pro_lneHrzDisplacement(m_hashCode);
350 pro_lneHrzDisplacement.
setName(m_settingsConfig->getLneHrzDisplacement());
353 m_properties->addProperty(pro_lneHrzDisplacement);
355 Property pro_bottomText(m_hashCode);
356 pro_bottomText.
setName(m_settingsConfig->getBottomText());
359 m_properties->addProperty(pro_bottomText);
362 pro_leftText.
setName(m_settingsConfig->getLeftText());
365 m_properties->addProperty(pro_leftText);
368 pro_rightText.
setName(m_settingsConfig->getRightText());
371 m_properties->addProperty(pro_rightText);
374 pro_topText.
setName(m_settingsConfig->getTopText());
377 m_properties->addProperty(pro_topText);
379 Property pro_bottomRotateText(m_hashCode);
380 pro_bottomRotateText.
setName(m_settingsConfig->getBottomRotateText());
383 m_properties->addProperty(pro_bottomRotateText);
385 Property pro_leftRotateText(m_hashCode);
386 pro_leftRotateText.
setName(m_settingsConfig->getLeftRotateText());
389 m_properties->addProperty(pro_leftRotateText);
391 Property pro_rightRotateText(m_hashCode);
392 pro_rightRotateText.
setName(m_settingsConfig->getRightRotateText());
395 m_properties->addProperty(pro_rightRotateText);
397 Property pro_topRotateText(m_hashCode);
398 pro_topRotateText.
setName(m_settingsConfig->getTopRotateText());
401 m_properties->addProperty(pro_topRotateText);
424 Property pro_visible = vectorProps->
contains(m_settingsConfig->getVisible());
431 Property pro_lneHrzGap = vectorProps->
contains(m_settingsConfig->getLneHrzGap());
432 if(!pro_lneHrzGap.
isNull())
437 Property pro_lneVrtGap = vectorProps->
contains(m_settingsConfig->getLneVrtGap());
438 if(!pro_lneVrtGap.
isNull())
443 Property pro_initialGridPointX = vectorProps->
contains(m_settingsConfig->getInitialGridPointX());
444 if(!pro_initialGridPointX.
isNull())
449 Property pro_initialGridPointY = vectorProps->
contains(m_settingsConfig->getInitialGridPointY());
450 if(!pro_initialGridPointY.
isNull())
455 Property pro_gridStyle = vectorProps->
contains(m_settingsConfig->getStyle());
456 if(!pro_gridStyle.
isNull())
460 m_gridStyle = styleType;
463 Property pro_lineStyle = vectorProps->
contains(m_settingsConfig->getLineStyle());
464 if(!pro_lineStyle.
isNull())
468 m_lineStyle = lineStyle;
471 Property pro_lineColor = vectorProps->
contains(m_settingsConfig->getLineColor());
472 if(!pro_lineColor.
isNull())
477 Property pro_lineWidth = vectorProps->
contains(m_settingsConfig->getLineWidth());
478 if(!pro_lineWidth.
isNull())
483 Property pro_pointTextSize = vectorProps->
contains(m_settingsConfig->getPointTextSize());
484 if(!pro_pointTextSize.
isNull())
489 Property pro_fontText = vectorProps->
contains(m_settingsConfig->getFontText());
490 if(!pro_fontText.
isNull())
495 Property pro_textColor = vectorProps->
contains(m_settingsConfig->getTextColor());
496 if(!pro_textColor.
isNull())
501 Property pro_visibleAllTexts = vectorProps->
contains(m_settingsConfig->getVisibleAllTexts());
502 if(!pro_visibleAllTexts.
isNull())
507 Property pro_superscriptText = vectorProps->
contains(m_settingsConfig->getSuperscriptText());
508 if(!pro_superscriptText.
isNull())
513 Property pro_lneVrtDisplacement = vectorProps->
contains(m_settingsConfig->getLneVrtDisplacement());
514 if(!pro_lneVrtDisplacement.
isNull())
516 m_lneVrtDisplacement = pro_lneVrtDisplacement.
getValue().
toInt();
519 Property pro_lneHrzDisplacement = vectorProps->
contains(m_settingsConfig->getLneHrzDisplacement());
520 if(!pro_lneHrzDisplacement.
isNull())
522 m_lneHrzDisplacement = pro_lneHrzDisplacement.
getValue().
toInt();
525 Property pro_bottomText = vectorProps->
contains(m_settingsConfig->getBottomText());
526 if(!pro_bottomText.
isNull())
531 Property pro_leftText = vectorProps->
contains(m_settingsConfig->getLeftText());
532 if(!pro_leftText.
isNull())
537 Property pro_rightText = vectorProps->
contains(m_settingsConfig->getRightText());
538 if(!pro_rightText.
isNull())
543 Property pro_topText = vectorProps->
contains(m_settingsConfig->getTopText());
549 Property pro_bottomRotateText = vectorProps->
contains(m_settingsConfig->getBottomRotateText());
550 if(!pro_bottomRotateText.
isNull())
555 Property pro_leftRotateText = vectorProps->
contains(m_settingsConfig->getLeftRotateText());
556 if(!pro_leftRotateText.
isNull())
561 Property pro_rightRotateText = vectorProps->
contains(m_settingsConfig->getRightRotateText());
562 if(!pro_rightRotateText.
isNull())
567 Property pro_topRotateText = vectorProps->
contains(m_settingsConfig->getTopRotateText());
568 if(!pro_topRotateText.
isNull())
586 return m_mapDisplacementX;
591 return m_mapDisplacementY;
631 return m_initialGridPointX;
636 return m_initialGridPointY;
661 return m_pointTextSize;
676 return m_visibleAllTexts;
681 return m_superscriptText;
686 return m_lneVrtDisplacement;
691 return m_lneHrzDisplacement;
716 return m_bottomRotateText;
721 return m_leftRotateText;
726 return m_rightRotateText;
731 return m_topRotateText;
virtual void setSystematic(Systematic *sys)
Class responsible for maintaining the drawing context of a MVC component. It is always used by the "M...
virtual bool isBottomText()
virtual double getMapDisplacementX()
virtual void setMapDisplacementX(double displacement)
virtual double getDisplacementX()
virtual double getScale()
virtual te::color::RGBAColor getLineColor()
virtual int getTextPointSize()
Variant getValue()
Returns stored value.
virtual EnumDataType * getEnumDataType()
Returns data type enumeration.
void addOption(Variant variant)
void setPublic(bool publicProperty)
Sets true if property is public, false otherwise If the component, father of this property...
virtual EnumType * getDataTypeBool() const
Returns value that represents type bool belonging to enumeration.
virtual void setVisibleAllTexts(bool visible)
virtual EnumType * getDataTypeDouble() const
Returns value that represents type double belonging to enumeration.
bool isNull()
Returns true if no value has been set, false otherwise.
virtual EnumType * getDataTypeInt() const
Returns value that represents type integer belonging to enumeration.
virtual void updateProperties(te::layout::Properties *properties)
Reimplemented from Observable.
virtual Properties * getProperties() const
Reimplemented from Observable.
Variant getOptionByCurrentChoice()
virtual double getLneHrzDisplacement()
Class that represents a "Model" part of GridMap MVC component. Its coordinate system is the same of s...
The Properties class represents a persistent set of properties. The Properties can be saved to a file...
virtual double getInitialGridPointX()
virtual std::map< te::gm::Point *, std::string > getGridInfo()
virtual EnumType * getStyleNone() const
Returns value that represents none style type belonging to enumeration.
virtual EnumObjectType * getEnumObjectType()
Returns graphic object (MVC component) and widget object (MVC widget) type enumeration.
virtual void updateProperties(te::layout::Properties *properties)
Reimplemented from Observable.
virtual bool isSuperscriptText()
virtual void setMapScale(double scale)
virtual void setBoundingBoxItemMM(te::gm::Envelope box)
virtual double getMapDisplacementY()
virtual EnumGridStyleType * getEnumGridStyleType()
Returns grid style type enumeration.
virtual void gridTextFreeMemory()
static Enums & getInstance()
It returns a reference to the singleton instance.
A point with x and y coordinate values.
An Envelope defines a 2D rectangular region.
#define TE_UNKNOWN_SRS
A numeric value to represent a unknown SRS identification in TerraLib.
virtual EnumType * getDataTypeGridSettings() const
Returns value that represents type GridSettings (string) belonging to enumeration.
GridMapModel()
Constructor.
Class to represent a data type enumeration. Ex.: int, double, bool, te::color::RGBAColor (color)...
virtual te::map::AbstractLayerPtr getLayer()
Class that represents a "Model" part of Map MVC component. Its coordinate system is the same of scene...
virtual void visitDependent(ContextItem context)
visit and if necessary redraw
virtual std::string getMapName()
virtual void setBoxMapMM(te::gm::Envelope box)
Class acts like a union for some C++/TerraLib5 data types. Responsible for storing the value...
virtual double getLneVrtGap()
virtual void setWorldBox(te::gm::Envelope box)
virtual EnumType * getEnum(int enumId) const
Searching for a value of the enumeration by id.
virtual EnumType * getDataTypeColor() const
Returns value that represents type te::color::RGBAColor** (color) belonging to enumeration.
virtual te::gm::Envelope getWorldBox()
virtual double getMapScale()
virtual double getInitialGridPointY()
double toDouble()
Returns the value of double type. (The setValue method received a double)
virtual double getLneVrtDisplacement()
Class that represents a "Model" part of Map MVC component. Its coordinate system is the same of scene...
void setComposeWidget(bool compose)
Sets true if property compose a widget, false otherwise If true, and the object that owns this proper...
virtual te::gm::Envelope getMapBox()
virtual Properties * getProperties() const
Reimplemented from Observable.
virtual int getLineWidth()
void setValue(ValueType value, EnumType *type)
Stores a copy of value.
virtual std::string getName()
Reimplemented from Observable.
virtual bool isTopRotateText()
Class that represents the value of an enumeration. An enumeration is made of "1..n" objects EnumType...
virtual double getDisplacementY()
virtual EnumType * getDataTypeStringList() const
Returns value that represents type StringList (string) belonging to enumeration.
virtual bool isLeftText()
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
virtual std::string getFontFamily()
virtual void calculateGaps(te::gm::Envelope box)
virtual EnumType * getStyleNone() const
Returns value that represents none style type belonging to enumeration.
std::string toString()
Returns the value of string type. (The setValue method received a string)
virtual EnumType * getGridMapItem() const
Returns value that represents gridmapitem (MVC Component) type belonging to enumeration.
virtual EnumType * getGridStyle()
void setName(std::string name)
Sets the name of this property.
virtual bool isBottomRotateText()
virtual bool isRightText()
virtual EnumType * getLineStyle()
virtual void setMenu(bool menu)
Sets true if property will be used in a menu, false otherwise.
virtual void setMapDisplacementY(double displacement)
te::color::RGBAColor toColor()
Returns the value of te::color::RGBAColor type. (The setValue method received a te::color::RGBAColor)...
virtual te::color::RGBAColor getTextColor()
virtual te::gm::Envelope getBoxMapMM()
virtual void setMapName(std::string name)
virtual EnumLineStyleType * getEnumLineStyleType()
Returns line style type enumeration.
virtual EnumType * getDataTypeString() const
Returns value that represents type string belonging to enumeration.
virtual bool isLeftRotateText()
virtual ~GridMapModel()
Destructor.
virtual bool contains(Property property)
Checks if the property is contained within the set of properties.
virtual bool isRightRotateText()
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.
int toInt()
Returns the value of int type. (The setValue method received a int)
virtual void setVisible(bool visible)
virtual bool isVisibleAllTexts()
bool toBool()
Returns the value of boolean type. (The setValue method received a boolean)
virtual double getLneHrzGap()
void setValue(ValueType value, EnumType *type)
Stores a copy of value.