[Lib2geom-devel] New HLineSegment/VLineSegment classes and path.h splitting
I splitted path.h in the following files:
curve.h (abstract class Curve) sbasis-curve.h bezier-curve.h elliptical-arc.h path.h (class Path and iterators )
and path.cpp in
curve-helpers.cpp (CurveHelpers::root_winding) path.cpp (all the previous methods)
finally I added a curves.h file so defined:
#include curve.h #include sbasis-curve.h #include bezier-curve.h #include elliptical-arc.h #include hvlinesegment.h
path.h includes curves.h so existent code should have no problem.
The HLineSegment and VLineSegment classes will be useful to represent directly "H" and "V" curves found in the svg path element.
I committed all changes both to 2geom and Inkscape. Btw I needed to do a make clean before succeeding in building inkscape correctly, because at beginning CurveHelpers::root_winding was seen as defined more than once.
Regards, Marco
-----Original Message----- From: Marco [mailto:mrcekets@...400...] Sent: dinsdag 27 mei 2008 0:54 To: inkscape-devel@lists.sourceforge.net; lib2geom-devel@lists.sourceforge.net Cc: njh; Engelen, J.B.C. (Johan) Subject: [Inkscape-devel][Lib2geom-devel] New HLineSegment/VLineSegment classes and path.h splitting
The HLineSegment and VLineSegment classes will be useful to represent directly "H" and "V" curves found in the svg path element.
I committed all changes both to 2geom and Inkscape.
Cool thanks!
Marco: Can you add the new V/HLineSegments to 2geom's svgparser? Jasper: Can you add special commands for these segments to svg/pathstring.h ? I will then have the new 2geom-type path writer call these functions.
Cheers, Johan
On Tue, 27 May 2008 09:55:32 +0200, <J.B.C.Engelen@...1578...> wrote:
-----Original Message----- From: Marco [mailto:mrcekets@...400...] Sent: dinsdag 27 mei 2008 0:54 To: inkscape-devel@lists.sourceforge.net; lib2geom-devel@lists.sourceforge.net Cc: njh; Engelen, J.B.C. (Johan) Subject: [Inkscape-devel][Lib2geom-devel] New HLineSegment/VLineSegment classes and path.h splitting
The HLineSegment and VLineSegment classes will be useful to represent directly "H" and "V" curves found in the svg path element.
I committed all changes both to 2geom and Inkscape.
Cool thanks!
Marco: Can you add the new V/HLineSegments to 2geom's svgparser? Jasper: Can you add special commands for these segments to svg/pathstring.h ? I will then have the new 2geom-type path writer call these functions.
Cheers, Johan
I added methods to PathSink to manage horizontal and vertical lines, and I modified the parser toy and svg-path-parser.rl accordingly anyway it seems that the parser is unable to parse correctly single coordinate, so H, V and A path elements are not parsed correctly. I spent the afternoon in trying to fix it but I didn't understand part of raleg state machine generator syntax. In particular how "coordinate_pair" are parsed and how priority feature is supposed to work. As of this fact I committed the changes to 2geom only at present.
You can test the above issue using the parser toy with simple string input as:
parser "M 10 10 H 20" output: M X: 10 Y: 10 H 2 H 0
parser "M 10 10 V 125" output: M X: 10 Y: 10 V 1 V 2 V 5
parser "M 10 10 H 20 10" output: M X: 10 Y: 10 H 2 H 0 H 10
parser "M 302 152 A 150, 120, 0, 1, 0, 2 152" output: M X: 302 Y: 152 A 0 0 1 0 0 X: 2 Y: 152 // should be A 150 120 0 1 0 X: 2 Y: 152
parser "M 300 150 A 150, 120, 30, 1, 0, 200 100" output: M X: 300 Y: 150 A 0 120 30 1 0 X: 200 Y: 100 // should be A 150 120 30 1 0 X: 200 Y: 100
if someone that knows ragel could fix all that it will be great.
Regards, Marco
Marco wrote:
if someone that knows ragel could fix all that it will be great.
That someone isn't really me, is it? Below are the results after r1283.
Aaron Spike
aaron@...1252...:/usr/local/src/2geom/build$ svn commit ../lib2geom/src/svg-path-parser.rl Sending lib2geom/src/svg-path-parser.rl Transmitting file data . Committed revision 1283. aaron@...1252...:/usr/local/src/2geom/build$ src/toys/parser "M 10 10 H 20" M X: 10 Y: 10 H 20 Try real pathsink: std::vector length: 1 success! aaron@...1252...:/usr/local/src/2geom/build$ src/toys/parser "M 10 10 V 125" M X: 10 Y: 10 V 125 Try real pathsink: std::vector length: 1 success! aaron@...1252...:/usr/local/src/2geom/build$ src/toys/parser "M 10 10 H 20 10" M X: 10 Y: 10 H 20 H 10 Try real pathsink: std::vector length: 1 success! aaron@...1252...:/usr/local/src/2geom/build$ src/toys/parser "M 302 152 A 150, 120, 0, 1, 0, 2 152" M X: 302 Y: 152 A 150 120 0 1 0 X: 2 Y: 152 Try real pathsink: std::vector length: 1 success! aaron@...1252...:/usr/local/src/2geom/build$ src/toys/parser "M 300 150 A 150, 120, 30, 1, 0, 200 100" M X: 300 Y: 150 A 150 120 30 1 0 X: 200 Y: 100 Try real pathsink: std::vector length: 1 success!
Wow Aaron and Marco,
That was quick, thanks a bunch! (I didn't know 2geom's parser didn't take A, probably this is going to fix a crash bug for Inkscape :-)
Cheers! Johan
-----Original Message----- From: lib2geom-devel-bounces@lists.sourceforge.net [mailto:lib2geom-devel-bounces@lists.sourceforge.net] On Behalf Of Aaron Spike Sent: woensdag 28 mei 2008 1:00 To: Marco Cc: inkscape-devel@lists.sourceforge.net; Engelen, J.B.C. (Johan); lib2geom-devel@lists.sourceforge.net Subject: Re: [Lib2geom-devel] [Inkscape-devel] New HLineSegment/VLineSegment classes and path.h splitting
Marco wrote:
if someone that knows ragel could fix all that it will be great.
That someone isn't really me, is it? Below are the results after r1283.
Aaron Spike
aaron@...1252...:/usr/local/src/2geom/build$ svn commit ../lib2geom/src/svg-path-parser.rl Sending lib2geom/src/svg-path-parser.rl Transmitting file data . Committed revision 1283. aaron@...1252...:/usr/local/src/2geom/build$ src/toys/parser "M 10 10 H 20" M X: 10 Y: 10 H 20 Try real pathsink: std::vector length: 1 success! aaron@...1252...:/usr/local/src/2geom/build$ src/toys/parser "M 10 10 V 125" M X: 10 Y: 10 V 125 Try real pathsink: std::vector length: 1 success! aaron@...1252...:/usr/local/src/2geom/build$ src/toys/parser "M 10 10 H 20 10" M X: 10 Y: 10 H 20 H 10 Try real pathsink: std::vector length: 1 success! aaron@...1252...:/usr/local/src/2geom/build$ src/toys/parser "M 302 152 A 150, 120, 0, 1, 0, 2 152" M X: 302 Y: 152 A 150 120 0 1 0 X: 2 Y: 152 Try real pathsink: std::vector length: 1 success! aaron@...1252...:/usr/local/src/2geom/build$ src/toys/parser "M 300 150 A 150, 120, 30, 1, 0, 200 100" M X: 300 Y: 150 A 150 120 30 1 0 X: 200 Y: 100 Try real pathsink: std::vector length: 1 success!
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Lib2geom-devel mailing list Lib2geom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lib2geom-devel
participants (3)
-
unknown@example.com
-
Aaron Spike
-
Marco