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