1 /* 2 * Copyright 2006-2007, Haiku. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Stephan Aßmus <superstippi@gmx.de> 7 */ 8 #ifndef PERSPECTIVE_TRANSFORMER_H 9 #define PERSPECTIVE_TRANSFORMER_H 10 11 12 #include "Transformer.h" 13 14 #include <agg_conv_transform.h> 15 #include <agg_trans_perspective.h> 16 17 18 namespace BPrivate { 19 namespace Icon { 20 21 typedef agg::conv_transform<VertexSource, 22 agg::trans_perspective> Perspective; 23 24 class PerspectiveTransformer : public Transformer, 25 public Perspective, 26 public agg::trans_perspective { 27 public: 28 enum { 29 archive_code = 'prsp', 30 }; 31 32 PerspectiveTransformer( 33 VertexSource& source); 34 #ifdef ICON_O_MATIC 35 PerspectiveTransformer( 36 VertexSource& source, 37 BMessage* archive); 38 #endif 39 virtual ~PerspectiveTransformer(); 40 41 // Transformer interface 42 virtual Transformer* Clone(VertexSource& source) const; 43 44 virtual void rewind(unsigned path_id); 45 virtual unsigned vertex(double* x, double* y); 46 47 virtual void SetSource(VertexSource& source); 48 49 virtual double ApproximationScale() const; 50 51 #ifdef ICON_O_MATIC 52 // IconObject interface 53 virtual status_t Archive(BMessage* into, 54 bool deep = true) const; 55 56 #endif 57 }; 58 59 } // namespace Icon 60 } // namespace BPrivate 61 62 #endif // PERSPECTIVE_TRANSFORMER_H 63