ShapeGroupElement.h
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 &); //not implemented
00019   ShapeGroupElement(const ShapeGroupElement &); //not implemented
00020   VectorTransformation2D m_transform;
00021 public:
00022   ShapeGroupElement(ShapeGroupElement *parent);
00023   ShapeGroupElement(ShapeGroupElement *parent, unsigned seqNum);
00024   ~ShapeGroupElement();
00025   void setShapeInfo(const ShapeInfo &shapeInfo);
00026   void setup(boost::function<void(ShapeGroupElement &self)> visitor);
00027   void visit(boost::function<
00028              boost::function<void(void)>
00029              (const ShapeInfo &info, const Coordinate &relativeTo, const VectorTransformation2D &foldedTransform, bool isGroup, const VectorTransformation2D &thisTransform)> visitor,
00030              const Coordinate &relativeTo, const VectorTransformation2D &foldedTransform) const;
00031   void visit(boost::function<
00032              boost::function<void(void)>
00033              (const ShapeInfo &info, const Coordinate &relativeTo, const VectorTransformation2D &foldedTransform, bool isGroup, const VectorTransformation2D &thisTransform)> visitor) const;
00034   bool isGroup() const;
00035   ShapeGroupElement *getParent();
00036   const ShapeGroupElement *getParent() const;
00037   void setSeqNum(unsigned seqNum);
00038   void setTransform(const VectorTransformation2D &transform);
00039   unsigned getSeqNum() const;
00040 };
00041 }
00042 
00043 #endif
00044 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */