32 #include "../../../../../geometry/Envelope.h"
33 #include "../../../../../geometry/Coord2D.h"
37 #include "../../../srs/Config.h"
43 m_lneCornerHrzDisplacement(10),
44 m_lneCornerVrtDisplacement(10),
45 m_lowerRightCornerText(false),
46 m_upperRightCornerText(false),
47 m_lowerLeftCornerText(false),
48 m_upperLeftCornerText(false),
49 m_visibleCornerTextsText(false),
50 m_pointTextSizeCorner(12),
68 m_name =
"GRID_GEODESIC_MODEL";
77 delete m_settingsConfig;
99 drawVerticalLines(canvas, box);
100 drawHorizontalLines(canvas, box);
112 yInit = m_initialGridPointY;
116 int nParts = (int)(dify/m_lneVrtGap);
119 yInit = m_initialGridPointY;
123 yInit = yInit + (nParts * m_lneVrtGap);
157 xInit = m_initialGridPointX;
161 int nParts = (int)(difx/m_lneHrzGap);
164 xInit = m_initialGridPointX;
168 xInit = xInit + (nParts * m_lneHrzGap);
196 if(m_lneHrzGap > 0 && m_lneVrtGap > 0)
204 if(m_initialGridPointX <= 0)
206 m_initialGridPointX = init.
x;
208 if(m_initialGridPointY <= 0)
210 m_initialGridPointY = init.
y;
217 m_lneHrzGap = fabs(init.
x - end.
x);
221 m_lneVrtGap = m_lneHrzGap;
225 m_lneVrtGap = m_lneHrzGap = 0.001;
232 m_property.setName(m_settingsConfig->getName());
233 m_property.setId(
"unknown");
234 std::string sValuePlanar =
"Settings";
238 pro_name.
setName(m_settingsConfig->getName());
240 m_property.addSubProperty(pro_name);
245 pro_visible.
setName(m_settingsConfig->getVisible());
247 m_property.addSubProperty(pro_visible);
250 pro_lneHrzGap.
setName(m_settingsConfig->getLneHrzGap());
252 m_property.addSubProperty(pro_lneHrzGap);
255 pro_lneVrtGap.
setName(m_settingsConfig->getLneVrtGap());
257 m_property.addSubProperty(pro_lneVrtGap);
260 pro_initialGridPointX.
setName(m_settingsConfig->getInitialGridPointX());
262 m_property.addSubProperty(pro_initialGridPointX);
265 pro_initialGridPointY.
setName(m_settingsConfig->getInitialGridPointY());
267 m_property.addSubProperty(pro_initialGridPointY);
271 pro_gridStyle.
setName(m_settingsConfig->getStyle());
273 m_property.addSubProperty(pro_gridStyle);
277 pro_lineStyle.
setName(m_settingsConfig->getLineStyle());
279 m_property.addSubProperty(pro_lineStyle);
282 pro_lineColor.
setName(m_settingsConfig->getLineColor());
284 m_property.addSubProperty(pro_lineColor);
287 pro_lineWidth.
setName(m_settingsConfig->getLineWidth());
289 m_property.addSubProperty(pro_lineWidth);
293 pro_pointTextSize.
setName(m_settingsConfig->getPointTextSize());
295 m_property.addSubProperty(pro_pointTextSize);
298 pro_fontText.
setName(m_settingsConfig->getFontText());
300 m_property.addSubProperty(pro_fontText);
303 pro_textColor.
setName(m_settingsConfig->getTextColor());
305 m_property.addSubProperty(pro_textColor);
309 pro_visibleAllTexts.
setName(m_settingsConfig->getVisibleAllTexts());
311 m_property.addSubProperty(pro_visibleAllTexts);
314 pro_superscriptText.
setName(m_settingsConfig->getSuperscriptText());
316 m_property.addSubProperty(pro_superscriptText);
319 pro_lneVrtDisplacement.
setName(m_settingsConfig->getLneVrtDisplacement());
321 m_property.addSubProperty(pro_lneVrtDisplacement);
324 pro_lneHrzDisplacement.
setName(m_settingsConfig->getLneHrzDisplacement());
326 m_property.addSubProperty(pro_lneHrzDisplacement);
329 pro_bottomText.
setName(m_settingsConfig->getBottomText());
331 m_property.addSubProperty(pro_bottomText);
334 pro_leftText.
setName(m_settingsConfig->getLeftText());
336 m_property.addSubProperty(pro_leftText);
339 pro_rightText.
setName(m_settingsConfig->getRightText());
341 m_property.addSubProperty(pro_rightText);
344 pro_topText.
setName(m_settingsConfig->getTopText());
346 m_property.addSubProperty(pro_topText);
349 pro_bottomRotateText.
setName(m_settingsConfig->getBottomRotateText());
351 m_property.addSubProperty(pro_bottomRotateText);
354 pro_leftRotateText.
setName(m_settingsConfig->getLeftRotateText());
356 m_property.addSubProperty(pro_leftRotateText);
359 pro_rightRotateText.
setName(m_settingsConfig->getRightRotateText());
361 m_property.addSubProperty(pro_rightRotateText);
364 pro_topRotateText.
setName(m_settingsConfig->getTopRotateText());
366 m_property.addSubProperty(pro_topRotateText);
387 if(!pro_lneHrzGap.
isNull())
393 if(!pro_lneVrtGap.
isNull())
399 if(!pro_initialGridPointX.
isNull())
405 if(!pro_initialGridPointY.
isNull())
411 if(!pro_gridStyle.
isNull())
418 if(!pro_lineStyle.
isNull())
425 if(!pro_lineColor.
isNull())
431 if(!pro_lineWidth.
isNull())
437 if(!pro_pointTextSize.
isNull())
443 if(!pro_fontText.
isNull())
449 if(!pro_textColor.
isNull())
455 if(!pro_visibleAllTexts.
isNull())
461 if(!pro_superscriptText.
isNull())
467 if(!pro_lneVrtDisplacement.
isNull())
469 m_lneVrtDisplacement = pro_lneVrtDisplacement.
getValue().
toInt();
473 if(!pro_lneHrzDisplacement.
isNull())
475 m_lneHrzDisplacement = pro_lneHrzDisplacement.
getValue().
toInt();
479 if(!pro_bottomText.
isNull())
485 if(!pro_leftText.
isNull())
491 if(!pro_rightText.
isNull())
503 if(!pro_bottomRotateText.
isNull())
509 if(!pro_leftRotateText.
isNull())
515 if(!pro_rightRotateText.
isNull())
521 if(!pro_topRotateText.
isNull())
virtual void updateProperty(te::layout::Property property)
virtual void draw(te::map::Canvas *canvas, te::gm::Envelope box, int srid)
double m_lneHrzDisplacement
const double & getUpperRightX() const
It returns a constant refernce to the x coordinate of the upper right corner.
const double & getLowerLeftY() const
It returns a constant refernce to the y coordinate of the lower left corner.
An utility struct for representing 2D coordinates.
const double & getUpperRightY() const
It returns a constant refernce to the x coordinate of the upper right corner.
void setValue(typename ValueType value, LayoutPropertyDataType type)
virtual te::gm::LinearRing * addCoordsInX(te::gm::Envelope box, double gap)
te::layout::LayoutGridStyle getLayoutEnumGridStyle(std::string val)
A LinearRing is a LineString that is both closed and simple.
GeodesicGridSettingsConfigProperties * m_settingsConfig
std::string getLayoutGridStyle(int enumVal)
An Envelope defines a 2D rectangular region.
#define TE_UNKNOWN_SRS
A numeric value to represent a unknown SRS identification in TerraLib.
virtual te::gm::LinearRing * addCoordsInY(te::gm::Envelope box, double gap)
virtual void calculateGaps(te::gm::Envelope box)
virtual te::layout::Property getProperty()
virtual void drawLineW(te::gm::LinearRing *line)
virtual void drawHorizontalLines(te::map::Canvas *canvas, te::gm::Envelope box)
virtual bool containsSubProperty(Property subProperty)
double m_lneVrtDisplacement
A canvas is an abstraction of a drawing area.
virtual ~GridGeodesicModel()
const double & getLowerLeftX() const
It returns a constant reference to the x coordinate of the lower left corner.
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
Coord2D getUpperRight() const
It returns the upper right coordinate of the envelope.
void setName(std::string name)
te::map::LineDashStyle getLayoutEnumDashStyle(std::string val)
virtual void drawVerticalLines(te::map::Canvas *canvas, te::gm::Envelope box)
virtual void setLineColor(const te::color::RGBAColor &color)=0
It sets the pen color used to draw line geometries.
te::color::RGBAColor toColor()
static Context * getInstance()
This function is called to create an instance of the class.
Coord2D getLowerLeft() const
It returns the lower left coordinate of the envelope.
std::string getLayoutDashStyle(int enumVal)
bool isValid() const
It tells if the rectangle is valid or not.