diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-09-10 23:42:59 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-09-10 23:42:59 +0000 |
| commit | 34dd43b53b90b8293b86da4a828d69f966aa51a4 (patch) | |
| tree | fb6a3810bcce412e6a1be5ed3e30a1c4a7501ed7 /src/libnr | |
| parent | 2geomify, remove warnings and other fixes (diff) | |
| download | inkscape-34dd43b53b90b8293b86da4a828d69f966aa51a4.tar.gz inkscape-34dd43b53b90b8293b86da4a828d69f966aa51a4.zip | |
LIBNR REMOVAL. remove nartbpath code!!!
remove nartbpath test code etc.
remove inkscape's path parsing, since it is now done by 2geom.
(bzr r6789)
Diffstat (limited to 'src/libnr')
| -rw-r--r-- | src/libnr/Makefile_insert | 3 | ||||
| -rw-r--r-- | src/libnr/n-art-bpath-2geom.cpp | 103 | ||||
| -rw-r--r-- | src/libnr/n-art-bpath-2geom.h | 31 | ||||
| -rw-r--r-- | src/libnr/n-art-bpath.h | 64 | ||||
| -rw-r--r-- | src/libnr/nr-forward.h | 3 |
5 files changed, 0 insertions, 204 deletions
diff --git a/src/libnr/Makefile_insert b/src/libnr/Makefile_insert index c7f5fd28c..ef813a8be 100644 --- a/src/libnr/Makefile_insert +++ b/src/libnr/Makefile_insert @@ -16,9 +16,6 @@ endif libnr_libnr_a_SOURCES = \ libnr/in-svg-plane.h \ - libnr/n-art-bpath.h \ - libnr/n-art-bpath-2geom.cpp \ - libnr/n-art-bpath-2geom.h \ libnr/nr-blit.cpp \ libnr/nr-blit.h \ libnr/nr-compose-transform.cpp \ diff --git a/src/libnr/n-art-bpath-2geom.cpp b/src/libnr/n-art-bpath-2geom.cpp deleted file mode 100644 index 2bd76e623..000000000 --- a/src/libnr/n-art-bpath-2geom.cpp +++ /dev/null @@ -1,103 +0,0 @@ -#define SEEN_LIBNR_N_ART_BPATH_2GEOM_CPP - -/** \file - * Contains functions to convert from NArtBpath to 2geom's Path - * - * Copyright (C) Johan Engelen 2007-2008 <j.b.c.engelen@utwente.nl> - * - * Released under GNU GPL, read the file 'COPYING' for more information - */ - -#include "libnr/n-art-bpath-2geom.h" - -#include "svg/svg.h" -#include <glib.h> -#include <2geom/path.h> -#include <2geom/svg-path.h> -#include <2geom/svg-path-parser.h> -#include <typeinfo> - -std::vector<Geom::Path> -BPath_to_2GeomPath(NArtBpath const * bpath) -{ - std::vector<Geom::Path> pathv; - if (!bpath) { - return pathv; - } - - NArtBpath const *bp = bpath; // points to element within bpath - Geom::Path * current = NULL; // points to current path - while (bp->code != NR_END) { - if ( current && - ( (bp->code == NR_MOVETO) || (bp->code == NR_MOVETO_OPEN) ) - ) - { // about to start a new path, correct the current path: nartbpath manually adds the closing line segment so erase it for closed path. - if (current->closed() && !current->empty()) { - // but only remove this last segment if it is a *linesegment*: - if ( dynamic_cast<Geom::LineSegment const *>(¤t->back()) ) { - current->erase_last(); - } - } - } - - switch(bp->code) { - case NR_MOVETO: - pathv.push_back( Geom::Path() ); // for some reason Geom::Path(Point) does not work... - current = &pathv.back(); - current->start( Geom::Point(bp->x3, bp->y3) ); - current->close(true); - break; - - case NR_MOVETO_OPEN: - pathv.push_back( Geom::Path() ); // for some reason Geom::Path(Point) does not work... - current = &pathv.back(); - current->start( Geom::Point(bp->x3, bp->y3) ); - current->close(false); - break; - - case NR_LINETO: - current->appendNew<Geom::LineSegment>( Geom::Point(bp->x3, bp->y3) ); - break; - - case NR_CURVETO: - current->appendNew<Geom::CubicBezier> ( Geom::Point(bp->x1, bp->y1), Geom::Point(bp->x2, bp->y2), Geom::Point(bp->x3, bp->y3) ); - break; - - case NR_END: - g_error("BPath_to_2GeomPath: logical error"); - break; - } - ++bp; - } - if ( current && current->closed() && !current->empty() ) { - // correct the current path: nartbpath manually adds the closing line segment so erase it for closed path. - // but only remove this last segment if it is a *linesegment*: - if ( dynamic_cast<Geom::LineSegment const *>(¤t->back()) ) { - current->erase_last(); - } - } - - return pathv; -} - -NArtBpath * -BPath_from_2GeomPath(std::vector<Geom::Path> const & path) -{ - char * svgd = sp_svg_write_path(path); - NArtBpath *bpath = sp_svg_read_path(svgd); - g_free(svgd); - return bpath; -} - - - -/* - 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 : diff --git a/src/libnr/n-art-bpath-2geom.h b/src/libnr/n-art-bpath-2geom.h deleted file mode 100644 index bf1592e28..000000000 --- a/src/libnr/n-art-bpath-2geom.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef SEEN_LIBNR_N_ART_BPATH_2GEOM_H -#define SEEN_LIBNR_N_ART_BPATH_2GEOM_H - -/** \file - * Contains functions to convert from NArtBpath to 2geom's Path - * - * Copyright (C) Johan Engelen 2007 <j.b.c.engelen@utwente.nl> - * - * Released under GNU GPL, read the file 'COPYING' for more information - */ - -#include <vector> -#include <2geom/path.h> -#include <libnr/n-art-bpath.h> - -std::vector<Geom::Path> BPath_to_2GeomPath (NArtBpath const *bpath); -NArtBpath * BPath_from_2GeomPath (std::vector<Geom::Path> const & path); - - -#endif /* !SEEN_LIBNR_N_ART_BPATH_2GEOM_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 : diff --git a/src/libnr/n-art-bpath.h b/src/libnr/n-art-bpath.h deleted file mode 100644 index fdb9855be..000000000 --- a/src/libnr/n-art-bpath.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef SEEN_LIBNR_N_ART_BPATH_H -#define SEEN_LIBNR_N_ART_BPATH_H - -/** \file - * NArtBpath: old-style path segment. - */ - -#include <stdlib.h> - -#include "libnr/nr-point.h" -#include "libnr/nr-path-code.h" -#include <cstdlib> - -/** - * Old-style path segment. - * - * Arrays of paths segment start with a MOVETO or MOVETO_OPEN segment - * where the former indicates the beginning of a closed subpath. - * \see subpath_from_bpath() - */ -class NArtBpath { -public: - NRPathcode code; ///< Type of segment - double x1, y1; ///< Position of control point in case of NR_CURVETO - double x2, y2; ///< Position of control point in case of NR_CURVETO - double x3, y3; ///< Position of next point - - /// Convert i-th position data pair to Point object - /// \pre 1 <= i <= 3 - NR::Point c(unsigned const i) const { - switch (i) { - case 1: return NR::Point(x1, y1); - case 2: return NR::Point(x2, y2); - case 3: return NR::Point(x3, y3); - default: std::abort(); - } - } - - /// Set i-th position data pair from Point - /// \pre 1 <= i <= 3 - void setC(unsigned const i, NR::Point const &p) { - using NR::X; using NR::Y; - switch (i) { - case 1: x1 = p[X]; y1 = p[Y]; break; - case 2: x2 = p[X]; y2 = p[Y]; break; - case 3: x3 = p[X]; y3 = p[Y]; break; - default: std::abort(); - } - } -}; - - -#endif /* !SEEN_LIBNR_N_ART_BPATH_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 : diff --git a/src/libnr/nr-forward.h b/src/libnr/nr-forward.h index 112313b24..da4fe99df 100644 --- a/src/libnr/nr-forward.h +++ b/src/libnr/nr-forward.h @@ -19,9 +19,6 @@ class scale; class translate; } -class NArtBpath; -struct NRBPath; -struct const_NRBPath; struct NRPixBlock; struct NRRect; struct NRRectL; |
