All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PaperConfig.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2014-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 PaperConfig.cpp
22 
23  \brief
24 
25  \ingroup layout
26 */
27 
28 // TerraLib
29 #include "PaperConfig.h"
30 
32  m_paperOrientationType(Portrait),
33  m_paperType(A4),
34  m_customW(0),
35  m_customH(0)
36 {
37 
38 }
39 
41  m_paperOrientationType(Portrait)
42 {
43  m_paperType = paperType;
44 }
45 
47 {
48 
49 }
50 
52 {
53  m_paperType = paperType;
54 }
55 
56 void te::layout::PaperConfig::getPaperSize( double &w, double &h )
57 {
58  switch(m_paperType)
59  {
60  case Letter:
61  w=216;
62  h=279;
63  break;
64  case Legal:
65  w=216;
66  h=356;
67  break;
68  case Executive:
69  w=191;
70  h=254;
71  break;
72  case A0 :
73  w=841;
74  h=1189;
75  break;
76  case A1 :
77  w=594;
78  h=841;
79  break;
80  case A2 :
81  w=420;
82  h=594;
83  break;
84  case A3 :
85  w=297;
86  h=420;
87  break;
88  case A4 :
89  w=210;
90  h=297;
91  break;
92  case A5 :
93  w=148;
94  h=210;
95  break;
96  case A6 :
97  w=105;
98  h=148;
99  break;
100  case A7 :
101  w=74;
102  h=105;
103  break;
104  case A8 :
105  w=52;
106  h=74;
107  break;
108  case A9 :
109  w=37;
110  h=52;
111  break;
112  case Custom:
113  w = m_customW;
114  h = m_customH;
115  break;
116  default:
117  w = 0;
118  h = 0;
119  }
120 }
121 
123 {
124  m_paperOrientationType = orientation;
125 }
126 
128 {
129  return m_paperOrientationType;
130 }
131 
133 {
134  m_customW = w;
135  m_customH = h;
136 }
enum te::layout::_TdkOrientation LayoutOrientationType
LayoutAbstractPaperType
Enum TdkAbstractComponentType. This is the enumeration of the components types.
Definition: AbstractType.h:65
virtual void setPaperSizeCustom(double w, double h)
virtual LayoutOrientationType getPaperOrientantion()
virtual void setPaperSize(LayoutAbstractPaperType paperType)
Definition: PaperConfig.cpp:51
portrait orientation
Definition: AbstractType.h:85
LayoutAbstractPaperType m_paperType
Definition: PaperConfig.h:55
virtual void getPaperSize(double &w, double &h)
Definition: PaperConfig.cpp:56
virtual void setPaperOrientation(LayoutOrientationType orientation)