ShapeGroupElement.h Source File documentation

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 {
21 class ShapeGroupElement
22 {
23 boost::optional<ShapeInfo> m_shapeInfo;
24 ShapeGroupElement *m_parent;
25 std::vector<ShapeGroupElement *> m_children;
26 unsigned m_seqNum;
27 ShapeGroupElement &operator=(const ShapeGroupElement &); //not implemented
28 ShapeGroupElement(const ShapeGroupElement &); //not implemented
29 VectorTransformation2D m_transform;
30 public:
31 ShapeGroupElement(ShapeGroupElement *parent);
32 ShapeGroupElement(ShapeGroupElement *parent, unsigned seqNum);
33 ~ShapeGroupElement();
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;
44 ShapeGroupElement *getParent();
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: */
libmspub::ShapeGroupElement::setShapeInfo
void setShapeInfo(const ShapeInfo &shapeInfo)
Definition: ShapeGroupElement.cpp:39
libmspub::ShapeGroupElement::m_transform
VectorTransformation2D m_transform
Definition: ShapeGroupElement.h:29
libmspub::ShapeGroupElement::setTransform
void setTransform(const VectorTransformation2D &transform)
Definition: ShapeGroupElement.cpp:44
VectorTransformation2D.h
libmspub::ShapeGroupElement::m_shapeInfo
boost::optional< ShapeInfo > m_shapeInfo
Definition: ShapeGroupElement.h:23
libmspub::ShapeGroupElement::operator=
ShapeGroupElement & operator=(const ShapeGroupElement &)
libmspub::Coordinate
Definition: Coordinate.h:15
libmspub::ShapeGroupElement::visit
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
libmspub::ShapeGroupElement::~ShapeGroupElement
~ShapeGroupElement()
Definition: ShapeGroupElement.cpp:23
libmspub::ShapeGroupElement::m_children
std::vector< ShapeGroupElement * > m_children
Definition: ShapeGroupElement.h:25
libmspub::ShapeGroupElement::getParent
ShapeGroupElement * getParent()
Definition: ShapeGroupElement.cpp:96
libmspub
Definition: Arrow.h:13
libmspub::ShapeGroupElement::setup
void setup(boost::function< void(ShapeGroupElement &self)> visitor)
Definition: ShapeGroupElement.cpp:49
libmspub::ShapeGroupElement::ShapeGroupElement
ShapeGroupElement(const ShapeGroupElement &)
libmspub::VectorTransformation2D
Definition: VectorTransformation2D.h:25
libmspub::ShapeGroupElement::getSeqNum
unsigned getSeqNum() const
Definition: ShapeGroupElement.cpp:111
libmspub::ShapeGroupElement::m_seqNum
unsigned m_seqNum
Definition: ShapeGroupElement.h:26
libmspub::ShapeGroupElement::m_parent
ShapeGroupElement * m_parent
Definition: ShapeGroupElement.h:24
ShapeInfo.h
libmspub::ShapeGroupElement
Definition: ShapeGroupElement.h:21
libmspub::ShapeInfo
Definition: ShapeInfo.h:34
libmspub::ShapeGroupElement::isGroup
bool isGroup() const
Definition: ShapeGroupElement.cpp:91
libmspub::ShapeGroupElement::setSeqNum
void setSeqNum(unsigned seqNum)
Definition: ShapeGroupElement.cpp:106