IWORKTable.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3  * This file is part of the libetonyek project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  */
9 
10 #ifndef IWORKTABLE_H_INCLUDED
11 #define IWORKTABLE_H_INCLUDED
12 
13 #include <deque>
14 
15 #include <glm/glm.hpp>
16 
17 #include "IWORKTypes_fwd.h"
18 #include "IWORKOutputElements.h"
19 
20 namespace libetonyek
21 {
22 
24 {
25  struct Cell
26  {
28  unsigned m_columnSpan;
29  unsigned m_rowSpan;
30  bool m_covered;
31 
32  Cell();
33  };
34 
35  typedef std::deque<Cell> Row_t;
36  typedef std::deque<Row_t> Table_t;
37 
38 public:
39  typedef std::deque<double> ColumnSizes_t;
40  typedef std::deque<double> RowSizes_t;
41 
42 public:
43  IWORKTable();
44 
45  void setSizes(const ColumnSizes_t &columnSizes, const RowSizes_t &rowSizes);
46  void insertCell(unsigned column, unsigned row, const IWORKOutputElements &content = IWORKOutputElements(), unsigned columnSpan = 1, unsigned rowSpan = 1);
47  void insertCoveredCell(unsigned column, unsigned row);
48 
50 
51  void draw(const glm::dmat3 &trafo, IWORKOutputElements &elements) const;
52 
53 private:
54  Table_t m_table;
55  ColumnSizes_t m_columnSizes;
56  RowSizes_t m_rowSizes;
58 };
59 
60 }
61 
62 #endif // IWORKTABLE_H_INCLUDED
63 
64 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
Definition: IWORKColorElement.cpp:19
Definition: IWORKOutputElements.h:25
Definition: IWORKTable.h:25
std::deque< Cell > Row_t
Definition: IWORKTable.h:35
std::deque< Row_t > Table_t
Definition: IWORKTable.h:36
boost::shared_ptr< IWORKGeometry > IWORKGeometryPtr_t
Definition: IWORKTypes_fwd.h:29
IWORKOutputElements m_content
Definition: IWORKTable.h:27
ColumnSizes_t m_columnSizes
Definition: IWORKTable.h:55
void setGeometry(const IWORKGeometryPtr_t &geometry)
Definition: IWORKTable.cpp:70
IWORKGeometryPtr_t m_geometry
Definition: IWORKTable.h:57
void setSizes(const ColumnSizes_t &columnSizes, const RowSizes_t &rowSizes)
Definition: IWORKTable.cpp:39
Table_t m_table
Definition: IWORKTable.h:54
unsigned m_rowSpan
Definition: IWORKTable.h:29
unsigned m_columnSpan
Definition: IWORKTable.h:28
IWORKTable()
Definition: IWORKTable.cpp:31
void insertCell(unsigned column, unsigned row, const IWORKOutputElements &content=IWORKOutputElements(), unsigned columnSpan=1, unsigned rowSpan=1)
Definition: IWORKTable.cpp:48
std::deque< double > RowSizes_t
Definition: IWORKTable.h:40
std::deque< double > ColumnSizes_t
Definition: IWORKTable.h:39
Definition: IWORKTable.h:23
Definition: IWORKToken.h:77
RowSizes_t m_rowSizes
Definition: IWORKTable.h:56
void insertCoveredCell(unsigned column, unsigned row)
Definition: IWORKTable.cpp:60
Definition: IWORKToken.h:98
Cell()
Definition: IWORKTable.cpp:23
bool m_covered
Definition: IWORKTable.h:30
void draw(const glm::dmat3 &trafo, IWORKOutputElements &elements) const
Definition: IWORKTable.cpp:75

Generated for libetonyek by doxygen 1.8.8