From: <ai...@us...> - 2012-01-22 00:39:09
|
Revision: 12147 http://plplot.svn.sourceforge.net/plplot/?rev=12147&view=rev Author: airwin Date: 2012-01-22 00:39:02 +0000 (Sun, 22 Jan 2012) Log Message: ----------- Apply slightly modified patch by Phil Rosenberg to replace references to cmap0 (except for background which is a special case which must use cmap0) by curcolor. This change allows plcol1 (which also sets curcolor just like plcol0) to affect the text colors in the first page of example 21 for the wxwidgets devices just like happens for all other devices. Modified Paths: -------------- trunk/drivers/wxwidgets_agg.cpp trunk/drivers/wxwidgets_dc.cpp trunk/drivers/wxwidgets_gc.cpp trunk/src/plfreetype.c Modified: trunk/drivers/wxwidgets_agg.cpp =================================================================== --- trunk/drivers/wxwidgets_agg.cpp 2012-01-22 00:21:26 UTC (rev 12146) +++ trunk/drivers/wxwidgets_agg.cpp 2012-01-22 00:39:02 UTC (rev 12147) @@ -399,10 +399,10 @@ //-------------------------------------------------------------------------- void wxPLDevAGG::SetColor0( PLStream *pls ) { - mColorRedStroke = pls->cmap0[pls->icol0].r; - mColorGreenStroke = pls->cmap0[pls->icol0].g; - mColorBlueStroke = pls->cmap0[pls->icol0].b; - mStrokeOpacity = (wxUint8) ( pls->cmap0[pls->icol0].a * 255 ); + mColorRedStroke = pls->curcolor.r; + mColorGreenStroke = pls->curcolor.g; + mColorBlueStroke = pls->curcolor.b; + mStrokeOpacity = (wxUint8) ( pls->curcolor.a * 255 ); } Modified: trunk/drivers/wxwidgets_dc.cpp =================================================================== --- trunk/drivers/wxwidgets_dc.cpp 2012-01-22 00:21:26 UTC (rev 12146) +++ trunk/drivers/wxwidgets_dc.cpp 2012-01-22 00:39:02 UTC (rev 12147) @@ -227,8 +227,7 @@ //-------------------------------------------------------------------------- void wxPLDevDC::SetWidth( PLStream *pls ) { - m_dc->SetPen( *( wxThePenList->FindOrCreatePen( wxColour( pls->cmap0[pls->icol0].r, pls->cmap0[pls->icol0].g, - pls->cmap0[pls->icol0].b ), + m_dc->SetPen( *( wxThePenList->FindOrCreatePen( wxColour( pls->curcolor.r, pls->curcolor.g, pls->curcolor.b ), pls->width > 0 ? pls->width : 1, wxSOLID ) ) ); } @@ -240,10 +239,9 @@ //-------------------------------------------------------------------------- void wxPLDevDC::SetColor0( PLStream *pls ) { - m_dc->SetPen( *( wxThePenList->FindOrCreatePen( wxColour( pls->cmap0[pls->icol0].r, pls->cmap0[pls->icol0].g, - pls->cmap0[pls->icol0].b ), + m_dc->SetPen( *( wxThePenList->FindOrCreatePen( wxColour( pls->curcolor.r, pls->curcolor.g, pls->curcolor.b ), pls->width > 0 ? pls->width : 1, wxSOLID ) ) ); - m_dc->SetBrush( wxBrush( wxColour( pls->cmap0[pls->icol0].r, pls->cmap0[pls->icol0].g, pls->cmap0[pls->icol0].b ) ) ); + m_dc->SetBrush( wxBrush( wxColour( pls->curcolor.r, pls->curcolor.g, pls->curcolor.b ) ) ); } @@ -254,8 +252,7 @@ //-------------------------------------------------------------------------- void wxPLDevDC::SetColor1( PLStream *pls ) { - m_dc->SetPen( *( wxThePenList->FindOrCreatePen( wxColour( pls->curcolor.r, pls->curcolor.g, - pls->curcolor.b ), + m_dc->SetPen( *( wxThePenList->FindOrCreatePen( wxColour( pls->curcolor.r, pls->curcolor.g, pls->curcolor.b ), pls->width > 0 ? pls->width : 1, wxSOLID ) ) ); m_dc->SetBrush( wxBrush( wxColour( pls->curcolor.r, pls->curcolor.g, pls->curcolor.b ) ) ); } @@ -422,8 +419,7 @@ sin_rot = sin( rotation ); // Set font color - m_dc->SetTextForeground( wxColour( pls->cmap0[pls->icol0].r, pls->cmap0[pls->icol0].g, - pls->cmap0[pls->icol0].b ) ); + m_dc->SetTextForeground( wxColour( pls->curcolor.r, pls->curcolor.g, pls->curcolor.b ) ); m_dc->SetTextBackground( wxColour( pls->curcolor.r, pls->curcolor.g, pls->curcolor.b ) ); posX = args->x; Modified: trunk/drivers/wxwidgets_gc.cpp =================================================================== --- trunk/drivers/wxwidgets_gc.cpp 2012-01-22 00:21:26 UTC (rev 12146) +++ trunk/drivers/wxwidgets_gc.cpp 2012-01-22 00:39:02 UTC (rev 12147) @@ -267,13 +267,13 @@ { // Log_Verbose( "%s", __FUNCTION__ ); - mColorRedStroke = pls->cmap0[pls->icol0].r; - mColorGreenStroke = pls->cmap0[pls->icol0].g; - mColorBlueStroke = pls->cmap0[pls->icol0].b; - mColorRedFill = pls->cmap0[pls->icol0].r; - mColorGreenFill = pls->cmap0[pls->icol0].g; - mColorBlueFill = pls->cmap0[pls->icol0].b; - mStrokeOpacity = (unsigned char) ( pls->cmap0[pls->icol0].a * 255 ); + mColorRedStroke = pls->curcolor.r; + mColorGreenStroke = pls->curcolor.g; + mColorBlueStroke = pls->curcolor.b; + mColorRedFill = pls->curcolor.r; + mColorGreenFill = pls->curcolor.g; + mColorBlueFill = pls->curcolor.b; + mStrokeOpacity = (unsigned char) ( pls->curcolor.a * 255 ); m_context->SetPen( *( wxThePenList->FindOrCreatePen( wxColour( mColorRedStroke, mColorGreenStroke, mColorBlueStroke, mStrokeOpacity ), @@ -452,9 +452,9 @@ #endif // text color - textRed = pls->cmap0[pls->icol0].r; - textGreen = pls->cmap0[pls->icol0].g; - textBlue = pls->cmap0[pls->icol0].b; + textRed = pls->curcolor.r; + textGreen = pls->curcolor.g; + textBlue = pls->curcolor.b; // calculate rotation of text plRotationShear( args->xform, &rotation, &shear, &stride ); Modified: trunk/src/plfreetype.c =================================================================== --- trunk/src/plfreetype.c 2012-01-22 00:21:26 UTC (rev 12146) +++ trunk/src/plfreetype.c 2012-01-22 00:39:02 UTC (rev 12147) @@ -2,7 +2,7 @@ // // Copyright (C) 2002, 2004, 2005 Andrew Roach // Copyright (C) 2002 Maurice LeBrun -// Copyright (C) 2002, 2004, 2005 Alan W. Irwin +// Copyright (C) 2002-2012 Alan W. Irwin // Copyright (C) 2003, 2004 Joao Cardoso // Copyright (C) 2003, 2004, 2005 Rafael Laboissiere // Copyright (C) 2004 Andrew Ross @@ -541,9 +541,9 @@ alpha_a = (float) FT->shade / 255.0; // alpha_b=1.0-alpha_a; - // R=(plsc->cmap0[pls->icol0].r*alpha_a)+(R*alpha_b); - // G=(plsc->cmap0[pls->icol0].g*alpha_a)+(G*alpha_b); - // B=(plsc->cmap0[pls->icol0].b*alpha_a)+(B*alpha_b); + // R=(plsc->curcolor.r*alpha_a)+(R*alpha_b); + // G=(plsc->curcolor.g*alpha_a)+(G*alpha_b); + // B=(plsc->curcolor.b*alpha_a)+(B*alpha_b); // // This next bit of code is, I *think*, computationally @@ -555,9 +555,9 @@ // Is one faster than the other so that you'd ever notice ? // - R = (int) ( ( ( plsc->cmap0[pls->icol0].r - R ) * alpha_a ) + R ); - G = (int) ( ( ( plsc->cmap0[pls->icol0].g - G ) * alpha_a ) + G ); - B = (int) ( ( ( plsc->cmap0[pls->icol0].b - B ) * alpha_a ) + B ); + R = (int) ( ( ( plsc->curcolor.r - R ) * alpha_a ) + R ); + G = (int) ( ( ( plsc->curcolor.g - G ) * alpha_a ) + G ); + B = (int) ( ( ( plsc->curcolor.b - B ) * alpha_a ) + B ); FT->set_pixel( pls, x + k, y + i, RGB( R > 255 ? 255 : R, G > 255 ? 255 : G, B > 255 ? 255 : B ) ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2012-01-27 22:29:22
|
Revision: 12160 http://plplot.svn.sourceforge.net/plplot/?rev=12160&view=rev Author: airwin Date: 2012-01-27 22:29:16 +0000 (Fri, 27 Jan 2012) Log Message: ----------- Replace the iargc and getarg GNU extensions in bindings/f95/configurable.f90 with the Fortran 2003 standard library routines, command_argument_count and get_command_argument. Arjen's tests show this change means it is no longer necessary to build configurable.f90 in a separate static library on windows platforms. Therefore, remove all STATIC_OPTS logic from the build system that made that separate static build possible. This means, configurable.f90 is now completely equivalent to other source for the plplotf95 library on all platforms now. (Since it is not configured, it is also time to change its name, but I will leave that to Arjen.) This change has been tested with the test_diff_psc target on Linux with good results (except for examples 20 and 28 because of on-going blank issues and the missing example 00). That target should also be tested on Windows to make sure all is well with that platform for Fortran 95. Modified Paths: -------------- trunk/bindings/f77/CMakeLists.txt trunk/bindings/f95/CMakeLists.txt trunk/bindings/f95/configurable.f90 trunk/cmake/modules/TestF77CmdLine.cmake trunk/examples/f77/CMakeLists.txt trunk/examples/f95/CMakeLists.txt trunk/examples/plplot_configure.cmake_installed_examples.in Modified: trunk/bindings/f77/CMakeLists.txt =================================================================== --- trunk/bindings/f77/CMakeLists.txt 2012-01-27 22:17:33 UTC (rev 12159) +++ trunk/bindings/f77/CMakeLists.txt 2012-01-27 22:29:16 UTC (rev 12160) @@ -179,24 +179,12 @@ ) ## Build fortran part of F77 bindings - if(STATIC_OPTS) - # Put the file configurable.f in a separate static library - set(plplotf77opts${LIB_TAG}_LIB_SRCS - configurable.f - ) - set(plplotf77${LIB_TAG}_LIB_SRCS - strutil.f - sfstubs.f - ) - else(STATIC_OPTS) - set(plplotf77${LIB_TAG}_LIB_SRCS - strutil.f - sfstubs.f - configurable.f - ) - endif(STATIC_OPTS) + set(plplotf77${LIB_TAG}_LIB_SRCS + strutil.f + sfstubs.f + configurable.f + ) - if(WIN32 AND BUILD_SHARED_LIBS AND NOT CYGWIN AND NOT MINGW) SET(plplotf77${LIB_TAG}_LIB_SRCS ${plplotf77${LIB_TAG}_LIB_SRCS} plplotf77${DEFFILE}.def) endif(WIN32 AND BUILD_SHARED_LIBS AND NOT CYGWIN AND NOT MINGW) @@ -215,13 +203,7 @@ set(PC_REQUIRES_TAG "Requires") endif(NON_TRANSITIVE) - if(STATIC_OPTS) - add_library(plplotf77opts${LIB_TAG} STATIC ${plplotf77opts${LIB_TAG}_LIB_SRCS}) - target_link_libraries(plplotf77${LIB_TAG} plplotf77c${LIB_TAG}) - target_link_libraries(plplotf77opts${LIB_TAG} plplotf77${LIB_TAG} plplotf77c${LIB_TAG}) - else(STATIC_OPTS) - target_link_libraries(plplotf77${LIB_TAG} plplotf77c${LIB_TAG}) - endif(STATIC_OPTS) + target_link_libraries(plplotf77${LIB_TAG} plplotf77c${LIB_TAG}) if(USE_RPATH) set_target_properties(plplotf77${LIB_TAG} @@ -247,15 +229,6 @@ RUNTIME DESTINATION ${BIN_DIR} ) - if(STATIC_OPTS) - install(TARGETS plplotf77opts${LIB_TAG} - EXPORT export_plplot - ARCHIVE DESTINATION ${LIB_DIR} - LIBRARY DESTINATION ${LIB_DIR} - RUNTIME DESTINATION ${BIN_DIR} - ) - endif(STATIC_OPTS) - # Configure pkg-config *.pc file corresponding to libplplotf77${LIB_TAG} if(PKG_CONFIG_EXECUTABLE) if(LIB_TAG) Modified: trunk/bindings/f95/CMakeLists.txt =================================================================== --- trunk/bindings/f95/CMakeLists.txt 2012-01-27 22:17:33 UTC (rev 12159) +++ trunk/bindings/f95/CMakeLists.txt 2012-01-27 22:29:16 UTC (rev 12160) @@ -125,21 +125,11 @@ ${CMAKE_CURRENT_BINARY_DIR}/plplot_parameters.h_compare ) - if(STATIC_OPTS) - set(plplotf95opts${LIB_TAG}_LIB_SRCS - configurable.f90 - ) - set(plplotf95${LIB_TAG}_LIB_SRCS - strutil.f90 - sfstubsf95.f90 - ) - else(STATIC_OPTS) - set(plplotf95${LIB_TAG}_LIB_SRCS - strutil.f90 - configurable.f90 - sfstubsf95.f90 - ) - endif(STATIC_OPTS) + set(plplotf95${LIB_TAG}_LIB_SRCS + strutil.f90 + configurable.f90 + sfstubsf95.f90 + ) if(WIN32 AND BUILD_SHARED_LIBS AND NOT MINGW AND NOT CYGWIN) SET(plplotf95${LIB_TAG}_LIB_SRCS ${plplotf95${LIB_TAG}_LIB_SRCS} plplotf95${DEFFILE}.def) @@ -159,13 +149,7 @@ set(PC_REQUIRES_TAG "Requires") endif(NON_TRANSITIVE) - if(STATIC_OPTS) - add_library(plplotf95opts${LIB_TAG} STATIC ${plplotf95opts${LIB_TAG}_LIB_SRCS}) - target_link_libraries(plplotf95${LIB_TAG} plplotf95c${LIB_TAG}) - target_link_libraries(plplotf95opts${LIB_TAG} plplotf95${LIB_TAG} plplotf95c${LIB_TAG}) - else(STATIC_OPTS) - target_link_libraries(plplotf95${LIB_TAG} plplotf95c${LIB_TAG}) - endif(STATIC_OPTS) + target_link_libraries(plplotf95${LIB_TAG} plplotf95c${LIB_TAG}) if(USE_RPATH) set_target_properties(plplotf95${LIB_TAG} @@ -201,15 +185,6 @@ RUNTIME DESTINATION ${BIN_DIR} ) - if(STATIC_OPTS) - install(TARGETS plplotf95opts${LIB_TAG} - EXPORT export_plplot - ARCHIVE DESTINATION ${LIB_DIR} - LIBRARY DESTINATION ${LIB_DIR} - RUNTIME DESTINATION ${BIN_DIR} - ) - endif(STATIC_OPTS) - # For CMake-2.6.0 and above, the module files are created by # default during the library build in the bindings/f95 directory. install( Modified: trunk/bindings/f95/configurable.f90 =================================================================== --- trunk/bindings/f95/configurable.f90 2012-01-27 22:17:33 UTC (rev 12159) +++ trunk/bindings/f95/configurable.f90 2012-01-27 22:29:16 UTC (rev 12160) @@ -22,16 +22,14 @@ use plplot implicit none integer :: mode - integer :: maxargs, iargs, numargs, index, maxindex, iargc + integer :: maxargs, iargs, numargs, index, maxindex parameter(maxindex = maxlen/4) parameter (maxargs=20) character (len=maxlen) :: arg integer, dimension(maxindex, maxargs) :: iargsarr -! write(0,'(a)') 'plparseopts not implemented on this fortran'// -! & ' platform because iargc or getarg are not available' - numargs = iargc() + numargs = command_argument_count() if(numargs.lt.0) then -! This actually happened on badly linked Cygwin platform. +! This actually happened historically on a badly linked Cygwin platform. write(0,'(a)') 'plparseopts: negative number of arguments' return endif @@ -40,7 +38,7 @@ return endif do 10 iargs = 0, numargs - call getarg(iargs, arg) + call get_command_argument(iargs, arg) call plstrf2c(trim(arg), string1) s1 = transfer( string1, s1 ) do 5 index = 1, maxindex Modified: trunk/cmake/modules/TestF77CmdLine.cmake =================================================================== --- trunk/cmake/modules/TestF77CmdLine.cmake 2012-01-27 22:17:33 UTC (rev 12159) +++ trunk/cmake/modules/TestF77CmdLine.cmake 2012-01-27 22:29:16 UTC (rev 12160) @@ -51,20 +51,3 @@ "the following output:\n${OUTPUT}\n\n") ENDIF (CMAKE_F77_CMD_LINE) ENDIF(NOT DEFINED CMAKE_F77_CMD_LINE) - -# On some Windows platforms the plparseopts routine should be in a -# static library - -SET(STATIC OFF) -IF(WIN32) - IF(MINGW OR CYGWIN) - IF(BUILD_SHARED_LIBS) - SET(STATIC ON) - ENDIF(BUILD_SHARED_LIBS) - ENDIF(MINGW OR CYGWIN) -ENDIF(WIN32) -IF(STATIC) - SET(STATIC_OPTS ON CACHE BOOL "Command-line parsing in static library") -ELSE(STATIC) - SET(STATIC_OPTS OFF CACHE BOOL "Command-line parsing in static library") -ENDIF(STATIC) Modified: trunk/examples/f77/CMakeLists.txt =================================================================== --- trunk/examples/f77/CMakeLists.txt 2012-01-27 22:17:33 UTC (rev 12159) +++ trunk/examples/f77/CMakeLists.txt 2012-01-27 22:29:16 UTC (rev 12160) @@ -145,11 +145,7 @@ set_property(GLOBAL PROPERTY TARGETS_examples_f77) foreach(STRING_INDEX ${f77_STRING_INDICES}) add_executable(x${STRING_INDEX}f ${f77_directory}/x${STRING_INDEX}f.f) - if(STATIC_OPTS) - target_link_libraries(x${STRING_INDEX}f plplotf77opts${LIB_TAG} plplotf77${LIB_TAG} plplotf77c${LIB_TAG}) - else(STATIC_OPTS) - target_link_libraries(x${STRING_INDEX}f plplotf77${LIB_TAG} plplotf77c${LIB_TAG}) - endif(STATIC_OPTS) + target_link_libraries(x${STRING_INDEX}f plplotf77${LIB_TAG} plplotf77c${LIB_TAG}) add_dependencies(x${STRING_INDEX}f build_plplot_parameters_h) set_property(GLOBAL APPEND PROPERTY TARGETS_examples_f77 x${STRING_INDEX}f) endforeach(STRING_INDEX ${f77_STRING_INDICES}) Modified: trunk/examples/f95/CMakeLists.txt =================================================================== --- trunk/examples/f95/CMakeLists.txt 2012-01-27 22:17:33 UTC (rev 12159) +++ trunk/examples/f95/CMakeLists.txt 2012-01-27 22:29:16 UTC (rev 12160) @@ -140,11 +140,7 @@ x${STRING_INDEX}f95 PROPERTIES OUTPUT_NAME x${STRING_INDEX}f ) - if(STATIC_OPTS) - target_link_libraries(x${STRING_INDEX}f95 plf95demolib${LIB_TAG} plplotf95opts${LIB_TAG} plplotf95${LIB_TAG} plplotf95c${LIB_TAG}) - else(STATIC_OPTS) - target_link_libraries(x${STRING_INDEX}f95 plf95demolib${LIB_TAG} plplotf95${LIB_TAG} plplotf95c${LIB_TAG}) - endif(STATIC_OPTS) + target_link_libraries(x${STRING_INDEX}f95 plf95demolib${LIB_TAG} plplotf95${LIB_TAG} plplotf95c${LIB_TAG}) set_property(GLOBAL APPEND PROPERTY TARGETS_examples_f95 x${STRING_INDEX}f95) endforeach(STRING_INDEX ${f95_STRING_INDICES}) endif(BUILD_TEST) Modified: trunk/examples/plplot_configure.cmake_installed_examples.in =================================================================== --- trunk/examples/plplot_configure.cmake_installed_examples.in 2012-01-27 22:17:33 UTC (rev 12159) +++ trunk/examples/plplot_configure.cmake_installed_examples.in 2012-01-27 22:29:16 UTC (rev 12160) @@ -111,12 +111,10 @@ endif(ENABLE_ada) if(ENABLE_f77) - set(STATIC_OPTS @STATIC_OPTS@) set(F77_INCLUDE_DIR @F77_INCLUDE_DIR@) endif(ENABLE_f77) if(ENABLE_f95) - set(STATIC_OPTS @STATIC_OPTS@) set(F95_MOD_DIR "@F95_MOD_DIR@") endif(ENABLE_f95) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arj...@us...> - 2012-02-01 05:43:19
|
Revision: 12163 http://plplot.svn.sourceforge.net/plplot/?rev=12163&view=rev Author: arjenmarkus Date: 2012-02-01 05:43:09 +0000 (Wed, 01 Feb 2012) Log Message: ----------- Introduce a new parameter "PL_END_OF_STRING" that indicates the precise end of a string, so that in Fortran you can have proper significant trailing blanks. This affected example x20f (and it also appeared to affect example x28f, but for some mysterious reason the difference with the C example has disappeared) Note: this parameter needs to be documented still. Modified Paths: -------------- trunk/bindings/f95/sfstubsf95.f90 trunk/examples/f95/x20f.f90 Modified: trunk/bindings/f95/sfstubsf95.f90 =================================================================== --- trunk/bindings/f95/sfstubsf95.f90 2012-02-01 05:26:07 UTC (rev 12162) +++ trunk/bindings/f95/sfstubsf95.f90 2012-02-01 05:43:09 UTC (rev 12163) @@ -71,6 +71,8 @@ character (len = maxlen) :: string4, string5, string6 character (len = maxlen) :: string7, string8, string9 integer, dimension(maxleni) :: s1, s2, s3, s4, s5, s6, s7, s8, s9 + + character(len=1), parameter :: PL_END_OF_STRING = achar(0) end module module plplotp Modified: trunk/examples/f95/x20f.f90 =================================================================== --- trunk/examples/f95/x20f.f90 2012-02-01 05:26:07 UTC (rev 12162) +++ trunk/examples/f95/x20f.f90 2012-02-01 05:43:09 UTC (rev 12163) @@ -144,7 +144,7 @@ z(XDIM,i) = 1._plflt enddo - call pllab('...around a blue square.',' ', & + call pllab('...around a blue square.',' '//PL_END_OF_STRING, & 'A red border should appear...') call plimage(z, 1._plflt, XDIMR, 1._plflt, YDIMR, 0._plflt, 0._plflt, & @@ -207,9 +207,9 @@ if (.not. nointeractive) then call pllab('Set and drag Button 1 to (re)set selection, Butto'// & - 'n 2 to finish.',' ','Lena...') + 'n 2 to finish.',' '//PL_END_OF_STRING,'Lena...') else - call pllab('',' ','Lena...') + call pllab('',' '//PL_END_OF_STRING,'Lena...') endif call plimage(img_f, 1._plflt, width_r, 1._plflt, & @@ -499,9 +499,9 @@ real(kind=plflt) sx(5), sy(5) integer PLK_Return - data PLK_Return / Z'0D' / + data PLK_Return / Z'0D' / integer hex100 - data hex100 / Z'100' / + data hex100 / Z'100' / xxi = xi yyi = yi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2012-02-19 18:33:39
|
Revision: 12174 http://plplot.svn.sourceforge.net/plplot/?rev=12174&view=rev Author: airwin Date: 2012-02-19 18:33:33 +0000 (Sun, 19 Feb 2012) Log Message: ----------- Update list of Fortran 95 examples to be built for traditional (make + pkg-config) build system for installed examples. Update lists of Tcl, Tk, and Fortran 95 examples to be tested. Modified Paths: -------------- trunk/examples/f95/Makefile.examples.in trunk/examples/tcl/standard_examples.in trunk/examples/tk/standard_examples.in trunk/plplot_test/test_f95.sh.in trunk/plplot_test/test_tcl.sh.in Modified: trunk/examples/f95/Makefile.examples.in =================================================================== --- trunk/examples/f95/Makefile.examples.in 2012-02-19 18:30:56 UTC (rev 12173) +++ trunk/examples/f95/Makefile.examples.in 2012-02-19 18:33:33 UTC (rev 12174) @@ -29,6 +29,7 @@ RPATHCMD = @RPATHCMD@ EXECUTABLES_list = \ + x00f$(EXEEXT) \ x01f$(EXEEXT) \ x02f$(EXEEXT) \ x03f$(EXEEXT) \ Modified: trunk/examples/tcl/standard_examples.in =================================================================== --- trunk/examples/tcl/standard_examples.in 2012-02-19 18:30:56 UTC (rev 12173) +++ trunk/examples/tcl/standard_examples.in 2012-02-19 18:33:33 UTC (rev 12174) @@ -7,6 +7,7 @@ @pltcl_LOCATION@ $* <<EOF source tcldemos.tcl plinit +0 1 2 3 @@ -37,5 +38,6 @@ 28 29 30 +33 exit EOF Modified: trunk/examples/tk/standard_examples.in =================================================================== --- trunk/examples/tk/standard_examples.in 2012-02-19 18:30:56 UTC (rev 12173) +++ trunk/examples/tk/standard_examples.in 2012-02-19 18:33:33 UTC (rev 12174) @@ -8,6 +8,7 @@ # \ @plserver_LOCATION@ <<EOF source tkdemos.tcl +0 1 2 3 @@ -37,5 +38,6 @@ 28 29 30 +33 exit EOF Modified: trunk/plplot_test/test_f95.sh.in =================================================================== --- trunk/plplot_test/test_f95.sh.in 2012-02-19 18:30:56 UTC (rev 12173) +++ trunk/plplot_test/test_f95.sh.in 2012-02-19 18:33:33 UTC (rev 12174) @@ -56,7 +56,7 @@ # Do the standard non-interactive examples. - for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33; do + for index in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33; do if [ "$verbose_test" ] ; then echo "x${index}f" fi @@ -108,7 +108,7 @@ # Do the standard non-interactive examples. - for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33; do + for index in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33; do if [ "$verbose_test" ] ; then echo "x${index}f" fi Modified: trunk/plplot_test/test_tcl.sh.in =================================================================== --- trunk/plplot_test/test_tcl.sh.in 2012-02-19 18:30:56 UTC (rev 12173) +++ trunk/plplot_test/test_tcl.sh.in 2012-02-19 18:33:33 UTC (rev 12174) @@ -76,7 +76,7 @@ if [ -n "$is_error" ] ; then exit 1 fi -for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33; do +for index in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33; do if [ "$verbose_test" ] ; then echo "x${index}" fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2012-02-24 23:07:18
|
Revision: 12177 http://plplot.svn.sourceforge.net/plplot/?rev=12177&view=rev Author: andrewross Date: 2012-02-24 23:07:11 +0000 (Fri, 24 Feb 2012) Log Message: ----------- Implement the new trivial example 00 in the remaining languages and include it in the standard tests. This produces clean results on my Ubuntu 64-bit system. Modified Paths: -------------- trunk/examples/ada/CMakeLists.txt trunk/examples/c++/CMakeLists.txt trunk/examples/d/CMakeLists.txt trunk/examples/java/CMakeLists.txt trunk/examples/lua/CMakeLists.txt trunk/examples/ocaml/CMakeLists.txt trunk/examples/octave/CMakeLists.txt trunk/examples/python/CMakeLists.txt trunk/examples/tcl/x00 trunk/plplot_test/test_ada.sh.in trunk/plplot_test/test_cxx.sh.in trunk/plplot_test/test_d.sh.in trunk/plplot_test/test_java.sh.in trunk/plplot_test/test_lua.sh.in trunk/plplot_test/test_ocaml.sh.in trunk/plplot_test/test_octave.sh.in trunk/plplot_test/test_python.sh.in Added Paths: ----------- trunk/examples/c++/x00.cc trunk/examples/d/x00d.d trunk/examples/java/x00.java trunk/examples/ocaml/x00.ml trunk/examples/octave/x00c.m trunk/examples/python/x00 trunk/examples/python/xw00.py Modified: trunk/examples/ada/CMakeLists.txt =================================================================== --- trunk/examples/ada/CMakeLists.txt 2012-02-24 20:33:39 UTC (rev 12176) +++ trunk/examples/ada/CMakeLists.txt 2012-02-24 23:07:11 UTC (rev 12177) @@ -25,6 +25,7 @@ # BUILD_TEST ON and CORE_BUILD OFF. set(ada_STRING_INDICES + "00" "01" "02" "03" @@ -57,6 +58,7 @@ "30" "31" "33" + "thick00" "thick01" "thick02" "thick03" Modified: trunk/examples/c++/CMakeLists.txt =================================================================== --- trunk/examples/c++/CMakeLists.txt 2012-02-24 20:33:39 UTC (rev 12176) +++ trunk/examples/c++/CMakeLists.txt 2012-02-24 23:07:11 UTC (rev 12177) @@ -27,6 +27,7 @@ set(cxx_STRING_INDICES "01cc" + "00" "01" "02" "03" Added: trunk/examples/c++/x00.cc =================================================================== --- trunk/examples/c++/x00.cc (rev 0) +++ trunk/examples/c++/x00.cc 2012-02-24 23:07:11 UTC (rev 12177) @@ -0,0 +1,88 @@ +// $Id:$ +// +// Simple demo of a 2D line plot. +// +// Copyright (C) 2011 Alan W. Irwin +// Copyright (C) 2012 Andrew Ross +// +// This file is part of PLplot. +// +// PLplot is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License as published +// by the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// PLplot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public License +// along with PLplot; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// + +#include "plc++demos.h" + +#ifdef PL_USE_NAMESPACE +using namespace std; +#endif + +class x00 { +public: + x00( int, const char **); + +private: + // Class data + plstream *pls; + + static const int NSIZE; +}; + +const int x00::NSIZE = 101; + +x00::x00( int argc, const char **argv ) +{ + PLFLT x[NSIZE], y[NSIZE]; + PLFLT xmin = 0., xmax = 1., ymin = 0., ymax = 100.; + int i; + + // Prepare data to be plotted. + for ( i = 0; i < NSIZE; i++ ) + { + x[i] = (PLFLT) ( i ) / (PLFLT) ( NSIZE - 1 ); + y[i] = ymax * x[i] * x[i]; + } + + pls = new plstream(); + + // Parse and process command line arguments + pls->parseopts( &argc, argv, PL_PARSE_FULL ); + + // Initialize plplot + pls->init(); + + // Create a labelled box to hold the plot. + pls->env( xmin, xmax, ymin, ymax, 0, 0 ); + pls->lab( "x", "y=100 x#u2#d", "Simple PLplot demo of a 2D line plot" ); + + // Plot the data that was prepared above. + pls->line( NSIZE, x, y ); + + + // In C++ we don't call plend() to close PLplot library + // this is handled by the destructor + delete pls; +} + +int main( int argc, const char ** argv ) +{ + x00 *x = new x00( argc, argv ); + delete x; +} + + +//-------------------------------------------------------------------------- +// End of x00.cc +//-------------------------------------------------------------------------- Modified: trunk/examples/d/CMakeLists.txt =================================================================== --- trunk/examples/d/CMakeLists.txt 2012-02-24 20:33:39 UTC (rev 12176) +++ trunk/examples/d/CMakeLists.txt 2012-02-24 23:07:11 UTC (rev 12177) @@ -26,6 +26,7 @@ # BUILD_TEST ON and CORE_BUILD OFF. set(d_STRING_INDICES + "00" "01" "02" "03" Added: trunk/examples/d/x00d.d =================================================================== --- trunk/examples/d/x00d.d (rev 0) +++ trunk/examples/d/x00d.d 2012-02-24 23:07:11 UTC (rev 12177) @@ -0,0 +1,61 @@ +// $Id:$ +// +// Simple demo of a 2D line plot. +// +// Copyright (C) 2011 Alan W. Irwin +// Copyright (C) 2012 Andrew Ross +// +// This file is part of PLplot. +// +// PLplot is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License as published +// by the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// PLplot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public License +// along with PLplot; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// + +import plplot; + +int main( char[][] args ) +{ + const int nsize = 101; + + PLFLT[nsize] x; + PLFLT[nsize] y; + PLFLT xmin = 0., xmax = 1., ymin = 0., ymax = 100.; + int i; + + // Prepare data to be plotted. + for ( i = 0; i < nsize; i++ ) + { + x[i] = cast(PLFLT) ( i ) / cast(PLFLT) ( nsize - 1 ); + y[i] = ymax * x[i] * x[i]; + } + + // Parse and process command line arguments + plparseopts( args, PL_PARSE_FULL ); + + // Initialize plplot + plinit(); + + // Create a labelled box to hold the plot. + plenv( xmin, xmax, ymin, ymax, 0, 0 ); + pllab( "x", "y=100 x#u2#d", "Simple PLplot demo of a 2D line plot" ); + + // Plot the data that was prepared above. + plline( x, y ); + + // Close PLplot library + plend(); + + return 0; +} Modified: trunk/examples/java/CMakeLists.txt =================================================================== --- trunk/examples/java/CMakeLists.txt 2012-02-24 20:33:39 UTC (rev 12176) +++ trunk/examples/java/CMakeLists.txt 2012-02-24 23:07:11 UTC (rev 12177) @@ -25,6 +25,7 @@ # BUILD_TEST ON and CORE_BUILD OFF. set(java_STRING_INDICES + "00" "01" "02" "03" Added: trunk/examples/java/x00.java =================================================================== --- trunk/examples/java/x00.java (rev 0) +++ trunk/examples/java/x00.java 2012-02-24 23:07:11 UTC (rev 12177) @@ -0,0 +1,75 @@ +// $Id:$ +// +// Simple demo of a 2D line plot. +// +// Copyright (C) 2011 Alan W. Irwin +// Copyright (C) 2012 Andrew Ross +// +// This file is part of PLplot. +// +// PLplot is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License as published +// by the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// PLplot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public License +// along with PLplot; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// + +package plplot.examples; + +import plplot.core.*; + +class x00 { + + PLStream pls = new PLStream(); + + static int NSIZE = 101; + + public static void main( String[] args ) + { + new x00( args ); + } + + public x00( String[] args ) + { + double x[] = new double[NSIZE]; + double y[] = new double[NSIZE]; + double xmin = 0., xmax = 1., ymin = 0., ymax = 100.; + int i; + + // Prepare data to be plotted. + for ( i = 0; i < NSIZE; i++ ) + { + x[i] = (double)( i ) / (double) ( NSIZE - 1 ); + y[i] = ymax * x[i] * x[i]; + } + + // Parse and process command line arguments + pls.parseopts( args, PLStream.PL_PARSE_FULL | PLStream.PL_PARSE_NOPROGRAM ); + // Initialize plplot + pls.init(); + + // Create a labelled box to hold the plot. + pls.env( xmin, xmax, ymin, ymax, 0, 0 ); + pls.lab( "x", "y=100 x#u2#d", "Simple PLplot demo of a 2D line plot" ); + + // Plot the data that was prepared above. + pls.line( x, y ); + + // Close PLplot library + pls.end(); + } +} + + +//-------------------------------------------------------------------------- +// End of x00.java +//-------------------------------------------------------------------------- Modified: trunk/examples/lua/CMakeLists.txt =================================================================== --- trunk/examples/lua/CMakeLists.txt 2012-02-24 20:33:39 UTC (rev 12176) +++ trunk/examples/lua/CMakeLists.txt 2012-02-24 23:07:11 UTC (rev 12177) @@ -25,6 +25,7 @@ # BUILD_TEST ON and CORE_BUILD OFF. set(lua_STRING_INDICES + "00" "01" "02" "03" Modified: trunk/examples/ocaml/CMakeLists.txt =================================================================== --- trunk/examples/ocaml/CMakeLists.txt 2012-02-24 20:33:39 UTC (rev 12176) +++ trunk/examples/ocaml/CMakeLists.txt 2012-02-24 23:07:11 UTC (rev 12177) @@ -29,6 +29,7 @@ # BUILD_TEST ON and CORE_BUILD OFF. set(ocaml_STRING_INDICES + "00" "01" "02" "03" Added: trunk/examples/ocaml/x00.ml =================================================================== --- trunk/examples/ocaml/x00.ml (rev 0) +++ trunk/examples/ocaml/x00.ml 2012-02-24 23:07:11 UTC (rev 12177) @@ -0,0 +1,55 @@ +(* $Id:$ + + Simple demo of a 2D line plot. + + Copyright (C) 2011 Alan W. Irwin + + This file is part of PLplot. + + PLplot is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + PLplot is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with PLplot; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +*) + +open Plplot + +let nsize = 101 + +let () = + let xmin = 0.0; + let xmax = 1.0; + let ymin = 0.0; + let ymax = 100.0; + + (* Prepare data to be plotted. *) + let x = Array.init nsize (fun i -> float_of_int i /. ( float_of_int nsize -. 1.0)) in + let y = Array.init nsize (fun i -> ymax *. x.(i) *. x.(i) ) in + + (* Parse and process command line arguments *) + plparseopts Sys.argv [PL_PARSE_FULL]; + + (* Initialize plplot *) + plinit (); + + (* Create a labelled box to hold the plot. *) + plenv xmin xmax ymin ymax 0 0 ; + pllab "x" "y=100 x#u2#d" "Simple PLplot demo of a 2D line plot" ; + + (* Plot the data that was prepared above. *) + plline x y; + + (* Close PLplot library *) + plend (); + () + Modified: trunk/examples/octave/CMakeLists.txt =================================================================== --- trunk/examples/octave/CMakeLists.txt 2012-02-24 20:33:39 UTC (rev 12176) +++ trunk/examples/octave/CMakeLists.txt 2012-02-24 23:07:11 UTC (rev 12177) @@ -47,6 +47,7 @@ p19.m p20.m p21.m + x00c.m x01c.m x02c.m x03c.m Added: trunk/examples/octave/x00c.m =================================================================== --- trunk/examples/octave/x00c.m (rev 0) +++ trunk/examples/octave/x00c.m 2012-02-24 23:07:11 UTC (rev 12177) @@ -0,0 +1,52 @@ +## $Id: x00c.c 12001 2011-10-27 05:26:31Z airwin $ +## +## Simple demo of a 2D line plot. +## +## Copyright (C) 2011 Alan W. Irwin +## Copyright (C) 2012 Andrew Ross +## +## This file is part of PLplot. +## +## PLplot is free software; you can redistribute it and/or modify +## it under the terms of the GNU Library General Public License as published +## by the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## PLplot is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU Library General Public License for more details. +## +## You should have received a copy of the GNU Library General Public License +## along with PLplot; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +## +## + +function x00c + + NSIZE = 101; + + xmin = 0.; xmax = 1.; ymin = 0.; ymax = 100.; + + ## Prepare data to be plotted. + x = (0:NSIZE-1) / (NSIZE-1); + y = ymax*x.*x; + + ## Parse and process command line arguments + ## plparseopts( &argc, argv, PL_PARSE_FULL ); + + ## Initialize plplot + plinit(); + + ## Create a labelled box to hold the plot. + plenv( xmin, xmax, ymin, ymax, 0, 0 ); + pllab( "x", "y=100 x#u2#d", "Simple PLplot demo of a 2D line plot" ); + + ## Plot the data that was prepared above. + plline( x', y' ); + + ## Close PLplot library + plend1(); + +endfunction Modified: trunk/examples/python/CMakeLists.txt =================================================================== --- trunk/examples/python/CMakeLists.txt 2012-02-24 20:33:39 UTC (rev 12176) +++ trunk/examples/python/CMakeLists.txt 2012-02-24 23:07:11 UTC (rev 12177) @@ -27,6 +27,7 @@ # N.B. examples 14, 17, and 31 handled independently while 32 has # not yet been implemented. set(python_STRING_INDICES + "00" "01" "02" "03" @@ -313,4 +314,4 @@ add_dependencies(plplot_logo _plplotcmodule) endif(CORE_BUILD) -endif(BUILD_TEST) \ No newline at end of file +endif(BUILD_TEST) Added: trunk/examples/python/x00 =================================================================== --- trunk/examples/python/x00 (rev 0) +++ trunk/examples/python/x00 2012-02-24 23:07:11 UTC (rev 12177) @@ -0,0 +1,40 @@ +#!/usr/bin/env python + +# Copyright (C) 2004 Alan W. Irwin +# Copyright (C) 2004 Andrew Ross +# +# This file is part of PLplot. +# +# PLplot is free software; you can redistribute it and/or modify +# it under the terms of the GNU Library General Public License as published +# by the Free Software Foundation; version 2 of the License. +# +# PLplot is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public License +# along with the file PLplot; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + +# Run all python plplot examples non-interactively. + +# Append to effective python path so that can find plplot modules. +from plplot_python_start import * + +import sys +from plplot import * + +# Parse and process command line arguments +plparseopts(sys.argv, PL_PARSE_FULL) + +# Initialize plplot +plinit() + +import xw00 + +# Terminate plplot +plend() + Property changes on: trunk/examples/python/x00 ___________________________________________________________________ Added: svn:executable + * Added: trunk/examples/python/xw00.py =================================================================== --- trunk/examples/python/xw00.py (rev 0) +++ trunk/examples/python/xw00.py 2012-02-24 23:07:11 UTC (rev 12177) @@ -0,0 +1,47 @@ +# $Id:$ +# +# Simple demo of a 2D line plot. +# +# Copyright (C) 2011 Alan W. Irwin +# Copyright (C) 2012 Andrew Ross +# +# This file is part of PLplot. +# +# PLplot is free software; you can redistribute it and/or modify +# it under the terms of the GNU Library General Public License as published +# by the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# PLplot is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public License +# along with PLplot; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# + +from plplot_py_demos import * + +NSIZE = 101 + +def main(): + xmin = 0. + xmax = 1. + ymin = 0. + ymax = 100. + + # Prepare data to be plotted. + x = arange(NSIZE) / float( NSIZE - 1 ) + y = ymax*x**2 + + # Create a labelled box to hold the plot. + plenv( xmin, xmax, ymin, ymax, 0, 0 ) + pllab( "x", "y=100 x#u2#d", "Simple PLplot demo of a 2D line plot" ) + + # Plot the data that was prepared above. + plline( x, y ) + +main() Modified: trunk/examples/tcl/x00 =================================================================== --- trunk/examples/tcl/x00 2012-02-24 20:33:39 UTC (rev 12176) +++ trunk/examples/tcl/x00 2012-02-24 23:07:11 UTC (rev 12177) @@ -14,9 +14,6 @@ source x00.tcl -plgver ver -puts [format "PLplot library version: %s" $ver ] - plinit x00 plend Modified: trunk/plplot_test/test_ada.sh.in =================================================================== --- trunk/plplot_test/test_ada.sh.in 2012-02-24 20:33:39 UTC (rev 12176) +++ trunk/plplot_test/test_ada.sh.in 2012-02-24 23:07:11 UTC (rev 12177) @@ -30,10 +30,10 @@ # Skip 17 because it is interactive. lang="a" for index in \ - 01 02 03 04 05 06 07 08 09 \ + 00 01 02 03 04 05 06 07 08 09 \ 10 11 12 13 14 15 16 17 18 19 20 \ 21 22 23 24 25 26 27 28 29 30 31 33 \ - thick01 thick02 thick03 thick04 thick05 thick06 thick07 thick08 thick09 \ + thick00 thick01 thick02 thick03 thick04 thick05 thick06 thick07 thick08 thick09 \ thick10 thick11 thick12 thick13 thick14 thick15 thick16 thick17 thick18 thick19 thick20 \ thick21 thick22 thick23 thick24 thick25 thick26 thick27 thick28 thick29 thick30 thick31 thick33; do if [ "$verbose_test" ] ; then Modified: trunk/plplot_test/test_cxx.sh.in =================================================================== --- trunk/plplot_test/test_cxx.sh.in 2012-02-24 20:33:39 UTC (rev 12176) +++ trunk/plplot_test/test_cxx.sh.in 2012-02-24 23:07:11 UTC (rev 12177) @@ -31,7 +31,7 @@ export index lang # Do the standard non-interactive examples. -for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 15 16 18 19 20 \ +for index in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 15 16 18 19 20 \ 21 22 23 24 25 26 27 28 30 31 33 ${critical_examples}; do if [ "$verbose_test" ] ; then echo "x${index}" Modified: trunk/plplot_test/test_d.sh.in =================================================================== --- trunk/plplot_test/test_d.sh.in 2012-02-24 20:33:39 UTC (rev 12176) +++ trunk/plplot_test/test_d.sh.in 2012-02-24 23:07:11 UTC (rev 12177) @@ -31,7 +31,7 @@ # 20-22, 28, and 31 not implemented yet. # example 14 excluded until plgdev fixed since the bad driver information # causes run-time errors. -for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33; do +for index in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33; do if [ "$verbose_test" ] ; then echo "x${index}${lang}" fi Modified: trunk/plplot_test/test_java.sh.in =================================================================== --- trunk/plplot_test/test_java.sh.in 2012-02-24 20:33:39 UTC (rev 12176) +++ trunk/plplot_test/test_java.sh.in 2012-02-24 23:07:11 UTC (rev 12177) @@ -44,7 +44,7 @@ PLPLOT_CLASSPATH="${javadir}":"${PLPLOT_CLASSPATH}" fi -for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33 ; do +for index in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33 ; do if [ "$verbose_test" ] ; then echo "x${index}" fi Modified: trunk/plplot_test/test_lua.sh.in =================================================================== --- trunk/plplot_test/test_lua.sh.in 2012-02-24 20:33:39 UTC (rev 12176) +++ trunk/plplot_test/test_lua.sh.in 2012-02-24 23:07:11 UTC (rev 12177) @@ -32,7 +32,7 @@ results="$(pwd |sed 's?^/\(.\)/?\1:/?')" export results cd "$luadir" -for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33; do +for index in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33; do if [ "$verbose_test" ] ; then echo "x${index}" fi Modified: trunk/plplot_test/test_ocaml.sh.in =================================================================== --- trunk/plplot_test/test_ocaml.sh.in 2012-02-24 20:33:39 UTC (rev 12176) +++ trunk/plplot_test/test_ocaml.sh.in 2012-02-24 23:07:11 UTC (rev 12177) @@ -24,7 +24,7 @@ # Do the standard non-interactive examples. lang="ocaml" -for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33; do +for index in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33; do if [ "$verbose_test" ] ; then echo "x${index}ocaml" fi Modified: trunk/plplot_test/test_octave.sh.in =================================================================== --- trunk/plplot_test/test_octave.sh.in 2012-02-24 20:33:39 UTC (rev 12176) +++ trunk/plplot_test/test_octave.sh.in 2012-02-24 23:07:11 UTC (rev 12177) @@ -73,10 +73,10 @@ # Example 32 not implemented because there has been no call for propagation # and it exercises no new API. failed = [] ; -@swig_octave_comment@for i=[1:18 19 20:31 33] ; +@swig_octave_comment@for i=[0:18 19 20:31 33] ; # Drop 4, 18, 26, and 33 because deprecated matwrap does not include plstring, # plstring3, pllegend, or plcolorbar. -@matwrap_octave_comment@for i=[1:3 5:17 20:25 27:31 ] ; +@matwrap_octave_comment@for i=[0:3 5:17 20:25 27:31 ] ; ofile = sprintf("${OUTPUT_DIR}/x%.2d${lang}_${dsuffix}.txt",i); strm = fopen(ofile,"w"); cmd = sprintf("x%.2dc",i); Modified: trunk/plplot_test/test_python.sh.in =================================================================== --- trunk/plplot_test/test_python.sh.in 2012-02-24 20:33:39 UTC (rev 12176) +++ trunk/plplot_test/test_python.sh.in 2012-02-24 23:07:11 UTC (rev 12177) @@ -29,7 +29,7 @@ # Skip 21 if using Numeric - it doesn't work # For 24 you need special fonts installed to get good result. lang="p" -for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 \ +for index in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 \ 20 22 23 24 25 26 27 28 29 30 31 33 @NUMPY_EXAMPLES@ ; do if [ "$verbose_test" ] ; then echo "x${index}" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2012-07-06 20:54:47
|
Revision: 12197 http://plplot.svn.sourceforge.net/plplot/?rev=12197&view=rev Author: airwin Date: 2012-07-06 20:54:41 +0000 (Fri, 06 Jul 2012) Log Message: ----------- Style previous commits. Modified Paths: -------------- trunk/drivers/wxwidgets.cpp trunk/drivers/wxwidgets_agg.cpp trunk/examples/c++/x00.cc trunk/examples/d/x21d.d trunk/examples/java/x00.java trunk/examples/java/x21.java Modified: trunk/drivers/wxwidgets.cpp =================================================================== --- trunk/drivers/wxwidgets.cpp 2012-07-04 20:33:40 UTC (rev 12196) +++ trunk/drivers/wxwidgets.cpp 2012-07-06 20:54:41 UTC (rev 12197) @@ -250,8 +250,8 @@ if ( ucs4[i] != (PLUNICODE) plplotEsc ) // a character to display { ucs4_to_utf8( ucs4[i], utf8 ); - strncat( utf8_string, utf8, - sizeof( utf8_string ) - strlen( utf8_string ) - 1 ); + strncat( utf8_string, utf8, + sizeof ( utf8_string ) - strlen( utf8_string ) - 1 ); i++; continue; } @@ -259,8 +259,8 @@ if ( ucs4[i] == (PLUNICODE) plplotEsc ) // a escape character to display { ucs4_to_utf8( ucs4[i], utf8 ); - strncat( utf8_string, utf8, - sizeof( utf8_string ) - strlen( utf8_string ) - 1 ); + strncat( utf8_string, utf8, + sizeof ( utf8_string ) - strlen( utf8_string ) - 1 ); i++; continue; } Modified: trunk/drivers/wxwidgets_agg.cpp =================================================================== --- trunk/drivers/wxwidgets_agg.cpp 2012-07-04 20:33:40 UTC (rev 12196) +++ trunk/drivers/wxwidgets_agg.cpp 2012-07-06 20:54:41 UTC (rev 12197) @@ -493,7 +493,7 @@ //size_t len=wxConvUTF8.ToWChar( str, 512, utf8_string ); size_t len = strlen( utf8_string ); char * str = utf8_string; - printf( "len=%lu\n", ( unsigned long ) len ); + printf( "len=%lu\n", (unsigned long) len ); const agg::glyph_cache* glyph; if ( !drawText ) Modified: trunk/examples/c++/x00.cc =================================================================== --- trunk/examples/c++/x00.cc 2012-07-04 20:33:40 UTC (rev 12196) +++ trunk/examples/c++/x00.cc 2012-07-06 20:54:41 UTC (rev 12197) @@ -31,17 +31,17 @@ class x00 { public: - x00( int, const char **); + x00( int, const char ** ); private: // Class data - plstream *pls; + plstream *pls; static const int NSIZE; }; const int x00::NSIZE = 101; - + x00::x00( int argc, const char **argv ) { PLFLT x[NSIZE], y[NSIZE]; @@ -54,9 +54,9 @@ x[i] = (PLFLT) ( i ) / (PLFLT) ( NSIZE - 1 ); y[i] = ymax * x[i] * x[i]; } - + pls = new plstream(); - + // Parse and process command line arguments pls->parseopts( &argc, argv, PL_PARSE_FULL ); Modified: trunk/examples/d/x21d.d =================================================================== --- trunk/examples/d/x21d.d 2012-07-04 20:33:40 UTC (rev 12196) +++ trunk/examples/d/x21d.d 2012-07-06 20:54:41 UTC (rev 12197) @@ -95,7 +95,7 @@ plenv( xm, xM, ym, yM, 2, 0 ); plcol0( 15 ); pllab( "X", "Y", "The original data sampling" ); - for ( int i = 0; i < pts ; i++ ) + for ( int i = 0; i < pts; i++ ) { plcol1( ( z[i] - zmin ) / ( zmax - zmin ) ); xx[0] = x[i]; Modified: trunk/examples/java/x00.java =================================================================== --- trunk/examples/java/x00.java 2012-07-04 20:33:40 UTC (rev 12196) +++ trunk/examples/java/x00.java 2012-07-06 20:54:41 UTC (rev 12197) @@ -28,11 +28,10 @@ import plplot.core.*; class x00 { + PLStream pls = new PLStream(); - PLStream pls = new PLStream(); - static int NSIZE = 101; - + public static void main( String[] args ) { new x00( args ); @@ -40,32 +39,32 @@ public x00( String[] args ) { - double x[] = new double[NSIZE]; - double y[] = new double[NSIZE]; - double xmin = 0., xmax = 1., ymin = 0., ymax = 100.; - int i; + double x[] = new double[NSIZE]; + double y[] = new double[NSIZE]; + double xmin = 0., xmax = 1., ymin = 0., ymax = 100.; + int i; - // Prepare data to be plotted. - for ( i = 0; i < NSIZE; i++ ) - { - x[i] = (double)( i ) / (double) ( NSIZE - 1 ); - y[i] = ymax * x[i] * x[i]; - } - - // Parse and process command line arguments - pls.parseopts( args, PLStream.PL_PARSE_FULL | PLStream.PL_PARSE_NOPROGRAM ); - // Initialize plplot - pls.init(); - - // Create a labelled box to hold the plot. - pls.env( xmin, xmax, ymin, ymax, 0, 0 ); - pls.lab( "x", "y=100 x#u2#d", "Simple PLplot demo of a 2D line plot" ); + // Prepare data to be plotted. + for ( i = 0; i < NSIZE; i++ ) + { + x[i] = (double) ( i ) / (double) ( NSIZE - 1 ); + y[i] = ymax * x[i] * x[i]; + } - // Plot the data that was prepared above. - pls.line( x, y ); + // Parse and process command line arguments + pls.parseopts( args, PLStream.PL_PARSE_FULL | PLStream.PL_PARSE_NOPROGRAM ); + // Initialize plplot + pls.init(); - // Close PLplot library - pls.end(); + // Create a labelled box to hold the plot. + pls.env( xmin, xmax, ymin, ymax, 0, 0 ); + pls.lab( "x", "y=100 x#u2#d", "Simple PLplot demo of a 2D line plot" ); + + // Plot the data that was prepared above. + pls.line( x, y ); + + // Close PLplot library + pls.end(); } } Modified: trunk/examples/java/x21.java =================================================================== --- trunk/examples/java/x21.java 2012-07-04 20:33:40 UTC (rev 12196) +++ trunk/examples/java/x21.java 2012-07-06 20:54:41 UTC (rev 12197) @@ -134,7 +134,7 @@ double x[], y[], z[], clev[]; double xg[], yg[], zg[][]; double xg0[][], yg0[][]; - double xx[], yy[]; + double xx[], yy[]; double zmin, zmax, lzm[], lzM[]; int i, j, k; int alg; @@ -167,11 +167,11 @@ pls.seed( 5489 ); - x = new double[pts]; - y = new double[pts]; - z = new double[pts]; - xx = new double[1]; - yy = new double[1]; + x = new double[pts]; + y = new double[pts]; + z = new double[pts]; + xx = new double[1]; + yy = new double[1]; create_data( x, y, z ); // the sampled data zmin = z[0]; @@ -208,23 +208,24 @@ pls.env( xm, xM, ym, yM, 2, 0 ); pls.col0( 15 ); pls.lab( "X", "Y", "The original data sampling" ); - for ( i = 0; i < pts ; i++ ) { - pls.col1( ( z[i] - zmin ) / ( zmax - zmin ) ); - // The following plstring call should be the the equivalent of - // plpoin( 1, &x[i], &y[i], 5 ); Use plstring because it is - // not deprecated like plpoin and has much more powerful - // capabilities. N.B. symbol 141 works for Hershey devices - // (e.g., -dev xwin) only if plfontld( 0 ) has been called - // while symbol 727 works only if plfontld( 1 ) has been - // called. The latter is the default which is why we use 727 - // here to represent a centred X (multiplication) symbol. - // This dependence on plfontld is one of the limitations of - // the Hershey escapes for PLplot, but the upside is you get - // reasonable results for both Hershey and Unicode devices. - xx[0] = x[i]; - yy[0] = y[i]; - pls.string( xx, yy, "#(727)" ); - } + for ( i = 0; i < pts; i++ ) + { + pls.col1( ( z[i] - zmin ) / ( zmax - zmin ) ); + // The following plstring call should be the the equivalent of + // plpoin( 1, &x[i], &y[i], 5 ); Use plstring because it is + // not deprecated like plpoin and has much more powerful + // capabilities. N.B. symbol 141 works for Hershey devices + // (e.g., -dev xwin) only if plfontld( 0 ) has been called + // while symbol 727 works only if plfontld( 1 ) has been + // called. The latter is the default which is why we use 727 + // here to represent a centred X (multiplication) symbol. + // This dependence on plfontld is one of the limitations of + // the Hershey escapes for PLplot, but the upside is you get + // reasonable results for both Hershey and Unicode devices. + xx[0] = x[i]; + yy[0] = y[i]; + pls.string( xx, yy, "#(727)" ); + } pls.adv( 0 ); pls.ssub( 3, 2 ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2012-08-13 21:02:43
|
Revision: 12207 http://plplot.svn.sourceforge.net/plplot/?rev=12207&view=rev Author: airwin Date: 2012-08-13 21:02:37 +0000 (Mon, 13 Aug 2012) Log Message: ----------- rev ==> alt_hue_path in the PLControlPt struct and its examplar, plsc->cmap1cp[n]. Modified Paths: -------------- trunk/bindings/ada/plplot_thin.ads trunk/bindings/d/plplot.d trunk/bindings/octave/plplot_octave.h.in trunk/bindings/tk/plframe.c trunk/bindings/tk/plr.c trunk/bindings/tk-x-plat/plplotter.c trunk/drivers/tk.c trunk/include/plplot.h trunk/src/plctrl.c Modified: trunk/bindings/ada/plplot_thin.ads =================================================================== --- trunk/bindings/ada/plplot_thin.ads 2012-08-13 20:27:59 UTC (rev 12206) +++ trunk/bindings/ada/plplot_thin.ads 2012-08-13 21:02:37 UTC (rev 12207) @@ -468,7 +468,7 @@ l : PLFLT; -- lightness s : PLFLT; -- saturation p : PLFLT; -- position - rev : Integer; -- if set, interpolate through h=0 + alt_hue_path : Integer; -- if set, interpolate through h=0 end record; -- A PLBufferingCB is a control block for interacting with devices Modified: trunk/bindings/d/plplot.d =================================================================== --- trunk/bindings/d/plplot.d 2012-08-13 20:27:59 UTC (rev 12206) +++ trunk/bindings/d/plplot.d 2012-08-13 21:02:37 UTC (rev 12207) @@ -1240,7 +1240,7 @@ PLFLT s; PLFLT p; PLFLT a; - int rev; + int alt_hue_path; } alias _N10 PLControlPt; Modified: trunk/bindings/octave/plplot_octave.h.in =================================================================== --- trunk/bindings/octave/plplot_octave.h.in 2012-08-13 20:27:59 UTC (rev 12206) +++ trunk/bindings/octave/plplot_octave.h.in 2012-08-13 21:02:37 UTC (rev 12207) @@ -361,7 +361,7 @@ PLFLT l; // lightness PLFLT s; // saturation PLFLT p; // position - int rev; // if set, interpolate through h=0 + int alt_hue_path; // if set, interpolate through h=0 } PLControlPt; // A PLBufferingCB is a control block for interacting with devices Modified: trunk/bindings/tk/plframe.c =================================================================== --- trunk/bindings/tk/plframe.c 2012-08-13 20:27:59 UTC (rev 12206) +++ trunk/bindings/tk/plframe.c 2012-08-13 21:02:37 UTC (rev 12207) @@ -1897,13 +1897,13 @@ ( pls->cmap1cp[i].l != l ) || ( pls->cmap1cp[i].s != s ) || ( pls->cmap1cp[i].p != p ) || - ( pls->cmap1cp[i].rev != reverse ) ) + ( pls->cmap1cp[i].alt_hue_path != reverse ) ) { pls->cmap1cp[i].h = h; pls->cmap1cp[i].l = l; pls->cmap1cp[i].s = s; pls->cmap1cp[i].p = p; - pls->cmap1cp[i].rev = reverse; + pls->cmap1cp[i].alt_hue_path = reverse; *p_changed = 1; } return TCL_OK; @@ -2023,7 +2023,7 @@ sprintf( str, "%02d", (int) ( 100 * pls->cmap1cp[i].p ) ); Tcl_AppendElement( interp, str ); - sprintf( str, "%01d", (int) ( pls->cmap1cp[i].rev ) ); + sprintf( str, "%01d", (int) ( pls->cmap1cp[i].alt_hue_path ) ); Tcl_AppendElement( interp, str ); } result = TCL_OK; Modified: trunk/bindings/tk/plr.c =================================================================== --- trunk/bindings/tk/plr.c 2012-08-13 20:27:59 UTC (rev 12206) +++ trunk/bindings/tk/plr.c 2012-08-13 21:02:37 UTC (rev 12207) @@ -508,7 +508,7 @@ plsc->cmap1cp[i].h = h; plsc->cmap1cp[i].l = l; plsc->cmap1cp[i].s = s; - plsc->cmap1cp[i].rev = rev; + plsc->cmap1cp[i].alt_hue_path = rev; } plP_state( PLSTATE_CMAP1 ); break; Modified: trunk/bindings/tk-x-plat/plplotter.c =================================================================== --- trunk/bindings/tk-x-plat/plplotter.c 2012-08-13 20:27:59 UTC (rev 12206) +++ trunk/bindings/tk-x-plat/plplotter.c 2012-08-13 21:02:37 UTC (rev 12207) @@ -1692,13 +1692,13 @@ ( pls->cmap1cp[i].l != l ) || ( pls->cmap1cp[i].s != s ) || ( pls->cmap1cp[i].p != p ) || - ( pls->cmap1cp[i].rev != reverse ) ) + ( pls->cmap1cp[i].alt_hue_path != reverse ) ) { pls->cmap1cp[i].h = h; pls->cmap1cp[i].l = l; pls->cmap1cp[i].s = s; pls->cmap1cp[i].p = p; - pls->cmap1cp[i].rev = reverse; + pls->cmap1cp[i].alt_hue_path = reverse; *p_changed = 1; } return TCL_OK; @@ -1812,7 +1812,7 @@ sprintf( str, "%02d", (int) ( 100 * pls->cmap1cp[i].p ) ); Tcl_AppendElement( interp, str ); - sprintf( str, "%01d", (int) ( pls->cmap1cp[i].rev ) ); + sprintf( str, "%01d", (int) ( pls->cmap1cp[i].alt_hue_path ) ); Tcl_AppendElement( interp, str ); } result = TCL_OK; Modified: trunk/drivers/tk.c =================================================================== --- trunk/drivers/tk.c 2012-08-13 20:27:59 UTC (rev 12206) +++ trunk/drivers/tk.c 2012-08-13 21:02:37 UTC (rev 12207) @@ -521,7 +521,7 @@ tk_wr( pdf_wr_ieeef( pls->pdfs, (float) pls->cmap1cp[i].h ) ); tk_wr( pdf_wr_ieeef( pls->pdfs, (float) pls->cmap1cp[i].l ) ); tk_wr( pdf_wr_ieeef( pls->pdfs, (float) pls->cmap1cp[i].s ) ); - tk_wr( pdf_wr_1byte( pls->pdfs, (U_CHAR) pls->cmap1cp[i].rev ) ); + tk_wr( pdf_wr_1byte( pls->pdfs, (U_CHAR) pls->cmap1cp[i].alt_hue_path ) ); } break; } Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2012-08-13 20:27:59 UTC (rev 12206) +++ trunk/include/plplot.h 2012-08-13 21:02:37 UTC (rev 12207) @@ -466,7 +466,7 @@ PLFLT s; // saturation PLFLT p; // position PLFLT a; // alpha (or transparency) - int rev; // if set, interpolate through h=0 + int alt_hue_path; // if set, interpolate through h=0 } PLControlPt; // A PLBufferingCB is a control block for interacting with devices Modified: trunk/src/plctrl.c =================================================================== --- trunk/src/plctrl.c 2012-08-13 20:27:59 UTC (rev 12206) +++ trunk/src/plctrl.c 2012-08-13 21:02:37 UTC (rev 12207) @@ -694,9 +694,9 @@ plsc->cmap1cp[n].a = 1.0; if ( rev == NULL ) - plsc->cmap1cp[n].rev = 0; + plsc->cmap1cp[n].alt_hue_path = 0; else - plsc->cmap1cp[n].rev = rev[n]; + plsc->cmap1cp[n].alt_hue_path = rev[n]; } // Calculate and set color map @@ -775,9 +775,9 @@ plsc->cmap1cp[n].a = a[n]; if ( rev == NULL ) - plsc->cmap1cp[n].rev = 0; + plsc->cmap1cp[n].alt_hue_path = 0; else - plsc->cmap1cp[n].rev = rev[n]; + plsc->cmap1cp[n].alt_hue_path = rev[n]; } // Calculate and set color map @@ -815,7 +815,7 @@ // Adjust dh if we are to go around "the back side" - if ( plsc->cmap1cp[n].rev ) + if ( plsc->cmap1cp[n].alt_hue_path ) dh = ( dh > 0 ) ? dh - 360 : dh + 360; // Loop over all color cells. Only interested in cells located (in This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2012-08-13 22:14:30
|
Revision: 12210 http://plplot.svn.sourceforge.net/plplot/?rev=12210&view=rev Author: andrewross Date: 2012-08-13 22:14:23 +0000 (Mon, 13 Aug 2012) Log Message: ----------- Clean up formatting using uncrustify. Modified Paths: -------------- trunk/bindings/tk/plframe.c trunk/bindings/tk/plr.c trunk/bindings/tk-x-plat/plplotter.c trunk/drivers/wxwidgets.h trunk/examples/c/x29c.c Modified: trunk/bindings/tk/plframe.c =================================================================== --- trunk/bindings/tk/plframe.c 2012-08-13 21:29:59 UTC (rev 12209) +++ trunk/bindings/tk/plframe.c 2012-08-13 22:14:23 UTC (rev 12210) @@ -1899,12 +1899,12 @@ ( pls->cmap1cp[i].p != p ) || ( pls->cmap1cp[i].alt_hue_path != reverse ) ) { - pls->cmap1cp[i].h = h; - pls->cmap1cp[i].l = l; - pls->cmap1cp[i].s = s; - pls->cmap1cp[i].p = p; + pls->cmap1cp[i].h = h; + pls->cmap1cp[i].l = l; + pls->cmap1cp[i].s = s; + pls->cmap1cp[i].p = p; pls->cmap1cp[i].alt_hue_path = reverse; - *p_changed = 1; + *p_changed = 1; } return TCL_OK; } Modified: trunk/bindings/tk/plr.c =================================================================== --- trunk/bindings/tk/plr.c 2012-08-13 21:29:59 UTC (rev 12209) +++ trunk/bindings/tk/plr.c 2012-08-13 22:14:23 UTC (rev 12210) @@ -505,9 +505,9 @@ plr_rd( pdf_rd_ieeef( plr->pdfs, &s ) ); plr_rd( pdf_rd_1byte( plr->pdfs, &rev ) ); - plsc->cmap1cp[i].h = h; - plsc->cmap1cp[i].l = l; - plsc->cmap1cp[i].s = s; + plsc->cmap1cp[i].h = h; + plsc->cmap1cp[i].l = l; + plsc->cmap1cp[i].s = s; plsc->cmap1cp[i].alt_hue_path = rev; } plP_state( PLSTATE_CMAP1 ); Modified: trunk/bindings/tk-x-plat/plplotter.c =================================================================== --- trunk/bindings/tk-x-plat/plplotter.c 2012-08-13 21:29:59 UTC (rev 12209) +++ trunk/bindings/tk-x-plat/plplotter.c 2012-08-13 22:14:23 UTC (rev 12210) @@ -1694,12 +1694,12 @@ ( pls->cmap1cp[i].p != p ) || ( pls->cmap1cp[i].alt_hue_path != reverse ) ) { - pls->cmap1cp[i].h = h; - pls->cmap1cp[i].l = l; - pls->cmap1cp[i].s = s; - pls->cmap1cp[i].p = p; + pls->cmap1cp[i].h = h; + pls->cmap1cp[i].l = l; + pls->cmap1cp[i].s = s; + pls->cmap1cp[i].p = p; pls->cmap1cp[i].alt_hue_path = reverse; - *p_changed = 1; + *p_changed = 1; } return TCL_OK; } Modified: trunk/drivers/wxwidgets.h =================================================================== --- trunk/drivers/wxwidgets.h 2012-08-13 21:29:59 UTC (rev 12209) +++ trunk/drivers/wxwidgets.h 2012-08-13 22:14:23 UTC (rev 12210) @@ -48,11 +48,11 @@ // side, but report/receive everything in virtual coordinates to/from the // PLplot core. // -#define VSCALE ( 40. ) +#define VSCALE ( 40. ) // pixels per inch -#define DEVICE_PIXELS_PER_IN ( 80. ) -#define VIRTUAL_PIXELS_PER_IN ( DEVICE_PIXELS_PER_IN * VSCALE ) +#define DEVICE_PIXELS_PER_IN ( 80. ) +#define VIRTUAL_PIXELS_PER_IN ( DEVICE_PIXELS_PER_IN * VSCALE ) // mm per inch @@ -467,16 +467,16 @@ // Use this macro if you want to define your own main() or WinMain() function // and call wxEntry() from there. -#define IMPLEMENT_PLAPP_NO_MAIN( appname ) \ - wxAppConsole * wxPLCreateApp() \ - { \ - wxAppConsole::CheckBuildOptions( WX_BUILD_OPTIONS_SIGNATURE, \ - "your program" ); \ - return new appname; \ - } \ - wxAppInitializer \ - wxAppInitializer( (wxAppInitializerFunction) (wxApp::GetInitializerFunction()==NULL ? wxPLCreateApp : wxApp::GetInitializerFunction()) ); \ - DECLARE_PLAPP( appname ) \ +#define IMPLEMENT_PLAPP_NO_MAIN( appname ) \ + wxAppConsole * wxPLCreateApp() \ + { \ + wxAppConsole::CheckBuildOptions( WX_BUILD_OPTIONS_SIGNATURE, \ + "your program" ); \ + return new appname; \ + } \ + wxAppInitializer \ + wxAppInitializer( (wxAppInitializerFunction) ( wxApp::GetInitializerFunction() == NULL ? wxPLCreateApp : wxApp::GetInitializerFunction() ) ); \ + DECLARE_PLAPP( appname ) \ appname & wxPLGetApp() { return *wx_static_cast( appname *, wxApp::GetInstance() ); } #define DECLARE_PLAPP( appname ) extern appname &wxPLGetApp(); Modified: trunk/examples/c/x29c.c =================================================================== --- trunk/examples/c/x29c.c 2012-08-13 21:29:59 UTC (rev 12209) +++ trunk/examples/c/x29c.c 2012-08-13 22:14:23 UTC (rev 12210) @@ -365,7 +365,7 @@ plbox( "bcnstd", xlabel_step, 0, "bcnstv", 0., 0 ); plcol0( 3 ); strncpy( title, "@frPLplot Example 29 - TAI-UTC ", 100 ); - strncat( title, title_suffix, 100 - strlen( title ) ); + strncat( title, title_suffix, 100 - strlen( title ) ); pllab( xtitle, "TAI-UTC (sec)", title ); plcol0( 4 ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2012-08-13 23:17:40
|
Revision: 12212 http://plplot.svn.sourceforge.net/plplot/?rev=12212&view=rev Author: airwin Date: 2012-08-13 23:17:31 +0000 (Mon, 13 Aug 2012) Log Message: ----------- rev ==> alt_hue_path changes for our core C library and bindings. This actually constitutes a minor API change to the Ada bindings so do the necessary change to the Ada examples as well. 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/d/plplot.d trunk/bindings/f77/scstubs.c trunk/bindings/f95/scstubs.c trunk/bindings/f95/sfstubsf95.f90 trunk/bindings/gnome2/lib/plplotcanvas.c trunk/bindings/java/PLStream.java trunk/bindings/ocaml/plplot.ml trunk/bindings/ocaml/plplot.mli trunk/bindings/ocaml/plplot_h trunk/bindings/ocaml/plplot_h.inc trunk/bindings/ocaml/touchup.ml trunk/bindings/octave/plplot_octave.h.in trunk/bindings/python/plplot.py.Numeric trunk/bindings/python/plplot.py.numpy trunk/bindings/tcl/plapi.tpl trunk/examples/ada/x08a.adb trunk/examples/ada/x11a.adb trunk/examples/ada/x12a.adb trunk/examples/ada/x15a.adb trunk/examples/ada/x20a.adb trunk/examples/ada/x21a.adb trunk/examples/ada/x30a.adb trunk/examples/ada/xthick08a.adb trunk/examples/ada/xthick11a.adb trunk/examples/ada/xthick12a.adb trunk/examples/ada/xthick15a.adb trunk/examples/ada/xthick20a.adb trunk/examples/ada/xthick21a.adb trunk/examples/ada/xthick30a.adb trunk/include/plplot.h trunk/include/plplotcanvas.h trunk/src/plctrl.c trunk/sys/win-tk/tclgen.c Modified: trunk/bindings/ada/plplot.adb =================================================================== --- trunk/bindings/ada/plplot.adb 2012-08-13 22:21:57 UTC (rev 12211) +++ trunk/bindings/ada/plplot.adb 2012-08-13 23:17:31 UTC (rev 12212) @@ -826,8 +826,8 @@ Red_4, Green_4, Blue_4 : Real_Vector (0..3); -- define 4 Hue_3, Lightness_3, Saturation_3 : Real_Vector (0..2); -- define 3 Hue_4, Lightness_4, Saturation_4 : Real_Vector (0..3); -- define 4 - Reverse_Hue_3 : Boolean_Array_1D (0..2); - Reverse_Hue_4 : Boolean_Array_1D (0..3); + Alt_Hue_Path_3 : Boolean_Array_1D (0..2); + Alt_Hue_Path_4 : Boolean_Array_1D (0..3); begin Set_Number_Of_Colors_In_Color_Map_1(256); @@ -899,10 +899,10 @@ Saturation_3(0) := 0.0; Saturation_3(1) := 0.0; Saturation_3(2) := 0.0; - Reverse_Hue_3(0) := False; - Reverse_Hue_3(1) := False; - Reverse_Hue_3(2) := False; - Set_Color_Map_1_Piecewise(HLS, Controls_3, Hue_3, Lightness_3, Saturation_3, Reverse_Hue_3); + Alt_Hue_Path_3(0) := False; + Alt_Hue_Path_3(1) := False; + Alt_Hue_Path_3(2) := False; + Set_Color_Map_1_Piecewise(HLS, Controls_3, Hue_3, Lightness_3, Saturation_3, Alt_Hue_Path_3); end; when Blue_Green_Red => -- This appears to be the PLplot default color theme. begin @@ -915,10 +915,10 @@ Red_3(0) := 0.0; Red_3(1) := 0.0; Red_3(2) := 1.0; - Reverse_Hue_3(0) := False; - Reverse_Hue_3(1) := False; - Reverse_Hue_3(2) := False; - Set_Color_Map_1_Piecewise(RGB, Controls_3, Red_3, Green_3, Blue_3, Reverse_Hue_3); + Alt_Hue_Path_3(0) := False; + Alt_Hue_Path_3(1) := False; + Alt_Hue_Path_3(2) := False; + Set_Color_Map_1_Piecewise(RGB, Controls_3, Red_3, Green_3, Blue_3, Alt_Hue_Path_3); end; when Red_Green_Blue => begin @@ -931,10 +931,10 @@ Red_3(0) := 1.0; Red_3(1) := 0.0; Red_3(2) := 0.0; - Reverse_Hue_3(0) := False; - Reverse_Hue_3(1) := False; - Reverse_Hue_3(2) := False; - Set_Color_Map_1_Piecewise(RGB, Controls_3, Red_3, Green_3, Blue_3, Reverse_Hue_3); + Alt_Hue_Path_3(0) := False; + Alt_Hue_Path_3(1) := False; + Alt_Hue_Path_3(2) := False; + Set_Color_Map_1_Piecewise(RGB, Controls_3, Red_3, Green_3, Blue_3, Alt_Hue_Path_3); end; when Red_Cyan_Blue => begin @@ -947,10 +947,10 @@ Lightness_3(0) := 0.5; Lightness_3(1) := 0.5; Lightness_3(2) := 0.5; - Reverse_Hue_3(0) := False; - Reverse_Hue_3(1) := False; - Reverse_Hue_3(2) := False; - Set_Color_Map_1_Piecewise(HLS, Controls_3, Hue_3, Lightness_3, Saturation_3, Reverse_Hue_3); + Alt_Hue_Path_3(0) := False; + Alt_Hue_Path_3(1) := False; + Alt_Hue_Path_3(2) := False; + Set_Color_Map_1_Piecewise(HLS, Controls_3, Hue_3, Lightness_3, Saturation_3, Alt_Hue_Path_3); end; when Blue_Black_Red => begin @@ -966,11 +966,11 @@ Lightness_4(1) := 0.0; Lightness_4(2) := 0.0; Lightness_4(3) := 0.5; - Reverse_Hue_4(0) := False; - Reverse_Hue_4(1) := False; - Reverse_Hue_4(2) := False; - Reverse_Hue_4(3) := False; - Set_Color_Map_1_Piecewise(HLS, Controls_4, Hue_4, Lightness_4, Saturation_4, Reverse_Hue_4); + Alt_Hue_Path_4(0) := False; + Alt_Hue_Path_4(1) := False; + Alt_Hue_Path_4(2) := False; + Alt_Hue_Path_4(3) := False; + Set_Color_Map_1_Piecewise(HLS, Controls_4, Hue_4, Lightness_4, Saturation_4, Alt_Hue_Path_4); end; when Red_Blue_Green => begin @@ -983,10 +983,10 @@ Saturation_3(0) := 1.0; Saturation_3(1) := 1.0; Saturation_3(2) := 1.0; - Reverse_Hue_3(0) := False; - Reverse_Hue_3(1) := False; - Reverse_Hue_3(2) := False; - Set_Color_Map_1_Piecewise(HLS, Controls_3, Hue_3, Lightness_3, Saturation_3, Reverse_Hue_3); + Alt_Hue_Path_3(0) := False; + Alt_Hue_Path_3(1) := False; + Alt_Hue_Path_3(2) := False; + Set_Color_Map_1_Piecewise(HLS, Controls_3, Hue_3, Lightness_3, Saturation_3, Alt_Hue_Path_3); end; when Red_Yellow => begin @@ -999,10 +999,10 @@ Saturation_3(0) := 1.0; Saturation_3(1) := 1.0; Saturation_3(2) := 1.0; - Reverse_Hue_3(0) := False; - Reverse_Hue_3(1) := False; - Reverse_Hue_3(2) := False; - Set_Color_Map_1_Piecewise(HLS, Controls_3, Hue_3, Lightness_3, Saturation_3, Reverse_Hue_3); + Alt_Hue_Path_3(0) := False; + Alt_Hue_Path_3(1) := False; + Alt_Hue_Path_3(2) := False; + Set_Color_Map_1_Piecewise(HLS, Controls_3, Hue_3, Lightness_3, Saturation_3, Alt_Hue_Path_3); end; end case; end Quick_Set_Color_Map_1; @@ -2378,15 +2378,14 @@ -- Note: Hue is 0.0 .. 360.0. L_Or_G : Real_Vector; -- range 0.0 .. 1.0; not checked here S_Or_B : Real_Vector; -- range 0.0 .. 1.0; not checked here - Reverse_Hue : Boolean_Array_1D) is -- False means red<->green<->blue<->red, True reverses - + Alt_Hue_Path : Boolean_Array_1D) is -- True means use alternative hue interpolation path which always includes the point hue = 0. False reverses. PL_Color_Model : PLBOOL; - PL_Reverse_Hue : PL_Bool_Array (Reverse_Hue'range); + PL_Alt_Hue_Path : PL_Bool_Array (Alt_Hue_Path'range); begin -- Check for consistent array lengths. if Control_Points'length /= H_Or_R'length or Control_Points'length /= L_or_G'length or - Control_Points'length /= S_Or_B'length or Control_Points'length /= Reverse_Hue'length + Control_Points'length /= S_Or_B'length or Control_Points'length /= Alt_Hue_Path'length then Put_Line("*** WARNING: Inconsistent array lengths when setting color map 1 ***"); end if; @@ -2397,23 +2396,23 @@ PL_Color_Model := PLfalse; end if; - for i in Reverse_Hue'range loop - if Reverse_Hue(i) then - PL_Reverse_Hue(i) := PLtrue; + for i in Alt_Hue_Path'range loop + if Alt_Hue_Path(i) then + PL_Alt_Hue_Path(i) := PLtrue; else - PL_Reverse_Hue(i) := PLfalse; + PL_Alt_Hue_Path(i) := PLfalse; end if; end loop; - plscmap1l(PL_Color_Model, Control_Points'Length, Control_Points, H_Or_R, L_Or_G, S_Or_B, PL_Reverse_Hue); + plscmap1l(PL_Color_Model, Control_Points'Length, Control_Points, H_Or_R, L_Or_G, S_Or_B, PL_Alt_Hue_Path); end Set_Color_Map_1_Piecewise; - -- Overloaded version of Set_Color_Map_1_Piecewise which allows simplified (non-)reversal of - -- the traversed hue range. This is an Ada-like way of doing what is described + -- Overloaded version of Set_Color_Map_1_Piecewise which allows simplified (alt_hue_path false) interpolation. + -- This is an Ada-like way of doing what is described -- in the PLplot documentation when a C user passes a null pointer as the - -- final argument instead of an array of booleans to indicate hue reversal. - -- plscmap1l + -- final argument instead of an array of booleans to indicate which + -- of the two hue interpolation paths to take. procedure Set_Color_Map_1_Piecewise (Color_Model : Color_Model_Type; -- HLS or RGB Control_Points : Real_Vector; -- range 0.0 .. 1.0; not checked here @@ -2421,20 +2420,20 @@ -- Note: Hue is 0.0 .. 360.0. L_Or_G : Real_Vector; -- range 0.0 .. 1.0; not checked here S_Or_B : Real_Vector; -- range 0.0 .. 1.0; not checked here - Reverse_Hue : Reverse_Hue_Type) is + Alt_Hue_Path : Alt_Hue_Path_Type) is - Reverse_Hue_Array : Boolean_Array_1D(Control_Points'range); + Alt_Hue_Path_Array : Boolean_Array_1D(Control_Points'range); begin - if Reverse_Hue = Reverse_Hue_All then - for i in Reverse_Hue_Array'range loop - Reverse_Hue_Array(i) := True; + if Alt_Hue_Path = Alt_Hue_Path_All then + for i in Alt_Hue_Path_Array'range loop + Alt_Hue_Path_Array(i) := True; end loop; - elsif Reverse_Hue = Reverse_Hue_None then - for i in Reverse_Hue_Array'range loop - Reverse_Hue_Array(i) := False; + elsif Alt_Hue_Path = Alt_Hue_Path_None then + for i in Alt_Hue_Path_Array'range loop + Alt_Hue_Path_Array(i) := False; end loop; end if; - Set_Color_Map_1_Piecewise(Color_Model, Control_Points, H_Or_R, L_Or_G, S_Or_B, Reverse_Hue_Array); + Set_Color_Map_1_Piecewise(Color_Model, Control_Points, H_Or_R, L_Or_G, S_Or_B, Alt_Hue_Path_Array); end Set_Color_Map_1_Piecewise; @@ -2449,15 +2448,14 @@ L_Or_G : Real_Vector; -- range 0.0 .. 1.0; not checked here S_Or_B : Real_Vector; -- range 0.0 .. 1.0; not checked here Alpha : Real_Vector; -- range 0.0 .. 1.0; not checked here - Reverse_Hue : Boolean_Array_1D) is -- False means red<->green<->blue<->red, True reverses - + Alt_Hue_Path : Boolean_Array_1D) is -- True means use alternative hue interpolation path which always includes the point hue = 0. False reverses. PL_Color_Model : PLBOOL; - PL_Reverse_Hue : PL_Bool_Array (Reverse_Hue'range); + PL_Alt_Hue_Path : PL_Bool_Array (Alt_Hue_Path'range); begin -- Check for consistent array lengths. if Control_Points'length /= H_Or_R'length or Control_Points'length /= L_or_G'length or - Control_Points'length /= S_Or_B'length or Control_Points'length /= Reverse_Hue'length + Control_Points'length /= S_Or_B'length or Control_Points'length /= Alt_Hue_Path'length then Put_Line("*** WARNING: Inconsistent array lengths when setting color map 1 ***"); end if; @@ -2468,23 +2466,23 @@ PL_Color_Model := PLfalse; end if; - for i in Reverse_Hue'range loop - if Reverse_Hue(i) then - PL_Reverse_Hue(i) := PLtrue; + for i in Alt_Hue_Path'range loop + if Alt_Hue_Path(i) then + PL_Alt_Hue_Path(i) := PLtrue; else - PL_Reverse_Hue(i) := PLfalse; + PL_Alt_Hue_Path(i) := PLfalse; end if; end loop; - plscmap1la(PL_Color_Model, Control_Points'Length, Control_Points, H_Or_R, L_Or_G, S_Or_B, Alpha, PL_Reverse_Hue); + plscmap1la(PL_Color_Model, Control_Points'Length, Control_Points, H_Or_R, L_Or_G, S_Or_B, Alpha, PL_Alt_Hue_Path); end Set_Color_Map_1_Piecewise_And_Alpha; - -- Overloaded version of Set_Color_Map_1_Piecewise_And_Alpha which allows simplified (non-)reversal of - -- the traversed hue range. This is an Ada-like way of doing what is described + -- Overloaded version of Set_Color_Map_1_Piecewise_And_Alpha which allows simplified (alt_hue_path false) interpolation. + -- This is an Ada-like way of doing what is described -- in the PLplot documentation when a C user passes a null pointer as the - -- final argument instead of an array of booleans to indicate hue reversal. - -- plscmap1la + -- final argument instead of an array of booleans to indicate which + -- of the two hue interpolation paths to take. procedure Set_Color_Map_1_Piecewise_And_Alpha (Color_Model : Color_Model_Type; -- HLS or RGB Control_Points : Real_Vector; -- range 0.0 .. 1.0; not checked here @@ -2492,20 +2490,20 @@ L_Or_G : Real_Vector; -- range 0.0 .. 1.0; not checked here S_Or_B : Real_Vector; -- range 0.0 .. 1.0; not checked here Alpha : Real_Vector; -- range 0.0 .. 1.0; not checked here - Reverse_Hue : Reverse_Hue_Type) is + Alt_Hue_Path : Alt_Hue_Path_Type) is - Reverse_Hue_Array : Boolean_Array_1D(Control_Points'range); + Alt_Hue_Path_Array : Boolean_Array_1D(Control_Points'range); begin - if Reverse_Hue = Reverse_Hue_All then - for i in Reverse_Hue_Array'range loop - Reverse_Hue_Array(i) := True; + if Alt_Hue_Path = Alt_Hue_Path_All then + for i in Alt_Hue_Path_Array'range loop + Alt_Hue_Path_Array(i) := True; end loop; - elsif Reverse_Hue = Reverse_Hue_None then - for i in Reverse_Hue_Array'range loop - Reverse_Hue_Array(i) := False; + elsif Alt_Hue_Path = Alt_Hue_Path_None then + for i in Alt_Hue_Path_Array'range loop + Alt_Hue_Path_Array(i) := False; end loop; end if; - Set_Color_Map_1_Piecewise_And_Alpha(Color_Model, Control_Points, H_Or_R, L_Or_G, S_Or_B, Alpha, Reverse_Hue_Array); + Set_Color_Map_1_Piecewise_And_Alpha(Color_Model, Control_Points, H_Or_R, L_Or_G, S_Or_B, Alpha, Alt_Hue_Path_Array); end Set_Color_Map_1_Piecewise_And_Alpha; Modified: trunk/bindings/ada/plplot.ads =================================================================== --- trunk/bindings/ada/plplot.ads 2012-08-13 22:21:57 UTC (rev 12211) +++ trunk/bindings/ada/plplot.ads 2012-08-13 23:17:31 UTC (rev 12212) @@ -728,7 +728,7 @@ type Color_Themes_For_Map_1_Type is (Gray, Blue_Green_Red, Red_Green_Blue, Red_Cyan_Blue, Blue_Black_Red, Red_Blue_Green, Red_Yellow); - type Reverse_Hue_Type is (Reverse_Hue_None, Reverse_Hue_All); + type Alt_Hue_Path_Type is (Alt_Hue_Path_None, Alt_Hue_Path_All); -- Quick application of pre-fabricated color schemes to color map 1. @@ -1574,13 +1574,13 @@ H_Or_R : Real_Vector; -- range 0.0 .. 1.0; not checked here L_Or_G : Real_Vector; -- range 0.0 .. 1.0; not checked here S_Or_B : Real_Vector; -- range 0.0 .. 1.0; not checked here - Reverse_Hue : Boolean_Array_1D); -- False means red<->green<->blue<->red, True reverses + Alt_Hue_Path : Boolean_Array_1D); -- True means use alternative hue interpolation path which always includes the point hue = 0. False reverses. - - -- Overloaded version of Set_Color_Map_1_Piecewise which allows simplified (non-)reversal of - -- the traversed hue range. This is an Ada-like way of doing what is described + -- Overloaded version of Set_Color_Map_1_Piecewise which allows simplified (alt_hue_path false) interpolation. + -- This is an Ada-like way of doing what is described -- in the PLplot documentation when a C user passes a null pointer as the - -- final argument instead of an array of booleans to indicate hue reversal. + -- final argument instead of an array of booleans to indicate which + -- of the two hue interpolation paths to take. procedure Set_Color_Map_1_Piecewise (Color_Model : Color_Model_Type; -- HLS or RGB Control_Points : Real_Vector; -- range 0.0 .. 1.0; not checked here @@ -1588,7 +1588,7 @@ -- Note: Hue is 0.0 .. 360.0. L_Or_G : Real_Vector; -- range 0.0 .. 1.0; not checked here S_Or_B : Real_Vector; -- range 0.0 .. 1.0; not checked here - Reverse_Hue : Reverse_Hue_Type); + Alt_Hue_Path : Alt_Hue_Path_Type); -- Set color map 1 colors using a piece-wise linear relationship between @@ -1602,13 +1602,14 @@ L_Or_G : Real_Vector; -- range 0.0 .. 1.0; not checked here S_Or_B : Real_Vector; -- range 0.0 .. 1.0; not checked here Alpha : Real_Vector; -- range 0.0 .. 1.0; not checked here - Reverse_Hue : Boolean_Array_1D); -- False means red<->green<->blue<->red, True reverses + Alt_Hue_Path : Boolean_Array_1D); -- True means use alternative hue interpolation path which always includes the point hue = 0. False reverses. - -- Overloaded version of Set_Color_Map_1_Piecewise_And_Alpha which allows simplified (non-)reversal of - -- the traversed hue range. This is an Ada-like way of doing what is described + -- Overloaded version of Set_Color_Map_1_Piecewise_And_Alpha which allows simplified (alt_hue_path false) interpolation. + -- This is an Ada-like way of doing what is described -- in the PLplot documentation when a C user passes a null pointer as the - -- final argument instead of an array of booleans to indicate hue reversal. + -- final argument instead of an array of booleans to indicate which + -- of the two hue interpolation paths to take. procedure Set_Color_Map_1_Piecewise_And_Alpha (Color_Model : Color_Model_Type; -- HLS or RGB Control_Points : Real_Vector; -- range 0.0 .. 1.0; not checked here @@ -1616,7 +1617,7 @@ L_Or_G : Real_Vector; -- range 0.0 .. 1.0; not checked here S_Or_B : Real_Vector; -- range 0.0 .. 1.0; not checked here Alpha : Real_Vector; -- range 0.0 .. 1.0; not checked here - Reverse_Hue : Reverse_Hue_Type); + Alt_Hue_Path : Alt_Hue_Path_Type); -- Set number of colors in cmap 1 Modified: trunk/bindings/ada/plplot_thin.ads =================================================================== --- trunk/bindings/ada/plplot_thin.ads 2012-08-13 22:21:57 UTC (rev 12211) +++ trunk/bindings/ada/plplot_thin.ads 2012-08-13 23:17:31 UTC (rev 12212) @@ -28,7 +28,7 @@ -- I hope that this is wrong and that they are really PLINTs like the API says. -- I converted these as a : out PLINT. These are the only *-ed quantities that I set to "outs". --- I made the final arg in plscmap1l, rev, an array of PLBOOLs, not an in out +-- I made the final arg in plscmap1l, alt_hue_path, an array of PLBOOLs, not an in out -- parameter; impossible to tell from C syntax which is intended, but I think -- this is right. @@ -1373,7 +1373,7 @@ procedure plscmap1l(itype : PLINT; npts : PLINT; intensity : PL_Float_Array; coord1 : PL_Float_Array; coord2 : PL_Float_Array; coord3 : PL_Float_Array; - rev : PL_Bool_Array); + alt_hue_path : PL_Bool_Array); pragma Import(C, plscmap1l, "c_plscmap1l"); @@ -1384,7 +1384,7 @@ procedure plscmap1la(itype : PLINT; npts : PLINT; intensity, coord1, coord2, coord3, a : PL_Float_Array; - rev : PL_Bool_Array); + alt_hue_path : PL_Bool_Array); pragma Import(C, plscmap1la, "c_plscmap1la"); Modified: trunk/bindings/ada/plplot_traditional.adb =================================================================== --- trunk/bindings/ada/plplot_traditional.adb 2012-08-13 22:21:57 UTC (rev 12211) +++ trunk/bindings/ada/plplot_traditional.adb 2012-08-13 23:17:31 UTC (rev 12212) @@ -827,8 +827,8 @@ Red_4, Green_4, Blue_4 : Real_Vector (0..3); -- define 4 Hue_3, Lightness_3, Saturation_3 : Real_Vector (0..2); -- define 3 Hue_4, Lightness_4, Saturation_4 : Real_Vector (0..3); -- define 4 - Reverse_Hue_3 : Boolean_Array_1D (0..2); - Reverse_Hue_4 : Boolean_Array_1D (0..3); + Alt_Hue_Path_3 : Boolean_Array_1D (0..2); + Alt_Hue_Path_4 : Boolean_Array_1D (0..3); begin plscmap1n(256); @@ -900,10 +900,10 @@ Saturation_3(0) := 0.0; Saturation_3(1) := 0.0; Saturation_3(2) := 0.0; - Reverse_Hue_3(0) := False; - Reverse_Hue_3(1) := False; - Reverse_Hue_3(2) := False; - plscmap1l(HLS, Controls_3, Hue_3, Lightness_3, Saturation_3, Reverse_Hue_3); + Alt_Hue_Path_3(0) := False; + Alt_Hue_Path_3(1) := False; + Alt_Hue_Path_3(2) := False; + plscmap1l(HLS, Controls_3, Hue_3, Lightness_3, Saturation_3, Alt_Hue_Path_3); end; when Blue_Green_Red => -- This appears to be the PLplot default color theme. begin @@ -916,10 +916,10 @@ Red_3(0) := 0.0; Red_3(1) := 0.0; Red_3(2) := 1.0; - Reverse_Hue_3(0) := False; - Reverse_Hue_3(1) := False; - Reverse_Hue_3(2) := False; - plscmap1l(RGB, Controls_3, Red_3, Green_3, Blue_3, Reverse_Hue_3); + Alt_Hue_Path_3(0) := False; + Alt_Hue_Path_3(1) := False; + Alt_Hue_Path_3(2) := False; + plscmap1l(RGB, Controls_3, Red_3, Green_3, Blue_3, Alt_Hue_Path_3); end; when Red_Green_Blue => begin @@ -932,10 +932,10 @@ Red_3(0) := 1.0; Red_3(1) := 0.0; Red_3(2) := 0.0; - Reverse_Hue_3(0) := False; - Reverse_Hue_3(1) := False; - Reverse_Hue_3(2) := False; - plscmap1l(RGB, Controls_3, Red_3, Green_3, Blue_3, Reverse_Hue_3); + Alt_Hue_Path_3(0) := False; + Alt_Hue_Path_3(1) := False; + Alt_Hue_Path_3(2) := False; + plscmap1l(RGB, Controls_3, Red_3, Green_3, Blue_3, Alt_Hue_Path_3); end; when Red_Cyan_Blue => begin @@ -948,10 +948,10 @@ Lightness_3(0) := 0.5; Lightness_3(1) := 0.5; Lightness_3(2) := 0.5; - Reverse_Hue_3(0) := False; - Reverse_Hue_3(1) := False; - Reverse_Hue_3(2) := False; - plscmap1l(HLS, Controls_3, Hue_3, Lightness_3, Saturation_3, Reverse_Hue_3); + Alt_Hue_Path_3(0) := False; + Alt_Hue_Path_3(1) := False; + Alt_Hue_Path_3(2) := False; + plscmap1l(HLS, Controls_3, Hue_3, Lightness_3, Saturation_3, Alt_Hue_Path_3); end; when Blue_Black_Red => begin @@ -967,11 +967,11 @@ Lightness_4(1) := 0.0; Lightness_4(2) := 0.0; Lightness_4(3) := 0.5; - Reverse_Hue_4(0) := False; - Reverse_Hue_4(1) := False; - Reverse_Hue_4(2) := False; - Reverse_Hue_4(3) := False; - plscmap1l(HLS, Controls_4, Hue_4, Lightness_4, Saturation_4, Reverse_Hue_4); + Alt_Hue_Path_4(0) := False; + Alt_Hue_Path_4(1) := False; + Alt_Hue_Path_4(2) := False; + Alt_Hue_Path_4(3) := False; + plscmap1l(HLS, Controls_4, Hue_4, Lightness_4, Saturation_4, Alt_Hue_Path_4); end; when Red_Blue_Green => begin @@ -984,10 +984,10 @@ Saturation_3(0) := 1.0; Saturation_3(1) := 1.0; Saturation_3(2) := 1.0; - Reverse_Hue_3(0) := False; - Reverse_Hue_3(1) := False; - Reverse_Hue_3(2) := False; - plscmap1l(HLS, Controls_3, Hue_3, Lightness_3, Saturation_3, Reverse_Hue_3); + Alt_Hue_Path_3(0) := False; + Alt_Hue_Path_3(1) := False; + Alt_Hue_Path_3(2) := False; + plscmap1l(HLS, Controls_3, Hue_3, Lightness_3, Saturation_3, Alt_Hue_Path_3); end; when Red_Yellow => begin @@ -1000,10 +1000,10 @@ Saturation_3(0) := 1.0; Saturation_3(1) := 1.0; Saturation_3(2) := 1.0; - Reverse_Hue_3(0) := False; - Reverse_Hue_3(1) := False; - Reverse_Hue_3(2) := False; - plscmap1l(HLS, Controls_3, Hue_3, Lightness_3, Saturation_3, Reverse_Hue_3); + Alt_Hue_Path_3(0) := False; + Alt_Hue_Path_3(1) := False; + Alt_Hue_Path_3(2) := False; + plscmap1l(HLS, Controls_3, Hue_3, Lightness_3, Saturation_3, Alt_Hue_Path_3); end; end case; end Quick_Set_Color_Map_1; @@ -2273,15 +2273,15 @@ -- Note: Hue is 0.0 .. 360.0. L_Or_G : Real_Vector; -- range 0.0 .. 1.0; not checked here S_Or_B : Real_Vector; -- range 0.0 .. 1.0; not checked here - Reverse_Hue : Boolean_Array_1D) is -- False means red<->green<->blue<->red, True reverses + Alt_Hue_Path : Boolean_Array_1D) is -- True means use alternative hue interpolation path which always includes the point hue = 0. False reverses. PL_Color_Model : PLBOOL; - PL_Reverse_Hue : PL_Bool_Array (Reverse_Hue'range); + PL_Alt_Hue_Path : PL_Bool_Array (Alt_Hue_Path'range); begin -- Check for consistent array lengths. if Control_Points'length /= H_Or_R'length or Control_Points'length /= L_or_G'length or - Control_Points'length /= S_Or_B'length or Control_Points'length /= Reverse_Hue'length + Control_Points'length /= S_Or_B'length or Control_Points'length /= Alt_Hue_Path'length then Put_Line("*** WARNING: Inconsistent array lengths when setting color map 1 ***"); end if; @@ -2292,22 +2292,23 @@ PL_Color_Model := PLfalse; end if; - for i in Reverse_Hue'range loop - if Reverse_Hue(i) then - PL_Reverse_Hue(i) := PLtrue; + for i in Alt_Hue_Path'range loop + if Alt_Hue_Path(i) then + PL_Alt_Hue_Path(i) := PLtrue; else - PL_Reverse_Hue(i) := PLfalse; + PL_Alt_Hue_Path(i) := PLfalse; end if; end loop; - PLplot_Thin.plscmap1l(PL_Color_Model, Control_Points'Length, Control_Points, H_Or_R, L_Or_G, S_Or_B, PL_Reverse_Hue); + PLplot_Thin.plscmap1l(PL_Color_Model, Control_Points'Length, Control_Points, H_Or_R, L_Or_G, S_Or_B, PL_Alt_Hue_Path); end plscmap1l; - -- Overloaded version of plscmap1l which allows simplified (non-)reversal of - -- the traversed hue range. This is an Ada-like way of doing what is described + -- Overloaded version of plscmap1l which allows simplified (alt_hue_path false) interpolation. + -- This is an Ada-like way of doing what is described -- in the PLplot documentation when a C user passes a null pointer as the - -- final argument instead of an array of booleans to indicate hue reversal. + -- final argument instead of an array of booleans to indicate which + -- of the two hue interpolation paths to take. procedure plscmap1l (Color_Model : Color_Model_Type; -- HLS or RGB Control_Points : Real_Vector; -- range 0.0 .. 1.0; not checked here @@ -2315,20 +2316,20 @@ -- Note: Hue is 0.0 .. 360.0. L_Or_G : Real_Vector; -- range 0.0 .. 1.0; not checked here S_Or_B : Real_Vector; -- range 0.0 .. 1.0; not checked here - Reverse_Hue : Reverse_Hue_Type) is + Alt_Hue_Path : Alt_Hue_Path_Type) is - Reverse_Hue_Array : Boolean_Array_1D(Control_Points'range); + Alt_Hue_Path_Array : Boolean_Array_1D(Control_Points'range); begin - if Reverse_Hue = Reverse_Hue_All then - for i in Reverse_Hue_Array'range loop - Reverse_Hue_Array(i) := True; + if Alt_Hue_Path = Alt_Hue_Path_All then + for i in Alt_Hue_Path_Array'range loop + Alt_Hue_Path_Array(i) := True; end loop; - elsif Reverse_Hue = Reverse_Hue_None then - for i in Reverse_Hue_Array'range loop - Reverse_Hue_Array(i) := False; + elsif Alt_Hue_Path = Alt_Hue_Path_None then + for i in Alt_Hue_Path_Array'range loop + Alt_Hue_Path_Array(i) := False; end loop; end if; - plscmap1l(Color_Model, Control_Points, H_Or_R, L_Or_G, S_Or_B, Reverse_Hue_Array); + plscmap1l(Color_Model, Control_Points, H_Or_R, L_Or_G, S_Or_B, Alt_Hue_Path_Array); end plscmap1l; @@ -2342,15 +2343,15 @@ L_Or_G : Real_Vector; -- range 0.0 .. 1.0; not checked here S_Or_B : Real_Vector; -- range 0.0 .. 1.0; not checked here Alpha : Real_Vector; -- range 0.0 .. 1.0; not checked here - Reverse_Hue : Boolean_Array_1D) is -- False means red<->green<->blue<->red, True reverses + Alt_Hue_Path : Boolean_Array_1D) is -- True means use alternative hue interpolation path which always includes the point hue = 0. False reverses. PL_Color_Model : PLBOOL; - PL_Reverse_Hue : PL_Bool_Array (Reverse_Hue'range); + PL_Alt_Hue_Path : PL_Bool_Array (Alt_Hue_Path'range); begin -- Check for consistent array lengths. if Control_Points'length /= H_Or_R'length or Control_Points'length /= L_or_G'length or - Control_Points'length /= S_Or_B'length or Control_Points'length /= Reverse_Hue'length + Control_Points'length /= S_Or_B'length or Control_Points'length /= Alt_Hue_Path'length then Put_Line("*** WARNING: Inconsistent array lengths when setting color map 1 ***"); end if; @@ -2361,22 +2362,23 @@ PL_Color_Model := PLfalse; end if; - for i in Reverse_Hue'range loop - if Reverse_Hue(i) then - PL_Reverse_Hue(i) := PLtrue; + for i in Alt_Hue_Path'range loop + if Alt_Hue_Path(i) then + PL_Alt_Hue_Path(i) := PLtrue; else - PL_Reverse_Hue(i) := PLfalse; + PL_Alt_Hue_Path(i) := PLfalse; end if; end loop; - PLplot_Thin.plscmap1la(PL_Color_Model, Control_Points'Length, Control_Points, H_Or_R, L_Or_G, S_Or_B, Alpha, PL_Reverse_Hue); + PLplot_Thin.plscmap1la(PL_Color_Model, Control_Points'Length, Control_Points, H_Or_R, L_Or_G, S_Or_B, Alpha, PL_Alt_Hue_Path); end plscmap1la; - -- Overloaded version of plscmap1la which allows simplified (non-)reversal of - -- the traversed hue range. This is an Ada-like way of doing what is described + -- Overloaded version of plscmap1la which allows simplified (alt_hue_path false) interpolation. + -- This is an Ada-like way of doing what is described -- in the PLplot documentation when a C user passes a null pointer as the - -- final argument instead of an array of booleans to indicate hue reversal. + -- final argument instead of an array of booleans to indicate which + -- of the two hue interpolation paths to take. procedure plscmap1la (Color_Model : Color_Model_Type; -- HLS or RGB Control_Points : Real_Vector; -- range 0.0 .. 1.0; not checked here @@ -2384,20 +2386,20 @@ L_Or_G : Real_Vector; -- range 0.0 .. 1.0; not checked here S_Or_B : Real_Vector; -- range 0.0 .. 1.0; not checked here Alpha : Real_Vector; -- range 0.0 .. 1.0; not checked here - Reverse_Hue : Reverse_Hue_Type) is + Alt_Hue_Path : Alt_Hue_Path_Type) is - Reverse_Hue_Array : Boolean_Array_1D(Control_Points'range); + Alt_Hue_Path_Array : Boolean_Array_1D(Control_Points'range); begin - if Reverse_Hue = Reverse_Hue_All then - for i in Reverse_Hue_Array'range loop - Reverse_Hue_Array(i) := True; + if Alt_Hue_Path = Alt_Hue_Path_All then + for i in Alt_Hue_Path_Array'range loop + Alt_Hue_Path_Array(i) := True; end loop; - elsif Reverse_Hue = Reverse_Hue_None then - for i in Reverse_Hue_Array'range loop - Reverse_Hue_Array(i) := False; + elsif Alt_Hue_Path = Alt_Hue_Path_None then + for i in Alt_Hue_Path_Array'range loop + Alt_Hue_Path_Array(i) := False; end loop; end if; - plscmap1la(Color_Model, Control_Points, H_Or_R, L_Or_G, S_Or_B, Alpha, Reverse_Hue_Array); + plscmap1la(Color_Model, Control_Points, H_Or_R, L_Or_G, S_Or_B, Alpha, Alt_Hue_Path_Array); end plscmap1la; Modified: trunk/bindings/ada/plplot_traditional.ads =================================================================== --- trunk/bindings/ada/plplot_traditional.ads 2012-08-13 22:21:57 UTC (rev 12211) +++ trunk/bindings/ada/plplot_traditional.ads 2012-08-13 23:17:31 UTC (rev 12212) @@ -726,7 +726,7 @@ type Color_Themes_For_Map_1_Type is (Gray, Blue_Green_Red, Red_Green_Blue, Red_Cyan_Blue, Blue_Black_Red, Red_Blue_Green, Red_Yellow); - type Reverse_Hue_Type is (Reverse_Hue_None, Reverse_Hue_All); + type Alt_Hue_Path_Type is (Alt_Hue_Path_None, Alt_Hue_Path_All); -- Quick application of pre-fabricated color schemes to color map 1. @@ -1465,7 +1465,7 @@ H_Or_R : Real_Vector; -- range 0.0 .. 1.0; not checked here L_Or_G : Real_Vector; -- range 0.0 .. 1.0; not checked here S_Or_B : Real_Vector; -- range 0.0 .. 1.0; not checked here - Reverse_Hue : Boolean_Array_1D); -- False means red<->green<->blue<->red, True reverses + Alt_Hue_Path : Boolean_Array_1D); -- True means use alternative hue interpolation path which always includes the point hue = 0. False reverses. -- Overloaded version of plscmap1l which allows simplified (non-)reversal of @@ -1479,7 +1479,7 @@ -- Note: Hue is 0.0 .. 360.0. L_Or_G : Real_Vector; -- range 0.0 .. 1.0; not checked here S_Or_B : Real_Vector; -- range 0.0 .. 1.0; not checked here - Reverse_Hue : Reverse_Hue_Type); + Alt_Hue_Path : Alt_Hue_Path_Type); -- Set color map 1 colors using a piece-wise linear relationship between @@ -1492,7 +1492,7 @@ L_Or_G : Real_Vector; -- range 0.0 .. 1.0; not checked here S_Or_B : Real_Vector; -- range 0.0 .. 1.0; not checked here Alpha : Real_Vector; -- range 0.0 .. 1.0; not checked here - Reverse_Hue : Boolean_Array_1D); -- False means red<->green<->blue<->red, True reverses + Alt_Hue_Path : Boolean_Array_1D); -- True means use alternative hue interpolation path which always includes the point hue = 0. False reverses. -- Overloaded version of plscmap1la which allows simplified (non-)reversal of @@ -1506,7 +1506,7 @@ L_Or_G : Real_Vector; -- range 0.0 .. 1.0; not checked here S_Or_B : Real_Vector; -- range 0.0 .. 1.0; not checked here Alpha : Real_Vector; -- range 0.0 .. 1.0; not checked here - Reverse_Hue : Reverse_Hue_Type); + Alt_Hue_Path : Alt_Hue_Path_Type); -- Set number of colors in cmap 1 Modified: trunk/bindings/c++/plstream.cc =================================================================== --- trunk/bindings/c++/plstream.cc 2012-08-13 22:21:57 UTC (rev 12211) +++ trunk/bindings/c++/plstream.cc 2012-08-13 23:17:31 UTC (rev 12212) @@ -1418,24 +1418,24 @@ void plstream::scmap1l( bool itype, PLINT npts, const PLFLT *intensity, const PLFLT *coord1, const PLFLT *coord2, const PLFLT *coord3, - const bool *rev ) + const bool *alt_hue_path ) { - PLBOOL *loc_rev = NULL; - if ( rev != NULL ) + PLBOOL *loc_alt_hue_path = NULL; + if ( alt_hue_path != NULL ) { - loc_rev = new PLBOOL[npts - 1]; + loc_alt_hue_path = new PLBOOL[npts - 1]; for ( int i = 0; i < npts - 1; i++ ) { - loc_rev[i] = (PLBOOL) rev[i]; + loc_alt_hue_path[i] = (PLBOOL) alt_hue_path[i]; } } set_stream(); - plscmap1l( (PLBOOL) itype, npts, intensity, coord1, coord2, coord3, loc_rev ); + plscmap1l( (PLBOOL) itype, npts, intensity, coord1, coord2, coord3, loc_alt_hue_path ); - if ( loc_rev != NULL ) - delete [] loc_rev; + if ( loc_alt_hue_path != NULL ) + delete [] loc_alt_hue_path; } // Set color map 1 colors using a piece-wise linear relationship between @@ -1444,25 +1444,25 @@ void plstream::scmap1la( bool itype, PLINT npts, const PLFLT *intensity, const PLFLT *coord1, const PLFLT *coord2, const PLFLT *coord3, - const PLFLT *a, const bool *rev ) + const PLFLT *a, const bool *alt_hue_path ) { - PLBOOL *loc_rev = NULL; - if ( rev != NULL ) + PLBOOL *loc_alt_hue_path = NULL; + if ( alt_hue_path != NULL ) { - loc_rev = new PLBOOL[npts - 1]; + loc_alt_hue_path = new PLBOOL[npts - 1]; for ( int i = 0; i < npts - 1; i++ ) { - loc_rev[i] = (PLBOOL) rev[i]; + loc_alt_hue_path[i] = (PLBOOL) alt_hue_path[i]; } } set_stream(); plscmap1la( (PLBOOL) itype, npts, intensity, coord1, coord2, coord3, - a, loc_rev ); + a, loc_alt_hue_path ); - if ( loc_rev != NULL ) - delete [] loc_rev; + if ( loc_alt_hue_path != NULL ) + delete [] loc_alt_hue_path; } // @@ -1478,24 +1478,24 @@ // Deprecated version using PLINT instead of bool void plstream::scmap1l( PLINT itype, PLINT npts, const PLFLT *intensity, const PLFLT *coord1, const PLFLT *coord2, const PLFLT *coord3, - const PLINT *rev ) + const PLINT *alt_hue_path ) { - PLBOOL *loc_rev = NULL; - if ( rev != NULL ) + PLBOOL *loc_alt_hue_path = NULL; + if ( alt_hue_path != NULL ) { - loc_rev = new PLBOOL[npts - 1]; + loc_alt_hue_path = new PLBOOL[npts - 1]; for ( int i = 0; i < npts - 1; i++ ) { - loc_rev[i] = (PLBOOL) rev[i]; + loc_alt_hue_path[i] = (PLBOOL) alt_hue_path[i]; } } set_stream(); - plscmap1l( (PLBOOL) itype, npts, intensity, coord1, coord2, coord3, loc_rev ); + plscmap1l( (PLBOOL) itype, npts, intensity, coord1, coord2, coord3, loc_alt_hue_path ); - if ( loc_rev != NULL ) - delete [] loc_rev; + if ( loc_alt_hue_path != NULL ) + delete [] loc_alt_hue_path; } // Set a given color from color map 0 by 8 bit RGB value Modified: trunk/bindings/c++/plstream.h =================================================================== --- trunk/bindings/c++/plstream.h 2012-08-13 22:21:57 UTC (rev 12211) +++ trunk/bindings/c++/plstream.h 2012-08-13 23:17:31 UTC (rev 12212) @@ -620,7 +620,7 @@ // intensity [0,1] (cmap 1 index) and position in HLS or RGB color space. void scmap1l( bool itype, PLINT npts, const PLFLT *intensity, - const PLFLT *coord1, const PLFLT *coord2, const PLFLT *coord3, const bool *rev = NULL ); + const PLFLT *coord1, const PLFLT *coord2, const PLFLT *coord3, const bool *alt_hue_path = NULL ); // void scmap1l( bool itype, PLINT npts, PLFLT *intensity, // PLFLT *coord1, PLFLT *coord2, PLFLT *coord3 ); @@ -631,7 +631,7 @@ void scmap1la( bool itype, PLINT npts, const PLFLT *intensity, const PLFLT *coord1, const PLFLT *coord2, const PLFLT *coord3, const PLFLT *a, - const bool *rev = NULL ); + const bool *alt_hue_path = NULL ); // Set a given color from color map 0 by 8 bit RGB value @@ -1156,7 +1156,7 @@ PLINT nx, PLINT ny, PLINT opt, PLINT side ); void poly3( PLINT n, const PLFLT *x, const PLFLT *y, const PLFLT *z, const PLINT *draw, PLINT ifcc ); void scmap1l( PLINT itype, PLINT npts, const PLFLT *intensity, - const PLFLT *coord1, const PLFLT *coord2, const PLFLT *coord3, const PLINT *rev ); + const PLFLT *coord1, const PLFLT *coord2, const PLFLT *coord3, const PLINT *alt_hue_path ); void shade( const PLFLT * const *a, PLINT nx, PLINT ny, PLINT ( *defined )( PLFLT, PLFLT ), Modified: trunk/bindings/d/plplot.d =================================================================== --- trunk/bindings/d/plplot.d 2012-08-13 22:21:57 UTC (rev 12211) +++ trunk/bindings/d/plplot.d 2012-08-13 23:17:31 UTC (rev 12212) @@ -582,16 +582,16 @@ // Set color map 1 colors using a piece-wise linear relationship between // intensity [0,1] (cmap 1 index) and position in HLS or RGB color space. void plscmap1l( PLBOOL itype, PLFLT[] intensity, PLFLT[] coord1, - PLFLT[] coord2, PLFLT[] coord3, PLBOOL[] rev = null ) + PLFLT[] coord2, PLFLT[] coord3, PLBOOL[] alt_hue_path = null ) { PLINT npts = intensity.length; assert( npts == coord1.length, "plscmap1l(): Arrays must be of same length!" ); assert( npts == coord2.length, "plscmap1l(): Arrays must be of same length!" ); assert( npts == coord3.length, "plscmap1l(): Arrays must be of same length!" ); - if ( rev != null ) + if ( alt_hue_path != null ) { - assert( npts - 1 == rev.length, "plscmap1l(): Array rev must be of same length then other arrays minus 1!" ); - c_plscmap1l( itype, npts, intensity.ptr, coord1.ptr, coord2.ptr, coord3.ptr, rev.ptr ); + assert( npts - 1 == alt_hue_path.length, "plscmap1l(): Array alt_hue_path must be of same length then other arrays minus 1!" ); + c_plscmap1l( itype, npts, intensity.ptr, coord1.ptr, coord2.ptr, coord3.ptr, alt_hue_path.ptr ); } else c_plscmap1l( itype, npts, intensity.ptr, coord1.ptr, coord2.ptr, coord3.ptr, null ); @@ -602,17 +602,17 @@ // intensity [0,1] (cmap 1 index) and position in HLS or RGB color space. // Will also linear interpolate alpha values. void plscmap1la( PLBOOL itype, PLFLT[] intensity, PLFLT[] coord1, - PLFLT[] coord2, PLFLT[] coord3, PLFLT[] a, PLBOOL[] rev = null ) + PLFLT[] coord2, PLFLT[] coord3, PLFLT[] a, PLBOOL[] alt_hue_path = null ) { PLINT npts = intensity.length; assert( npts == coord1.length, "plscmap1la(): Arrays must be of same length!" ); assert( npts == coord2.length, "plscmap1la(): Arrays must be of same length!" ); assert( npts == coord3.length, "plscmap1la(): Arrays must be of same length!" ); assert( npts == a.length, "plscmap1la(): Arrays must be of same length!" ); - if ( rev != null ) + if ( alt_hue_path != null ) { - assert( npts - 1 == rev.length, "plscmap1la(): Array rev must be of same length then other arrays minus 1!" ); - c_plscmap1la( itype, npts, intensity.ptr, coord1.ptr, coord2.ptr, coord3.ptr, a.ptr, rev.ptr ); + assert( npts - 1 == alt_hue_path.length, "plscmap1la(): Array alt_hue_path must be of same length then other arrays minus 1!" ); + c_plscmap1la( itype, npts, intensity.ptr, coord1.ptr, coord2.ptr, coord3.ptr, a.ptr, alt_hue_path.ptr ); } else c_plscmap1la( itype, npts, intensity.ptr, coord1.ptr, coord2.ptr, coord3.ptr, a.ptr, null ); @@ -1948,12 +1948,12 @@ // Set color map 1 colors using a piece-wise linear relationship between // intensity [0,1] (cmap 1 index) and position in HLS or RGB color space. -void c_plscmap1l( PLBOOL itype, PLINT npts, PLFLT *intensity, PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLBOOL *rev ); +void c_plscmap1l( PLBOOL itype, PLINT npts, PLFLT *intensity, PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLBOOL *alt_hue_path ); // Set color map 1 colors using a piece-wise linear relationship between // intensity [0,1] (cmap 1 index) and position in HLS or RGB color space. // Will also linear interpolate alpha values. -void c_plscmap1la( PLBOOL itype, PLINT npts, PLFLT *intensity, PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLFLT *a, PLBOOL *rev ); +void c_plscmap1la( PLBOOL itype, PLINT npts, PLFLT *intensity, PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLFLT *a, PLBOOL *alt_hue_path ); // Set number of colors in cmap 1 void c_plscmap1n( PLINT ncol1 ); Modified: trunk/bindings/f77/scstubs.c =================================================================== --- trunk/bindings/f77/scstubs.c 2012-08-13 22:21:57 UTC (rev 12211) +++ trunk/bindings/f77/scstubs.c 2012-08-13 23:17:31 UTC (rev 12212) @@ -802,16 +802,16 @@ void PLSCMAP1L( PLBOOL *itype, PLINT *npts, PLFLT *intensity, - PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLBOOL *rev ) + PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLBOOL *alt_hue_path ) { - c_plscmap1l( *itype, *npts, intensity, coord1, coord2, coord3, rev ); + c_plscmap1l( *itype, *npts, intensity, coord1, coord2, coord3, alt_hue_path ); } void PLSCMAP1LA( PLBOOL *itype, PLINT *npts, PLFLT *intensity, - PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLFLT *a, PLBOOL *rev ) + PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLFLT *a, PLBOOL *alt_hue_path ) { - c_plscmap1la( *itype, *npts, intensity, coord1, coord2, coord3, a, rev ); + c_plscmap1la( *itype, *npts, intensity, coord1, coord2, coord3, a, alt_hue_path ); } void Modified: trunk/bindings/f95/scstubs.c =================================================================== --- trunk/bindings/f95/scstubs.c 2012-08-13 22:21:57 UTC (rev 12211) +++ trunk/bindings/f95/scstubs.c 2012-08-13 23:17:31 UTC (rev 12212) @@ -178,11 +178,11 @@ void PLSCMAP1( PLINT *r, PLINT *g, PLINT *b, PLINT *ncol1 ); void PLSCMAP1A( PLINT *r, PLINT *g, PLINT *b, PLFLT *a, PLINT *ncol1 ); void PLSCMAP1L( PLBOOL *itype, PLINT *npts, PLFLT *intensity, - PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLBOOL *rev ); + PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLBOOL *alt_hue_path ); void PLSCMAP1L2( PLBOOL *itype, PLINT *npts, PLFLT *intensity, PLFLT *coord1, PLFLT *coord2, PLFLT *coord3 ); void PLSCMAP1LA( PLBOOL *itype, PLINT *npts, PLFLT *intensity, - PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLFLT *a, PLBOOL *rev ); + PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLFLT *a, PLBOOL *alt_hue_path ); void PLSCMAP1LA2( PLBOOL *itype, PLINT *npts, PLFLT *intensity, PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLFLT *a ); void PLSCMAP1N( PLINT *n ); @@ -1057,9 +1057,9 @@ void PLSCMAP1L( PLBOOL *itype, PLINT *npts, PLFLT *intensity, - PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLBOOL *rev ) + PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLBOOL *alt_hue_path ) { - c_plscmap1l( *itype, *npts, intensity, coord1, coord2, coord3, rev ); + c_plscmap1l( *itype, *npts, intensity, coord1, coord2, coord3, alt_hue_path ); } void @@ -1071,9 +1071,9 @@ void PLSCMAP1LA( PLBOOL *itype, PLINT *npts, PLFLT *intensity, - PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLFLT *a, PLBOOL *rev ) + PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLFLT *a, PLBOOL *alt_hue_path ) { - c_plscmap1la( *itype, *npts, intensity, coord1, coord2, coord3, a, rev ); + c_plscmap1la( *itype, *npts, intensity, coord1, coord2, coord3, a, alt_hue_path ); } void Modified: trunk/bindings/f95/sfstubsf95.f90 =================================================================== --- trunk/bindings/f95/sfstubsf95.f90 2012-08-13 22:21:57 UTC (rev 12211) +++ trunk/bindings/f95/sfstubsf95.f90 2012-08-13 23:17:31 UTC (rev 12212) @@ -1359,20 +1359,20 @@ call plscmap1af77( r, g, b, a, size(r) ) end subroutine plscmap1a - subroutine plscmap1l( rgbtype, intensity, coord1, coord2, coord3, rev) + subroutine plscmap1l( rgbtype, intensity, coord1, coord2, coord3, alt_hue_path) logical :: rgbtype real(kind=plflt), dimension(:) :: intensity, coord1, coord2, coord3 - logical, dimension(:) :: rev + logical, dimension(:) :: alt_hue_path - integer, dimension(size(rev)) :: irev + integer, dimension(size(alt_hue_path)) :: ialt_hue_path integer :: i integer :: type type = convert_to_int( rgbtype ) - do i = 1,size(rev) - irev(i) = convert_to_int( rev(i) ) + do i = 1,size(alt_hue_path) + ialt_hue_path(i) = convert_to_int( alt_hue_path(i) ) enddo - call plscmap1lf77( type, size(intensity), intensity, coord1, coord2, coord3, irev ) + call plscmap1lf77( type, size(intensity), intensity, coord1, coord2, coord3, ialt_hue_path ) end subroutine plscmap1l subroutine plscmap1l2( rgbtype, intensity, coord1, coord2, coord3) @@ -1385,20 +1385,20 @@ call plscmap1l2f77( type, size(intensity), intensity, coord1, coord2, coord3) end subroutine plscmap1l2 - subroutine plscmap1la( rgbtype, intensity, coord1, coord2, coord3, a, rev) + subroutine plscmap1la( rgbtype, intensity, coord1, coord2, coord3, a, alt_hue_path) logical :: rgbtype real(kind=plflt), dimension(:) :: intensity, coord1, coord2, coord3, a - logical, dimension(:) :: rev + logical, dimension(:) :: alt_hue_path - integer, dimension(size(rev)) :: irev + integer, dimension(size(alt_hue_path)) :: ialt_hue_path integer :: i integer :: type type = convert_to_int( rgbtype ) - do i = 1,size(rev) - irev(i) = convert_to_int( rev(i) ) + do i = 1,size(alt_hue_path) + ialt_hue_path(i) = convert_to_int( alt_hue_path(i) ) enddo - call plscmap1laf77( type, size(intensity), intensity, coord1, coord2, coord3, a, irev ) + call plscmap1laf77( type, size(intensity), intensity, coord1, coord2, coord3, a, ialt_hue_path ) end subroutine plscmap1la subroutine plscmap1la2( rgbtype, intensity, coord1, coord2, coord3, a) Modified: trunk/bindings/gnome2/lib/plplotcanvas.c =================================================================== --- trunk/bindings/gnome2/lib/plplotcanvas.c 2012-08-13 22:21:57 UTC (rev 12211) +++ trunk/bindings/gnome2/lib/plplotcanvas.c 2012-08-13 23:17:31 UTC (rev 12212) @@ -872,10 +872,10 @@ // Set color map 1 colors using a piece-wise linear relationship between // intensity [0,1] (cmap 1 index) and position in HLS or RGB color space. -void plplot_canvas_scmap1l( PlplotCanvas* self, PLINT itype, PLINT npts, PLFLT *intensity, PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLINT *rev ) +void plplot_canvas_scmap1l( PlplotCanvas* self, PLINT itype, PLINT npts, PLFLT *intensity, PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLINT *alt_hue_path ) { plsstrm( self->Nstream ); - plscmap1l( itype, npts, intensity, coord1, coord2, coord3, rev ); + plscmap1l( itype, npts, intensity, coord1, coord2, coord3, alt_hue_path ); } // Set number of colors in cmap 1 Modified: trunk/bindings/java/PLStream.java =================================================================== --- trunk/bindings/java/PLStream.java 2012-08-13 22:21:57 UTC (rev 12211) +++ trunk/bindings/java/PLStream.java 2012-08-13 23:17:31 UTC (rev 12212) @@ -773,10 +773,10 @@ } public void scmap1l( boolean itype, double[] intensity, double[] coord1, - double[] coord2, double[] coord3, boolean[] rev ) + double[] coord2, double[] coord3, boolean[] alt_hue_path ) { if ( set_stream() == -1 ) return; - plplotjavac.plscmap1l( itype, intensity, coord1, coord2, coord3, rev ); + plplotjavac.plscmap1l( itype, intensity, coord1, coord2, coord3, alt_hue_path ); } public void scmap1l( boolean itype, double[] intensity, double[] coord1, @@ -787,10 +787,10 @@ } public void scmap1la( boolean itype, double[] intensity, double[] coord1, - double[] coord2, double[] coord3, double[] a, boolean[] rev ) + double[] coord2, double[] coord3, double[] a, boolean[] alt_hue_path ) { if ( set_stream() == -1 ) return; - plplotjavac.plscmap1la( itype, intensity, coord1, coord2, coord3, a, rev ); + plplotjavac.plscmap1la( itype, intensity, coord1, coord2, coord3, a, alt_hue_path ); } public void scmap1la( boolean itype, double[] intensity, double[] coord1, @@ -1243,19 +1243,19 @@ } public void scmap1l( int itype, double[] intensity, double[] coord1, - double[] coord2, double[] coord3, int[] rev ) + double[] coord2, double[] coord3, int[] alt_hue_path ) { if ( set_stream() == -1 ) return; - boolean [] loc_rev = null; - if ( rev != null ) + boolean [] loc_alt_hue_path = null; + if ( alt_hue_path != null ) { - loc_rev = new boolean[rev.length]; - for ( int i = 0; i < rev.length; i++ ) + loc_alt_hue_path = new boolean[alt_hue_path.length]; + for ( int i = 0; i < alt_hue_path.length; i++ ) { - loc_rev[i] = ( rev[i] != 0 ); + loc_alt_hue_path[i] = ( alt_hue_path[i] != 0 ); } } - plplotjavac.plscmap1l( itype != 0, intensity, coord1, coord2, coord3, loc_rev ); + plplotjavac.plscmap1l( itype != 0, intensity, coord1, coord2, coord3, loc_alt_hue_path ); } public void shades( double[][] a, double xmin, double xmax, double ymin, Modified: trunk/bindings/ocaml/plplot.ml =================================================================== --- trunk/bindings/ocaml/plplot.ml 2012-08-13 22:21:57 UTC (rev 12211) +++ trunk/bindings/ocaml/plplot.ml 2012-08-13 23:17:31 UTC (rev 12212) @@ -399,10 +399,11 @@ let set_color ?stream c = with_stream ?stream (fun () -> plcol0 (int_of_color c)) - (** [set_color_scale ?stream ?pos ?rev colors] sets the color scale 1 (images + (** [set_color_scale ?stream ?pos ?alt_hue_path colors] sets the color scale 1 (images and shade plots) using a linear interpolation between the given list of - colors. If [rev] is true then the scale goes in the reverse order. *) - let set_color_scale ?stream ?pos ?rev colors = + colors. If [alt_hue_path] is true then the interpolation of any segment + uses the alternative hue path which always includes the hue = 0 point. *) + let set_color_scale ?stream ?pos ?alt_hue_path colors = let cs = Array.map rgb_of_color colors in let r, g, b = Array.map (fun (r, _, _) -> float_of_int r /. 255.0) cs, @@ -410,7 +411,7 @@ Array.map (fun (_, _, b) -> float_of_int b /. 255.0) cs in let positions = pos |? Array_ext.range ~n:(Array.length cs) 0.0 1.0 in - with_stream ?stream (fun () -> plscmap1l true positions r g b rev); + with_stream ?stream (fun () -> plscmap1l true positions r g b alt_hue_path); () (** Start a new page *) Modified: trunk/bindings/ocaml/plplot.mli =================================================================== --- trunk/bindings/ocaml/plplot.mli 2012-08-13 22:21:57 UTC (rev 12211) +++ trunk/bindings/ocaml/plplot.mli 2012-08-13 23:17:31 UTC (rev 12212) @@ -214,18 +214,19 @@ [color]. *) val set_color : ?stream:stream_t -> color_t -> unit - (** [set_color_scale ?stream ?pos ?rev colors] sets the continuous color map + (** [set_color_scale ?stream ?pos ?alt_hue_path colors] sets the continuous color map (color map 1) to a scale determined by interpolating between [colors]. [pos] can be used to specify where in the color scale ([0.0 - 1.0]) the a color interpolation point should fall. [pos] defaults to even spacing. - [rev] can be used to specify that a given segment should be - interpolated backwards. + [alt_hue_path] can be used to specify that a given segment should be + interpolated using the alternative hue path which always includes the + hue=0 point. {!Plplot.plscmap1l} is used internally to set the color scale. *) val set_color_scale : ?stream:stream_t -> ?pos:float array -> - ?rev:bool array -> + ?alt_hue_path:bool array -> color_t array -> unit (** PLplot has two color palettes - indexed (color map 0) and Modified: trunk/bindings/ocaml/plplot_h =================================================================== --- trunk/bindings/ocaml/plplot_h 2012-08-13 22:21:57 UTC (rev 12211) +++ trunk/bindings/ocaml/plplot_h 2012-08-13 23:17:31 UTC (rev 12212) @@ -411,11 +411,11 @@ void c_plscmap1l(PLBOOL itype, PLINT npts, PLFLT *intensity, - PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLBOOL *rev); + PLFLT *... [truncated message content] |
From: <and...@us...> - 2012-08-21 11:45:36
|
Revision: 12221 http://plplot.svn.sourceforge.net/plplot/?rev=12221&view=rev Author: andrewross Date: 2012-08-21 11:45:29 +0000 (Tue, 21 Aug 2012) Log Message: ----------- Tweak qt driver to include QT_LIBRARIES in qt_LINK_FLAGS as is done for all other drivers. Modified Paths: -------------- trunk/cmake/modules/qt.cmake trunk/drivers/CMakeLists.txt Modified: trunk/cmake/modules/qt.cmake =================================================================== --- trunk/cmake/modules/qt.cmake 2012-08-21 11:44:32 UTC (rev 12220) +++ trunk/cmake/modules/qt.cmake 2012-08-21 11:45:29 UTC (rev 12221) @@ -90,7 +90,7 @@ set(qt_COMPILE_FLAGS "${qt_COMPILE_FLAGS} -I${DIR}") endforeach(DIR ${QT_INCLUDES}) - set(qt_LINK_FLAGS) + set(qt_LINK_FLAGS ${QT_LIBRARIES}) set(qt_RPATH ${QT_LIBRARY_DIR}) filter_rpath(qt_RPATH) #message("qt_LIBRARY_DIR = ${qt_LIBRARY_DIR}") Modified: trunk/drivers/CMakeLists.txt =================================================================== --- trunk/drivers/CMakeLists.txt 2012-08-21 11:44:32 UTC (rev 12220) +++ trunk/drivers/CMakeLists.txt 2012-08-21 11:45:29 UTC (rev 12221) @@ -119,7 +119,6 @@ ${MATH_LIB} ${${SOURCE_ROOT_NAME}_LINK_FLAGS} ${${SOURCE_ROOT_NAME}_TARGETS} - ${QT_LIBRARIES} ) else(ANY_QT_DEVICE) message(FATAL_ERROR "Internal build system inconsistency. Attempt to build dynamic qt device when ANY_QT_DEVICE is false.") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hez...@us...> - 2012-10-03 13:22:25
|
Revision: 12235 http://plplot.svn.sourceforge.net/plplot/?rev=12235&view=rev Author: hezekiahcarty Date: 2012-10-03 13:22:14 +0000 (Wed, 03 Oct 2012) Log Message: ----------- Add support for multiple labels and axes to plcolorbar C examples 16 and 33 have been updated to match the API changes. Modified Paths: -------------- trunk/examples/c/x16c.c trunk/examples/c/x33c.c trunk/include/plplot.h trunk/src/pllegend.c Modified: trunk/examples/c/x16c.c =================================================================== --- trunk/examples/c/x16c.c 2012-10-03 13:08:38 UTC (rev 12234) +++ trunk/examples/c/x16c.c 2012-10-03 13:22:14 UTC (rev 12235) @@ -140,6 +140,23 @@ PLINT fill_width = 2, cont_color = 0, cont_width = 0; PLFLT colorbar_width, colorbar_height; +#define NUM_AXES 1 + PLINT n_axis_opts = NUM_AXES; + const char *axis_opts[] = { + "bcvtm", + }; + PLINT num_values[NUM_AXES]; + PLFLT *values[NUM_AXES]; + PLFLT filler_values[2] = { 0.0, 1.0 }; +#define NUM_LABELS 1 + PLINT n_labels = NUM_LABELS; + PLINT label_opts[] = { + PL_COLORBAR_LABEL_BOTTOM, + }; + const char *labels[] = { + "Magnitude", + }; + // Parse and process command line arguments plMergeOpts( options, "x16c options", notes ); @@ -244,11 +261,15 @@ plsmaj( 0.0, 0.5 ); plsmin( 0.0, 0.5 ); + num_values[0] = ns + 1; + values[0] = shedge; plcolorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, - 0.026, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, - cont_color, cont_width, 0.0, 0, "bcvtm", "", - ns + 1, shedge ); + 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, + cont_color, cont_width, 0.0, 0, + n_labels, label_opts, labels, + n_axis_opts, axis_opts, + num_values, (const PLFLT * const *)values ); // Reset text and tick sizes plschr( 0.0, 1.0 ); @@ -291,11 +312,15 @@ plsmaj( 0.0, 0.5 ); plsmin( 0.0, 0.5 ); + num_values[0] = ns + 1; + values[0] = shedge; plcolorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, - 0.026, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, - cont_color, cont_width, 0.0, 0, "bcvtm", "", - ns + 1, shedge ); + 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, + cont_color, cont_width, 0.0, 0, + n_labels, label_opts, labels, + n_axis_opts, axis_opts, + num_values, (const PLFLT * const *)values ); // Reset text and tick sizes plschr( 0.0, 1.0 ); @@ -338,11 +363,15 @@ plsmaj( 0.0, 0.5 ); plsmin( 0.0, 0.5 ); + num_values[0] = ns + 1; + values[0] = shedge; plcolorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, - 0.026, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, - cont_color, cont_width, 0.0, 0, "bcvtm", "", - ns + 1, shedge ); + 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, + cont_color, cont_width, 0.0, 0, + n_labels, label_opts, labels, + n_axis_opts, axis_opts, + num_values, (const PLFLT * const *)values ); // Reset text and tick sizes plschr( 0.0, 1.0 ); @@ -384,11 +413,15 @@ plsmaj( 0.0, 0.5 ); plsmin( 0.0, 0.5 ); + num_values[0] = ns + 1; + values[0] = shedge; plcolorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, - 0.026, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, - 2, 3, 0.0, 0, "bcvxm", "", - ns + 1, shedge ); + 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, + 2, 3, 0.0, 0, + n_labels, label_opts, labels, + n_axis_opts, axis_opts, + num_values, (const PLFLT * const *)values ); // Reset text and tick sizes plschr( 0.0, 1.0 ); @@ -481,11 +514,15 @@ plsmaj( 0.0, 0.5 ); plsmin( 0.0, 0.5 ); + num_values[0] = ns + 1; + values[0] = shedge; plcolorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, - 0.026, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, - cont_color, cont_width, 0.0, 0, "bcvtm", "", - ns + 1, shedge ); + 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, + cont_color, cont_width, 0.0, 0, + n_labels, label_opts, labels, + n_axis_opts, axis_opts, + num_values, (const PLFLT * const *)values ); // Reset text and tick sizes plschr( 0.0, 1.0 ); Modified: trunk/examples/c/x33c.c =================================================================== --- trunk/examples/c/x33c.c 2012-10-03 13:08:38 UTC (rev 12234) +++ trunk/examples/c/x33c.c 2012-10-03 13:22:14 UTC (rev 12235) @@ -160,11 +160,21 @@ PLINT sub_ticks; PLFLT low_cap_color, high_cap_color; PLINT vertical, ifn; - const char *axis_opts; - char label[200]; + PLINT n_axes = 1; + const char *axis_opts[1]; + PLINT n_labels = 1; + PLINT label_opts[1] = { 0 }; + char *label; char title[200]; PLFLT colorbar_width, colorbar_height; + PLINT n_values_array[1]; + PLFLT *values_array[1]; + label = (char *)malloc(sizeof(char) * 200); + + n_values_array[0] = n_values; + values_array[0] = values; + ticks = 0.0; sub_ticks = 0; @@ -207,26 +217,26 @@ { if ( cont_color == 0 || cont_width == 0 ) { - axis_opts = "uwtivn"; - //axis_opts = "uwtin"; + axis_opts[0] = "uwtivn"; + //axis_opts[0] = "uwtin"; } else { - axis_opts = "uwxvn"; - //axis_opts = "uwxn"; + axis_opts[0] = "uwxvn"; + //axis_opts[0] = "uwxn"; } } else { if ( cont_color == 0 || cont_width == 0 ) { - axis_opts = "uwtivm"; - //axis_opts = "uwtim"; + axis_opts[0] = "uwtivm"; + //axis_opts[0] = "uwtim"; } else { - axis_opts = "uwxvm"; - //axis_opts = "uwxm"; + axis_opts[0] = "uwxvm"; + //axis_opts[0] = "uwxm"; } } @@ -251,8 +261,9 @@ low_cap_color, high_cap_color, cont_color, cont_width, ticks, sub_ticks, - axis_opts, label, - n_values, values ); + n_labels, label_opts, (const char **)&label, + n_axes, axis_opts, + n_values_array, (const PLFLT * const *)values_array ); // Reset text and tick sizes plschr( 0.0, 1.0 ); Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2012-10-03 13:08:38 UTC (rev 12234) +++ trunk/include/plplot.h 2012-10-03 13:22:14 UTC (rev 12235) @@ -1256,8 +1256,9 @@ PLFLT low_cap_color, PLFLT high_cap_color, PLINT cont_color, PLINT cont_width, PLFLT ticks, PLINT sub_ticks, - const char *axis_opts, const char *label, - PLINT n_values, const PLFLT *values ); + PLINT n_labels, PLINT *label_opts, const char *label[], + PLINT n_axes, const char *axis_opts[], + PLINT *n_values, const PLFLT * const *values ); // Sets position of the light source PLDLLIMPEXP void Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2012-10-03 13:08:38 UTC (rev 12234) +++ trunk/src/pllegend.c 2012-10-03 13:22:14 UTC (rev 12235) @@ -1439,16 +1439,22 @@ //! design of plshades. //! @param ticks Spacing of major ticks, as for plbox. //! @param sub_ticks Number of subticks, as for plbox. +//! @param n_labels Number of labels to place around the colorbar +//! @param label_opts Options for each label. n_label total values. +//! @param labels Text labels for the colorbar. No label is drawn if no +//! label position is specified with one of the +//! PL_COLORBAR_LABEL_(RIGHT|TOP|LEFT|BOTTOM) bits in the corresponding +//! label_opts field. +//! @param n_axes Number of axis definitions provided. Must be >= 1. //! @param axis_opts Axis options for the colorbar's major axis, as for plbox. -//! @param label Text label for the colorbar. No label is drawn if no -//! label position is specified with one of the -//! PL_COLORBAR_LABEL_(RIGHT|TOP|LEFT|BOTTOM) bits in opt. -//! @param n_values Number of elements in the values array. +//! n_axes values in the array. +//! @param n_values Number of elements in each values array. //! @param values Numeric values for the data range represented by the //! colorbar. For PL_COLORBAR_SHADE, this should include one value per break //! between segments. For PL_COLORBAR_IMAGE and PL_COLORBAR_GRADIENT this //! includes two values, one for the maximum value on the scale and one for the -//! minimum value. +//! minimum value. The first entry will be used to render the colorbar +//! contents. All other entries will be used only for axis rendering. //! void @@ -1459,8 +1465,9 @@ PLFLT low_cap_color, PLFLT high_cap_color, PLINT cont_color, PLINT cont_width, PLFLT ticks, PLINT sub_ticks, - const char *axis_opts, const char *label, - PLINT n_values, const PLFLT *values ) + PLINT n_labels, PLINT *label_opts, const char *labels[], + PLINT n_axes, const char *axis_opts[], + PLINT *n_values, const PLFLT * const *values ) { // Min and max values // Assumes that the values array is sorted from smallest to largest @@ -1527,6 +1534,7 @@ // colorbar minus decorated colorbar, and the dml suffix refers to // decorated colorbar minus labelled and decorated colorbar.) PLFLT dx_subpage_omd, dy_subpage_omd, dx_subpage_dml, dy_subpage_dml; + PLFLT dx_subpage_omd_accu = 0.0, dy_subpage_omd_accu = 0.0, dx_subpage_dml_accu = 0.0, dy_subpage_dml_accu = 0.0; // Normalized subpage coordinates of the top left of undecorated // colorbar, PLFLT plot_x_subpage, plot_y_subpage; @@ -1544,7 +1552,8 @@ PLINT i, j, ni = 0, nj = 0, n_steps; PLFLT step_size; - PLBOOL if_edge; + PLBOOL if_edge = 0; + PLBOOL if_edge_b = 0, if_edge_c = 0, if_edge_u = 0, if_edge_w = 0; // Ratio of normalized subpage coordinates to mm coordinates in // x and y. @@ -1591,6 +1600,12 @@ return; } + if ( n_axes < 1 ) + { + plabort( "plcolorbar: At least one axis must be specified" ); + return; + } + // xdmin_save, etc., are the actual external relative viewport // coordinates within the current sub-page used only for // restoration at the end. @@ -1625,15 +1640,15 @@ opt = opt | PL_COLORBAR_ORIENT_RIGHT; } - if_edge = plP_stsearch( axis_opts, 'b' ) && - !plP_stsearch( axis_opts, 'u' ) && - plP_stsearch( axis_opts, 'c' ) && - !plP_stsearch( axis_opts, 'w' ); + for ( i = 0; i < n_axes; i++ ) + { + if_edge_b = if_edge_b || plP_stsearch( axis_opts[i], 'b' ); + if_edge_c = if_edge_c || plP_stsearch( axis_opts[i], 'c' ); + if_edge_u = if_edge_u || plP_stsearch( axis_opts[i], 'u' ); + if_edge_w = if_edge_w || plP_stsearch( axis_opts[i], 'w' ); + } + if_edge = if_edge_b && if_edge_c && !(if_edge_u || if_edge_w); - min_value = values[0]; - max_value = values[ n_values - 1 ]; - max_abs = MAX( fabs( min_value ), fabs( max_value ) ); - // Assumes that the colors array is sorted from smallest to largest. plgcmap1_range( &min_color, &max_color ); @@ -1658,111 +1673,127 @@ cap_extent_mm = cap_extent / spypmm; } - // Specify the proper window ranges for colorbar depending on - // orientation. - if ( opt & PL_COLORBAR_ORIENT_RIGHT ) + for ( i = n_axes - 1; i >= 0; i-- ) { - wx_min = min_value; - wx_max = max_value; - wy_min = 0.0; - wy_max = max_abs; - } - else if ( opt & PL_COLORBAR_ORIENT_TOP ) - { - wx_min = 0.0; - wx_max = max_abs; - wy_min = min_value; - wy_max = max_value; - } - else if ( opt & PL_COLORBAR_ORIENT_LEFT ) - { - wx_min = max_value; - wx_max = min_value; - wy_min = 0.0; - wy_max = max_abs; - } - else if ( opt & PL_COLORBAR_ORIENT_BOTTOM ) - { - wx_min = 0.0; - wx_max = max_abs; - wy_min = max_value; - wy_max = min_value; - } - else - { - plabort( "plcolorbar: Invalid PL_COLORBAR_ORIENT_* bits" ); - } + min_value = values[i][0]; + max_value = values[i][ n_values[i] - 1 ]; + max_abs = MAX( fabs( min_value ), fabs( max_value ) ); - // Viewport has correct size but has a shifted zero-point - // convention required by bounding-box calculations in draw_box, - // further bounding-box calculations in the cap_extent section - // below, and also in the calculate_limits call below that. - plvpor( 0., colorbar_width, 0., colorbar_height ); - plwind( wx_min, wx_max, wy_min, wy_max ); + // Specify the proper window ranges for colorbar depending on + // orientation. + if ( opt & PL_COLORBAR_ORIENT_RIGHT ) + { + wx_min = min_value; + wx_max = max_value; + wy_min = 0.0; + wy_max = max_abs; + } + else if ( opt & PL_COLORBAR_ORIENT_TOP ) + { + wx_min = 0.0; + wx_max = max_abs; + wy_min = min_value; + wy_max = max_value; + } + else if ( opt & PL_COLORBAR_ORIENT_LEFT ) + { + wx_min = max_value; + wx_max = min_value; + wy_min = 0.0; + wy_max = max_abs; + } + else if ( opt & PL_COLORBAR_ORIENT_BOTTOM ) + { + wx_min = 0.0; + wx_max = max_abs; + wy_min = max_value; + wy_max = min_value; + } + else + { + plabort( "plcolorbar: Invalid PL_COLORBAR_ORIENT_* bits" ); + } - // Calculate the bounding box for decorated (i.e., including tick - // marks + numerical tick labels) box. - draw_box( TRUE, opt, axis_opts, if_edge, - ticks, sub_ticks, n_values, values ); + // Viewport has correct size but has a shifted zero-point + // convention required by bounding-box calculations in draw_box, + // further bounding-box calculations in the cap_extent section + // below, and also in the calculate_limits call below that. + plvpor( 0., colorbar_width, 0., colorbar_height ); + plwind( wx_min, wx_max, wy_min, wy_max ); - if ( opt & PL_COLORBAR_CAP_LOW ) - { - if ( opt & PL_COLORBAR_ORIENT_RIGHT ) - plsc->boxbb_xmin = MIN( plsc->boxbb_xmin, -cap_extent_mm ); - if ( opt & PL_COLORBAR_ORIENT_TOP ) - plsc->boxbb_ymin = MIN( plsc->boxbb_ymin, -cap_extent_mm ); - if ( opt & PL_COLORBAR_ORIENT_LEFT ) - plsc->boxbb_xmax = MAX( plsc->boxbb_xmax, colorbar_width_mm + cap_extent_mm ); - if ( opt & PL_COLORBAR_ORIENT_BOTTOM ) - plsc->boxbb_ymax = MAX( plsc->boxbb_ymax, colorbar_height_mm + cap_extent_mm ); + // Calculate the bounding box for decorated (i.e., including tick + // marks + numerical tick labels) box. + draw_box( TRUE, opt, axis_opts[i], if_edge, + ticks, sub_ticks, n_values[i], values[i] ); + + if ( opt & PL_COLORBAR_CAP_LOW ) + { + if ( opt & PL_COLORBAR_ORIENT_RIGHT ) + plsc->boxbb_xmin = MIN( plsc->boxbb_xmin, -cap_extent_mm ); + if ( opt & PL_COLORBAR_ORIENT_TOP ) + plsc->boxbb_ymin = MIN( plsc->boxbb_ymin, -cap_extent_mm ); + if ( opt & PL_COLORBAR_ORIENT_LEFT ) + plsc->boxbb_xmax = MAX( plsc->boxbb_xmax, colorbar_width_mm + cap_extent_mm ); + if ( opt & PL_COLORBAR_ORIENT_BOTTOM ) + plsc->boxbb_ymax = MAX( plsc->boxbb_ymax, colorbar_height_mm + cap_extent_mm ); + } + if ( opt & PL_COLORBAR_CAP_HIGH ) + { + if ( opt & PL_COLORBAR_ORIENT_RIGHT ) + plsc->boxbb_xmax = MAX( plsc->boxbb_xmax, colorbar_width_mm + cap_extent_mm ); + if ( opt & PL_COLORBAR_ORIENT_TOP ) + plsc->boxbb_ymax = MAX( plsc->boxbb_ymax, colorbar_height_mm + cap_extent_mm ); + if ( opt & PL_COLORBAR_ORIENT_LEFT ) + plsc->boxbb_xmin = MIN( plsc->boxbb_xmin, -cap_extent_mm ); + if ( opt & PL_COLORBAR_ORIENT_BOTTOM ) + plsc->boxbb_ymin = MIN( plsc->boxbb_ymin, -cap_extent_mm ); + } + + // Calculate limits relevant to label position. + calculate_limits( position, x, y, + xdmin_adopted, xdmax_adopted, ydmin_adopted, ydmax_adopted, + colorbar_height, + &colorbar_width_d, &colorbar_height_d, + &colorbar_width_ac, &colorbar_height_ac, + &plot_x_subpage_bb, &plot_y_subpage_bb, + &dx_subpage_omd, &dy_subpage_omd ); + + // Viewport has correct size but has a shifted zero point + // convention required by bounding-box calculations in draw_label + // and further calculations in calculate_limits. + plvpor( 0., colorbar_width_d, 0., colorbar_height_d ); + + dx_subpage_omd_accu += dx_subpage_omd; + dy_subpage_omd_accu += dy_subpage_omd; } - if ( opt & PL_COLORBAR_CAP_HIGH ) + + for ( i = 0; i < n_labels; i++ ) { - if ( opt & PL_COLORBAR_ORIENT_RIGHT ) - plsc->boxbb_xmax = MAX( plsc->boxbb_xmax, colorbar_width_mm + cap_extent_mm ); - if ( opt & PL_COLORBAR_ORIENT_TOP ) - plsc->boxbb_ymax = MAX( plsc->boxbb_ymax, colorbar_height_mm + cap_extent_mm ); - if ( opt & PL_COLORBAR_ORIENT_LEFT ) - plsc->boxbb_xmin = MIN( plsc->boxbb_xmin, -cap_extent_mm ); - if ( opt & PL_COLORBAR_ORIENT_BOTTOM ) - plsc->boxbb_ymin = MIN( plsc->boxbb_ymin, -cap_extent_mm ); - } + // Calculate the bounding box for combined label + decorated box. + draw_label( TRUE, opt | label_opts[i], labels[i] ); - // Calculate limits relevant to label position. - calculate_limits( position, x, y, - xdmin_adopted, xdmax_adopted, ydmin_adopted, ydmax_adopted, - colorbar_height, - &colorbar_width_d, &colorbar_height_d, - &colorbar_width_ac, &colorbar_height_ac, - &plot_x_subpage_bb, &plot_y_subpage_bb, - &dx_subpage_omd, &dy_subpage_omd ); + // Calculate overall limits. + calculate_limits( position, x, y, + xdmin_adopted, xdmax_adopted, ydmin_adopted, ydmax_adopted, + colorbar_height_d, + &colorbar_width_l, &colorbar_height_l, + &colorbar_width_ac, &colorbar_height_ac, + &plot_x_subpage_bb, &plot_y_subpage_bb, + &dx_subpage_dml, &dy_subpage_dml ); - // Viewport has correct size but has a shifted zero point - // convention required by bounding-box calculations in draw_label - // and further calculations in calculate_limits. - plvpor( 0., colorbar_width_d, 0., colorbar_height_d ); + dx_subpage_dml_accu += dx_subpage_dml; + dy_subpage_dml_accu += dy_subpage_dml; + } - // Calculate the bounding box for combined label + decorated box. - draw_label( TRUE, opt, label ); - - // Calculate overall limits. - calculate_limits( position, x, y, - xdmin_adopted, xdmax_adopted, ydmin_adopted, ydmax_adopted, - colorbar_height_d, - &colorbar_width_l, &colorbar_height_l, - &colorbar_width_ac, &colorbar_height_ac, - &plot_x_subpage_bb, &plot_y_subpage_bb, - &dx_subpage_dml, &dy_subpage_dml ); - // Normalized subpage coordinates (top-left corner) for undecorated // colorbar - plot_x_subpage = plot_x_subpage_bb + dx_subpage_omd + dx_subpage_dml; - plot_y_subpage = plot_y_subpage_bb + dy_subpage_omd + dy_subpage_dml; + plot_x_subpage = plot_x_subpage_bb + dx_subpage_omd_accu + dx_subpage_dml_accu; + plot_y_subpage = plot_y_subpage_bb + dy_subpage_omd_accu + dy_subpage_dml_accu; // Coordinates of bounding box for decorated colorbar (without overall label). - label_vpor_xmin = plot_x_subpage_bb + dx_subpage_dml; + label_vpor_xmin = plot_x_subpage_bb + dx_subpage_dml_accu; label_vpor_xmax = label_vpor_xmin + colorbar_width_d; - label_vpor_ymax = plot_y_subpage_bb + dy_subpage_dml; + label_vpor_ymax = plot_y_subpage_bb + dy_subpage_dml_accu; label_vpor_ymin = label_vpor_ymax - colorbar_height_d; // Return bounding box width and height in adopted coordinates for @@ -1839,7 +1870,7 @@ // Interpolate // TODO: Should this be decided with an extra opt option instead of by // counting n_values? - if ( n_values == 2 ) + if ( n_values[0] == 2 ) { // Use the same number of steps as there are steps in // color palette 1. @@ -1906,7 +1937,7 @@ // No interpolation - use values array as-is else { - n_steps = n_values; + n_steps = n_values[0]; // Use the provided values in this case. if ( opt & PL_COLORBAR_ORIENT_RIGHT ) { @@ -1917,7 +1948,7 @@ { for ( j = 0; j < nj; j++ ) { - color_data[i][j] = values[i]; + color_data[i][j] = values[0][i]; } } } @@ -1930,7 +1961,7 @@ { for ( j = 0; j < nj; j++ ) { - color_data[i][j] = values[j]; + color_data[i][j] = values[0][j]; } } } @@ -1943,7 +1974,7 @@ { for ( j = 0; j < nj; j++ ) { - color_data[i][j] = values[ni - 1 - i]; + color_data[i][j] = values[0][ni - 1 - i]; } } } @@ -1956,7 +1987,7 @@ { for ( j = 0; j < nj; j++ ) { - color_data[i][j] = values[nj - 1 - j]; + color_data[i][j] = values[0][nj - 1 - j]; } } } @@ -1979,11 +2010,11 @@ // then segment B will be twice the length of segment A. PLcGrid grid; PLFLT grid_axis[2] = { 0.0, max_abs }; - n_steps = n_values; + n_steps = n_values[0]; // Use the provided values. if ( opt & PL_COLORBAR_ORIENT_RIGHT ) { - grid.xg = (PLFLT *) values; + grid.xg = (PLFLT *) values[0]; grid.yg = grid_axis; grid.nx = n_steps; grid.ny = 2; @@ -1994,14 +2025,14 @@ { for ( j = 0; j < nj; j++ ) { - color_data[i][j] = values[i]; + color_data[i][j] = values[0][i]; } } } else if ( opt & PL_COLORBAR_ORIENT_TOP ) { grid.xg = grid_axis; - grid.yg = (PLFLT *) values; + grid.yg = (PLFLT *) values[0]; grid.nx = 2; grid.ny = n_steps; ni = 2; @@ -2011,13 +2042,13 @@ { for ( j = 0; j < nj; j++ ) { - color_data[i][j] = values[j]; + color_data[i][j] = values[0][j]; } } } else if ( opt & PL_COLORBAR_ORIENT_LEFT ) { - grid.xg = (PLFLT *) values; + grid.xg = (PLFLT *) values[0]; grid.yg = grid_axis; grid.nx = n_steps; grid.ny = 2; @@ -2028,14 +2059,14 @@ { for ( j = 0; j < nj; j++ ) { - color_data[i][j] = values[ni - 1 - i]; + color_data[i][j] = values[0][ni - 1 - i]; } } } else if ( opt & PL_COLORBAR_ORIENT_BOTTOM ) { grid.xg = grid_axis; - grid.yg = (PLFLT *) values; + grid.yg = (PLFLT *) values[0]; grid.nx = 2; grid.ny = n_steps; ni = 2; @@ -2045,7 +2076,7 @@ { for ( j = 0; j < nj; j++ ) { - color_data[i][j] = values[nj - 1 - j]; + color_data[i][j] = values[0][nj - 1 - j]; } } } @@ -2056,7 +2087,7 @@ // Draw the color bar plshades( (const PLFLT * const *) color_data, ni, nj, NULL, wx_min, wx_max, wy_min, wy_max, - values, n_steps, 0, cont_color, cont_width, plfill, TRUE, + values[0], n_steps, 0, cont_color, cont_width, plfill, TRUE, pltr1, (void *) ( &grid ) ); plFree2dGrid( color_data, ni, nj ); } @@ -2158,15 +2189,57 @@ high_cap_color ); } - // Viewport and world coordinate ranges for box. - plvpor( vx_min, vx_max, vy_min, vy_max ); - plwind( wx_min, wx_max, wy_min, wy_max ); + for ( i = n_axes - 1; i >= 0; i-- ) + { + min_value = values[i][0]; + max_value = values[i][ n_values[i] - 1 ]; + max_abs = MAX( fabs( min_value ), fabs( max_value ) ); - // draw decorated (i.e., including tick marks + numerical tick - // labels) box. - draw_box( FALSE, opt, axis_opts, if_edge, - ticks, sub_ticks, n_values, values ); + // Specify the proper window ranges for colorbar depending on + // orientation. + if ( opt & PL_COLORBAR_ORIENT_RIGHT ) + { + wx_min = min_value; + wx_max = max_value; + wy_min = 0.0; + wy_max = max_abs; + } + else if ( opt & PL_COLORBAR_ORIENT_TOP ) + { + wx_min = 0.0; + wx_max = max_abs; + wy_min = min_value; + wy_max = max_value; + } + else if ( opt & PL_COLORBAR_ORIENT_LEFT ) + { + wx_min = max_value; + wx_max = min_value; + wy_min = 0.0; + wy_max = max_abs; + } + else if ( opt & PL_COLORBAR_ORIENT_BOTTOM ) + { + wx_min = 0.0; + wx_max = max_abs; + wy_min = max_value; + wy_max = min_value; + } + else + { + plabort( "plcolorbar: Invalid PL_COLORBAR_ORIENT_* bits" ); + } + // Viewport and world coordinate ranges for box. + plvpor( vx_min, vx_max, vy_min, vy_max ); + plwind( wx_min, wx_max, wy_min, wy_max ); + + // draw decorated (i.e., including tick marks + numerical tick + // labels) box. + draw_box( FALSE, opt, axis_opts[i], if_edge, + ticks, sub_ticks, n_values[i], values[i] ); + } + // Viewport and world coordinate ranges for bounding-box. plvpor( 0., 1., 0., 1. ); plwind( 0., 1., 0., 1. ); @@ -2197,7 +2270,10 @@ // Write label. // Viewport coordinate ranges for label. plvpor( label_vpor_xmin, label_vpor_xmax, label_vpor_ymin, label_vpor_ymax ); - draw_label( FALSE, opt, label ); + for ( i = 0; i < n_labels; i++ ) + { + draw_label( FALSE, opt | label_opts[i], labels[i] ); + } // Restore previous plot characteristics. plcol0( col0_save ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2012-10-05 21:31:47
|
Revision: 12242 http://plplot.svn.sourceforge.net/plplot/?rev=12242&view=rev Author: andrewross Date: 2012-10-05 21:31:41 +0000 (Fri, 05 Oct 2012) Log Message: ----------- Style recent code updates. Modified Paths: -------------- trunk/drivers/wingcc.c trunk/examples/c/x16c.c trunk/examples/c/x33c.c trunk/src/plctrl.c trunk/src/pllegend.c Modified: trunk/drivers/wingcc.c =================================================================== --- trunk/drivers/wingcc.c 2012-10-05 17:41:00 UTC (rev 12241) +++ trunk/drivers/wingcc.c 2012-10-05 21:31:41 UTC (rev 12242) @@ -227,7 +227,7 @@ pdt->pl_esc = (plD_esc_fp) plD_esc_wingcc; } -static TCHAR* szWndClass = _T("PlplotWin"); +static TCHAR* szWndClass = _T( "PlplotWin" ); //-------------------------------------------------------------------------- @@ -303,7 +303,7 @@ if ( dev->ps.fErase ) { dev->oldcolour = SetBkColor( dev->hdc, RGB( pls->cmap0[0].r, pls->cmap0[0].g, pls->cmap0[0].b ) ); - ExtTextOut( dev->hdc, 0, 0, ETO_OPAQUE, &dev->rect, _T(""), 0, 0 ); + ExtTextOut( dev->hdc, 0, 0, ETO_OPAQUE, &dev->rect, _T( "" ), 0, 0 ); SetBkColor( dev->hdc, dev->oldcolour ); } @@ -374,7 +374,7 @@ // dev->oldcolour = SetBkColor( dev->hdc, RGB( pls->cmap0[0].r, pls->cmap0[0].g, pls->cmap0[0].b ) ); - ExtTextOut( dev->hdc, 0, 0, ETO_OPAQUE, &dev->rect, _T(""), 0, 0 ); + ExtTextOut( dev->hdc, 0, 0, ETO_OPAQUE, &dev->rect, _T( "" ), 0, 0 ); SetBkColor( dev->hdc, dev->oldcolour ); dev->already_erased = 1; @@ -418,9 +418,9 @@ // Variables used for reading the registary keys // might eventually add a user defined pallette here, but for now it just does freetype // - TCHAR key_name[] = _T("Software\\PLplot\\wingcc"); - TCHAR Keyword_text[] = _T("freetype"); - TCHAR Keyword_smooth[] = _T("smooth"); + TCHAR key_name[] = _T( "Software\\PLplot\\wingcc" ); + TCHAR Keyword_text[] = _T( "freetype" ); + TCHAR Keyword_smooth[] = _T( "smooth" ); #endif DrvOpt wingcc_options[] = { @@ -436,8 +436,8 @@ // // Variable for storing the program name // - TCHAR *program; - int programlength; + TCHAR *program; + int programlength; // Allocate and initialize device-specific data @@ -547,17 +547,17 @@ RegisterClassEx( &dev->wndclass ); - // - //convert the program name to wide char if needed - // + // + //convert the program name to wide char if needed + // #ifdef UNICODE - printf(pls->program); - programlength=strlen(pls->program)+1; - program=malloc(programlength*sizeof(TCHAR)); - MultiByteToWideChar(CP_UTF8,0,pls->program,programlength,program,programlength); + printf( pls->program ); + programlength = strlen( pls->program ) + 1; + program = malloc( programlength * sizeof ( TCHAR ) ); + MultiByteToWideChar( CP_UTF8, 0, pls->program, programlength, program, programlength ); #else - program=pls->program; + program = pls->program; #endif // // Create our main window using that window class. @@ -577,7 +577,7 @@ ); #ifdef UNICODE - free(program); + free( program ); #endif // @@ -599,9 +599,9 @@ // dev->PopupMenu = CreatePopupMenu(); - AppendMenu( dev->PopupMenu, MF_STRING, PopupPrint, _T("Print") ); - AppendMenu( dev->PopupMenu, MF_STRING, PopupNextPage, _T("Next Page") ); - AppendMenu( dev->PopupMenu, MF_STRING, PopupQuit, _T("Quit") ); + AppendMenu( dev->PopupMenu, MF_STRING, PopupPrint, _T( "Print" ) ); + AppendMenu( dev->PopupMenu, MF_STRING, PopupNextPage, _T( "Next Page" ) ); + AppendMenu( dev->PopupMenu, MF_STRING, PopupQuit, _T( "Quit" ) ); #ifdef HAVE_FREETYPE @@ -1397,7 +1397,7 @@ ZeroMemory( &docinfo, sizeof ( docinfo ) ); docinfo.cbSize = sizeof ( docinfo ); - docinfo.lpszDocName = _T("Plplot Page"); + docinfo.lpszDocName = _T( "Plplot Page" ); // // Reset out printer structure to zero and initialise it Modified: trunk/examples/c/x16c.c =================================================================== --- trunk/examples/c/x16c.c 2012-10-05 17:41:00 UTC (rev 12241) +++ trunk/examples/c/x16c.c 2012-10-05 21:31:41 UTC (rev 12242) @@ -140,17 +140,17 @@ PLINT fill_width = 2, cont_color = 0, cont_width = 0; PLFLT colorbar_width, colorbar_height; -#define NUM_AXES 1 - PLINT n_axis_opts = NUM_AXES; +#define NUM_AXES 1 + PLINT n_axis_opts = NUM_AXES; const char *axis_opts[] = { "bcvtm", }; - PLINT num_values[NUM_AXES]; - PLFLT *values[NUM_AXES]; - PLFLT filler_values[2] = { 0.0, 1.0 }; -#define NUM_LABELS 1 - PLINT n_labels = NUM_LABELS; - PLINT label_opts[] = { + PLINT num_values[NUM_AXES]; + PLFLT *values[NUM_AXES]; + PLFLT filler_values[2] = { 0.0, 1.0 }; +#define NUM_LABELS 1 + PLINT n_labels = NUM_LABELS; + PLINT label_opts[] = { PL_COLORBAR_LABEL_BOTTOM, }; const char *labels[] = { @@ -262,14 +262,14 @@ plsmin( 0.0, 0.5 ); num_values[0] = ns + 1; - values[0] = shedge; + values[0] = shedge; plcolorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, cont_color, cont_width, 0.0, 0, n_labels, label_opts, labels, n_axis_opts, axis_opts, - num_values, (const PLFLT * const *)values ); + num_values, (const PLFLT * const *) values ); // Reset text and tick sizes plschr( 0.0, 1.0 ); @@ -313,14 +313,14 @@ plsmin( 0.0, 0.5 ); num_values[0] = ns + 1; - values[0] = shedge; + values[0] = shedge; plcolorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, cont_color, cont_width, 0.0, 0, n_labels, label_opts, labels, n_axis_opts, axis_opts, - num_values, (const PLFLT * const *)values ); + num_values, (const PLFLT * const *) values ); // Reset text and tick sizes plschr( 0.0, 1.0 ); @@ -364,14 +364,14 @@ plsmin( 0.0, 0.5 ); num_values[0] = ns + 1; - values[0] = shedge; + values[0] = shedge; plcolorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, cont_color, cont_width, 0.0, 0, n_labels, label_opts, labels, n_axis_opts, axis_opts, - num_values, (const PLFLT * const *)values ); + num_values, (const PLFLT * const *) values ); // Reset text and tick sizes plschr( 0.0, 1.0 ); @@ -414,14 +414,14 @@ plsmin( 0.0, 0.5 ); num_values[0] = ns + 1; - values[0] = shedge; + values[0] = shedge; plcolorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, 2, 3, 0.0, 0, n_labels, label_opts, labels, n_axis_opts, axis_opts, - num_values, (const PLFLT * const *)values ); + num_values, (const PLFLT * const *) values ); // Reset text and tick sizes plschr( 0.0, 1.0 ); @@ -515,14 +515,14 @@ plsmin( 0.0, 0.5 ); num_values[0] = ns + 1; - values[0] = shedge; + values[0] = shedge; plcolorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, cont_color, cont_width, 0.0, 0, n_labels, label_opts, labels, n_axis_opts, axis_opts, - num_values, (const PLFLT * const *)values ); + num_values, (const PLFLT * const *) values ); // Reset text and tick sizes plschr( 0.0, 1.0 ); Modified: trunk/examples/c/x33c.c =================================================================== --- trunk/examples/c/x33c.c 2012-10-05 17:41:00 UTC (rev 12241) +++ trunk/examples/c/x33c.c 2012-10-05 21:31:41 UTC (rev 12242) @@ -162,7 +162,7 @@ PLINT vertical, ifn; PLINT n_axes = 1; const char *axis_opts[1]; - PLINT n_labels = 1; + PLINT n_labels = 1; PLINT label_opts[1] = { 0 }; char *label; char title[200]; @@ -170,10 +170,10 @@ PLINT n_values_array[1]; PLFLT *values_array[1]; - label = (char *)malloc(sizeof(char) * 200); + label = (char *) malloc( sizeof ( char ) * 200 ); n_values_array[0] = n_values; - values_array[0] = values; + values_array[0] = values; ticks = 0.0; sub_ticks = 0; @@ -261,9 +261,9 @@ low_cap_color, high_cap_color, cont_color, cont_width, ticks, sub_ticks, - n_labels, label_opts, (const char **)&label, + n_labels, label_opts, (const char **) &label, n_axes, axis_opts, - n_values_array, (const PLFLT * const *)values_array ); + n_values_array, (const PLFLT * const *) values_array ); // Reset text and tick sizes plschr( 0.0, 1.0 ); Modified: trunk/src/plctrl.c =================================================================== --- trunk/src/plctrl.c 2012-10-05 17:41:00 UTC (rev 12241) +++ trunk/src/plctrl.c 2012-10-05 21:31:41 UTC (rev 12242) @@ -1673,14 +1673,14 @@ goto finish; } - r = (PLFLT *) malloc( (size_t) number_colors * sizeof ( PLFLT ) ); - g = (PLFLT *) malloc( (size_t) number_colors * sizeof ( PLFLT ) ); - b = (PLFLT *) malloc( (size_t) number_colors * sizeof ( PLFLT ) ); - ri = (PLINT *) malloc( (size_t) number_colors * sizeof ( PLINT ) ); - gi = (PLINT *) malloc( (size_t) number_colors * sizeof ( PLINT ) ); - bi = (PLINT *) malloc( (size_t) number_colors * sizeof ( PLINT ) ); - a = (PLFLT *) malloc( (size_t) number_colors * sizeof ( PLFLT ) ); - pos = (PLFLT *) malloc( (size_t) number_colors * sizeof ( PLFLT ) ); + r = (PLFLT *) malloc( (size_t) number_colors * sizeof ( PLFLT ) ); + g = (PLFLT *) malloc( (size_t) number_colors * sizeof ( PLFLT ) ); + b = (PLFLT *) malloc( (size_t) number_colors * sizeof ( PLFLT ) ); + ri = (PLINT *) malloc( (size_t) number_colors * sizeof ( PLINT ) ); + gi = (PLINT *) malloc( (size_t) number_colors * sizeof ( PLINT ) ); + bi = (PLINT *) malloc( (size_t) number_colors * sizeof ( PLINT ) ); + a = (PLFLT *) malloc( (size_t) number_colors * sizeof ( PLFLT ) ); + pos = (PLFLT *) malloc( (size_t) number_colors * sizeof ( PLFLT ) ); alt_hue_path = (PLBOOL *) malloc( (size_t) number_colors * sizeof ( PLBOOL ) ); if ( format_version == 0 ) Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2012-10-05 17:41:00 UTC (rev 12241) +++ trunk/src/pllegend.c 2012-10-05 21:31:41 UTC (rev 12242) @@ -1552,7 +1552,7 @@ PLINT i, j, ni = 0, nj = 0, n_steps; PLFLT step_size; - PLBOOL if_edge = 0; + PLBOOL if_edge = 0; PLBOOL if_edge_b = 0, if_edge_c = 0, if_edge_u = 0, if_edge_w = 0; // Ratio of normalized subpage coordinates to mm coordinates in @@ -1647,7 +1647,7 @@ if_edge_u = if_edge_u || plP_stsearch( axis_opts[i], 'u' ); if_edge_w = if_edge_w || plP_stsearch( axis_opts[i], 'w' ); } - if_edge = if_edge_b && if_edge_c && !(if_edge_u || if_edge_w); + if_edge = if_edge_b && if_edge_c && !( if_edge_u || if_edge_w ); // Assumes that the colors array is sorted from smallest to largest. plgcmap1_range( &min_color, &max_color ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2012-10-10 22:17:17
|
Revision: 12243 http://plplot.svn.sourceforge.net/plplot/?rev=12243&view=rev Author: andrewross Date: 2012-10-10 22:17:10 +0000 (Wed, 10 Oct 2012) Log Message: ----------- Commit on behalf of Phil Rosenberg. Fixes to the wxwidgets driver to properly support newline characters in strings. Modified Paths: -------------- trunk/drivers/wxwidgets.cpp trunk/drivers/wxwidgets.h trunk/drivers/wxwidgets_dc.cpp trunk/drivers/wxwidgets_gc.cpp trunk/src/plfreetype.c Modified: trunk/drivers/wxwidgets.cpp =================================================================== --- trunk/drivers/wxwidgets.cpp 2012-10-05 21:31:41 UTC (rev 12242) +++ trunk/drivers/wxwidgets.cpp 2012-10-10 22:17:10 UTC (rev 12243) @@ -176,6 +176,8 @@ devDesc = (const char **) malloc( NDEV * sizeof ( char** ) ); memset( devDesc, '\0', NDEV * sizeof ( char** ) ); ndev = NDEV; + + lineSpacing = 1.0; } @@ -234,14 +236,11 @@ char plplotEsc; plgesc( &plplotEsc ); - // Get the curent font - fontScale = 1.0; - yOffset = 0.0; - PLUNICODE fci; - plgfci( &fci ); - PSSetFont( fci ); - textWidth = 0; - textHeight = 0; + //Reset the size metrics + textWidth = 0; + textHeight = 0; + superscriptHeight = 0; + subscriptDepth = 0; while ( i < ucs4Len ) { Modified: trunk/drivers/wxwidgets.h =================================================================== --- trunk/drivers/wxwidgets.h 2012-10-05 21:31:41 UTC (rev 12242) +++ trunk/drivers/wxwidgets.h 2012-10-10 22:17:10 UTC (rev 12243) @@ -165,6 +165,10 @@ double fontSize; double fontScale; wxCoord textWidth, textHeight, textDescent, textLeading; + PLUNICODE fci; + //the distance between the superscript top and subscript base from the baseline + wxCoord superscriptHeight, subscriptDepth; + double lineSpacing; double yOffset; PLINT posX, posY; PLFLT rotation, cos_rot, sin_rot; Modified: trunk/drivers/wxwidgets_dc.cpp =================================================================== --- trunk/drivers/wxwidgets_dc.cpp 2012-10-05 21:31:41 UTC (rev 12242) +++ trunk/drivers/wxwidgets_dc.cpp 2012-10-10 22:17:10 UTC (rev 12243) @@ -337,15 +337,65 @@ wxCoord w, h, d, l; wxString str( wxConvUTF8.cMB2WC( utf8_string ), *wxConvCurrent ); + m_dc->GetTextExtent( str, &w, &h, &d, &l ); + if ( drawText ) - m_dc->DrawRotatedText( str, (wxCoord) ( posX / scalex - yOffset / scaley * sin_rot ), - (wxCoord) ( height - ( posY + yOffset * cos_rot ) / scaley ), + { + m_dc->DrawRotatedText( str, (wxCoord) ( posX - yOffset / scaley * sin_rot ), + (wxCoord) ( height - (wxCoord) ( posY + yOffset * cos_rot / scaley ) ), rotation * 180.0 / M_PI ); - posX += (PLINT) ( w * scalex * cos_rot ); - posY += (PLINT) ( w * scaley * sin_rot ); + posX += (PLINT) ( w * cos_rot ); + posY += (PLINT) ( w * sin_rot ); + } + textWidth += w; - textHeight = (wxCoord) ( textHeight > ( h + yOffset / scaley ) ? textHeight : ( h + yOffset / scaley ) ); + + //keep track of the height of superscript text, the depth of subscript + //text and the height of regular text + if ( yOffset > 0.0001 ) + { + //determine the height the text would have if it were full size + double currentOffset = yOffset; + double currentHeight = h; + while ( currentOffset > 0.0001 ) + { + currentOffset -= scaley * fontSize * fontScale / 2.; + currentHeight *= 1.25; + } + textHeight = (wxCoord) textHeight > ( currentHeight ) + ? textHeight + : currentHeight; + //work out the height including superscript + superscriptHeight = superscriptHeight > ( currentHeight + yOffset / scaley ) + ? superscriptHeight + : static_cast<int>( ( currentHeight + yOffset / scaley ) ); + } + else if ( yOffset < -0.0001 ) + { + //determine the height the text would have if it were full size + double currentOffset = yOffset; + double currentHeight = h; + double currentDepth = d; + while ( currentOffset < -0.0001 ) + { + currentOffset += scaley * fontSize * fontScale * 1.25 / 2.; + currentHeight *= 1.25; + currentDepth *= 1.25; + } + textHeight = (wxCoord) textHeight > currentHeight ? textHeight : currentHeight; + //work out the additional depth for subscript note an assumption has been made + //that the font size of (non-superscript and non-subscript) text is the same + //along a line. Currently there is no escape to change font size mid string + //so this should be fine + subscriptDepth = (wxCoord) subscriptDepth > ( ( -yOffset / scaley + h + d ) - ( currentDepth + textHeight ) ) + ? subscriptDepth + : ( ( -yOffset / scaley + h + d ) - ( currentDepth + textHeight ) ); + subscriptDepth = subscriptDepth > 0 ? subscriptDepth : 0; + } + else + textHeight = (wxCoord) textHeight > ( h ) ? textHeight : h; + memset( utf8_string, '\0', max_string_length ); } @@ -422,14 +472,67 @@ m_dc->SetTextForeground( wxColour( pls->curcolor.r, pls->curcolor.g, pls->curcolor.b ) ); m_dc->SetTextBackground( wxColour( pls->curcolor.r, pls->curcolor.g, pls->curcolor.b ) ); - posX = args->x; - posY = args->y; - PSDrawText( args->unicode_array, args->unicode_array_len, false ); + PLUNICODE *lineStart = args->unicode_array; + int lineLen = 0; + bool lineFeed = false; + bool carriageReturn = false; + wxCoord paraHeight = 0; + // Get the curent font + fontScale = 1.0; + yOffset = 0.0; + plgfci( &fci ); + PSSetFont( fci ); + while ( lineStart != args->unicode_array + args->unicode_array_len ) + { + while ( lineStart + lineLen != args->unicode_array + args->unicode_array_len + && *( lineStart + lineLen ) != (PLUNICODE) '\n' ) + { + lineLen++; + } + //set line feed for the beginning of this line and + //carriage return for the end + lineFeed = carriageReturn; + carriageReturn = lineStart + lineLen != args->unicode_array + args->unicode_array_len + && *( lineStart + lineLen ) == (PLUNICODE) ( '\n' ); + if ( lineFeed ) + paraHeight += textHeight + subscriptDepth; - posX = (PLINT) ( args->x - ( ( args->just * textWidth ) * cos_rot + ( 0.5 * textHeight ) * sin_rot ) * scalex ); - posY = (PLINT) ( args->y - ( ( args->just * textWidth ) * sin_rot - ( 0.5 * textHeight ) * cos_rot ) * scaley ); - PSDrawText( args->unicode_array, args->unicode_array_len, true ); + //remember the text parameters so they can be restored + double startingFontScale = fontScale; + double startingYOffset = yOffset; + PLUNICODE startingFci = fci; + // determine extent of text + posX = args->x / scalex; + posY = args->y / scaley; + + PSDrawText( lineStart, lineLen, false ); + + if ( lineFeed && superscriptHeight > textHeight ) + paraHeight += superscriptHeight - textHeight; + + // actually draw text, resetting the font first + fontScale = startingFontScale; + yOffset = startingYOffset; + fci = startingFci; + PSSetFont( fci ); + posX = (PLINT) ( args->x / scalex - ( args->just * textWidth ) * cos_rot - ( 0.5 * textHeight - paraHeight * lineSpacing ) * sin_rot ); //move to set alignment + posY = (PLINT) ( args->y / scaley - ( args->just * textWidth ) * sin_rot + ( 0.5 * textHeight - paraHeight * lineSpacing ) * cos_rot ); + PSDrawText( lineStart, lineLen, true ); //draw text + + lineStart += lineLen; + if ( carriageReturn ) + lineStart++; + lineLen = 0; + } + //posX = args->x; + //posY = args->y; + //PSDrawText( args->unicode_array, args->unicode_array_len, false ); + + //posX = (PLINT) ( args->x - ( ( args->just * textWidth ) * cos_rot + ( 0.5 * textHeight ) * sin_rot ) * scalex ); + //posY = (PLINT) ( args->y - ( ( args->just * textWidth ) * sin_rot - ( 0.5 * textHeight ) * cos_rot ) * scaley ); + //PSDrawText( args->unicode_array, args->unicode_array_len, true ); + AddtoClipRegion( 0, 0, width, height ); } Modified: trunk/drivers/wxwidgets_gc.cpp =================================================================== --- trunk/drivers/wxwidgets_gc.cpp 2012-10-05 21:31:41 UTC (rev 12242) +++ trunk/drivers/wxwidgets_gc.cpp 2012-10-10 22:17:10 UTC (rev 12243) @@ -36,6 +36,9 @@ // std and driver headers #include "wxwidgets.h" +#include <wx/string.h> +#include <string> + // only compile code if wxGraphicsContext available #if wxUSE_GRAPHICS_CONTEXT @@ -370,7 +373,10 @@ wxDouble w, h, d, l; wxString str( wxConvUTF8.cMB2WC( utf8_string ), *wxConvCurrent ); + + w = 0; m_context->GetTextExtent( str, &w, &h, &d, &l ); + if ( drawText ) { m_context->DrawText( str, 0, -yOffset / scaley ); @@ -378,9 +384,52 @@ } textWidth += static_cast<int>( w ); - textHeight = textHeight > ( h + yOffset / scaley ) - ? textHeight - : static_cast<int>( ( h + yOffset / scaley ) ); + + //keep track of the height of superscript text, the depth of subscript + //text and the height of regular text + if ( yOffset > 0.0001 ) + { + //determine the height the text would have if it were full size + double currentOffset = yOffset; + double currentHeight = h; + while ( currentOffset > 0.0001 ) + { + currentOffset -= scaley * fontSize * fontScale / 2.; + currentHeight *= 1.25; + } + textHeight = textHeight > ( currentHeight ) + ? textHeight + : static_cast<int>( ( currentHeight ) ); + //work out the height including superscript + superscriptHeight = superscriptHeight > ( currentHeight + yOffset / scaley ) + ? superscriptHeight + : static_cast<int>( ( currentHeight + yOffset / scaley ) ); + } + else if ( yOffset < -0.0001 ) + { + //determine the height the text would have if it were full size + double currentOffset = yOffset; + double currentHeight = h; + double currentDepth = d; + while ( currentOffset < -0.0001 ) + { + currentOffset += scaley * fontSize * fontScale * 1.25 / 2.; + currentHeight *= 1.25; + currentDepth *= 1.25; + } + textHeight = textHeight > currentHeight ? textHeight : static_cast<int>( ( currentHeight ) ); + //work out the additional depth for subscript note an assumption has been made + //that the font size of (non-superscript and non-subscript) text is the same + //along a line. Currently there is no escape to change font size mid string + //so this should be fine + subscriptDepth = subscriptDepth > ( ( -yOffset / scaley + h + d ) - ( currentDepth + textHeight ) ) + ? subscriptDepth + : static_cast<int>( ( -yOffset / scaley + h + d ) - ( currentDepth + textHeight ) ); + subscriptDepth = subscriptDepth > 0 ? subscriptDepth : 0; + } + else + textHeight = textHeight > h ? textHeight : static_cast<int>( h ); + memset( utf8_string, '\0', max_string_length ); } @@ -416,9 +465,9 @@ } // Check that unicode string isn't longer then the max we allow - if ( args->unicode_array_len >= 500 ) + if ( args->unicode_array_len >= max_string_length ) { - printf( "Sorry, the wxWidgets drivers only handles strings of length < %d\n", 500 ); + printf( "Sorry, the wxWidgets drivers only handles strings of length < %d\n", max_string_length ); return; } @@ -464,22 +513,67 @@ cos_shear = cos( shear ); sin_shear = sin( shear ); - // determine extend of text - PSDrawText( args->unicode_array, args->unicode_array_len, false ); - // actually draw text - m_context->PushState(); - m_context->Translate( args->x / scalex, height - args->y / scaley ); - wxGraphicsMatrix matrix = m_context->CreateMatrix( - cos_rot * stride, -sin_rot * stride, - cos_rot * sin_shear + sin_rot * cos_shear, - -sin_rot * sin_shear + cos_rot * cos_shear, - 0.0, 0.0 ); - m_context->ConcatTransform( matrix ); - m_context->Translate( -args->just * textWidth, -0.5 * textHeight ); - PSDrawText( args->unicode_array, args->unicode_array_len, true ); - m_context->PopState(); + PLUNICODE *lineStart = args->unicode_array; + int lineLen = 0; + bool lineFeed = false; + bool carriageReturn = false; + wxCoord paraHeight = 0; + // Get the curent font + fontScale = 1.0; + yOffset = 0.0; + plgfci( &fci ); + PSSetFont( fci ); + while ( lineStart != args->unicode_array + args->unicode_array_len ) + { + while ( lineStart + lineLen != args->unicode_array + args->unicode_array_len + && *( lineStart + lineLen ) != (PLUNICODE) '\n' ) + { + lineLen++; + } + //set line feed for the beginning of this line and + //carriage return for the end + lineFeed = carriageReturn; + carriageReturn = lineStart + lineLen != args->unicode_array + args->unicode_array_len + && *( lineStart + lineLen ) == (PLUNICODE) ( '\n' ); + if ( lineFeed ) + paraHeight += textHeight + subscriptDepth; + //remember the text parameters so they can be restored + double startingFontScale = fontScale; + double startingYOffset = yOffset; + PLUNICODE startingFci = fci; + + // determine extent of text + PSDrawText( lineStart, lineLen, false ); + + if ( lineFeed && superscriptHeight > textHeight ) + paraHeight += superscriptHeight - textHeight; + + // actually draw text, resetting the font first + fontScale = startingFontScale; + yOffset = startingYOffset; + fci = startingFci; + PSSetFont( fci ); + m_context->PushState(); //save current position + m_context->Translate( args->x / scalex, height - args->y / scaley ); //move to text starting position + wxGraphicsMatrix matrix = m_context->CreateMatrix( + cos_rot * stride, -sin_rot * stride, + cos_rot * sin_shear + sin_rot * cos_shear, + -sin_rot * sin_shear + cos_rot * cos_shear, + 0.0, 0.0 ); //create rotation transformation matrix + m_context->ConcatTransform( matrix ); //rotate + m_context->Translate( -args->just * textWidth, -0.5 * textHeight + paraHeight * lineSpacing ); //move to set alignment + PSDrawText( lineStart, lineLen, true ); //draw text + m_context->PopState(); //return to original position + + lineStart += lineLen; + if ( carriageReturn ) + lineStart++; + lineLen = 0; + } + + AddtoClipRegion( 0, 0, width, height ); m_context->ResetClip(); Modified: trunk/src/plfreetype.c =================================================================== --- trunk/src/plfreetype.c 2012-10-05 21:31:41 UTC (rev 12242) +++ trunk/src/plfreetype.c 2012-10-10 22:17:10 UTC (rev 12243) @@ -148,7 +148,7 @@ // static void FT_WriteStrW( PLStream *pls, const PLUNICODE *text, short len, int x, int y ); -static void FT_StrX_YW( PLStream *pls, const PLUNICODE *text, short len, int *xx, int *yy ); +static void FT_StrX_YW( PLStream *pls, const PLUNICODE *text, short len, int *xx, int *yy, int *overyy, int *underyy ); //-------------------------------------------------------------------------- // FT_StrX_YW() @@ -161,12 +161,12 @@ //-------------------------------------------------------------------------- void -FT_StrX_YW( PLStream *pls, const PLUNICODE *text, short len, int *xx, int *yy ) +FT_StrX_YW( PLStream *pls, const PLUNICODE *text, short len, int *xx, int *yy, int *overyy, int *underyy ) { FT_Data *FT = (FT_Data *) pls->FT; short i = 0; - FT_Vector akerning; - int x = 0, y = 0; + FT_Vector akerning, adjust; + int x = 0, y = 0, startingy; char esc; plgesc( &esc ); @@ -178,7 +178,13 @@ // and this is the best thing I could think of. // - y -= (int) FT->face->size->metrics.height; + y -= (int) FT->face->size->metrics.height; + startingy = y; + *yy = y; //note height is negative! + *overyy = 0; + *underyy = 0; + adjust.x = 0; + adjust.y = 0; // walk through the text character by character for ( i = 0; i < len; i++ ) @@ -191,9 +197,26 @@ switch ( text[i + 1] ) { case 'u': // super script + case 'U': // super script + adjust.y = FT->face->size->metrics.height / 2; + adjust.x = 0; + FT_Vector_Transform( &adjust, &FT->matrix ); + x += (int) adjust.x; + y -= (int) adjust.y; + //calculate excess height from superscripts, this will need changing if scale of sub/superscripts changes + *overyy = y - startingy < *overyy ? y - startingy : *overyy; + i++; + break; + case 'd': // subscript - case 'U': - case 'D': + case 'D': // subscript + adjust.y = -FT->face->size->metrics.height / 2; + adjust.x = 0; + FT_Vector_Transform( &adjust, &FT->matrix ); + x += (int) adjust.x; + y -= (int) adjust.y; + //calculate excess depth from subscripts, this will need changing if scale of sub/superscripts changes + *underyy = startingy - y < *underyy ? startingy - y : *underyy; i++; break; } @@ -202,6 +225,7 @@ { // FCI in text stream; change font accordingly. FT_SetFace( pls, text[i] ); + *yy = FT->face->size->metrics.height > -*yy ? -FT->face->size->metrics.height : *yy; } else { @@ -250,7 +274,6 @@ //yy=y>> 6; //xx=x>> 6; // - *yy = y; *xx = x; } @@ -772,8 +795,11 @@ fclose( infile ); } } - FontLookup[i].fci = TrueTypeLookup[i].fci; - FontLookup[i].pfont = (unsigned char *) FT->font_name[i]; + FontLookup[i].fci = TrueTypeLookup[i].fci; + if ( FT->font_name[i][0] == '\0' ) + FontLookup[i].pfont = NULL; + else + FontLookup[i].pfont = (unsigned char *) FT->font_name[i]; } // // Next, we check to see if -drvopt has been used on the command line to @@ -847,11 +873,14 @@ { FT_Data *FT = (FT_Data *) pls->FT; int x, y; - int w = 0, h = 0; + int w = 0, h = 0, overh = 0, underh = 0; PLFLT *t = args->xform; FT_Matrix matrix; PLFLT angle = PI * pls->diorot / 2; -// + PLUNICODE *line = args->unicode_array; + int linelen; + int prevlineheights = 0; + // Used later in a commented out section (See Rotate The Page), if that // section will never be used again, remove these as well. // PLINT clxmin, clxmax, clymin, clymax; @@ -862,7 +891,7 @@ FT_Fixed height; PLFLT height_factor; - if ( ( args->string != NULL ) || ( args->unicode_array_len > 0 ) ) + if ( ( args->unicode_array_len > 0 ) ) { // // Work out if either the font size, the font face or the @@ -885,6 +914,15 @@ // +// Split the text into lines based on the newline character +// + while ( line < args->unicode_array + args->unicode_array_len ) + { + linelen = 0; + while ( line[linelen] != '\n' && line + linelen < args->unicode_array + args->unicode_array_len ) + ++linelen; + +// // Now we work out how long the text is (for justification etc...) and how // high the text is. This is done on UN-TRANSFORMED text, since we will // apply our own transformations on it later, so it's necessary for us @@ -892,15 +930,15 @@ // that calculates the text size. // - FT->matrix.xx = 0x10000; - FT->matrix.xy = 0x00000; - FT->matrix.yx = 0x00000; - FT->matrix.yy = 0x10000; + FT->matrix.xx = 0x10000; + FT->matrix.xy = 0x00000; + FT->matrix.yx = 0x00000; + FT->matrix.yy = 0x10000; - FT_Vector_Transform( &FT->pos, &FT->matrix ); - FT_Set_Transform( FT->face, &FT->matrix, &FT->pos ); + FT_Vector_Transform( &FT->pos, &FT->matrix ); + FT_Set_Transform( FT->face, &FT->matrix, &FT->pos ); - FT_StrX_YW( pls, args->unicode_array, (short) args->unicode_array_len, &w, &h ); + FT_StrX_YW( pls, line, (short) linelen, &w, &h, &overh, &underh ); // // Set up the transformation Matrix @@ -925,20 +963,20 @@ // always a negative quantity. // - height_factor = (PLFLT) ( FT->face->ascender - FT->face->descender ) - / FT->face->ascender; - height = (FT_Fixed) ( 0x10000 * height_factor ); + height_factor = (PLFLT) ( FT->face->ascender - FT->face->descender ) + / FT->face->ascender; + height = (FT_Fixed) ( 0x10000 * height_factor ); #ifdef DJGPP - FT->matrix.xx = (FT_Fixed) ( (PLFLT) height * t[0] ); - FT->matrix.xy = (FT_Fixed) ( (PLFLT) height * t[2] ); - FT->matrix.yx = (FT_Fixed) ( (PLFLT) height * t[1] ); - FT->matrix.yy = (FT_Fixed) ( (PLFLT) height * t[3] ); + FT->matrix.xx = (FT_Fixed) ( (PLFLT) height * t[0] ); + FT->matrix.xy = (FT_Fixed) ( (PLFLT) height * t[2] ); + FT->matrix.yx = (FT_Fixed) ( (PLFLT) height * t[1] ); + FT->matrix.yy = (FT_Fixed) ( (PLFLT) height * t[3] ); #else - FT->matrix.xx = (FT_Fixed) ( (PLFLT) height * t[0] ); - FT->matrix.xy = (FT_Fixed) ( (PLFLT) height * t[1] ); - FT->matrix.yx = (FT_Fixed) ( (PLFLT) height * t[2] ); - FT->matrix.yy = (FT_Fixed) ( (PLFLT) height * t[3] ); + FT->matrix.xx = (FT_Fixed) ( (PLFLT) height * t[0] ); + FT->matrix.xy = (FT_Fixed) ( (PLFLT) height * t[1] ); + FT->matrix.yx = (FT_Fixed) ( (PLFLT) height * t[2] ); + FT->matrix.yy = (FT_Fixed) ( (PLFLT) height * t[3] ); #endif @@ -949,22 +987,22 @@ // will use freetypes matrix math stuff to do this for us. // - Cos_A = cos( angle ); - Sin_A = sin( angle ); + Cos_A = cos( angle ); + Sin_A = sin( angle ); - matrix.xx = (FT_Fixed) ( (PLFLT) 0x10000 * Cos_A ); + matrix.xx = (FT_Fixed) ( (PLFLT) 0x10000 * Cos_A ); #ifdef DJGPP - matrix.xy = (FT_Fixed) ( (PLFLT) 0x10000 * Sin_A * -1.0 ); - matrix.yx = (FT_Fixed) ( (PLFLT) 0x10000 * Sin_A ); + matrix.xy = (FT_Fixed) ( (PLFLT) 0x10000 * Sin_A * -1.0 ); + matrix.yx = (FT_Fixed) ( (PLFLT) 0x10000 * Sin_A ); #else - matrix.xy = (FT_Fixed) ( (PLFLT) 0x10000 * Sin_A ); - matrix.yx = (FT_Fixed) ( (PLFLT) 0x10000 * Sin_A * -1.0 ); + matrix.xy = (FT_Fixed) ( (PLFLT) 0x10000 * Sin_A ); + matrix.yx = (FT_Fixed) ( (PLFLT) 0x10000 * Sin_A * -1.0 ); #endif - matrix.yy = (FT_Fixed) ( (PLFLT) 0x10000 * Cos_A ); + matrix.yy = (FT_Fixed) ( (PLFLT) 0x10000 * Cos_A ); - FT_Matrix_Multiply( &matrix, &FT->matrix ); + FT_Matrix_Multiply( &matrix, &FT->matrix ); // Calculate a Vector from the matrix @@ -976,7 +1014,7 @@ // - FT_Vector_Transform( &FT->pos, &FT->matrix ); + FT_Vector_Transform( &FT->pos, &FT->matrix ); // Transform the font face @@ -988,7 +1026,7 @@ // it is asked for. // - FT_Set_Transform( FT->face, &FT->matrix, &FT->pos ); + FT_Set_Transform( FT->face, &FT->matrix, &FT->pos ); // Rotate the Page @@ -1004,51 +1042,51 @@ // Convert into normal coordinates from virtual coordinates // - if ( FT->scale != 0.0 ) // scale was set - { - x = (int) ( args->x / FT->scale ); + if ( FT->scale != 0.0 ) // scale was set + { + x = (int) ( args->x / FT->scale ); - if ( FT->invert_y == 1 ) - y = (int) ( FT->ymax - ( args->y / FT->scale ) ); + if ( FT->invert_y == 1 ) + y = (int) ( FT->ymax - ( args->y / FT->scale ) ); + else + y = (int) ( args->y / FT->scale ); + } else - y = (int) ( args->y / FT->scale ); - } - else - { - x = (int) ( args->x / FT->scalex ); + { + x = (int) ( args->x / FT->scalex ); - if ( FT->invert_y == 1 ) - y = (int) ( FT->ymax - ( args->y / FT->scaley ) ); - else - y = (int) ( args->y / FT->scaley ); - } + if ( FT->invert_y == 1 ) + y = (int) ( FT->ymax - ( args->y / FT->scaley ) ); + else + y = (int) ( args->y / FT->scaley ); + } - // Adjust for the justification and character height - // - // Eeeksss... this wasn't a nice bit of code to work out, let me tell you. - // I could not work out an entirely satisfactory solution that made - // logical sense, so came up with an "illogical" one as well. - // The logical one works fine for text in the normal "portrait" - // orientation, and does so for reasons you might expect it to work; But - // for all other orientations, the text's base line is either a little - // high, or a little low. This is because of the way the base-line pos - // is calculated from the decender height. The "dodgie" way of calculating - // the position is to use the character height here, then adjust for the - // decender height by a three-fold factor later on. That approach seems to - // work a little better for rotated pages, but why it should be so, I - // don't understand. You can compile in or out which way you want it by - // defining "DODGIE_DECENDER_HACK". - // - // note: the logic of the page rotation coming up next is that we pump in - // the justification factor and then use freetype to rotate and transform - // the values, which we then use to change the plotting location. - // + // Adjust for the justification and character height + // + // Eeeksss... this wasn't a nice bit of code to work out, let me tell you. + // I could not work out an entirely satisfactory solution that made + // logical sense, so came up with an "illogical" one as well. + // The logical one works fine for text in the normal "portrait" + // orientation, and does so for reasons you might expect it to work; But + // for all other orientations, the text's base line is either a little + // high, or a little low. This is because of the way the base-line pos + // is calculated from the decender height. The "dodgie" way of calculating + // the position is to use the character height here, then adjust for the + // decender height by a three-fold factor later on. That approach seems to + // work a little better for rotated pages, but why it should be so, I + // don't understand. You can compile in or out which way you want it by + // defining "DODGIE_DECENDER_HACK". + // + // note: the logic of the page rotation coming up next is that we pump in + // the justification factor and then use freetype to rotate and transform + // the values, which we then use to change the plotting location. + // #ifdef DODGIE_DECENDER_HACK - adjust.y = h; + adjust.y = h; #else - adjust.y = 0; + adjust.y = 0; #endif // (RL, on 2005-01-24) The code below uses floating point and division @@ -1069,14 +1107,14 @@ // only one glyph in the string in this case, we are okay here). // - if ( ( args->unicode_array_len == 2 ) - && ( args->unicode_array[0] == ( PL_FCI_MARK | 0x004 ) ) ) - { - adjust.x = (FT_Pos) ( args->just * ROUND( (PLFLT) FT->face->glyph->metrics.width / 64.0 ) ); - adjust.y = (FT_Pos) ROUND( (PLFLT) FT->face->glyph->metrics.height / 128.0 ); - } - else - { + if ( ( args->unicode_array_len == 2 ) + && ( args->unicode_array[0] == ( PL_FCI_MARK | 0x004 ) ) ) + { + adjust.x = (FT_Pos) ( args->just * ROUND( (PLFLT) FT->face->glyph->metrics.width / 64.0 ) ); + adjust.y = (FT_Pos) ROUND( (PLFLT) FT->face->glyph->metrics.height / 128.0 ); + } + else + { // (RL, on 2005-01-21) The vertical adjustment is set below, making // the DODGIE conditional moot. I use the value of h as return by FT_StrX_YW, // which should correspond to the total height of the text being @@ -1086,17 +1124,24 @@ // height_factor below. // - adjust.y = (FT_Pos) - ROUND( (PLFLT) FT->face->size->metrics.height / height_factor / 128.0 ); - adjust.x = (FT_Pos) ( args->just * ROUND( w / 64.0 ) ); - } + adjust.y = (FT_Pos) + ROUND( (PLFLT) FT->face->size->metrics.height / height_factor / 128.0 - ( prevlineheights + overh ) / 64.0 ); + adjust.x = (FT_Pos) ( args->just * ROUND( w / 64.0 ) ); + } - FT_Vector_Transform( &adjust, &FT->matrix ); // was /&matrix); - was I using the wrong matrix all this time ? + FT_Vector_Transform( &adjust, &FT->matrix ); // was /&matrix); - was I using the wrong matrix all this time ? - x -= (int) adjust.x; - y += (int) adjust.y; + x -= (int) adjust.x; + y += (int) adjust.y; - FT_WriteStrW( pls, args->unicode_array, (short) args->unicode_array_len, x, y ); // write it out + FT_WriteStrW( pls, line, (short) linelen, x, y ); // write it out + +// +// Move to the next line +// + line += linelen + 1; + prevlineheights += h + overh + underh; + } } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2012-10-22 19:36:15
|
Revision: 12245 http://plplot.svn.sourceforge.net/plplot/?rev=12245&view=rev Author: andrewross Date: 2012-10-22 19:36:07 +0000 (Mon, 22 Oct 2012) Log Message: ----------- Patch from Phil Rosenberg to include shapefile support for plmap if shapelib is detected. Add in shapefile map equivalents of the old plplot maps. Data from www.naturalearthdata.com. Further cmake tweaks by ANR. Modified Paths: -------------- trunk/cmake/modules/FindShapelib.cmake trunk/data/CMakeLists.txt trunk/src/plmap.c Added Paths: ----------- trunk/data/cglobe.shp trunk/data/cglobe.shx trunk/data/globe.shp trunk/data/globe.shx trunk/data/usa.shp trunk/data/usa.shx trunk/data/usaglobe.shp trunk/data/usaglobe.shx Modified: trunk/cmake/modules/FindShapelib.cmake =================================================================== --- trunk/cmake/modules/FindShapelib.cmake 2012-10-11 21:53:07 UTC (rev 12244) +++ trunk/cmake/modules/FindShapelib.cmake 2012-10-22 19:36:07 UTC (rev 12245) @@ -3,9 +3,8 @@ # This module defines the following uncached variables: # SHAPELIB_FOUND, if false, do not try to use shapelib. -# SHAPELIB_INCLUDE_DIRS, where to find shapefil.h. +# SHAPELIB_INCLUDE_DIR, where to find shapefil.h. # SHAPELIB_LIBRARIES, the libraries to link against to use shapelib -# SHAPELIB_LIBRARY_DIRS, the directory where libshp (either shared or static) # is found. find_path(SHAPELIB_INCLUDE_DIR shapefil.h /usr/local/include /usr/include) @@ -16,11 +15,8 @@ PATHS /usr/local/lib /usr/lib ) if(SHAPELIB_LIBRARY) - set(SHAPELIB_LIBRARY_DIR "") - get_filename_component(SHAPELIB_LIBRARY_DIRS ${SHAPELIB_LIBRARY} PATH) # Set uncached variables as per standard. set(SHAPELIB_FOUND ON) - set(SHAPELIB_INCLUDE_DIRS ${SHAPELIB_INCLUDE_DIR}) set(SHAPELIB_LIBRARIES ${SHAPELIB_LIBRARY}) endif(SHAPELIB_LIBRARY) endif(SHAPELIB_INCLUDE_DIR) Modified: trunk/data/CMakeLists.txt =================================================================== --- trunk/data/CMakeLists.txt 2012-10-11 21:53:07 UTC (rev 12244) +++ trunk/data/CMakeLists.txt 2012-10-22 19:36:07 UTC (rev 12245) @@ -20,12 +20,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA set(data_DATAFILES -cglobe.map -globe.map plstnd5.fnt plxtnd5.fnt -usa.map -usaglobe.map cmap0_default.pal cmap0_alternate.pal cmap0_white_bg.pal @@ -39,4 +35,26 @@ cmap1_lowfreq.pal ) +if(HAVE_SHAPELIB) + set(data_DATAFILES + ${data_DATAFILES} + cglobe.shx + cglobe.shp + globe.shx + globe.shp + usa.shx + usa.shp + usaglobe.shx + usaglobe.shp + ) +else(HAVE_SHAPELIB) + set(data_DATAFILES + ${data_DATAFILES} + cglobe.map + globe.map + usa.map + usaglobe.map + ) +endif(HAVE_SHAPELIB) + install(FILES ${data_DATAFILES} DESTINATION ${DATA_DIR}) Added: trunk/data/cglobe.shp =================================================================== (Binary files differ) Property changes on: trunk/data/cglobe.shp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/data/cglobe.shx =================================================================== (Binary files differ) Property changes on: trunk/data/cglobe.shx ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/data/globe.shp =================================================================== (Binary files differ) Property changes on: trunk/data/globe.shp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/data/globe.shx =================================================================== (Binary files differ) Property changes on: trunk/data/globe.shx ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/data/usa.shp =================================================================== (Binary files differ) Property changes on: trunk/data/usa.shp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/data/usa.shx =================================================================== (Binary files differ) Property changes on: trunk/data/usa.shx ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/data/usaglobe.shp =================================================================== (Binary files differ) Property changes on: trunk/data/usaglobe.shp ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/data/usaglobe.shx =================================================================== (Binary files differ) Property changes on: trunk/data/usaglobe.shx ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/src/plmap.c =================================================================== --- trunk/src/plmap.c 2012-10-11 21:53:07 UTC (rev 12244) +++ trunk/src/plmap.c 2012-10-22 19:36:07 UTC (rev 12245) @@ -39,8 +39,18 @@ // // +#define NEED_PLDEBUG 1 + #include "plplotP.h" +#ifdef HAVE_SHAPELIB +#include <shapefil.h> + +SHPHandle +OpenShapeFile( const char *fn ); + +#endif + //-------------------------------------------------------------------------- // void plmap(void (*mapform)(PLINT, PLFLT *, PLFLT *), const char *type, // PLFLT minlong, PLFLT maxlong, PLFLT minlat, PLFLT maxlat); @@ -67,6 +77,10 @@ // "usa" USA and state boundaries // "cglobe" continental outlines and countries // "usaglobe" USA, state boundaries and continental outlines +// alternatively the filename of a shapefile can be passed if PLplot has +// been compiled with shapelib. In this case either the base name of the +// file can be passed or the filename including the .shp or .shx suffix. +// Only the .shp and .shx files are used. // // minlong, maxlong are the values of the longitude on the left and right // side of the plot, respectively. The value of minlong must be less than @@ -80,38 +94,149 @@ // plotted. //-------------------------------------------------------------------------- +#ifdef HAVE_SHAPELIB +#define MAP_FILE "" +#define OpenMap OpenShapeFile +#define CloseMap SHPClose +#else #define MAP_FILE ".map" +#define OpenMap plLibOpenPdfstrm +#define CloseMap pdf_close #define OFFSET ( 180 * 100 ) #define SCALE 100.0 #define W_BUFSIZ ( 32 * 1024 ) +#endif void plmap( void ( *mapform )( PLINT, PLFLT *, PLFLT * ), const char *type, - PLFLT minlong, PLFLT maxlong, PLFLT PL_UNUSED( minlat ), PLFLT PL_UNUSED( maxlat ) ) + PLFLT minlong, PLFLT maxlong, PLFLT minlat, PLFLT maxlat ) { - PLINT wrap, sign; - int i, j; - PLFLT bufx[200], bufy[200], x[2], y[2]; - short int test[400]; + int i, j; + char *filename; + char *warning; + int n = 200; + PLFLT minsectlon, maxsectlon, minsectlat, maxsectlat; + const int ncopies = 5; //must be odd - original plus copies shifted by multiples of +/- 360 + const int mid = ncopies / 2 + 1; + PLFLT **bufx = NULL, **bufy = NULL; + int bufsize = 0; + +#ifdef HAVE_SHAPELIB + SHPHandle in; + int nentries; + int nparts; + int entrynumber = 0; + int partnumber = 0; + int shapetype; + double mins[4]; + double maxs[4]; + SHPObject *object = NULL; + double *bufxraw; + double *bufyraw; +#else register PDFstrm *in; - char filename[100]; - + //PLFLT bufx[ncopies][200], bufy[ncopies][200]; unsigned char n_buff[2], buff[800]; - int n; long int t; + int k; +#endif // // read map outline // - strncpy( filename, type, 99 ); - filename[99] = '\0'; - strncat( filename, MAP_FILE, 99 - strlen( filename ) ); + filename = malloc( strlen( type ) + strlen( MAP_FILE ) + 1 ); + strcpy( filename, type ); + strcat( filename, MAP_FILE ); + warning = malloc( strlen( type ) + strlen( MAP_FILE ) + 50 ); + strcpy( warning, "Could not find " ); + strcat( warning, filename ); + strcat( warning, " file." ); +#ifdef HAVE_SHAPELIB + if ( ( in = OpenShapeFile( filename ) ) == NULL ) + { + plwarn( warning ); + return; + } + SHPGetInfo( in, &nentries, &shapetype, mins, maxs ); +#else if ( ( in = plLibOpenPdfstrm( filename ) ) == NULL ) + { + plwarn( warning ); return; + } +#endif + bufx = malloc( ncopies * sizeof ( PLFLT* ) ); + bufy = malloc( ncopies * sizeof ( PLFLT* ) ); + for ( i = 0; i < ncopies; i++ ) + { + bufx[i] = NULL; + bufy[i] = NULL; + } + for (;; ) { +#ifdef HAVE_SHAPELIB + //break condition if we've reached the end of the file + if ( entrynumber == nentries ) + break; + //if partnumber == 0 then we need to load the next object + if ( partnumber == 0 ) + { + object = SHPReadObject( in, entrynumber ); + nparts = object->nParts; + } + + //work out how many points are in the current part + if ( partnumber == ( nparts - 1 ) ) + n = object->nVertices - object->panPartStart[partnumber]; + else + n = object->panPartStart[partnumber + 1] - object->panPartStart[partnumber]; +#endif + //allocate memory for the data + if ( n > bufsize ) + { + bufsize = n; + for ( i = 0; i < ncopies; i++ ) + { + if ( bufx[i] ) + free( bufx[i] ); + if ( bufy[i] ) + free( bufy[i] ); + bufx[i] = malloc( bufsize * sizeof ( double ) ); + bufy[i] = malloc( bufsize * sizeof ( double ) ); + } + } + +#ifdef HAVE_SHAPELIB + //point the plot buffer to the correct starting vertex + //and copy it to the PLFLT arrays + bufxraw = object->padfX + object->panPartStart[partnumber]; + bufyraw = object->padfY + object->panPartStart[partnumber]; + for ( i = 0; i < n; i++ ) + { + bufx[mid][i] = (PLFLT) bufxraw[i]; + for ( j = 0; j < ncopies; j++ ) + bufy[j][i] = (PLFLT) bufyraw[i]; + } + + //set the minlat/lon of the object + minsectlon = object->dfXMin; + maxsectlon = object->dfXMax; + minsectlat = object->dfYMin; + maxsectlat = object->dfYMax; + + //increment the partnumber or if we've reached the end of + //an entry increment the entrynumber and set partnumber to 0 + if ( partnumber == nparts - 1 ) + { + entrynumber++; + partnumber = 0; + } + else + partnumber++; +#else // read in # points in segment if ( pdf_rdx( n_buff, (long) sizeof ( unsigned char ) * 2, in ) == 0 ) break; @@ -125,114 +250,101 @@ for ( j = i = 0; i < n; i++, j += 2 ) { - t = ( buff[j] << 8 ) + buff[j + 1]; - bufx[i] = ( (PLFLT) t - OFFSET ) / SCALE; + t = ( buff[j] << 8 ) + buff[j + 1]; + bufx[mid][i] = ( (PLFLT) t - OFFSET ) / SCALE; } for ( i = 0; i < n; i++, j += 2 ) { - t = ( buff[j] << 8 ) + buff[j + 1]; - bufy[i] = ( (PLFLT) t - OFFSET ) / SCALE; + t = ( buff[j] << 8 ) + buff[j + 1]; + bufy[0][i] = ( (PLFLT) t - OFFSET ) / SCALE; + for ( k = 1; k < ncopies; k++ ) + bufy[k][i] = bufy[0][i]; } + //set the min/max section lat/lon with extreme values + //to be overwritten later + minsectlon = 1000.; + maxsectlon = -1000.; + minsectlat = 1000.; + maxsectlat = -1000.; - for ( i = 0; i < n; i++ ) - { - while ( bufx[i] < minlong ) - { - bufx[i] += 360.0; - } - while ( bufx[i] > maxlong ) - { - bufx[i] -= 360.0; - } - } +#endif + //two obvious issues exist here with plotting longitudes: + // + //1) wraparound causing lines which go the wrong way round + // the globe + //2) some people plot lon from 0-360 deg, others from -180 - +180 + // + //we can cure these problems by conditionally adding/subtracting + //360 degrees to each data point in order to ensure that the + //distance between adgacent points is always less than 180 + //degrees, then plotting up to 2 out of 5 copies of the data + //each separated by 360 degrees. - // remove last 2 points if both outside of domain and won't plot - -// AR: 18/11/01 -// I have commented out the next section which supposedly -// removes points that do not plot within the domain. -// -// This code appears at any rate to be superseded by the next -// block of code that checks for wrapping problems. Removing -// this code seems to have fixed up the problems with mapping -// function, but I do not wish to delete it outright just now in -// case I have managed to miss something. -// - -// while (n > 1) { -// if ((bufx[n-1] < minlong && bufx[n-2] < minlong) || -// (bufx[n-1] > maxlong && bufx[n-2] > maxlong) || -// (bufy[n-1] < minlat && bufy[n-2] < minlat) || -// (bufy[n-1] > maxlat && bufy[n-2] > maxlat)) { -// n--; -// } -// else { -// break; -// } -// } -// if (n <= 1) continue; -// - - if ( mapform != NULL ) - ( *mapform )( n, bufx, bufy ); // moved transformation to here - // so bound-checking worked right - - wrap = 0; - // check for wrap around problems for ( i = 0; i < n - 1; i++ ) { - // jc: this code is wrong, as the bufx/y are floats that are - // converted to ints before abs() is called. Thus, small - // differences are masked off. The proof that it is wrong is - // that when replacing abs() with fabs(), as it should be, - // the code works the wrong way. What a proof :-) - // - // test[i] = abs((bufx[i]-bufx[i+1])) > abs(bufy[i]/3); - // - // If the intended behaviour is *really* that, than an - // explicit cast should be used to help other programmers, as - // is done bellow!!! - // - - test[i] = abs( (int) ( bufx[i] - bufx[i + 1] ) ) > abs( (int) bufy[i] / 3 ); // Changed this from 30 degrees so it is now "polar sensitive" - if ( test[i] ) - wrap = 1; + if ( bufx[mid][i] - bufx[mid][i + 1] > 180. ) + bufx[mid][i + 1] += 360.; + else if ( bufx[mid][i] - bufx[mid][i + 1] < -180. ) + bufx[mid][i + 1] -= 360.; } - - if ( wrap == 0 ) + for ( i = 0; i < n; i++ ) { - plline( n, bufx, bufy ); + for ( j = 0; j < mid; j++ ) + bufx[j][i] = bufx[mid][i] + 360. * (PLFLT) ( j - mid ); + for ( j = mid + 1; j < ncopies; j++ ) + bufx[j][i] = bufx[mid][i] + 360. * (PLFLT) ( j - mid ); +#ifndef HAVE_SHAPELIB + minsectlon = MIN( minsectlon, bufx[mid][i] ); + maxsectlon = MAX( minsectlon, bufx[mid][i] ); + minsectlat = MIN( minsectlat, bufy[mid][i] ); + maxsectlat = MAX( minsectlat, bufy[mid][i] ); +#endif } - else + + //check if the latitude range means we need to plot this section + if ( ( maxsectlat > minlat ) && ( minsectlat < maxlat ) ) { - for ( i = 0; i < n - 1; i++ ) + //check which of the translated maps fall within the + //range and transform and plot them - note more than one + //map may be needed due to wrapping + for ( j = 0; j < ncopies; j++ ) { - x[0] = bufx[i]; - x[1] = bufx[i + 1]; - y[0] = bufy[i]; - y[1] = bufy[i + 1]; - if ( test[i] == 0 ) + if ( ( minsectlon + 360. * (PLFLT) ( j - mid ) < maxlong ) + && ( maxsectlon + 360. * (PLFLT) ( j - mid ) > minlong ) ) { - plline( 2, x, y ); + if ( mapform != NULL ) + ( *mapform )( n, bufx[j], bufy[j] ); + plline( n, bufx[j], bufy[j] ); } - else // this code seems to supercede the block commented out above - { - // segment goes off the edge - sign = ( x[1] > x[0] ) ? 1 : -1; - x[1] -= sign * 360.0; - plline( 2, x, y ); - x[0] = bufx[i]; - x[1] = bufx[i + 1]; - y[0] = bufy[i]; - y[1] = bufy[i + 1]; - x[0] += sign * 360.0; - plline( 2, x, y ); - } } } + + + +#ifdef HAVE_SHAPELIB + if ( partnumber == 0 ) + SHPDestroyObject( object ); +#endif } // Close map file +#ifdef HAVE_SHAPELIB + SHPClose( in ); +#else pdf_close( in ); +#endif + + //free memory + for ( i = 0; i < ncopies; i++ ) + { + if ( bufx[i] ) + free( bufx[i] ); + if ( bufy[i] ) + free( bufy[i] ); + } + free( bufx ); + free( bufy ); + free( filename ); + free( warning ); } //-------------------------------------------------------------------------- @@ -333,3 +445,102 @@ } } } + +//-------------------------------------------------------------------------- +// SHPHandle OpenShapeFile(fn) +// +//! Returns a handle to a shapefile from the filename fn. Content based on +//! plLibOpenPdfstrm in plctrl.c +//! Locations checked: +//! PLPLOT_LIB_ENV = $(PLPLOT_LIB) +//! current directory +//! PLPLOT_HOME_ENV/lib = $(PLPLOT_HOME)/lib +//! DATA_DIR +//! PLLIBDEV +//! +//! @param fn Name of the file. +//! +//! @Return handle to a shapefile on success or NULL if the file cannot be +//! found +//-------------------------------------------------------------------------- +#ifdef HAVE_SHAPELIB +SHPHandle +OpenShapeFile( const char *fn ) +{ + SHPHandle file; + char *fs = NULL, *dn = NULL; + +//*** search build tree *** + + if ( plInBuildTree() == 1 ) + { + plGetName( SOURCE_DIR, "data", fn, &fs ); + + if ( ( file = SHPOpen( fs, "rb" ) ) != NULL ) + goto done; + } + +//*** search PLPLOT_LIB_ENV = $(PLPLOT_LIB) *** + +#if defined ( PLPLOT_LIB_ENV ) + if ( ( dn = getenv( PLPLOT_LIB_ENV ) ) != NULL ) + { + plGetName( dn, "", fn, &fs ); + + if ( ( file = SHPOpen( fs, "rb" ) ) != NULL ) + goto done; + fprintf( stderr, PLPLOT_LIB_ENV "=\"%s\"\n", dn ); // what IS set? + } +#endif // PLPLOT_LIB_ENV + +//*** search current directory *** + + if ( ( file = SHPOpen( fn, "rb" ) ) != NULL ) + { + pldebug( "OpenShapeFile", "Found file %s in current directory.\n", fn ); + free_mem( fs ); + return ( file ); + } + +//*** search PLPLOT_HOME_ENV/lib = $(PLPLOT_HOME)/lib *** + +#if defined ( PLPLOT_HOME_ENV ) + if ( ( dn = getenv( PLPLOT_HOME_ENV ) ) != NULL ) + { + plGetName( dn, "lib", fn, &fs ); + + if ( ( file = SHPOpen( fs, "rb" ) ) != NULL ) + goto done; + fprintf( stderr, PLPLOT_HOME_ENV "=\"%s\"\n", dn ); // what IS set? + } +#endif // PLPLOT_HOME_ENV/lib + +//*** search installed location *** + +#if defined ( DATA_DIR ) + plGetName( DATA_DIR, "", fn, &fs ); + + if ( ( file = SHPOpen( fs, "rb" ) ) != NULL ) + goto done; +#endif // DATA_DIR + +//*** search hardwired location *** + +#ifdef PLLIBDEV + plGetName( PLLIBDEV, "", fn, &fs ); + + if ( ( file = SHPOpen( fs, "rb" ) ) != NULL ) + goto done; +#endif // PLLIBDEV + +//*** not found, give up *** + pldebug( "OpenShapeFile", "File %s not found.\n", fn ); + free_mem( fs ); + return NULL; + +done: + pldebug( "OpenShapeFile", "Found file %s\n", fs ); + free_mem( fs ); + return ( file ); +} +#endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2012-10-22 21:08:58
|
Revision: 12249 http://plplot.svn.sourceforge.net/plplot/?rev=12249&view=rev Author: andrewross Date: 2012-10-22 21:08:52 +0000 (Mon, 22 Oct 2012) Log Message: ----------- Enable colorbar support by default for example 16. Enable colorbar support in C++ and update C++ example 16 accordingly. Modified Paths: -------------- trunk/bindings/c++/plstream.cc trunk/bindings/c++/plstream.h trunk/examples/c/x16c.c trunk/examples/c++/x16.cc Modified: trunk/bindings/c++/plstream.cc =================================================================== --- trunk/bindings/c++/plstream.cc 2012-10-22 21:07:18 UTC (rev 12248) +++ trunk/bindings/c++/plstream.cc 2012-10-22 21:08:52 UTC (rev 12249) @@ -1013,18 +1013,24 @@ symbol_colors, symbol_scales, symbol_numbers, symbols ); } -void plstream::colorbar( PLINT /*position*/, PLINT /*opt*/, PLFLT /*x*/, PLFLT /*y*/, PLFLT /*length*/, PLFLT /*width*/, PLINT /*cont_color*/, PLINT /*cont_width*/, - PLFLT /*ticks*/, PLINT /*sub_ticks*/, - const char * /*axis_opts*/, const char * /*label*/, - PLINT /*n_colors*/, const PLFLT * /*colors*/, const PLFLT * /*values*/ ) +void plstream::colorbar( PLFLT *p_colorbar_width, PLFLT *p_colorbar_height, + PLINT opt, PLINT position, PLFLT x, PLFLT y, + PLFLT x_length, PLFLT y_length, + PLINT bg_color, PLINT bb_color, PLINT bb_style, + PLFLT low_cap_color, PLFLT high_cap_color, + PLINT cont_color, PLINT cont_width, + PLFLT ticks, PLINT sub_ticks, + PLINT n_labels, PLINT *label_opts, const char *label[], + PLINT n_axes, const char *axis_opts[], + PLINT *n_values, const PLFLT * const *values ) { set_stream(); -#if 0 - plcolorbar( position, opt, x, y, length, width, - cont_color, cont_width, ticks, sub_ticks, axis_opts, - label, n_colors, colors, values ); -#endif + plcolorbar( p_colorbar_width, p_colorbar_height, opt, position, x, y, + x_length, y_length, bg_color, bb_color, bb_style, + low_cap_color, high_cap_color, cont_color, cont_width, + ticks, sub_ticks, n_labels, label_opts, label, + n_axes, axis_opts, n_values, values ); } Modified: trunk/bindings/c++/plstream.h =================================================================== --- trunk/bindings/c++/plstream.h 2012-10-22 21:07:18 UTC (rev 12248) +++ trunk/bindings/c++/plstream.h 2012-10-22 21:08:52 UTC (rev 12249) @@ -442,12 +442,17 @@ const PLINT *symbol_colors, const PLFLT *symbol_scales, const PLINT *symbol_numbers, const char **symbols ); - void colorbar( PLINT position, PLINT opt, PLFLT x, PLFLT y, PLFLT length, PLFLT width, PLINT cont_color, PLINT cont_width, + void colorbar( PLFLT *p_colorbar_width, PLFLT *p_colorbar_height, + PLINT opt, PLINT position, PLFLT x, PLFLT y, + PLFLT x_length, PLFLT y_length, + PLINT bg_color, PLINT bb_color, PLINT bb_style, + PLFLT low_cap_color, PLFLT high_cap_color, + PLINT cont_color, PLINT cont_width, PLFLT ticks, PLINT sub_ticks, - const char *axis_opts, const char *label, - PLINT n_colors, const PLFLT *colors, const PLFLT *values ); + PLINT n_labels, PLINT *label_opts, const char *label[], + PLINT n_axes, const char *axis_opts[], + PLINT *n_values, const PLFLT * const *values ); - // Sets position of the light source void lightsource( PLFLT x, PLFLT y, PLFLT z ); Modified: trunk/examples/c/x16c.c =================================================================== --- trunk/examples/c/x16c.c 2012-10-22 21:07:18 UTC (rev 12248) +++ trunk/examples/c/x16c.c 2012-10-22 21:08:52 UTC (rev 12249) @@ -20,7 +20,7 @@ // front end other than the C one. // For now, don't show the colorbars while we are working out the API. -static int colorbar = 0; +static int colorbar = 1; // polar plot data #define PERIMETERPTS 100 Modified: trunk/examples/c++/x16.cc =================================================================== --- trunk/examples/c++/x16.cc 2012-10-22 21:07:18 UTC (rev 12248) +++ trunk/examples/c++/x16.cc 2012-10-22 21:08:52 UTC (rev 12249) @@ -46,6 +46,7 @@ static int nx; static int ny; static int exclude; + static int colorbar; const static int PERIMETERPTS; public: static PLFLT tr[]; @@ -54,11 +55,12 @@ static const char *notes[]; }; -int x16:: ns = 20; -int x16:: nx = 35; -int x16:: ny = 46; -int x16:: exclude = 0; -const int x16::PERIMETERPTS = 100; +int x16:: ns = 20; +int x16:: nx = 35; +int x16:: ny = 46; +int x16:: exclude = 0; +int x16:: colorbar = 1; +const int x16::PERIMETERPTS = 100; PLFLT x16:: tr[] = { 2. / ( nx - 1 ), 0.0, -1.0, 0.0, 2. / ( ny - 1 ), -1.0 }; @@ -150,7 +152,24 @@ PLFLT *clevel = new PLFLT[ns]; PLFLT *shedge = new PLFLT[ns + 1]; const int fill_width = 2, cont_color = 0, cont_width = 0; + PLFLT colorbar_width, colorbar_height; +#define NUM_AXES 1 + PLINT n_axis_opts = NUM_AXES; + const char *axis_opts[] = { + "bcvtm", + }; + PLINT num_values[NUM_AXES]; + PLFLT *values[NUM_AXES]; + PLFLT filler_values[2] = { 0.0, 1.0 }; +#define NUM_LABELS 1 + PLINT n_labels = NUM_LABELS; + PLINT label_opts[] = { + PL_COLORBAR_LABEL_BOTTOM, + }; + const char *labels[] = { + "Magnitude", + }; // plplot initialization @@ -240,6 +259,30 @@ cont_color, cont_width, plstream::fill, true, NULL, NULL ); + if ( colorbar ) + { + // Smaller text + pls->schr( 0.0, 0.75 ); + // Small ticks on the vertical axis + pls->smaj( 0.0, 0.5 ); + pls->smin( 0.0, 0.5 ); + + num_values[0] = ns + 1; + values[0] = shedge; + pls->colorbar( &colorbar_width, &colorbar_height, + PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, + 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, + cont_color, cont_width, 0.0, 0, + n_labels, label_opts, labels, + n_axis_opts, axis_opts, + num_values, (const PLFLT * const *) values ); + + // Reset text and tick sizes + pls->schr( 0.0, 1.0 ); + pls->smaj( 0.0, 1.0 ); + pls->smin( 0.0, 1.0 ); + } + pls->col0( 1 ); pls->box( "bcnst", 0.0, 0, "bcnstv", 0.0, 0 ); pls->col0( 2 ); @@ -262,6 +305,30 @@ cont_color, cont_width, plstream::fill, true, plstream::tr1, (void *) &cgrid1 ); + if ( colorbar ) + { + // Smaller text + pls->schr( 0.0, 0.75 ); + // Small ticks on the vertical axis + pls->smaj( 0.0, 0.5 ); + pls->smin( 0.0, 0.5 ); + + num_values[0] = ns + 1; + values[0] = shedge; + pls->colorbar( &colorbar_width, &colorbar_height, + PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, + 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, + cont_color, cont_width, 0.0, 0, + n_labels, label_opts, labels, + n_axis_opts, axis_opts, + num_values, (const PLFLT * const *) values ); + + // Reset text and tick sizes + pls->schr( 0.0, 1.0 ); + pls->smaj( 0.0, 1.0 ); + pls->smin( 0.0, 1.0 ); + } + pls->col0( 1 ); pls->box( "bcnst", 0.0, 0, "bcnstv", 0.0, 0 ); pls->col0( 2 ); @@ -285,6 +352,30 @@ cont_color, cont_width, plstream::fill, false, plstream::tr2, (void *) &cgrid2 ); + if ( colorbar ) + { + // Smaller text + pls->schr( 0.0, 0.75 ); + // Small ticks on the vertical axis + pls->smaj( 0.0, 0.5 ); + pls->smin( 0.0, 0.5 ); + + num_values[0] = ns + 1; + values[0] = shedge; + pls->colorbar( &colorbar_width, &colorbar_height, + PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, + 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, + cont_color, cont_width, 0.0, 0, + n_labels, label_opts, labels, + n_axis_opts, axis_opts, + num_values, (const PLFLT * const *) values ); + + // Reset text and tick sizes + pls->schr( 0.0, 1.0 ); + pls->smaj( 0.0, 1.0 ); + pls->smin( 0.0, 1.0 ); + } + pls->col0( 1 ); pls->box( "bcnst", 0.0, 0, "bcnstv", 0.0, 0 ); pls->col0( 2 ); @@ -309,6 +400,30 @@ 2, 3, plstream::fill, false, plstream::tr2, (void *) &cgrid2 ); + if ( colorbar ) + { + // Smaller text + pls->schr( 0.0, 0.75 ); + // Small ticks on the vertical axis + pls->smaj( 0.0, 0.5 ); + pls->smin( 0.0, 0.5 ); + + num_values[0] = ns + 1; + values[0] = shedge; + pls->colorbar( &colorbar_width, &colorbar_height, + PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, + 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, + 2, 3, 0.0, 0, + n_labels, label_opts, labels, + n_axis_opts, axis_opts, + num_values, (const PLFLT * const *) values ); + + // Reset text and tick sizes + pls->schr( 0.0, 1.0 ); + pls->smaj( 0.0, 1.0 ); + pls->smin( 0.0, 1.0 ); + } + pls->col0( 1 ); pls->box( "bcnst", 0.0, 0, "bcnstv", 0.0, 0 ); pls->col0( 2 ); @@ -379,6 +494,30 @@ cont_color, cont_width, plstream::fill, false, plstream::tr2, (void *) &cgrid2 ); + if ( colorbar ) + { + // Smaller text + pls->schr( 0.0, 0.75 ); + // Small ticks on the vertical axis + pls->smaj( 0.0, 0.5 ); + pls->smin( 0.0, 0.5 ); + + num_values[0] = ns + 1; + values[0] = shedge; + pls->colorbar( &colorbar_width, &colorbar_height, + PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, + 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, + cont_color, cont_width, 0.0, 0, + n_labels, label_opts, labels, + n_axis_opts, axis_opts, + num_values, (const PLFLT * const *) values ); + + // Reset text and tick sizes + pls->schr( 0.0, 1.0 ); + pls->smaj( 0.0, 1.0 ); + pls->smin( 0.0, 1.0 ); + } + // Now we can draw the perimeter. (If do before, shade stuff may overlap.) for ( i = 0; i < PERIMETERPTS; i++ ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hez...@us...> - 2012-10-25 01:33:36
|
Revision: 12254 http://plplot.svn.sourceforge.net/plplot/?rev=12254&view=rev Author: hezekiahcarty Date: 2012-10-25 01:33:29 +0000 (Thu, 25 Oct 2012) Log Message: ----------- Support per-axis tickmark spacing in colorbars Modified Paths: -------------- trunk/examples/c/x16c.c trunk/include/plplot.h trunk/src/pllegend.c Modified: trunk/examples/c/x16c.c =================================================================== --- trunk/examples/c/x16c.c 2012-10-24 21:51:13 UTC (rev 12253) +++ trunk/examples/c/x16c.c 2012-10-25 01:33:29 UTC (rev 12254) @@ -147,7 +147,12 @@ }; PLINT num_values[NUM_AXES]; PLFLT *values[NUM_AXES]; - PLFLT filler_values[2] = { 0.0, 1.0 }; + PLFLT axis_ticks[NUM_AXES] = { + 0.0, + }; + PLINT axis_subticks[NUM_AXES] = { + 0, + }; #define NUM_LABELS 1 PLINT n_labels = NUM_LABELS; PLINT label_opts[] = { @@ -266,9 +271,10 @@ plcolorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, - cont_color, cont_width, 0.0, 0, + cont_color, cont_width, n_labels, label_opts, labels, n_axis_opts, axis_opts, + axis_ticks, axis_subticks, num_values, (const PLFLT * const *) values ); // Reset text and tick sizes @@ -317,9 +323,10 @@ plcolorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, - cont_color, cont_width, 0.0, 0, + cont_color, cont_width, n_labels, label_opts, labels, n_axis_opts, axis_opts, + axis_ticks, axis_subticks, num_values, (const PLFLT * const *) values ); // Reset text and tick sizes @@ -368,9 +375,10 @@ plcolorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, - cont_color, cont_width, 0.0, 0, + cont_color, cont_width, n_labels, label_opts, labels, n_axis_opts, axis_opts, + axis_ticks, axis_subticks, num_values, (const PLFLT * const *) values ); // Reset text and tick sizes @@ -418,9 +426,10 @@ plcolorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, - 2, 3, 0.0, 0, + 2, 3, n_labels, label_opts, labels, n_axis_opts, axis_opts, + axis_ticks, axis_subticks, num_values, (const PLFLT * const *) values ); // Reset text and tick sizes @@ -519,9 +528,10 @@ plcolorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, - cont_color, cont_width, 0.0, 0, + cont_color, cont_width, n_labels, label_opts, labels, n_axis_opts, axis_opts, + axis_ticks, axis_subticks, num_values, (const PLFLT * const *) values ); // Reset text and tick sizes Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2012-10-24 21:51:13 UTC (rev 12253) +++ trunk/include/plplot.h 2012-10-25 01:33:29 UTC (rev 12254) @@ -1255,9 +1255,9 @@ PLINT bg_color, PLINT bb_color, PLINT bb_style, PLFLT low_cap_color, PLFLT high_cap_color, PLINT cont_color, PLINT cont_width, - PLFLT ticks, PLINT sub_ticks, PLINT n_labels, PLINT *label_opts, const char *label[], PLINT n_axes, const char *axis_opts[], + PLFLT *ticks, PLINT *sub_ticks, PLINT *n_values, const PLFLT * const *values ); // Sets position of the light source Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2012-10-24 21:51:13 UTC (rev 12253) +++ trunk/src/pllegend.c 2012-10-25 01:33:29 UTC (rev 12254) @@ -1437,8 +1437,6 @@ //! @param cont_width Contour width for PL_COLORBAR_SHADE plots. This is //! passed directly to plshades, so it will be interpreted according to the //! design of plshades. -//! @param ticks Spacing of major ticks, as for plbox. -//! @param sub_ticks Number of subticks, as for plbox. //! @param n_labels Number of labels to place around the colorbar //! @param label_opts Options for each label. n_label total values. //! @param labels Text labels for the colorbar. No label is drawn if no @@ -1448,6 +1446,10 @@ //! @param n_axes Number of axis definitions provided. Must be >= 1. //! @param axis_opts Axis options for the colorbar's major axis, as for plbox. //! n_axes values in the array. +//! @param ticks Spacing of major ticks, as for plbox. n_axes values in the +//! array. +//! @param sub_ticks Number of subticks, as for plbox. n_axes values in the +//! array. //! @param n_values Number of elements in each values array. //! @param values Numeric values for the data range represented by the //! colorbar. For PL_COLORBAR_SHADE, this should include one value per break @@ -1464,9 +1466,9 @@ PLINT bg_color, PLINT bb_color, PLINT bb_style, PLFLT low_cap_color, PLFLT high_cap_color, PLINT cont_color, PLINT cont_width, - PLFLT ticks, PLINT sub_ticks, PLINT n_labels, PLINT *label_opts, const char *labels[], PLINT n_axes, const char *axis_opts[], + PLFLT *ticks, PLINT *sub_ticks, PLINT *n_values, const PLFLT * const *values ) { // Min and max values @@ -1724,7 +1726,7 @@ // Calculate the bounding box for decorated (i.e., including tick // marks + numerical tick labels) box. draw_box( TRUE, opt, axis_opts[i], if_edge, - ticks, sub_ticks, n_values[i], values[i] ); + ticks[i], sub_ticks[i], n_values[i], values[i] ); if ( opt & PL_COLORBAR_CAP_LOW ) { @@ -2237,7 +2239,7 @@ // draw decorated (i.e., including tick marks + numerical tick // labels) box. draw_box( FALSE, opt, axis_opts[i], if_edge, - ticks, sub_ticks, n_values[i], values[i] ); + ticks[i], sub_ticks[i], n_values[i], values[i] ); } // Viewport and world coordinate ranges for bounding-box. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2012-10-25 17:36:13
|
Revision: 12256 http://plplot.svn.sourceforge.net/plplot/?rev=12256&view=rev Author: andrewross Date: 2012-10-25 17:36:06 +0000 (Thu, 25 Oct 2012) Log Message: ----------- Fix up C example 33 and the C++ bindings and example 16 following changes to colorbar API. Modified Paths: -------------- trunk/bindings/c++/plstream.cc trunk/bindings/c++/plstream.h trunk/examples/c/x33c.c trunk/examples/c++/x16.cc Modified: trunk/bindings/c++/plstream.cc =================================================================== --- trunk/bindings/c++/plstream.cc 2012-10-25 01:35:24 UTC (rev 12255) +++ trunk/bindings/c++/plstream.cc 2012-10-25 17:36:06 UTC (rev 12256) @@ -1019,9 +1019,9 @@ PLINT bg_color, PLINT bb_color, PLINT bb_style, PLFLT low_cap_color, PLFLT high_cap_color, PLINT cont_color, PLINT cont_width, - PLFLT ticks, PLINT sub_ticks, PLINT n_labels, PLINT *label_opts, const char *label[], PLINT n_axes, const char *axis_opts[], + PLFLT *ticks, PLINT *sub_ticks, PLINT *n_values, const PLFLT * const *values ) { set_stream(); @@ -1029,8 +1029,8 @@ plcolorbar( p_colorbar_width, p_colorbar_height, opt, position, x, y, x_length, y_length, bg_color, bb_color, bb_style, low_cap_color, high_cap_color, cont_color, cont_width, - ticks, sub_ticks, n_labels, label_opts, label, - n_axes, axis_opts, n_values, values ); + n_labels, label_opts, label,n_axes, axis_opts, + ticks, sub_ticks, n_values, values ); } Modified: trunk/bindings/c++/plstream.h =================================================================== --- trunk/bindings/c++/plstream.h 2012-10-25 01:35:24 UTC (rev 12255) +++ trunk/bindings/c++/plstream.h 2012-10-25 17:36:06 UTC (rev 12256) @@ -448,9 +448,9 @@ PLINT bg_color, PLINT bb_color, PLINT bb_style, PLFLT low_cap_color, PLFLT high_cap_color, PLINT cont_color, PLINT cont_width, - PLFLT ticks, PLINT sub_ticks, PLINT n_labels, PLINT *label_opts, const char *label[], PLINT n_axes, const char *axis_opts[], + PLFLT *ticks, PLINT *sub_ticks, PLINT *n_values, const PLFLT * const *values ); // Sets position of the light source Modified: trunk/examples/c/x33c.c =================================================================== --- trunk/examples/c/x33c.c 2012-10-25 01:35:24 UTC (rev 12255) +++ trunk/examples/c/x33c.c 2012-10-25 17:36:06 UTC (rev 12256) @@ -156,8 +156,8 @@ // Parameters for the colorbars on this page PLINT position_i, position, opt; PLFLT x, y, x_length, y_length; - PLFLT ticks; - PLINT sub_ticks; + PLFLT ticks[1] = { 0.0 }; + PLINT sub_ticks[1] = { 0 }; PLFLT low_cap_color, high_cap_color; PLINT vertical, ifn; PLINT n_axes = 1; @@ -175,9 +175,6 @@ n_values_array[0] = n_values; values_array[0] = values; - ticks = 0.0; - sub_ticks = 0; - low_cap_color = 0.0; high_cap_color = 1.0; @@ -260,9 +257,9 @@ 15, 1, 1, low_cap_color, high_cap_color, cont_color, cont_width, - ticks, sub_ticks, n_labels, label_opts, (const char **) &label, n_axes, axis_opts, + ticks, sub_ticks, n_values_array, (const PLFLT * const *) values_array ); // Reset text and tick sizes Modified: trunk/examples/c++/x16.cc =================================================================== --- trunk/examples/c++/x16.cc 2012-10-25 01:35:24 UTC (rev 12255) +++ trunk/examples/c++/x16.cc 2012-10-25 17:36:06 UTC (rev 12256) @@ -161,6 +161,12 @@ }; PLINT num_values[NUM_AXES]; PLFLT *values[NUM_AXES]; + PLFLT axis_ticks[NUM_AXES] = { + 0.0, + }; + PLINT axis_subticks[NUM_AXES] = { + 0, + }; PLFLT filler_values[2] = { 0.0, 1.0 }; #define NUM_LABELS 1 PLINT n_labels = NUM_LABELS; @@ -272,9 +278,10 @@ pls->colorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, - cont_color, cont_width, 0.0, 0, + cont_color, cont_width, n_labels, label_opts, labels, n_axis_opts, axis_opts, + axis_ticks, axis_subticks, num_values, (const PLFLT * const *) values ); // Reset text and tick sizes @@ -318,9 +325,10 @@ pls->colorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, - cont_color, cont_width, 0.0, 0, + cont_color, cont_width, n_labels, label_opts, labels, n_axis_opts, axis_opts, + axis_ticks, axis_subticks, num_values, (const PLFLT * const *) values ); // Reset text and tick sizes @@ -365,9 +373,10 @@ pls->colorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, - cont_color, cont_width, 0.0, 0, + cont_color, cont_width, n_labels, label_opts, labels, n_axis_opts, axis_opts, + axis_ticks, axis_subticks, num_values, (const PLFLT * const *) values ); // Reset text and tick sizes @@ -413,9 +422,10 @@ pls->colorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, - 2, 3, 0.0, 0, + 2, 3, n_labels, label_opts, labels, n_axis_opts, axis_opts, + axis_ticks, axis_subticks, num_values, (const PLFLT * const *) values ); // Reset text and tick sizes @@ -507,9 +517,10 @@ pls->colorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, - cont_color, cont_width, 0.0, 0, + cont_color, cont_width, n_labels, label_opts, labels, n_axis_opts, axis_opts, + axis_ticks, axis_subticks, num_values, (const PLFLT * const *) values ); // Reset text and tick sizes This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2012-11-02 19:13:52
|
Revision: 12270 http://plplot.svn.sourceforge.net/plplot/?rev=12270&view=rev Author: airwin Date: 2012-11-02 19:13:45 +0000 (Fri, 02 Nov 2012) Log Message: ----------- Use correct RPATH configuration for shapelib. This allows the Unix run-time loader to find versions of shapelib that are installed in a non-standard location. Modified Paths: -------------- trunk/cmake/modules/shapelib.cmake trunk/src/CMakeLists.txt Modified: trunk/cmake/modules/shapelib.cmake =================================================================== --- trunk/cmake/modules/shapelib.cmake 2012-11-02 19:10:52 UTC (rev 12269) +++ trunk/cmake/modules/shapelib.cmake 2012-11-02 19:13:45 UTC (rev 12270) @@ -1,6 +1,7 @@ # cmake/modules/shapefil.cmake # # Copyright (C) 2012 Andrew Ross +# Copyright (C) 2012 Alan W. Irwin # # This file is part of PLplot. # @@ -28,7 +29,10 @@ # Look for shapelib libraries if (HAVE_SHAPELIB) find_package(Shapelib) - if(NOT SHAPELIB_FOUND) + if(SHAPELIB_FOUND) + set(SHAPELIB_RPATH ${SHAPELIB_LIBRARY_DIRS}) + filter_rpath(SHAPELIB_RPATH) + else(SHAPELIB_FOUND) message(STATUS "WARNING: SHAPELIB not found. Setting HAVE_SHAPELIB to OFF." ) @@ -36,5 +40,5 @@ CACHE BOOL "Enable driver options for using SHAPELIB library for reading shapefile map data" FORCE ) - endif(NOT SHAPELIB_FOUND) + endif(SHAPELIB_FOUND) endif (HAVE_SHAPELIB) Modified: trunk/src/CMakeLists.txt =================================================================== --- trunk/src/CMakeLists.txt 2012-11-02 19:10:52 UTC (rev 12269) +++ trunk/src/CMakeLists.txt 2012-11-02 19:13:45 UTC (rev 12270) @@ -318,6 +318,8 @@ ${SHAPELIB_LIBRARIES} ) + set(LIB_INSTALL_RPATH ${LIB_INSTALL_RPATH} ${SHAPELIB_RPATH}) + # Convert to -L... -l... form. string(REGEX REPLACE "(/[^ ]*)/lib([^ ]*)\\.so" "-L\\1 -l\\2" _SHAPELIB_LINK_FLAGS This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hba...@us...> - 2012-11-17 22:49:41
|
Revision: 12275 http://plplot.svn.sourceforge.net/plplot/?rev=12275&view=rev Author: hbabcock Date: 2012-11-17 22:49:34 +0000 (Sat, 17 Nov 2012) Log Message: ----------- Add a EPS driver to the Cairo family. On by default since this seemed pretty straight-forward.. Fix a typo in the README.drivers file. Modified Paths: -------------- trunk/cmake/modules/cairo.cmake trunk/cmake/modules/drivers-init.cmake trunk/drivers/README.drivers trunk/drivers/cairo.c trunk/drivers/cairo.driver_info.in trunk/examples/plplot_configure.cmake_installed_examples.in trunk/include/drivers.h trunk/include/plDevs.h.cmake trunk/include/plcore.h trunk/plplot_test/plplot-test.sh.cmake Modified: trunk/cmake/modules/cairo.cmake =================================================================== --- trunk/cmake/modules/cairo.cmake 2012-11-17 17:34:42 UTC (rev 12274) +++ trunk/cmake/modules/cairo.cmake 2012-11-17 22:49:34 UTC (rev 12275) @@ -27,6 +27,7 @@ # PLD_pdfcairo - ON means the pdfcairo device is enabled. # PLD_pngcairo - ON means the pngcairo device is enabled. # PLD_pscairo - ON means the pscairo device is enabled. +# PLD_epscairo - ON means the epscairo device is enabled. # PLD_svgcairo - ON means the svgcairo device is enabled. # PLD_xcairo - ON means the xcairo device is enabled. # PLD_wincairo - ON means the wincairo device is enabled. @@ -53,6 +54,7 @@ OR PLD_pdfcairo OR PLD_pngcairo OR PLD_pscairo + OR PLD_epscairo OR PLD_svgcairo OR PLD_xcairo OR PLD_extcairo @@ -66,6 +68,7 @@ set(PLD_pdfcairo OFF CACHE BOOL "Enable pdfcairo device" FORCE) set(PLD_pngcairo OFF CACHE BOOL "Enable pngcairo device" FORCE) set(PLD_pscairo OFF CACHE BOOL "Enable pscairo device" FORCE) + set(PLD_epscairo OFF CACHE BOOL "Enable epscairo device" FORCE) set(PLD_svgcairo OFF CACHE BOOL "Enable svgcairo device" FORCE) set(PLD_xcairo OFF CACHE BOOL "Enable xcairo device" FORCE) set(PLD_extcairo OFF CACHE BOOL "Enable extcairo device" FORCE) @@ -76,6 +79,7 @@ OR PLD_pdfcairo OR PLD_pngcairo OR PLD_pscairo + OR PLD_epscairo OR PLD_svgcairo OR PLD_xcairo OR PLD_extcairo @@ -87,6 +91,7 @@ OR PLD_pdfcairo OR PLD_pngcairo OR PLD_pscairo + OR PLD_epscairo OR PLD_svgcairo OR PLD_xcairo OR PLD_extcairo @@ -148,6 +153,7 @@ set(PLD_pdfcairo OFF CACHE BOOL "Enable pdfcairo device" FORCE) set(PLD_pngcairo OFF CACHE BOOL "Enable pngcairo device" FORCE) set(PLD_pscairo OFF CACHE BOOL "Enable pscairo device" FORCE) + set(PLD_epscairo OFF CACHE BOOL "Enable epscairo device" FORCE) set(PLD_svgcairo OFF CACHE BOOL "Enable svgcairo device" FORCE) set(PLD_xcairo OFF CACHE BOOL "Enable xcairo device" FORCE) set(PLD_extcairo OFF CACHE BOOL "Enable extcairo device" FORCE) @@ -158,6 +164,7 @@ OR PLD_pdfcairo OR PLD_pngcairo OR PLD_pscairo + OR PLD_epscairo OR PLD_svgcairo OR PLD_xcairo OR PLD_extcairo Modified: trunk/cmake/modules/drivers-init.cmake =================================================================== --- trunk/cmake/modules/drivers-init.cmake 2012-11-17 17:34:42 UTC (rev 12274) +++ trunk/cmake/modules/drivers-init.cmake 2012-11-17 22:49:34 UTC (rev 12275) @@ -132,6 +132,7 @@ "pdfcairo:cairo:ON:F:OFF" "pngcairo:cairo:ON:F:ON" "pscairo:cairo:ON:F:OFF" + "epscairo:cairo:ON:F:ON" "svgcairo:cairo:ON:F:ON" "xcairo:cairo:ON:I:OFF" "wincairo:cairo:ON:I:OFF" Modified: trunk/drivers/README.drivers =================================================================== --- trunk/drivers/README.drivers 2012-11-17 17:34:42 UTC (rev 12274) +++ trunk/drivers/README.drivers 2012-11-17 22:49:34 UTC (rev 12275) @@ -29,7 +29,7 @@ This should be the exact duplicate of the corresponding entry in the driver source code for plD_DEVICE_INFO_<driver>. -2. Add the following line to plplot_cmake/modules/drivers-init.cmake in +2. Add the following line to plplot/cmake/modules/drivers-init.cmake in set(DRIVERS_DEVICE_LIST... "<dev>:<driver>:ON:<kind>:<familied>" Modified: trunk/drivers/cairo.c =================================================================== --- trunk/drivers/cairo.c 2012-11-17 17:34:42 UTC (rev 12274) +++ trunk/drivers/cairo.c 2012-11-17 22:49:34 UTC (rev 12275) @@ -167,6 +167,9 @@ #if defined ( PLD_wincairo ) "wincairo:Cairo Microscoft Windows Driver:0:cairo:107:wincairo\n" #endif +#if defined ( PLD_epscairo ) + "epscairo:Cairo EPS Driver:0:cairo:108:epscairo\n" +#endif ; // @@ -2256,6 +2259,110 @@ //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- // +// That which is specific to the cairo EPS driver. +// +//-------------------------------------------------------------------------- +//-------------------------------------------------------------------------- + +#if defined ( PLD_epscairo ) + +void plD_dispatch_init_epscairo( PLDispatchTable *pdt ); +void plD_init_epscairo( PLStream * ); + +//-------------------------------------------------------------------------- +// dispatch_init_init() +// +// Initialize device dispatch table +//-------------------------------------------------------------------------- + +// epscairo +void plD_dispatch_init_epscairo( PLDispatchTable *pdt ) +{ +#ifndef ENABLE_DYNDRIVERS + pdt->pl_MenuStr = "Cairo EPS Driver"; + pdt->pl_DevName = "epscairo"; +#endif + pdt->pl_type = plDevType_FileOriented; + pdt->pl_seq = 102; + pdt->pl_init = (plD_init_fp) plD_init_epscairo; + pdt->pl_line = (plD_line_fp) plD_line_cairo; + pdt->pl_polyline = (plD_polyline_fp) plD_polyline_cairo; + pdt->pl_eop = (plD_eop_fp) plD_eop_cairo; + pdt->pl_bop = (plD_bop_fp) plD_bop_famcairo; + pdt->pl_tidy = (plD_tidy_fp) plD_tidy_cairo; + pdt->pl_state = (plD_state_fp) plD_state_cairo; + pdt->pl_esc = (plD_esc_fp) plD_esc_cairo; +} + +//-------------------------------------------------------------------------- +// plD_init_epscairo() +// +// Initialize Cairo EPS device +//-------------------------------------------------------------------------- + +void plD_init_epscairo( PLStream *pls ) +{ + PLCairo *aStream; + + // Setup the PLStream and the font lookup table and allocate a cairo + // stream structure. + // + // NOTE: The check below is necessary since, in family mode, this function + // will be called multiple times. While you might think that it is + // sufficient to update what *should* be the only pointer to the contents + // of pls->dev, i.e. the pointer pls->dev itself, it appears that + // something else somewhere else is also pointing to pls->dev. If you + // change what pls->dev points to then you will get a "bus error", from + // which I infer the existence of said bad stale pointer. + // + if ( pls->dev == NULL ) + { + aStream = stream_and_font_setup( pls, 0 ); + } + else + { + stream_and_font_setup( pls, 0 ); + aStream = pls->dev; + } + + // Initialize family file info + plFamInit( pls ); + + // Prompt for a file name if not already set. + plOpenFile( pls ); + + // Create an cairo surface & context for EPS file. + // Dimension units are pts = 1/72 inches from cairo documentation. + aStream->cairoSurface = cairo_ps_surface_create_for_stream( (cairo_write_func_t) write_to_stream, pls->OutFile, (double) pls->ylength, (double) pls->xlength ); + aStream->cairoContext = cairo_create( aStream->cairoSurface ); + + // Set the PS surface to be EPS. + cairo_ps_surface_set_eps ( aStream->cairoSurface , 1 ); + + // Save the pointer to the structure in the PLplot stream + pls->dev = aStream; + + // Handle portrait or landscape + if ( pls->portrait ) + { + plsdiori( 1 ); + pls->freeaspect = 1; + } + rotate_cairo_surface( pls, 0.0, -1.0, -1.0, 0.0, (float) pls->ylength, (float) pls->xlength, FALSE ); + + // Set fill rule for the case of self-intersecting boundaries. + if ( pls->dev_eofill ) + cairo_set_fill_rule( aStream->cairoContext, CAIRO_FILL_RULE_EVEN_ODD ); + else + cairo_set_fill_rule( aStream->cairoContext, CAIRO_FILL_RULE_WINDING ); +} + +#endif + + +//-------------------------------------------------------------------------- +//-------------------------------------------------------------------------- +// // That which is specific to the cairo SVG driver. // //-------------------------------------------------------------------------- Modified: trunk/drivers/cairo.driver_info.in =================================================================== --- trunk/drivers/cairo.driver_info.in 2012-11-17 17:34:42 UTC (rev 12274) +++ trunk/drivers/cairo.driver_info.in 2012-11-17 22:49:34 UTC (rev 12275) @@ -6,3 +6,4 @@ memcairo:Cairo Memory Driver:0:cairo:105:memcairo extcairo:Cairo External Context Driver:0:cairo:106:extcairo wincairo:Cairo Microscoft Windows Driver:0:cairo:107:wincairo +epscairo:Cairo EPS Driver:0:cairo:108:epscairo Modified: trunk/examples/plplot_configure.cmake_installed_examples.in =================================================================== --- trunk/examples/plplot_configure.cmake_installed_examples.in 2012-11-17 17:34:42 UTC (rev 12274) +++ trunk/examples/plplot_configure.cmake_installed_examples.in 2012-11-17 22:49:34 UTC (rev 12275) @@ -167,6 +167,7 @@ set(PLD_pdfcairo @PLD_pdfcairo@) set(PLD_pngcairo @PLD_pngcairo@) set(PLD_pscairo @PLD_pscairo@) +set(PLD_epscairo @PLD_epscairo@) set(PLD_svgcairo @PLD_svgcairo@) set(PLD_cgm @PLD_cgm@) set(PLD_dg300 @PLD_dg300@) Modified: trunk/include/drivers.h =================================================================== --- trunk/include/drivers.h 2012-11-17 17:34:42 UTC (rev 12274) +++ trunk/include/drivers.h 2012-11-17 22:49:34 UTC (rev 12275) @@ -93,6 +93,7 @@ PLDLLIMPEXP_DRIVER void plD_dispatch_init_xcairo( PLDispatchTable *pdt ); PLDLLIMPEXP_DRIVER void plD_dispatch_init_pdfcairo( PLDispatchTable *pdt ); PLDLLIMPEXP_DRIVER void plD_dispatch_init_pscairo( PLDispatchTable *pdt ); +PLDLLIMPEXP_DRIVER void plD_dispatch_init_epscairo( PLDispatchTable *pdt ); PLDLLIMPEXP_DRIVER void plD_dispatch_init_svgcairo( PLDispatchTable *pdt ); PLDLLIMPEXP_DRIVER void plD_dispatch_init_pngcairo( PLDispatchTable *pdt ); PLDLLIMPEXP_DRIVER void plD_dispatch_init_memcairo( PLDispatchTable *pdt ); Modified: trunk/include/plDevs.h.cmake =================================================================== --- trunk/include/plDevs.h.cmake 2012-11-17 17:34:42 UTC (rev 12274) +++ trunk/include/plDevs.h.cmake 2012-11-17 22:49:34 UTC (rev 12275) @@ -81,6 +81,7 @@ #cmakedefine PLD_xcairo #cmakedefine PLD_pdfcairo #cmakedefine PLD_pscairo +#cmakedefine PLD_epscairo #cmakedefine PLD_svgcairo #cmakedefine PLD_pngcairo #cmakedefine PLD_memcairo Modified: trunk/include/plcore.h =================================================================== --- trunk/include/plcore.h 2012-11-17 17:34:42 UTC (rev 12274) +++ trunk/include/plcore.h 2012-11-17 22:49:34 UTC (rev 12275) @@ -285,6 +285,9 @@ #if defined ( PLD_pscairo ) && !defined ( ENABLE_DYNDRIVERS ) plD_dispatch_init_pscairo, #endif +#if defined ( PLD_epscairo ) && !defined ( ENABLE_DYNDRIVERS ) + plD_dispatch_init_epscairo, +#endif #if defined ( PLD_svgcairo ) && !defined ( ENABLE_DYNDRIVERS ) plD_dispatch_init_svgcairo, #endif Modified: trunk/plplot_test/plplot-test.sh.cmake =================================================================== --- trunk/plplot_test/plplot-test.sh.cmake 2012-11-17 17:34:42 UTC (rev 12274) +++ trunk/plplot_test/plplot-test.sh.cmake 2012-11-17 22:49:34 UTC (rev 12275) @@ -310,6 +310,7 @@ # special case PLD_psc=@PLD_ps@ PLD_pscairo=@PLD_pscairo@ +PLD_epscairo=@PLD_epscairo@ PLD_pstex=@PLD_pstex@ PLD_psttf=@PLD_psttf@ # special case This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2012-11-19 00:02:20
|
Revision: 12277 http://plplot.svn.sourceforge.net/plplot/?rev=12277&view=rev Author: airwin Date: 2012-11-19 00:02:13 +0000 (Mon, 19 Nov 2012) Log Message: ----------- Build-system fixups for new epscairo device. Modified Paths: -------------- trunk/cmake/modules/plplot_functions.cmake trunk/examples/CMakeLists.txt trunk/plplot_test/plplot-test.sh.cmake Modified: trunk/cmake/modules/plplot_functions.cmake =================================================================== --- trunk/cmake/modules/plplot_functions.cmake 2012-11-18 20:31:09 UTC (rev 12276) +++ trunk/cmake/modules/plplot_functions.cmake 2012-11-19 00:02:13 UTC (rev 12277) @@ -54,6 +54,7 @@ if( ${device} STREQUAL "png" OR ${device} STREQUAL "pngcairo" OR + ${device} STREQUAL "epscairo" OR ${device} STREQUAL "jpeg" OR ${device} STREQUAL "xfig" OR ${device} STREQUAL "svg" OR @@ -72,6 +73,7 @@ else( ${device} STREQUAL "png" OR ${device} STREQUAL "pngcairo" OR + ${device} STREQUAL "epscairo" OR ${device} STREQUAL "jpeg" OR ${device} STREQUAL "xfig" OR ${device} STREQUAL "svg" OR @@ -90,6 +92,7 @@ endif( ${device} STREQUAL "png" OR ${device} STREQUAL "pngcairo" OR + ${device} STREQUAL "epscairo" OR ${device} STREQUAL "jpeg" OR ${device} STREQUAL "xfig" OR ${device} STREQUAL "svg" OR Modified: trunk/examples/CMakeLists.txt =================================================================== --- trunk/examples/CMakeLists.txt 2012-11-18 20:31:09 UTC (rev 12276) +++ trunk/examples/CMakeLists.txt 2012-11-19 00:02:13 UTC (rev 12277) @@ -107,6 +107,10 @@ set(PSCAIRO_COMMENT "#") endif(NOT PLD_pscairo) + if(NOT PLD_epscairo) + set(EPSCAIRO_COMMENT "#") + endif(NOT PLD_epscairo) + if(NOT PLD_svgcairo) set(SVGCAIRO_COMMENT "#") endif(NOT PLD_svgcairo) @@ -1037,6 +1041,7 @@ test_c_pdfcairo test_c_pngcairo test_c_pscairo + test_c_epscairo test_c_svgcairo test_extcairo test_c_xcairo @@ -1065,6 +1070,7 @@ PLD_pdfcairo: ${PLD_pdfcairo} PLD_pngcairo: ${PLD_pngcairo} PLD_pscairo: ${PLD_pscairo} +PLD_epscairo: ${PLD_epscairo} PLD_svgcairo: ${PLD_svgcairo} PLD_cgm: ${PLD_cgm} PLD_dg300: ${PLD_dg300} Modified: trunk/plplot_test/plplot-test.sh.cmake =================================================================== --- trunk/plplot_test/plplot-test.sh.cmake 2012-11-18 20:31:09 UTC (rev 12276) +++ trunk/plplot_test/plplot-test.sh.cmake 2012-11-19 00:02:13 UTC (rev 12277) @@ -356,7 +356,7 @@ # Some devices require special options others do not. case "$device" in - png|pngcairo|jpeg|xfig|svg|svgcairo|bmpqt|jpgqt|pngqt|ppmqt|tiffqt|svgqt|epsqt|pdfqt) + png|pngcairo|epscairo|jpeg|xfig|svg|svgcairo|bmpqt|jpgqt|pngqt|ppmqt|tiffqt|svgqt|epsqt|pdfqt) options="-fam -fflen 2" ;; gif) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2012-11-23 21:27:57
|
Revision: 12281 http://plplot.svn.sourceforge.net/plplot/?rev=12281&view=rev Author: andrewross Date: 2012-11-23 21:27:51 +0000 (Fri, 23 Nov 2012) Log Message: ----------- Format recent code changes using scripts/style_source.sh. Modified Paths: -------------- trunk/bindings/c++/plstream.cc trunk/bindings/octave/plplot_octave.i trunk/drivers/wxwidgets.cpp trunk/examples/c/x33c.c trunk/examples/c++/x16.cc trunk/src/pllegend.c trunk/src/plmap.c Modified: trunk/bindings/c++/plstream.cc =================================================================== --- trunk/bindings/c++/plstream.cc 2012-11-23 21:25:40 UTC (rev 12280) +++ trunk/bindings/c++/plstream.cc 2012-11-23 21:27:51 UTC (rev 12281) @@ -1029,7 +1029,7 @@ plcolorbar( p_colorbar_width, p_colorbar_height, opt, position, x, y, x_length, y_length, bg_color, bb_color, bb_style, low_cap_color, high_cap_color, cont_color, cont_width, - n_labels, label_opts, label,n_axes, axis_opts, + n_labels, label_opts, label, n_axes, axis_opts, ticks, sub_ticks, n_values, values ); } Modified: trunk/bindings/octave/plplot_octave.i =================================================================== --- trunk/bindings/octave/plplot_octave.i 2012-11-23 21:25:40 UTC (rev 12280) +++ trunk/bindings/octave/plplot_octave.i 2012-11-23 21:27:51 UTC (rev 12281) @@ -34,7 +34,6 @@ %module plplot_octave %{ - // #undef PACKAGE and VERSION macros which are leaked out by the octave headers #undef PACKAGE #undef VERSION @@ -671,12 +670,12 @@ %typemap( in, numinputs = 0 ) char *OUTPUT( octave_value_list retval ) { // Check if version >= 3.4.0 -%#if OCTAVE_API_VERSION_NUMBER < 45 +%# if OCTAVE_API_VERSION_NUMBER < 45 retval( 0 ) = octave_value( charMatrix( 80, 1 ), true ); -%#else - retval( 0 ) = octave_value( charMatrix( 80, 1 ) ); -%#endif - $1 = (char *) retval( 0 ).char_matrix_value().data(); +%# else + retval( 0 ) = octave_value( charMatrix( 80, 1 ) ); +%# endif + $1 = (char *) retval( 0 ).char_matrix_value().data(); } %typemap( argout ) char *OUTPUT { $result = SWIG_Octave_AppendOutput( $result, retval$argnum( 0 ) ); Modified: trunk/drivers/wxwidgets.cpp =================================================================== --- trunk/drivers/wxwidgets.cpp 2012-11-23 21:25:40 UTC (rev 12280) +++ trunk/drivers/wxwidgets.cpp 2012-11-23 21:27:51 UTC (rev 12281) @@ -331,7 +331,7 @@ // Log_Verbose( "common_init()" ); wxPLDevBase* dev; - PLFLT downscale, downscale2; + PLFLT downscale, downscale2; // default options static PLINT freetype = -1; @@ -481,7 +481,7 @@ plP_setpxl( (PLFLT) VIRTUAL_PIXELS_PER_MM, (PLFLT) VIRTUAL_PIXELS_PER_MM ); // Set up physical limits of plotting device (in drawing units) - downscale = (double) dev->width / (double) ( PIXELS_X - 1 ); + downscale = (double) dev->width / (double) ( PIXELS_X - 1 ); downscale2 = (double) dev->height / (double) PIXELS_Y; if ( downscale < downscale2 ) downscale = downscale2; Modified: trunk/examples/c/x33c.c =================================================================== --- trunk/examples/c/x33c.c 2012-11-23 21:25:40 UTC (rev 12280) +++ trunk/examples/c/x33c.c 2012-11-23 21:27:51 UTC (rev 12281) @@ -156,7 +156,7 @@ // Parameters for the colorbars on this page PLINT position_i, position, opt; PLFLT x, y, x_length, y_length; - PLFLT ticks[1] = { 0.0 }; + PLFLT ticks[1] = { 0.0 }; PLINT sub_ticks[1] = { 0 }; PLFLT low_cap_color, high_cap_color; PLINT vertical, ifn; Modified: trunk/examples/c++/x16.cc =================================================================== --- trunk/examples/c++/x16.cc 2012-11-23 21:25:40 UTC (rev 12280) +++ trunk/examples/c++/x16.cc 2012-11-23 21:27:51 UTC (rev 12281) @@ -278,7 +278,7 @@ pls->colorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, - cont_color, cont_width, + cont_color, cont_width, n_labels, label_opts, labels, n_axis_opts, axis_opts, axis_ticks, axis_subticks, @@ -325,7 +325,7 @@ pls->colorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, - cont_color, cont_width, + cont_color, cont_width, n_labels, label_opts, labels, n_axis_opts, axis_opts, axis_ticks, axis_subticks, @@ -373,7 +373,7 @@ pls->colorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, - cont_color, cont_width, + cont_color, cont_width, n_labels, label_opts, labels, n_axis_opts, axis_opts, axis_ticks, axis_subticks, @@ -422,7 +422,7 @@ pls->colorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, 0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0, - 2, 3, + 2, 3, n_labels, label_opts, labels, n_axis_opts, axis_opts, axis_ticks, axis_subticks, Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2012-11-23 21:25:40 UTC (rev 12280) +++ trunk/src/pllegend.c 2012-11-23 21:27:51 UTC (rev 12281) @@ -1660,8 +1660,8 @@ adopted_to_subpage_x( 0. ); colorbar_height = adopted_to_subpage_y( y_length ) - adopted_to_subpage_y( 0. ); - colorbar_width_d = colorbar_width; - colorbar_height_d = colorbar_height; + colorbar_width_d = colorbar_width; + colorbar_height_d = colorbar_height; colorbar_width_mm = colorbar_width / spxpmm; colorbar_height_mm = colorbar_height / spypmm; // Extent of cap in normalized subpage coordinates in either X or Y @@ -1775,7 +1775,7 @@ } // Capture the current bounding box dimensions - colorbar_width_l = colorbar_width_d; + colorbar_width_l = colorbar_width_d; colorbar_height_l = colorbar_height_d; for ( i = 0; i < n_labels; i++ ) Modified: trunk/src/plmap.c =================================================================== --- trunk/src/plmap.c 2012-11-23 21:25:40 UTC (rev 12280) +++ trunk/src/plmap.c 2012-11-23 21:27:51 UTC (rev 12281) @@ -111,7 +111,7 @@ plmap( void ( *mapform )( PLINT, PLFLT *, PLFLT * ), const char *type, PLFLT minlong, PLFLT maxlong, PLFLT minlat, PLFLT maxlat ) { -#if defined (HAVE_SHAPELIB) || defined (PL_DEPRECATED) +#if defined ( HAVE_SHAPELIB ) || defined ( PL_DEPRECATED ) int i, j; char *filename; char *warning; @@ -346,9 +346,9 @@ free( bufy ); free( filename ); free( warning ); -#else // defined (HAVE_SHAPELIB) || defined (PL_DEPRECATED) +#else // defined (HAVE_SHAPELIB) || defined (PL_DEPRECATED) plwarn( "Use of the old plplot map file format is deprecated.\nIt is recommended that the shapelib library be used to provide map support.\n" ); -#endif // defined (HAVE_SHAPELIB) || defined (PL_DEPRECATED) +#endif // defined (HAVE_SHAPELIB) || defined (PL_DEPRECATED) } //-------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2012-12-23 20:09:13
|
Revision: 12283 http://plplot.svn.sourceforge.net/plplot/?rev=12283&view=rev Author: airwin Date: 2012-12-23 20:09:07 +0000 (Sun, 23 Dec 2012) Log Message: ----------- Use more modern idiom to determine CMake version for output. Modified Paths: -------------- trunk/CMakeLists.txt trunk/examples/CMakeLists.txt Modified: trunk/CMakeLists.txt =================================================================== --- trunk/CMakeLists.txt 2012-12-19 17:11:01 UTC (rev 12282) +++ trunk/CMakeLists.txt 2012-12-23 20:09:07 UTC (rev 12283) @@ -2,7 +2,7 @@ ### ### Process this file with cmake to produce Makefile ### -# Copyright (C) 2006 Alan W. Irwin +# Copyright (C) 2006-2012 Alan W. Irwin # # This file is part of PLplot. # @@ -37,7 +37,7 @@ # examples are disabled. project(plplot C) -message(STATUS "CMake version = ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}") +message(STATUS "CMake version = ${CMAKE_VERSION}") message(STATUS "CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}") if(CMAKE_SYSTEM_NAME STREQUAL "Linux") Modified: trunk/examples/CMakeLists.txt =================================================================== --- trunk/examples/CMakeLists.txt 2012-12-19 17:11:01 UTC (rev 12282) +++ trunk/examples/CMakeLists.txt 2012-12-23 20:09:07 UTC (rev 12283) @@ -1,7 +1,7 @@ # examples/CMakeLists.txt ### Process this file with cmake to produce Makefile ### -# Copyright (C) 2006, 2007, 2008, 2009 Alan W. Irwin +# Copyright (C) 2006-2012 Alan W. Irwin # # This file is part of PLplot. # @@ -357,6 +357,8 @@ else(CORE_BUILD) project(installed_plplot_examples NONE) + message(STATUS "CMake version = ${CMAKE_VERSION}") + message(STATUS "CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}") if(CMAKE_SYSTEM_NAME STREQUAL "Linux") # We prefer to support only the latest CMake version because it This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-01-29 23:36:08
|
Revision: 12286 http://plplot.svn.sourceforge.net/plplot/?rev=12286&view=rev Author: airwin Date: 2013-01-29 23:36:01 +0000 (Tue, 29 Jan 2013) Log Message: ----------- Whitespace style changes for previous commits. Modified Paths: -------------- trunk/bindings/tk/tkMain.c trunk/drivers/cairo.c trunk/src/plshade.c Modified: trunk/bindings/tk/tkMain.c =================================================================== --- trunk/bindings/tk/tkMain.c 2013-01-29 08:37:25 UTC (rev 12285) +++ trunk/bindings/tk/tkMain.c 2013-01-29 23:36:01 UTC (rev 12286) @@ -599,7 +599,7 @@ { Tcl_AddErrorInfo( intp, "\n (script that generates prompt)" ); - fprintf( stderr, "%s\n", Tcl_GetStringResult(intp) ); + fprintf( stderr, "%s\n", Tcl_GetStringResult( intp ) ); goto defaultPrompt; } } Modified: trunk/drivers/cairo.c =================================================================== --- trunk/drivers/cairo.c 2013-01-29 08:37:25 UTC (rev 12285) +++ trunk/drivers/cairo.c 2013-01-29 23:36:01 UTC (rev 12286) @@ -241,7 +241,7 @@ PLCairo *stream_and_font_setup( PLStream *, int ); cairo_status_t write_to_stream( void *, unsigned char *, unsigned int ); void set_clip( PLStream *pls ); -int cairo_family_check( PLStream *pls); +int cairo_family_check( PLStream *pls ); // String processing @@ -1641,13 +1641,13 @@ //-------------------------------------------------------------------------- #if defined ( PLD_pngcairo ) || defined ( PLD_svgcairo ) || defined ( PLD_epscairo ) -void plD_bop_cairo_fam( PLStream *); -void plD_eop_cairo_fam( PLStream *); +void plD_bop_cairo_fam( PLStream * ); +void plD_eop_cairo_fam( PLStream * ); void plD_state_cairo_fam( PLStream *, PLINT ); -void plD_esc_cairo_fam( PLStream *, PLINT, void *); -void plD_tidy_cairo_fam( PLStream *); -void plD_line_cairo_fam( PLStream *, short, short, short, short); -void plD_polyline_cairo_fam( PLStream *, short *, short *, PLINT); +void plD_esc_cairo_fam( PLStream *, PLINT, void * ); +void plD_tidy_cairo_fam( PLStream * ); +void plD_line_cairo_fam( PLStream *, short, short, short, short ); +void plD_polyline_cairo_fam( PLStream *, short *, short *, PLINT ); //-------------------------------------------------------------------------- // plD_bop_cairo_fam() @@ -1669,7 +1669,7 @@ // Suppress multi-page output if family file output is not // specified by the user. - if ( cairo_family_check( pls) ) + if ( cairo_family_check( pls ) ) { return; } @@ -1692,12 +1692,12 @@ void plD_eop_cairo_fam( PLStream *pls ) { - if ( cairo_family_check( pls) ) + if ( cairo_family_check( pls ) ) { return; } - plD_eop_cairo(pls); + plD_eop_cairo( pls ); } //-------------------------------------------------------------------------- @@ -1708,12 +1708,12 @@ void plD_state_cairo_fam( PLStream *pls, PLINT op ) { - if ( cairo_family_check( pls) ) + if ( cairo_family_check( pls ) ) { return; } - - plD_state_cairo(pls, op); + + plD_state_cairo( pls, op ); } //-------------------------------------------------------------------------- @@ -1722,14 +1722,14 @@ // Generic escape function. //-------------------------------------------------------------------------- -void plD_esc_cairo_fam( PLStream *pls, PLINT op , void *ptr ) +void plD_esc_cairo_fam( PLStream *pls, PLINT op, void *ptr ) { - if ( cairo_family_check( pls) ) + if ( cairo_family_check( pls ) ) { return; } - - plD_esc_cairo(pls, op, ptr); + + plD_esc_cairo( pls, op, ptr ); } //-------------------------------------------------------------------------- @@ -1751,12 +1751,12 @@ void plD_line_cairo_fam( PLStream *pls, short x1a, short y1a, short x2a, short y2a ) { - if ( cairo_family_check( pls) ) + if ( cairo_family_check( pls ) ) { return; } - - plD_line_cairo(pls, x1a, y1a, x2a, y2a); + + plD_line_cairo( pls, x1a, y1a, x2a, y2a ); } //-------------------------------------------------------------------------- @@ -1767,12 +1767,12 @@ void plD_polyline_cairo_fam( PLStream *pls, short *xa, short *ya, PLINT npts ) { - if ( cairo_family_check( pls) ) + if ( cairo_family_check( pls ) ) { return; } - - plD_polyline_cairo(pls, xa, ya, npts); + + plD_polyline_cairo( pls, xa, ya, npts ); } #endif @@ -2702,7 +2702,7 @@ { PLCairo *aStream; - if ( cairo_family_check( pls) ) + if ( cairo_family_check( pls ) ) { return; } Modified: trunk/src/plshade.c =================================================================== --- trunk/src/plshade.c 2013-01-29 08:37:25 UTC (rev 12285) +++ trunk/src/plshade.c 2013-01-29 23:36:01 UTC (rev 12286) @@ -822,7 +822,7 @@ *cond++ = NEG; else if ( *a > sh_max ) *cond++ = POS; - else if ( isnan(*a) ) //check for nans and set cond to undefined + else if ( isnan( *a ) ) //check for nans and set cond to undefined *cond++ = UNDEF; else *cond++ = OK; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-01-30 04:40:48
|
Revision: 12288 http://plplot.svn.sourceforge.net/plplot/?rev=12288&view=rev Author: airwin Date: 2013-01-30 04:40:35 +0000 (Wed, 30 Jan 2013) Log Message: ----------- Replace plwid everywhere by plwidth, and store pen width arguments as PLFLT's everywhere (that I can find them). These changes allow width parameters < 1. to work for cairo devices, e.g., examples/c/x03c.c -dev xcairo -width 0.3 gives extremely thin line results. Further discussion on list of what else there is to do. 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/d/plplot.d trunk/bindings/f77/plstubs.h trunk/bindings/f77/scstubs.c trunk/bindings/f95/plstubs.h trunk/bindings/f95/scstubs.c trunk/bindings/f95/sfstubsf95.f90 trunk/bindings/gnome2/lib/plplotcanvas.c trunk/bindings/java/PLStream.java trunk/bindings/lua/plplotluac.i trunk/bindings/ocaml/plplot.ml trunk/bindings/ocaml/plplot.mli trunk/bindings/ocaml/plplot_core.idl trunk/bindings/ocaml/plplot_h trunk/bindings/ocaml/plplot_h.inc trunk/bindings/ocaml/plplot_impl.c trunk/bindings/octave/etc/plplot.doc trunk/bindings/octave/plplot_octave.h.in trunk/bindings/swig-support/plplotcapi.i trunk/bindings/tcl/plapi.tpl trunk/bindings/tk/PLWin.itk trunk/bindings/tk/plr.c trunk/doc/docbook/src/advanced.xml trunk/doc/docbook/src/api.xml trunk/doc/docbook/src/plplotdoc.xml.in trunk/drivers/cairo.c trunk/examples/ada/x01a.adb trunk/examples/ada/x02a.adb trunk/examples/c/x01c.c trunk/examples/c/x02c.c trunk/examples/c++/qt_PlotWindow.cpp trunk/examples/c++/wxPLplotDemo.cpp trunk/examples/c++/x01.cc trunk/examples/c++/x02.cc trunk/examples/d/x01d.d trunk/examples/d/x02d.d trunk/examples/f77/x01f.fm4 trunk/examples/f77/x02f.fm4 trunk/examples/f95/x01f.f90 trunk/examples/f95/x02f.f90 trunk/examples/java/x01.java trunk/examples/java/x02.java trunk/examples/lua/x01.lua trunk/examples/lua/x02.lua trunk/examples/ocaml/x01.ml trunk/examples/ocaml/x02.ml trunk/examples/octave/x01c.m trunk/examples/octave/x02c.m trunk/examples/perl/x01.pl trunk/examples/perl/x02.pl trunk/examples/python/plplot_logo.py trunk/examples/python/pyqt4_example.py trunk/examples/python/x02.py trunk/examples/python/xw01.py trunk/examples/python/xw02.py trunk/examples/tcl/x01.tcl trunk/examples/tcl/x02.tcl trunk/include/plplot.h trunk/include/plstrm.h trunk/src/plargs.c trunk/src/plcore.c trunk/src/pllegend.c trunk/src/plot3d.c trunk/src/plshade.c trunk/sys/win-tk/tclgen.c trunk/sys/win-tk/tclgen.h trunk/sys/win-tk/tclgen_s.h trunk/utils/plrender.c Modified: trunk/bindings/ada/plplot.adb =================================================================== --- trunk/bindings/ada/plplot.adb 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/ada/plplot.adb 2013-01-30 04:40:35 UTC (rev 12288) @@ -3311,10 +3311,10 @@ -- Set pen width. - -- plwid + -- plwidth procedure Set_Pen_Width(Pen_Width : Integer) is begin - plwid(Pen_Width); + plwidth(Pen_Width); end Set_Pen_Width; Modified: trunk/bindings/ada/plplot.ads =================================================================== --- trunk/bindings/ada/plplot.ads 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/ada/plplot.ads 2013-01-30 04:40:35 UTC (rev 12288) @@ -2103,7 +2103,7 @@ -- Set pen width. - -- plwid + -- plwidth procedure Set_Pen_Width(Pen_Width : Integer); Modified: trunk/bindings/ada/plplot_thin.ads =================================================================== --- trunk/bindings/ada/plplot_thin.ads 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/ada/plplot_thin.ads 2013-01-30 04:40:35 UTC (rev 12288) @@ -1875,8 +1875,8 @@ -- Set pen width. procedure - plwid(width : PLINT); - pragma Import(C, plwid, "c_plwid"); + plwidth(width : PLFLT); + pragma Import(C, plwidth, "c_plwidth"); -- Set up world coordinates of the viewport boundaries (2d plots). Modified: trunk/bindings/ada/plplot_traditional.adb =================================================================== --- trunk/bindings/ada/plplot_traditional.adb 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/ada/plplot_traditional.adb 2013-01-30 04:40:35 UTC (rev 12288) @@ -73,7 +73,7 @@ Default_Pen_Width : constant Integer := 1; procedure Set_Default_Pen_Width is begin - plwid(Default_Pen_Width); + plwidth(Default_Pen_Width); end Set_Default_Pen_Width; @@ -3147,10 +3147,10 @@ -- Set pen width. - procedure plwid(Pen_Width : Integer) is + procedure plwidth(Pen_Width : Integer) is begin - PLplot_Thin.plwid(Pen_Width); - end plwid; + PLplot_Thin.plwidth(Pen_Width); + end plwidth; -- Set up world coordinates of the viewport boundaries (2d plots). Modified: trunk/bindings/ada/plplot_traditional.ads =================================================================== --- trunk/bindings/ada/plplot_traditional.ads 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/ada/plplot_traditional.ads 2013-01-30 04:40:35 UTC (rev 12288) @@ -1932,7 +1932,7 @@ -- Set pen width. - procedure plwid(Pen_Width : Integer); + procedure plwidth(Pen_Width : Integer); -- Set up world coordinates of the viewport boundaries (2d plots). Modified: trunk/bindings/c++/plstream.cc =================================================================== --- trunk/bindings/c++/plstream.cc 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/c++/plstream.cc 2013-01-30 04:40:35 UTC (rev 12288) @@ -2320,11 +2320,11 @@ // Set pen width. -void plstream::wid( PLINT width ) +void plstream::width( PLFLT width ) { set_stream(); - plwid( width ); + plwidth( width ); } // Set up world coordinates of the viewport boundaries (2d plots). Modified: trunk/bindings/c++/plstream.h =================================================================== --- trunk/bindings/c++/plstream.h 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/c++/plstream.h 2013-01-30 04:40:35 UTC (rev 12288) @@ -959,7 +959,7 @@ // Set pen width. - void wid( PLINT width ); + void width( PLFLT width ); // Set up world coordinates of the viewport boundaries (2d plots). Modified: trunk/bindings/d/plplot.d =================================================================== --- trunk/bindings/d/plplot.d 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/d/plplot.d 2013-01-30 04:40:35 UTC (rev 12288) @@ -1472,7 +1472,7 @@ alias c_plvpor plvpor; alias c_plvsta plvsta; alias c_plw3d plw3d; -alias c_plwid plwid; +alias c_plwidth plwidth; alias c_plwind plwind; alias c_plxormod plxormod; @@ -2167,7 +2167,7 @@ // Set pen width. -void c_plwid( PLINT width ); +void c_plwidth( PLFLT width ); // Set up world coordinates of the viewport boundaries (2d plots). Modified: trunk/bindings/f77/plstubs.h =================================================================== --- trunk/bindings/f77/plstubs.h 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/f77/plstubs.h 2013-01-30 04:40:35 UTC (rev 12288) @@ -353,7 +353,7 @@ #define PLVPOR FNAME( PLVPOR, plvpor ) #define PLVSTA FNAME( PLVSTA, plvsta ) #define PLW3D FNAME( PLW3D, plw3d ) -#define PLWID FNAME( PLWID, plwid ) +#define PLWIDTH FNAME( PLWIDTH, plwidth ) #define PLWIND FNAME( PLWIND, plwind ) #define PLXORMOD FNAME( PLXORMOD, plxormod ) Modified: trunk/bindings/f77/scstubs.c =================================================================== --- trunk/bindings/f77/scstubs.c 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/f77/scstubs.c 2013-01-30 04:40:35 UTC (rev 12288) @@ -1225,7 +1225,7 @@ void PLWID( PLINT *width ) { - c_plwid( *width ); + c_plwidth( *width ); } void Modified: trunk/bindings/f95/plstubs.h =================================================================== --- trunk/bindings/f95/plstubs.h 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/f95/plstubs.h 2013-01-30 04:40:35 UTC (rev 12288) @@ -364,7 +364,7 @@ #define PLVPOR FNAME( PLVPOR, plvpor ) #define PLVSTA FNAME( PLVSTA, plvsta ) #define PLW3D FNAME( PLW3D, plw3d ) -#define PLWID FNAME( PLWID, plwid ) +#define PLWIDTH FNAME( PLWIDTH, plwidth ) #define PLWIND FNAME( PLWIND, plwind ) #define PLXORMOD FNAME( PLXORMODF77, plxormodf77 ) Modified: trunk/bindings/f95/scstubs.c =================================================================== --- trunk/bindings/f95/scstubs.c 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/f95/scstubs.c 2013-01-30 04:40:35 UTC (rev 12288) @@ -260,7 +260,7 @@ PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, PLFLT *zmin, PLFLT *zmax, PLFLT *alt, PLFLT *az ); -void PLWID( PLINT *width ); +void PLWIDTH( PLFLT *width ); void PLWIND( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax ); void PLXORMOD( PLBOOL *mode, PLBOOL *status ); @@ -1519,9 +1519,9 @@ } void -PLWID( PLINT *width ) +PLWIDTH( PLFLT *width ) { - c_plwid( *width ); + c_plwidth( *width ); } void Modified: trunk/bindings/f95/sfstubsf95.f90 =================================================================== --- trunk/bindings/f95/sfstubsf95.f90 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/f95/sfstubsf95.f90 2013-01-30 04:40:35 UTC (rev 12288) @@ -944,9 +944,10 @@ end interface interface - subroutine plwid( width ) - integer :: width - end subroutine plwid + subroutine plwidth( width ) + use plplot_flt + real(kind=plflt) :: width + end subroutine plwidth end interface interface Modified: trunk/bindings/gnome2/lib/plplotcanvas.c =================================================================== --- trunk/bindings/gnome2/lib/plplotcanvas.c 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/gnome2/lib/plplotcanvas.c 2013-01-30 04:40:35 UTC (rev 12288) @@ -1263,7 +1263,7 @@ void plplot_canvas_wid( PlplotCanvas* self, PLINT width ) { plsstrm( self->Nstream ); - plwid( width ); + plwidth( width ); } // Set up world coordinates of the viewport boundaries (2d plots). Modified: trunk/bindings/java/PLStream.java =================================================================== --- trunk/bindings/java/PLStream.java 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/java/PLStream.java 2013-01-30 04:40:35 UTC (rev 12288) @@ -1163,10 +1163,10 @@ zmin0, zmax0, alt, az ); } - public void wid( int width ) + public void width( int width ) { if ( set_stream() == -1 ) return; - plplotjavac.plwid( width ); + plplotjavac.plwidth( width ); } public void wind( double xmin, double xmax, double ymin, double ymax ) Modified: trunk/bindings/lua/plplotluac.i =================================================================== --- trunk/bindings/lua/plplotluac.i 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/lua/plplotluac.i 2013-01-30 04:40:35 UTC (rev 12288) @@ -1456,7 +1456,7 @@ %rename( vpor ) plvpor; %rename( vsta ) plvsta; %rename( w3d ) plw3d; -%rename( wid ) plwid; +%rename( width ) plwidth; %rename( wind ) plwind; %rename( xormod ) plxormod; %rename( warn ) plwarn; Modified: trunk/bindings/ocaml/plplot.ml =================================================================== --- trunk/bindings/ocaml/plplot.ml 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/ocaml/plplot.ml 2013-01-30 04:40:35 UTC (rev 12288) @@ -973,14 +973,14 @@ let plot_axes (color, xopt, yopt, width, style, labelfunc) = set_color_in color ( fun () -> - let old_width = plgwid () in - plwid width; + let old_width = plgwidth () in + plwidth width; set_line_style style; Option.may plslabelfunc labelfunc; plot_axes xopt yopt; Option.may (fun _ -> plunset_labelfunc ()) labelfunc; set_line_style Solid_line; - plwid old_width; + plwidth old_width; ) in let plot_contours (color, pltr, contours, data) = @@ -1008,12 +1008,12 @@ let plot_join (color, x0, y0, x1, y1, width, style) = set_color_in color ( fun () -> - let old_width = plgwid () in - plwid width; + let old_width = plgwidth () in + plwidth width; set_line_style style; pljoin x0 y0 x1 y1; set_line_style Solid_line; - plwid old_width; + plwidth old_width; ) in let plot_labels (color, x, y, title) = @@ -1024,12 +1024,12 @@ let plot_lines (label, color, xs, ys, width, style) = set_color_in color ( fun () -> - let old_width = plgwid () in - plwid width; + let old_width = plgwidth () in + plwidth width; set_line_style style; plline xs ys; set_line_style Solid_line; - plwid old_width; + plwidth old_width; ) in let plot_map (color, outline, x0, y0, x1, y1) = Modified: trunk/bindings/ocaml/plplot.mli =================================================================== --- trunk/bindings/ocaml/plplot.mli 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/ocaml/plplot.mli 2013-01-30 04:40:35 UTC (rev 12288) @@ -942,7 +942,7 @@ float -> float -> float -> float -> float -> float -> float -> float -> unit = "camlidl_plplot_core_c_plw3d_bytecode" "camlidl_plplot_core_c_plw3d" -external plwid : int -> unit = "camlidl_plplot_core_c_plwid" +external plwidth : float -> unit = "camlidl_plplot_core_c_plwidth" external plwind : float -> float -> float -> float -> unit = "camlidl_plplot_core_c_plwind" external plxormod : bool -> bool = "camlidl_plplot_core_c_plxormod" @@ -992,7 +992,7 @@ = "camlidl_plplot_core_plg_current_col0" external plg_current_col1 : unit -> float = "camlidl_plplot_core_plg_current_col1" -external plgwid : unit -> int = "camlidl_plplot_core_plgwid" +external plgwidth : unit -> float = "camlidl_plplot_core_plgwidth" external plgchrht : unit -> float = "camlidl_plplot_core_plgchrht" external plstripc : string -> Modified: trunk/bindings/ocaml/plplot_core.idl =================================================================== --- trunk/bindings/ocaml/plplot_core.idl 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/ocaml/plplot_core.idl 2013-01-30 04:40:35 UTC (rev 12288) @@ -201,7 +201,7 @@ // information from PLplot. int plg_current_col0(void); float plg_current_col1(void); -int plgwid(void); +float plgwidth(void); float plgchrht(void); #define QUOTEME(x) #x Modified: trunk/bindings/ocaml/plplot_h =================================================================== --- trunk/bindings/ocaml/plplot_h 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/ocaml/plplot_h 2013-01-30 04:40:35 UTC (rev 12288) @@ -738,7 +738,7 @@ PLFLT zmax0, PLFLT alt, PLFLT az); void -c_plwid(PLINT width); +c_plwidth(PLFLT width); void c_plwind(PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax); Modified: trunk/bindings/ocaml/plplot_h.inc =================================================================== --- trunk/bindings/ocaml/plplot_h.inc 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/ocaml/plplot_h.inc 2013-01-30 04:40:35 UTC (rev 12288) @@ -146,7 +146,7 @@ [mlname(plvpor)] void c_plvpor ( double xmin, double xmax, double ymin, double ymax ); [mlname(plvsta)] void c_plvsta ( void ); [mlname(plw3d)] void c_plw3d ( double basex, double basey, double height, double xmin0, double xmax0, double ymin0, double ymax0, double zmin0, double zmax0, double alt, double az ); -[mlname(plwid)] void c_plwid ( int width ); +[mlname(plwidth)] void c_plwidth ( double width ); [mlname(plwind)] void c_plwind ( double xmin, double xmax, double ymin, double ymax ); [mlname(plxormod)] void c_plxormod ( boolean mode, [out] boolean * status ); [mlname(plsetopt)] nonzero_error_int c_plsetopt ( [string] const char * opt, [string] const char * optarg ); Modified: trunk/bindings/ocaml/plplot_impl.c =================================================================== --- trunk/bindings/ocaml/plplot_impl.c 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/ocaml/plplot_impl.c 2013-01-30 04:40:35 UTC (rev 12288) @@ -958,7 +958,7 @@ // Get the current pen width. TODO: Remove this, as I think this information // can be retrieved from another proper PLplot function. -int plgwid( void ) +float plgwidth( void ) { return plsc->width; } Modified: trunk/bindings/octave/etc/plplot.doc =================================================================== --- trunk/bindings/octave/etc/plplot.doc 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/octave/etc/plplot.doc 2013-01-30 04:40:35 UTC (rev 12288) @@ -111,7 +111,7 @@ plvpor -- Creates a viewport with the specified normalized subpage coordinates. plvsta -- Defines a "standard" viewport with seven character heights for the left margin and four character heights everywhere else. plw3d -- Set up a window for three-dimensional plotting. -plwid -- Set pen width. +plwidth -- Set pen width. plwind -- Set up world coordinates of the viewport boundaries -2d plots-. Functions for use from C or C++ only Modified: trunk/bindings/octave/plplot_octave.h.in =================================================================== --- trunk/bindings/octave/plplot_octave.h.in 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/octave/plplot_octave.h.in 2013-01-30 04:40:35 UTC (rev 12288) @@ -588,7 +588,7 @@ #define plvpor c_plvpor #define plvsta c_plvsta #define plw3d c_plw3d -#define plwid c_plwid +#define plwidth c_plwidth #define plwind c_plwind #define plxormod c_plxormod @@ -1587,7 +1587,7 @@ // Set pen width. -void c_plwid( PLINT width ); //%name plwid +void c_plwidth( PLFLT width ); //%name plwidth // Set up world coordinates of the viewport boundaries (2d plots). Modified: trunk/bindings/swig-support/plplotcapi.i =================================================================== --- trunk/bindings/swig-support/plplotcapi.i 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/swig-support/plplotcapi.i 2013-01-30 04:40:35 UTC (rev 12288) @@ -805,7 +805,7 @@ PLFLT zmax0, PLFLT alt, PLFLT az ); void -plwid( PLINT width ); +plwidth( PLINT width ); void plwind( PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax ); Modified: trunk/bindings/tcl/plapi.tpl =================================================================== --- trunk/bindings/tcl/plapi.tpl 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/tcl/plapi.tpl 2013-01-30 04:40:35 UTC (rev 12288) @@ -1060,7 +1060,7 @@ # Set pen width. -pltclcmd plwid void +pltclcmd plwidth void width PLINT # Set up world coordinates of the viewport boundaries (2d plots). Modified: trunk/bindings/tk/PLWin.itk =================================================================== --- trunk/bindings/tk/PLWin.itk 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/tk/PLWin.itk 2013-01-30 04:40:35 UTC (rev 12288) @@ -402,8 +402,8 @@ eval $plwin cmd plw3d $args } - method plwid {args} { - eval $plwin cmd plwid $args + method plwidth {args} { + eval $plwin cmd plwidth $args } method plwind {args} { Modified: trunk/bindings/tk/plr.c =================================================================== --- trunk/bindings/tk/plr.c 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/bindings/tk/plr.c 2013-01-30 04:40:35 UTC (rev 12288) @@ -249,7 +249,7 @@ if ( !strcmp( tag, "width" ) ) { plr_rd( pdf_rd_1byte( plr->pdfs, &dum_uchar ) ); - plwid( dum_uchar ); + plwidth( dum_uchar ); continue; } @@ -425,7 +425,7 @@ plr_rd( pdf_rd_2bytes( plr->pdfs, &width ) ); - plwid( width ); + plwidth( width ); break; } Modified: trunk/doc/docbook/src/advanced.xml =================================================================== --- trunk/doc/docbook/src/advanced.xml 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/doc/docbook/src/advanced.xml 2013-01-30 04:40:35 UTC (rev 12288) @@ -1318,7 +1318,7 @@ </para> <para> - Line width is set using &plwid;. This option is not supported by + Line width is set using &plwidth;. This option is not supported by all devices. </para> Modified: trunk/doc/docbook/src/api.xml =================================================================== --- trunk/doc/docbook/src/api.xml 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/doc/docbook/src/api.xml 2013-01-30 04:40:35 UTC (rev 12288) @@ -16252,16 +16252,16 @@ </sect1> - <sect1 id="plwid" renderas="sect3"> + <sect1 id="plwidth" renderas="sect3"> <title> - <function>plwid</function>: Set pen width + <function>plwidth</function>: Set pen width </title> <para> <funcsynopsis> <funcprototype> <funcdef> - <function>plwid</function> + <function>plwidth</function> </funcdef> <paramdef><parameter>width</parameter></paramdef> </funcprototype> @@ -16292,7 +16292,7 @@ </variablelist> <para> - Redacted form: <function>plwid(width)</function> + Redacted form: <function>plwidth(width)</function> </para> <para> Modified: trunk/doc/docbook/src/plplotdoc.xml.in =================================================================== --- trunk/doc/docbook/src/plplotdoc.xml.in 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/doc/docbook/src/plplotdoc.xml.in 2013-01-30 04:40:35 UTC (rev 12288) @@ -254,7 +254,7 @@ <!ENTITY plvpor '<link linkend="plvpor"><function>plvpor</function></link>'> <!ENTITY plvsta '<link linkend="plvsta"><function>plvsta</function></link>'> <!ENTITY plw3d '<link linkend="plw3d"><function>plw3d</function></link>'> -<!ENTITY plwid '<link linkend="plwid"><function>plwid</function></link>'> +<!ENTITY plwidth '<link linkend="plwidth"><function>plwidth</function></link>'> <!ENTITY plwind '<link linkend="plwind"><function>plwind</function></link>'> <!ENTITY PLGraphicsIn '<link linkend="PLGraphicsIn"><structname>PLGraphicsIn</structname></link>'> <!ENTITY PLOptionTable '<link linkend="PLOptionTable"><structname>PLOptionTable</structname></link>'> Modified: trunk/drivers/cairo.c =================================================================== --- trunk/drivers/cairo.c 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/drivers/cairo.c 2013-01-30 04:40:35 UTC (rev 12288) @@ -1361,7 +1361,7 @@ (double) pls->curcolor.b / 255.0, (double) pls->curcolor.a ); // In Cairo, zero width lines are not hairlines, they are completely invisible. - if ( pls->width < 1 ) + if ( pls->width <= 0. ) { cairo_set_line_width( aStream->cairoContext, 1.0 ); } Modified: trunk/examples/ada/x01a.adb =================================================================== --- trunk/examples/ada/x01a.adb 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/ada/x01a.adb 2013-01-30 04:40:35 UTC (rev 12288) @@ -98,9 +98,9 @@ -- Draw the line plcol0(3); - plwid(2); + plwidth(2); plline(x, y); - plwid(1); + plwidth(1); end plot2; Modified: trunk/examples/ada/x02a.adb =================================================================== --- trunk/examples/ada/x02a.adb 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/ada/x02a.adb 2013-01-30 04:40:35 UTC (rev 12288) @@ -62,14 +62,14 @@ vmin := 0.1; vmax := 0.9; for j in 0..2 loop - plwid(j + 1); + plwidth(j + 1); plvpor(vmin, vmax, vmin, vmax); plwind(0.0, 1.0, 0.0, 1.0); plbox("bc", 0.0, 0, "bc", 0.0, 0); vmin := vmin + 0.1; vmax := vmax - 0.1; end loop; - plwid(1); + plwidth(1); plptex(0.5, 0.5, 1.0, 0.0, 0.5, Trim(Integer'image(i), Left)); end loop; end draw_windows; Modified: trunk/examples/c/x01c.c =================================================================== --- trunk/examples/c/x01c.c 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/c/x01c.c 2013-01-30 04:40:35 UTC (rev 12288) @@ -320,9 +320,9 @@ // Draw the line plcol0( 3 ); - plwid( 2 ); + plwidth( 2 ); plline( 100, x, y ); - plwid( 1 ); + plwidth( 1 ); } //-------------------------------------------------------------------------- Modified: trunk/examples/c/x02c.c =================================================================== --- trunk/examples/c/x02c.c 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/c/x02c.c 2013-01-30 04:40:35 UTC (rev 12288) @@ -141,14 +141,14 @@ vmax = 0.9; for ( j = 0; j <= 2; j++ ) { - plwid( j + 1 ); + plwidth( j + 1 ); plvpor( vmin, vmax, vmin, vmax ); plwind( 0.0, 1.0, 0.0, 1.0 ); plbox( "bc", 0.0, 0, "bc", 0.0, 0 ); vmin = vmin + 0.1; vmax = vmax - 0.1; } - plwid( 1 ); + plwidth( 1 ); plptex( 0.5, 0.5, 1.0, 0.0, 0.5, text ); } } Modified: trunk/examples/c++/qt_PlotWindow.cpp =================================================================== --- trunk/examples/c++/qt_PlotWindow.cpp 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/c++/qt_PlotWindow.cpp 2013-01-30 04:40:35 UTC (rev 12288) @@ -96,11 +96,11 @@ plbox( "bcnst", 0., 0, "bcnst", 0., 0 ); plcol0( 1 ); - plwid( 2 ); + plwidth( 2 ); plline( 360, indexes, sine ); plcol0( 3 ); - plwid( 1 ); + plwidth( 1 ); pllsty( 2 ); plline( 360, indexes, cosine ); pllsty( 1 ); @@ -125,11 +125,11 @@ plbox( "bcnst", 0., 0, "bcnst", 0., 0 ); plcol0( 1 ); - plwid( 2 ); + plwidth( 2 ); plline( 360, indexes, square ); plcol0( 3 ); - plwid( 1 ); + plwidth( 1 ); pllsty( 2 ); plline( 360, indexes, cubic ); pllsty( 1 ); Modified: trunk/examples/c++/wxPLplotDemo.cpp =================================================================== --- trunk/examples/c++/wxPLplotDemo.cpp 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/c++/wxPLplotDemo.cpp 2013-01-30 04:40:35 UTC (rev 12288) @@ -272,7 +272,7 @@ pls->lab( "x", "y", "sin(x)/x" ); pls->col0( 3 ); - pls->wid( 2 ); + pls->width( 2 ); pls->line( np, x, y ); plotwindow->RenewPlot(); Modified: trunk/examples/c++/x01.cc =================================================================== --- trunk/examples/c++/x01.cc 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/c++/x01.cc 2013-01-30 04:40:35 UTC (rev 12288) @@ -327,9 +327,9 @@ // Draw the line. pls->col0( 3 ); - pls->wid( 2 ); + pls->width( 2 ); pls->line( 100, x, y ); - pls->wid( 1 ); + pls->width( 1 ); delete[] x; delete[] y; Modified: trunk/examples/c++/x02.cc =================================================================== --- trunk/examples/c++/x02.cc 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/c++/x02.cc 2013-01-30 04:40:35 UTC (rev 12288) @@ -148,14 +148,14 @@ vmax = 0.9; for ( j = 0; j <= 2; j++ ) { - pls->wid( j + 1 ); + pls->width( j + 1 ); pls->vpor( vmin, vmax, vmin, vmax ); pls->wind( 0.0, 1.0, 0.0, 1.0 ); pls->box( "bc", 0.0, 0, "bc", 0.0, 0 ); vmin = vmin + 0.1; vmax = vmax - 0.1; } - pls->wid( 1 ); + pls->width( 1 ); pls->ptex( 0.5, 0.5, 1.0, 0.0, 0.5, text ); } } Modified: trunk/examples/d/x01d.d =================================================================== --- trunk/examples/d/x01d.d 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/d/x01d.d 2013-01-30 04:40:35 UTC (rev 12288) @@ -254,10 +254,10 @@ // Draw the line plcol0( 3 ); - plwid( 2 ); + plwidth( 2 ); plline( x, y ); plflush(); - plwid( 1 ); + plwidth( 1 ); } public void plot3() Modified: trunk/examples/d/x02d.d =================================================================== --- trunk/examples/d/x02d.d 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/d/x02d.d 2013-01-30 04:40:35 UTC (rev 12288) @@ -125,14 +125,14 @@ PLFLT vmax = 0.9; for ( int j = 0; j < 3; j++ ) { - plwid( j + 1 ); + plwidth( j + 1 ); plvpor( vmin, vmax, vmin, vmax ); plwind( 0.0, 1.0, 0.0, 1.0 ); plbox( "bc", 0.0, 0, "bc", 0.0, 0 ); vmin = vmin + 0.1; vmax = vmax - 0.1; } - plwid( 1 ); + plwidth( 1 ); plptex( 0.5, 0.5, 1.0, 0.0, 0.5, std.string.toString( i ) ); } } Modified: trunk/examples/f77/x01f.fm4 =================================================================== --- trunk/examples/f77/x01f.fm4 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/f77/x01f.fm4 2013-01-30 04:40:35 UTC (rev 12288) @@ -153,9 +153,9 @@ c Draw the line call plcol0(3) - call plwid(2) + call plwidth(2.d0) call plline( 100, x, y ) - call plwid(1) + call plwidth(1.d0) end c====================================================================== Modified: trunk/examples/f77/x02f.fm4 =================================================================== --- trunk/examples/f77/x02f.fm4 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/f77/x02f.fm4 2013-01-30 04:40:35 UTC (rev 12288) @@ -139,14 +139,14 @@ vmin = 0.1d0 vmax = 0.9d0 do j=1,3 - call plwid(j) + call plwidth(dble(j)) call plvpor(vmin,vmax,vmin,vmax) call plwind(0.0d0, 1.0d0, 0.0d0, 1.0d0) call plbox('bc', 0.0d0, 0, 'bc', 0.0d0, 0) vmin = vmin + 0.1d0 vmax = vmax - 0.1d0 enddo - call plwid(1) + call plwidth(1.d0) call plptex(0.5d0, 0.5d0, 1.0d0, 0.0d0, 0.5d0, text) enddo Modified: trunk/examples/f95/x01f.f90 =================================================================== --- trunk/examples/f95/x01f.f90 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/f95/x01f.f90 2013-01-30 04:40:35 UTC (rev 12288) @@ -135,9 +135,9 @@ ! Draw the line call plcol0(3) - call plwid(2) + call plwidth(2._plflt) call plline( x, y ) - call plwid(1) + call plwidth(1._plflt) end subroutine plot2 Modified: trunk/examples/f95/x02f.f90 =================================================================== --- trunk/examples/f95/x02f.f90 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/f95/x02f.f90 2013-01-30 04:40:35 UTC (rev 12288) @@ -118,7 +118,7 @@ integer :: nw, cmap0_offset integer :: i,j - real(kind=plflt) :: vmin, vmax + real(kind=plflt) :: vmin, vmax, xj character (len=3) :: text call plschr(0.0_plflt, 3.5_plflt) @@ -132,14 +132,15 @@ vmin = 0.1_plflt vmax = 0.9_plflt do j=1,3 - call plwid(j) + xj = j + call plwidth(xj) call plvpor(vmin,vmax,vmin,vmax) call plwind(0.0_plflt, 1.0_plflt, 0.0_plflt, 1.0_plflt) call plbox('bc', 0.0_plflt, 0, 'bc', 0.0_plflt, 0) vmin = vmin + 0.1_plflt vmax = vmax - 0.1_plflt enddo - call plwid(1) + call plwidth(1._plflt) call plptex(0.5_plflt, 0.5_plflt, 1.0_plflt, 0.0_plflt, 0.5_plflt, text) enddo Modified: trunk/examples/java/x01.java =================================================================== --- trunk/examples/java/x01.java 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/java/x01.java 2013-01-30 04:40:35 UTC (rev 12288) @@ -235,9 +235,9 @@ // Draw the line. pls.col0( 3 ); - pls.wid( 2 ); + pls.width( 2 ); pls.line( x, y ); - pls.wid( 1 ); + pls.width( 1 ); } void plot3() Modified: trunk/examples/java/x02.java =================================================================== --- trunk/examples/java/x02.java 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/java/x02.java 2013-01-30 04:40:35 UTC (rev 12288) @@ -165,14 +165,14 @@ vmax = 0.9; for ( j = 0; j <= 2; j++ ) { - pls.wid( j + 1 ); + pls.width( j + 1 ); pls.vpor( vmin, vmax, vmin, vmax ); pls.wind( 0.0, 1.0, 0.0, 1.0 ); pls.box( "bc", 0.0, 0, "bc", 0.0, 0 ); vmin = vmin + 0.1; vmax = vmax - 0.1; } - pls.wid( 1 ); + pls.width( 1 ); pls.ptex( 0.5, 0.5, 1.0, 0.0, 0.5, text ); } } Modified: trunk/examples/lua/x01.lua =================================================================== --- trunk/examples/lua/x01.lua 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/lua/x01.lua 2013-01-30 04:40:35 UTC (rev 12288) @@ -87,9 +87,9 @@ -- Draw the line pl.col0(3) - pl.wid(2) + pl.width(2) pl.line(x, y) - pl.wid(1) + pl.width(1) end Modified: trunk/examples/lua/x02.lua =================================================================== --- trunk/examples/lua/x02.lua 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/lua/x02.lua 2013-01-30 04:40:35 UTC (rev 12288) @@ -40,14 +40,14 @@ vmin = 0.1 vmax = 0.9 for j = 0, 2 do - pl.wid(j + 1) + pl.width(j + 1) pl.vpor(vmin, vmax, vmin, vmax) pl.wind(0, 1, 0, 1) pl.box("bc", 0, 0, "bc", 0, 0) vmin = vmin + 0.1 vmax = vmax - 0.1 end - pl.wid(1) + pl.width(1) pl.ptex(0.5, 0.5, 1, 0, 0.5, tostring(i)) end end Modified: trunk/examples/ocaml/x01.ml =================================================================== --- trunk/examples/ocaml/x01.ml 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/ocaml/x01.ml 2013-01-30 04:40:35 UTC (rev 12288) @@ -182,9 +182,9 @@ (* Draw the line *) plcol0 3; - plwid 2; + plwidth 2; plline x y; - plwid 1; + plwidth 1; (* All done. *) () Modified: trunk/examples/ocaml/x02.ml =================================================================== --- trunk/examples/ocaml/x02.ml 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/ocaml/x02.ml 2013-01-30 04:40:35 UTC (rev 12288) @@ -39,13 +39,13 @@ let vmin = 0.1 in let vmax = 0.9 in for j = 0 to 2 do - plwid (j + 1); + plwidth (j + 1); let j' = float_of_int j *. 0.1 in plvpor (vmin +. j') (vmax -. j') (vmin +. j') (vmax -. j'); plwind 0.0 1.0 0.0 1.0; plbox "bc" 0.0 0 "bc" 0.0 0; done; - plwid 1; + plwidth 1; plptex 0.5 0.5 1.0 0.0 0.5 text; done; () Modified: trunk/examples/octave/x01c.m =================================================================== --- trunk/examples/octave/x01c.m 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/octave/x01c.m 2013-01-30 04:40:35 UTC (rev 12288) @@ -171,9 +171,9 @@ ## Draw the line */ plcol0(3); - plwid(2); + plwidth(2); plline(x', y'); - plwid(1); + plwidth(1); endfunction Modified: trunk/examples/octave/x02c.m =================================================================== --- trunk/examples/octave/x02c.m 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/octave/x02c.m 2013-01-30 04:40:35 UTC (rev 12288) @@ -50,14 +50,14 @@ vmin = 0.1; vmax = 0.9; for j=0:2 - plwid(j + 1); + plwidth(j + 1); plvpor(vmin, vmax, vmin, vmax); plwind(0.0, 1.0, 0.0, 1.0); plbox("bc", 0.0, 0, "bc", 0.0, 0); vmin = vmin + 0.1; vmax = vmax - 0.1; endfor - plwid(1); + plwidth(1); plptex(0.5, 0.5, 1.0, 0.0, 0.5, text); endfor endfunction Modified: trunk/examples/perl/x01.pl =================================================================== --- trunk/examples/perl/x01.pl 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/perl/x01.pl 2013-01-30 04:40:35 UTC (rev 12288) @@ -254,9 +254,9 @@ # Draw the line plcol0 (3); - plwid (2); + plwidth (2); plline ($x, $y); - plwid (1); + plwidth (1); } sub plot3 { Modified: trunk/examples/perl/x02.pl =================================================================== --- trunk/examples/perl/x02.pl 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/perl/x02.pl 2013-01-30 04:40:35 UTC (rev 12288) @@ -130,14 +130,14 @@ my $vmin = 0.1; my $vmax = 0.9; for (my $j = 0; $j <= 2; $j++) { - plwid($j + 1); + plwidth($j + 1); plvpor($vmin, $vmax, $vmin, $vmax); plwind(0.0, 1.0, 0.0, 1.0); plbox(0,0,0,0,"bc","bc"); $vmin += 0.1; $vmax -= 0.1; } - plwid(1); + plwidth(1); plptex(0.5, 0.5, 1.0, 0.0, 0.5, $text); } } Modified: trunk/examples/python/plplot_logo.py =================================================================== --- trunk/examples/python/plplot_logo.py 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/python/plplot_logo.py 2013-01-30 04:40:35 UTC (rev 12288) @@ -83,7 +83,7 @@ step = (zmax-zmin)/(nlevel+1) clevel = zmin + step + arange(nlevel)*step plschr(0., 1.8) - plwid(1) + plwidth(1) pladv(0) plvpor(0.0, 1.0, 0.0, 1.0) plwind(-0.43, 0.840, 0.05, 0.48) Modified: trunk/examples/python/pyqt4_example.py =================================================================== --- trunk/examples/python/pyqt4_example.py 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/python/pyqt4_example.py 2013-01-30 04:40:35 UTC (rev 12288) @@ -89,11 +89,11 @@ plplot.plbox("bcnst", 0., 0, "bcnst", 0., 0) plplot.plcol0(1) - plplot.plwid(2) + plplot.plwidth(2) plplot.plline(indexes, sine) plplot.plcol0(3) - plplot.plwid(1) + plplot.plwidth(1) plplot.pllsty(2) plplot.plline(indexes, cosine) plplot.pllsty(1) @@ -114,11 +114,11 @@ plplot.plbox("bcnst", 0., 0, "bcnst", 0., 0) plplot.plcol0(1) - plplot.plwid(2) + plplot.plwidth(2) plplot.plline(indexes, square) plplot.plcol0(3) - plplot.plwid(1) + plplot.plwidth(1) plplot.pllsty(2) plplot.plline(indexes, cubic) plplot.pllsty(1) Modified: trunk/examples/python/x02.py =================================================================== --- trunk/examples/python/x02.py 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/python/x02.py 2013-01-30 04:40:35 UTC (rev 12288) @@ -41,13 +41,13 @@ vmin = 0.1 vmax = 0.9 for j in range(3): - w.plwid(j + 3) + w.plwidth(j + 3) w.plvpor(vmin, vmax, vmin, vmax) w.plwind(0.0, 1.0, 0.0, 1.0) w.plbox("bc", 0.0, 0, "bc", 0.0, 0) vmin = vmin + 0.1 vmax = vmax - 0.1 - w.plwid(1) + w.plwidth(1) w.plptex(0.5, 0.5, 1.0, 0.0, 0.5, `i`) # Now finish up. Modified: trunk/examples/python/xw01.py =================================================================== --- trunk/examples/python/xw01.py 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/python/xw01.py 2013-01-30 04:40:35 UTC (rev 12288) @@ -124,9 +124,9 @@ # Draw the line plcol0(3) - plwid(2) + plwidth(2) plline(x, y) - plwid(1) + plwidth(1) # =============================================================== Modified: trunk/examples/python/xw02.py =================================================================== --- trunk/examples/python/xw02.py 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/python/xw02.py 2013-01-30 04:40:35 UTC (rev 12288) @@ -36,13 +36,13 @@ vmin = 0.1 vmax = 0.9 for j in range(3): - plwid(j + 1) + plwidth(j + 1) plvpor(vmin, vmax, vmin, vmax) plwind(0.0, 1.0, 0.0, 1.0) plbox("bc", 0.0, 0, "bc", 0.0, 0) vmin = vmin + 0.1 vmax = vmax - 0.1 - plwid(1) + plwidth(1) plptex(0.5, 0.5, 1.0, 0.0, 0.5, `i`) # Demonstrate multiple windows and default color map 0 palette. Modified: trunk/examples/tcl/x01.tcl =================================================================== --- trunk/examples/tcl/x01.tcl 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/tcl/x01.tcl 2013-01-30 04:40:35 UTC (rev 12288) @@ -111,9 +111,9 @@ } $w cmd plcol0 3 - $w cmd plwid 2 + $w cmd plwidth 2 $w cmd plline 100 x1 y1 - $w cmd plwid 1 + $w cmd plwidth 1 } # This is supposed to work just like the plot3() in x01c.c Modified: trunk/examples/tcl/x02.tcl =================================================================== --- trunk/examples/tcl/x02.tcl 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/examples/tcl/x02.tcl 2013-01-30 04:40:35 UTC (rev 12288) @@ -124,14 +124,14 @@ set vmin 0.1 set vmax 0.9 for {set j 0} {$j <= 2} {incr j} { - $w cmd plwid [expr $j+1] + $w cmd plwidth [expr $j+1] $w cmd plvpor $vmin $vmax $vmin $vmax $w cmd plwind 0.0 1.0 0.0 1.0 $w cmd plbox "bc" 0.0 0 "bc" 0.0 0 set vmin [expr $vmin+0.1] set vmax [expr $vmax-0.1] } - $w cmd plwid 1 + $w cmd plwidth 1 $w cmd plptex 0.5 0.5 1.0 0.0 0.5 $i } Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/include/plplot.h 2013-01-30 04:40:35 UTC (rev 12288) @@ -753,6 +753,7 @@ #define plvsta c_plvsta #define plw3d c_plw3d #define plwid c_plwid +#define plwidth c_plwidth #define plwind c_plwind #define plxormod c_plxormod @@ -1976,7 +1977,7 @@ // Set pen width. PLDLLIMPEXP void -c_plwid( PLINT width ); +c_plwidth( PLFLT width ); // Set up world coordinates of the viewport boundaries (2d plots). Modified: trunk/include/plstrm.h =================================================================== --- trunk/include/plstrm.h 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/include/plstrm.h 2013-01-30 04:40:35 UTC (rev 12288) @@ -554,7 +554,7 @@ // Variables governing pen width - PLINT width; + PLFLT width; PLINT widthset, widthlock; // Variables governing arrow Modified: trunk/src/plargs.c =================================================================== --- trunk/src/plargs.c 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/src/plargs.c 2013-01-30 04:40:35 UTC (rev 12288) @@ -1867,17 +1867,17 @@ static int opt_width( const char * PL_UNUSED( opt ), const char *opt_arg, void * PL_UNUSED( client_data ) ) { - int width; + double width; - width = atoi( opt_arg ); - if ( width < 0 ) + width = atof( opt_arg ); + if ( width < 0. ) { fprintf( stderr, "?invalid width\n" ); return 1; } else { - plwid( width ); + plwidth( width ); plsc->widthlock = 1; } return 0; Modified: trunk/src/plcore.c =================================================================== --- trunk/src/plcore.c 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/src/plcore.c 2013-01-30 04:40:35 UTC (rev 12288) @@ -11,7 +11,7 @@ // Copyright (C) 2004, 2005 Rafael Laboissiere // Copyright (C) 2004, 2006 Andrew Ross // Copyright (C) 2004 Andrew Roach -// Copyright (C) 2005-2010 Alan W. Irwin +// Copyright (C) 2005-2013 Alan W. Irwin // Copyright (C) 2005 Thomas J. Duck // // This file is part of PLplot. @@ -3624,9 +3624,9 @@ // void -c_plwid( PLINT width ) +c_plwidth( PLFLT width ) { - if ( width != plsc->width && width >= 0 ) + if ( width != plsc->width && width >= 0. ) { plsc->width = width; Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/src/pllegend.c 2013-01-30 04:40:35 UTC (rev 12288) @@ -820,7 +820,7 @@ { plcol0( box_colors[i] ); plpsty( box_patterns[i] ); - plwid( box_line_widths[i] ); + plwidth( box_line_widths[i] ); xbox[0] = plot_x_subpage + xshift; xbox[1] = xbox[0]; xbox[2] = plot_x_end_subpage + xshift; @@ -831,20 +831,20 @@ ybox[3] = ty + 0.5 * drow * box_scales[i]; plfill( 4, xbox, ybox ); pllsty( line_style_save ); - plwid( line_width_save ); + plwidth( line_width_save ); } if ( opt_array[i] & PL_LEGEND_LINE ) { plcol0( line_colors[i] ); pllsty( line_styles[i] ); - plwid( line_widths[i] ); + plwidth( line_widths[i] ); xl[0] = plot_x_subpage + xshift; xl[1] = plot_x_end_subpage + xshift; yl[0] = ty; yl[1] = ty; plline( 2, xl, yl ); pllsty( line_style_save ); - plwid( line_width_save ); + plwidth( line_width_save ); } if ( opt_array[i] & PL_LEGEND_SYMBOL ) Modified: trunk/src/plot3d.c =================================================================== --- trunk/src/plot3d.c 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/src/plot3d.c 2013-01-30 04:40:35 UTC (rev 12288) @@ -553,7 +553,7 @@ bx[2] = ( ixOrigin != ixmin && ixSlow == 0 ) || ixSlow > 0 ? xmax : xmin; by[2] = ( iyOrigin != iymin && iySlow == 0 ) || iySlow > 0 ? ymax : ymin; - plwid( zbwidth ); + plwidth( zbwidth ); plcol0( zbcol ); for ( tp = tick * floor( zmin / tick ) + tick; tp <= zmax; tp += tick ) { @@ -565,7 +565,7 @@ by[0] = by[1]; bz[0] = zmin; plline3( 2, bx, by, bz ); - plwid( width ); + plwidth( width ); plcol0( color ); } @@ -1432,10 +1432,10 @@ { color = plsc->icol0; width = plsc->width; - plwid( zbwidth ); + plwidth( zbwidth ); plcol0( zbcol ); plgrid3( zbtck ); - plwid( width ); + plwidth( width ); plcol0( color ); } Modified: trunk/src/plshade.c =================================================================== --- trunk/src/plshade.c 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/src/plshade.c 2013-01-30 04:40:35 UTC (rev 12288) @@ -272,7 +272,7 @@ init_color = plsc->icol0; init_width = plsc->width; plcol0( cont_color ); - plwid( cont_width ); + plwidth( cont_width ); if ( pltr ) { plfcont( zops->f2eval, zp, nx, ny, 1, nx, 1, ny, clevel, nlevel, pltr, pltr_data ); @@ -306,7 +306,7 @@ free( y ); } plcol0( init_color ); - plwid( init_width ); + plwidth( init_width ); } } @@ -520,7 +520,7 @@ pen_wd_max = max_width; plstyl( (PLINT) 0, NULL, NULL ); - plwid( sh_width ); + plwidth( sh_width ); if ( fill != NULL ) { switch ( sh_cmap ) @@ -788,7 +788,7 @@ if ( fill != NULL ) { - plwid( sh_width ); + plwidth( sh_width ); if ( sh_cmap == 0 ) plcol0( (PLINT) sh_color ); else if ( sh_cmap == 1 ) @@ -804,7 +804,7 @@ free( c ); free( a ); - plwid( init_width ); + plwidth( init_width ); } //-------------------------------------------------------------------------- @@ -1166,7 +1166,7 @@ if ( pen_col_min != 0 && pen_wd_min != 0 && min_points != 0 ) { plcol0( pen_col_min ); - plwid( pen_wd_min ); + plwidth( pen_wd_min ); if ( min_points == 4 && slope == 0 ) { // swap points 1 and 3 @@ -1184,7 +1184,7 @@ if ( pen_col_max != 0 && pen_wd_max != 0 && max_points != 0 ) { plcol0( pen_col_max ); - plwid( pen_wd_max ); + plwidth( pen_wd_max ); if ( max_points == 4 && slope == 0 ) { // swap points 1 and 3 Modified: trunk/sys/win-tk/tclgen.c =================================================================== --- trunk/sys/win-tk/tclgen.c 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/sys/win-tk/tclgen.c 2013-01-30 04:40:35 UTC (rev 12288) @@ -5150,13 +5150,13 @@ } /*--------------------------------------------------------------------------*\ - * plwidCmd + * plwidthCmd * - * Processes plwid Tcl command. + * Processes plwidth Tcl command. \*--------------------------------------------------------------------------*/ static int -plwidCmd( ClientData clientData, Tcl_Interp *interp, int argc, char *argv[] ) +plwidthCmd( ClientData clientData, Tcl_Interp *interp, int argc, char *argv[] ) { PLINT width; @@ -5164,7 +5164,7 @@ if ( (argc == 2) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) { Tcl_AppendResult( interp, "command syntax: \"", - "plwid width", "\"", + "plwidth width", "\"", (char *) NULL); return TCL_ERROR; } @@ -5173,14 +5173,14 @@ (!0 && !0 && (argc != (1 + 1))) || ( 0 && (argc != 1) && (argc != (1 + 1))) ) { Tcl_AppendResult( interp, "wrong # args: should be \"", - "plwid width", "\"", + "plwidth width", "\"", (char *) NULL); return TCL_ERROR; } width = atoi(argv[1+0]); - plwid ( width ); + plwidth ( width ); if (errcode != 0) { Modified: trunk/sys/win-tk/tclgen.h =================================================================== --- trunk/sys/win-tk/tclgen.h 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/sys/win-tk/tclgen.h 2013-01-30 04:40:35 UTC (rev 12288) @@ -99,6 +99,6 @@ static int plvporCmd( ClientData, Tcl_Interp *, int, char **); static int plvstaCmd( ClientData, Tcl_Interp *, int, char **); static int plw3dCmd( ClientData, Tcl_Interp *, int, char **); -static int plwidCmd( ClientData, Tcl_Interp *, int, char **); +static int plwidthCmd( ClientData, Tcl_Interp *, int, char **); static int plwindCmd( ClientData, Tcl_Interp *, int, char **); static int plxormodCmd( ClientData, Tcl_Interp *, int, char **); Modified: trunk/sys/win-tk/tclgen_s.h =================================================================== --- trunk/sys/win-tk/tclgen_s.h 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/sys/win-tk/tclgen_s.h 2013-01-30 04:40:35 UTC (rev 12288) @@ -99,6 +99,6 @@ {"plvpor", plvporCmd}, {"plvsta", plvstaCmd}, {"plw3d", plw3dCmd}, - {"plwid", plwidCmd}, + {"plwidth", plwidthCmd}, {"plwind", plwindCmd}, {"plxormod", plxormodCmd}, Modified: trunk/utils/plrender.c =================================================================== --- trunk/utils/plrender.c 2013-01-30 01:06:02 UTC (rev 12287) +++ trunk/utils/plrender.c 2013-01-30 04:40:35 UTC (rev 12288) @@ -972,7 +972,7 @@ plm_rd( pdf_rd_2bytes( pdfs, &width ) ); - plwid( width ); + plwidth( width ); break; } @@ -1931,7 +1931,7 @@ if ( !strcmp( tag, "width" ) ) { plm_rd( pdf_rd_1byte( pdfs, &dum_uchar ) ); - plwid( dum_uchar ); + plwidth( dum_uchar ); continue; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-01-30 08:05:48
|
Revision: 12289 http://plplot.svn.sourceforge.net/plplot/?rev=12289&view=rev Author: airwin Date: 2013-01-30 08:05:39 +0000 (Wed, 30 Jan 2013) Log Message: ----------- Move to floating point pen width for qt devices. This appears to work now since calling plwidth(0.01); in example 1 yields extremely thin line results for a number of different qt devices. During the course of the testing I found a qt device driver issue which is the -width option (even -width 100.) appears to have no effect on line width except to make it fixed at unity. I could not figure out the cause of this issue. (Which is why I did my testing by calling plwidth explicitly from example 1). Modified Paths: -------------- trunk/bindings/qt_gui/plqt.cpp trunk/drivers/qt.cpp trunk/include/qt.h Modified: trunk/bindings/qt_gui/plqt.cpp =================================================================== --- trunk/bindings/qt_gui/plqt.cpp 2013-01-30 04:40:35 UTC (rev 12288) +++ trunk/bindings/qt_gui/plqt.cpp 2013-01-30 08:05:39 UTC (rev 12289) @@ -452,13 +452,13 @@ m_painterP->setBrush( linear_gradient ); } -void QtPLDriver::setWidth( PLINT w ) +void QtPLDriver::setWidthF( PLFLT w ) { if ( !m_painterP->isActive() ) return; QPen p = m_painterP->pen(); - p.setWidth( w ); + p.setWidthF( w ); m_painterP->setPen( p ); } @@ -928,11 +928,11 @@ redrawFromLastFlush = true; } -void QtPLWidget::setWidth( PLINT w ) +void QtPLWidget::setWidthF( PLFLT w ) { BufferElement el; el.Element = SET_WIDTH; - el.Data.intParam = w; + el.Data.fltParam = w; m_listBuffer.append( el ); // redrawFromLastFlush=true; } @@ -1412,7 +1412,7 @@ break; case SET_WIDTH: - SolidPen.setWidthF( i->Data.intParam ); + SolidPen.setWidthF( i->Data.fltParam ); if ( hasPen ) { p->setPen( SolidPen ); Modified: trunk/drivers/qt.cpp =================================================================== --- trunk/drivers/qt.cpp 2013-01-30 04:40:35 UTC (rev 12288) +++ trunk/drivers/qt.cpp 2013-01-30 08:05:39 UTC (rev 12289) @@ -450,7 +450,7 @@ switch ( op ) { case PLSTATE_WIDTH: - widget->setWidth( pls->width ); + widget->setWidthF( pls->width ); break; case PLSTATE_COLOR0: @@ -893,7 +893,7 @@ switch ( op ) { case PLSTATE_WIDTH: - widget->setWidth( pls->width ); + widget->setWidthF( pls->width ); break; case PLSTATE_COLOR0: @@ -1186,7 +1186,7 @@ switch ( op ) { case PLSTATE_WIDTH: - widget->setWidth( pls->width ); + widget->setWidthF( pls->width ); break; case PLSTATE_COLOR0: @@ -1446,7 +1446,7 @@ switch ( op ) { case PLSTATE_WIDTH: - widget->setWidth( pls->width ); + widget->setWidthF( pls->width ); break; case PLSTATE_COLOR0: @@ -1648,7 +1648,7 @@ switch ( op ) { case PLSTATE_WIDTH: - widget->setWidth( pls->width ); + widget->setWidthF( pls->width ); break; case PLSTATE_COLOR0: Modified: trunk/include/qt.h =================================================================== --- trunk/include/qt.h 2013-01-30 04:40:35 UTC (rev 12288) +++ trunk/include/qt.h 2013-01-30 08:05:39 UTC (rev 12289) @@ -135,7 +135,7 @@ virtual void setGradient( int x1, int x2, int y1, int y2, unsigned char *r, unsigned char *g, unsigned char *b, PLFLT *alpha, PLINT ncol1 ); - virtual void setWidth( PLINT w ); + virtual void setWidthF( PLFLT w ); // Set pen to draw solid strokes (called after drawing dashed strokes) virtual void setSolid(); // Conversion factor from internal plplot coordinates to device coordinates @@ -328,7 +328,7 @@ void setGradient( int x1, int x2, int y1, int y2, unsigned char *r, unsigned char *g, unsigned char *b, PLFLT *alpha, PLINT ncol1 ); - void setWidth( PLINT r ); + void setWidthF( PLFLT r ); void drawText( EscText* txt ); void flush(); void getCursorCmd( PLGraphicsIn *ptr ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |