139241fe2SDarkWyrm //---------------------------------------------------------------------------- 2*e39da397SStephan Aßmus // Anti-Grain Geometry - Version 2.4 3*e39da397SStephan Aßmus // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) 439241fe2SDarkWyrm // 539241fe2SDarkWyrm // Permission to copy, use, modify, sell and distribute this software 639241fe2SDarkWyrm // is granted provided this copyright notice appears in all copies. 739241fe2SDarkWyrm // This software is provided "as is" without express or implied 839241fe2SDarkWyrm // warranty, and with no claim as to its suitability for any purpose. 939241fe2SDarkWyrm // 1039241fe2SDarkWyrm //---------------------------------------------------------------------------- 1139241fe2SDarkWyrm // Contact: mcseem@antigrain.com 1239241fe2SDarkWyrm // mcseemagg@yahoo.com 1339241fe2SDarkWyrm // http://www.antigrain.com 1439241fe2SDarkWyrm //---------------------------------------------------------------------------- 1539241fe2SDarkWyrm 1639241fe2SDarkWyrm #ifndef AGG_VPGEN_SEGMENTATOR_INCLUDED 1739241fe2SDarkWyrm #define AGG_VPGEN_SEGMENTATOR_INCLUDED 1839241fe2SDarkWyrm 1939241fe2SDarkWyrm #include <math.h> 2039241fe2SDarkWyrm #include "agg_basics.h" 2139241fe2SDarkWyrm 2239241fe2SDarkWyrm namespace agg 2339241fe2SDarkWyrm { 2439241fe2SDarkWyrm 2539241fe2SDarkWyrm //=======================================================vpgen_segmentator 2639241fe2SDarkWyrm // 2739241fe2SDarkWyrm // See Implementation agg_vpgen_segmentator.cpp 2839241fe2SDarkWyrm // 2939241fe2SDarkWyrm class vpgen_segmentator 3039241fe2SDarkWyrm { 3139241fe2SDarkWyrm public: vpgen_segmentator()3239241fe2SDarkWyrm vpgen_segmentator() : m_approximation_scale(1.0) {} 3339241fe2SDarkWyrm approximation_scale(double s)3439241fe2SDarkWyrm void approximation_scale(double s) { m_approximation_scale = s; } approximation_scale()3539241fe2SDarkWyrm double approximation_scale() const { return m_approximation_scale; } 3639241fe2SDarkWyrm auto_close()37abd00302SDarkWyrm static bool auto_close() { return false; } auto_unclose()38abd00302SDarkWyrm static bool auto_unclose() { return false; } 3939241fe2SDarkWyrm reset()40abd00302SDarkWyrm void reset() { m_cmd = path_cmd_stop; } 4139241fe2SDarkWyrm void move_to(double x, double y); 4239241fe2SDarkWyrm void line_to(double x, double y); 4339241fe2SDarkWyrm unsigned vertex(double* x, double* y); 4439241fe2SDarkWyrm 4539241fe2SDarkWyrm private: 4639241fe2SDarkWyrm double m_approximation_scale; 4739241fe2SDarkWyrm double m_x1; 4839241fe2SDarkWyrm double m_y1; 4939241fe2SDarkWyrm double m_dx; 5039241fe2SDarkWyrm double m_dy; 5139241fe2SDarkWyrm double m_dl; 5239241fe2SDarkWyrm double m_ddl; 5339241fe2SDarkWyrm unsigned m_cmd; 5439241fe2SDarkWyrm }; 5539241fe2SDarkWyrm 5639241fe2SDarkWyrm 5739241fe2SDarkWyrm 5839241fe2SDarkWyrm } 5939241fe2SDarkWyrm 6039241fe2SDarkWyrm #endif 6139241fe2SDarkWyrm 62