ShapeGroupElement.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 libmspub 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 __SHAPEGROUPELEMENT_H__
11 #define __SHAPEGROUPELEMENT_H__
12 #include <boost/optional.hpp>
13 #include <boost/function.hpp>
14 #include <vector>
15 
16 #include "ShapeInfo.h"
17 #include "VectorTransformation2D.h"
18 
19 namespace libmspub
20 {
22 {
23  boost::optional<ShapeInfo> m_shapeInfo;
25  std::vector<ShapeGroupElement *> m_children;
26  unsigned m_seqNum;
27  ShapeGroupElement &operator=(const ShapeGroupElement &); //not implemented
28  ShapeGroupElement(const ShapeGroupElement &); //not implemented
30 public:
32  ShapeGroupElement(ShapeGroupElement *parent, unsigned seqNum);
34  void setShapeInfo(const ShapeInfo &shapeInfo);
35  void setup(boost::function<void(ShapeGroupElement &self)> visitor);
36  void visit(boost::function<
37  boost::function<void(void)>
38  (const ShapeInfo &info, const Coordinate &relativeTo, const VectorTransformation2D &foldedTransform, bool isGroup, const VectorTransformation2D &thisTransform)> visitor,
39  const Coordinate &relativeTo, const VectorTransformation2D &foldedTransform) const;
40  void visit(boost::function<
41  boost::function<void(void)>
42  (const ShapeInfo &info, const Coordinate &relativeTo, const VectorTransformation2D &foldedTransform, bool isGroup, const VectorTransformation2D &thisTransform)> visitor) const;
43  bool isGroup() const;
45  const ShapeGroupElement *getParent() const;
46  void setSeqNum(unsigned seqNum);
47  void setTransform(const VectorTransformation2D &transform);
48  unsigned getSeqNum() const;
49 };
50 }
51 
52 #endif
53 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
void setShapeInfo(const ShapeInfo &shapeInfo)
Definition: ShapeGroupElement.cpp:39
VectorTransformation2D m_transform
Definition: ShapeGroupElement.h:29
void setTransform(const VectorTransformation2D &transform)
Definition: ShapeGroupElement.cpp:44
boost::optional< ShapeInfo > m_shapeInfo
Definition: ShapeGroupElement.h:23
ShapeGroupElement & operator=(const ShapeGroupElement &)
Definition: Coordinate.h:15
~ShapeGroupElement()
Definition: ShapeGroupElement.cpp:23
std::vector< ShapeGroupElement * > m_children
Definition: ShapeGroupElement.h:25
ShapeGroupElement * getParent()
Definition: ShapeGroupElement.cpp:96
bool isGroup() const
Definition: ShapeGroupElement.cpp:91
Definition: Arrow.h:13
void setup(boost::function< void(ShapeGroupElement &self)> visitor)
Definition: ShapeGroupElement.cpp:49
ShapeGroupElement(const ShapeGroupElement &)
unsigned getSeqNum() const
Definition: ShapeGroupElement.cpp:111
Definition: VectorTransformation2D.h:25
unsigned m_seqNum
Definition: ShapeGroupElement.h:26
ShapeGroupElement * m_parent
Definition: ShapeGroupElement.h:24
Definition: ShapeGroupElement.h:21
Definition: ShapeInfo.h:34
void setSeqNum(unsigned seqNum)
Definition: ShapeGroupElement.cpp:106
void visit(boost::function< boost::function< void(void)>(const ShapeInfo &info, const Coordinate &relativeTo, const VectorTransformation2D &foldedTransform, bool isGroup, const VectorTransformation2D &thisTransform)> visitor, const Coordinate &relativeTo, const VectorTransformation2D &foldedTransform) const

Generated for libmspub by doxygen 1.8.9.1