From: <ai...@us...> - 2011-03-02 18:16:49
|
Revision: 11584 http://plplot.svn.sourceforge.net/plplot/?rev=11584&view=rev Author: airwin Date: 2011-03-02 18:16:43 +0000 (Wed, 02 Mar 2011) Log Message: ----------- Implement the -eofill option. If this option is used, then for the case where the boundary of the filled region is self-intersecting (e.g., example 27), use the even-odd fill rule rather than the default nonzero fill rule. Note, PLplot current relies on drivers (or the library dependencies of drivers) to implement fills so it is up to the drivers to honor this option. ToDo. Get xwin, svg, cairo, and qt device drivers to honor this option. Modified Paths: -------------- trunk/include/plstrm.h trunk/src/plargs.c Modified: trunk/include/plstrm.h =================================================================== --- trunk/include/plstrm.h 2011-02-28 09:30:50 UTC (rev 11583) +++ trunk/include/plstrm.h 2011-03-02 18:16:43 UTC (rev 11584) @@ -198,6 +198,10 @@ // dev_npts PLINT Number of points we are plotting // dev_x short* Pointer to array of x values // dev_y short* Pointer to array of x values +// For the case where the boundary of the filled region is +// self-intersecting, use the even-odd fill rule rather than the +// default nonzero fill rule. +// dev_eofill PLINT // // For images // dev_nptsX PLINT Number of points we are plotting in X @@ -784,6 +788,7 @@ PLINT has_string_length; PLFLT string_length; PLINT get_string_length; + PLINT dev_eofill; } PLStream; //-------------------------------------------------------------------------- Modified: trunk/src/plargs.c =================================================================== --- trunk/src/plargs.c 2011-02-28 09:30:50 UTC (rev 11583) +++ trunk/src/plargs.c 2011-03-02 18:16:43 UTC (rev 11584) @@ -160,6 +160,7 @@ static int opt_cmap0( const char *, const char *, void * ); static int opt_cmap1( const char *, const char *, void * ); static int opt_locale( const char *, const char *, void * ); +static int opt_eofill( const char *, const char *, void * ); // Global variables @@ -637,6 +638,15 @@ "Use locale environment (e.g., LC_ALL, LC_NUMERIC, or LANG) to set LC_NUMERIC locale (which affects decimal point separator)." }, { + "eofill", + opt_eofill, + NULL, + NULL, + PL_OPT_FUNC, + "-eofill", + "For the case where the boundary of the filled region is self-intersecting, use the even-odd fill rule rather than the default nonzero fill rule." + }, + { "drvopt", // Driver specific options opt_drvopt, NULL, @@ -2458,3 +2468,17 @@ return 0; } +//-------------------------------------------------------------------------- +// opt_eofill() +// +// For the case where the boundary of the filled region is +// self-intersecting, use the even-odd fill rule rather than the +// default nonzero fill rule. +//-------------------------------------------------------------------------- + +static int +opt_eofill( const char *opt, const char *optarg, void *client_data ) +{ + plsc->dev_eofill = 1; + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |