X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fview.h;h=4bcff89c2ca1b31a055ed4c925ed206e2b75dc45;hp=6be1ebf7d3b33227c8008aaebdcaa3bb5f64ea2d;hb=f3452f32fba45b1f317e4a6a1906d16068ce3bdf;hpb=1d179b93f6a1b2a4fe3823c26fba862c24bc5d6e diff --git a/src/view.h b/src/view.h index 6be1ebf..4bcff89 100644 --- a/src/view.h +++ b/src/view.h @@ -5,15 +5,27 @@ #include "document.h" #include "framebuffer.h" #include "objectrenderer.h" +#include "path.h" +#include "transformationtype.h" #define USE_GPU_TRANSFORM true #define USE_GPU_RENDERING true #define USE_SHADING !(USE_GPU_RENDERING) && true -#define TRANSFORM_OBJECTS_NOT_VIEW +#ifdef TRANSFORM_BEZIERS_TO_PATH +#include "gmprat.h" +#include "paranoidnumber.h" +#endif namespace IPDF { + #ifdef TRANSFORM_BEZIERS_TO_PATH + typedef Gmprat VReal; + #else + typedef Real VReal; + #endif + typedef TRect VRect; + class Screen; /** * The View class manages a rectangular view into the document. @@ -23,7 +35,7 @@ namespace IPDF class View { public: - View(Document & document, Screen & screen, const Rect & bounds = Rect(0,0,1,1), const Colour & colour = Colour(0.f,0.f,0.f,1.f)); + View(Document & document, Screen & screen, const VRect & bounds = VRect(0,0,1,1), const Colour & colour = Colour(0.f,0.f,0.f,1.f)); virtual ~View(); void Render(int width = 0, int height = 0); @@ -34,7 +46,7 @@ namespace IPDF Rect TransformToViewCoords(const Rect& inp) const; - const Rect& GetBounds() const { return m_bounds; } + const VRect& GetBounds() const { return m_bounds; } const bool UsingGPUTransform() const { return m_use_gpu_transform; } // whether view transform calculated on CPU or GPU @@ -69,6 +81,8 @@ namespace IPDF void SaveCPUBMP(const char * filename); void SaveGPUBMP(const char * filename); + Document & Doc() {return m_document;} + private: struct GPUObjBounds { @@ -89,7 +103,7 @@ namespace IPDF Document & m_document; Screen & m_screen; FrameBuffer m_cached_display; - Rect m_bounds; + VRect m_bounds; Colour m_colour; // Stores the view bounds.