patchSkencil - Patches: patch #3746, Convert to curve, combine/split...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #3746: Convert to curve, combine/split beziers

Submitter:  Valentin Ungureanu <vung>
Submitted:  Wed 16 Feb 2005 06:22:34 PM UTC
   
 
Category:  0.7.x Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Closed

Sat 02 Apr 2005 11:56:31 PM UTC, comment #1: 

Applied.  Thanks for the patch.  I've modified the code slightly (See the ChangeLog entry).

The patch was already very well made, but if you want to make it even more convenient for me to apply, could you add the list changes that you entered in the comment here in the patch tracker to the ChangeLog file (it's already in the right format for that) and include it in the patch?

Bernhard Herzog <bh>
Group administrator
Wed 16 Feb 2005 06:22:34 PM UTC, original submission:  

This is a patch for three commands related to curves, ported from v. 0.6

Changes:

  • Sketch/Editor/doceditor.py: Added some commands from Skencil 0.6

related to curves: combine_beziers, split_beziers, convert_to_curve.
The behavior of these commands is slightly changed, allowing them to
be applied when the selection contains more than one object or other
object types.

(EditorWithSelection.CanCombineBeziers): New. Return true if the
selection contains a least two objects that are curves or can be
converted to curves.
This is different from version 0.6, where the selection
was required to contain only curves.

(EditorWithSelection.CombineBeziers): New. Combines as many as
possible of the selected objects into a single PolyBezier, first
converting them to curves if necessary. The objects that are not
curves and can not be converted to curves are simply kept in the
selection.
To preserve as much as possible of the status before the operation,
the layer and stacking order of the resulted object will be those of
the first object that will be combined.
This is different from version 0.6, where the combined object was
inserted into the active layer.

(EditorWithSelection.CanSplitBeziers): New. Return true if the
selection contains at least a PolyBezier which has more than
one path.
This is different from version 0.6, which only required that a single
PolyBezier is selected and did not check its number of paths.

(EditorWithSelection.SplitBeziers): New. Split the curves in the
selection into paths. The objects that are not curves with more than
one path are simply kept in the selection.

(EditorWithSelection.CanConvertToCurve): New. Return true if the
selection contains at least one object that can be converted
to curves and is not already a Polybezier.
This is different from version 0.6, which required that a single
object is selected.

(EditorWithSelection.ConvertToCurve): New. Convert as many as possible
of the selected objects to PolyBeziers by replacing each of them with
a curve containing the paths returned by the object's AsBezier method.
The objects that can not be converted to curves are simply kept in the
selection.

  • Sketch/Editor/__init__.py: Added the commands to standard_menu

and standard_keystrokes.

There are also six new tests (two for each command):

  • test_doceditor.py: New tests for combine_beziers, split_beziers and

convert_to_curve.
(MockNonCurve): New.  A minimal graphics object that is not a curve
and cannot be converted to a curve.
Used in the tests for commands that affect curve objects: combine,
convert to curves, etc.  This object is meant to be ignored by these
commands, but still kept in the selection. It's the simplest
placeholder for objects that are not curves, like groups, images
or plugin objects that are not convertible to curves.

(CurveCommandTest): New. Base class for the methods that affect curve
objects: combine, convert to curves, etc.  Used to make available a
number of graphics objects ready to be inserted in the document.

(CombineBeziersTest): New base class for combine_beziers tests.
(TestCombineBeziersSimple, TestCombineBeziersComplex): New.

(SplitBeziersTest): New base class for split_beziers tests.
(TestSplitBeziersSimple, TestSplitBeziersComplex): New.

(ConvertToCurveTest): New base class for convert_to_curve tests.
(TestConvertToCurveSimple, TestConvertToCurveMultiple): New.

Valentin Ungureanu <vung>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #8419:  convert_combine_split.diff added by vung (24KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-04-02 bh Open/ClosedOpen Closed
2005-04-02 bh StatusNone Done
2005-02-16 vung Attached File- Added convert_combine_split.diff, #4189

Back to the top

Powered by Savane 3.13-02a9.
Corresponding source code