curve.h revision 01e77bd6da7435e8d3719497b38790c73544bbaf
#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
* Copyright (C) 2008 Johan Engelen
*
* Released under GNU GPL
*/
#include "libnr/nr-forward.h"
#define SP_CURVE_LENSTEP 32
struct SPObject;
/// Wrapper around Geom::PathVector.
/* Constructors */
guint get_length() const;
void reset();
void closepath();
void closepath_current();
bool is_empty() const;
bool is_closed() const;
NArtBpath const * last_bpath() const;
NArtBpath const * first_bpath() const;
guint nodes_in_path() const;
SPCurve * create_reverse() const;
void backspace();
/// 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;
// Don't implement these:
//friends:
friend double sp_curve_nonzero_distance_including_space(SPCurve const *const curve, double seg2len[]);
// this function is the only one who needs read access to _movePos and _posSet
static void debug_check( char const * text, bool a);
};
#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:encoding=utf-8:textwidth=99 :