Anti-Grain Geometry - AGG (libagg)  2.5
agg-2.5/include/agg_arc.h
Go to the documentation of this file.
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_ARC_INCLUDED
00026 #define AGG_ARC_INCLUDED
00027 
00028 #include <math.h>
00029 #include "agg_basics.h"
00030 
00031 namespace agg
00032 {
00033 
00034     //=====================================================================arc
00035     //
00036     // See Implementation agg_arc.cpp 
00037     //
00038     class arc
00039     {
00040     public:
00041         arc() : m_scale(1.0), m_initialized(false) {}
00042         arc(double x,  double y, 
00043             double rx, double ry, 
00044             double a1, double a2, 
00045             bool ccw=true);
00046 
00047         void init(double x,  double y, 
00048                   double rx, double ry, 
00049                   double a1, double a2, 
00050                   bool ccw=true);
00051 
00052         void approximation_scale(double s);
00053         double approximation_scale() const { return m_scale;  }
00054 
00055         void rewind(unsigned);
00056         unsigned vertex(double* x, double* y);
00057 
00058     private:
00059         void normalize(double a1, double a2, bool ccw);
00060 
00061         double   m_x;
00062         double   m_y;
00063         double   m_rx;
00064         double   m_ry;
00065         double   m_angle;
00066         double   m_start;
00067         double   m_end;
00068         double   m_scale;
00069         double   m_da;
00070         bool     m_ccw;
00071         bool     m_initialized;
00072         unsigned m_path_cmd;
00073     };
00074 
00075 
00076 }
00077 
00078 
00079 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines