~ubuntu-branches/ubuntu/gutsy/plotutils/gutsy

« back to all changes in this revision

Viewing changes to libplot/g_bez.c

  • Committer: Bazaar Package Importer
  • Author(s): Floris Bruynooghe
  • Date: 2007-05-10 19:48:54 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070510194854-mrr3lgwzpxd8hovo
Tags: 2.5-2
Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of the GNU plotutils package.  Copyright (C) 1995,
 
2
   1996, 1997, 1998, 1999, 2000, 2005, Free Software Foundation, Inc.
 
3
 
 
4
   The GNU plotutils package is free software.  You may redistribute it
 
5
   and/or modify it under the terms of the GNU General Public License as
 
6
   published by the Free Software foundation; either version 2, or (at your
 
7
   option) any later version.
 
8
 
 
9
   The GNU plotutils package is distributed in the hope that it will be
 
10
   useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
   General Public License for more details.
 
13
 
 
14
   You should have received a copy of the GNU General Public License along
 
15
   with the GNU plotutils package; see the file COPYING.  If not, write to
 
16
   the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor,
 
17
   Boston, MA 02110-1301, USA. */
 
18
 
1
19
/* This file contains the bezier2 and bezier3 methods, which are GNU
2
20
   extensions to libplot.  Each of them draws an object: a quadratic and a
3
21
   cubic Bezier path segment, respectively. */
6
24
#include "extern.h"
7
25
 
8
26
int
9
 
#ifdef _HAVE_PROTOS
10
27
_API_fbezier2 (R___(Plotter *_plotter) double x0, double y0, double x1, double y1, double x2, double y2)
11
 
#else
12
 
_API_fbezier2 (R___(_plotter) x0, y0, x1, y1, x2, y2)
13
 
     S___(Plotter *_plotter;) 
14
 
     double x0, y0, x1, y1, x2, y2;
15
 
#endif
16
28
{
17
29
  int prev_num_segments;
18
30
  plPoint p0, p1, p2;
78
90
      if (_plotter->data->have_mixed_paths == false
79
91
          && _plotter->drawstate->path->num_segments == 2)
80
92
        {
81
 
          _maybe_replace_arc (S___(_plotter));
 
93
          _pl_g_maybe_replace_arc (S___(_plotter));
82
94
          if (_plotter->drawstate->path->num_segments > 2)
83
95
            prev_num_segments = 0;      
84
96
        }
130
142
}
131
143
 
132
144
int
133
 
#ifdef _HAVE_PROTOS
134
145
_API_fbezier3 (R___(Plotter *_plotter) double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3)
135
 
#else
136
 
_API_fbezier3 (R___(_plotter) x0, y0, x1, y1, x2, y2, x3, y3)
137
 
     S___(Plotter *_plotter;)
138
 
     double x0, y0, x1, y1, x2, y2, x3, y3;
139
 
#endif
140
146
{
141
147
  int prev_num_segments;
142
148
  plPoint p0, p1, p2, p3;
203
209
      if (_plotter->data->have_mixed_paths == false
204
210
          && _plotter->drawstate->path->num_segments == 2)
205
211
        {
206
 
          _maybe_replace_arc (S___(_plotter));
 
212
          _pl_g_maybe_replace_arc (S___(_plotter));
207
213
          if (_plotter->drawstate->path->num_segments > 2)
208
214
            prev_num_segments = 0;      
209
215
        }