Anti-Grain Geometry - AGG (libagg)  2.5
agg-2.5/include/agg_vcgen_bspline.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_VCGEN_BSPLINE_INCLUDED
00026 #define AGG_VCGEN_BSPLINE_INCLUDED
00027 
00028 #include "agg_basics.h"
00029 #include "agg_array.h"
00030 #include "agg_bspline.h"
00031 
00032 
00033 namespace agg
00034 {
00035 
00036     //==========================================================vcgen_bspline
00037     class vcgen_bspline
00038     {
00039         enum status_e
00040         {
00041             initial,
00042             ready,
00043             polygon,
00044             end_poly,
00045             stop
00046         };
00047 
00048     public:
00049         typedef pod_bvector<point_d, 6> vertex_storage;
00050 
00051         vcgen_bspline();
00052 
00053         void interpolation_step(double v) { m_interpolation_step = v; }
00054         double interpolation_step() const { return m_interpolation_step; }
00055 
00056         // Vertex Generator Interface
00057         void remove_all();
00058         void add_vertex(double x, double y, unsigned cmd);
00059 
00060         // Vertex Source Interface
00061         void     rewind(unsigned path_id);
00062         unsigned vertex(double* x, double* y);
00063 
00064     private:
00065         vcgen_bspline(const vcgen_bspline&);
00066         const vcgen_bspline& operator = (const vcgen_bspline&);
00067 
00068         vertex_storage m_src_vertices;
00069         bspline        m_spline_x;
00070         bspline        m_spline_y;
00071         double         m_interpolation_step;
00072         unsigned       m_closed;
00073         status_e       m_status;
00074         unsigned       m_src_vertex;
00075         double         m_cur_abscissa;
00076         double         m_max_abscissa;
00077     };
00078 
00079 }
00080 
00081 
00082 #endif
00083 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines