Anti-Grain Geometry - AGG (libagg)  2.5
agg-2.5/include/agg_vcgen_contour.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_CONTOUR_INCLUDED
00026 #define AGG_VCGEN_CONTOUR_INCLUDED
00027 
00028 #include "agg_math_stroke.h"
00029 
00030 namespace agg
00031 {
00032 
00033     //----------------------------------------------------------vcgen_contour
00034     //
00035     // See Implementation agg_vcgen_contour.cpp
00036     //
00037     class vcgen_contour
00038     {
00039         enum status_e
00040         {
00041             initial,
00042             ready,
00043             outline,
00044             out_vertices,
00045             end_poly,
00046             stop
00047         };
00048 
00049     public:
00050         typedef vertex_sequence<vertex_dist, 6> vertex_storage;
00051         typedef pod_bvector<point_d, 6>         coord_storage;
00052 
00053         vcgen_contour();
00054 
00055         void line_cap(line_cap_e lc)     { m_stroker.line_cap(lc); }
00056         void line_join(line_join_e lj)   { m_stroker.line_join(lj); }
00057         void inner_join(inner_join_e ij) { m_stroker.inner_join(ij); }
00058 
00059         line_cap_e   line_cap()   const { return m_stroker.line_cap(); }
00060         line_join_e  line_join()  const { return m_stroker.line_join(); }
00061         inner_join_e inner_join() const { return m_stroker.inner_join(); }
00062 
00063         void width(double w) { m_stroker.width(m_width = w); }
00064         void miter_limit(double ml) { m_stroker.miter_limit(ml); }
00065         void miter_limit_theta(double t) { m_stroker.miter_limit_theta(t); }
00066         void inner_miter_limit(double ml) { m_stroker.inner_miter_limit(ml); }
00067         void approximation_scale(double as) { m_stroker.approximation_scale(as); }
00068 
00069         double width() const { return m_width; }
00070         double miter_limit() const { return m_stroker.miter_limit(); }
00071         double inner_miter_limit() const { return m_stroker.inner_miter_limit(); }
00072         double approximation_scale() const { return m_stroker.approximation_scale(); }
00073 
00074         void auto_detect_orientation(bool v) { m_auto_detect = v; }
00075         bool auto_detect_orientation() const { return m_auto_detect; }
00076 
00077         // Generator interface
00078         void remove_all();
00079         void add_vertex(double x, double y, unsigned cmd);
00080 
00081         // Vertex Source Interface
00082         void     rewind(unsigned path_id);
00083         unsigned vertex(double* x, double* y);
00084 
00085     private:
00086         vcgen_contour(const vcgen_contour&);
00087         const vcgen_contour& operator = (const vcgen_contour&);
00088 
00089         math_stroke<coord_storage> m_stroker;
00090         double                     m_width;
00091         vertex_storage             m_src_vertices;
00092         coord_storage              m_out_vertices;
00093         status_e                   m_status;
00094         unsigned                   m_src_vertex;
00095         unsigned                   m_out_vertex;
00096         unsigned                   m_closed;
00097         unsigned                   m_orientation;
00098         bool                       m_auto_detect;
00099     };
00100 
00101 }
00102 
00103 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines