Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __SHAPEGROUPELEMENT_H__
00011 #define __SHAPEGROUPELEMENT_H__
00012 #include <boost/optional.hpp>
00013 #include <boost/function.hpp>
00014 #include <vector>
00015
00016 #include "ShapeInfo.h"
00017 #include "VectorTransformation2D.h"
00018
00019 namespace libmspub
00020 {
00021 class ShapeGroupElement
00022 {
00023 boost::optional<ShapeInfo> m_shapeInfo;
00024 ShapeGroupElement *m_parent;
00025 std::vector<ShapeGroupElement *> m_children;
00026 unsigned m_seqNum;
00027 ShapeGroupElement &operator=(const ShapeGroupElement &);
00028 ShapeGroupElement(const ShapeGroupElement &);
00029 VectorTransformation2D m_transform;
00030 public:
00031 ShapeGroupElement(ShapeGroupElement *parent);
00032 ShapeGroupElement(ShapeGroupElement *parent, unsigned seqNum);
00033 ~ShapeGroupElement();
00034 void setShapeInfo(const ShapeInfo &shapeInfo);
00035 void setup(boost::function<void(ShapeGroupElement &self)> visitor);
00036 void visit(boost::function<
00037 boost::function<void(void)>
00038 (const ShapeInfo &info, const Coordinate &relativeTo, const VectorTransformation2D &foldedTransform, bool isGroup, const VectorTransformation2D &thisTransform)> visitor,
00039 const Coordinate &relativeTo, const VectorTransformation2D &foldedTransform) const;
00040 void visit(boost::function<
00041 boost::function<void(void)>
00042 (const ShapeInfo &info, const Coordinate &relativeTo, const VectorTransformation2D &foldedTransform, bool isGroup, const VectorTransformation2D &thisTransform)> visitor) const;
00043 bool isGroup() const;
00044 ShapeGroupElement *getParent();
00045 const ShapeGroupElement *getParent() const;
00046 void setSeqNum(unsigned seqNum);
00047 void setTransform(const VectorTransformation2D &transform);
00048 unsigned getSeqNum() const;
00049 };
00050 }
00051
00052 #endif
00053