The view size is not 640x480 and hasn't been for a long time
[ipdf/code.git] / src / document.h
1 #ifndef _DOCUMENT_H
2 #define _DOCUMENT_H
3
4 #include "ipdf.h"
5 #include "quadtree.h"
6
7 namespace IPDF
8 {
9         class Document
10         {
11                 public:
12                         Document(const std::string & filename = "") : m_objects(), m_count(0) {Load(filename);}
13                         virtual ~Document() {}
14                         
15                         void LoadSVG(const std::string & filename, const Rect & bounds = {0,0,1,1});
16
17                         void Load(const std::string & filename = "");
18                         void Save(const std::string & filename);
19                         void DebugDumpObjects();
20
21                         unsigned ObjectCount() const {return m_count;}
22                         inline const Objects & GetObjects() const {return m_objects;}
23
24                         bool operator==(const Document & equ) const;
25                         bool operator!=(const Document & equ) const {return !(this->operator==(equ));}
26
27                         void Add(ObjectType type, const Rect & bounds, unsigned data_index = 0);
28                         unsigned AddBezierData(const Bezier & bezier);
29                         
30                         void AddPathFromString(const std::string & d, const Rect & bounds);
31
32 #ifndef QUADTREE_DISABLED
33                         inline const QuadTree& GetQuadTree() { if (m_quadtree.root_id == QUADTREE_EMPTY) { GenBaseQuadtree(); } return m_quadtree; }
34                         QuadTreeIndex GenQuadNode(QuadTreeIndex parent, QuadTreeNodeChildren type);
35 #endif
36
37                 private:
38                         friend class View;
39                         Objects m_objects;
40 #ifndef QUADTREE_DISABLED
41                         QuadTree m_quadtree;
42                         void GenBaseQuadtree();
43 #endif
44                         unsigned m_count;
45                         
46
47         };
48 }
49
50 #endif //_DOCUMENT_H

UCC git Repository :: git.ucc.asn.au