From: <and...@us...> - 2011-03-17 20:05:35
|
Revision: 11639 http://plplot.svn.sourceforge.net/plplot/?rev=11639&view=rev Author: andrewross Date: 2011-03-17 20:05:27 +0000 (Thu, 17 Mar 2011) Log Message: ----------- Tidy up plplot API. Remove plParseOpts, plHLS_RGB, plRGB_HLS, plarrows which were all in src/pldeprecated.c and have been marked for deletion for some time. Move plrgb, plrgb1 and plhls which are marked as obsolete and not to be used into src/pldeprecated.c to formally deprecate them. The functions in pldeprecated.c are now wrapped with #ifdef PL_DEPRECATED statements. Add -DPL_DEPRECATED=ON to the cmake command line to enable support for these. Remove the compatibility macros for plcol, plpage, plclr, plcontf, Alloc2dGrid, Free2dGrid, MinMax2dGrid, plP_gvpd, plP_gvpw, plotsh3d. These versions have been hanging around for a long time and are marked as obsolete. Update bindings to remove mentions of the above. For C, C++, f77, f90 the deprecated functions are #ifdef'd out. For swig generated langauges the support was already disabled. For ada it is commented out in the code. Update plplot code and examples to remove all mentions of plcol, plrgb, plrgb1, plhls, plParseOpt. Update documentation accordingly. Modified Paths: -------------- trunk/bindings/ada/plplot.adb trunk/bindings/ada/plplot.ads trunk/bindings/ada/plplot_thin.ads trunk/bindings/ada/plplot_traditional.adb trunk/bindings/ada/plplot_traditional.ads trunk/bindings/c++/plstream.cc trunk/bindings/c++/plstream.h trunk/bindings/f77/plstubs.h trunk/bindings/f77/scstubs.c trunk/bindings/f95/plstubs.h trunk/bindings/f95/scstubs.c trunk/bindings/gnome2/lib/plplotcanvas.c trunk/bindings/swig-support/plplotcapi.i trunk/bindings/tcl/plapi.tpl trunk/bindings/tcl/tclAPI.c trunk/bindings/tk/PLWin.itk trunk/bindings/tk/plr.c trunk/bindings/wxwidgets/wxPLplotstream.cpp trunk/config.h.cmake trunk/doc/docbook/src/api-obsolete.xml trunk/examples/tk/xtk01.c trunk/examples/tk/xtk02.c trunk/include/plplot.h trunk/src/plargs.c trunk/src/plcore.c trunk/src/plctrl.c trunk/src/pldeprecated.c trunk/src/plstripc.c Modified: trunk/bindings/ada/plplot.adb =================================================================== --- trunk/bindings/ada/plplot.adb 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/ada/plplot.adb 2011-03-17 20:05:27 UTC (rev 11639) @@ -1798,13 +1798,13 @@ -- Set current color (map 0) by hue, lightness, and saturation. -- plhls - procedure Set_Color_HLS - (Hue_Component : Long_Float; -- Not documented; presumably 0.0..360.0. - Lightness_Component : Long_Float_0_1_Type; - Saturation_Component : Long_Float_0_1_Type) is - begin - plhls(Hue_Component, Lightness_Component, Saturation_Component); - end Set_Color_HLS; + -- procedure Set_Color_HLS + -- (Hue_Component : Long_Float; -- Not documented; presumably 0.0..360.0. + -- Lightness_Component : Long_Float_0_1_Type; + -- Saturation_Component : Long_Float_0_1_Type) is + -- begin + -- plhls(Hue_Component, Lightness_Component, Saturation_Component); + -- end Set_Color_HLS; -- Functions for converting between HLS and RGB color space @@ -2165,20 +2165,21 @@ end Replot; + -- This deprecated - commented out -- Set line color by red, green, blue from 0.0 to 1.0 -- plrgb - procedure Set_Line_Color_RGB_0_1(Red_Component, Blue_Component, Green_Component : Long_Float_0_1_Type) is - begin - plrgb(Red_Component, Blue_Component, Green_Component); - end Set_Line_Color_RGB_0_1; + -- procedure Set_Line_Color_RGB_0_1(Red_Component, Blue_Component, Green_Component : Long_Float_0_1_Type) is + -- begin + -- plrgb(Red_Component, Blue_Component, Green_Component); + -- end Set_Line_Color_RGB_0_1; -- Set line color by 8 bit RGB values. -- plrgb1 - procedure Set_Line_Color_RGB_0_255(Red_Component, Blue_Component, Green_Component : Integer) is - begin - plrgb1(Red_Component, Blue_Component, Green_Component); - end Set_Line_Color_RGB_0_255; + -- procedure Set_Line_Color_RGB_0_255(Red_Component, Blue_Component, Green_Component : Integer) is + -- begin + -- plrgb1(Red_Component, Blue_Component, Green_Component); + -- end Set_Line_Color_RGB_0_255; -- Functions for converting between HLS and RGB color space Modified: trunk/bindings/ada/plplot.ads =================================================================== --- trunk/bindings/ada/plplot.ads 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/ada/plplot.ads 2011-03-17 20:05:27 UTC (rev 11639) @@ -1121,10 +1121,10 @@ -- Set current color (map 0) by hue, lightness, and saturation. -- plhls - procedure Set_Color_HLS - (Hue_Component : Long_Float; -- Not documented; presumably 0.0..360.0. - Lightness_Component : Long_Float_0_1_Type; - Saturation_Component : Long_Float_0_1_Type); + -- procedure Set_Color_HLS + -- (Hue_Component : Long_Float; -- Not documented; presumably 0.0..360.0. + -- Lightness_Component : Long_Float_0_1_Type; + -- Saturation_Component : Long_Float_0_1_Type); -- Functions for converting between HLS and RGB color space @@ -1357,12 +1357,12 @@ -- Set line color by red, green, blue from 0.0 to 1.0 -- plrgb - procedure Set_Line_Color_RGB_0_1(Red_Component, Blue_Component, Green_Component : Long_Float_0_1_Type); + -- procedure Set_Line_Color_RGB_0_1(Red_Component, Blue_Component, Green_Component : Long_Float_0_1_Type); -- Set line color by 8 bit RGB values. -- plrgb1 - procedure Set_Line_Color_RGB_0_255(Red_Component, Blue_Component, Green_Component : Integer); + -- procedure Set_Line_Color_RGB_0_255(Red_Component, Blue_Component, Green_Component : Integer); -- Functions for converting between HLS and RGB color space Modified: trunk/bindings/ada/plplot_thin.ads =================================================================== --- trunk/bindings/ada/plplot_thin.ads 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/ada/plplot_thin.ads 2011-03-17 20:05:27 UTC (rev 11639) @@ -975,9 +975,9 @@ -- Set current color (map 0) by hue, lightness, and saturation. - procedure - plhls(h : PLFLT; l : PLFLT; s : PLFLT); - pragma Import(C, plhls, "c_plhls"); + -- procedure + -- plhls(h : PLFLT; l : PLFLT; s : PLFLT); + -- pragma Import(C, plhls, "c_plhls"); -- Functions for converting between HLS and RGB color space @@ -1215,16 +1215,16 @@ -- Set line color by red, green, blue from 0. to 1. - procedure - plrgb(r : PLFLT; g : PLFLT; b : PLFLT); - pragma Import(C, plrgb, "c_plrgb"); + -- procedure + -- plrgb(r : PLFLT; g : PLFLT; b : PLFLT); + -- pragma Import(C, plrgb, "c_plrgb"); -- Set line color by 8 bit RGB values. - procedure - plrgb1(r : PLINT; g : PLINT; b : PLINT); - pragma Import(C, plrgb1, "c_plrgb1"); + -- procedure + -- plrgb1(r : PLINT; g : PLINT; b : PLINT); + -- pragma Import(C, plrgb1, "c_plrgb1"); -- Functions for converting between HLS and RGB color space Modified: trunk/bindings/ada/plplot_traditional.adb =================================================================== --- trunk/bindings/ada/plplot_traditional.adb 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/ada/plplot_traditional.adb 2011-03-17 20:05:27 UTC (rev 11639) @@ -1734,13 +1734,13 @@ -- Set current color (map 0) by hue, lightness, and saturation. - procedure plhls - (Hue_Component : Long_Float; -- Not documented; presumably 0.0..360.0. - Lightness_Component : Long_Float_0_1_Type; - Saturation_Component : Long_Float_0_1_Type) is - begin - PLplot_Thin.plhls(Hue_Component, Lightness_Component, Saturation_Component); - end plhls; + -- procedure plhls + -- (Hue_Component : Long_Float; -- Not documented; presumably 0.0..360.0. + -- Lightness_Component : Long_Float_0_1_Type; + -- Saturation_Component : Long_Float_0_1_Type) is + -- begin + -- PLplot_Thin.plhls(Hue_Component, Lightness_Component, Saturation_Component); + -- end plhls; -- Functions for converting between HLS and RGB color space @@ -2075,17 +2075,17 @@ -- Set line color by red, green, blue from 0.0 to 1.0 - procedure plrgb(Red_Component, Blue_Component, Green_Component : Long_Float_0_1_Type) is - begin - PLplot_Thin.plrgb(Red_Component, Blue_Component, Green_Component); - end plrgb; + -- procedure plrgb(Red_Component, Blue_Component, Green_Component : Long_Float_0_1_Type) is + -- begin + -- PLplot_Thin.plrgb(Red_Component, Blue_Component, Green_Component); + -- end plrgb; -- Set line color by 8 bit RGB values. - procedure plrgb1(Red_Component, Blue_Component, Green_Component : Integer) is - begin - PLplot_Thin.plrgb1(Red_Component, Blue_Component, Green_Component); - end plrgb1; + -- procedure plrgb1(Red_Component, Blue_Component, Green_Component : Integer) is + -- begin + -- PLplot_Thin.plrgb1(Red_Component, Blue_Component, Green_Component); + -- end plrgb1; -- Functions for converting between HLS and RGB color space Modified: trunk/bindings/ada/plplot_traditional.ads =================================================================== --- trunk/bindings/ada/plplot_traditional.ads 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/ada/plplot_traditional.ads 2011-03-17 20:05:27 UTC (rev 11639) @@ -1052,10 +1052,10 @@ -- Set current color (map 0) by hue, lightness, and saturation. - procedure plhls - (Hue_Component : Long_Float; -- Not documented; presumably 0.0..360.0. - Lightness_Component : Long_Float_0_1_Type; - Saturation_Component : Long_Float_0_1_Type); + -- procedure plhls + -- (Hue_Component : Long_Float; -- Not documented; presumably 0.0..360.0. + -- Lightness_Component : Long_Float_0_1_Type; + -- Saturation_Component : Long_Float_0_1_Type); -- Functions for converting between HLS and RGB color space @@ -1258,11 +1258,11 @@ -- Set line color by red, green, blue from 0.0 to 1.0 - procedure plrgb(Red_Component, Blue_Component, Green_Component : Long_Float_0_1_Type); + -- procedure plrgb(Red_Component, Blue_Component, Green_Component : Long_Float_0_1_Type); -- Set line color by 8 bit RGB values. - procedure plrgb1(Red_Component, Blue_Component, Green_Component : Integer); + -- procedure plrgb1(Red_Component, Blue_Component, Green_Component : Integer); -- Functions for converting between HLS and RGB color space Modified: trunk/bindings/c++/plstream.cc =================================================================== --- trunk/bindings/c++/plstream.cc 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/c++/plstream.cc 2011-03-17 20:05:27 UTC (rev 11639) @@ -328,6 +328,7 @@ plarc( x, y, a, b, angle1, angle2, fill ); } +#ifdef PL_DEPRECATED void plstream::arrows( const PLFLT *u, const PLFLT *v, const PLFLT *x, const PLFLT *y, PLINT n, PLFLT scale, PLFLT dx, PLFLT dy ) @@ -336,6 +337,7 @@ plarrows( u, v, x, y, n, scale, dx, dy ); } +#endif // PL_DEPRECATED void plstream::vect( const PLFLT * const *u, const PLFLT * const *v, PLINT nx, PLINT ny, PLFLT scale, @@ -953,12 +955,14 @@ // Set current color (map 0) by hue, lightness, and saturation. +#ifdef PL_DEPRECATED void plstream::hls( PLFLT h, PLFLT l, PLFLT s ) { set_stream(); plhls( h, l, s ); } +#endif // PL_DEPRECATED // Initializes PLplot, using preset or default options @@ -1337,21 +1341,25 @@ // Set line color by red, green, blue from 0. to 1. +#ifdef PL_DEPRECATED void plstream::rgb( PLFLT r, PLFLT g, PLFLT b ) { set_stream(); plrgb( r, g, b ); } +#endif // PL_DEPRECATED // Set line color by 8 bit RGB values. +#ifdef PL_DEPRECATED void plstream::rgb( PLINT r, PLINT g, PLINT b ) { set_stream(); plrgb1( r, g, b ); } +#endif // PL_DEPRECATED // Set character height. @@ -2545,21 +2553,25 @@ } // Depreciated version - use setopt instead. +#ifdef PL_DEPRECATED int plstream::SetOpt( const char *opt, const char *optarg ) { set_stream(); return ::plsetopt( opt, optarg ); } +#endif // PL_DEPRECATED // Process options list using current options info. +#ifdef PL_DEPRECATED int plstream::ParseOpts( int *p_argc, const char **argv, PLINT mode ) { set_stream(); return ::plParseOpts( p_argc, argv, mode ); } +#endif // PL_DEPRECATED // Print usage & syntax message. Modified: trunk/bindings/c++/plstream.h =================================================================== --- trunk/bindings/c++/plstream.h 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/c++/plstream.h 2011-03-17 20:05:27 UTC (rev 11639) @@ -125,8 +125,10 @@ PLBOOL fill ); // Simple arrow plotter +#ifdef PL_DEPRECATED void arrows( const PLFLT *u, const PLFLT *v, const PLFLT *x, const PLFLT *y, PLINT n, PLFLT scale, PLFLT dx, PLFLT dy ); +#endif // PL_DEPRECATED void vect( const PLFLT * const *u, const PLFLT * const *v, PLINT nx, PLINT ny, PLFLT scale, void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ), @@ -408,7 +410,9 @@ // Set current color (map 0) by hue, lightness, and saturation. +#ifdef PL_DEPRECATED void hls( PLFLT h, PLFLT l, PLFLT s ); +#endif // PL_DEPRECATED // Initializes PLplot, using preset or default options @@ -574,11 +578,15 @@ // Set line color by red, green, blue from 0. to 1. +#ifdef PL_DEPRECATED void rgb( PLFLT r, PLFLT g, PLFLT b ); +#endif // PL_DEPRECATED // Set line color by 8 bit RGB values. +#ifdef PL_DEPRECATED void rgb( PLINT r, PLINT g, PLINT b ); +#endif // PL_DEPRECATED // Set character height. Modified: trunk/bindings/f77/plstubs.h =================================================================== --- trunk/bindings/f77/plstubs.h 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/f77/plstubs.h 2011-03-17 20:05:27 UTC (rev 11639) @@ -235,7 +235,6 @@ #define PLGYAX FNAME( PLGYAX, plgyax ) #define PLGZAX FNAME( PLGZAX, plgzax ) #define PLHIST FNAME( PLHIST, plhist ) -#define PLHLS FNAME( PLHLS, plhls ) #define PLHLSRGB FNAME( PLHLSRGB, plhlsrgb ) #define PLIMAGE FNAME( PLIMAGE, plimage ) #define PLIMAGEFR07 FNAME( PLIMAGEFR07, plimagefr07 ) @@ -273,8 +272,6 @@ #define PLPTEX37 FNAME( PLPTEX37, plptex37 ) #define PLRANDD FNAME( PLRANDD, plrandd ) #define PLREPLOT FNAME( PLREPLOT, plreplot ) -#define PLRGB FNAME( PLRGB, plrgb ) -#define PLRGB1 FNAME( PLRGB1, plrgb1 ) #define PLRGBHLS FNAME( PLRGBHLS, plrgbhls ) #define PLSCHR FNAME( PLSCHR, plschr ) #define PLSCMAP0 FNAME( PLSCMAP0, plscmap0 ) @@ -360,4 +357,13 @@ #define PLWIND FNAME( PLWIND, plwind ) #define PLXORMOD FNAME( PLXORMOD, plxormod ) +// The following are deprecated and will be removed in future versions of plplot +#ifdef PL_DEPRECATED + +#define PLRGB FNAME( PLRGB, plrgb ) +#define PLRGB1 FNAME( PLRGB1, plrgb1 ) +#define PLHLS FNAME( PLHLS, plhls ) + +#endif // PL_DEPRECATED + #endif // __PLSTUBS_H__ Modified: trunk/bindings/f77/scstubs.c =================================================================== --- trunk/bindings/f77/scstubs.c 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/f77/scstubs.c 2011-03-17 20:05:27 UTC (rev 11639) @@ -449,11 +449,13 @@ c_plhist( *n, data, *datmin, *datmax, *nbin, *oldwin ); } +#ifdef PL_DEPRECATED void PLHLS( PLFLT *hue, PLFLT *light, PLFLT *sat ) { c_plhls( *hue, *light, *sat ); } +#endif // PL_DEPRECATED void PLHLSRGB( PLFLT *h, PLFLT *l, PLFLT *s, PLFLT *r, PLFLT *g, PLFLT *b ) @@ -748,17 +750,21 @@ c_plreplot(); } +#ifdef PL_DEPRECATED void PLRGB( PLFLT *red, PLFLT *green, PLFLT *blue ) { c_plrgb( *red, *green, *blue ); } +#endif // PL_DEPRECATED +#ifdef PL_DEPRECATED void PLRGB1( PLINT *r, PLINT *g, PLINT *b ) { c_plrgb1( *r, *g, *b ); } +#endif // PL_DEPRECATED void PLRGBHLS( PLFLT *r, PLFLT *g, PLFLT *b, PLFLT *h, PLFLT *l, PLFLT *s ) Modified: trunk/bindings/f95/plstubs.h =================================================================== --- trunk/bindings/f95/plstubs.h 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/f95/plstubs.h 2011-03-17 20:05:27 UTC (rev 11639) @@ -235,7 +235,6 @@ #define PLGYAX FNAME( PLGYAX, plgyax ) #define PLGZAX FNAME( PLGZAX, plgzax ) #define PLHIST FNAME( PLHISTF77, plhistf77 ) -#define PLHLS FNAME( PLHLS, plhls ) #define PLHLSRGB FNAME( PLHLSRGB, plhlsrgb ) #define PLIMAGE FNAME( PLIMAGEF77, plimagef77 ) #define PLIMAGEFR07 FNAME( PLIMAGEFR07, plimagefr07 ) @@ -280,8 +279,6 @@ #define PLPTEX37 FNAME( PLPTEX37, plptex37 ) #define PLRANDD FNAME( PLRANDDF77, plranddf77 ) #define PLREPLOT FNAME( PLREPLOT, plreplot ) -#define PLRGB FNAME( PLRGB, plrgb ) -#define PLRGB1 FNAME( PLRGB1, plrgb1 ) #define PLRGBHLS FNAME( PLRGBHLS, plrgbhls ) #define PLSCHR FNAME( PLSCHR, plschr ) #define PLSCMAP0 FNAME( PLSCMAP0F77, plscmap0f77 ) @@ -371,4 +368,10 @@ #define PLWIND FNAME( PLWIND, plwind ) #define PLXORMOD FNAME( PLXORMODF77, plxormodf77 ) +#ifdef PL_DEPRECATE +#define PLRGB FNAME( PLRGB, plrgb ) +#define PLRGB1 FNAME( PLRGB1, plrgb1 ) +#define PLHLS FNAME( PLHLS, plhls ) +#endif // PL_DEPRECATED + #endif // __PLSTUBS_H__ Modified: trunk/bindings/f95/scstubs.c =================================================================== --- trunk/bindings/f95/scstubs.c 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/f95/scstubs.c 2011-03-17 20:05:27 UTC (rev 11639) @@ -459,11 +459,13 @@ c_plhist( *n, data, *datmin, *datmax, *nbin, *oldwin ); } +#ifdef PL_DEPRECATED void PLHLS( PLFLT *hue, PLFLT *light, PLFLT *sat ) { c_plhls( *hue, *light, *sat ); } +#endif // PL_DEPRECATED void PLHLSRGB( PLFLT *h, PLFLT *l, PLFLT *s, PLFLT *r, PLFLT *g, PLFLT *b ) @@ -787,17 +789,21 @@ c_plreplot(); } +#ifdef PL_DEPRECATED void PLRGB( PLFLT *red, PLFLT *green, PLFLT *blue ) { c_plrgb( *red, *green, *blue ); } +#endif // PL_DEPRECATED +#ifdef PL_DEPRECATED void PLRGB1( PLINT *r, PLINT *g, PLINT *b ) { c_plrgb1( *r, *g, *b ); } +#endif // PL_DEPRECATED void PLRGBHLS( PLFLT *r, PLFLT *g, PLFLT *b, PLFLT *h, PLFLT *l, PLFLT *s ) Modified: trunk/bindings/gnome2/lib/plplotcanvas.c =================================================================== --- trunk/bindings/gnome2/lib/plplotcanvas.c 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/gnome2/lib/plplotcanvas.c 2011-03-17 20:05:27 UTC (rev 11639) @@ -199,12 +199,6 @@ // simple arrow plotter. -// deprecated in core so remove this. -// void plplot_canvas_arrows(PlplotCanvas* self, PLFLT *u, PLFLT *v, PLFLT *x, PLFLT *y, PLINT n, PLFLT scale, PLFLT dx, PLFLT dy) { -// plsstrm(self->Nstream); -// plarrows(u, v, x, y, n, scale, dx, dy) ; -// } - void plplot_canvas_vect( PlplotCanvas* self, PLFLT **u, PLFLT **v, PLINT nx, PLINT ny, PLFLT scale, void ( *pltr )( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ), PLPointer pltr_data ) { plsstrm( self->Nstream ); @@ -626,11 +620,13 @@ // Set current color (map 0) by hue, lightness, and saturation. +#ifdef PL_DEPRECATED void plplot_canvas_hls( PlplotCanvas* self, PLFLT h, PLFLT l, PLFLT s ) { plsstrm( self->Nstream ); plhls( h, l, s ); } +#endif // PL_DEPRECATED // /\* Initializes PLplot, using preset or default options *\/ @@ -823,6 +819,7 @@ plreplot(); } +#ifdef PL_DEPRECATED // Set line color by red, green, blue from 0. to 1. void plplot_canvas_rgb( PlplotCanvas* self, PLFLT r, PLFLT g, PLFLT b ) @@ -838,6 +835,7 @@ plsstrm( self->Nstream ); plrgb1( r, g, b ); } +#endif // PL_DEPRECATED // Set character height. Modified: trunk/bindings/swig-support/plplotcapi.i =================================================================== --- trunk/bindings/swig-support/plplotcapi.i 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/swig-support/plplotcapi.i 2011-03-17 20:05:27 UTC (rev 11639) @@ -246,17 +246,7 @@ // Non-common API that are included here because they traditionally // were part of plmodule.c. -#if 0 -// Deprecated function that we no longer want to propagate to the -// python API. - void -plarrows( const PLFLT *Array, const PLFLT *ArrayCk, const PLFLT *ArrayCk, const PLFLT *ArrayCk, PLINT n, - PLFLT scale, PLFLT dx, PLFLT dy ); - -#endif - -void plsxwin( PLINT window_id ); #endif // SWIG_PYTHON @@ -456,15 +446,7 @@ plhist( PLINT n, const PLFLT *Array, PLFLT datmin, PLFLT datmax, PLINT nbin, PLINT oldwin ); -#if 0 -// Deprecated function that we no longer want to propagate to the -// python API. - void -plhls( PLFLT h, PLFLT l, PLFLT s ); -#endif - -void plhlsrgb( PLFLT h, PLFLT l, PLFLT s, PLFLT *OUTPUT, PLFLT *OUTPUT, PLFLT *OUTPUT ); void @@ -839,12 +821,6 @@ // propagate them to the python API. void -plrgb( PLFLT r, PLFLT g, PLFLT b ); - -void -plrgb1( PLINT r, PLINT g, PLINT b ); - -void plshade1( const PLFLT *Matrix, PLINT nx, PLINT ny, defined_func df, PLFLT left, PLFLT right, PLFLT bottom, PLFLT top, PLFLT shade_min, PLFLT shade_max, Modified: trunk/bindings/tcl/plapi.tpl =================================================================== --- trunk/bindings/tcl/plapi.tpl 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/tcl/plapi.tpl 2011-03-17 20:05:27 UTC (rev 11639) @@ -459,10 +459,10 @@ # Set current color (map 0) by hue, lightness, and saturation. -pltclcmd plhls void -h PLFLT -l PLFLT -s PLFLT +#pltclcmd plhls void +#h PLFLT +#l PLFLT +#s PLFLT # Function to transform from HLS to RGB color space. @@ -630,17 +630,17 @@ # Set line color by red, green, blue from 0. to 1. -pltclcmd plrgb void -r PLFLT -g PLFLT -b PLFLT +#pltclcmd plrgb void +#r PLFLT +#g PLFLT +#b PLFLT # Set line color by 8 bit RGB values. -pltclcmd plrgb1 void -r PLINT -g PLINT -b PLINT +#pltclcmd plrgb1 void +#r PLINT +#g PLINT +#b PLINT # Function to transform from RGB to HLS color space. Modified: trunk/bindings/tcl/tclAPI.c =================================================================== --- trunk/bindings/tcl/tclAPI.c 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/tcl/tclAPI.c 2011-03-17 20:05:27 UTC (rev 11639) @@ -97,7 +97,6 @@ static CmdInfo Cmds[] = { { "loopback", loopbackCmd }, #include "tclgen_s.h" - { "plcol", plcol0Cmd }, { "plcont", plcontCmd }, { "pllegend", pllegendCmd }, { "plmap", plmapCmd }, Modified: trunk/bindings/tk/PLWin.itk =================================================================== --- trunk/bindings/tk/PLWin.itk 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/tk/PLWin.itk 2011-03-17 20:05:27 UTC (rev 11639) @@ -50,12 +50,6 @@ eval $plwin db $args } -# A useful convenience which is similar to what is done in C. - - method plcol {args} { - eval $plwin cmd plcol0 $args - } - # Command which aren't generated by pltclgen, and so aren't done by # plitclgen either. Modified: trunk/bindings/tk/plr.c =================================================================== --- trunk/bindings/tk/plr.c 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/tk/plr.c 2011-03-17 20:05:27 UTC (rev 11639) @@ -436,11 +436,11 @@ plr_rd( pdf_rd_1byte( plr->pdfs, &r ) ); plr_rd( pdf_rd_1byte( plr->pdfs, &g ) ); plr_rd( pdf_rd_1byte( plr->pdfs, &b ) ); - plrgb1( r, g, b ); + plscol0( icol0, r, g, b ); } else { - plcol( icol0 ); + plcol0( icol0 ); } break; } Modified: trunk/bindings/wxwidgets/wxPLplotstream.cpp =================================================================== --- trunk/bindings/wxwidgets/wxPLplotstream.cpp 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/bindings/wxwidgets/wxPLplotstream.cpp 2011-03-17 20:05:27 UTC (rev 11639) @@ -80,7 +80,7 @@ backend ); strncat( drvopt, buffer, bufferSize - strlen( drvopt ) ); - SetOpt( "-drvopt", drvopt ); + setopt( "-drvopt", drvopt ); init(); Modified: trunk/config.h.cmake =================================================================== --- trunk/config.h.cmake 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/config.h.cmake 2011-03-17 20:05:27 UTC (rev 11639) @@ -35,6 +35,9 @@ // Name of the default cmap1 palette to use #define PL_DEFAULT_CMAP1_FILE "@DEFAULT_CMAP1_FILE@" +// Define if support for deprecated plplot functions should be compiled +#cmakedefine PL_DEPRECATED + // Define if there is support for dynamically loaded drivers #cmakedefine ENABLE_DYNDRIVERS Modified: trunk/doc/docbook/src/api-obsolete.xml =================================================================== --- trunk/doc/docbook/src/api-obsolete.xml 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/doc/docbook/src/api-obsolete.xml 2011-03-17 20:05:27 UTC (rev 11639) @@ -65,7 +65,7 @@ </para> <para> - Deprecated. Use the new name, &pleop;, for this function instead. + Removed. Use the new name, &pleop;, for this function instead. </para> </sect1> @@ -87,7 +87,7 @@ </para> <para> - Deprecated. Use the new name, &plcol0;, for this function instead. + Removed. Use the new name, &plcol0;, for this function instead. </para> <variablelist> @@ -128,7 +128,7 @@ <para> Set current color by hue, lightness, and saturation. Convert hls color coordinates to rgb, then call plrgb. - Do <emphasis>not</emphasis> use this. Only retained for backward compatibility. + This function has been removed. Use &plhlsrgb; and &plscol0; instead. </para> <!-- TODO: find out what to do exactly --> @@ -193,8 +193,7 @@ </para> <para> - Use &plhlsrgb; from the common API instead of this deprecated C-only - function. + Removed. Use &plhlsrgb; from the common API instead. </para> <variablelist> @@ -287,7 +286,7 @@ </para> <para> - Deprecated. Use the new name, &plbop;, for this function instead. + Removed. Use the new name, &plbop;, for this function instead. </para> </sect1> @@ -312,9 +311,7 @@ <para> Set line color by red, green, blue from 0. to 1. Do - <emphasis>not</emphasis> use this. - Only retained for backward compatibility. Use the function &plscol0; - instead. + Removed. Use the function &plscol0; instead. </para> <variablelist> @@ -375,8 +372,7 @@ <para> Set line color by 8-bit RGB values. Do <emphasis>not</emphasis> use this. - Only retained for backward compatibility. Use the function &plscol0; - instead. + Removed. Use the function &plscol0; instead. </para> <variablelist> Modified: trunk/examples/tk/xtk01.c =================================================================== --- trunk/examples/tk/xtk01.c 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/examples/tk/xtk01.c 2011-03-17 20:05:27 UTC (rev 11639) @@ -204,19 +204,19 @@ // scaled separately (just = 0), and we just draw a labelled // box (axis = 0). - plcol( 1 ); + plcol0( 1 ); plenv( xmin, xmax, ymin, ymax, 0, 0 ); - plcol( 6 ); + plcol0( 6 ); pllab( "(x)", "(y)", "#frPLplot Example 1 - y=x#u2" ); // Plot the data points - plcol( 9 ); + plcol0( 9 ); plpoin( 6, xs1, ys1, 9 ); // Draw the line through the data - plcol( 4 ); + plcol0( 4 ); plline( 60, x, y ); } @@ -231,9 +231,9 @@ // 10.0, and the range in Y is -0.4 to 2.0. The axes are scaled separately // (just = 0), and we draw a box with axes (axis = 1). - plcol( 1 ); + plcol0( 1 ); plenv( (PLFLT) -2.0, (PLFLT) 10.0, (PLFLT) -0.4, (PLFLT) 1.2, 0, 1 ); - plcol( 2 ); + plcol0( 2 ); pllab( "(x)", "sin(x)/x", "#frPLplot Example 1 - Sinc Function" ); // Fill up the arrays @@ -248,7 +248,7 @@ // Draw the line - plcol( 3 ); + plcol0( 3 ); plline( 100, x, y ); } @@ -272,18 +272,18 @@ // Draw a box with ticks spaced 60 degrees apart in X, and 0.2 in Y. - plcol( 1 ); + plcol0( 1 ); plbox( "bcnst", (PLFLT) 60.0, 2, "bcnstv", (PLFLT) 0.2, 2 ); // Superimpose a dashed line grid, with 1.5 mm marks and spaces. plstyl // expects a pointer!! plstyl( 1, &mark1, &space1 ); - plcol( 2 ); + plcol0( 2 ); plbox( "g", (PLFLT) 30.0, 0, "g", (PLFLT) 0.2, 0 ); plstyl( 0, &mark0, &space0 ); - plcol( 3 ); + plcol0( 3 ); pllab( "Angle (degrees)", "sine", "#frPLplot Example 1 - Sine function" ); for ( i = 0; i < 101; i++ ) @@ -292,7 +292,7 @@ y[i] = sin( x[i] * 3.141592654 / 180.0 ); } - plcol( 4 ); + plcol0( 4 ); plline( 101, x, y ); } @@ -440,9 +440,9 @@ plfill, 1, NULL, NULL ); } - plcol( 1 ); + plcol0( 1 ); plbox( "bcnst", 0.0, 0, "bcnstv", 0.0, 0 ); - plcol( 2 ); + plcol0( 2 ); // // plcont(w, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, NCONTR, mypltr, NULL); // Modified: trunk/examples/tk/xtk02.c =================================================================== --- trunk/examples/tk/xtk02.c 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/examples/tk/xtk02.c 2011-03-17 20:05:27 UTC (rev 11639) @@ -240,19 +240,19 @@ // scaled separately (just = 0), and we just draw a labelled // box (axis = 0). - plcol( 1 ); + plcol0( 1 ); plenv( xmin, xmax, ymin, ymax, 0, 0 ); - plcol( 6 ); + plcol0( 6 ); pllab( "(x)", "(y)", "#frPLplot Example 1 - y=x#u2" ); // Plot the data points - plcol( 9 ); + plcol0( 9 ); plpoin( 6, xs, ys, 9 ); // Draw the line through the data - plcol( 4 ); + plcol0( 4 ); plline( 60, x, y ); } @@ -267,9 +267,9 @@ // 10.0, and the range in Y is -0.4 to 2.0. The axes are scaled separately // (just = 0), and we draw a box with axes (axis = 1). - plcol( 1 ); + plcol0( 1 ); plenv( -2.0, 10.0, -0.4, 1.2, 0, 1 ); - plcol( 2 ); + plcol0( 2 ); pllab( "(x)", "sin(x)/x", "#frPLplot Example 1 - Sinc Function" ); // Fill up the arrays @@ -284,7 +284,7 @@ // Draw the line - plcol( 3 ); + plcol0( 3 ); plline( 100, x, y ); } @@ -308,18 +308,18 @@ // Draw a box with ticks spaced 60 degrees apart in X, and 0.2 in Y. - plcol( 1 ); + plcol0( 1 ); plbox( "bcnst", 60.0, 2, "bcnstv", 0.2, 2 ); // Superimpose a dashed line grid, with 1.5 mm marks and spaces. plstyl // expects a pointer!! plstyl( 1, &mark1, &space1 ); - plcol( 2 ); + plcol0( 2 ); plbox( "g", 30.0, 0, "g", 0.2, 0 ); plstyl( 0, &mark0, &space0 ); - plcol( 3 ); + plcol0( 3 ); pllab( "Angle (degrees)", "sine", "#frPLplot Example 1 - Sine function" ); for ( i = 0; i < 101; i++ ) @@ -328,7 +328,7 @@ y[i] = sin( x[i] * 3.141592654 / 180.0 ); } - plcol( 4 ); + plcol0( 4 ); plline( 101, x, y ); } Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/include/plplot.h 2011-03-17 20:05:27 UTC (rev 11639) @@ -314,10 +314,16 @@ #define PL_FCI_MEDIUM 0x0 #define PL_FCI_BOLD 0x1 +#ifdef PL_DEPRECATED + // Obsolete names #define plParseInternalOpts( a, b, c ) c_plparseopts( a, b, c ) #define plSetInternalOpt( a, b ) plSetOpt( a, b ) + +#endif // PL_DEPRECATED + + // Option table definition typedef struct @@ -799,6 +805,8 @@ #ifndef __PLSTUBS_H__ // i.e. do not expand this in the stubs +#ifdef PL_DEPRECATED + #define plclr pleop #define plpage plbop #define plcol plcol0 @@ -810,6 +818,8 @@ #define plP_gvpw plgvpw #define plotsh3d( x, y, z, nx, ny, opt ) plsurf3d( x, y, z, nx, ny, opt, NULL, 0 ) +#endif // PL_DEPRECATED + #endif // __PLSTUBS_H__ //-------------------------------------------------------------------------- @@ -2196,9 +2206,13 @@ PLDLLIMPEXP int c_plsetopt( const char *opt, const char *optarg ); +#ifdef PL_DEPRECATED + PLDLLIMPEXP int plSetOpt( const char *opt, const char *optarg ); +#endif // PL_DEPRECATED + // Process options list using current options info. PLDLLIMPEXP int @@ -2284,22 +2298,8 @@ PLDLLIMPEXP int plTranslateCursor( PLGraphicsIn *gin ); -// Deprecated function names which are handled as wrappers for strict -// backwards compatibility of the library API +#ifdef PL_DEPRECATED -PLDLLIMPEXP int -plParseOpts( int *p_argc, const char **argv, PLINT mode ); - -PLDLLIMPEXP void -plHLS_RGB( PLFLT h, PLFLT l, PLFLT s, PLFLT *p_r, PLFLT *p_g, PLFLT *p_b ); - -PLDLLIMPEXP void -plRGB_HLS( PLFLT r, PLFLT g, PLFLT b, PLFLT *p_h, PLFLT *p_l, PLFLT *p_s ); - -PLDLLIMPEXP void -plarrows( const PLFLT *u, const PLFLT *v, const PLFLT *x, const PLFLT *y, PLINT n, - PLFLT scale, PLFLT dx, PLFLT dy ); - // These functions are depreciated and only retained for backwards // compatibility - do not use in new code. @@ -2318,7 +2318,9 @@ PLDLLIMPEXP void c_plrgb1( PLINT r, PLINT g, PLINT b ); +#endif // PL_DEPRECATED + #ifdef __cplusplus } #endif Modified: trunk/src/plargs.c =================================================================== --- trunk/src/plargs.c 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/src/plargs.c 2011-03-17 20:05:27 UTC (rev 11639) @@ -150,7 +150,6 @@ static int opt_plserver( const char *, const char *, void * ); static int opt_plwindow( const char *, const char *, void * ); -static int opt_tcl_cmd( const char *, const char *, void * ); static int opt_auto_path( const char *, const char *, void * ); static int opt_bufmax( const char *, const char *, void * ); static int opt_server_name( const char *, const char *, void * ); @@ -566,15 +565,6 @@ "Name of PLplot container window (tk driver)" }, { - "tcl_cmd", // TCL initialization command - opt_tcl_cmd, - NULL, - NULL, - PL_OPT_FUNC | PL_OPT_ARG | PL_OPT_INVISIBLE, - "-tcl_cmd command", - "Depreciated - use -drvopt tcl_cmd= instead" - }, - { "auto_path", // Additional directory(s) to autoload opt_auto_path, NULL, @@ -2170,35 +2160,6 @@ } //-------------------------------------------------------------------------- -// opt_tcl_cmd() -// -// Performs appropriate action for option "tcl_cmd": -// Sets TCL command(s) to eval on startup -// Depreciated - just bounce on to -drvopt tcl_cmd= -//-------------------------------------------------------------------------- - -static int -opt_tcl_cmd( const char *opt, const char *optarg, void *client_data ) -{ - char *newcmd; - - if ( ( newcmd = (char *) malloc( (size_t) ( strlen( optarg ) + 9 ) * sizeof ( char ) ) ) == NULL ) - { - plexit( "opt_tcl_cmd: Insufficient memory" ); - } - - strcpy( newcmd, "tcl_cmd=" ); - strcat( newcmd, optarg ); - - fprintf( stderr, "-tcl_cmd <cmd> is obsolete. Please use -drvopt tcl_cmd=<cmd> instead\n" ); - - opt_drvopt( "drvopt", newcmd, NULL ); - free( newcmd ); - - return 0; -} - -//-------------------------------------------------------------------------- // opt_auto_path() // // Performs appropriate action for option "auto_path": Modified: trunk/src/plcore.c =================================================================== --- trunk/src/plcore.c 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/src/plcore.c 2011-03-17 20:05:27 UTC (rev 11639) @@ -2319,7 +2319,7 @@ // Switch to graphics mode and set color and arrow style plgra(); - plcol( 1 ); + plcol0( 1 ); pllsty( 1 ); plpat( 1, &inc, &del ); Modified: trunk/src/plctrl.c =================================================================== --- trunk/src/plctrl.c 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/src/plctrl.c 2011-03-17 20:05:27 UTC (rev 11639) @@ -1046,78 +1046,6 @@ } //-------------------------------------------------------------------------- -// plrgb() -// -// Set line color by red, green, blue from 0. to 1. -// Do NOT use this. Only retained for backward compatibility -//-------------------------------------------------------------------------- - -void -c_plrgb( PLFLT r, PLFLT g, PLFLT b ) -{ - if ( plsc->level < 1 ) - { - plabort( "plrgb: Please call plinit first" ); - return; - } - - plsc->icol0 = PL_RGB_COLOR; - plsc->curcolor.r = MAX( 0, MIN( 255, (int) ( 256. * r ) ) ); - plsc->curcolor.g = MAX( 0, MIN( 255, (int) ( 256. * g ) ) ); - plsc->curcolor.b = MAX( 0, MIN( 255, (int) ( 256. * b ) ) ); - - plsc->curcmap = 0; - plP_state( PLSTATE_COLOR0 ); -} - -//-------------------------------------------------------------------------- -// plrgb1() -// -// Set line color by 8 bit RGB values. -// Do NOT use this. Only retained for backward compatibility -//-------------------------------------------------------------------------- - -void -c_plrgb1( PLINT r, PLINT g, PLINT b ) -{ - if ( plsc->level < 1 ) - { - plabort( "plrgb1: Please call plinit first" ); - return; - } - if ( ( r < 0 || r > 255 ) || ( g < 0 || g > 255 ) || ( b < 0 || b > 255 ) ) - { - plabort( "plrgb1: Invalid color" ); - return; - } - - plsc->icol0 = PL_RGB_COLOR; - plsc->curcolor.r = r; - plsc->curcolor.g = g; - plsc->curcolor.b = b; - - plsc->curcmap = 0; - plP_state( PLSTATE_COLOR0 ); -} - -//-------------------------------------------------------------------------- -// void plhls() -// -// Set current color by hue, lightness, and saturation. -// Convert hls color coordinates to rgb, then call plrgb. -// Do NOT use this. Only retained for backward compatibility -//-------------------------------------------------------------------------- - -void -c_plhls( PLFLT h, PLFLT l, PLFLT s ) -{ - PLFLT r, g, b; - - c_plhlsrgb( h, l, s, &r, &g, &b ); - plrgb( r, g, b ); -} - -//-------------------------------------------------------------------------- // void value() // // Auxiliary function used by c_plhlsrgb(). Modified: trunk/src/pldeprecated.c =================================================================== --- trunk/src/pldeprecated.c 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/src/pldeprecated.c 2011-03-17 20:05:27 UTC (rev 11639) @@ -25,150 +25,102 @@ // is explicitly commented. // +#ifdef PL_DEPRECATED + #define NEED_PLDEBUG #include "plplotP.h" -//-------------------------------------------------------------------------- -// Use plparseopts instead. -//-------------------------------------------------------------------------- -int -plParseOpts( int *p_argc, const char **argv, PLINT mode ) -{ - plwarn( "plParseOpts: function deprecated. Use plparseopts instead" ); - return c_plparseopts( p_argc, argv, mode ); -} +// The following functions have been removed from plplot ahead of the 5.9.8 +// release. They have long been advertised as deprecated. +// plParseOpts +// plHLS_RGB +// plRGB_HLS +// plarrows -//-------------------------------------------------------------------------- -// Use plhlsrgb instead. -//-------------------------------------------------------------------------- -void -plHLS_RGB( PLFLT h, PLFLT l, PLFLT s, PLFLT *p_r, PLFLT *p_g, PLFLT *p_b ) -{ - plwarn( "plHLS_RGB: function deprecated. Use plhlsrgb instead" ); - c_plhlsrgb( h, l, s, p_r, p_g, p_b ); -} +// The following functions have been marked as obsolete for some time, +// but were formally deprecated as of version 5.9.8 +// plrgb +// plrgb1 +// plhls //-------------------------------------------------------------------------- -// Use plrgbhls instead. +// plrgb() +// +// Set line color by red, green, blue from 0. to 1. +// Do NOT use this. Only retained for backward compatibility //-------------------------------------------------------------------------- + void -plRGB_HLS( PLFLT r, PLFLT g, PLFLT b, PLFLT *p_h, PLFLT *p_l, PLFLT *p_s ) +c_plrgb( PLFLT r, PLFLT g, PLFLT b ) { - plwarn( "plRGB_HLS: function deprecated. Use plrgbhls instead" ); - c_plrgbhls( r, g, b, p_h, p_l, p_s ); + plwarn( "plrgb: function deprecated. Use plscol instead" ); + + if ( plsc->level < 1 ) + { + plabort( "plrgb: Please call plinit first" ); + return; + } + + plsc->icol0 = PL_RGB_COLOR; + plsc->curcolor.r = MAX( 0, MIN( 255, (int) ( 256. * r ) ) ); + plsc->curcolor.g = MAX( 0, MIN( 255, (int) ( 256. * g ) ) ); + plsc->curcolor.b = MAX( 0, MIN( 255, (int) ( 256. * b ) ) ); + + plsc->curcmap = 0; + plP_state( PLSTATE_COLOR0 ); } //-------------------------------------------------------------------------- -// Use plvect / plsvect instead. -// void plarrows() +// plrgb1() // -// simple arrow plotter -// copyright 1993 Wesley Ebisuzaki -// -// an arrow is defined by its location (x, y) and its direction (u, v) -// -// inputs: -// u[i], v[i] arrow's horizontal and vertical projection -// x[i], y[i] arrow's location (world coordinates) -// n number of arrows to draw -// scale > 0 scaling factor for arrows -// 0 default scaling factor -// < 0 default scaling factor * (-scale) -// dx, dy distance between arrows -// used when calculating the default arrow scaling -// so that arrows don't overlap -// +// Set line color by 8 bit RGB values. +// Do NOT use this. Only retained for backward compatibility //-------------------------------------------------------------------------- -#define SCALE0 2.0 - -// definition of original arrow: 2 line segments - -static PLFLT arrow_x[4] = { 0.5, -0.5, -0.27, -0.5 }; -static PLFLT arrow_y[4] = { 0.0, 0.0, 0.0, 0.20 }; - void -plarrows( const PLFLT *u, const PLFLT *v, const PLFLT *x, const PLFLT *y, PLINT n, - PLFLT scale, PLFLT dx, PLFLT dy ) +c_plrgb1( PLINT r, PLINT g, PLINT b ) { - PLFLT uu, vv; - PLINT i, j, npts = 4; - PLINT px0, py0, dpx, dpy; - PLINT a_x[4], a_y[4]; - PLFLT max_u, max_v; - double t; + plwarn( "plrgb1: function deprecated. Use plscol instead" ); - plwarn( "plarrows: function deprecated. Use plvect instead" ); - - if ( n <= 0 ) + if ( plsc->level < 1 ) + { + plabort( "plrgb1: Please call plinit first" ); return; - - if ( scale <= 0.0 ) + } + if ( ( r < 0 || r > 255 ) || ( g < 0 || g > 255 ) || ( b < 0 || b > 255 ) ) { - // automatic scaling - // find max / min values of data - - max_u = u[0]; - max_v = v[0]; - for ( i = 1; i < n; i++ ) - { - t = fabs( (double) u[i] ); - max_u = t > max_u ? t : max_u; - t = fabs( (double) v[i] ); - max_v = t > max_v ? t : max_v; - } - - // measure distance in grid boxs - - max_u = max_u / fabs( (double) dx ); - max_v = max_v / fabs( (double) dy ); - - t = ( max_u > max_v ? max_u : max_v ); - t = SCALE0 / t; - if ( scale < 0 ) - { - scale = -scale * t; - } - else - { - scale = t; - } + plabort( "plrgb1: Invalid color" ); + return; } - pldebug( "plarrows", "scale factor=%lf n=%d\n", scale, n ); - for ( i = 0; i < n; i++ ) - { - uu = scale * u[i]; - vv = scale * v[i]; - if ( uu == 0.0 && uu == 0.0 ) - continue; + plsc->icol0 = PL_RGB_COLOR; + plsc->curcolor.r = r; + plsc->curcolor.g = g; + plsc->curcolor.b = b; - // conversion to physical coordinates + plsc->curcmap = 0; + plP_state( PLSTATE_COLOR0 ); +} - px0 = plP_wcpcx( x[i] ); - py0 = plP_wcpcy( y[i] ); +//-------------------------------------------------------------------------- +// void plhls() +// +// Set current color by hue, lightness, and saturation. +// Convert hls color coordinates to rgb, then call plrgb. +// Do NOT use this. Only retained for backward compatibility +//-------------------------------------------------------------------------- - pldebug( "plarrows", "%f %f %d %d\n", x[i], y[i], px0, py0 ); +void +c_plhls( PLFLT h, PLFLT l, PLFLT s ) +{ + PLFLT r, g, b; - dpx = plP_wcpcx( x[i] + 0.5 * uu ) - px0; - dpy = plP_wcpcy( y[i] + 0.5 * vv ) - py0; + plwarn( "plhls: function deprecated. Use plhlsrgb / plscol instead" ); - // transform arrow -> a - - for ( j = 0; j < npts; j++ ) - { - a_x[j] = (PLINT) ( arrow_x[j] * dpx - - arrow_y[j] * dpy + px0 ); - a_y[j] = (PLINT) ( arrow_x[j] * dpy + - arrow_y[j] * dpx + py0 ); - } - - // draw the arrow - plP_movphy( a_x[0], a_y[0] ); - plP_draphy( a_x[1], a_y[1] ); - plP_movphy( a_x[2], a_y[2] ); - plP_draphy( a_x[3], a_y[3] ); - } + c_plhlsrgb( h, l, s, &r, &g, &b ); + plrgb( r, g, b ); } + +#endif // PL_DEPRECATED Modified: trunk/src/plstripc.c =================================================================== --- trunk/src/plstripc.c 2011-03-17 19:45:57 UTC (rev 11638) +++ trunk/src/plstripc.c 2011-03-17 20:05:27 UTC (rev 11639) @@ -159,9 +159,9 @@ { if ( stripc->npts[i] || first ) { - plcol( stripc->colline[i] ); pllsty( stripc->styline[i] ); + plcol0( stripc->colline[i] ); pllsty( stripc->styline[i] ); pljoin( stripc->xlpos, stripc->ylpos - sc, stripc->xlpos + 0.1, stripc->ylpos - sc ); - plcol( stripc->collab ); + plcol0( stripc->collab ); plptex( stripc->xlpos + 0.11, stripc->ylpos - sc, 0., 0., 0, stripc->legline[i] ); sc += dy; } } @@ -184,7 +184,7 @@ plvpor( 0, 1, 0, 1 ); plwind( 0, 1, 0, 1 ); - plcol( 0 ); plpsty( 0 ); + plcol0( 0 ); plpsty( 0 ); plclear(); plvsta(); @@ -195,17 +195,17 @@ plwind( strip->xmin, strip->xmax, strip->ymin, strip->ymax ); pllsty( 1 ); - plcol( strip->colbox ); + plcol0( strip->colbox ); plbox( strip->xspec, 0.0, 0, strip->yspec, 0.0, 0 ); - plcol( strip->collab ); + plcol0( strip->collab ); pllab( strip->labx, strip->laby, strip->labtop ); for ( i = 0; i < PEN; i++ ) { if ( strip->npts[i] > 0 ) { - plcol( strip->colline[i] ); pllsty( strip->styline[i] ); + plcol0( strip->colline[i] ); pllsty( strip->styline[i] ); plline( strip->npts[i], strip->x[i], strip->y[i] ); } } @@ -274,7 +274,7 @@ // If user has changed subwindow, make shure we have the correct one plvsta(); plwind( stripc->wxmin, stripc->wxmax, stripc->wymin, stripc->wymax ); // FIXME - can exist some redundancy here - plcol( stripc->colline[p] ); pllsty( stripc->styline[p] ); + plcol0( stripc->colline[p] ); pllsty( stripc->styline[p] ); if ( ( stripc->npts[p] - 2 ) < 0 ) plP_movwor( stripc->x[p][stripc->npts[p] - 1], stripc->y[p][stripc->npts[p] - 1] ); else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |