Anti-Grain Geometry - AGG (libagg)  2.5
agg-2.5/include/agg_rounded_rect.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_ROUNDED_RECT_INCLUDED
00026 #define AGG_ROUNDED_RECT_INCLUDED
00027 
00028 #include "agg_basics.h"
00029 #include "agg_arc.h"
00030 
00031 namespace agg
00032 {
00033     //------------------------------------------------------------rounded_rect
00034     //
00035     // See Implemantation agg_rounded_rect.cpp
00036     //
00037     class rounded_rect
00038     {
00039     public:
00040         rounded_rect() {}
00041         rounded_rect(double x1, double y1, double x2, double y2, double r);
00042 
00043         void rect(double x1, double y1, double x2, double y2);
00044         void radius(double r);
00045         void radius(double rx, double ry);
00046         void radius(double rx_bottom, double ry_bottom, double rx_top, double ry_top);
00047         void radius(double rx1, double ry1, double rx2, double ry2, 
00048                     double rx3, double ry3, double rx4, double ry4);
00049         void normalize_radius();
00050 
00051         void approximation_scale(double s) { m_arc.approximation_scale(s); }
00052         double approximation_scale() const { return m_arc.approximation_scale(); }
00053 
00054         void rewind(unsigned);
00055         unsigned vertex(double* x, double* y);
00056 
00057     private:
00058         double m_x1;
00059         double m_y1;
00060         double m_x2;
00061         double m_y2;
00062         double m_rx1;
00063         double m_ry1;
00064         double m_rx2;
00065         double m_ry2;
00066         double m_rx3;
00067         double m_ry3;
00068         double m_rx4;
00069         double m_ry4;
00070         unsigned m_status;
00071         arc      m_arc;
00072     };
00073 
00074 }
00075 
00076 #endif
00077 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines