summaryrefslogtreecommitdiff
path: root/libs/canvas/canvas/curve.h
blob: 733808dc14cf7a5836174d8ca82085ea6f503d56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef __CANVAS_CURVE_H__
#define __CANVAS_CURVE_H__

#include "canvas/poly_item.h"

namespace ArdourCanvas {

class Curve : public PolyItem
{
public:
    Curve (Group *);
    
    void compute_bounding_box () const;

    void render (Rect const & area, Cairo::RefPtr<Cairo::Context>) const;
    XMLNode* get_state () const;
    void set_state (XMLNode const *);

    void set (Points const &);

  protected:
    void render_path (Rect const &, Cairo::RefPtr<Cairo::Context>) const;
    void render_curve (Rect const &, Cairo::RefPtr<Cairo::Context>) const;
    
  private:
    Points first_control_points;
    Points second_control_points;

    
    static void compute_control_points (Points const &,
					Points&, Points&);
    static double* solve (std::vector<double> const&);
};
	
}

#endif