curve.h revision ff141f9bb174c02bf87ff9786cb7f0e15f1a341b
#ifndef SEEN_DISPLAY_CURVE_H
#define SEEN_DISPLAY_CURVE_H
/** \file
* Wrapper around an array of NArtBpath objects.
*
* Author:
* Lauris Kaplinski <lauris@kaplinski.com>
*
* Copyright (C) 2000 Lauris Kaplinski
* Copyright (C) 2000-2001 Ximian, Inc.
* Copyright (C) 2002 Lauris Kaplinski
*
* Released under GNU GPL
*/
#include "libnr/nr-forward.h"
#include "libnr/nr-point.h"
/// Wrapper around NArtBpath.
struct SPCurve {
/// Index in bpath[] of NR_END element.
/// Allocated size (i.e., capacity) of bpath[] array. Not to be confused
/// with the SP_CURVE_LENGTH macro, which returns the logical length of
/// the path (i.e., index of NR_END).
/// Index in bpath[] of the start (i.e., moveto element) of the last
/// subpath in this path.
/// Previous moveto position.
/// \note This is used for coalescing moveto's, whereas if we're to
/// conform to the SVG spec then we mustn't coalesce movetos if we have
/// midpoint markers. Ref:
/// http://www.w3.org/TR/SVG11/implnote.html#PathElementImplementationNotes
/// (first subitem of the item about zero-length path segments)
/// True iff current point is defined. Initially false for a new curve;
/// becomes true after moveto; becomes false on closepath. Curveto,
bool hascpt : 1;
/// True iff previous was moveto.
bool posSet : 1;
/// True iff bpath end is moving.
bool moving : 1;
/// True iff all subpaths are closed.
bool closed : 1;
};
/* Constructors */
SPCurve *sp_curve_new();
/* Methods */
void sp_curve_curveto(SPCurve *curve, NR::Point const &p0, NR::Point const &p1, NR::Point const &p2);
void sp_curve_curveto(SPCurve *curve, gdouble x0, gdouble y0, gdouble x1, gdouble y1, gdouble x2, gdouble y2);
#define sp_curve_is_empty sp_curve_empty
#endif /* !SEEN_DISPLAY_CURVE_H */
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :