ShapeGroup.h
Go to the documentation of this file.
1 #ifndef __SHAPEGROUP_H__
2 #define __SHAPEGROUP_H__
4 #include "ShapeGroupPainter.h"
5 #include "MSPUBConstants.h"
6 #include "Coordinate.h"
7 #include <boost/ptr_container/ptr_vector.hpp>
8 namespace libmspub
9 {
10 class ShapeGroup;
12 {
13 public:
18  {
19  }
20  virtual unsigned getPageSeqNum() const = 0;
21  virtual unsigned getFirstShapeSeqNum() const = 0;
22  virtual void setPage(unsigned pageSeqNum) = 0;
23  virtual void visit(ShapeGroupVisitor *v) = 0;
25  {
26  }
27 private:
30 };
32 {
33  ShapeGroup(const ShapeGroup &);
35 public:
36  boost::ptr_vector<ShapeGroupElement> m_elements;
38  {
39  }
40  unsigned getFirstShapeSeqNum() const
41  {
42  return (!m_elements.empty()) ? m_elements[0].getFirstShapeSeqNum() : 0;
43  }
44  unsigned getPageSeqNum() const
45  {
46  if (!m_elements.empty())
47  {
48  return m_elements[0].getPageSeqNum();
49  }
50  return 0;
51  }
52  void setPage(unsigned pageSeqNum)
53  {
54  for (unsigned i = 0; i < m_elements.size(); ++i)
55  {
56  m_elements[i].setPage(pageSeqNum);
57  }
58  }
60  void visit(ShapeGroupVisitor *v);
61  unsigned m_seqNum;
62 };
64 {
67  unsigned m_pageSeqNum;
68  unsigned m_seqNum;
69 public:
70  ShapeGroupElementLeaf(ShapeGroup *parent, unsigned seqNum = 0) : ShapeGroupElement(parent), m_pageSeqNum(0), m_seqNum(seqNum)
71  {
72  }
73  unsigned getPageSeqNum() const
74  {
75  return m_pageSeqNum;
76  }
77  unsigned getFirstShapeSeqNum() const
78  {
79  return m_seqNum;
80  }
81  void setPage(unsigned pageSeqNum)
82  {
83  m_pageSeqNum = pageSeqNum;
84  }
85  void visit(ShapeGroupVisitor *v);
87 };
88 }
89 #endif
90 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */

Generated for libmspub by doxygen 1.8.1.2