All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AbstractRuler.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 AbstractRuler.cpp
22 
23  \brief
24 
25  \ingroup layout
26 */
27 
28 // TerraLib
29 #include "AbstractRuler.h"
30 #include "../../core/PaperConfig.h"
31 
33  m_visible(true),
34  m_longLine(3.),
35  m_mediumLine(2.5),
36  m_smallLine(1.5),
37  m_blockSize(10),
38  m_middleBlockSize(5),
39  m_smallBlockSize(1),
40  m_height(7),
41  m_cornerSize(7),
42  m_spacingLineText(3.5)
43 {
44 
45 }
46 
48 {
49 
50 }
51 
53 {
54  m_visible = visible;
55 }
56 
58 {
59  return m_visible;
60 }
61 
63 {
64  return m_longLine;
65 }
66 
68 {
69  m_longLine = size;
70 }
71 
73 {
74  return m_mediumLine;
75 }
76 
78 {
79  m_mediumLine = size;
80 }
81 
83 {
84  return m_smallLine;
85 }
86 
88 {
89  m_smallLine = size;
90 }
91 
93 {
94  return m_blockSize;
95 }
96 
98 {
99  m_blockSize = size;
100 }
101 
103 {
104  return m_middleBlockSize;
105 }
106 
108 {
109  m_middleBlockSize = size;
110 }
111 
113 {
114  return m_smallBlockSize;
115 }
116 
118 {
119  m_smallBlockSize = size;
120 }
121 
123 {
124  return m_height;
125 }
126 
128 {
129  m_height = size;
130 }
131 
133 {
134  return m_cornerSize;
135 }
136 
138 {
139  m_cornerSize = size;
140 }
141 
142 void te::layout::AbstractRuler::drawText( QPoint p, std::string txt, double angle, QPainter* painter )
143 {
144  if(txt.empty())
145  return;
146 
147  painter->translate(p);
148  if(angle != 0.)
149  painter->rotate(angle);
150 
151  painter->drawText(p, txt.c_str());
152 }
153 
155 {
156  return m_spacingLineText;
157 }
158 
160 {
161  m_spacingLineText = size;
162 }
virtual double getSpacingLineText()
virtual void setMiddleBlockSize(double size)
virtual void drawText(QPoint p, std::string txt, double angle, QPainter *painter)
virtual void setHeight(double size)
virtual void setVisible(bool visible)
virtual void setSmallLine(double size)
virtual double getCornerSize()
virtual void setCornerSize(double size)
virtual double getSmallLine()
Abstract class representing a ruler.
virtual double getMediumLine()
virtual void setSmallBlockSize(double size)
virtual double getLongLine()
virtual double getMiddleBlockSize()
virtual void setBlockSize(double size)
virtual double getSmallBlockSize()
virtual void setSpacingLineText(double size)
virtual void setLongLine(double size)
virtual void setMediumLine(double size)
virtual double getBlockSize()
virtual double getHeight()