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