All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AbstractRulerModel.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2001-2014 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 AbstractRulerModel.cpp
22 
23  \brief
24 
25  \ingroup layout
26 */
27 
28 #include "AbstractRulerModel.h"
29 
30 
32  m_visible(true),
33  m_spacing(1.),
34  m_blockSize(10),
35  m_middleBlockSize(5),
36  m_smallBlockSize(1),
37  m_longLine(6.),
38  m_mediumLine(4.),
39  m_smallLine(3.),
40  m_borderLineSize(0.3),
41  m_lineMargin(2.),
42  m_backEndSpacing(10),
43  m_backEndMargin(2.)
44 {
45  m_box = te::gm::Envelope(0., 0., 150., 150.);
46  m_paperBox = te::gm::Envelope(0., 0., 210., 297.); // A4 default
47  m_backEndBox = te::gm::Envelope(0., 0., 150., 150.);
48 }
49 
51 {
52 
53 }
54 
56 {
58  line = utils->createSimpleLine(box);
59  utils->drawLineW(line);
60  if(line) delete line;
61 }
62 
64 {
65  canvas->setPolygonFillColor(color);
66  canvas->setPolygonContourColor(color);
67  utils->drawRectW(box);
68 }
69 
71 {
72  m_paperBox = box;
73 }
74 
76 {
77  return m_paperBox;
78 }
79 
81 {
82  m_visible = visible;
83 }
84 
86 {
87  return m_visible;
88 }
virtual void setVisible(bool visible)
virtual void setPolygonFillColor(const te::color::RGBAColor &color)=0
It sets the color used to fill the draw of polygon geometries.
virtual void drawRectW(te::gm::Envelope box)
Definition: Utils.cpp:49
virtual void setPaperBox(te::gm::Envelope box)
virtual void drawRectW(te::gm::Envelope box, te::color::RGBAColor color, te::map::Canvas *canvas, Utils *utils)
virtual te::gm::LinearRing * createSimpleLine(te::gm::Envelope box)
Definition: Utils.cpp:85
A LinearRing is a LineString that is both closed and simple.
Definition: LinearRing.h:53
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
virtual void drawLineW(te::gm::Envelope box, Utils *utils)
virtual void drawLineW(te::gm::LinearRing *line)
Definition: Utils.cpp:73
A canvas is an abstraction of a drawing area.
Definition: Canvas.h:91
virtual void setPolygonContourColor(const te::color::RGBAColor &color)=0
It sets the pen color used to draw the boundary of polygon geometries.
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
Definition: RGBAColor.h:57
virtual te::gm::Envelope getPaperBox()