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 AFFINE_TRANSFORMER_H 9 #define AFFINE_TRANSFORMER_H 10 11 12 #include "Transformer.h" 13 14 #include <agg_conv_transform.h> 15 #include <agg_trans_affine.h> 16 17 18 namespace BPrivate { 19 namespace Icon { 20 21 typedef agg::conv_transform<VertexSource, 22 agg::trans_affine> Affine; 23 24 class AffineTransformer : public Transformer, 25 public Affine, 26 public agg::trans_affine { 27 public: 28 enum { 29 archive_code = 'affn', 30 }; 31 32 AffineTransformer( 33 VertexSource& source); 34 #ifdef ICON_O_MATIC 35 AffineTransformer( 36 VertexSource& source, 37 BMessage* archive); 38 #endif 39 virtual ~AffineTransformer(); 40 41 virtual Transformer* Clone(VertexSource& source) const; 42 43 virtual void rewind(unsigned path_id); 44 virtual unsigned vertex(double* x, double* y); 45 46 virtual void SetSource(VertexSource& source); 47 48 virtual double ApproximationScale() const; 49 50 #ifdef ICON_O_MATIC 51 // IconObject interface 52 virtual status_t Archive(BMessage* into, 53 bool deep = true) const; 54 55 virtual PropertyObject* MakePropertyObject() const; 56 virtual bool SetToPropertyObject( 57 const PropertyObject* object); 58 #endif 59 }; 60 61 } // namespace Icon 62 } // namespace BPrivate 63 64 #endif // AFFINE_TRANSFORMER_H 65