7 typedef struct stbtt_fontinfo stbtt_fontinfo;
14 Document(const std::string & filename = "") : m_objects(), m_count(0) {Load(filename);}
15 virtual ~Document() {}
17 void LoadSVG(const std::string & filename, const Rect & bounds = Rect(0,0,1,1));
19 void Load(const std::string & filename = "");
20 void Save(const std::string & filename);
21 void DebugDumpObjects();
23 unsigned ObjectCount() const {return m_count;}
24 inline const Objects & GetObjects() const {return m_objects;}
26 bool operator==(const Document & equ) const;
27 bool operator!=(const Document & equ) const {return !(this->operator==(equ));}
29 void Add(ObjectType type, const Rect & bounds, unsigned data_index = 0);
30 unsigned AddBezierData(const Bezier & bezier);
32 void AddPathFromString(const std::string & d, const Rect & bounds);
34 void AddFontGlyphAtPoint(stbtt_fontinfo *font, int character, Real scale, Real x, Real y);
36 #ifndef QUADTREE_DISABLED
37 inline const QuadTree& GetQuadTree() { if (m_quadtree.root_id == QUADTREE_EMPTY) { GenBaseQuadtree(); } return m_quadtree; }
38 QuadTreeIndex GenQuadChild(QuadTreeIndex parent, QuadTreeNodeChildren type);
39 QuadTreeIndex GenQuadParent(QuadTreeIndex child, QuadTreeNodeChildren mytype);
45 #ifndef QUADTREE_DISABLED
47 void GenBaseQuadtree();