xref: /haiku/headers/libs/agg/agg_vcgen_bspline.h (revision e39da397f5ff79f2db9f9a3ddf1852b6710578af)
139241fe2SDarkWyrm //----------------------------------------------------------------------------
2*e39da397SStephan Aßmus // Anti-Grain Geometry - Version 2.4
3*e39da397SStephan Aßmus // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
439241fe2SDarkWyrm //
539241fe2SDarkWyrm // Permission to copy, use, modify, sell and distribute this software
639241fe2SDarkWyrm // is granted provided this copyright notice appears in all copies.
739241fe2SDarkWyrm // This software is provided "as is" without express or implied
839241fe2SDarkWyrm // warranty, and with no claim as to its suitability for any purpose.
939241fe2SDarkWyrm //
1039241fe2SDarkWyrm //----------------------------------------------------------------------------
1139241fe2SDarkWyrm // Contact: mcseem@antigrain.com
1239241fe2SDarkWyrm //          mcseemagg@yahoo.com
1339241fe2SDarkWyrm //          http://www.antigrain.com
1439241fe2SDarkWyrm //----------------------------------------------------------------------------
1539241fe2SDarkWyrm 
1639241fe2SDarkWyrm #ifndef AGG_VCGEN_BSPLINE_INCLUDED
1739241fe2SDarkWyrm #define AGG_VCGEN_BSPLINE_INCLUDED
1839241fe2SDarkWyrm 
1939241fe2SDarkWyrm #include "agg_basics.h"
2039241fe2SDarkWyrm #include "agg_array.h"
2139241fe2SDarkWyrm #include "agg_bspline.h"
2239241fe2SDarkWyrm 
2339241fe2SDarkWyrm 
2439241fe2SDarkWyrm namespace agg
2539241fe2SDarkWyrm {
2639241fe2SDarkWyrm 
2739241fe2SDarkWyrm     //==========================================================vcgen_bspline
2839241fe2SDarkWyrm     class vcgen_bspline
2939241fe2SDarkWyrm     {
3039241fe2SDarkWyrm         enum status_e
3139241fe2SDarkWyrm         {
3239241fe2SDarkWyrm             initial,
3339241fe2SDarkWyrm             ready,
3439241fe2SDarkWyrm             polygon,
3539241fe2SDarkWyrm             end_poly,
3639241fe2SDarkWyrm             stop
3739241fe2SDarkWyrm         };
3839241fe2SDarkWyrm 
3939241fe2SDarkWyrm     public:
40*e39da397SStephan Aßmus         typedef pod_bvector<point_d, 6> vertex_storage;
4139241fe2SDarkWyrm 
4239241fe2SDarkWyrm         vcgen_bspline();
4339241fe2SDarkWyrm 
interpolation_step(double v)4439241fe2SDarkWyrm         void interpolation_step(double v) { m_interpolation_step = v; }
interpolation_step()4539241fe2SDarkWyrm         double interpolation_step() const { return m_interpolation_step; }
4639241fe2SDarkWyrm 
4739241fe2SDarkWyrm         // Vertex Generator Interface
4839241fe2SDarkWyrm         void remove_all();
4939241fe2SDarkWyrm         void add_vertex(double x, double y, unsigned cmd);
5039241fe2SDarkWyrm 
5139241fe2SDarkWyrm         // Vertex Source Interface
52*e39da397SStephan Aßmus         void     rewind(unsigned path_id);
5339241fe2SDarkWyrm         unsigned vertex(double* x, double* y);
5439241fe2SDarkWyrm 
5539241fe2SDarkWyrm     private:
5639241fe2SDarkWyrm         vcgen_bspline(const vcgen_bspline&);
5739241fe2SDarkWyrm         const vcgen_bspline& operator = (const vcgen_bspline&);
5839241fe2SDarkWyrm 
5939241fe2SDarkWyrm         vertex_storage m_src_vertices;
6039241fe2SDarkWyrm         bspline        m_spline_x;
6139241fe2SDarkWyrm         bspline        m_spline_y;
6239241fe2SDarkWyrm         double         m_interpolation_step;
6339241fe2SDarkWyrm         unsigned       m_closed;
6439241fe2SDarkWyrm         status_e       m_status;
6539241fe2SDarkWyrm         unsigned       m_src_vertex;
6639241fe2SDarkWyrm         double         m_cur_abscissa;
6739241fe2SDarkWyrm         double         m_max_abscissa;
6839241fe2SDarkWyrm     };
6939241fe2SDarkWyrm 
7039241fe2SDarkWyrm }
7139241fe2SDarkWyrm 
7239241fe2SDarkWyrm 
7339241fe2SDarkWyrm #endif
7439241fe2SDarkWyrm 
75