Anti-Grain Geometry - AGG (libagg)
2.5
|
00001 //---------------------------------------------------------------------------- 00002 // Anti-Grain Geometry (AGG) - Version 2.5 00003 // A high quality rendering engine for C++ 00004 // Copyright (C) 2002-2006 Maxim Shemanarev 00005 // Contact: mcseem@antigrain.com 00006 // mcseemagg@yahoo.com 00007 // http://antigrain.com 00008 // 00009 // AGG is free software; you can redistribute it and/or 00010 // modify it under the terms of the GNU General Public License 00011 // as published by the Free Software Foundation; either version 2 00012 // of the License, or (at your option) any later version. 00013 // 00014 // AGG is distributed in the hope that it will be useful, 00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 // GNU General Public License for more details. 00018 // 00019 // You should have received a copy of the GNU General Public License 00020 // along with AGG; if not, write to the Free Software 00021 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 00022 // MA 02110-1301, USA. 00023 //---------------------------------------------------------------------------- 00024 00025 #ifndef AGG_VPGEN_SEGMENTATOR_INCLUDED 00026 #define AGG_VPGEN_SEGMENTATOR_INCLUDED 00027 00028 #include <math.h> 00029 #include "agg_basics.h" 00030 00031 namespace agg 00032 { 00033 00034 //=======================================================vpgen_segmentator 00035 // 00036 // See Implementation agg_vpgen_segmentator.cpp 00037 // 00038 class vpgen_segmentator 00039 { 00040 public: 00041 vpgen_segmentator() : m_approximation_scale(1.0) {} 00042 00043 void approximation_scale(double s) { m_approximation_scale = s; } 00044 double approximation_scale() const { return m_approximation_scale; } 00045 00046 static bool auto_close() { return false; } 00047 static bool auto_unclose() { return false; } 00048 00049 void reset() { m_cmd = path_cmd_stop; } 00050 void move_to(double x, double y); 00051 void line_to(double x, double y); 00052 unsigned vertex(double* x, double* y); 00053 00054 private: 00055 double m_approximation_scale; 00056 double m_x1; 00057 double m_y1; 00058 double m_dx; 00059 double m_dy; 00060 double m_dl; 00061 double m_ddl; 00062 unsigned m_cmd; 00063 }; 00064 00065 00066 00067 } 00068 00069 #endif 00070