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"
18
19namespace 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
30public:
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: */
Definition: ShapeGroupElement.h:22
~ShapeGroupElement()
Definition: ShapeGroupElement.cpp:23
bool isGroup() const
Definition: ShapeGroupElement.cpp:91
unsigned m_seqNum
Definition: ShapeGroupElement.h:26
void setTransform(const VectorTransformation2D &transform)
Definition: ShapeGroupElement.cpp:44
ShapeGroupElement(const ShapeGroupElement &)
ShapeGroupElement & operator=(const ShapeGroupElement &)
void setSeqNum(unsigned seqNum)
Definition: ShapeGroupElement.cpp:106
void setup(boost::function< void(ShapeGroupElement &self)> visitor)
Definition: ShapeGroupElement.cpp:49
ShapeGroupElement * m_parent
Definition: ShapeGroupElement.h:24
VectorTransformation2D m_transform
Definition: ShapeGroupElement.h:29
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
boost::optional< ShapeInfo > m_shapeInfo
Definition: ShapeGroupElement.h:23
std::vector< ShapeGroupElement * > m_children
Definition: ShapeGroupElement.h:25
void visit(boost::function< boost::function< void(void)>(const ShapeInfo &info, const Coordinate &relativeTo, const VectorTransformation2D &foldedTransform, bool isGroup, const VectorTransformation2D &thisTransform)> visitor) const
unsigned getSeqNum() const
Definition: ShapeGroupElement.cpp:111
void setShapeInfo(const ShapeInfo &shapeInfo)
Definition: ShapeGroupElement.cpp:39
ShapeGroupElement * getParent()
Definition: ShapeGroupElement.cpp:96
Definition: VectorTransformation2D.h:26
Definition: Arrow.h:14
Definition: Coordinate.h:16
Definition: ShapeInfo.h:35

Generated for libmspub by doxygen 1.9.3