add plplot

This commit is contained in:
侯歌 2021-12-14 18:33:00 +08:00
parent ad83072f73
commit 2c5f6c9965
4191 changed files with 1060329 additions and 1 deletions

1
.gitignore vendored Normal file → Executable file
View File

@ -1,5 +1,4 @@
out* out*
?
*.bak *.bak
*.pak *.pak
*.swp *.swp

27
allwinnerx5.sh Executable file
View File

@ -0,0 +1,27 @@
if [ $# -gt 0 ]
then
mkdir -p out-allwinnerr
pushd out-allwinnerr
TYPE=Release
else
mkdir -p out-allwinner
pushd out-allwinner
TYPE=Debug
fi
cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/allwinner-x5toolchain.cmake\
-DCDROID_CHIPSET=allwinner -DENABLE_RFB=ON \
-DCMAKE_INSTALL_PREFIX=./ \
-DCMAKE_BUILD_TYPE=${TYPE} \
..
popd
if [ ! -d "src/gui" ]; then
pushd deps/lib
mv libcairo.a libcairo_static.a
mv libjrtp.a libjrtplib-static.a
mv libgui.a libgui_static.a
mv libdvbepg.a libdvbepg_static.a
mv libtvhal.a libtvhal_static.a
popd
fi

View File

@ -0,0 +1,15 @@
SET(CMAKE_SYSTEM_NAME Linux)
SET(TOOLCHAIN_DIR /opt/nx5-toolchain)
set(CMAKE_CROSSCOMPILING true)
SET(CMAKE_SYSTEM_PROCESSOR mips)
SET(CMAKE_CXX_COMPILER ${TOOLCHAIN_DIR}/bin/arm-linux-gnueabi-g++)
SET(CMAKE_C_COMPILER ${TOOLCHAIN_DIR}/bin/arm-linux-gnueabi-gcc)
SET(CMAKE_ASM_COMPILER ${TOOLCHAIN_DIR}/bin/arm-linux-gnueabi-gcc)
#SET(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_DIR}/host/usr/mipsel-buildroot-linux-gnu/sysroot)
SET(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_DIR}/arm-linux-gnueabi)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

34
src/3rdparty/plplot/.gitattributes vendored Executable file
View File

@ -0,0 +1,34 @@
# All text files are by default (unless some specific pattern
# overrides below) treated as LF in repository and native (LF on Unix
# and CRLF on Windows) in the working directory.
* text=auto
# All bash shell scripts must uniformly have LF endings.
*.sh eof=lf
*.sh.in eof=lf
# git has its own heuristics for detecting text versus binary files
# but just to make sure it doesn't misclassify a file as text when
# it is binary, use specific rules below.
# Chloe image in Portable Gray Map binary form
*.pgm -text
# Binary graphical formats in the www subdirectory tree
*.gif -text
*.jpg -text
# Binary graphical format in lib/nistcd/*.cgm
*.cgm -text
# Shapefile binary formats in the data subdirectory tree
*.dbf -text
*.prj -text
*.shp -text
*.shx -text
# Hershey binary font files in data subdirectory
*.fnt -text
# PNG format files in doc/wiki_source/*/*/*.png
*.png -text

31
src/3rdparty/plplot/.gitignore vendored Executable file
View File

@ -0,0 +1,31 @@
# For emacs there are many more ignore patterns available from
# https://github.com/github/gitignore/blob/master/Global/Emacs.gitignore,
# but I think that is overkill, and these are the only three patterns I
# routinely encounter when using emacs as an editor rather than an
# OS. :-)
# Those whose emacs use creates more auto-generated
# files than this should probably being doing a global
# config for themselves instead of a change to this file.
*~
\#*\#
.\#*
# For Python there are many more ignore patterns available from
# https://github.com/github/gitignore/blob/master/Python.gitignore
# if needed, but so far I find this pattern is enough when using
# python from another directory (such as the separate build directory
# you should be using).
*.py[cod]
# In case the user wants to use this specific separate build tree
# within the source tree.
build/
# Other ignore patterns which have historically been in this
# file but which are currently undocumented.
*.flc
tmp/
# Ignore Mac OS X generated file/directory attribute storage files
\.DS_Store
\._\.DS_Store

157
src/3rdparty/plplot/ABOUT vendored Executable file
View File

@ -0,0 +1,157 @@
What is PLplot?
PLplot is relatively small, portable, freely distributable plotting
library, that is rich enough to satisfy most users. It has a wide
range of plot types including line (linear, log), contour, 3D, fill.
It also supports unicode (UTF-8) text so that plots can include a very
large range of mathematical symbols and be labeled in every human
language. The package is designed to make it easy to quickly get
graphical output; only a handful of function calls are typically
required. For more advanced use, virtually all aspects of plotting are
configurable.
Why and when did PLplot come to be?
PLplot was originally developed by Sze Tan of the University of Auckland
in Fortran-77 (in 1986). Many of the underlying concepts used in the
PLplot package are based on ideas used in Tim Pearson's PGPLOT package.
Sze Tan writes:
I'm rather amazed how far PLPLOT has traveled given its origins etc. I
first used PGPLOT on the Starlink VAX computers while I was a graduate
student at the Mullard Radio Astronomy Observatory in Cambridge from
1983-1987. At the beginning of 1986, I was to give a seminar within the
department at which I wanted to have a computer graphics demonstration on
an IBM PC which was connected to a completely non-standard graphics
card. Having about a week to do this and not having any drivers for the
card, I started from the back end and designed PLPLOT to be such that one
only needed to be able to draw a line or a dot on the screen in order to
do arbitrary graphics. The application programmer's interface was made as
similar as possible to PGPLOT so that I could easily port my programs from
the VAX to the PC. The kernel of PLPLOT was modeled on PGPLOT but the code
is not derived from it.
Then Tony Richardson ported it to the Commodore Amiga, rewriting in C with
additional improvements.
While doing a post-doc fellowship in Japan Maurice LeBrun needed a free
scientific graphics library for his plasma simulation code and came across
PLplot on the Amiga "Fish disks" (disk 222). Maurice ported it back to
several varieties of Unix and took over maintenance from Tony. After
returning to the Institute of Fusion Studies at University of Texas Maurice
continued to develop the package, with Geoff Furnish joining him as a
co-developer. In the early 90s's the new contributions were released under
the LGPL.
When Maurice left UT in '95 Geoff became sole maintainer for some years,
and was responsible for getting it up at Sourceforge in the earliest days
of that site's existence. That made it easier to add collaborators & such,
and starting with Alan Irwin & Rafael Laboissiere the core team gradually
came to be.
In which [language(s)|platform(s)] is PLplot developed?
PLplot is developed in primarily C, with language bindings for Ada, C++,
D, Fortran, Java, Lua, Python, OCaml, Octave and Tcl/Tk. Every effort
is made to support the Linux, OS-X, and Windows platforms.
Also answering the question from the human language perspective,
PLplot is developed exclusively in English. However, it has both a
fine mathematical reputation and international reputation because of
its complete support for unicode (UTF-8) for all text strings and
symbols that are plotted by our modern device drivers. We presume
this is one of the reasons why PLplot usage is spread between 100
different countries (see below).
Does PLplot have sponsors (private, academic, other)?
Virtually all of our developers have been unpaid volunteers. The
exception has been a recent important development contribution from
the Cluster Science Centre QSAS team, Imperial College, London
How are the sponsors supporting the project?
QSAS donated the original version of the qt device driver along with ~two
months of developer time to help with its integration into PLplot.
How many users do you estimate PLplot has?
16 000 binary and source users actively use it divided between Linux
(73 per cent), Windows (22 per cent), and OS X (5 per cent). Users
are widely spread between about 100 countries with US users leading
the pack but only with a 22 per cent share and with 18 countries in
total having more than a 1 per cent share each.
These estimates are necessarily extremely approximate, but here is how
we arrived at these figures. Statistics at
http://qa.debian.org/popcon.php?package=iceweasel show roughly half of
Debian users are desktop users. Thus, multiplying the popularity
contest statistics at http://qa.debian.org/popcon.php?package=plplot
by a factor of two to obtain the desktop share for PLplot, 0.2 per
cent of Debian desktop users, use it regularly. Furthermore make the
(conservative?) assumption there are 5 million Linux desktop users in
the world with similar needs to Debian desktop users. Combining the
above estimates leads to an estimate of 10 000 Linux desktop users who
use a binary version of PLplot regularly.
An additional type of PLplot user downloads and builds PLplot for
themselves rather than using a binary package. The result from
http://sourceforge.net/projects/plplot/files/plplot/5.9.7%20Source/stats/timeline?dates=2009-10-01+to+2011-07-27
is ~3500 Windows downloads, ~1700 Linux downloads, ~800 Mac OS X
downloads, and ~500 downloads where the OS could not be identified.
The total downloads for all OS's were ~6500. Presumably most of these
downloaders (say 6000 of them) will build PLplot for themselves and
use it regularly. When the unknown OS is split between the various
OS's appropriately, and those splits adjusted for
the 10 000 Linux binary package users we arrive at the final estimate
given above.
Note the above summary of the country statistics comes directly from
SourceForge PLplot source download statistics site so these splits are
likely distorted by lack of similar evidence from the binary package
users of PLplot.
Do you know where PLplot is used (corporations, universities, other)?
No, although we assume it is used mostly for scientific plotting.
How many team members does PLplot have? (You can list their names)
There are 10 PLplot developers who currently have write access to our
subversion repository. Their names are Alan W. Irwin, Andrew Ross,
Arjen Markus, Geoffrey Furnish, Hazen Babcock, Hezekiah M. Carty, Doug
Hunt, Jerry Bauck, Maurice LeBrun, and Werner Smekal. For more information
on the work of our current developers and historical developers see
PLplot see http://www.ohloh.net/p/plplot/contributors.
In what areas of PLplot development do you currently need help?
This project is fairly mature, so we are primarily looking for help in
documentation and testing on various platforms, particularly
windows. Bug reports are also appreciated.
How can people get involved with PLplot?
The best way to start is by submitting suggestions and patches to the
mailing list. Users who seem particularly enthusiastic and who have
a history of contributions are often added to the project as developers
with subversion repository write access.
What features are in the roadmap?
The PLplot project does not have a formal roadmap. Development
operates primarily in a reactive mode, bugs are fixed as users
discover them and features are added on request (if there is a
consensus among the developers that the feature seems like a
reasonable addition).

11
src/3rdparty/plplot/AUTHORS vendored Executable file
View File

@ -0,0 +1,11 @@
Joao Cardoso <jcard@users.sourceforge.net>
Vince Darley <vincentdarley@users.sourceforge.net>
Geoffrey Furnish <furnish@users.sourceforge.net>
Alan W. Irwin <airwin@users.sourceforge.net>
Rafael Laboissiere <rlaboiss@users.sourceforge.net>
Maurice LeBrun <mlebrun@users.sourceforge.net>
Arjen Markus <arjen.markus@wldelft.nl>
Andrew Roach <aroach@users.sourceforge.net>
David Schleef <dschleef@users.sourceforge.net>
Andrew Ross <andrewross@users.sourceforge.net>
Thomas J. Duck <tomduck@users.sourceforge.net>

444
src/3rdparty/plplot/CMakeLists.txt vendored Executable file
View File

@ -0,0 +1,444 @@
# Top-level CMakeLists.txt for PLplot
# Copyright (C) 2006-2019 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; 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 PLplot; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
# Note, that if you are using a platform that does not supply our
# designated minimum version of CMake for that platform, then your
# best bet is to build a recent version of CMake for yourself or even
# download a binary version of it from Kitware that is suitable for
# your platform.
# MAINTENANCE 2019-02-03:
# We prefer to support only recent CMake versions and latest CMake
# policies to keep our build system as simple and as bug free as
# possible. However, as a special concession for our modern (not
# enterprise or LTS) Linux distro users we allow them to use the
# system version of CMake which at this time is typically 3.13.2 or so
# (e.g., on Debian Buster which is currently in freeze before it is
# released as Debian Stable later this year). The current status of
# official CMake packages on important non-Linux platforms is as
# follows:
# Cygwin: 3.13.1 from <https://cygwin.com/cgi-bin2/package-grep.cgi>
# MinGW-w64/MSYS2: 3.12.4 from <http://repo.msys2.org/mingw/x86_64/>
# Fink: 3.11.0 from <http://pdb.finkproject.org/pdb/index.php?phpLang=en>
# MacPorts: 3.13.3 from <https://www.macports.org/ports.php>
# HomeBrew:3.13.3 from <http://brewformulas.org/>
# These are all rolling releases that attempt to stay close to the
# latest version of cmake (and much other) software. Therefore, I
# anticipate that it won't be too long before Cygwin, MinGW-w64/MSYS2,
# and Fink supply 3.13.2 or greater and similarly for those Linux
# distributions that currently don't provide at least that version.
# Therefore, I have adopted this CMake minimum version for both Linux and
# non-Linux platforms.
# Adapted method suggested by Brad King for using
# potentially different minimum versions for different platforms.
set(MINIMUM_LINUX_CMAKE_VERSION 3.13.2)
# Latest CMake version for all platforms other than Linux.
# Must be greater than or equal to MINIMUM_LINUX_CMAKE_VERSION
set(MINIMUM_NON_LINUX_CMAKE_VERSION 3.13.2)
# Keep policy consistent for all platforms, i.e., use the Linux
# version which must be the minimum of the two versions above.
set(CMAKE_UNIFORM_POLICY_VERSION ${MINIMUM_LINUX_CMAKE_VERSION})
cmake_minimum_required(VERSION ${MINIMUM_LINUX_CMAKE_VERSION} FATAL_ERROR)
cmake_policy(VERSION ${CMAKE_UNIFORM_POLICY_VERSION})
project(plplot NONE)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
cmake_minimum_required(VERSION ${MINIMUM_NON_LINUX_CMAKE_VERSION} FATAL_ERROR)
cmake_policy(VERSION ${CMAKE_UNIFORM_POLICY_VERSION})
endif(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
# CMP0086 implemented for cmake-3.14.0 so to avoid warning
# messages when our minimum version is less than that must
# set this policy when it is available.
if(POLICY CMP0086)
cmake_policy(SET CMP0086 NEW)
endif(POLICY CMP0086)
# N.B. As a result of the following two set commands and logic in the
# configure_library_build function, all internal writeable library
# targets should be referred to as
# ${WRITEABLE_TARGET}<original_target_name> and all corresponding
# internal read-only library targets should be referred to in our
# build system as PLPLOT::<original_target_name>. The exception to
# these rules are the swig-generated modules case where the writeable
# target name (which is only available in the scope that calls the
# configure_library_build function) is
# ${SWIG_MODULE_<original_target_name>_REAL_NAME} instead of
# ${WRITEABLE_TARGET<original_target_name>. For example, these
# target names are ${WRITEABLE_TARGET}plplot and PLPLOT::plplot
# for the libplplot.so library and ${SWIG_MODULE_plplotc_REAL_NAME}
# and PLPLOT::_plplotc for the _plplotc.so swig-generated Python
# extension module.
# This value used in configure_library_build function to provide the namespace
# for build-tree ALIAS libraries. Otherwise, "PLPLOT::" is explicitly used as the
# prefix of read-only library and executable targets that occur in both the build and
# install trees.
set(PROJECT_NAMESPACE PLPLOT::)
option(USE_WRITEABLE_TARGET_TEST_PREFIX "Option to test library and executable targets which have both writeable and (ALIASed namespaced) read-only versions of their targets in the build tree and namespaced read-only targets in the install tree. This test prepends a prefix to the writeable version of the target name so as a result any such target referred to in the build tree without a writeable (\"writeable_target_test_prefix_)\") or read-only (\"PLPLOT::\") prefix should be discovered by this test (N.B. unless the unprefixed target reference occurs in CMake logic branches that are unexecuted by the particular configuration options that are chosen which makes this test necessary but not sufficient)." OFF)
if(USE_WRITEABLE_TARGET_TEST_PREFIX)
set(WRITEABLE_TARGET writeable_target_test_prefix_)
else(USE_WRITEABLE_TARGET_TEST_PREFIX)
set(WRITEABLE_TARGET)
endif(USE_WRITEABLE_TARGET_TEST_PREFIX)
# It is a fatal error if no working C compiler is available to build
# the PLplot core C library and core C examples. All other compilers
# required by our bindings are optional in that if no working compiler
# of the kind needed is available, the associated bindings and
# examples are disabled.
enable_language(C)
message(STATUS "CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}")
message(STATUS "CMAKE_COMMAND = ${CMAKE_COMMAND}")
message(STATUS "CMAKE_VERSION = ${CMAKE_VERSION}")
message(STATUS "CMAKE_GENERATOR = ${CMAKE_GENERATOR}")
message(STATUS "CMAKE_INCLUDE_PATH = ${CMAKE_INCLUDE_PATH}")
message(STATUS "Environment variable CMAKE_INCLUDE_PATH = $ENV{CMAKE_INCLUDE_PATH}")
message(STATUS "CMAKE_LIBRARY_PATH = ${CMAKE_LIBRARY_PATH}")
message(STATUS "Environment variable CMAKE_LIBRARY_PATH = $ENV{CMAKE_LIBRARY_PATH}")
# Location of configured language support files.
message(STATUS "CMAKE_PLATFORM_INFO_DIR = ${CMAKE_PLATFORM_INFO_DIR}")
# Set unambiguous names for these variables as a reminder.
set(WIN32_AND_NOT_CYGWIN ${WIN32})
if(WIN32 OR CYGWIN)
set(WIN32_OR_CYGWIN ON)
else(WIN32 OR CYGWIN)
set(WIN32_OR_CYGWIN OFF)
endif(WIN32 OR CYGWIN)
set(PACKAGE plplot)
# Locations where the PLplot build system first looks for cmake modules.
set(CMAKE_MODULE_PATH
"${PROJECT_SOURCE_DIR}/cmake/modules"
"${PROJECT_SOURCE_DIR}/cmake/modules/language_support/cmake"
)
# We need the path to the MinGW/Borland compiler in order to find
# the import libraries for system libraries.
if(MINGW)
get_filename_component(MINGWBINPATH ${CMAKE_C_COMPILER} PATH)
set(MINGWLIBPATH ${MINGWBINPATH}/../lib
CACHE FILEPATH
"Path to MinGW import libraries")
endif(MINGW)
if(BORLAND)
get_filename_component(BORLANDBINPATH ${CMAKE_C_COMPILER} PATH)
set(BORLANDLIBPATH ${BORLANDBINPATH}/../Lib/PSDK
CACHE FILEPATH
"Path to Borland import libraries")
endif(BORLAND)
# Version data that need modification for each release.
include(plplot_version)
# parameters to control overall cmake behaviour.
# Configure PLplot component variables....
include(plplot)
# Use configured variables to process configurable top-level files.
# This CMake-configured template file is processed further by sed for
# abi-compliance-checker.
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/abi-compliance-checker.xml.template.in
${CMAKE_CURRENT_BINARY_DIR}/abi-compliance-checker.xml.template
@ONLY
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/plplot_config.h.in
${CMAKE_CURRENT_BINARY_DIR}/plplot_config.h
)
# Allow access to the generated plplot_config.h for this build.
add_definitions("-DPLPLOT_HAVE_CONFIG_H")
# Disable warnings about deprecated functions (Visual C++ 2005)
if(MSVC_VERSION GREATER 1399)
add_definitions("/D_CRT_SECURE_NO_DEPRECATE")
endif(MSVC_VERSION GREATER 1399)
# Borland Compiler must compile in ANSII mode
if(BORLAND)
add_definitions(-A)
endif(BORLAND)
# Enable CTest-based testing framework for examples
if(BUILD_TEST)
# Use same BUILDNAME logic as the CTest module except
# we allow a BUILDNAME suffix whose value is specified
# by the user as PLPLOT_BUILDNAME_SUFFIX. In order
# for this logic to work it must precede including the
# CTest module which configures DartConfiguration.tcl
# with BUILDNAME as determined here.
# Maintenance: 2019-03-28 copy this BUILDNAME logic from
# cmake git v3.13.4 Modules/CTest.cmake.
if(NOT BUILDNAME)
set(DART_COMPILER "${CMAKE_CXX_COMPILER}")
if(NOT DART_COMPILER)
set(DART_COMPILER "${CMAKE_C_COMPILER}")
endif()
if(NOT DART_COMPILER)
set(DART_COMPILER "unknown")
endif()
if(WIN32)
set(DART_NAME_COMPONENT "NAME_WE")
else()
set(DART_NAME_COMPONENT "NAME")
endif()
if(NOT BUILD_NAME_SYSTEM_NAME)
set(BUILD_NAME_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}")
endif()
if(WIN32)
set(BUILD_NAME_SYSTEM_NAME "Win32")
endif()
if(UNIX OR BORLAND)
get_filename_component(DART_COMPILER_NAME
"${DART_COMPILER}" ${DART_NAME_COMPONENT})
else()
get_filename_component(DART_COMPILER_NAME
"${CMAKE_MAKE_PROGRAM}" ${DART_NAME_COMPONENT})
endif()
if(DART_COMPILER_NAME MATCHES "devenv")
GET_VS_VERSION_STRING("${CMAKE_GENERATOR}" DART_COMPILER_NAME)
endif()
set(BUILDNAME "${BUILD_NAME_SYSTEM_NAME}-${DART_COMPILER_NAME}")
endif()
# This is only BUILDNAME logic that is different from the CTest.cmake version.
set(BUILDNAME "${BUILDNAME}${PLPLOT_BUILDNAME_SUFFIX}")
# Change the default ctest timeout from 1500 to 15000 to accommodate
# our users who happen to have extraordinarily slow computers (such
# as the Raspberry Pi) or our users with anomalous platform issues
# where some tests are extraordinarily slow (such as test_c_epsqt
# and test_c_pdfqt for the static library build on MinGW-w64/MSYS2
# [as of 2017-08]).
# (This change must also be done before the following include)
set(DART_TESTING_TIMEOUT 15000 CACHE STRING
"Maximum time allowed before CTest will kill the test.")
# According to
# <https://cmake.org/Wiki/CMake_Testing_With_CTest>
# the following command executes the required "enable_testing()"
# command and also enable the creation and submission of a dashboard
# (which is defined as the result of a test run, reformatted for easy review)
# to our dashboard server (the PLplot_git "project" at my.cdash.org whose
# details are given by CTestConfig.cmake and whose dashboard viewer
# URL is <http://my.cdash.org/index.php?project=PLplot_git>).
include(CTest)
# Customize default values set by include(CTest). Result must be in
# top of build tree so copy it there. Also note comment
# from David Cole <https://blog.kitware.com/ctest-performance-tip-use-ctestcustom-cmake-not-ctest/>
# that for greatest speed (to avoid a huge glob over the build tree) it should be named
# CTestCustom.cmake rather than the traditional name CTestCustom.ctest
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake
COPYONLY
)
# N.B. we execute add_test(...) in the plplot_test
# subdirectory to implement the various tests that are
# run by ctest.
# N.B. The above commands have been copied to examples/CMakeLists.txt so that
# ctest can be configured for the installed examples tree. We also have to
# install the following files to implement that as well.
install(FILES CTestCustom.cmake.in CTestConfig.cmake DESTINATION ${DATA_DIR}/examples)
endif(BUILD_TEST)
# Install top-level files
set(top_level_DOCFILES
ABOUT
AUTHORS
COPYING.LIB
ChangeLog.release
Copyright
FAQ
NEWS
PROBLEMS
README
README.release
README.cumulated_release
)
install(FILES ${top_level_DOCFILES} DESTINATION ${DOC_DIR})
if(BUILD_SHARED_LIBS AND WIN32_OR_CYGWIN)
# For platforms (currently WIN32 or Cygwin, although the Cygwin version
# of CMake may support this in future since -rpath apparently does work
# on that platform) where CMake does not use -rpath, use a workaround
# where all dll's are collected in the dll subdirectory of the build tree.
set(USE_DLL_SUBDIRECTORY ON)
else(BUILD_SHARED_LIBS AND WIN32_OR_CYGWIN)
set(USE_DLL_SUBDIRECTORY OFF)
endif(BUILD_SHARED_LIBS AND WIN32_OR_CYGWIN)
# in windows all created dlls are gathered in the dll directory
# if you add this directory to your PATH all shared libraries are available
if(USE_DLL_SUBDIRECTORY)
set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dll)
endif(USE_DLL_SUBDIRECTORY)
# Prior to processing directories must initialize exports of installed targets.
# Install CMake package config file which handles all those exports.
install(FILES plplotConfig.cmake DESTINATION ${LIB_DIR}/cmake/plplot)
# Initialize the plplot_exports.cmake file which is appended to by CMake logic
# to install and export targets that is indirectly executed by the add_subdirectory commands below.
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/plplot_exports.cmake
"# This is a file that is generated by our core build system. It contains
# CMake logic that includes the export files for each of the
# exported targets that are generated by the PLplot core build.
# The includes are optional to allow software packagers to divide up
# the PLplot exported targets into individual packages with complete
# freedom so long as their packages have the appropriate dependencies
# between them.
# Start the conditional includes....
")
# Installation occurs in the generation phase
# after plplot_exports.cmake is completed by the add_subdirectory
# commands below.
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plplot_exports.cmake DESTINATION ${LIB_DIR}/cmake/plplot)
# Process other directories including using configured variables to
# process configurable files in those directories. N.B. Order is
# important here at the cmake stage because targets must be processed
# by cmake in a specific order e.g., due to get_target_property
# invocations or if(TARGET...) commands. Note, this order has nothing
# to do with the order which make processes these subdirectories at
# build time. That build-time order is determined by the dependencies
# between targets and also by file dependencies that are established
# by the cmake configuration files.
add_subdirectory(fonts)
add_subdirectory(lib)
add_subdirectory(include)
add_subdirectory(src)
add_subdirectory(data)
add_subdirectory(bindings)
add_subdirectory(drivers)
add_subdirectory(utils)
add_subdirectory(plplot_test)
add_subdirectory(examples)
add_subdirectory(scripts)
add_subdirectory(doc)
add_subdirectory(www)
add_subdirectory(pkgcfg)
summary()
if(PREBUILD_DIST)
# Pre-build everything required for a distribution tarball and copy it to
# the source tree (if build tree is different from source tree).
# List of targets that must be (pre-)built.
set(DIST_TARGETS)
if(BUILD_PRINT)
list(APPEND DIST_TARGETS print)
endif(BUILD_PRINT)
if(BUILD_INFO)
list(APPEND DIST_TARGETS info)
endif(BUILD_INFO)
if(BUILD_MAN)
list(APPEND DIST_TARGETS man)
endif(BUILD_MAN)
if(BUILD_HTML)
list(APPEND DIST_TARGETS html)
endif(BUILD_HTML)
if(BUILD_DOX_DOC)
list(APPEND DIST_TARGETS build_doxygen)
endif(BUILD_DOX_DOC)
if(PROJECT_BINARY_DIR STREQUAL "${PROJECT_SOURCE_DIR}")
add_custom_target(prebuild_dist)
else(PROJECT_BINARY_DIR STREQUAL "${PROJECT_SOURCE_DIR}")
# copy prebuilds back to source tree.
# N.B. copy_directory quietly creates an empty directory with no
# error condition if the source directory does not exist.
add_custom_target(
prebuild_dist
COMMAND ${CMAKE_COMMAND} -E remove_directory
${PROJECT_SOURCE_DIR}/doc/doxygen
COMMAND ${CMAKE_COMMAND} -E copy_directory
${PROJECT_BINARY_DIR}/doc/doxygen
${PROJECT_SOURCE_DIR}/doc/doxygen
COMMAND cp
`cat static_built_files ${INFO_MANIFEST} ${MAN_MANIFEST} ${HTML_MANIFEST}`
${PROJECT_SOURCE_DIR}/doc/docbook/src
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/doc/docbook/src
)
endif(PROJECT_BINARY_DIR STREQUAL "${PROJECT_SOURCE_DIR}")
add_dependencies(prebuild_dist ${DIST_TARGETS})
endif(PREBUILD_DIST)
#
# Packing stuff
#
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The Scientific Plotting Library PLplot")
set(CPACK_PACKAGE_VENDOR "PLplot development team")
set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_CURRENT_SOURCE_DIR}/README)
set(CPACK_SET_DESTDIR ON)
if(WIN32_AND_NOT_CYGWIN)
set(CPACK_GENERATOR ZIP)
else(WIN32_AND_NOT_CYGWIN)
set(CPACK_GENERATOR TGZ)
endif(WIN32_AND_NOT_CYGWIN)
set(
CPACK_SOURCE_PACKAGE_FILE_NAME
"plplot-${PLPLOT_VERSION}"
CACHE INTERNAL "tarball basename"
)
set(CPACK_SOURCE_GENERATOR TGZ)
# The following components are regex's to match anywhere (unless anchored)
# in absolute path + filename to find files or directories to be excluded
# from source tarball.
set(CPACK_SOURCE_IGNORE_FILES
"\\\\#.*$"
"~$"
# Ignore Mac OS X generated file/directory attribute storage files.
"\\\\.DS_Store"
"\\\\._\\\\.DS_Store"
"^${PROJECT_SOURCE_DIR}.*/\\\\.git/"
)
#message("CPACK_SOURCE_IGNORE_FILES = ${CPACK_SOURCE_IGNORE_FILES}")
include(CPack)
# Path to native build for executables required in the build process.
# This is only required for cross compiling
if(CMAKE_CROSSCOMPILING)
set(CMAKE_NATIVE_BINARY_DIR NATIVEDIR-NOTFOUND CACHE FILEPATH "Point to the native build directory")
endif(CMAKE_CROSSCOMPILING)

481
src/3rdparty/plplot/COPYING.LIB vendored Executable file
View File

@ -0,0 +1,481 @@
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1991 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the library GPL. It is
numbered 2 because it goes with version 2 of the ordinary GPL.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Library General Public License, applies to some
specially designated Free Software Foundation software, and to any
other libraries whose authors decide to use it. You can use it for
your libraries, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if
you distribute copies of the library, or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link a program with the library, you must provide
complete object files to the recipients so that they can relink them
with the library, after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
Our method of protecting your rights has two steps: (1) copyright
the library, and (2) offer you this license which gives you legal
permission to copy, distribute and/or modify the library.
Also, for each distributor's protection, we want to make certain
that everyone understands that there is no warranty for this free
library. If the library is modified by someone else and passed on, we
want its recipients to know that what they have is not the original
version, so that any problems introduced by others will not reflect on
the original authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that companies distributing free
software will individually obtain patent licenses, thus in effect
transforming the program into proprietary software. To prevent this,
we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License, which was designed for utility programs. This
license, the GNU Library General Public License, applies to certain
designated libraries. This license is quite different from the ordinary
one; be sure to read it in full, and don't assume that anything in it is
the same as in the ordinary license.
The reason we have a separate public license for some libraries is that
they blur the distinction we usually make between modifying or adding to a
program and simply using it. Linking a program with a library, without
changing the library, is in some sense simply using the library, and is
analogous to running a utility program or application program. However, in
a textual and legal sense, the linked executable is a combined work, a
derivative of the original library, and the ordinary General Public License
treats it as such.
Because of this blurred distinction, using the ordinary General
Public License for libraries did not effectively promote software
sharing, because most developers did not use the libraries. We
concluded that weaker conditions might promote sharing better.
However, unrestricted linking of non-free programs would deprive the
users of those programs of all benefit from the free status of the
libraries themselves. This Library General Public License is intended to
permit developers of non-free programs to use free libraries, while
preserving your freedom as a user of such programs to change the free
libraries that are incorporated in them. (We have not seen how to achieve
this as regards changes in header files, but we have achieved it as regards
changes in the actual functions of the Library.) The hope is that this
will lead to faster development of free libraries.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, while the latter only
works together with the library.
Note that it is possible for a library to be covered by the ordinary
General Public License rather than by this special one.
GNU LIBRARY GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library which
contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Library
General Public License (also called "this License"). Each licensee is
addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also compile or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
c) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
d) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the source code distributed need not include anything that is normally
distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Library General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library 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.
This library 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 this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

15
src/3rdparty/plplot/CTestConfig.cmake vendored Executable file
View File

@ -0,0 +1,15 @@
## This file should be placed in the root directory of your project.
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
##
## # The following are required to submit to the CDash dashboard:
## ENABLE_TESTING()
## INCLUDE(CTest)
set(CTEST_PROJECT_NAME "PLplot_git")
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "my.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=PLplot_git")
set(CTEST_DROP_SITE_CDASH TRUE)

6
src/3rdparty/plplot/CTestCustom.cmake.in vendored Executable file
View File

@ -0,0 +1,6 @@
# Customize default values set by include(CTest).
# The default limit on length of successful ctest results is only 1024
# bytes which the examples_compare test normally exceeds.
# Raise that default limit by an order of magnitude.
set(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 10240)

2376
src/3rdparty/plplot/ChangeLog.release vendored Executable file

File diff suppressed because it is too large Load Diff

285
src/3rdparty/plplot/Copyright vendored Executable file
View File

@ -0,0 +1,285 @@
Aside from the exceptions explicitly noted below in the "Other
Copyrights" sections, all files in the PLplot package may be
distributed under the following terms:
This library 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.
This library 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 this library; if not, write to the Free Software
Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
The text of this license is given in the file COPYING.LIB in the
distribution directory.
The intent behind distributing the vast majority of
PLplot files under the LGPL is to ensure that it
continues to evolve in a positive way, while remaining freely
distributable. The package is considered a "library" even though there
are associated programs, such as plrender, pltek, plserver, and pltcl.
The ties between these programs and the library are so great that I
consider them as part of the library, so distribution under the terms of
the LGPL makes sense. Software developers are allowed and encouraged to
use PLplot as an integral part of their product, even a commercial
product. Under the conditions of the LGPL, however, the PLplot source
code must remain freely available, including any modifications you make to
it (if you distribute a program based on the modified library). Please
read the full license for more info.
Other Copyrights
___________________________________________________________________________
The octave binding which links to the PLplot library (but not vice
versa) and the Octave examples (except for x00c.m, x20c.m, x21c.m,
x23c.m, x24c.m, x25c.m, x26c.m, x27c.m, x28c.m, x29c.m, x30c.m,
x31c.m, and x33c.m which are copyright under the default LGPL license
stated above) are copyright under the terms of the GNU General Public
License as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
___________________________________________________________________________
The startup code used in argument handling (utils/plrender.c and
src/plargs.c) is partially derived from "xterm.c" of the X11R5
distribution, and its copyright is reproduced here:
Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the names of Digital or MIT not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
___________________________________________________________________________
The documentation files are distributed under the following license terms:
DocBook documentation for the PLplot Library
Copyright (C) 1994 Geoffrey Furnish and Maurice LeBrun
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Alan W. Irwin
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Rafael Laboissiere
Copyright (C) 2003 Joao Cardoso
License terms:
Redistribution and use in source (XML DocBook) and "compiled" forms
(HTML, PDF, PostScript, DVI, TeXinfo and so forth) with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code (XML DocBook) must retain the
above copyright notice, this list of conditions and the following
disclaimer as the first lines of this file unmodified.
2. Redistributions in compiled form (transformed to other DTDs,
converted to HTML, PDF, PostScript, and other formats) must
reproduce the above copyright notice, this list of conditions and
the following disclaimer in the documentation and/or other
materials provided with the distribution.
Important: THIS DOCUMENTATION IS PROVIDED BY THE PLPLOT PROJECT "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PLPLOT PROJECT BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
___________________________________________________________________________
The files in the subdirectory data/ss contain Ordnance Survey data ©
Crown copyright and database right 2014 distributed under the Open
Government Licence available from
http://www.ordnancesurvey.co.uk/oswebsite/opendata/docs/os-opendata-licence.pdf
___________________________________________________________________________
The examples/Chloe.pgm file was created with the commands given
in examples/README.Chloe.pgm. The examples/Chloe.pgm file is
Copyright (C) 2016 Alan W. Irwin
and is distributed under the Creative Commons Attribution-Share Alike
3.0 Unported license
<https://creativecommons.org/licenses/by-sa/3.0/deed.en> whose full
text (downloaded as of 2016-02-05) is as follows:
You are free to:
Share — copy and redistribute the material in any medium or format
Adapt — remix, transform, and build upon the material for any purpose,
even commercially.
The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
Attribution — You must give appropriate credit, provide a link to the
license, and indicate if changes were made. You may do so in any
reasonable manner, but not in any way that suggests the licensor
endorses you or your use.
ShareAlike — If you remix, transform, or build upon the material, you
must distribute your contributions under the same license as the
original.
No additional restrictions — You may not apply legal terms or
technological measures that legally restrict others from doing
anything the license permits. Notices:
You do not have to comply with the license for elements of the
material in the public domain or where your use is permitted by an
applicable exception or limitation. No warranties are given. The
license may not give you all of the permissions necessary for your
intended use. For example, other rights such as publicity, privacy, or
moral rights may limit how you use the material.
___________________________________________________________________________
www/simplepie.inc has the following copyright notice:
* Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* * Neither the name of the SimplePie Team nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
* AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
___________________________________________________________________________
www/js/slimbox.js has the following copyright notice:
//MooTools, My Object Oriented Javascript Tools. Copyright (c) 2006-2007 Valerio Proietti, <http://mad4milk.net>, MIT Style License.
/*
Slimbox v1.41 - The ultimate lightweight Lightbox clone
by Christophe Beyls (http://www.digitalia.be) - MIT-style license.
Inspired by the original Lightbox v2 by Lokesh Dhakar.
*/
___________________________________________________________________________
The www/css/style.css.in file is
Copyright (C) 2008-2016 Alan W. Irwin
Copyright (C) 2008-2016 Werner Smekal
and is distributed under the
"Creative Commons License",
<http://creativecommons.org/licenses/by-nc/2.5/>
whose full text (downloaded as of 2016-02-05) is as follows:
You are free to:
Share — copy and redistribute the material in any medium or format
Adapt — remix, transform, and build upon the material
The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
Attribution — You must give appropriate credit, provide a link to the
license, and indicate if changes were made. You may do so in any
reasonable manner, but not in any way that suggests the licensor
endorses you or your use.
NonCommercial — You may not use the material for commercial purposes.
No additional restrictions — You may not apply legal terms or
technological measures that legally restrict others from doing
anything the license permits.
Notices:
You do not have to comply with the license for elements of the
material in the public domain or where your use is permitted by an
applicable exception or limitation.
No warranties are given. The license may not give you all of the
permissions necessary for your intended use. For example, other rights
such as publicity, privacy, or moral rights may limit how you use the
material.
___________________________________________________________________________
The CMake-related files
cmake/modules/FindLua.cmake
cmake/modules/FindwxWidgets.cmake
cmake/modules/language_support/cmake/CMakeAdaInformation.cmake
cmake/modules/language_support/cmake/CMakeDetermineAdaCompiler.cmake
cmake/modules/language_support/cmake/CMakeTestAdaCompiler.cmake
cmake/modules/ndp_UseQt4.cmake
cmake/test_ada/cmake/Modules/CMakeAdaInformation.cmake
cmake/test_ada/cmake/Modules/CMakeDetermineAdaCompiler.cmake
cmake/test_ada/cmake/Modules/CMakeTestAdaCompiler.cmake
were originally distributed by Kitware Inc. and were downloaded at
various epochs by PLplot developers and then further modified by us.
The CMake-related D language support files
cmake/modules/language_support/cmake/CMakeD_Copyright.txt
cmake/modules/language_support/cmake/CMakeDInformation.cmake
cmake/modules/language_support/cmake/Platform/Linux-dmd.cmake
cmake/modules/language_support/cmake/Platform/Darwin-dmd.cmake
cmake/modules/language_support/cmake/Platform/Windows-gdc.cmake
cmake/modules/language_support/cmake/Platform/Linux-gdc.cmake
cmake/modules/language_support/cmake/Platform/Windows-dmd.cmake
cmake/modules/language_support/cmake/CMakeDCompiler.cmake.in
cmake/modules/language_support/cmake/CMakeTestDCompiler.cmake
cmake/modules/language_support/cmake/CMakeDetermineDCompiler.cmake
were downloaded from Kitware Inc. by CMakeD developers Selman Ulug and
Tim Burrell <http://www.dsource.org/projects/cmaked>, substantially
modified by them, and then further downloaded from that site in 2009
by us and further modified by us.
This complete group of CMake-related files sometimes has slightly
different licensing language depending on download epoch so look at
each of the above files for the definitive source of licensing
language. However, in all cases that language is very similar to the
modern version of the license for CMake itself which is the
OSI-approved BSD 3-clause License (see <https://cmake.org/licensing>
for further details).
___________________________________________________________________________
Any file that is explicitly marked as "public domain" is free from any
restriction on distribution.
___________________________________________________________________________

1696
src/3rdparty/plplot/FAQ vendored Executable file

File diff suppressed because it is too large Load Diff

72
src/3rdparty/plplot/INSTALL vendored Executable file
View File

@ -0,0 +1,72 @@
PLplot Configuration, Build, and Installation
=============================================
The definitive set of instructions is given at
<https://sourceforge.net/p/plplot/wiki/Building_PLplot>. The material
below is cut and pasted from
<https://sourceforge.net/p/plplot/wiki/Building_PLplot/edit> in
markdown format as of 2014-10-08.
With the exception of DJGPP on (Free)DOS (where you should follow the directions at sys/dos/djgpp/readme) all PLplot builds are done with our CMake-based build system which gives good results on Unix, Linux, and Mac OS X and Cygwin, MinGW, MinGW/MSYS, and bare windows. After reading this section you should consult [specifics for various platforms](Specifics for various platforms "wikilink") for more details. Also, after a build and install is completed you should follow up by [testing PLplot](testing PLplot "wikilink").
### Building PLplot with our CMake-based build system
Our CMake-based build system has been made available as part of our development releases of PLplot starting with version 5.7.0 and is now with the exception of the DJGPP platform our sole build system. It is important to consult the CMake documentation to get the most out of our build system. That documentation is quite thorough but tends to be a bit scattered so we have collected what we think are the best [general CMake documentation links](general CMake documentation links "wikilink") for your convenience.
After consulting that documentation, [install](http://www.cmake.org/HTML/Install.html) the appropriate package of [CMake](http://www.cmake.org) for your system platform. Note, you must use at least version 2.6.0 of CMake for your PLplot configuration, but our build system works with the latest version (2.6.2) of CMake as well.
### <a name="Generic_Unix_instructions_for_our_build_system"></a>Generic Unix instructions for our build system
#### (Optional) set environment variables to help cmake find system components that are installed in non-standard locations
Here is one particular example (which must be executed before the cmake invocation discussed below).
`export CMAKE_INCLUDE_PATH=/home/software/autotools/install/include:/home/software/cgmlib/cd1.3`
`export CMAKE_LIBRARY_PATH=/home/software/autotools/install/lib:/home/software/cgmlib/cd1.3`
`export PKG_CONFIG_PATH=/home/software/libLASi/install/lib/pkgconfig`
For this particular example, <tt>CMAKE_INCLUDE_PATH</tt> helps cmake to find the headers for <tt>libltdl</tt> and <tt>libcd</tt> in non-standard install locations; <tt>CMAKE_LIBRARY_PATH</tt> helps cmake to find the <tt>libltdl</tt> and <tt>libcd</tt> libraries in non-standard install locations; and <tt>PKG_CONFIG_PATH</tt> helps cmake to use the <tt>pkg-config</tt> command internally to find a libLASi pkg-config module file that is installed in a non-standard location.
In general, <tt>CMAKE_INCLUDE_PATH</tt> helps cmake find headers and other files that are installed in non-standard locations; <tt>CMAKE_LIBRARY_PATH</tt> helps cmake find libraries that are installed in non-standard locations; and <tt>PKG_CONFIG_PATH</tt> helps pkg-config (either externally or internally from cmake) find pkg-config modules installed in non-standard locations. Finally, although not used in the specific example above, the colon-separated environment variable <tt>PATH</tt> helps cmake find executables that are installed in non-standard locations.
#### (Optional) set environment variables to specify the compilers and compiler flags
Here is one particular example (which must be executed before the cmake invocation discussed below).
`export CC="gcc -O2"`
`export CXX="g++ -O2"`
`export FC="g77 -O2"`
If you don't set the environment variables above, then by default no compiler options (i.e., no optimization and no debugging symbols) are used for gcc-related compilers for our build system which makes for fast builds, but slow execution.
#### cmake invocation
Here is one typical example.
`mkdir build_dir`
`cd build_dir`
`cmake -DCMAKE_INSTALL_PREFIX=/my/prefix \`
`../plplot_cmake >& cmake.out`
(CMake is capable of generating builds within the source tree, but we have emphasized a build with a separate build tree here because of its fundamental advantage that the source tree remains clean with no generated files in it.)
Check the cmake.out file for any configuration issues, especially WARNING messages which signal that a component of PLplot has been removed because required system components for that component have not been found.
There are a large number of [CMake options for PLplot](CMake options for PLplot "wikilink") which can be set for cmake to personalize your build. Use the ccmake front end to cmake to obtain documentation of all these options. In the above case we have specified a particular install prefix "/my/prefix".
Note in the above example an initially empty build directory (arbitrarily) named build_dir is used to insure a clean start, and ../plplot_cmake is the (arbitrary) name of the top-level directory of a freshly checked out source tree from our svn repository. If instead you use a freshly unpacked PLplot source distribution tarball "../plplot_cmake" will need to be replaced by "../plplot-5.9.2" (for our latest release at time of writing).
To start a fresh build, simply execute "cd build_dir; rm -rf \*" before invoking cmake. Of course, "rm -rf \*" is an extremely dangerous command (since it removes everything in the current directory and all subdirectories), but you should be okay so long as you cd to the correct directory before executing the "rm" command.
#### Build and install
`make >& make.out`
`make install >& make_install.out`
Check make.out and make_install.out for any errors. Follow up by [testing PLplot](testing PLplot "wikilink").

22
src/3rdparty/plplot/NEWS vendored Executable file
View File

@ -0,0 +1,22 @@
This file contains no PLplot news. Instead it points to the places where
you can find such news.
For short news items about PLplot stretching back to
2001 look at http://sourceforge.net/p/plplot/news/?source=navbar
For current release notes see README.release
For older release notes stretching back to 5.5.0 see README.cumulated_release.
For still older release announcements, see
http://plplot.org/announce/announce-plplot-5.3.1.xhtml
http://plplot.org/announce/announce-plplot-5.3.0.xhtml
http://plplot.org/announce/announce-plplot-5.2.1.html
http://plplot.org/announce/announce-plplot-5.1.0.html
For release notes for 4.99j (some also covered in slightly different
format in OLDER-NEWS) through PLplot-5.1.0, see OLD-NEWS.
For key e-mails from 1993 to the release announcement for 5.0.2 see
OLDER-NEWS.

597
src/3rdparty/plplot/OLD-NEWS vendored Executable file
View File

@ -0,0 +1,597 @@
Late news first
************************* 5.1.0 NEWS ***************************************
Important Changes to Existing Features
The Windows port of PLplot has been completely refurbished. PLplot now
runs on Windows 98 (and perhaps even Windows 95 although that is
untested), Windows NT, and Windows 2000. See
plplot/sys/win32/msdev/README.TXT and
plplot/sys/win32/msdev/INSTALL.TXT for details. Please direct all
questions about this Windows port to Olof Svensson.
The examples were extensively expanded for each front end to be the
union of the previous results for all front ends. For example, you
should now expect to get the same results for the 10 pages of the
contouring (ninth) example regardless of whether you are running that
example from Tcl, C, Python, Java (and eventually C++, Fortran, and
Perl).
We have finished converting all Python examples to use the Numeric
module (from the Numpy project) wherever possible. This module allows
high-level array manipulations at C speeds that are quite useful in
preparing data to be plotted. The xw??.py examples are no longer
stand-alone scripts. Instead, they are now organized as modules that
are imported into python scripts such as pythondemos.py or prova.py.
API change:
plxormod now returns a status.
plssub now no longer has a forced page advance inside it (which was
confusing some drivers). More specific page initialization is used
inside of plssub instead. If this change causes you some problems, see
the examples for the proper way to terminate pages and sub-pages.
We no longer support the variety of make commands on the non-GNU/Linux
unices. Instead, we now only support the GNU version of make which is
well documented and which can be downloaded from
ftp://ftp.gnu.org/pub/gnu/make.
The DocBook API chapter (and the man pages and Octave help built from
that chapter) now have complete documentation of the meaning of the
function parameters. The overall documentation and our website content
have been improved as well.
Important New Features
A new cgm (Computer Graphics Metafile) driver has been added. This
relies on libcd.a which is not maintained any more. Nevertheless
libcd.a is a free library that works well and does its job so for our
cgm user's convenience we have put a copy of the cd1.3.tar.gz tarball
for building this library from source in our file release area. Our
tests indicate the cgm driver is now stable.
Dynamical loading of device drivers. We have 29 (!) different devices
for output plots, but only one of those is selected by the user for a
given plot. Thus, dynamic loading of device drivers makes your
executables substantially smaller. Caveats: Your Unix must support
shared libraries (this happens automatically for most Linux
distributions), xwin and tk drivers are static-only for now (until we
arrange for the PLplot library itself to be dynamically loaded from
the Tcl/Tk front-end). Use the --enable-dyndrivers configure option to
get access to dynamic loading of device drivers.
We now have an experimental Java front end. The PLplot API accessible
from Java is still incomplete, but it is large enough currently to do
all planned examples other than x16.java and x18.java. See
plplot/examples/java/README.javademos for directions about how to get
access to the Java front end for PLplot.
We now have a new tk (ntk) driver (--enable-ntk) whose goal is to
provide the tk driver functionality using a simpler, cleaner
design. This is "a work in progress" because its functionality,
although working, is still quite limited compared to the traditional
tk driver.
We now have the beginnings of a Pyqt GUI for PLplot thanks to
Alessandro Mirone. See examples/python/README.pythondemos for
directions about how to access it.
We now have an experimental plimage function for PLplot thanks (again)
to Alessandro Mirone. Try the experimental x20c example to see how to
work with images in PLplot at the moment, but note the plimage API may
change in the future.
Important Bug fixes
Interactive color palettes now work for the plframe Tk GUI. This
important feature allows you to interactively adjust the cmap0
(discrete) and cmap1 (continuous) colors for a particular plot.
Remaining Important Bugs
The shaded 3D plots (see Example 8) have problems with the edges of
hidden shaded regions. Our judgement is this donated plotsh3d code is
too difficult to fix and should be completely replaced. Any
volunteers? Meanwhile, with Example 8 we do get a taste of the nice
effects you can have with 3D shaded plots.
There is no page control for the plframe widget for multi-page plots
in 5.1.0. This has now been fixed in CVS and will get into the next
release.
Have fun with this latest stable release of PLplot!
Alan W. Irwin for the PLplot core team, 2002 January 31
************************* 5.0.4 NEWS **********************************
Important Changes:
(1) Default orientation for the ljii, ljiip, psc, ps, and pstex drivers has
been rotated from seascape (upside-down landscape) by 180 deg to landscape.
With this change no special 180 deg latex rotations will be required to get
true landscape mode (top of the plot on the left of the page as opposed to
on the right of the page for seascape mode). If you still require seascape
for some reason for these drivers, use the -ori 2. command-line option or
else use plsdiori(2.) or plsetopt("ori", "2.").
(2) The installation location for examples has been changed to
$prefix/lib/plplot<ver>/examples to be in better conformance with the FHS.
Important Bug fixes:
(1) Many improvements to the octave front end.
(2) Many improvements to the xfig driver.
(3) If the overall aspect ratio is changed by the -geometry, -a, or -portrait
options or else by the combination of the -ori 1 and -freeaspect options, the
character aspect ratio remains unaffected. For example, when the overall
aspect ratio is changed now, circular symbols remain circular rather than
turning into ellipses as in the old code.
(4) Software pattern fills now rotate correctly with the rest of the plot
when the -ori option is used. This fix affects all drivers (e.g., xwin,
psc) which do not handle their own pattern fills. (Previously the rotation
angle for software pattern fills was mistakenly doubled by two calls to the
orientation transformation routine.)
Important New Features:
(1) Portrait mode. Use the -portrait option on the command line or else
plsetopt("portrait", "") to get this option which only currently affects the
ljii, ljiip, ps, psc, and pstex drivers. This option is especially useful
for yplot, the yorick front-end to PLplot. yplot previously maintained
separate (==> hard-to-maintain and buggy) portrait versions of the psc, ps,
and ljiip drivers. Those will no longer be necessary with this PLplot
core change, and in fact portrait mode is now available for a much wider
range of drivers.
(2) -drvopt command-line option (or else use plsetopt("drvopt","option")).
This allows setting options for particular drivers. For example, the
-drvopt text option for the psc or ps driver allows use of Adobe fonts (This
is poorly documented currently, but for now see notes in ps.c for more
details).
(3) New pstex driver. This is not currently documented, but there is post
from João Cardoso on plplot_devel
(http://www.geocrawler.com/archives/3/10834/2001/4/50/5536095/) that gives
the recipe (ignore the configuration stuff and start with the ./x01c
command). The idea is to emulate the pstex output of the xfig application
so that latex can be used to directly process the file output from the
PLplot pstex driver.
Have fun with this latest stable release of PLplot!
Alan W. Irwin
************************* 5.0.3 NEWS **************************************
The important changes are as follows:
(1) General PNG and JPEG drivers have been added which are based on the
libgd library (available for Unix/Linux/Mac/Windows). These drivers
encourage the use of PLplot for web applications because the PNG and JPEG
formats are so favoured for the web. We classify these two drivers as
late-beta and we are sufficiently confident of them that we configure them
by default if you have the appropriate headers and libraries installed from
libgd, libpng, libjpeg, and zlib. (You need at least libgd-1.7 to obtain
good PNG images, and at least libgd-1.8 to obtain JPEG images under PLplot.)
For more information on libgd and the additional required libraries please
visit http://www.boutell.com/gd/.
(2) The GNUSVGA driver (see plplot/sys/dos/djgpp) has been rewritten
to use DJGPP V2+ and GRX V2+. The improved driver adds: a cross hair mode; a
locate mode; double buffering; and an XOR mode to the "screen" driver, all
of which now give the driver most functions of the XWIN driver. It also
fixes up: handling of key and mouse events; colormap setting with "-bg"
switch; and now allows non-fatal/ non-volatile switching between graphics
and text mode (i.e. it no longer clobbers the computer, and now preserves the
screen). Additionally (and optionally) the DJGPP driver family now includes
support for TIFF, BMP, and JPG drivers, and the ability to do "hot key"
screen-dumps of the screen images to these formats.
(3) Octave is a mostly Matlab compatible high-level language intended for
numerical computations. An octave front end has been available for some
years for PLplot-4.99 and has, in fact, been maintained as a Debian package.
However, this PLplot 5.0.3 release is the first attempt to integrate the
octave front end with PLplot-5. See the README INSTALL USAGE and FGA
(frequently given answers) files in bindings/octave to find out how to use
this front end. Recently, an absolute octave newbie (AWI) was able to get
all the demos mentioned in INSTALL to work interactively for a Debian potato
system. Nevertheless, we classify this version of the front end as mid to
late beta because it has not been tested for a wide variety of environments
yet. We would welcome reports for this front end.
(4) An experimental Perl front end is just getting underway for PLplot. This
is an exciting project because it adds an important web-scripting
environment to PLplot. Usually, documentation trails code, but in this case
we have the unusual situation where we have parsed our API documentation
chapter (written in DocBook/XML) to create Perl wrappers for the common
PLplot API. With this start we have been able to create the demonstration
Perl script x01.pl which produces identical results to the standard x01c
demo (that was written in C). For instructions on how to get the Perl
binding to work, read bindings/perl5/README. More perl script demos are in
the works, and we welcome your participation (via the plplot-devel mailing
list, subscribe at http://sourceforge.net/mail/?group_id=2915) in helping to
develop this front end .
(5) A GNOME-compatible driver has been written for PLplot. At this point,
the driver is being rapidly developed with many exciting interactive
capabilities being considered. If you want to get in on the development of
this driver we urge you to subscribe to the plplot-devel mailing list (see
http://sourceforge.net/mail/?group_id=2915). We classify this driver as
alpha because the interactive features are not complete, but already it is
stable enough to view most of the demonstrations without problems. If you
want to try this for yourself, use --enable-gnome when you configure PLplot,
and for any demo specify gnome as the driver.
(6) Many other small changes. The important ones include the following:
(a) A test script. After you have built and installed the demo programmes
(go to $prefix/share/doc/plplot/examples and execute make cdemos in the c
directory, fdemos in the f77 directory, cxxdemos in the c++ directory) then
plplot-test.sh will generate all possible postscript file results for all
demos. (Use the --help option to explore other file driver possibilities.)
This script is an excellent way to test that you have built everything
properly on your system.
(b) A plplot-config configuration script to help you build your PLplot
applications. Do plplot-config --help to learn how to use it.
(b') We have changed a library name. The matrix library core name is now
libtclmatrix. A d suffix is applied to the name (just as for all other
libraries) if the library is built with --with-double=yes configured. If
you are using the plplot-config script to help link your applications, then
this library name change should be transparent to you.
(c) Added plshades routine to make life much easier for generating
continuously shaded plots. See x16c for a demonstration.
(d) Small change in exclusion API for shade plots. (If you are not
excluding regions of your shade plots this does not affect you.) For an
example of the new exclusion API for plshades see x16c.c. The excluded
annulus now actually is smooth--a nice improvement. See plshades.c for the
changes to the plshade exclusion API.
(e) Added argument list processing for xw??.py demos.
(f) Bug fix. Clip was not being applied to fills, now is.
(g) x10.tcl and x15.tcl added to demos.
(h) float --> PLFLT throughout the code. This change exterminates much of
the single precision that was contaminating the code (with consequent large
roundoff errors that differed from machine to machine) when
--with-double=yes is configured. Comparison of 32-bit and 64-bit results
for x??c now indicates identical postscript files except for date (of
course) and the x05c and x16c examples (which still must have some
single-precision contaminating them somewhere.) Other demos still need to be
checked for single-precision contamination in addition to the fundamental
x??c examples.
(i) Package relocatability put in. This is essential for building debs and
rpm's.
(j) Assorted documentation improvements including adding a Chapter entitled
"Notes for each Operating System that We Support". So far only filled with
somewhat sparse information on Unix/Linux. If you want to contribute some
documentation for other platforms, feel free to send the material to AWI,
and he will include it.
Reports are welcome (especially using plplot-test.sh) for all OS/hardware
combinations. It is only through such reports (and patches that work for
you) that we can improve our cross-platform support.
Alan W. Irwin
************************* 5.0.2 NEWS *************************************
Note we also have some innovation in the new release as well as bug fixing.
(1) The python xw??.py examples should now work right out of the box
without fooling around with PYTHONPATH.
(2) Install file locations now conform to the FHS. So, for example,
you will find the examples installed at
$prefix/share/doc/plplot/examples.
(3) The content of the documentation source has been greatly improved
from 5.0.1. We have now completely finished going through the doc
directory for several generations of notes on various topics and
incorporated all this material (with substantial updates and
expansions) into our docbook source. The result is new docbook
sections/chapters on devices, driver functions, plrender and
metafiles, familying, interactive output devices, color, and C and
fortran bindings. We have added API sections that are specialized to C
and fortran. We have also added a bibliography and reorganized the
material so that all the reference material (bibliography and API
sections) appear at the back of the document. We have now removed
virtually all the old files in doc so there is no longer the potential
of getting confused with these older generations of documentation.
We don't anticipate the addition of too many more chapters or sections
to the documentation, but some refinement of the existing
chapters/sections still needs to be done. If you are interested in
helping with this effort, please contact yours truly
(irwin@beluga.phys.uvic.ca).
(4) Our DocBook source can be built into PLplot documentation in a
variety of formats (currently html, dvi, postscript, pdf, info, and
man). Our CVS does not have these files because they are generated
rather than source files. However, you can always get the latest forms
of these results from http://www.plplot.org/resources/docbook-manual/,
and for your convenience we have also bundled these results into the
doc directory of the 5.0.2 tarball.
Please send bug reports, comments, and questions to the PLplot list,
and have fun (and profit) with the new 5.0.2 release of plplot!
Alan
************************* 5.0.1 NEWS ***************************************
Note we also have some innovation in the new release as well as bug fixing.
(1) The documentation building process has been changed completely over to
DocBook 4.1 XML. To see the nice html, postscript, pdf, dvi, info, and man
results of this effort, please look at
http://www.plplot.org/resources/docbook-manual/
(2) The content of the documentation source has been greatly improved from
previous versions. However, more work is always needed on documentation
content, and if you have an interest in helping out with this aspect of
plplot, please contact yours truly (Alan W. Irwin).
(3) The header file style has been changed to be similar to that of X. That
is every header file reference in source should have the prefix plplot, e.g.,
#include "plplot/plConfig.h"
This gives much less potential for nameclashes, if the headers are stored in,
e.g., /usr/include/plplot. It also means that the -I parameter stays the
same as it was before on the compile line.
(4) The library names have been changed so they are in a more consistent style
now that gives more protection against nameclashes. All library tags
(suffixes to the core name of libplplot, libplmatrix, etc.) are
now gone except for d for double precision and nothing for single precision
or the libplmatrix library (which is always single precision even if
you have configured double precision). To indicate what the library names
that were used to build plrender, execute the installed
$prefix/bin/plplot_linkage. On my current system this emits the following
line:
-L/usr/local/plplot/lib -lplplotd -lplmatrix -litk3.1 -ltk8.2 -litcl3.1
-ltcl8.2 -L/usr/X11R6/lib -lX11 -lvga -ldl -lm -lg2c -Wl,-rpath
-Wl,/usr/local/plplot/lib
Your system (if it isn't Debian potato) will have a different link line
emitted by $prefix/bin/plplot_linkage. That is the one to use!
(5) Python now works! (at least in widgetless mode). Configure python (which
happens by default), and try out the new widgetless examples, xw??.py.
You will like them! These examples all require double precision. Eventually,
we plan to add Tk widget capabilities to these examples. Any help
would be appreciated.
(6) Fortran now works with double precision and Linux! (It always worked
well with single precision before, but it is nice to have this generality.)
Please send bug reports, comments, and questions to this list, and
have fun (and profit) with the new 5.0.1 release of plplot!
Alan
************************* 5.0.0 NEWS ***************************************
Greetings to all,
And you thought it would /NEVER/ happen. :-).
I am pleased to announce that PLplot version 5.0.0 has been released.
The rest of this email will attempt to explain exactly what this means
in more detail.
Now for a little background. We are done with the 4.99 x, x=abc...
business, as well as the dated snapshots. Dated snapshots are being
replaced by providing anonymous cvs access through plplot.org. So
anyone who wants to track day-to-day development, or follow progress
on their patch submissions, etc, will be able to do that by using cvs.
In addition to that, we will provide real releases which are supposed
to be stable, or at least to get stable over a short time. The
releasing naming conventions will follow the Linux tradition. Even
releases are supposed to be stable, and only bug fixes and
stabilization patches will be applied to these. Thus, 5.0.0 is the
first in this strain. If people find minor little nits that need
fixing, this will result in 5.0.1, 5.0.2, etc. We hope it doesn`t get
too far... Ongoing feature development will proceed in the 5.1
strain.
The release and versioning business is coordinated with cvs in the
following manner. Stable releases go on a branch. Ongoing
development continues on the cvs head. To be really cvs technical, we
provide a branch point tag, a branch tag, and release tags. So, to be
totally explicit, I did the following operations today when preparing
the 5.0.0 release:
1) cvs tag bp_v5_0
2) cvs rtag -b -r bp_v5_0 v5_0 plplot
3) cvs tag v5_0_0
4) cvs export -r v5_0_0 plplot
5) mv plplot/ plplot-5.0.0
6) tar cvzf plplot-5.0.0.tar.gz plplot-5.0.0/
Step 1 labels the state of the repository at the point in time when we
fork the 5.0 release branch. The name of the branch point for the 5.0
release, is bp_v5_0. Step 2 creates a cvs "branch tag" for referring
to the head of this branch. The name of this tag is v5_0. Step 3
creates a tag for the specific release 5.0.0, with tag name v5_0_0.
In the current case, there were no changes made between any of these
steps, so steps 1, 2, and 3 all refer to the same versions of the
files. But as we move on from here, people who wish to participate in
stabilizing the 5.0 branch will need to check out the head of this
branch via:
cvs co -r v5_0 plplot
Then they can do stabilization oriented development, submit context
diffs, and the core team will apply these patches, and eventually at
various points along the way, we will tag v5_0_1, v5_0_2, etc. So,
the thing to understand here is that "v5_0" is the branch tag. It is
a floating reference, which alwasy points to the head of this branch.
Non branch tags just refer to static file versions, labelling a single
specific collection of file versions for all of time.
Henceforth, the main line of deveopment, which we will call 5.1,
proceeds on the cvs head. There is no branch tag for this. To see
the ongoing develoment work on the 5.1 branch, just do:
cvs co plplot
Use update to track ongoing work, etc. We may possibly tag a few
interesting points along the way as v5_1_0, v5_1_1, etc, but there
will not be a branch tag for this. Eventually, when 5.1 development
seems to have run its course, we will fork another branch for 5.2,
making a new branch point tag bp_v5_2, a branch tag v5_2 to refer to
the head of the branch holding the 5.2 release strain, and occasional
tags for specific 5.2.x releases.
Hopefully that is comprehensible to people with a cvs background. See
the CVS faq for more background. We`ll try to put this kind of info
on the web site somewhere as we get better organized.
Anyway, in addition to the cvs access mechanisms described above, we
also are providing the 5.0.0 release as a .tar.gz file. Steps 4, 5,
and 6 show exactly how this was created, guaranteeing that the
plplot-5.0.0.tar.gz file contains exactly the file versions that were
tagged as v5_0_0 in step 3, but omitting the CVS control information.
This tarball release is appropriate for people who just want the code
in a packaged form, and aren`t interested in tracking the cvs
development specifically, or even in using cvs to fetch identified
versions. This file has been uploaded to the plplot.org ftp site.
You can get it via:
/<EMAIL: PROTECTED>:/pub/plplot/plplot-5.0.0.tar.gz
Eventually we will get the http://www.plplot.org web site updated to reflect
this, and also figure out how to identify this file release on the
sourceforge.net project page for plplot. Someone will post messages
about that as we progress in these other areas.
Anyway, the bottom line is, right now you can get PLplot 5.0.0, either
by anonymous ftp, or by anonymous cvs.
Now for a word about the contents of 5.0.0.
The main thing that has happened over the past three years since I
escaped graduate school, is that we`ve been trying to fix bugs in the
autoconf support, and in the Tcl/Tk driver, and in color handling of
the X driver. There have been a great many bugs rooted out of the
system over this period of time, and I would encourage all PLplot
users worldwide, to upgrade to 5.0.0 at this time. This release is
known to work with 8.x strain Tcl/Tk releases, Itcl 3 releases, Python
1.5, etc. The problems with X color management are believed to be
resolved in a manner that is generally satisfactory (there`s always
room for improvement in this area, but the current state is a big leg
up over where it was before in the 4.99j or in the early snapshots).
And numerous patch submissions from users worldwide have been
integrated (although admittedly there are more outstanding, pending
core team review). There is also a new Mac driver by Rob Managan.
Currently just the necessary source and doc files, but we will get his
Mac CW project support goods uploaded to ftp.plplot.org at some point
too. So, there`s been lots of improvement since the last release, and
I hope people will endeavor to upgrade to this new version. If things
go wrong, please submit patches to sourceforge.net, and we`ll work on
getting it stabilized.
In the midst of such endeavors, please note the distinction between
bug fixes to 5.0.x, and feature development for ongoing 5.1. The new
stuff is going to go into 5.1. 5.0.x is really there just to have an
up to date stable and official release for those who don`t want to
track ongoing development. As such, don`t expect major new features
to appear in 5.0.x releases, just fixes that relate to platform
support, minor bugs, etc.
So, what lays ahead for 5.1? Well, like I said before, that depends a
lot on what people contribute. My personal actions will focus in the
short term on better Tcl package participation and improved Python
module interaction. But there are more drivers in the works, web
integration opportunities, more plot types, variations, and viewing
overhauls, etc, that various people have expressed interest in. More
news as it happens.
Remember that you can track it all by subscribing to
<EMAIL: PROTECTED>, or by reviewing the lists chronology in
geocrawler. Or, you can use the cvs history command (also easily
accessible in Emacs fromt he version control pane), to see what people
are doing, track your patch submissions to see when they get in, etc.
Cheers to all,
Geoffrey Furnish
********************* 4.99j NEWS *********************************************
This is the 10th beta release (4.99j) of what will eventually become
the PLplot 5.0 distribution. At this point I'm mainly trying to root out the
remaining bugs and system dependencies, but there will undoubtably be a
few improvements yet before the final version sees the light of day.
Please refer to the following files for more information:
README General introduction, where to get more information, etc.
NEWS This file
CHANGES Log of changes to plplot in reverse chronological order.
ToDo Describes what's on the agenda (no promises, however :-).
FAQ Frequently answered questions.
INSTALL Installation notes
Also see the system-specific documentation under sys/<system-name>.
The manual is being updated! More below.
You can get the PLplot distribution by anonymous ftp from:
/anonymous@dino.ph.utexas.edu:/plplot
in .zip or .tar.gz form. The most up-to-date (not very, at this point)
manual (in .ps and .dvi form) and info document files are available there as
well.
For more detail of these changes, consult CHANGES.
**************************************************************************
Version 4.99j: Summary of major changes
**************************************************************************
A massive update. Major changes follow:
- A major upgrade of the configure scripts. Now uses Autoconf 2.3 to
generate. You can now build PLplot in an arbitrary temporary directory,
typing <path>/configure and then make. This allows building from a
read-only file system, or setting up multiple build directories using
different build options simultaneously. Help entries now available for all
recognized configure command line options. Confusing a --with-<opt> with a
--enable-<opt> is now detected and flagged as an error. The option to skip
loading the defaults file is now invoked by using --without-defaults or
--with-defaults=no to be more like typical configure parameters. Added
--with-nobraindead (not for general use). Better support of shared
libraries (in principle), and better handling of the install procedure. Run
results are sent to the file config.summary, so you can type "ls config.*"
to see all the informational files created by configure. Searches for
Fortran compiler if enable_f77=yes. If that isn't found, switches to f2c.
If that isn't found, enable_f77 is set to "no" (Fortran interface layer is
omitted). Added --with-dbmalloc, for linking with a debugging malloc
library. Support generation of shared lib on Linux, using ELF tools.
- Better internal debug handling and reporting. Files where DEBUG is
defined only generate debug output if the debug stream variable is
set (e.g. via -debug). Uses stdarg capability, first time I've used
this in PLplot, so be on the lookout for portability problems with this.
If all goes well I have other uses of stdargs in mind.

1316
src/3rdparty/plplot/OLDER-NEWS vendored Executable file

File diff suppressed because it is too large Load Diff

161
src/3rdparty/plplot/PROBLEMS vendored Executable file
View File

@ -0,0 +1,161 @@
This file is designed to keep track of various problem fixes and new
features being worked on for the current PLplot CVS MAIN HEAD version and
who is taking responsibility for following up on each item.
The items are divided into Essential and "Would be nice" (i.e., release
critical versus not) with each of those categories further classified into
minor or major effort required.
N.B. at the end we have an additional section on problems/issues associated
with the new unicode-aware fonts.
Essential, major effort required.
********************************
Essential, minor effort required.
********************************
* PLplot documentation of python, java, etc., interfaces. Alan
"Would be nice", major effort required.
***************************************
* Fix bad-looking surface contours for plsurf. The problem goes away if the
plP_fill call is commented out in the normal series of alternating calls to
plP_fill and plline3 that are used to generate the surface and the surface
contours. So I conclude there is some inconsistency between the edge of
the triangles as defined for the surface contours plotted by plline3
and the edge of the triangles being filled. Low resolution devices have
worse problems than high resolution devices. Surface contours look bad
for png, better (but still not acceptable for publication) for psc, better
still for xwin, and I could not find any problems at all for tk.
* Move from DSSL based docbook stylesheets to XSL. Rafael, as soon as
the XSL results look as good (pdf currently a problem) as the DSSL results.
* Maurice's idea of plsopt and plsdopt so that our API doesn't keep
proliferating. Example, instead of plenv0 do:
plsopt("plenv_advance", "0");
plenv(...)
* -the tk drivers ignore plconfig.tcl if it is in the user directory ~/tcl
and a tclIndex file is generated. "auto_path" is correctly initialized to
~/tcl, pwd/tcl, etc, but plconfig is not executed. Reported by Joao. Status?
* Maurice plans to finish his changes to implement handling strings as
strings in the metafile format.
* Geoffrey plans to at least evaluate remaining fidelity problems caused
by our 16-bit integer approach.
* Put in index limits for the plot3d API's so they can handle
non-rectangular x,y regions. This has already been done for plsurf and
needs to be extended to plot3d.
* Put in variation of "defined" callback function with user-defined data
for plshade and plshades. Rafael?
* Put in "defined" callback function with user-defined data for plcont,
plot3d, and plsurf. This will supersede the non-rectangular x,y regions
change already done for plsurf and planned for plot3d, but this programming
is harder than those previous or planned changes so it will probably take
longer. Rafael?
"Would be nice", minor effort required.
***************************************
* 2003-09-20: The generated info files should have their root name changed
from plplotdoc (plplotdoc.info, etc.) to plplot$version like the rest of the
generated files (plplot-5.2.1.cvs.20030915.dvi, etc.) Note this change would
require that packagers' scripts that execute install-info would need a
change to use the versioned name, but this should be straightforward to do
both for RedHat and Debian packages.
* 2003-09-20: References are not there in info bibliography section (chapter
14). According to Rafael this problem is caused by docbook2x not currently
supporting the <bibliomixed> and <bibliomset> tags so we will have to wait
for that to get sorted out.
* plplot_general list 2003-08-26: Arjen Markus <arjen.markus@wldelft.nl> "I
have found that with the X Window driver the values returned by plgspa()
are/can be too small by a factor of approximately 1.4." This should be
followed up by an attempt to confirm the bug, and if it is there, fix it.
* Error messages for when the extended search fails in tclAPI.c. This is
required when running in tcl-only mode with no plframe or stack trace.
* As part of extended search try the install location. We know exactly
where that is relative to our font data, and we know exactly where the font
data are installed so we know the absolute path to our tcl install location.
Then, the only way such an extended search would fail is if the packagers
messed with our tcl install location.
* Use some well-recognized pdf verification tool (similar in spirit to the
w3c verification tests for web sites) to be sure our results conform to the
published pdf standards. Currently there is no idea whether such a pdf
verification tool exists, but acroread is buggy on Linux so that is not good
enough as a verification tool.
Collection of problems/issues with new unicode-aware fonts as of 2005-03-21.
All these are in the would-be-nice category with some/all taking major effort
to resolve.
****************************************************************************
I. Font problems associated with plfreetype.c which is called by gd.c which
implements the png, gif, or jpeg devices. (These issues were discovered
using -dev png).
* The default -drvopt smooth=1 option does not work (lots of cmap0 index
errors) if there is any user change to cmap0. This problem is triggered
if you attempt to run example 2 with -dev png. Andrew Roach thinks he
knows a small redesign that will fix it.
* There are still problems with vertical alignment of symbols for
plfreetype.c. See results from
examples/c/x06c -dev png -o test.png
where on line 100 the characters move up or down depending on whether they
have an ascender, descender or neither. There are similar problems for
example 7.
N.B. This is only a problem for plpoin (example 6) and plsym (example 7),
but not a problem for plmtex. So there is probably some issue with the way
plhrsh (called by plpoin and plsym) sets up the call to the code in
plfreetype.c that is not present for plmtex.
* The above problem may be related to the xform setting in plhrsh (plsym.c)
which is a kludge. if you define TEST_FOR_MISSING_GLYPHS,
it quits working (all the symbols are twisted by 90 deg).
* -drvopt 24bit problems. If this option is turned on (and only in this
case), Example 9 and 22 second and subsequent pages have rectangular
viewports with no box or tick marks. Furthermore, with Example 19 the
second and 3rd pages turn black. If you use -bg FFFFFF, you can see the
problem is a cmap0 one, somehow 24bit turns the default red colour into
black which doesn't show against the normal black background, but which
does show against a white background as with -bg FFFFFF.
* text clipping does not work (see example 9). There is a clipping method
in libgd, but the preferred solution (since it will apply to every device
driver that uses plfreetype.c) is to use the libfreetype clipping
method which Andrew Ross found in the freetype documentation.
* We need to build in fontconfig support into plfreetype.c for truetype
fonts. This well-known library by Keith Packard is available for both
Linux and windows and should allow truetype font selection by name rather
than by filename, and font substitution on both Linux and windows if the
requested named font is not available.
II. Font problems associated with ps.c and either -dev psc or -dev ps.
* The overall size of the text is systematically smaller than for Hershey or
TrueType fonts.
III. Other font problems/issues.
* We should enable additional device drivers for unicode. In particular,
our two most heavily used interactive device drivers, xwin and tk, should
give some outstanding looking results once they are unicode-enabled.
I nominate Maurice to make this happen.... :-)

151
src/3rdparty/plplot/README vendored Executable file
View File

@ -0,0 +1,151 @@
INTRODUCTION
PLplot <http://plplot.org/> is a cross-platform (see
PLATFORMS below) software package for creating scientific plots whose
(UTF-8 <http://www.utf-8.com/>) plot symbols and text are limited in
practice only by what Unicode<"http://www.unicode.org/>-aware system
fonts are installed on a user's computer. The PLplot software, which is
primarily licensed under the LGPL
<http://www.gnu.org/licenses/lgpl.html>, has a clean architecture that
is organized as a core C library, separate language bindings for that
library (see BINDINGS below), and separate dynamically loaded device
drivers (see DEVICE DRIVERS below) which control how the plots are
presented in noninteractive and interactive plotting contexts.
The PLplot core library can be used to create standard x-y plots,
semi-log plots, log-log plots, contour plots, 3D surface plots, mesh
plots, bar charts and pie charts. Multiple graphs (of the same or
different sizes) may be placed on a single page, and multiple pages
are allowed for those device formats that support them.
PLplot has core library support for plot symbols and text specified by
the user in the UTF-8 encoding of Unicode. This means for our many
Unicode-aware devices that plot symbols and text are only limited by
the collection of glyphs normally available via installed system
fonts. Furthermore, a large subset of our Unicode-aware devices also
support complex text layout (CTL) languages such as Arabic, Hebrew,
and Indic and Indic-derived CTL scripts such as Devanagari, Thai, Lao,
and Tibetan. Thus, for these PLplot devices essentially any language
that is supported by Unicode and installed system fonts can be used to
label plots.
PLATFORMS
PLplot is currently known to work on the following platforms:
Linux, Mac OS X, and other Unices
MSVC IDE on the Microsoft version of Windows (Windows 2000 and later)
Cygwin on the Microsoft version of Windows
MinGW/MSYS on the Microsoft version of Windows
MinGW/MSYS on the Wine version of Windows
For each of the above platforms, PLplot can be built from source (see
SOURCE CODE below), and for the Linux and Mac OS X platforms
third-party binary packages for PLplot (see BINARY PACKAGES below) are available.
BINDINGS
PLplot bindings exist for the following compiled and interpreted languages:
Ada
C/C++/D
Fortran
Java
Lisp
Lua
OCaml
Octave
Perl
Python
Tcl/Tk
The above list of bindings all are part of the PLplot software package
with the exception of the Lisp
<http://common-lisp.net/project/cl-plplot/> and Perl
<http://search.cpan.org/~dhunt/PDL-Graphics-PLplot/> bindings which
are independent projects. The Java, Lua, Octave, and Python bindings
are all generated by SWIG <http://www.swig.org/>, and a
straightforward expansion of this effort could be used to generate
additional bindings for PLplot using the many computer languages
<http://www.swig.org/compat.html#SupportedLanguages> that are
supported by SWIG.
DEVICE DRIVERS
The PLplot device drivers are typically built as shared objects that
can be dynamically loaded by our core library. It is straightforward
to add noninteractive or interactive device drivers to PLplot by
writing a small number of device-dependent routines.
Existing noninteractive PLplot device drivers support the following
file formats:
CGM
GIF
JPEG
LaTeX
PBM
PDF
PNG
PostScript
SVG
Xfig
Existing interactive PLplot device drivers are available for the
following platforms:
Gtk+
PyQt
Qt
Tcl/Tk
wxWidgets
X
SOURCE CODE
All our Windows users and many of our Unix users build PLplot from
source code using our build system that is implemented with CMake <http://cmake.org>
following the directions in our wiki
<https://sourceforge.net/p/plplot/wiki>. PLplot source code can be
accessed a number of ways. You can obtain the latest stable version
of PLplot from <http://sourceforge.net/projects/plplot/files/plplot/>.
Alternatively, you can obtain the cutting-edge version of PLplot
source code (but with no promises about stability) using the command
git clone git://git.code.sf.net/p/plplot/plplot plplot.git
and you can browse our git repository at
<http://sourceforge.net/p/plplot/plplot/ci/master/tree/>.
BINARY PACKAGES
A number of third-party binary packages for PLplot are available.
Binary packages for Linux are provided by at least Ubuntu
<http://packages.ubuntu.com/search?keywords=plplot&searchon=names&suite=all&section=all>,
Debian
<https://packages.debian.org/search?searchon=sourcenames&keywords=plplot>,
Fedora <https://apps.fedoraproject.org/packages/plplot>, and openSUSE
<http://software.opensuse.org/package/plplot>. Binary packages for
Mac OS X are provided by at least Fink
<http://www.finkproject.org/pdb/browse.php?summary=plplot>, Homebrew
<https://github.com/Homebrew/homebrew/blob/master/Library/Formula/plplot.rb>, and MacPorts
<https://www.macports.org/ports.php?by=name&substr=plplot>. To our
knowledge no binary packages for PLplot are currently available for
Windows platforms so our Windows users must build PLplot
from source (see SOURCE CODE above).
OTHER WEB RESOURCES
The most up-to-date information about PLplot can be found at our
principal website <http://plplot.org/>. There you will
find the following important PLplot links:
news <http://sourceforge.net/p/plplot/news/>,
example code and resulting PLplot screenshots
<http://plplot.org/examples.php>,
documentation <http://plplot.org/documentation.php>,
credits <http://plplot.org/credits.php>,
wiki <https://sourceforge.net/p/plplot/wiki>,
SourceForge project page <http://sourceforge.net/projects/plplot>,
project support page <http://sourceforge.net/projects/plplot/support>,
mailing lists <http://sourceforge.net/p/plplot/mailman/>,
and bug tracker <http://sourceforge.net/p/plplot/bugs/>.

View File

@ -0,0 +1,161 @@
At Alan W. Irwin's request, CMake developers (namely Brad King) have
added a built-in PLplot contract test to CMake. (Brad has arranged
this for several projects, see the Tests/Contracts subdirectory of the
cmake source code.) This extra CMake code allows any CMake user to
add a build and install of PLplot to the normal tests used for testing
CMake with ctest. And the purpose of this document is to help PLplot
users set up this contract test for themselves to insure the latest
development version of CMake configures, builds, and installs Plplot with no issues on their platform.
Note that such a contract test helps CMake developers discover
regressions in the CMake source code, helps the PLplot project
indirectly by avoiding such regressions in CMake releases, and helps
the PLplot project directly in case the issue is a bug or some
deficiency in the PLplot build system that is exposed by the latest
development version of CMake.
To set up the PLplot contract test you should follow the directions at
<https://gitlab.kitware.com/cmake/cmake/blob/master/Help/dev/testing.rst>.
The key part of those is
git clone https://gitlab.kitware.com/cmake/dashboard-scripts.git Scripts/CMakeScripts
The Scripts/CMakeScripts/cmake_common.cmake script contains comments at the top with
instructions to set up a testing client. As it instructs, create a
CTest script Scripts/CMakeScripts/my_dashboard.cmake with local settings and include cmake_common.cmake
from that script.
(For additional background information for setting up CTest scripts)
see <https://cmake.org/Wiki/CMake_Scripting_Of_CTest>.
Here is an example of Alan's version of this script.
##########################################
software@raven> cat Scripts/CMakeScripts/my_dashboard.cmake
# Client maintainer: airwin@users.sourceforge.net
# Brad King prefers an alphabetic string (with no
# qualifiers) here to identify the computer.
set(CTEST_SITE "merlin")
set(CTEST_BUILD_NAME "Debian-Buster-gcc-8.2.0-x86_64")
# Just in case this environment variable which I often set would affect
# Fortran-related tests.
unset(ENV{FFLAGS})
# If CTEST_BUILD_CONFIGURATION is not DEFINED (i.e., unset or empty),
# then cmake_common.cmake sets this variable to Debug.
#set(CTEST_BUILD_CONFIGURATION None)
set(CTEST_BUILD_CONFIGURATION Release)
# Note, the bootstrap script ignores this variable
# when building the preliminary version of CMake but pays attention
# to it when configuring the build of the final version of CMake.
# Thus, to make the compile flags when building the preliminary
# version the same as the final version we set the following:
set(ENV{CXXFLAGS} "-O3 -DNDEBUG")
set(ENV{CFLAGS} "-O3 -DNDEBUG")
# However, without the macro below these environment variables are
# used for all tests which makes the complex, complexOneConfig,
# Preprocess, and Qt4Deploy tests fail.
# Brad's comment was "at least some of them may be testing per-config
# behavior, so by adding `-DNDEBUG` to the all-config flags they get
# confused." So instead following a suggestion by Brad, we use the
# above environment variables to set C and C++ compile flags for just
# the "bootstrap and configuration steps", but we arrange those
# environment variables are unset for tests using the following macro:
macro(dashboard_hook_build)
unset(ENV{CXXFLAGS})
unset(ENV{CFLAGS})
# Attempt to work around X authentication issues for Experimental mode
set(ENV{XAUTHORITY} /home/software/.Xauthority)
endmacro()
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
# Additional variables to set before include:
# Use Experimental each time you want an immediate test of any changes
# to this file or some quick fix by Brad (which will not be
# immediately accessible for Nightly ctests), but remember to switch
# back to Nightly in time for the cron job!
#set(dashboard_model Experimental)
set(dashboard_model Nightly)
# Parallel build level used when running bootstrap command
set(dashboard_bootstrap 16)
# Parallel build level when building CMake, CTest, etc.
set(CTEST_BUILD_FLAGS -j16)
# Parallel test level when running ctest
set(CTEST_TEST_ARGS PARALLEL_LEVEL 16)
set(dashboard_cache "
//Use system-installed curl
CMAKE_USE_SYSTEM_CURL:BOOL=ON
//Do not build Qt dialog for CMake (for now because of
//Debian Jessie Qt5 issue where COPYONLY was misspelled as COPY_ONLY)
//BUILD_QtDialog:BOOL=0
// Do configure, build and install of PLplot as a ctest of CMake.
CMake_TEST_CONTRACT_PLplot:BOOL=ON
// CMake configuration options for that build to add more to the all target
// that is being built.
CMake_TEST_CONTRACT_PLplot_CMAKE_FLAGS:STRING=-DBUILD_TEST=ON -DUSE_INCRTCL_VERSION_4=ON -DBUILD_DOC=ON -DBUILD_DOX_DOC=OFF
// Working version of PLplot with Debian Buster as of 2018-02-13
CMake_TEST_CONTRACT_PLplot_GIT_TAG:STRING=plplot-5.14.0
")
include(${CTEST_SCRIPT_DIRECTORY}/cmake_common.cmake)
##########################################
The CMake logic of this file is mostly either self-explanatory or is
accompanied by commentary that documents it. In particular, all
variables that don't have "PLplot" in their name have to do with the
general configuration of ctest for CMake. And you will have to figure
out from the directions above how you change those for your own
platform such as the unique identification of your computer, what compile
flags will be used to build CMake, what parallel build options you use
for that build, whether ctest will be run in Experimental or Nightly
configuration, etc. The remaining variables with "PLplot" in their
name that are set are CMake_TEST_CONTRACT_PLplot,
CMake_TEST_CONTRACT_PLplot_CMAKE_FLAGS, and
CMake_TEST_CONTRACT_PLplot_GIT_TAG. Those variables obviously allow you to
decide whether to include the PLplot contract test as part of the
ctest test of CMake, what CMake flags will be used for the CMake
configuration of PLplot, and what PLplot version will be used for the
contract test. N.B. The PLplot release manager will likely change the
PLplot version that he tests more often than once per release cycle to
insure the latest CMake works properly with modern PLplot, but other
PLplot developers will likely only want to change the PLplot version
in their own version of this script each time there is a new release.
In any case, control of the PLplot version that is tested implies each
user has a small maintenance burden for the version of this script
that they use.
Here is how I run the above script after changing the above script to
the Experimental mode
time (nice -19 /usr/bin/ctest -S ~/cmake/Dashboards/Scripts/CMakeScripts/my_dashboard.cmake -VV >| ctest.out 2>&1)
The net result of this command is all ordinary ctests of CMake (and KWSys) are run plus the extra
PLplot contract test of CMake for the latest experimental version of CMake (and KWSys) with dashboards
of the results submitted to <https://open.cdash.org/index.php?project=CMake>
and <https://open.cdash.org/index.php?project=KWSys>.
N.B. Brad King tells me the above ctest used to launch the script
must be version 3.12.3 or later to avoid
errors in some of the KWSys dashboard results.
Once the Experimental version works correctly, then you will want to
change the configuration in your my_dashboard.cmake script from
Experimental to Nightly and run the equivalent of the above command
automatically each night. Consult the above documentation about how
you set up such automatic nightly tasks on each platform, but on my Linux
(Debian Testing) platform it boiled down to simply
configuring a cron job.

File diff suppressed because it is too large Load Diff

17308
src/3rdparty/plplot/README.cumulated_release vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,40 @@
To submit a dashboard (which is defined as the collection of virtually
all details concerning a ctest run) to the PLplot dashboard server to
be publicly displayed there, PLplot users simply have to configure
PLplot (with -DBUILD_TEST=ON), build the "all" target as per normal,
then run
ctest -D Experimental
That ctest command does its normal ctest thing (performing all the
tests we have configured in plplot_test/CMakeLists.txt), but then
because of that -D Experimental option it then collects all that
test data into a dashboard and sends it to our dashboard server to be
publicly displayed.
For now, the PLplot dashboard submission capability is very simply
configured using the CTest module method with the two files
CTestConfig.cmake (to specify the dashboard server which is the
PLplot_config "project" of my.cdash.org with submitted dashboard
results publicly displayed at
<http://my.cdash.org/index.php?project=PLplot_git>) and
CTestCustom.ctest.in (to specify one minor CTest module customization
that we need). In addition there is some code in the top-level
CMakeLists.txt file to support a scheme (commit 7e987c4) to add a
user-specified suffix (called PLPLOT_BUILDNAME_SUFFIX) to the
BUILDNAME build label string that is ordinarily determined by the
CTest module. This change is to help users identify their builds a
little more precisely (e.g., by using the cmake option
-DPLPLOT_BUILDNAME_SUFFIX:STRING="-(shared library + dynamic devices)"
the users adds that suffix to the usual BUILDNAME label to help
identify their dashboard in what can be long lists of dashboards
presented by dashboard servers.
I plan no more changes to this Experimental dashboard client
capability I have configured for ctest and which is also supported by
the "-do_submit_dashboard yes" option of the
scripts/comprehensive_test.sh script. However, at some point I or
somebody else may decide to generalize this capability to deal with
Nightly and Continuous types of dashboard submissions.

395
src/3rdparty/plplot/README.developers vendored Executable file
View File

@ -0,0 +1,395 @@
Information about version control
---------------------------------
PLplot uses git for version control. The fundamental git
documentation we refer to most often is the freely downloadable
[Pro Git Book](http://git-scm.com/book).
There is excellent advice about commit messages and how to organize
commits at <http://who-t.blogspot.be/2009/12/on-commit-messages.html>
as well. In particular, the fundamental advice there is to always
include a short description paragraph at the top of your commit
message giving a general description of your commit. That description
is used throughout git when summarizing commits so it should be kept
as short as reasonable (i.e., there is typically just one line in the
description paragraph).
Installation of git is straightforward as described at
<http://git-scm.com/book/en/Getting-Started-Installing-Git>
In all cases, it is highly recommended that git is run from the
command line rather than from a GUI because the git command line is
powerful, extremely well documented, and is the standard way most git users
(including PLplot developers) use git.
Command-line versions of git are readily available on all platforms.
The Linux packages for git, the Mac OS X free software repository
packages for git, and the Cygwin and MinGW-w64/MSYS2 Windows packages
for git all include command-line versions. In addition, the Xcode
version of git on Mac OS X and the Git for Windows version of git can
both be used from the command line (see
<http://www.appcoda.com/git-source-control-in-xcode/> and
<https://git-for-windows.github.io/>).
Continuing with the git theme that "simpler is better", our general
advice is to ignore non-standard extensions to git such as github
versions or git-lfs since they are not needed, and use of standard git
means there is less to go wrong. In fact, before we formulated this
advice one of our developers installed and used git-lfs (from
Macports) inadvertently with the result that a .git/hooks/pre-push
shell script was run to execute git-lfs before each of his pushes, and
he ran into trouble with that complication. He reverted back to the
lean git that is also available from Macports by the following
measures (which may be useful to others who have inadvertently
installed git-lfs):
"I did git lfs uninstall and it cleaned up the lines it had added to
~/.gitconfig. I also uninstalled git-lfs from my MacPorts stuff. Then
I got a fresh clone."
As expected (since git-lfs adds nothing that is truly needed for PLplot git
needs) that lean git command-line environment has been working well for him
ever since.
Local configuration of git
--------------------------
That is covered in the Pro Git book referenced above. But the fundamental
thing you should do is identify yourself in the way you want to be identified
in your commit messages.
# To change/set the relevant values use, e.g.,
git config --global user.name "Alan W. Irwin"
git config --global user.email airwin@users.sourceforge.net
Workflow
--------
PLplot currently uses the rebase git workflow
[described here](http://kevinold.com/2013/04/17/my-git-workflow.html).
And summarized here:
1. *ALWAYS* develop on a branch:
git checkout -b new_branch
Develop followed by tests of that development followed by
git commit
to create commits in new_branch. If you create a commit and
realize before you make additional commits that there is an error
in the commit, please use the --amend option to the subsequent
commit that fixes the error. What this option does is squash the
two commits together, i.e., it replace the old commit with the
error by the combined old commit and fix. This approach minimizes
errors in the commits that will eventually be merged to master (see
below), and this cleaner master history will make subsequent use of
git-bisect (a killer-app typically used to find which commit first
caused a regression) much easier.
2. Updating the master branch:
git checkout master
git fetch
# (optional) review newly downloaded changes
git log origin/master
git merge --ff-only origin/master
Make sure that you are on the master branch before doing the
merge. Failure to do so will mean having to undo the merge as
merging master into your branch is bad and attempts to push
your work back to official repo will be rejected.
3. Updating your working branch so that it is a sequential
continuation of the work on the master branch:
git checkout new_branch
git rebase master
Note that there is some possibility for headaches here. If one
of the files that you are working on is changed in the master
branch you may have to deal with merge conflicts. Unless you
really need some new feature in master (and you probably
should not if your branch is really a self-contained topic)
then it is probably best to do this once just before you want
to push your work back to the official repo.
Also, git rebase is not suitable if you are right in the
middle of work on a topic with a dirty tree with uncommitted
changes. For this case use
git checkout new_branch # (checkout the dirty tree with uncommitted changes)
git stash save # (save that dirty tree to make new_branch clean
# i.e., all uncommitted changes disappear).
git rebase master # (update that clean branch)
git stash pop # (restore your uncommitted changes)
# ... keep working.... until you are ready to commit (and ultimately
# merge back to master and push).
4. Incorporate changes back into master:
git checkout master
git fetch
# Note, you are now in a race to get your changes pushed before someone
# else does so work quickly from now on until that push.
# Only if above fetch showed something downloaded
git merge --ff-only origin/master
git merge --ff-only new_branch
At this point you should see a message like "Fast-forward". If
instead you see "Merge made by the 'recursive' strategy" this
is bad and means that your changes will be rejected when you
try to push them to the official repo. You can inspect the
history with gitk and possibly collapse the offending commits
into a single commit (using git rebase --interactive) that makes
the history sequential again.
5. Push changes to the official repo:
# Check first:
git push --dry-run origin master
# Actual Push:
git push origin master
This is a rebase work flow. The sequential nature of the master branch is
enforced by server side hooks and by only allowing fast-forward
merges with the merge flag --ff-only. You can make this the
default option for your repository using the command:
git config merge.ff only
This will add these two lines:
[merge]
ff = only
To the .git/config file in your local repository of the PLplot project.
Development Collaboration
-------------------------
Note one drawback of a rebase workflow like adopted here is care must
be used in sharing development branches with others. One such method
is to publish an experimental branch using some public repository like
those at github and asking others to have a look and make suggestions,
as long as everyone else understands that it is a "read only" branch
whose series of commits will disappear and be replaced by other
commits whenever that branch is rebased on the official master version
(which must occur, for example, before it is ff-merged with the master
branch). Another method which has no such concerns at all is simply
to use patches generated by "git format-patch" to share development
branches on the plplot-devel mailing list. Developers who subscribe
to that list can easily apply those patches with the "git am" command
on some private branch to evaluate them (unless there are explicit
file conflicts with the HEAD of master in which case the developer of
those series of patches would need to bring them up to date with
master by rebasing his private development branch before regenerating
the patch series).
For those new to git, here is the simple cookbook for using "git format-patch"
(but use "git help format-patch" to learn a lot more).
1. Develop your topic on a private branch as indicated above. Suppose
you have made 2 commits to that topic branch that you would like to
share with others for their evaluation. Then use
git format-patch -2
to create two formatted patch files corresponding to your two commits, e.g.,
0001-Build-system-Fix-test_python_psc-dependency-issue.patch
0002-Build-system-Implement-version-check-on-libharu-libh.patch
Review each of those files to make sure your commit name and e-mail
address are the way you like them (see the "git config" command above
for changing those). Also make sure your description (see comments
on the description paragraph above) is the way you like it for
each of the commits. Then
store those files in a compressed tarball, e.g.,
tar zcf my_topic.tar.gz 000*.patch
send those compressed results as an e-mail attachment to, e.g., the plplot-devel
mailing list; and then cleanup afterward as follows:
rm 000*.patch
rm my_topic.tar.gz
Those receiving such a tarball should unpack it, and then use git am
_on a private topic branch_ to commit those changes for further
collaboration until the collaborative yet private topic is matured
enough to be merged with the master branch and pushed.
Updating our wiki pages
-----------------------
The definitive markdown source for our wiki pages is located in
doc/wiki_source. While working on a topic branch (see advice above)
do the following steps:
Case I (when you prefer to use your own file editor):
* Edit an existing file at doc/wiki_source (or if you are creating a
new wiki page edit a new file there).
* Use the
git diff --word-diff
command to evaluate the changes (the --word-diff option is essential
to allow humans to isolate the changes in the generally long
markdown format lines);
* Transmit those changes to SF by cutting and pasting them with ctrl-c
and ctrl-v from the git working directory file edit to the SF GUI
editor for the wiki page in question. On the SF GUI editor side, the
old text that is being replaced can be selected and deleted.
* Test the resulting changed wiki page (e.g., check the diff available
in the history GUI to make sure there were no cut and paste or
deletion failures, check the new links, check the rendering of the
updated markdown format looks good).
* Commit the markdown source file for the wiki changes on the git
topic branch.
* Push your commit following the above directions.
(END OF CASE I)
Case II (when you prefer to use the SF wiki editor):
* Click on the SF GUI for the wiki page to edit the markdown source for that
page.
* Test the resulting changed wiki page (e.g., check the diff available
in the history GUI to make sure there were no cut and paste or
deletion failures, check the new links, check the rendering of the
updated markdown format looks good);
* Transmit those changes to the git working directory doc/wiki_source
by cutting and pasting them from the SF GUI editor session to a file
edit of the appropriate file in that directory using ctrl-c to
select and ctrl-v to paste and ordinary file editing capability to
delete the text that is being replaced.
* Use the
git diff --word-diff
command to evaluate the changes (the --word-diff option is essential
to allow humans to isolate the changes in the generally long
markdown format lines);
* Commit the markdown source file for the wiki changes on the git
topic branch.
* Push your commit following the above directions.
(END OF CASE II)
Configuring the build system
----------------------------
The PLplot build system now requires CMake to configure the build on
all build platforms (Linux, Mac OS X, traditional Unix, and
Windows). The latest instructions for building PLplot with cmake can
be found on the PLplot wiki.
http://sourceforge.net/p/plplot/wiki/
Coding standards for PLplot
---------------------------
Adherence to coding standards should help make code more portable.
Therefore when writing / contributing code for PLplot the following standards
should be followed:
C: ISO C99 standards with POSIX.1-2001 base specification (required
for a number of functions)
C++: ISO C++ 1998 standard plus amendments
Fortran: Fortran 2003 standard (especially including support for
the ISO_C_BINDING module that we use to implement the new fortran
binding).
To check code conforms to standards it is recommended to try compiling with suitable compiler
flags to enforce these standards and to enable compiler warnings to check
for dubious code.
For gcc / g++ / gfortran the following flags can be used
export CFLAGS="-O3 -fvisibility=hidden -std=c99 -D_POSIX_C_SOURCE=200112L -pedantic -Wall -Wextra -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs -Wconversion -Wshadow -Wcast-qual -Wcast-align -Wwrite-strings"
export CXXFLAGS="-O3 -fvisibility=hidden -std=c++98 -pedantic -Wall -Wextra"
export FFLAGS="-O3 -Wall -Wextra"
N.B. adding the options -std=f2003 -pedantic to FFLAGS would normally
be used to check compliance with the Fortran 2003 standard, but those
gfortran options do not currently work for our new Fortran binding
because that compiler generates build errors in that case where the
associated message is
Error: Fortran 2008: Array of interoperable type at (1) to C_LOC which is nonallocatable and neither assumed size nor explicit size
A google check for that error message found
<https://gcc.gnu.org/ml/gcc-patches/2013-04/msg00110.html> where
apparently the interoperability concern was that an assumed shape
array might not be continuous. But we feel that should not be a
concern for this singly dimensioned case, and the NAG compiler
(notorious for its ability to check for standards compliance) builds
our fortran binding and examples without any errors or warnings. So
for now we can only avoid what we believe is this spurious gfortran
build error by dropping the -std=f2003 -pedantic options. Which means
we cannot check compliance with Fortran 2003 with that compiler and
must rely on a different Fortran compiler (NAG) to do that.
Some notes and recommendations
------------------------------
- Use C++ style // comments rather than the older /* */ style comments.
The only exception to this where a comment is embeded in a line of code,
e.g. to comment out a parameter name in a function definition in C++.
- To mark function parameters as unused and to suppress at least gcc
warnings about these, mark the parameter names with the PL_UNUSED( )
macro.
Styling of code
---------------
The uncrustify code beautifying program is used to style the source
code consistently and in a readable manner. Running the
scripts/style_source.sh
shell script can be used the check the
source code and optionally apply any styling changes required.
Use the --help option for this script to find out what options
you have to run it.
In order for this script to work, you must have the correct version
(currently that is version 0.60) of uncrustify installed and
on your PATH. You must also have PYTHON and other Unix tools
installed. So typically this script is only run on Unix
systems (or Unix-like systems such as Cygwin and MinGW-w64/MSYS2).
Since this script can potentially make intrusive changes (if you use
the --apply option), always run the "git diff" command afterward to
review those changes before committing the result.
Another important code styling script available on Unix or Unix-like
systems is
scripts/remove_trailing_blanks.sh
which unconditionally removes trailing blanks from
essentially all text files in the source tree.
Since this script can potentially make intrusive changes, always run
the "git diff" command afterward to review the changes before
committing the result.

129
src/3rdparty/plplot/README.emacs vendored Executable file
View File

@ -0,0 +1,129 @@
This file gives cookbooks for using emacs modes to help with editing and
maintaining a consistent style for our various kinds of files.
----------------------------------------------
* CMake files
There is a cmake mode available for emacs. On some systems (the latest
Debian unstable for instance) this may be automatically installed along
with cmake. If not, then the following cookbook should work.
1) Get the cmake-mode.el file from the cmake site
http://www.cmake.org/CMakeDocs/cmake-mode.el . Note the current file
has a couple of lines from diff / patch in (starting with >>> or <<<)
which need removing.
2) Install cmake-mode.el in a suitable location in your system / home
directory.
3) Add the following to your .emacs file to automatically load cmake
mode for .cmake and CMakeLists.txt files.
----
;--------------------
; Enable CMake mode |
;--------------------
(setq load-path (cons (expand-file-name "~/lib/site-lisp") load-path))
(autoload 'cmake-mode "CMAKE" "Major mode for editing CMake listfiles")
(setq auto-mode-alist
(append '(("CMakeLists\\.txt\\'" . cmake-mode)
("\\.cmake\\'" . cmake-mode))
auto-mode-alist))
----
You will need to alter the directory path depending on where you
installed cmake-mode.el
4) Check the file works by loading one of the plplot cmake files into
emacs. You should see CMAKE at the bottom of the screen as the major
mode.
5) For my version of emacs this does not autoload the helper function
for unscreamifying the buffer (i.e. all cmake commands in lower case).
Typing "M-x load-library cmake-mode" should fix this.
The two most useful functions are
"M-x unscreamify-buffer" which will put all cmake commands into
lower case
"M-x indent-region" which will indent the selected region
correctly
----------------------------------------------
DocBook files in doc/docbook/src
There is a well-established nxml mode for emacs that should be
automatically available for all recent versions of emacs that is useful
for editing our DocBook files.
1) Add the following to your .emacs file to automatically load nxml
mode for our DocBook files.
----
;--------------------
; Support nxml mode according to /usr/share/doc/nxml-mode/README
;--------------------
(load "/usr/share/emacs/site-lisp/nxml-mode/rng-auto.el")
(setq auto-mode-alist
(cons '("\\.\\(xml\\|xml.in\\|xsl\\|rng\\|xhtml\\)\\'" . nxml-mode)
auto-mode-alist))
----
2) Edit one of the DocBook files in doc/docbook/src.
i) Recognition of the DocBook schema for our DocBook files.
nxml automatically uses schemas.xml in the above directory to
use the DocBook schema for our DocBook files. If we add new DocBook
files, schemas.xml will have to be changed accordingly. To confirm you
are using the correct schema use the
C-c-C-s-C-w
emacs command.
ii) Validation.
nxml dynamically validates the file as it is being edited and underlines
in red (with a pop-up explaining the problem if you hover your mouse
over the underlined element) all elements that it cannot validate. This
facility is extremely useful while you edit our DocBook documentation.
Note, one nxml validation limitation is it does not understand xml
projects split into more than one file. In practice, this means all the
entities defined in plplotdoc.xml(.in) will not validate correctly
(i.e., will be underlined in red). Of course, to validate the entire
PLplot DocBook documentation project including entities, it is important
to run "make validate" in the build tree after your editing session is
complete. To find the next invalid element use the
C-c-C-n
emacs command.
iii) Standard indentation style.
To impose a standard indentation style on our DocBook files, select a
region by marking a location with the
C-@
emacs command, then moving the point (cursor) to the end of the region you
want to select. Then impose a standard indentation style on the
selected region using the
C-M-\
emacs command. This has recently been done for the entire regions of
all DocBook files so the region you normally select would normally be
just the one where you have recently made changes.
iv) Other nxml possibilities.
See "XML document authoring with emacs nxml-mode" at
http://infohost.nmt.edu/tcc/help/pubs/nxml/index.html .
----------------------------------------------

427
src/3rdparty/plplot/README.release vendored Executable file
View File

@ -0,0 +1,427 @@
PLplot Release 5.15.0
This is a release of the PLplot plotting package. It represents the
ongoing best efforts (roughly ~50 commits since the last release) of
the PLplot development community to improve this package, and it is
the only version of PLplot that we attempt to support. Releases in
the 5.x.y series should be available roughly two times per year.
Note that PLplot has been continuously developed since 1986 so it has
accumulated a lot of cruft since that time. Therefore, we are now
slowing removing that cruft to improve the lot of both new users and
new members of the development team. As a result virtually every
PLplot release has some backwards incompatibilities introduced to help
clean it up so please pay careful attention to the OFFICIAL NOTICES
FOR USERS below (and also in the various sections of
README.cumulated_release if you need backward incompatibility
information for several recent releases) where we document such
incompatibilities to make life easier for those who have prior
experience with older PLplot releases.
If you encounter a problem with this release that is not already
documented on our bug tracker, then please send bug reports to PLplot
developers via our mailing lists (preferred for initial discussion of
issues) at <http://sourceforge.net/p/plplot/mailman/>. If it turns out
no quick resolution is possible via mailing-list discussion, then the
issue should be placed on our bug tracker at
<http://sourceforge.net/p/plplot/bugs/>.
This software is primarily distributed under the LGPL. See the
Copyright file for all licensing details.
________________________________________________________________
CONTENTS
1. OFFICIAL NOTICES FOR USERS
1.1 CMake version compatibility
1.2 Remove typedefs for PL_NC_GENERIC_POINTER and PL_GENERIC_POINTER
1.3 Fix typedef for PLINT_NC_VECTOR
2. Improvements relative to the previous release
2.1 Bug fixes
2.2 Update PLplot to be consistent with modern free software
2.3 Rewrite the configuration of the INSTALL_RPATH target property
2.4 Rewrite the rpath configuration of traditionally built examples
2.5 Factor the PLplot export files
2.6 Introduce symbolic constants in our color-map routines
2.7 New implementation of the range checks for the validity of cmap0 and cmap1 user input
2.8 New implementation of the -bg command-line option
2.9 Implement ctest for the build system of the installed examples
3. PLplot testing
________________________________________________________________
1. OFFICIAL NOTICES FOR USERS
1.1 CMake version compatibility
Our build system is implemented using CMake. The minimum version of
CMake we currently allow is 3.13.2 on all platforms, and currently the
latest version of CMake that has been officially released is 3.14.4.
Note, that as of the time of this release we have the following
free distribution packaging support for modern CMake versions:
* Cygwin: 3.13.1 from <https://cygwin.com/cgi-bin2/package-grep.cgi>
* MinGW-w64/MSYS2: 3.14.4 from <http://repo.msys2.org/mingw/x86_64/>
* Fink: 3.11.0 from <http://pdb.finkproject.org/pdb/browse.php?name=cmake>
* MacPorts: 3.14.4 from <https://www.macports.org/ports.php?by=name&substr=cmake>
* Homebrew: 3.14.4 from <https://formulae.brew.sh/formula/cmake>
* Debian Testing: 3.13.4 (from <https://packages.debian.org/buster/cmake> where Testing = Buster is likely to become the official Debian Stable release of Debian in mid-2019, i.e., soon, see <https://en.wikipedia.org/wiki/Debian_version_history>).
* Other modern Linux distributions: likely 3.13.4 or greater since they typically package later versions of CMake than are available for Debian Stable.
It appears from the above table that binary packages for CMake for our
minimum allowed version (3.13.2) or later should be available soon or
immediately on most modern free software distributions. However,
PLplot users of distributions that do not package 3.13.2 or later
(e.g., Cygwin and Fink) will need to build CMake 3.13.2 or later for
themselves before they build PLplot-5.15.0
This particular PLplot release has been comprehensively tested for
CMake-3.13.2 through 3.14.4 on a variety of platforms (see
<http://sourceforge.net/p/plplot/wiki/Testing_Reports> for details
of recent tests on all platforms).
Therefore, if the CMake version is within this range there is an
excellent chance that our build system will "just work" on all
platforms. Furthermore, if later on you try CMake versions greater
than the latest version of CMake that is available at the time of this
PLplot release (3.14.4), our build system will likely continue to work
well because CMake has an excellent reputation for preserving
backwards compatibility.
1.2 Remove typedefs for PL_NC_GENERIC_POINTER and PL_GENERIC_POINTER
typedef PLPointer PL_NC_GENERIC_POINTER;
typedef PLPointer PL_GENERIC_POINTER;
were introduced as of 5.12.0 as the start of a plan that was almost
immediately abandoned. So these typedefs were officially deprecated
in 5.13.0, and they are now being dropped as of this release.
This cruft-removal causes a backwards-incompatible change to our C API
that is of no concern for users who do not use PL_NC_GENERIC_POINTER
and PL_GENERIC_POINTER in their code. However, for the remaining
users the solution must be to replace PL_NC_GENERIC_POINTER and
PL_GENERIC_POINTER by PLPointer everywhere in their code.
1.3 Fix typedef for PLINT_NC_VECTOR
This typedef (first defined as of 5.12.0) has been changed from
-typedef int * PLINT_NC_VECTOR;
+typedef PLINT * PLINT_NC_VECTOR;
to fix an inconsistency that was incorrectly and inadvertently created
for 5.12.0 between this typedef and all other PLINT* typedefs.
For systems that provide the stdint.h header the PLINT typedef is
typedef int32_t PLINT;
but for those systems that do not provide that header, this typedef is
typedef int PLINT;
Therefore the above change to the typedef for PLINT_NC_VECTOR is
backwards-incompatible (requiring recompilation of user code but no
changes to that code to fix the problem) for users with systems that
(a) provide the stdint.h header, and (b) define int differently than
int32_t for those systems.
________________________________________________________________
2. Improvements relative to the previous release
2.1 Bug fixes
The bug fixes in this release are noted in the ~50 commit messages
collected in ChangeLog.release.
Commit plplot-5.14.0-8-gdb9d90d0b should be of particular note since
it finally makes results achieved with our qt device driver linked to
Qt5 similar to the high quality of results achieved with that same
device driver when it is linked to Qt4.
2.2 Update PLplot to be consistent with modern free software
This ongoing project is implemented by making sure PLplot passes all
[comprehensive
tests](<https://sourceforge.net/p/plplot/wiki/Testing_Reports) on the
Debian Testing platform which is a high-quality rolling release that
keeps up to date with modern free software development. As a result
PLplot should be compatible with the following modern versions of free
software packages:
* CMake-3.13.2 through 3.14.4 (core, bindings, and device drivers)
* gcc 8.3.0 (core)
* qhull 2015.2 (optional core interpolation functionality)
* shapelib 1.4.1 (optional core map functionality)
* swig 3.0.12 through 4.0.0 (java, lua, octave, and python bindings)
* gnatmake/gdc/gfortran 8.3.0 (ada, d, and fortran bindings)
* g++ 8.3.0 (c++ binding and psttf and wxwidgets device drivers)
* pango 1.42.3, cairo 1.16.0 (cairo device driver)
* openjdk 11.0.3 (java binding)
* lua 5.3.5 (lua binding)
* camlidl 1.05, ocaml 4.05 (ocaml binding)
* octave 4.4.1 (octave binding)
* python 3.7.3 (python binding)
* Qt 5.11.3 (qt binding and qt device driver)
* Tcl/Tk 8.6.9 (tcl/tk binding and tk device driver)
* libx11 2:1.6.7 (tk and xwin device drivers)
* wxWidgets 3.0.4 (wxwidgets binding and device driver)
Notes for this table:
* The CMake versions used for testing were locally built rather than
installed from Debian testing, see Section 1.1 for details.
* The Debian Testing package for swig 3.0.12 contains a swig fix from
swig-4.0.0. That fix allows an Octave-4.4 binding to be built for
PLplot. If your swig-3 version does not have this fix, you should
use Octave-4.2 until swig-4 is released.
* The swig-4.0.0 version used for testing was locally built since this
version is not packaged for Debian Testing (yet).
* The Debian Testing package for lua 5.3.3 currently perpetuates
[a serious bug](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=902238)
for that particular upstream version. The above good results for lua
5.3.5 were generated with a locally built version of upstream 5.3.5
that contains the essential fix for 5.3.3.
2.3 Rewrite the configuration of the INSTALL_RPATH target property
This change is important for those Unix users who install
PLplot dependencies (such as libLASi) in non-standard locations and
who use the traditional build of our installed examples rather than
the CMake-based build of those examples.
DT_RPATH and its more modern variant DT_RUNPATH are two ways on Unix
systems to inform the run-time loader of non-standard locations of
shared libraries that are needed by applications. Therefore, the
details of how our build system configures use of the INSTALL_RPATH
target property (which controls DT_RPATH on old Unix systems such as
Debian Jessie and DT_RUNPATH on more modern Unix systems such as
Debian Testing) become important for the traditional build of
installed examples if any external library (e.g., libLASi) needed by
any PLplot component is installed in a non-standard location. (Note
that CMake-based builds automatically take care of all rpath concerns
so our CMake-based core build and CMake-based build of the installed
examples automatically work fine regardless of where our external
libraries are installed or the INSTALL_RPATH target property set for
them.)
Our INSTALL_RPATH configuration worked fine for our traditional builds
of installed examples on DT_RPATH platforms such as Debian Jessie and
was extensively tested in that era with epa_built external libraries
that were installed in non-standard locations. However, that
configuration did not work correctly for DT_RUNPATH platforms such as
Debian Testing since it was not always consistent with the following
additional constraint on the use of DT_RUNPATH that has been taken
from
<https://refspecs.linuxfoundation.org/elf/gabi4+/ch5.dynamic.html>:
"The set of directories specified by a given DT_RUNPATH entry is
used to find only the immediate dependencies of the executable or
shared object containing the DT_RUNPATH entry. That is, it is used
only for those dependencies contained in the DT_NEEDED entries of
the dynamic structure containing the DT_RUNPATH entry, itself. One
object's DT_RUNPATH entry does not affect the search for any other
object's dependencies."
As a result PLplot's use of the new libLASi release (which necessarily
had to be built locally and with a non-standard install prefix) failed
for our traditional build.
To address this issue I (AWI) have completely rewritten our rpath
configuration logic for the INSTALL_RPATH property of installed
targets to (i) be consistent with the above additional DT_RUNPATH
constraint, and (ii) have that configuration done in a standardized
way for all our installed targets (executables, dll's (modules)
generated by swig, ordinary dll's, shared libraries and static
libraries). The result of this work is a substantial reduction in the
number of lines of CMake logic in our build system (since virtually
all of the INSTALL_RPATH logic is now taken care of in the new
process_rpath function).
Note that this new logic always uses the transitive INSTALL_RPATH
method for the static build case and by default uses non-transitive
INSTALL_RPATH method for the shared library case (regardless of
whether the device drivers are dynamic or nondynamic). And that
default for the shared library case works well for Debian Testing.
But if there are still some Unix platforms out there that only work
for the transitive INSTALL_RPATH method for the shared library case,
the user can choose that method by setting the
-DNON_TRANSITIVE_RPATH=OFF cmake option. And as always if the user
(typically a binary package maintainer) specifies -DUSE_RPATH=OFF, the
INSTALL_RPATH target property (transitive or otherwise) will not be
set at all for installed targets with the result that DT_RPATH (old
Unix systems) and DT_RUNPATH (modern Unix systems) will not be set for
those targets.
N.B. in the rewritten INSTALL_RPATH logic the simplifying assumption
is made that in both the non-transitive and transitive rpath cases,
that all non-system library locations must be mentioned in the derived
DT_RPATH or DT_RUNPATH. Of course, this assumption is only necessary
if the relevant libraries are shared so the result in the case where
the relevant library (whether external or internal) is static is the
non-standard location of that library is unnecessarily listed in the
resulting DT_RPATH or DT_RUNPATH. So the result is the run-time
loader has to check a bit more before deciding that location
information is irrelevant so it adds slightly to start-up latency.
However, implementing a check whether external and internal libraries
are shared or not would so complicate our build system code and
therefore make it more fragile that I have decided to stick with using
this simplifying assumption.
2.4 Rewrite the rpath configuration of traditionally built examples
In this case, "traditionally built" refers to the traditional (GNU
make + pkg-config) build of the installed examples (including the
ocaml examples) AND the CMake-based builds of the ocaml examples in
the core build tree and the build tree for the installed examples.
(OCaml is a special case because there is no CMake official support
for this language so even for the CMake-based build of ocaml examples,
low-level CMake add_custom_command/target pairs must be used that are
very similar to the traditional build of the installed ocaml examples.
This change updated the somewhat sloppy transitive rpath method that
was used before for traditionally built examples to the rigorous
method I have implemented (see Section 2.3) recently for the case of
the INSTALL_RPATH property for installed targets. That is, for the
non-transitive rpath case the traditionally built examples only refer
to the directory location of the "PLPLOT::" libraries that the plplot
examples in question depend on, and for the transitive case append the
INSTALL_RPATH locations for just the internal libraries that are
dependencies of the examples in question. See the process_rpath
function in cmake/modules/plplot_functions.cmake for details.)
Note we use the same simplifying assumption mentioned in Section 2.3
to decide which library locations should be inserted in DT_RPATH or
DT_RUNPATH for traditionally built examples.
Note this more rigorous approach solved an ocaml rpath bug that was
exposed by the DT_RUNPATH Debian Testing platform. So as far as I
know the combination of this change and the INSTALL_RPATH changes
described in section 2.3 eliminates the last known regression against
the good test results I achieved with the old sloppy rpath method on
the Debian Jessie platform with its old-fashioned but nevertheless
working DT_RPATH capability.
In sum, recent comprehensive tests on the Debian Testing platform
support the idea that our rewritten INSTALL_RPATH configuration for
installed targets and our rewritten rpath configuration for
traditionally built executables generates working DT_RUNPATH results
for the case where either/both PLplot libraries or external libraries
are installed in non-standard locations. And presumably that good
result also holds true for generated DT_RPATH results since even quite
sloppy rpath configuration seems to have worked well in the past on
such systems (e.g., Debian Jessie). However, if there are Unix
platforms still out there where the run-time loader (operating at run
time in contrast to the linker that operates at build time) errors out
by saying it cannot find a library for the present rpath methods, the
first thing the user should try is -DUSE_RPATH=ON (if they are not
using that default already) and the second thing they should try if
this trouble occurs for the shared build case is
-DNON_TRANSITIVE_RPATH=OFF.
2.5 Factor the PLplot export files
Packagers of binary versions of PLplot used in free software
distributions such as Debian and Fedora typically split the PLplot
installation into many different package components, and users of
those distributions have the option of only installing the subset of
those packages (and their dependencies) that they need. However, the
CMake-based build system that is part of the examples package (which
contains source code for all our test examples) can currently only
build the examples if the user installs all binary components of
PLplot.
The current change is a large step toward removing that constraint.
This change factors the the two previous integrated PLplot export
files into two exported files per exported target (which can be an
installed library, module, or executable). So if packagers distribute
these factored export files in the same binary packages which contain
the actual libraries, modules, or executables which are described by
the exported targets, then *any* CMake-based build systems for
software that depends on the PLplot installation can simply
interrogate that installation (using the if(TARGET ...) command) to
see what subset of the PLplot targets have been installed and act
accordingly.
N.B. the CMake-based build system for the example source code that is
installed is a (large) example of such software. But that software
has not yet been changed as described above so packagers will have to
wait until the next release before the source code for the appropriate
subset of the examples in that package can be built properly against
the subset of binary PLplot packages that have been installed by
users.
2.6 Introduce symbolic constants in our color-map routines
These new symbolic constants (in their C/C++ form) are
// Default number of colors for cmap0 and cmap1.
#define PL_DEFAULT_NCOL0 16
#define PL_DEFAULT_NCOL1 128
// minimum and maximum PLINT RGB values.
#define MIN_PLINT_RGB 0
#define MAX_PLINT_RGB 255
// minimum and maximum PLFLT cmap1 color index values.
#define MIN_PLFLT_CMAP1 0.
#define MAX_PLFLT_CMAP1 1.
// minimum and maximum PLFLT alpha values.
#define MIN_PLFLT_ALPHA 0.
#define MAX_PLFLT_ALPHA 1.
These constants should be defined for our core C "plplot" library and
all our different supported language bindings. These symbolic
constants are used, for example, in our range checks for the validity
of cmap0 and cmap1 user input.
2.7 New implementation of the range checks for the validity of cmap0 and cmap1 user input
Instead of exiting when cmap0 or cmap1 user input is invalid, the
philosophy for the new implementation of cmap0 and cmap1 range
checking is to issue a warning message, substitute something
reasonable, and continue. In addition, for the new implementation we
attempt to catch all invalid cmap0 or cmap1 user input rather than
just a subset of such cases.
2.8 New implementation of the -bg command-line option
The -bg command-line option is used to specify the RGB and (optional)
alpha values of the background. The new implementation is much more
careful about checking for user input errors in both the RGB and alpha
values and follows the philosophy of warning and continuing with
reasonable default values when the user specifies an non-parsable or
invalid value for the RGB or alpha values of the background.
2.9 Implement ctest for the build system of the installed examples
Previously the ctest command was only configured for the CMake-based
build system of the core build of PLplot libraries and the source code
of the PLplot examples that appears in the PLplot source tree. What
is changed now is the ctest command has also been configured for the
CMake-based build system of the installed source code for the PLplot
examples using in most cases common CMake logic as for the core build
case. As a result, the ctest results in the two very different cases
cover the same tests. In addition the same (good) ctest results have
been achieved for these two different builds confirming that all is
well with the core build of PLplot libraries and examples as well as
the installed binary version of PLplot libraries and corresponding
CMake-based build system for the installed source code for the PLplot
examples that is built against those installed libraries.
________________________________________________________________
3. PLplot testing
Comprehensive tests of this release are documented in
<https://sourceforge.net/p/plplot/wiki/Testing_Reports>. In addition,
developers and users who have used the evolving git master tip
development version of PLplot for their plotting needs during this
release cycle have provided additional important testing of this
release of PLplot.
________________________________________________________________

8
src/3rdparty/plplot/SERVICE vendored Executable file
View File

@ -0,0 +1,8 @@
In the spirit of the GNU service file included with Emacs, gcc, etc,
this file lists conctact information for people or organizations which
provide PLplot related services for hire. If you would like to be
listed, send your contact information to one of the PLplot
maintainers.
-----------------------------------------------------------------------------

203
src/3rdparty/plplot/ToDo vendored Executable file
View File

@ -0,0 +1,203 @@
Areas currently under development
---------------------------------
- Need developers! It is becoming too difficult to support PLplot on all
the many platforms it runs on. If you want it to run correctly on your
platform it needs your support. Current system supporters include:
Maurice LeBrun HP-UX, Super-UX
mjl@dino.ph.utexas.edu
Geoff Furnish Linux
furnish@dino.ph.utexas.edu
Paul Casteels DOS/BGI (bcc)
casteels@uia.ac.be
John C. Peterson OS/2
jcp@trg.saic.com
Paul Kirschner DOS/DJGPP
pek@logos.res.utc.com
Hiromi Kimura VMS port
hiromi@tac.tsukuba.ac.jp
This is not to say that other platforms are unsupported, as often we do
work on other platforms, and will fix whatever problems we encounter.
But there is no guarantee PLplot will work without problems on such
systems either. The systems we really need help to support (in order
of most urgent need) include:
Irix
Ultrix
SunOS 5.x
(any other *ix not mentioned)
Macintosh
Amiga
Unicos
AIX
SunOS 4.x
- Continue updating the manual.
- improve color dialogs for TK driver:
. inform client side that colors have been changed (right now only
plserver side knows about it)
. put in a better file selector for palette files
. rewrite palette tools in itcl
. add a way to pick direction in hue to use when interpolating between
colors
- Add an initialization file capability. This would be very nice from a
customization standpoint, and inevitably I will want to add it before
long. But it has some problems. For example, when does it get read?
If when you call plinit(), it may overwrite previous variables set by
the API or command-line. This is a thorny problem. A secondary issue
is deciding what libraries it should depend on. Using libX11 makes it
easier for color support, and Tcl for parsing, but with a bit extra
effort, I could support non-Unix systems too.
The real problem is that plplot has no command to "open the library".
I am VERY tempted to require a call to plopen() as the FIRST plplot
library call, just so that it could be absolutely sure it was the
first. Then, it could read the startup file. You could do this with
the Tk plframe widget because it must be created before you can send
commands to it, and the command to read the init file could be buried
in there. But it would probably be a bad idea to have one output
driver read an init file and another one ignore it, since most people
(myself included) rely on output from one driver to the next to be
basically the same, contingent on driver capabilities that is. So this
capability really needs to go into the core.
- 3-D plots should be clipped at the 3-D box boundary. Right now the 3-d
data is immediately transformed to 2-d lines on the projection plane.
No intermediate clipping is performed, meaning that only the 2-d
projected part is clipped.
- fix 2d function plotter API's: Most general function in each
category should accept transformer function and transformer data, to work
with arbitrary data layouts, but there should also be FE's for the
"usual data types". Work to be done:
- add contour plotter FE's
- add condition code array handler to plshade
(upgrade plAlloc.. to handle char variables?)
- fix API for surface plotter
- vector field plotter?
- better document the 2d function plotter API in plfcont, etc.
- File familying is iffy and needs a full check out.
- Write plcfill() or whatever to cheaply fill 2d functions based on cell
value only. Should be much faster than plshade for many grid points
(e.g. 128 x 128). The other option is raster, see below.
- The color map selection in the versaterm driver still doesn't work
quite right. When running x16c, the following happens:
o color 9 isn't set correctly. This doesn't make sense -- how
can the driver be messing up just for this one? Besides, it
works fine on my Amiga's tek4107 driver. Sounds like a bug
in versaterm. Need to check this code out on other Tek4107
emulators, like mskermit.
o There is sometimes some garbage at the beginning of the fill.
- implement some sort of raster-oriented output. GIF might be good since
it runs on lots of machines (originated with PC's but now supported
under Unix and Amiga). Any PD code for writing it from Unix?
- support command line arg reading from Fortran under whatever important
OS's support it. One trouble here is that it may require an additional
oddball library to be linked in, and I'm not thrilled about that.
- fix additional problems with custom color map support under X:
. Add command line switch to enable it, maybe switches to for all the
preprocessor constants in xwin.c controlling cmap allocation.
. When a custom colormap is used, it becomes the new top level TK
colormap, since the palette modification tools need to be using the
same colormap in order for the colors to come out the same. But
there is a minimum of color changing when the colormaps are swapped
(i.e. focus goes into or out of the plplot/TK application) because
the xwin driver copies as many colors out of the default as is
reasonable. Cases where this still isn't quite good enough include
the text widgets (such as help windows), for which the color is not
preallocated, and sometimes the TK menu bar, for which I think the
color is preallocated but exactly matches one already in use by the
window manager and thus does not get copied. Some strategies in
fixing this include: (a) providing a list of colors for the xwin
driver to copy and allocate and (b) do not install the xwin colormap
in the main window and instead share the colormap with windows that
want it through a plframe extension. Right now because of continued
uncertainties the custom colormap option in xwin.c is disabled.
- metafile produced on the Amiga isn't quite right! Compiler bug?
- How can I modify the surface plotter to do color overlays?
- Write Fortran counterparts to x14c and x15c?
- check out shared library support under SAS/C on the Amiga -- supposed to
be easy (6.0 and later)
- Split off Tcl-DP stuff from Tk stuff better, get it working with DP-lite.
- put pen width option in TK driver
- const'ify plplot API where appropriate.
- fix bugs in Amiga print driver.
- mouse dragging in TK driver text window should cause a scroll.
- get plplot up under gcc on the Amiga?
- fix problems with hidden line removal on "spiky" 3D plots on high
resolution (300 dpi or greater) devices. There are little gaps that
sometimes appear after a line reappears from behind a surface. In
Mathematica, hidden line removal is done by the device driver (which
receives PostScript) instead of beforehand. (There is a section in the
Mathematica manual where they mention hidden-line removal as an inherently
device dependent problem.)
Things planned for sometime in the future.
----------------------------------------------
- CGM driver. Shouldn't be too hard, just haven't gotten around to it
yet. Any volunteers? Should I assume the presence of a CGM library?
Or should I carry my own routines to do low-level operations to the CGM
file? (Here I could borrow from a freely distributable package that
deals with CGM files).
- graphical entities to be "objectized", so they are easier to manipulate
from plrender. Likely candidates: plot, string, character, tick, axis,
line, etc. But high performance must not be sacrificed.
- Better use of driver intelligence, esp. for text -- the postscript driver
should be capable of using postscript fonts instead of the Hershey fonts.
- Cloned streams, for plotting to multiple devices simultaneously.
- Fully document the plplot-driver interface.
- Japanese plplot/TK extensions?
- Japanese font extensions?
BUGS
----
The following are known bugs or failings of PLplot, that are unlikely to
be fixed any time soon if at all.
- ps output files do not work with up(1).
- The contour plotter has a bug that causes it to occasionally fail for
some data sets. One known example is if there is no x-dependence.
If you experience problems with other data try to work up a demo and
send it to me and then maybe I can track down the problem. There has
been some talk about replacing the contourer with a better algorithm.
Volunteers needed.

View File

@ -0,0 +1,27 @@
<version>${PLPLOT_VERSION}</version>
<headers>
${PREFIX}/include/plplot
</headers>
<libs>
${PREFIX}/lib
</libs>
<include_paths>
@TCL_INCLUDE_PATH@
@TK_INCLUDE_PATH@
@QT_INCLUDES@
</include_paths>
<include_preamble>
<!-- These two must be first in the list of headers. plplotP.h for
obvious reasons, and qt.h because some other PLplot installed header
interferes (somehow) unless qt.h is near the top of the list. -->
plplotP.h
qt.h
</include_preamble>
<skip_headers>
<!-- Remove headers that currently cause errors for
abi-compliance-checker.-->
wxPLplotstream.h
wxPLplotwindow.h
</skip_headers>

91
src/3rdparty/plplot/bindings/CMakeLists.txt vendored Executable file
View File

@ -0,0 +1,91 @@
# bindings/CMakeLists.txt for PLplot
###
### Process this file with cmake to produce Makefile
###
# Copyright (C) 2006-2018 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; 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 PLplot; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
# swig-support has to come before swig-generated bindings (currently
# python, java, lua, and octave).
add_subdirectory(swig-support)
add_subdirectory(c++)
add_subdirectory(fortran)
add_subdirectory(tcl)
add_subdirectory(tk)
add_subdirectory(tk-x-plat)
add_subdirectory(python)
add_subdirectory(octave)
add_subdirectory(java)
add_subdirectory(wxwidgets)
add_subdirectory(ada)
add_subdirectory(d)
add_subdirectory(ocaml)
add_subdirectory(lua)
add_subdirectory(qt_gui)
set(index)
if(ENABLE_tcl)
list(APPEND index "${CMAKE_CURRENT_BINARY_DIR}/tcl/pkgIndex.tcl")
endif(ENABLE_tcl)
if(PLD_tk)
list(APPEND index "${CMAKE_CURRENT_BINARY_DIR}/tk/pkgIndex.tcl")
endif(PLD_tk)
if(PLD_tkwin)
list(APPEND index "${CMAKE_CURRENT_BINARY_DIR}/tk-x-plat/pkgIndex.tcl")
endif(PLD_tkwin)
if(index)
# The best cross-platform method of concatenating these files would
# be to use "cmake -E concatenate ...", but that functionality has
# not been implemented yet so we use a different method.
# This method of concatenating files at cmake time works because each
# of the files in index is configured at cmake time.
# N.B. the quotes on filecontents below are necessary to avoid
# having semicolons in filecontents messing up the results.
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/concatenate_pkgIndex.tcl.cmake
"
set(script_index \"${index}\")
#message(STATUS \"script_index = \${script_index}\")
file(WRITE \"${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl\" \"\")
foreach(filename IN LISTS script_index)
#message(STATUS \"filename = \${filename}\")
file(READ \${filename} filecontents)
file(APPEND \"${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl\" \"\${filecontents}\")
endforeach(filename IN LISTS script_index)
"
)
add_custom_command(
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl
COMMAND
${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/concatenate_pkgIndex.tcl.cmake
DEPENDS
${index}
VERBATIM
)
add_custom_target(
concatenate_pkgIndex.tcl ALL
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl
DESTINATION ${DATA_DIR}
)
endif(index)

View File

@ -0,0 +1,147 @@
# bindings/ada/CMakeLists.txt
# Copyright (C) 2007-2019 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; 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 PLplot; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
if(ENABLE_ada)
# Specification files containing, e.g., variables, types, and subprogramme (subprocedure) declarations.
set(SPEC_SOURCE_LIST
plplot.ads
plplot_standard.ads
plplot_thin.ads
plplot_traditional.ads
plplot_auxiliary.ads
)
# Body files containing code for the subprogrammes. Only body files need to be compiled. The
# corresponding specification files will be found automatically.
set(BODY_SOURCE_LIST
plplot_standard.adb
plplot_thin.adb
plplot_traditional.adb
plplot_auxiliary.adb
)
# These are Ada library information files built by gnat. I am not
# sure whether the name suffixes correspond to the *.adb or *.ads files
# above or the union of them. In any case, if any of the names change
# above, then this list will probably have to be changed as well.)
# N.B. the absolute location prefix of these files may have to be changed
# in the future since this is a CMake internal.
set(ALI_PREFIX
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/plplotada.dir
)
set(ALI_LIST
${ALI_PREFIX}/plplot_standard.ali
${ALI_PREFIX}/plplot_thin.ali
${ALI_PREFIX}/plplot_traditional.ali
${ALI_PREFIX}/plplot_auxiliary.ali
)
# I am pretty sure this is a workaround for a MinGW gnatmake bug
# since the installation of these files is not needed for Linux.
# However, without this workaround the standard examples build on
# MinGW/MSYS platforms without problems (so gnatmake is happy if the
# *.o files are not installed which is another indication we are
# dealing with a bug here), but at run-time the ada examples
# immediately return with a return code of 3.
if(MINGW)
list(APPEND ALI_LIST
${ALI_PREFIX}/plplot_standard.o
${ALI_PREFIX}/plplot_thin.o
${ALI_PREFIX}/plplot_traditional.o
${ALI_PREFIX}/plplot_auxiliary.o
)
endif(MINGW)
set(plplotada_SPEC_SRCS)
foreach(SPEC_FILE ${SPEC_SOURCE_LIST})
list(APPEND plplotada_SPEC_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/${SPEC_FILE}
)
endforeach(SPEC_FILE ${SPEC_SOURCE_LIST})
set(plplotada_BODY_SRCS)
foreach(BODY_FILE ${BODY_SOURCE_LIST})
list(APPEND plplotada_BODY_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/${BODY_FILE}
)
endforeach(BODY_FILE ${BODY_SOURCE_LIST})
# plplotada depends on the plplot library.
set(LIB_INSTALL_RPATH ${LIB_DIR})
# target_link_libraries used in special way below so avoid using it inside configure_library_build.
configure_library_build(plplotada "" "${plplotada_BODY_SRCS}" "" "${LIB_INSTALL_RPATH}")
# Work around an issue in our CMake Ada language
# support for MinGW/Windows. FIXME. This issue should be fixed
# at the Ada language support level and not worked around here.
# N.B. On the Cygwin platform the copy command below would fail
# because on that platform a very different library naming
# convention is used. Furthermore, it appears the naming convention
# for the plplotada library on Cygwin is consistent, i.e.,
# dll/cygplplot-13.dll and dll/cygplplotada-2.dll for the plplot and
# plplotada libraries (presumably because UNIX is true on Cygwin).
# Therefore, there is no need, in any case, for any
# naming-convention workarounds for that platform. Thus,
# specifically exclude Cygwin below.
if(USE_DLL_SUBDIRECTORY AND NOT CYGWIN)
add_custom_command(
TARGET plplotada POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
libplplotada.dll
libplplotada.dll.a
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/dll
VERBATIM
)
endif(USE_DLL_SUBDIRECTORY AND NOT CYGWIN)
# Link to GNAT_LIB to avoid underlinking the plplotada library (which causes
# link errors on at least the Cygwin platform), but use
# the PRIVATE keyword (on all platforms) to avoid overlinking Ada applications
# that link to plplotada.
target_link_libraries(${WRITEABLE_TARGET}plplotada PRIVATE ${GNAT_LIB})
# N.B. nm evidence shows that examples that use
# callbacks (e.g., plfill in x15a.adb) have unresolved references
# to c_plfill, etc. that require a public link to plplot
# regardless of how NON_TRANSITIVE is set.
target_link_libraries(${WRITEABLE_TARGET}plplotada PUBLIC PLPLOT::plplot)
install(FILES ${plplotada_SPEC_SRCS} ${plplotada_BODY_SRCS}
DESTINATION ${ADA_INCLUDE_DIR}
)
# Permissions of *.ali files in accordance with
# http://people.debian.org/~lbrenta/debian-ada-policy.html
install(FILES ${ALI_LIST}
DESTINATION ${ADA_LIB_DIR}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
)
# Add generated .ali files to the list of additional files to be
# removed by make clean
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${ALI_LIST}")
# Configure pkg-config *.pc file corresponding to libplplotada
# See remarks above concerning why plplot has to be public.
pkg_config_file("ada" "Ada" " Ada binding" "plplotada" "" "${GNAT_LIB}" "-lplplot")
endif(ENABLE_ada)

29
src/3rdparty/plplot/bindings/ada/plplot.ads vendored Executable file
View File

@ -0,0 +1,29 @@
-- Maintain backward compatibility of the Ada "standard" binding after changing the
-- name to PLplot_Standard from PLplot.
-- Copyright (C) 2016 Jerry Bauck
-- 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
-- The preferred name for the "standard" Ada binding is PLplot_Standard. It replaces
-- the earlier identical package that was named PLplot. This file simply renames that
-- package so that applications which use the old binding name, PLplot, will still
-- function as they did before the name change. The name PLplot is thus deprecated
-- although with this file progams that with-use the PLplot name should always work.
with PLplot_Standard;
package PLplot renames PLplot_Standard;

View File

@ -0,0 +1,126 @@
-- Auxiliary types and subprograms to be with-ed by all the Ada
-- bindings to PLplot
-- Copyright (C) 2008-2010 Jerry Bauck
-- 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 body PLplot_Auxiliary is
--------------------------------------------------------------------------------
-- Utility procedures useful in compiling the examples --
--------------------------------------------------------------------------------
-- Mimic C conversion of float to integer; something similar works in e.g.
-- plplot_thin.adb.
-- C truncates towards 0. Ada rounds to nearest integer; midway rounded
-- away from zero, e.g. Inteter(±3.5) is ±4. But any completely reliable
-- conversion is probalby not possible; indeed, this one exactly emulates C
-- when tested for values around ±2 to ±3. Both convert ±2.9999999999999997
-- to ±2 and ±2.9999999999999998 to ±3 which is of course wrong. But that's C.
function Trunc(a : Long_Float) return Integer is
begin
if a >= 0.0 then
return Integer(a - 0.4999999999999999);
else
return Integer(a + 0.4999999999999999);
end if;
end Trunc;
-- Find minimum in a 1D array.
function Vector_Min(x : Real_Vector) return Long_Float is
Result : Long_Float;
begin
Result := x(x'First);
for i in x'First+1..x'Last loop
Result := Long_Float'min(Result, x(i));
end loop;
return Result;
end Vector_Min;
-- Find minimum and its location in a 1D array.
procedure Vector_Min(x : Real_Vector;
The_Minimum : out Long_Float;
Location_Of_Min : out Integer) is
begin
The_Minimum := x(x'First);
Location_Of_Min := x'First;
for i in x'First+1..x'Last loop
if x(i) < x(i - 1) then -- Finds the first of repeated mins.
The_Minimum := x(i);
Location_Of_Min := i;
end if;
end loop;
end Vector_Min;
-- Find maximum in a 1D array.
function Vector_Max(x : Real_Vector) return Long_Float is
Result : Long_Float;
begin
Result := x(x'First);
for i in x'First+1..x'Last loop
Result := Long_Float'max(Result, x(i));
end loop;
return Result;
end Vector_Max;
-- Find maximum and its location in a 1D array.
procedure Vector_Max(x : Real_Vector;
The_Maximum : out Long_Float;
Location_Of_Max : out Integer) is
begin
The_Maximum := x(x'First);
Location_Of_Max := x'First;
for i in x'First+1..x'Last loop
if x(i) > x(i - 1) then -- Finds the first of repeated maxes.
The_Maximum := x(i);
Location_Of_Max := i;
end if;
end loop;
end Vector_Max;
-- Find minimum in a 2D array.
function Matrix_Min(x : Real_Matrix) return Long_Float is
Result : Long_Float := Long_Float'large;
begin
for j in x'First(2)..x'Last(2) loop
for i in x'First(1)..x'Last(1) loop
Result := Long_Float'Min(Result, x(i, j));
end loop;
end loop;
return Result;
end Matrix_Min;
-- Find maximum in a 2D array.
function Matrix_Max(x : Real_Matrix) return Long_Float is
Result : Long_Float := Long_Float'small;
begin
for j in x'First(2)..x'Last(2) loop
for i in x'First(1)..x'Last(1) loop
Result := Long_Float'Max(Result, x(i, j));
end loop;
end loop;
return Result;
end Matrix_Max;
end PLplot_Auxiliary;

View File

@ -0,0 +1,100 @@
-- Auxiliary types and subprograms to be with-ed and by all the Ada
-- bindings to PLplot
-- Copyright (C) 2006-2010 Jerry Bauck
-- 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
with
Ada.Strings.Bounded, -- fixme Probable cruft.
Ada.Strings.Unbounded;
use
Ada.Strings.Bounded,
Ada.Strings.Unbounded;
-- with Ada.Numerics.Long_Real_Arrays;
package PLplot_Auxiliary is
--------------------------------------------------------------------------------
-- Utility type declarations used by the bindings --
--------------------------------------------------------------------------------
-- Declarations for Ada 95 and Ada 2005 when it is desired to _not_ invoke
-- the numerical capability of Annex G.3.
type Real_Vector is array (Integer range <>) of Long_Float;
type Real_Matrix is array (Integer range <>, Integer range <>) of Long_Float;
-- Declarations when using Ada 2005 and it is desired to invoke the numerics
-- Annex G.3 or the user simply prefers to declare real vectors and matrices
-- in a manner that is type-compatible with that annex. ALSO IN THIS CASE
-- uncomment the line above: with Ada.Numerics.Long_Real_Arrays;.
-- Using Annex G.3 requires linking to BLAS and LAPACK libraries or the
-- PLplot build process will fail when attempting to link the Ada examples
-- e.g. x01a.adb.
-- subtype Real_Vector is Ada.Numerics.Long_Real_Arrays.Real_Vector;
-- subtype Real_Matrix is Ada.Numerics.Long_Real_Arrays.Real_Matrix;
----------------------------------------------------------------------------
-- Implementation note: The easy ability to switch to Ada 2005 Annex G.3
-- capability (with only these simple edits to this file) is the only reason
-- for requiring that this package be with-ed in the bindings. Only the
-- examples use the utility procedures below--not the bindings themselves.
-- If it were ever to be decided to abandon Ada 95 compatibility and to
-- require all Ada-capable PLplot builds to link to BLAS and LAPACK, then
-- the with-s to this package in the bindings could be removed.
----------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Utility procedures useful in compiling the examples --
--------------------------------------------------------------------------------
-- Mimic C conversion of float to integer; something similar works in e.g.
-- plplot_thin.adb.
-- C truncates towards 0. Ada rounds to nearest integer; midway rounded
-- away from zero, e.g. Inteter(±3.5) is ±4. But any completely reliable
-- conversion is probalby not possible; indeed, this one exactly emulates C
-- when tested for values around ±2 to ±3. Both convert ±2.9999999999999997
-- to ±2 and ±2.9999999999999998 to ±3.
function Trunc(a : Long_Float) return Integer;
-- Find minimum in a 1D array.
function Vector_Min(x : Real_Vector) return Long_Float;
-- Find minimum and its location in a 1D array.
procedure Vector_Min(x : Real_Vector;
The_Minimum : out Long_Float;
Location_Of_Min : out Integer);
-- Find maximum in a 1D array.
function Vector_Max(x : Real_Vector) return Long_Float;
-- Find maximum and its location in a 1D array.
procedure Vector_Max(x : Real_Vector;
The_Maximum : out Long_Float;
Location_Of_Max : out Integer);
-- Find minimum in a 2D array.
function Matrix_Min(x : Real_Matrix) return Long_Float;
-- Find maximum in a 2D array.
function Matrix_Max(x : Real_Matrix) return Long_Float;
end PLplot_Auxiliary;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,378 @@
-- Thin Ada binding to PLplot
-- Copyright (C) 2006-2013 Jerry Bauck
-- 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
with
Ada.Text_IO,
PLplot_Auxiliary,
System.Address_To_Access_Conversions;
use
PLplot_Auxiliary,
Ada.Text_IO;
package body PLplot_Thin is
--------------------------------------------------------------------------------
-- Utility for passing matrices to C --
--------------------------------------------------------------------------------
-- Take a Real_Matrix as defined in Ada.Numerics.Generic_Real_Arrays
-- and its instances and produce a 1D array of access variables to the
-- element located at the first column of each row. This is then suitable
-- for passing to an external C subroutine which expects a "2D array" in the
-- form of an array of pointers to "1D arrays" which in turn are pointers to
-- the first element of each row in C-land. This currently uses the GNAT
-- attribute Unrestricted_Access which makes it non-portable but allows the
-- accessing of the matrix elements without aliasing them, which is useful
-- because the Ada 2005 vector and matrix types are non-aliased.
-- For more about the Unrestricted_Access attribute, see Implementation
-- Defined Attributes in the GNAT Reference Manual.
-- TO-DO: Write a function which accepts x(Index, Index_Of_First_Column)
-- as an argument and returns a "proper" access variable using the method
-- discussed in "Ada as a Second Language," Second Edition, by Norman H.
-- Cohen, Section 19.3, for portability. This should remove GNAT dependence.
-- Question: Will Unchecked_Access, a normal Ada feature, work instead? fix this
function Matrix_To_Pointers(x : Real_Matrix) return Long_Float_Pointer_Array is
Index_Of_First_Column : Integer := x'First(2);
x_As_Pointers : Long_Float_Pointer_Array (x'range(1));
begin
for Index in x'range(1) loop
x_As_Pointers(Index) := x(Index, Index_Of_First_Column)'Unrestricted_Access;
end loop;
return x_As_Pointers;
end Matrix_To_Pointers;
--------------------------------------------------------------------------------
-- Transpose a Matrix. --
--------------------------------------------------------------------------------
function PL_Transpose(A : Real_Matrix) return Real_Matrix is
B : Real_Matrix(A'range(2), A'range(1));
begin
for i in A'range(1) loop
for j in A'range(2) loop
B(j, i) := A(i, j);
end loop;
end loop;
return B;
end PL_Transpose;
--------------------------------------------------------------------------------
-- Functions for use from C or C++ only --
-- (Not really ;). --
--------------------------------------------------------------------------------
-- THESE FUNCTIONS ^^^ ARE NOT IMPLEMENTED FOR THE ADA BINDING
-- EXCEPT FOR THE FOLLOWING.
-- plparseopts here is an exact copy (exept for the name) of
-- Parse_Command_Line_Arguments in the thick binding. The reason for
-- departing from the usual method of simply pragma Import-ing as in
-- most or all of the other interfaces to C is because of the need to
-- figure out what the command lines arguments are by also pragma
-- Import-ing Gnat_Argc and Gnat_Argv. A single-argument version is made
-- at the request of the development team rather than the three-argument
-- version of the documetation. The caller specifies only the parse mode.
-- Process options list using current options info.
procedure plparseopts(Mode : Parse_Mode_Type) is
Gnat_Argc : aliased Integer;
pragma Import (C, Gnat_Argc);
Gnat_Argv : System.Address;
pragma Import (C, Gnat_Argv);
type Gnat_Argc_Access_Type is access all Integer;
Gnat_Argc_Access : Gnat_Argc_Access_Type;
procedure
plparseopts_local(argc : Gnat_Argc_Access_Type;
argv : System.Address;
mode : Parse_Mode_Type);
pragma Import(C, plparseopts_local, "c_plparseopts");
begin
Gnat_Argc_Access := Gnat_Argc'access;
plparseopts_local(Gnat_Argc_Access, Gnat_Argv, Mode);
end plparseopts;
-- This is a three-argument version of plparseopts as indicated in the
-- documentation.
-- Process options list using current options info.
procedure plparseopts
(Gnat_Argc : Integer;
Gnat_Argv : System.Address;
Mode : Parse_Mode_Type) is
Gnat_Argc_Dummy : aliased Integer;
type Gnat_Argc_Access_Type is access all Integer;
Gnat_Argc_Access : Gnat_Argc_Access_Type;
procedure
plparseopts_local(argc : Gnat_Argc_Access_Type;
argv : System.Address;
mode : Parse_Mode_Type);
pragma Import(C, plparseopts_local, "c_plparseopts");
begin
Gnat_Argc_Dummy := Gnat_Argc;
Gnat_Argc_Access := Gnat_Argc_Dummy'access;
plparseopts_local(Gnat_Argc_Access, Gnat_Argv, Mode);
end plparseopts;
-- Transformation routines
-- pltr0, pltr1, and pltr2 had to be re-written in Ada in order to make the
-- callback work while also passing the data structure along, e.g.
-- pltr_data in the formal names below. The machinery surroundinging this idea
-- also allows for user-defined plot transformation subprograms to be easily
-- written.
-- Identity transformation. Re-write of pltr0 in plcont.c in Ada.
procedure pltr0
(x, y : PLFLT;
tx, ty : out PLFLT;
pltr_data : PLplot_thin.PL_Pointer) is
begin
tx := x;
ty := y;
end pltr0;
-- Re-write of pltr1 in Ada.
procedure pltr1
(x, y : PLFLT;
tx, ty : out PLFLT;
pltr_data : PLplot_thin.PL_Pointer)
is
ul, ur, vl, vr : PLINT;
du, dv : PLFLT;
xl, xr, yl, yr : PLFLT;
nx, ny : PLINT;
-- Tell the program what structure the data beginning at pltr_data has.
package Transformation_Data_Type_Address_Conversions is new System.Address_To_Access_Conversions(Transformation_Data_Type);
Transformation_Data_Pointer : Transformation_Data_Type_Address_Conversions.Object_Pointer;
begin
Transformation_Data_Pointer := Transformation_Data_Type_Address_Conversions.To_Pointer(pltr_data);
nx := Transformation_Data_Pointer.nx;
ny := Transformation_Data_Pointer.ny;
-- Ada converts floats to integers by rounding while C does so by
-- truncation. There is no fool-proof way to fix that. Here, we simply
-- subtract 0.499999999999999 before doing the conversion. Subtracting
-- 0.5 results in index constraint errors being raised.
ul := Integer(x - 0.499999999999999);
ur := ul + 1;
du := x - Long_Float(ul);
vl := Integer(y - 0.499999999999999);
vr := vl + 1;
dv := y - Long_Float(vl);
if x < 0.0 or x > Long_Float(nx - 1) or y < 0.0 or y > Long_Float(ny - 1) then
-- Mimic (badly, probably) plexit. Don't call plend and don't abort.
-- This might be better if an exception is declared where plcont is called
-- to prevent multiple calls to this while trying to make a sinlge plot.
tx := 0.0; -- These shouldn't be used.
ty := 0.0; -- Only set them to prevent compiler warning.
Put_Line("*** PLPLOT ERROR, IMMEDIATE EXIT ***");
Put_Line("pltr1: Invalid coordinates");
return; -- Return to caller instead of aborting like plexit.
end if;
xl := Transformation_Data_Pointer.xg(ul);
yl := Transformation_Data_Pointer.yg(vl);
if ur = Transformation_Data_Pointer.nx then
tx := xl;
else
xr := Transformation_Data_Pointer.xg(ur);
tx := xl * (1.0 - du) + xr * du;
end if;
if vr = Transformation_Data_Pointer.ny then
ty := yl;
else
yr := Transformation_Data_Pointer.yg(vr);
ty := yl * (1.0 - dv) + yr * dv;
end if;
end pltr1;
-- Re-write of pltr2 in Ada.
-- Does linear interpolation from doubly dimensioned coord arrays
-- (column dominant, as per normal C 2d arrays).
procedure pltr2
(x, y : PLFLT;
tx, ty : out PLFLT;
pltr_data : PLplot_thin.PL_Pointer)
is
ul, ur, vl, vr : Integer;
du, dv : PLFLT;
xll, xlr, xrl, xrr : PLFLT;
yll, ylr, yrl, yrr : PLFLT;
xmin, xmax, ymin, ymax : PLFLT;
package Transformation_Data_Type_2_Address_Conversions is new System.Address_To_Access_Conversions(Transformation_Data_Type_2);
TD : Transformation_Data_Type_2_Address_Conversions.Object_Pointer;
begin
TD := Transformation_Data_Type_2_Address_Conversions.To_Pointer(pltr_data);
-- Ada converts floats to integers by rounding while C does so, dangerously, by
-- truncation. There is no fool-proof way to fix that. Here, we simply
-- subtract 0.499999999999999 before doing the conversion. Subtracting
-- 0.5 results in index constraint errors being raised.
ul := Integer(x - 0.499999999999999);
ur := ul + 1;
du := x - Long_Float(ul);
vl := Integer(y - 0.499999999999999);
vr := vl + 1;
dv := y - Long_Float(vl);
xmin := 0.0;
xmax := Long_Float(TD.nx - 1);
ymin := 0.0;
ymax := Long_Float(TD.ny - 1);
if x < xmin or x > xmax or y < ymin or y > ymax then
Put_Line("*** PLPLOT WARNING ***");
Put_Line("pltr2: Invalid coordinates");
if x < xmin then
if y < ymin then
tx := TD.xg(0, 0);
ty := TD.yg(0, 0);
elsif y > ymax then
tx := TD.xg(0, TD.ny - 1);
ty := TD.yg(0, TD.ny - 1);
else
xll := TD.xg(0, vl);
yll := TD.yg(0, vl);
xlr := TD.xg(0, vr);
ylr := TD.yg(0, vr);
tx := xll * (1.0 - dv) + xlr * dv;
ty := yll * (1.0 - dv) + ylr * dv;
end if;
elsif x > xmax then
if y < ymin then
tx := TD.xg(TD.nx - 1, 0);
ty := TD.yg(TD.nx - 1, 0);
elsif y > ymax then
tx := TD.xg(TD.nx - 1, TD.ny - 1);
ty := TD.yg(TD.nx - 1, TD.ny - 1);
else
xll := TD.xg(TD.nx - 1, vl);
yll := TD.yg(TD.nx - 1, vl);
xlr := TD.xg(TD.nx - 1, vr);
ylr := TD.yg(TD.nx - 1, vr);
tx := xll * (1.0 - dv) + xlr * dv;
ty := yll * (1.0 - dv) + ylr * dv;
end if;
else
if y < ymin then
xll := TD.xg(ul, 0);
xrl := TD.xg(ur, 0);
yll := TD.yg(ul, 0);
yrl := TD.yg(ur, 0);
tx := xll * (1.0 - du) + xrl * du;
ty := yll * (1.0 - du) + yrl * du;
elsif y > ymax then
xlr := TD.xg(ul, TD.ny - 1);
xrr := TD.xg(ur, TD.ny - 1);
ylr := TD.yg(ul, TD.ny - 1);
yrr := TD.yg(ur, TD.ny - 1);
tx := xlr * (1.0 - du) + xrr * du;
ty := ylr * (1.0 - du) + yrr * du;
end if;
end if;
-- Normal case.
-- Look up coordinates in row-dominant array.
-- Have to handle right boundary specially -- if at the edge, we'd
-- better not reference the out of bounds point.
else
xll := TD.xg(ul, vl);
yll := TD.yg(ul, vl);
-- ur is out of bounds
if ur = TD.nx and vr < TD.ny then
xlr := TD.xg(ul, vr);
ylr := TD.yg(ul, vr);
tx := xll * (1.0 - dv) + xlr * dv;
ty := yll * (1.0 - dv) + ylr * dv;
-- vr is out of bounds
elsif ur < TD.nx and vr = TD.ny then
xrl := TD.xg(ur, vl);
yrl := TD.yg(ur, vl);
tx := xll * (1.0 - du) + xrl * du;
ty := yll * (1.0 - du) + yrl * du;
-- both ur and vr are out of bounds
elsif ur = TD.nx and vr = TD.ny then
tx := xll;
ty := yll;
-- everything in bounds
else
xrl := TD.xg(ur, vl);
xlr := TD.xg(ul, vr);
xrr := TD.xg(ur, vr);
yrl := TD.yg(ur, vl);
ylr := TD.yg(ul, vr);
yrr := TD.yg(ur, vr);
tx := xll * (1.0 - du) * (1.0 - dv) + xlr * (1.0 - du) * dv +
xrl * du * (1.0 - dv) + xrr * du * dv;
ty := yll * (1.0 - du) * (1.0 - dv) + ylr * (1.0 - du) * dv +
yrl * du * (1.0 - dv) + yrr * du * dv;
end if;
end if;
end pltr2;
end PLplot_Thin;

2132
src/3rdparty/plplot/bindings/ada/plplot_thin.ads vendored Executable file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,50 @@
# bindings/c++/CMakeLists.txt
# Copyright (C) 2006 Andrew Ross
# Copyright (C) 2015-2019 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; 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 PLplot; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
if(ENABLE_cxx)
set(plplotcxx_LIB_SRCS
plstream.cc
)
set(plplotcxx_INSTALLED_HEADERS
plstream.h
)
# Set the include path
include_directories(
${PROJECT_SOURCE_DIR}/include
${PROJECT_BINARY_DIR}
${PROJECT_BINARY_DIR}/include
)
# plplotcxx depends on the plplot library.
set(LIB_INSTALL_RPATH ${LIB_DIR})
configure_library_build(plplotcxx "" "${plplotcxx_LIB_SRCS}" PLPLOT::plplot "${LIB_INSTALL_RPATH}")
install(FILES
${plplotcxx_INSTALLED_HEADERS}
DESTINATION ${INCLUDE_DIR}
)
# Configure pkg-config *.pc file corresponding to libplplotcxx
pkg_config_file("c++" "C++" " C++ binding" "plplotcxx" "" "-lplplot")
endif(ENABLE_cxx)

2797
src/3rdparty/plplot/bindings/c++/plstream.cc vendored Executable file

File diff suppressed because it is too large Load Diff

1286
src/3rdparty/plplot/bindings/c++/plstream.h vendored Executable file

File diff suppressed because it is too large Load Diff

43
src/3rdparty/plplot/bindings/d/CMakeLists.txt vendored Executable file
View File

@ -0,0 +1,43 @@
# bindings/d/CMakeLists.txt
# Copyright (C) 2008 Werner Smekal
# Copyright (C) 2015-2019 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; 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 PLplot; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
if(ENABLE_d)
set(d_interface_INSTALLED_HEADERS plplot.d )
install(FILES ${d_interface_INSTALLED_HEADERS}
DESTINATION ${INCLUDE_DIR}
)
# Build d bindings
set(plplotdmd_LIB_SRCS
plplot.d
)
# plplotdmd depends on the plplot library.
set(LIB_INSTALL_RPATH ${LIB_DIR})
if(plplotdmd_SHARED)
configure_library_build(plplotdmd "" "${plplotdmd_LIB_SRCS}" PLPLOT::plplot "${LIB_INSTALL_RPATH}")
else(plplotdmd_SHARED)
configure_library_build(plplotdmd STATIC "${plplotdmd_LIB_SRCS}" PLPLOT::plplot "${LIB_INSTALL_RPATH}")
endif(plplotdmd_SHARED)
# Configure pkg-config *.pc file corresponding to libplplotdmd
pkg_config_file("d" "D" " D binding" "plplotdmd" "" "-lplplot")
endif(ENABLE_d)

42
src/3rdparty/plplot/bindings/d/README.txt vendored Executable file
View File

@ -0,0 +1,42 @@
Instructions to create the plplot module
========================================
* Download the D compiler (version 1.028) from http://www.digitalmars.com/d/download.html
* Download the digitalmars C/C++ compiler from http://www.digitalmars.com/download/freecompiler.html
* Unzip them and set the PATH variable accordingly
* Download the htod tool from http://www.digitalmars.com/d/2.0/htod.html and put it in the dm/bin directory
* cd into the plplot/include directory
* edit the plplot.h file:
- remove the first 136 lines
- add
#define PLDLLIMPEXP
#define PLDLLIMPEXP_DATA(type) type
before the rest of the header file
- remove the plgfile(FILE **p_file); and plsfile(FILE *file); declarations (around line 1600)
* run "htod plplot.h plplot.d -hc -DDOUBLE"
* remove
alias DBL_MAX PLFLT_MAX;
alias DBL_MIN PLFLT_MIN;
from the plplot.d file (right at the top).
* needed to add the following lines at about line 880, since they were not converted
const DRAW_LINEX=1<<0; /* draw lines parallel to the X axis */
const DRAW_LINEY=1<<1; /* draw lines parallel to the Y axis */
const DRAW_LINEXY=DRAW_LINEX|DRAW_LINEY; /* draw lines parallel to both the X and Y axis */
const MAG_COLOR=1<<2; /* draw the mesh with a color dependent of the magnitude */
const BASE_CONT=1<<3; /* draw contour plot at bottom xy plane */
const TOP_CONT=1<<4; /* draw contour plot at top xy plane */
const SURF_CONT=1<<5; /* draw contour plot at surface */
const DRAW_SIDES=1<<6; /* draw sides */
const FACETED=1<<7; /* draw outline for each square that makes up the surface */
const MESH=1<<8; /* draw mesh */
Compile examples
================
* Download and install the gdc compiler (only tested with this compiler)
- Linux: http://dgcc.sourceforge.net/
- Ubuntu: sudo apt-get install gdc
- Windows: http://gdcwin.sourceforge.net/ (You need the MinGW compiler 3.4.5 installed as well)
- Mac OS X: http://gdcmac.sourceforge.net/
* cd into the plplot/examples/d directory
* MinGW: gdc x07d.d -I ..\..\bindings\d path_to_build_directory\dll\libplplotd.dll.a -o x07d
* Linux: gdc x06d.d -I../../bindings/d path_to_build_directory/src/libplplotd.so -o x06d

2422
src/3rdparty/plplot/bindings/d/plplot.d vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,191 @@
# bindings/fortran/CMakeLists.txt
# Copyright (C) 2006 Andrew Ross
# Copyright (C) 2006-2019 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; 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 PLplot; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
if(ENABLE_fortran)
if(CMAKE_Fortran_COMPILER MATCHES "gfortran")
message(STATUS
"WARNING concerning spurious warning messages generated by the gfortran compiler.
The new Fortran binding is known to generate some ~50 \"marked
PRIVATE\" warning messages when building the plplotfortran target with the
gfortran Fortran compiler. A typical example of such a warning
message is
Warning: Symbol 'interface_plcont' at (1) is marked PRIVATE but has been given the binding label 'c_plcont'
It appears these warnings (which do not occur if using the ifort or
nagfor Fortran compilers) are due to a gfortran bug (see
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49111> and
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64861>), i.e., they
are spurious warnings concerning completely valid use of the
private attribute for interface blocks describing C routines.
There appear to be no known negative consequences of this gfortran
bug other than the spurious warnings themselves. Until this gfortran
bug is fixed, these ~50 \"marked PRIVATE\" warnings should just be
ignored for those using gfortran."
)
endif(CMAKE_Fortran_COMPILER MATCHES "gfortran")
# Set the include path
include_directories(
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/lib/qsastime
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/include
${CMAKE_BINARY_DIR}/lib/qsastime
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
## Build C part of Fortran bindings
if(WIN32_OR_CYGWIN)
# Set the flags for the C compiler. The C stubs need to have the
# correct case and calling convention for the Fortran compiler
IF(TARGET_FORTRAN MATCHES "IVF")
SET(DEFFILE "_ifort")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /DIVF")
ELSEIF(TARGET_FORTRAN MATCHES "CVF")
SET(DEFFILE "")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /DCVF")
ENDIF(TARGET_FORTRAN MATCHES "IVF")
endif(WIN32_OR_CYGWIN)
# Build fortran part of Fortran bindings.
# Notes:
# The CMake Fortran dependency scanner finds the Fortran include
# files and deals properly with the dependencies on those files.
# Therefore, there is no need to include those files in the SRCS
# list or do anything special with their dependencies.
# Check consistency of included_plplot_parameters.f90.
add_custom_target(
check_fortran_parameters
${CMAKE_COMMAND} -E echo "Check that bindings/fortran/included_plplot_parameters.f90 is consistent with the #defines in bindings/swig-support/plplotcapi.i"
COMMAND ${CMAKE_COMMAND} -E remove -f
${CMAKE_CURRENT_BINARY_DIR}/included_plplot_parameters.f90_compare
COMMAND
sed -f ${CMAKE_CURRENT_SOURCE_DIR}/global_defines.sed <
${CMAKE_SOURCE_DIR}/bindings/swig-support/plplotcapi.i >
${CMAKE_CURRENT_BINARY_DIR}/included_plplot_parameters.f90_compare
COMMAND
cmp ${CMAKE_CURRENT_SOURCE_DIR}/included_plplot_parameters.f90
${CMAKE_CURRENT_BINARY_DIR}/included_plplot_parameters.f90_compare
)
# check_plplotcapi_defines should be done first since
# ${CMAKE_SOURCE_DIR}/bindings/swig-support/plplotcapi.i
# might be changed as a result of that check.
add_dependencies(check_fortran_parameters check_plplotcapi_defines)
add_dependencies(check_all check_fortran_parameters)
# Check consistency of plplotfortran_ifort.def using Unix commands
# First write header of generated plplotfortran_ifort.def file
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/plplotfortran_ifort.def_header
"; You should not normally edit this generated file. Instead, check its consistency
; with the symbols in the plplotfortran library using the
; (Unix) target \"check_ifort_definitions_file\". If that target reports an
; inconsistency (via a cmp message) between the generated
; plplotfortran_ifort.def_compare file in the build tree and
; plplotfortran_ifort.def in the source tree, then copy that generated
; plplotfortran_ifort.def_compare on top of plplotfortran_ifort.def and
; check in that result.
LIBRARY plplotfortran.dll
EXPORTS
")
# Create a configurable file that contains the bash command to create plplotfortran_ifort.def_compare
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/plplotfortran_ifort.def.sh.in
"nm --defined-only \$<TARGET_FILE:PLPLOT::plplotfortran> |tr '[:lower:]' '[:upper:]' |sed -f ${CMAKE_CURRENT_SOURCE_DIR}/generate_ifort_deffile.sed |sort --key=3 | cat ${CMAKE_CURRENT_BINARY_DIR}/plplotfortran_ifort.def_header - >| ${CMAKE_CURRENT_BINARY_DIR}/plplotfortran_ifort.def_compare
")
# Configure that file (which contains the generator expression, $<TARGET_FILE:PLPLOT::plplotfortran>) :
configure_file_generate(
${CMAKE_CURRENT_BINARY_DIR}/plplotfortran_ifort.def.sh.in
${CMAKE_CURRENT_BINARY_DIR}/plplotfortran_ifort.def.sh
@ONLY
)
add_custom_target(
check_ifort_definitions_file
${CMAKE_COMMAND} -E echo "Check that bindings/fortran/plplotfortran_ifort.def is consistent with the symbols in the plplotfortran library"
COMMAND ${CMAKE_COMMAND} -E remove -f
${CMAKE_CURRENT_BINARY_DIR}/plplotfortran_ifort.def_compare
COMMAND
bash ${CMAKE_CURRENT_BINARY_DIR}/plplotfortran_ifort.def.sh
COMMAND
cmp ${CMAKE_CURRENT_SOURCE_DIR}/plplotfortran_ifort.def
${CMAKE_CURRENT_BINARY_DIR}/plplotfortran_ifort.def_compare
)
add_dependencies(check_ifort_definitions_file PLPLOT::plplotfortran)
add_dependencies(check_all check_ifort_definitions_file)
# Configure the Fortran source file that specifies the
# types used for PLplot.
if(PL_DOUBLE)
set(FORTRAN_EQUIVALENT_PLFLT "c_double")
else(PL_DOUBLE)
set(FORTRAN_EQUIVALENT_PLFLT "c_float")
endif(PL_DOUBLE)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/included_plplot_configured_types.f90.in
${CMAKE_CURRENT_BINARY_DIR}/included_plplot_configured_types.f90
@ONLY
)
set(plplotfortran_LIB_SRCS
plplot.f90
# The "single" and "double" here refer to user's real precision
# rather than the actual PLFLT single or double precision so
# we need to build both of these modules.
plplot_single.f90
plplot_double.f90
# Every other PLplot module depends on these so must be kept
# in a separate file.
plplot_small_modules.f90
)
if(WIN32_AND_NOT_CYGWIN AND BUILD_SHARED_LIBS AND NOT MINGW AND NOT MSYS)
SET(plplotfortran_LIB_SRCS ${plplotfortran_LIB_SRCS} plplotfortran${DEFFILE}.def)
endif(WIN32_AND_NOT_CYGWIN AND BUILD_SHARED_LIBS AND NOT MINGW AND NOT MSYS)
# plplotfortran depends on the plplot library.
set(LIB_INSTALL_RPATH ${LIB_DIR})
configure_library_build(plplotfortran "" "${plplotfortran_LIB_SRCS}" PLPLOT::plplot "${LIB_INSTALL_RPATH}")
# While user programmes should only use the plplot module,
# some compilers (e.g. Intel Fortran, but not gfortran) require access
# to all the modules that the plplot module depends upon.
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/plplot.mod
${CMAKE_CURRENT_BINARY_DIR}/plplot_double.mod
${CMAKE_CURRENT_BINARY_DIR}/plplot_single.mod
${CMAKE_CURRENT_BINARY_DIR}/plplot_private_utilities.mod
${CMAKE_CURRENT_BINARY_DIR}/plplot_graphics.mod
${CMAKE_CURRENT_BINARY_DIR}/plplot_private_exposed.mod
${CMAKE_CURRENT_BINARY_DIR}/plplot_types.mod
DESTINATION ${FORTRAN_MOD_DIR}
)
# Configure pkg-config *.pc file corresponding to libplplotfortran
pkg_config_file("fortran" "Fortran" " Fortran binding" "plplotfortran" "-I\"${FORTRAN_MOD_DIR}\"" "-lplplot" "")
endif(ENABLE_fortran)

View File

@ -0,0 +1,155 @@
This file presents the complete list of rules for arrays sizes that
are enforced in a user-friendly way for the Fortran bindings by
emitting a warning message when these rules are not followed. These
rules were derived from the rules implied for our swig-generated
bindings in bindings/swig-support/plplotcapi.i (i.e., anything to do
with a "Ck" argument such as the Array and ArrayCk arguments).
plbin( x, y, center )
-- x and y must have identical sizes;
plcolorbar(colorbar_width, 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,
label_opts, labels,
axis_opts, ticks, sub_ticks, n_values, values )
-- label_opts and labels must have identical sizes and axis_opts,
ticks, sub_ticks, nvalues, and the first dimension of values must
have identical sizes.
plerrx( xmin, xmax, y )
-- xmin, xmax, and y must have identical sizes;
plerry( x, ymin, ymax )
-- x, ymin, and ymax must have identical sizes;
plfill3( x, y, z )
-- x, y, and z must have identical sizes;
plfill( x, y )
-- x and y must have identical sizes;
plgradient( x, y, angle )
-- x and y must have identical sizes;
plgriddata( x, y, z, xg, yg, zg, type, data )
-- x, y, and z must have identical sizes, and the first dimension of z
must be identical with the size of xg, and the second dimension
of z must be identical with the size of yg;
pllegend( legend_width, legend_height,
opt, position, x, y,
plot_width, bg_color, bb_color, bb_style,
nrow, ncolumn, opt_array,
text_offset, text_scale, text_spacing,
text_justification, text_colors, text,
box_colors, box_patterns, box_scales, box_line_widths,
line_colors, line_styles, line_widths,
symbol_colors, symbol_scales, symbol_numbers, symbols )
-- opt_array, text_colors, text, box_colors, box_patterns, box_scales,
box_line_widths, line_colors, line_styles, line_widths,
symbol_colors, symbol_scales, symbol_numbers and symbols must all
have the same sizes;
plmesh( x, y, z, opt )
-- The size of x must be identical with the size of the first
dimension of z and the size of y must be identical with the size of
the second dimension of z;
plmeshc( x, y, z, opt, clevel )
-- The size of x must be identical with the size of the first
dimension of z and the size of y must be identical with the size of
the second dimension of z;
plot3d( x, y, z, opt, side)
-- The size of x must be identical with the size of the first
dimension of z and the size of y must be identical with the size of
the second dimension of z;
plot3dc( x, y, z, opt, clevel )
-- The size of x must be identical with the size of the first
dimension of z and the size of y must be identical with the size of
the second dimension of z;
plot3dcl( x, y, z, opt, clevel, indexxmin, indexymin, indexymax )
-- The size of x must be identical with the size of the first
dimension of z, the size of y must be identical with the size of
the second dimension of z, and indexymin and indexymax must have
identical sizes;
plpat( inc, del )
-- inc and del must have identical sizes;
plpoin3( x, y, z, code )
-- x, y, and z must have identical sizes;
plpoin( x, y, code )
-- x and y must have identical sizes;
plpoly3( x, y, z, draw, ifcc )
-- x, y, and z must have identical sizes and the size of draw
must be one less than the size of x, y, and z;
plscmap0( r, g, b )
-- r, g, and b must have identical sizes;
plscmap0a( r, g, b, a )
-- r, g, b, and a must have identical sizes;
plscmap1( r, g, b )
-- r, g, and b must have identical sizes;
plscmap1a( r, g, b, a )
-- r, g, b, and a must have identical sizes;
plscmap1la_impl( rgbtype, intensity, coord1, coord2, coord3, alpha, alt_hue_path)
-- intensity, coord1, coord2, coord3, and alpha must have identical
sizes and the size of alt_hue_path must be one less than the size
of intensity, coord1, coord2, coord3, and alpha;
plscmap1l_impl( rgbtype, intensity, coord1, coord2, coord3, alt_hue_path)
-- intensity, coord1, coord2, and coord3 must have identical sizes and
the size of alt_hue_path must be one less than the size of
intensity, coord1, coord2, and coord3;
plstring3( x, y, z, string )
-- x, y, and z must have identical sizes;
plstring( x, y, string )
-- x and y must have identical sizes;
plstripc( id, xspec, yspec, xmin, xmax, xjump, ymin, ymax,
xlpos, ylpos, y_ascl, acc, colbox, collab,
colline, styline, legline, labx, laby, labtop )
-- colline, styline, and legline must all have sizes of 4.
plsurf3d( x, y, z, opt, clevel )
-- The size of x must be identical with the size of the first
dimension of z and the size of y must be identical with the size of
the second dimension of z;
plsurf3dl( x, y, z, opt, clevel, indexxmin, indexymin, indexymax )
-- The size of x must be identical with the size of the first
dimension of z, the size of y must be identical with the size of
the second dimension of z, and indexymin and indexymax must have
identical sizes;
plsvect( arrowx, arrowy, fill )
-- arrowx and arrowy must have identical sizes;
plsym( x, y, code )
-- x and y must have identical sizes;
plvect( u, v, scale )
plvect( u, v, scale, xg1, yg1 )
plvect( u, v, scale, xg2, yg2 )
plvect( u, v, scale, tr )
-- u and v must have identical sizes for their first dimension and identical
sizes for their second dimension, the xg1 size must be identical to the
size of the first dimension of u and v, the yg1 size must be identical
to the size of the second dimension of u and v, and xg2 and yg2 must
have first dimension sizes that are identical to the sizes of the first
dimension of u and v, and second dimension sizes that are identical to the
sizes of the second dimension of u and v.

View File

@ -0,0 +1,23 @@
# sed script specifically designed to parse the output of
# nm --defined-only bindings/fortran/libplplotfortran.so | sort --key=3 | tr '[:lower:]' '[:upper:]'
# to help generate a sorted ifort definition file.
# N.B. note the last stanza of that pipeline which
# converts everything to upper case. That upper-case
# result is assumed below.
# Header comments, LIBRARY, and EXPORTS lines
# are generated independently by cmake.
# Drop every line that does not refer to a module symbol
/^.*__PLPLOT.*_MOD_/! d
# Drop additional specific lines
/^.*PLPLOT_PRIVATE_UTILITIES/ d
/^.*MATRIX_TO_C/ d
/^.*MOD___/ d
# Parse module symbols into form required by ifort .def file
s?.*__PLPLOT_DOUBLE_MOD_?PLPLOT_DOUBLE_mp_?
s?.*__PLPLOT_GRAPHICS_MOD_?PLPLOT_GRAPHICS_mp_?
s?.*__PLPLOT_SINGLE_MOD_?PLPLOT_SINGLE_mp_?
s?.*__PLPLOT_MOD_?PLPLOT_mp_?

View File

@ -0,0 +1,78 @@
# sed script specifically designed to parse the #define statements in
# bindings/swig-support/plplotcapi.i into a file that can be used for
# global variable definitions for fortran.
# Insert text at the start:
1 i\
! Do not edit this generated file. Instead, check its consistency\
! with the #defines in bindings/swig-support/plplotcapi.i using the\
! (Unix) target "check_fortran_parameters". If that target reports an\
! inconsistency (via a cmp message) between the generated\
! plplot_parameters.inc_compare file in the build tree and\
! plplot_parameters.inc in the source tree, then copy\
! plplot_parameters.inc_compare on top of plplot_parameters.inc and\
! check in that result.\
# Drop every line that is not a #define
/^#define/! d
# Drop specific #defines from the file that are not available
# because of specific #if statements.
/OBJECT_DATA/ d
/^#define pltr_img/ d
# Translate trailing comment identifier into Fortran trailing comment.
/^#define/ s?//?!?
# Transform octal constants to Fortran (BOZ) form.
/^#define/ s? 0\([0-9][0-9]*\)? o'\1'?
# Transform hexadecimal constants to Fortran (BOZ) form.
/^#define/ s? 0[xX]\([0-9a-fA-F][0-9a-fA-F]*\)? z'\1'?
# Handle special case of z'80000000' which generates integer overflow
# for gfortran (and probably other Fortran compilers).
/^#define/ s? z'80000000'? ishft(1,31)?
# Parse what is left while preserving trailing comments. Watch out
# for parentheses around value as well.
# Treat PL_NOTSET as a floating value and append special parameter lines for
# PL_PI and PL_TWOPI in this case as well.
/^#define/ s?^#define *\(PL_NOTSET\)[ (]*\([^ ]*\)[ )]*\(.*\)$? real(kind=private_double), parameter :: \1 = \2.0_private_double\3\n real(kind=private_double), parameter :: PL_PI = 3.1415926535897932384_private_double\n real(kind=private_double), parameter :: PL_TWOPI = 2.0_private_double*PL_PI?
# Replace all hexadecimal BOZ constants by their decimal equivalents to maintain
# standards compliance rather than relying on an extension from the
# Fortran standards which allows BOZ constants in this context.
# (This extension is likely implemented by each different Fortran
# compiler, but you can never be sure.)
/^#define/ s?z'0*\([0-9]\)'?\1?
/^#define/ s?z'0*f'?15?
/^#define/ s?z'0*\([0-9]\)0'?\1*16?
/^#define/ s?z'0*\([0-9]\)00'?\1*16*16?
/^#define/ s?z'0*\([0-9]\)000'?\1*16*16*16?
/^#define/ s?z'0*\([0-9]\)0000'?\1*16*16*16*16?
# This last one is one more than we currently need.
/^#define/ s?z'0*\([0-9]\)00000'?\1*16*16*16*16*16?
# Note we could do the same transformation for octal BOZ constants, but we
# don't have any at present.
# Comment the following line so that we do not use a special form for BOZ constants.
#/^#define/ s?^#define *\([^ ]*\)[ (]*\([oz][^ ]*\)[ )]*\(.*\)$? integer :: \1 \3\n data \1 / \2 /?
# Look for pattern
# ^#define
# <blanks>
# <anything but blanks> = \1
# <blanks or left parentheses>
# <anything but blanks> = \2
# <blanks or right parentheses>
# <! followed by anything to EOL>
/^#define/ s?^#define *\([^ ]*\)[ (]*\([^ ]*\)[ )]*\(!.*\)$? integer, parameter :: \1 = \2 \3?
# Look for pattern
# ^#define
# <blanks>
# <anything but blanks> = \1
# <blanks or left parentheses>
# <anything but blanks> = \2
# <zero or more blanks to EOL>
/^#define/ s?^#define *\([^ ]*\)[ (]*\([^ ]*\)*$? integer, parameter :: \1 = \2?

View File

@ -0,0 +1,6 @@
! Specify configured Fortran types (currently only private_plflt) to
! be used by the fortran binding.
! Configured by CMake depending on the floating-point precision
! adopted for the core C PLplot library.
integer, parameter :: private_plflt = @FORTRAN_EQUIVALENT_PLFLT@

View File

@ -0,0 +1,196 @@
! Do not edit this generated file. Instead, check its consistency
! with the #defines in bindings/swig-support/plplotcapi.i using the
! (Unix) target "check_fortran_parameters". If that target reports an
! inconsistency (via a cmp message) between the generated
! plplot_parameters.inc_compare file in the build tree and
! plplot_parameters.inc in the source tree, then copy
! plplot_parameters.inc_compare on top of plplot_parameters.inc and
! check in that result.
integer, parameter :: PLESC_SET_RGB = 1 ! obsolete
integer, parameter :: PLESC_ALLOC_NCOL = 2 ! obsolete
integer, parameter :: PLESC_SET_LPB = 3 ! obsolete
integer, parameter :: PLESC_EXPOSE = 4 ! handle window expose
integer, parameter :: PLESC_RESIZE = 5 ! handle window resize
integer, parameter :: PLESC_REDRAW = 6 ! handle window redraw
integer, parameter :: PLESC_TEXT = 7 ! switch to text screen
integer, parameter :: PLESC_GRAPH = 8 ! switch to graphics screen
integer, parameter :: PLESC_FILL = 9 ! fill polygon
integer, parameter :: PLESC_DI = 10 ! handle DI command
integer, parameter :: PLESC_FLUSH = 11 ! flush output
integer, parameter :: PLESC_EH = 12 ! handle Window events
integer, parameter :: PLESC_GETC = 13 ! get cursor position
integer, parameter :: PLESC_SWIN = 14 ! set window parameters
integer, parameter :: PLESC_DOUBLEBUFFERING = 15 ! configure double buffering
integer, parameter :: PLESC_XORMOD = 16 ! set xor mode
integer, parameter :: PLESC_SET_COMPRESSION = 17 ! AFR: set compression
integer, parameter :: PLESC_CLEAR = 18 ! RL: clear graphics region
integer, parameter :: PLESC_DASH = 19 ! RL: draw dashed line
integer, parameter :: PLESC_HAS_TEXT = 20 ! driver draws text
integer, parameter :: PLESC_IMAGE = 21 ! handle image
integer, parameter :: PLESC_IMAGEOPS = 22 ! plimage related operations
integer, parameter :: PLESC_PL2DEVCOL = 23 ! convert PLColor to device color
integer, parameter :: PLESC_DEV2PLCOL = 24 ! convert device color to PLColor
integer, parameter :: PLESC_SETBGFG = 25 ! set BG, FG colors
integer, parameter :: PLESC_DEVINIT = 26 ! alternate device initialization
integer, parameter :: PLESC_GETBACKEND = 27 ! get used backend of (wxWidgets) driver - no longer used
integer, parameter :: PLESC_BEGIN_TEXT = 28 ! get ready to draw a line of text
integer, parameter :: PLESC_TEXT_CHAR = 29 ! render a character of text
integer, parameter :: PLESC_CONTROL_CHAR = 30 ! handle a text control character (super/subscript, etc.)
integer, parameter :: PLESC_END_TEXT = 31 ! finish a drawing a line of text
integer, parameter :: PLESC_START_RASTERIZE = 32 ! start rasterized rendering
integer, parameter :: PLESC_END_RASTERIZE = 33 ! end rasterized rendering
integer, parameter :: PLESC_ARC = 34 ! render an arc
integer, parameter :: PLESC_GRADIENT = 35 ! render a gradient
integer, parameter :: PLESC_MODESET = 36 ! set drawing mode
integer, parameter :: PLESC_MODEGET = 37 ! get drawing mode
integer, parameter :: PLESC_FIXASPECT = 38 ! set or unset fixing the aspect ratio of the plot
integer, parameter :: PLESC_IMPORT_BUFFER = 39 ! set the contents of the buffer to a specified byte string
integer, parameter :: PLESC_APPEND_BUFFER = 40 ! append the given byte string to the buffer
integer, parameter :: PLESC_FLUSH_REMAINING_BUFFER = 41 ! flush the remaining buffer e.g. after new data was appended
integer, parameter :: PLTEXT_FONTCHANGE = 0 ! font change in the text stream
integer, parameter :: PLTEXT_SUPERSCRIPT = 1 ! superscript in the text stream
integer, parameter :: PLTEXT_SUBSCRIPT = 2 ! subscript in the text stream
integer, parameter :: PLTEXT_BACKCHAR = 3 ! back-char in the text stream
integer, parameter :: PLTEXT_OVERLINE = 4 ! toggle overline in the text stream
integer, parameter :: PLTEXT_UNDERLINE = 5 ! toggle underline in the text stream
integer, parameter :: ZEROW2B = 1
integer, parameter :: ZEROW2D = 2
integer, parameter :: ONEW2B = 3
integer, parameter :: ONEW2D = 4
integer, parameter :: PLSWIN_DEVICE = 1 ! device coordinates
integer, parameter :: PLSWIN_WORLD = 2 ! world coordinates
integer, parameter :: PL_X_AXIS = 1 ! The x-axis
integer, parameter :: PL_Y_AXIS = 2 ! The y-axis
integer, parameter :: PL_Z_AXIS = 3 ! The z-axis
integer, parameter :: PL_OPT_ENABLED = 1 ! Obsolete
integer, parameter :: PL_OPT_ARG = 2 ! Option has an argument
integer, parameter :: PL_OPT_NODELETE = 4 ! Don't delete after processing
integer, parameter :: PL_OPT_INVISIBLE = 8 ! Make invisible
integer, parameter :: PL_OPT_DISABLED = 1*16 ! Processing is disabled
integer, parameter :: PL_OPT_FUNC = 1*16*16 ! Call handler function
integer, parameter :: PL_OPT_BOOL = 2*16*16 ! Set *var = 1
integer, parameter :: PL_OPT_INT = 4*16*16 ! Set *var = atoi(optarg)
integer, parameter :: PL_OPT_FLOAT = 8*16*16 ! Set *var = atof(optarg)
integer, parameter :: PL_OPT_STRING = 1*16*16*16 ! Set var = optarg
integer, parameter :: PL_PARSE_PARTIAL = 0 ! For backward compatibility
integer, parameter :: PL_PARSE_FULL = 1 ! Process fully & exit if error
integer, parameter :: PL_PARSE_QUIET = 2 ! Don't issue messages
integer, parameter :: PL_PARSE_NODELETE = 4 ! Don't delete options after
integer, parameter :: PL_PARSE_SHOWALL = 8 ! Show invisible options
integer, parameter :: PL_PARSE_OVERRIDE = 1*16 ! Obsolete
integer, parameter :: PL_PARSE_NOPROGRAM = 2*16 ! Program name NOT in *argv[0]..
integer, parameter :: PL_PARSE_NODASH = 4*16 ! Set if leading dash NOT required
integer, parameter :: PL_PARSE_SKIP = 8*16 ! Skip over unrecognized args
integer, parameter :: PL_FCI_MARK = ishft(1,31)
integer, parameter :: PL_FCI_IMPOSSIBLE = 0
integer, parameter :: PL_FCI_HEXDIGIT_MASK = 15
integer, parameter :: PL_FCI_HEXPOWER_MASK = 7
integer, parameter :: PL_FCI_HEXPOWER_IMPOSSIBLE = 15
integer, parameter :: PL_FCI_FAMILY = 0
integer, parameter :: PL_FCI_STYLE = 1
integer, parameter :: PL_FCI_WEIGHT = 2
integer, parameter :: PL_FCI_SANS = 0
integer, parameter :: PL_FCI_SERIF = 1
integer, parameter :: PL_FCI_MONO = 2
integer, parameter :: PL_FCI_SCRIPT = 3
integer, parameter :: PL_FCI_SYMBOL = 4
integer, parameter :: PL_FCI_UPRIGHT = 0
integer, parameter :: PL_FCI_ITALIC = 1
integer, parameter :: PL_FCI_OBLIQUE = 2
integer, parameter :: PL_FCI_MEDIUM = 0
integer, parameter :: PL_FCI_BOLD = 1
integer, parameter :: PL_MAXKEY = 16
integer, parameter :: PL_MASK_SHIFT = 1 ! ( 1 << 0 )
integer, parameter :: PL_MASK_CAPS = 2 ! ( 1 << 1 )
integer, parameter :: PL_MASK_CONTROL = 4 ! ( 1 << 2 )
integer, parameter :: PL_MASK_ALT = 8 ! ( 1 << 3 )
integer, parameter :: PL_MASK_NUM = 1*16 ! ( 1 << 4 )
integer, parameter :: PL_MASK_ALTGR = 2*16 ! ( 1 << 5 )
integer, parameter :: PL_MASK_WIN = 4*16 ! ( 1 << 6 )
integer, parameter :: PL_MASK_SCROLL = 8*16 ! ( 1 << 7 )
integer, parameter :: PL_MASK_BUTTON1 = 1*16*16 ! ( 1 << 8 )
integer, parameter :: PL_MASK_BUTTON2 = 2*16*16 ! ( 1 << 9 )
integer, parameter :: PL_MASK_BUTTON3 = 4*16*16 ! ( 1 << 10 )
integer, parameter :: PL_MASK_BUTTON4 = 8*16*16 ! ( 1 << 11 )
integer, parameter :: PL_MASK_BUTTON5 = 1*16*16*16 ! ( 1 << 12 )
integer, parameter :: PL_MAXWINDOWS = 64 ! Max number of windows/page tracked
real(kind=private_double), parameter :: PL_NOTSET = -42.0_private_double
real(kind=private_double), parameter :: PL_PI = 3.1415926535897932384_private_double
real(kind=private_double), parameter :: PL_TWOPI = 2.0_private_double*PL_PI
integer, parameter :: PL_DEFAULT_NCOL0 = 16
integer, parameter :: PL_DEFAULT_NCOL1 = 128
integer, parameter :: MIN_PLINT_RGB = 0
integer, parameter :: MAX_PLINT_RGB = 255
integer, parameter :: MIN_PLFLT_CMAP1 = 0.
integer, parameter :: MAX_PLFLT_CMAP1 = 1.
integer, parameter :: MIN_PLFLT_ALPHA = 0.
integer, parameter :: MAX_PLFLT_ALPHA = 1.
integer, parameter :: PLESC_DOUBLEBUFFERING_ENABLE = 1
integer, parameter :: PLESC_DOUBLEBUFFERING_DISABLE = 2
integer, parameter :: PLESC_DOUBLEBUFFERING_QUERY = 3
integer, parameter :: PL_BIN_DEFAULT = 0
integer, parameter :: PL_BIN_CENTRED = 1
integer, parameter :: PL_BIN_NOEXPAND = 2
integer, parameter :: PL_BIN_NOEMPTY = 4
integer, parameter :: GRID_CSA = 1 ! Bivariate Cubic Spline approximation
integer, parameter :: GRID_DTLI = 2 ! Delaunay Triangulation Linear Interpolation
integer, parameter :: GRID_NNI = 3 ! Natural Neighbors Interpolation
integer, parameter :: GRID_NNIDW = 4 ! Nearest Neighbors Inverse Distance Weighted
integer, parameter :: GRID_NNLI = 5 ! Nearest Neighbors Linear Interpolation
integer, parameter :: GRID_NNAIDW = 6 ! Nearest Neighbors Around Inverse Distance Weighted
integer, parameter :: PL_HIST_DEFAULT = 0
integer, parameter :: PL_HIST_NOSCALING = 1
integer, parameter :: PL_HIST_IGNORE_OUTLIERS = 2
integer, parameter :: PL_HIST_NOEXPAND = 8
integer, parameter :: PL_HIST_NOEMPTY = 1*16
integer, parameter :: PL_POSITION_NULL = 0
integer, parameter :: PL_POSITION_LEFT = 1
integer, parameter :: PL_POSITION_RIGHT = 2
integer, parameter :: PL_POSITION_TOP = 4
integer, parameter :: PL_POSITION_BOTTOM = 8
integer, parameter :: PL_POSITION_INSIDE = 1*16
integer, parameter :: PL_POSITION_OUTSIDE = 2*16
integer, parameter :: PL_POSITION_VIEWPORT = 4*16
integer, parameter :: PL_POSITION_SUBPAGE = 8*16
integer, parameter :: PL_LEGEND_NULL = 0
integer, parameter :: PL_LEGEND_NONE = 1
integer, parameter :: PL_LEGEND_COLOR_BOX = 2
integer, parameter :: PL_LEGEND_LINE = 4
integer, parameter :: PL_LEGEND_SYMBOL = 8
integer, parameter :: PL_LEGEND_TEXT_LEFT = 1*16
integer, parameter :: PL_LEGEND_BACKGROUND = 2*16
integer, parameter :: PL_LEGEND_BOUNDING_BOX = 4*16
integer, parameter :: PL_LEGEND_ROW_MAJOR = 8*16
integer, parameter :: PL_COLORBAR_NULL = 0
integer, parameter :: PL_COLORBAR_LABEL_LEFT = 1
integer, parameter :: PL_COLORBAR_LABEL_RIGHT = 2
integer, parameter :: PL_COLORBAR_LABEL_TOP = 4
integer, parameter :: PL_COLORBAR_LABEL_BOTTOM = 8
integer, parameter :: PL_COLORBAR_IMAGE = 1*16
integer, parameter :: PL_COLORBAR_SHADE = 2*16
integer, parameter :: PL_COLORBAR_GRADIENT = 4*16
integer, parameter :: PL_COLORBAR_CAP_NONE = 8*16
integer, parameter :: PL_COLORBAR_CAP_LOW = 1*16*16
integer, parameter :: PL_COLORBAR_CAP_HIGH = 2*16*16
integer, parameter :: PL_COLORBAR_SHADE_LABEL = 4*16*16
integer, parameter :: PL_COLORBAR_ORIENT_RIGHT = 8*16*16
integer, parameter :: PL_COLORBAR_ORIENT_TOP = 1*16*16*16
integer, parameter :: PL_COLORBAR_ORIENT_LEFT = 2*16*16*16
integer, parameter :: PL_COLORBAR_ORIENT_BOTTOM = 4*16*16*16
integer, parameter :: PL_COLORBAR_BACKGROUND = 8*16*16*16
integer, parameter :: PL_COLORBAR_BOUNDING_BOX = 1*16*16*16*16
integer, parameter :: PL_DRAWMODE_UNKNOWN = 0
integer, parameter :: PL_DRAWMODE_DEFAULT = 1
integer, parameter :: PL_DRAWMODE_REPLACE = 2
integer, parameter :: PL_DRAWMODE_XOR = 4
integer, parameter :: DRAW_LINEX = 1 ! draw lines parallel to the X axis
integer, parameter :: DRAW_LINEY = 2 ! draw lines parallel to the Y axis
integer, parameter :: DRAW_LINEXY = 3 ! draw lines parallel to both the X and Y axis
integer, parameter :: MAG_COLOR = 4 ! draw the mesh with a color dependent of the magnitude
integer, parameter :: BASE_CONT = 8 ! draw contour plot at bottom xy plane
integer, parameter :: TOP_CONT = 1*16 ! draw contour plot at top xy plane
integer, parameter :: SURF_CONT = 2*16 ! draw contour plot at surface
integer, parameter :: DRAW_SIDES = 4*16 ! draw sides
integer, parameter :: FACETED = 8*16 ! draw outline for each square that makes up the surface
integer, parameter :: MESH = 1*16*16 ! draw mesh

File diff suppressed because it is too large Load Diff

1776
src/3rdparty/plplot/bindings/fortran/plplot.f90 vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,268 @@
!***********************************************************************
! plplot_double.f90
!
! Copyright (C) 2005-2016 Arjen Markus
! Copyright (C) 2006-2016 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
!
!
!***********************************************************************
module plplot_double
use iso_c_binding, only: c_ptr, c_char, c_null_char, c_null_ptr, c_loc, c_funptr, c_null_funptr, c_funloc, c_associated
use iso_fortran_env, only: error_unit
use plplot_types, only: private_plflt, private_plint, private_plbool, private_double, PLcGrid, PLfGrid
use plplot_private_exposed
use plplot_private_utilities, only: character_array_to_c
implicit none
integer, parameter :: wp = private_double
private :: c_ptr, c_char, c_null_char, c_null_ptr, c_loc, c_funptr, c_null_funptr, c_funloc
private :: error_unit
private :: private_plflt, private_plint, private_plbool, private_double, PLcGrid, PLfGrid
private :: character_array_to_c
private :: wp
! Private interfaces for wp-precision callbacks
private :: plmapformf2c, pllabelerf2c, pllabelerf2c_data, pltransformf2c, pltransformf2c_data
! Normally interface blocks describing the C routines that are
! called by this Fortran binding are embedded as part of module
! procedures, but when more than one module procedure uses such
! interface blocks there is a requirement (enforced at least by
! the nagfor compiler) that those interface blocks be consistent.
! We could comply with that requirement by embedding such multiply
! used interface blocks as part of module procedures using
! duplicated code, but that is inefficient (in terms of the number
! of lines of code to be compiled) and implies a maintenance issue
! (to keep that code duplicated whenever there are changes on the
! C side). To deal with those two potential issues we collect
! here in alphabetical order all interface blocks describing C
! routines that are called directly by more than one module
! procedure.
interface
subroutine interface_plslabelfunc( proc, data ) bind(c, name = 'c_plslabelfunc' )
import :: c_funptr, c_ptr
type(c_funptr), value, intent(in) :: proc
type(c_ptr), value, intent(in) :: data
end subroutine interface_plslabelfunc
end interface
private :: interface_plslabelfunc
interface
subroutine interface_plstransform( proc, data ) bind(c, name = 'c_plstransform' )
import :: c_funptr, c_ptr
type(c_funptr), value, intent(in) :: proc
type(c_ptr), value, intent(in) :: data
end subroutine interface_plstransform
end interface
private :: interface_plstransform
! Routines that have floating-point attributes that nevertheless
! cannot be disambiguated so we only provide them for the
! double-precision case (rather than using a separate naming
! convention for these routines or some other complexity for users
! to distinguish the double- and single-precision cases).
interface plrandd
! Only provide double-precison version because of
! disambiguation problems with the corresponding
! single-precision versions.
module procedure plrandd_impl
end interface plrandd
private :: plrandd_impl
interface plslabelfunc
! Only provide double-precison versions because of
! disambiguation problems with the corresponding
! single-precision versions.
module procedure plslabelfunc_impl_data
module procedure plslabelfunc_impl
module procedure plslabelfunc_impl_null
end interface plslabelfunc
private :: plslabelfunc_impl_data
private :: plslabelfunc_impl
private :: plslabelfunc_impl_null
interface plstransform
! Only provide double-precison versions because of
! disambiguation problems with the corresponding
! single-precision versions.
module procedure plstransform_impl_data
module procedure plstransform_impl
module procedure plstransform_impl_null
end interface plstransform
private :: plstransform_impl_data
private :: plstransform_impl
private :: plstransform_impl_null
! Routines that have floating-point attributes that can
! be disambiguated.
include 'included_plplot_real_interfaces.f90'
! Routines that have floating-point attributes that nevertheless
! cannot be disambiguated so we only provide them for the
! double-precision case (rather than using a separate naming
! convention for these routines or some other complexity for users
! to distinguish the double- and single-precision cases).
! Return type is not part of the disambiguation so we provide
! one explicit double-precision version rather than both types.
function plrandd_impl()
real(kind=wp) :: plrandd_impl !function type
interface
function interface_plrandd() bind(c,name='c_plrandd')
import :: private_plflt
implicit none
real(kind=private_plflt) :: interface_plrandd !function type
end function interface_plrandd
end interface
plrandd_impl = real(interface_plrandd(), kind=wp)
end function plrandd_impl
! Only provide double-precison version because of disambiguation
! problems with the corresponding single-precision version.
subroutine plslabelfunc_impl_data( proc, data )
procedure(pllabeler_proc_data) :: proc
type(c_ptr), value, intent(in) :: data
pllabeler_data => proc
call interface_plslabelfunc( c_funloc(pllabelerf2c_data), data )
end subroutine plslabelfunc_impl_data
! Only provide double-precison version because of disambiguation
! problems with the corresponding single-precision version.
subroutine plslabelfunc_impl( proc )
procedure(pllabeler_proc) :: proc
pllabeler => proc
call interface_plslabelfunc( c_funloc(pllabelerf2c), c_null_ptr )
end subroutine plslabelfunc_impl
subroutine plslabelfunc_impl_null
call interface_plslabelfunc( c_null_funptr, c_null_ptr )
end subroutine plslabelfunc_impl_null
! Only provide double-precison version because of disambiguation
! problems with the corresponding single-precision version.
subroutine plstransform_impl_data( proc, data )
procedure(pltransform_proc_data) :: proc
type(c_ptr), value, intent(in) :: data
pltransform_data => proc
call interface_plstransform( c_funloc(pltransformf2c_data), data )
end subroutine plstransform_impl_data
! Only provide double-precison version because of disambiguation
! problems with the corresponding single-precision version.
subroutine plstransform_impl( proc )
procedure(pltransform_proc) :: proc
pltransform => proc
call interface_plstransform( c_funloc(pltransformf2c), c_null_ptr )
end subroutine plstransform_impl
subroutine plstransform_impl_null
call interface_plstransform( c_null_funptr, c_null_ptr )
end subroutine plstransform_impl_null
! plflt-precision callback routines that are called from C and which wrap a call to wp-precision Fortran routines.
subroutine plmapformf2c( n, x, y ) bind(c, name = 'plplot_double_private_plmapformf2c')
integer(kind=private_plint), value, intent(in) :: n
real(kind=private_plflt), dimension(n), intent(inout) :: x, y
real(kind=wp), dimension(:), allocatable :: x_inout, y_inout
allocate(x_inout(n), y_inout(n))
x_inout = real(x, kind=wp)
y_inout = real(y, kind=wp)
call plmapform( x_inout, y_inout )
x = real(x_inout, kind=private_plflt)
y = real(y_inout, kind=private_plflt)
end subroutine plmapformf2c
subroutine pllabelerf2c( axis, value, label, length, data ) bind(c, name = 'plplot_double_private_pllabelerf2c')
integer(kind=private_plint), value, intent(in) :: axis, length
real(kind=private_plflt), value, intent(in) :: value
character(len=1), dimension(*), intent(out) :: label
type(c_ptr), value, intent(in) :: data
character(len=:), allocatable :: label_out
integer :: trimmed_length
if ( c_associated(data) ) then
write(*,*) 'PLPlot: error in pllabelerf2c - data argument should be NULL'
stop
endif
allocate(character(length) :: label_out)
call pllabeler( int(axis), real(value,kind=wp), label_out )
trimmed_length = min(length,len_trim(label_out) + 1)
label(1:trimmed_length) = transfer(trim(label_out(1:length))//c_null_char, " ", trimmed_length)
deallocate(label_out)
end subroutine pllabelerf2c
subroutine pllabelerf2c_data( axis, value, label, length, data ) bind(c, name = 'plplot_double_private_pllabelerf2c_data')
integer(kind=private_plint), value, intent(in) :: axis, length
real(kind=private_plflt), value, intent(in) :: value
character(len=1), dimension(*), intent(out) :: label
type(c_ptr), value, intent(in) :: data
character(len=:), allocatable :: label_out
integer :: trimmed_length
allocate(character(length) :: label_out)
call pllabeler_data( int(axis), real(value,kind=wp), label_out, data )
trimmed_length = min(length,len_trim(label_out) + 1)
label(1:trimmed_length) = transfer(trim(label_out(1:length))//c_null_char, " ", trimmed_length)
deallocate(label_out)
end subroutine pllabelerf2c_data
subroutine pltransformf2c( x, y, tx, ty, data ) bind(c, name = 'plplot_double_private_pltransformf2c')
real(kind=private_plflt), value, intent(in) :: x, y
real(kind=private_plflt), intent(out) :: tx, ty
type(c_ptr), value, intent(in) :: data
real(kind=wp) :: tx_out, ty_out
if ( c_associated(data) ) then
write(*,*) 'PLPlot: error in pltransfrom2c - data argument should be NULL'
stop
endif
call pltransform( real(x,kind=wp), real(y,kind=wp), tx_out, ty_out )
tx = tx_out
ty = ty_out
end subroutine pltransformf2c
subroutine pltransformf2c_data( x, y, tx, ty, data ) bind(c, name = 'plplot_double_private_pltransformf2c_data')
real(kind=private_plflt), value, intent(in) :: x, y
real(kind=private_plflt), intent(out) :: tx, ty
type(c_ptr), value, intent(in) :: data
real(kind=wp) :: tx_out, ty_out
call pltransform_data( real(x,kind=wp), real(y,kind=wp), tx_out, ty_out, data )
tx = tx_out
ty = ty_out
end subroutine pltransformf2c_data
end module plplot_double

View File

@ -0,0 +1,131 @@
!***********************************************************************
! plplot_single.f90
!
! Copyright (C) 2005-2016 Arjen Markus
! Copyright (C) 2006-2016 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
!
!
!***********************************************************************
module plplot_single
use iso_c_binding, only: c_ptr, c_char, c_null_char, c_null_ptr, c_loc, c_funptr, c_null_funptr, c_funloc, &
c_associated
use iso_fortran_env, only: error_unit
use plplot_types, only: private_plflt, private_plint, private_plbool, private_single, PLcGrid, PLfGrid
use plplot_private_exposed
use plplot_private_utilities, only: character_array_to_c
implicit none
integer, parameter :: wp = private_single
private :: c_ptr, c_char, c_null_char, c_null_ptr, c_loc, c_funptr, c_null_funptr, c_funloc
private :: error_unit
private :: private_plflt, private_plint, private_plbool, private_single, PLcGrid, PLfGrid
private :: character_array_to_c
private :: wp
! Private interfaces for wp-precision callbacks
private :: plmapformf2c, pllabelerf2c, pllabelerf2c_data, pltransformf2c, pltransformf2c_data
include 'included_plplot_real_interfaces.f90'
! plflt-precision callback routines that are called from C and which wrap a call to wp-precision Fortran routines.
subroutine plmapformf2c( n, x, y ) bind(c, name = 'plplot_single_private_plmapformf2c')
integer(kind=private_plint), value, intent(in) :: n
real(kind=private_plflt), dimension(n), intent(inout) :: x, y
real(kind=wp), dimension(:), allocatable :: x_inout, y_inout
allocate(x_inout(n), y_inout(n))
x_inout = real(x, kind=wp)
y_inout = real(y, kind=wp)
call plmapform( x_inout, y_inout )
x = real(x_inout, kind=private_plflt)
y = real(y_inout, kind=private_plflt)
end subroutine plmapformf2c
subroutine pllabelerf2c( axis, value, label, length, data ) bind(c, name = 'plplot_single_private_pllabelerf2c')
integer(kind=private_plint), value, intent(in) :: axis, length
real(kind=private_plflt), value, intent(in) :: value
character(len=1), dimension(*), intent(out) :: label
type(c_ptr), value, intent(in) :: data
character(len=:), allocatable :: label_out
integer :: trimmed_length
if ( c_associated(data) ) then
write(*,*) 'PLPlot: error in pllabelerf2c - data argument should be NULL'
stop
endif
allocate(character(length) :: label_out)
call pllabeler( int(axis), real(value,kind=wp), label_out )
trimmed_length = min(length,len_trim(label_out) + 1)
label(1:trimmed_length) = transfer(trim(label_out(1:length))//c_null_char, " ", trimmed_length)
deallocate(label_out)
end subroutine pllabelerf2c
subroutine pllabelerf2c_data( axis, value, label, length, data ) bind(c, name = 'plplot_single_private_pllabelerf2c_data')
integer(kind=private_plint), value, intent(in) :: axis, length
real(kind=private_plflt), value, intent(in) :: value
character(len=1), dimension(*), intent(out) :: label
type(c_ptr), value, intent(in) :: data
character(len=:), allocatable :: label_out
integer :: trimmed_length
allocate(character(length) :: label_out)
call pllabeler_data( int(axis), real(value,kind=wp), label_out, data )
trimmed_length = min(length,len_trim(label_out) + 1)
label(1:trimmed_length) = transfer(trim(label_out(1:length))//c_null_char, " ", trimmed_length)
deallocate(label_out)
end subroutine pllabelerf2c_data
subroutine pltransformf2c( x, y, tx, ty, data ) bind(c, name = 'plplot_single_private_pltransformf2c')
real(kind=private_plflt), value, intent(in) :: x, y
real(kind=private_plflt), intent(out) :: tx, ty
type(c_ptr), value, intent(in) :: data
real(kind=wp) :: tx_out, ty_out
if ( c_associated(data) ) then
write(*,*) 'PLPlot: error in pltransfrom2c - data argument should be NULL'
stop
endif
call pltransform( real(x,kind=wp), real(y,kind=wp), tx_out, ty_out )
tx = tx_out
ty = ty_out
end subroutine pltransformf2c
subroutine pltransformf2c_data( x, y, tx, ty, data ) bind(c, name = 'plplot_single_private_pltransformf2c_data')
real(kind=private_plflt), value, intent(in) :: x, y
real(kind=private_plflt), intent(out) :: tx, ty
type(c_ptr), value, intent(in) :: data
real(kind=wp) :: tx_out, ty_out
call pltransform_data( real(x,kind=wp), real(y,kind=wp), tx_out, ty_out, data )
tx = tx_out
ty = ty_out
end subroutine pltransformf2c_data
end module plplot_single

View File

@ -0,0 +1,330 @@
!***********************************************************************
! plplot_small_modules.f90
!
! Copyright (C) 2005-2016 Arjen Markus
! Copyright (C) 2006-2018 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
!
!
!***********************************************************************
module plplot_types
use iso_c_binding, only: c_ptr, c_int32_t, c_float, c_double
implicit none
private :: c_ptr, c_int32_t, c_float, c_double
! Specify Fortran types used by the various modules below.
! N.B. It is those modules' responsibility to keep these precision values
! private.
! These types are used along with function overloading so that
! applications do not need a specific real type at all (under the
! constraint that all real arguments must have consistent real type
! for a particular call to a routine in the Fortran binding of
! PLplot.)
! This include file only defines the private_plflt parameter at the
! moment which is configured to be either c_float or c_double
! to agree with the configured real precision (PLFLT) of the PLplot
! C library.
include 'included_plplot_configured_types.f90'
! The idea here is to match the Fortran integer type with the
! corresponding C types for PLINT (normally int32_t), PLBOOL
! (currently typedefed to PLINT) and PLUNICODE (normally
! uint32_t). In the past we have used 4 for this purpose with
! good success for both the gfortran and Intel compilers. That
! is, kind=4 corresponded to 4-byte integers for those compilers.
! But kind=4 may not do that for other compilers so we are now
! using a more standards-compliant approach as recommended by
! Wadud Miah of the NAG group.
! The kind c_int32_t defined in ISO_C_BINDING is meant to match the
! C type int32_t, which is used for PLINT and PLBOOL. As there
! is no equivalent for unsigned integers in Fortran, we use this
! kind for PLUNICODE as well.
integer, parameter :: private_plint = c_int32_t
integer, parameter :: private_plbool = c_int32_t
integer, parameter :: private_plunicode = c_int32_t
! Define parameters for specific real precisions, so that we can
! specify equivalent interfaces for all precisions (kinds)
integer, parameter :: private_single = c_float
integer, parameter :: private_double = c_double
! The PLfGrid and PLcGrid types transfer information about a multidimensional
! array to the plcontour/plshade family of routines.
type, bind(c) :: PLfGrid
type(c_ptr) :: f
integer(kind=private_plint) :: nx, ny, nz
end type PLfGrid
type, bind(c) :: PLcGrid
type(c_ptr) :: xg, yg, zg
integer(kind=private_plint) :: nx, ny, nz
end type PLcGrid
end module plplot_types
module plplot_private_utilities
use iso_c_binding, only: c_ptr, c_char, c_null_char, c_loc, c_size_t, c_f_pointer
use iso_fortran_env, only: error_unit
implicit none
private :: c_ptr, c_char, c_null_char, c_loc, c_size_t, c_f_pointer, error_unit
! Normally interface blocks describing the C routines that are
! called by this Fortran binding are embedded as part of module
! procedures, but when more than one module procedure uses such
! interface blocks there is a requirement (enforced at least by
! the nagfor compiler) that those interface blocks be consistent.
! We could comply with that requirement by embedding such multiply
! used interface blocks as part of module procedures using
! duplicated code, but that is inefficient (in terms of the number
! of lines of code to be compiled) and implies a maintenance issue
! (to keep that code duplicated whenever there are changes on the
! C side). To deal with those two potential issues we collect
! here in alphabetical order all interface blocks describing C
! routines that are called directly by more than one module
! procedure below.
interface
! Use standard C library function strlen to determine C string length excluding terminating NULL.
function interface_strlen(s) bind(c, name='strlen')
import c_ptr, c_size_t
implicit none
integer(c_size_t) :: interface_strlen
type(c_ptr), intent(in), value :: s
end function interface_strlen
end interface
private :: interface_strlen
contains
subroutine character_array_to_c( cstring_array, cstring_address, character_array )
! Translate from Fortran character_array to an array of C strings (cstring_array), where the
! address of the start of each C string is stored in the cstring_address vector.
! N.B. cstring_array is only an argument to keep those allocatable data in scope for the calling
! routine.
character(len=*), dimension(:), intent(in) :: character_array
character(len=1), dimension(:,:), allocatable, target, intent(out) :: cstring_array
type(c_ptr), dimension(:), allocatable, intent(out) :: cstring_address
integer :: j_local, length_local, number_local, length_column_local
! length of character string
length_local = len(character_array)
! number of character strings in array
number_local = size(character_array)
! Leave room for trailing c_null_char if the Fortran character string is
! filled with non-blank characters to the end.
allocate( cstring_array(length_local+1, number_local) )
allocate( cstring_address(number_local) )
do j_local = 1, number_local
length_column_local = len(trim(character_array(j_local))) + 1
! Drop all trailing blanks in Fortran character string when converting to C string.
cstring_array(1:length_column_local, j_local) = &
transfer(trim(character_array(j_local))//c_null_char, " ", length_column_local)
cstring_address(j_local) = c_loc(cstring_array(1,j_local))
enddo
end subroutine character_array_to_c
function c_to_character_array( character_array, cstring_address_array )
! Translate from an array of pointers to NULL-terminated C strings (cstring_address_array)
! to a Fortran character array (character_array).
integer :: c_to_character_array
character(len=*), dimension(:), intent(out) :: character_array
type(c_ptr), dimension(:), intent(in) :: cstring_address_array
integer :: i_local, j_local, length_local, number_local, length_column_local
! Array for accessing string pointed to by an element of cstring_address_array
character(kind=c_char), pointer :: string_ptr(:)
length_local = len(character_array)
number_local = size(cstring_address_array)
if(number_local > size(character_array)) then
write(error_unit, *) "Error in c_to_character_array: size of character_array too small to hold converted result."
endif
do j_local = 1, number_local
length_column_local = interface_strlen(cstring_address_array(j_local))
if(length_column_local > length_local) then
write(error_unit, *) &
"Error in c_to_character_array: length of character_array too small to hold converted result."
c_to_character_array = 1
return
endif
! Copy contents of string addressed by cstring_address_array(j_local) and of
! length length_column_local to string_ptr pointer array which
! is dynamically allocated as needed.
call c_f_pointer(cstring_address_array(j_local), string_ptr, [length_column_local])
do i_local = 1, length_column_local
character_array(j_local)(i_local:i_local) = string_ptr(i_local)
enddo
! append blanks to character_array element
character_array(j_local)(length_column_local+1:) = " "
enddo
c_to_character_array = 0
end function c_to_character_array
subroutine copystring2f( fstring, cstring )
character(len=*), intent(out) :: fstring
character(len=1), dimension(:), intent(in) :: cstring
integer :: i_local
fstring = ' '
do i_local = 1,min(len(fstring),size(cstring))
if ( cstring(i_local) /= c_null_char ) then
fstring(i_local:i_local) = cstring(i_local)
else
exit
endif
enddo
end subroutine copystring2f
function max_cstring_length(cstring_address_array)
! Find maximum length (excluding the NULL-terminating character)
! of the C strings pointed to by cstring_address_array
integer :: max_cstring_length
type(c_ptr), dimension(:), intent(in) :: cstring_address_array
integer :: j_local, number_local
number_local = size(cstring_address_array)
max_cstring_length = 0
do j_local = 1, number_local
max_cstring_length = max(max_cstring_length, interface_strlen(cstring_address_array(j_local)))
enddo
end function max_cstring_length
end module plplot_private_utilities
module plplot_graphics
use plplot_types, only: private_plint, private_plflt, private_double
use plplot_private_utilities, only: copystring2f
implicit none
private :: private_plint, private_plflt, private_double
! This is a public derived Fortran type that contains all the
! information in private_PLGraphicsIn below, but in standard
! Fortran form rather than C form.
type :: PLGraphicsIn
integer :: type ! of event (CURRENTLY UNUSED)
integer :: state ! key or button mask
integer :: keysym ! key selected
integer :: button ! mouse button selected
integer :: subwindow ! subwindow (alias subpage, alias subplot) number
character(len=16) :: string ! Fortran character string
integer :: pX, pY ! absolute device coordinates of pointer
real(kind=private_double) :: dX, dY ! relative device coordinates of pointer
real(kind=private_double) :: wX, wY ! world coordinates of pointer
end type PLGraphicsIn
interface plGetCursor
module procedure plGetCursor_impl
end interface plGetCursor
private :: plGetCursor_impl
contains
function plGetCursor_impl( gin )
! According to a gfortran build error message the combination of bind(c) and
! private attributes is not allowed for a derived type so to keep
! private_PLGraphicsIn actually private declare it inside the function
! rather than before the contains.
! This derived type is a direct equivalent of the C struct because
! of the bind(c) attribute and interoperable nature of all the
! types. (See <https://gcc.gnu.org/onlinedocs/gfortran/Derived-Types-and-struct.html> for
! further discussion.)
! Note the good alignment (offset is a multiple of 8 bytes) of the
! trailing dX, dY, wX, and wY for the case when private_plflt refers
! to double precision.
type, bind(c) :: private_PLGraphicsIn
integer(kind=private_plint) :: type ! of event (CURRENTLY UNUSED)
integer(kind=private_plint) :: state ! key or button mask
integer(kind=private_plint) :: keysym ! key selected
integer(kind=private_plint) :: button ! mouse button selected
integer(kind=private_plint) :: subwindow ! subwindow (alias subpage, alias subplot) number
character(len=1), dimension(16) :: string ! NULL-terminated character string
integer(kind=private_plint) :: pX, pY ! absolute device coordinates of pointer
real(kind=private_plflt) :: dX, dY ! relative device coordinates of pointer
real(kind=private_plflt) :: wX, wY ! world coordinates of pointer
end type private_PLGraphicsIn
type(PLGraphicsIn), intent(out) :: gin
integer :: plGetCursor_impl !function type
type(private_PLGraphicsIn) :: gin_out
interface
function interface_plGetCursor( gin ) bind(c,name='plGetCursor')
import :: private_PLGraphicsIn, private_plint
implicit none
integer(kind=private_plint) :: interface_plGetCursor !function type
type(private_PLGraphicsIn), intent(out) :: gin
end function interface_plGetCursor
end interface
plGetCursor_impl = int(interface_plGetCursor( gin_out ))
! Copy all gin_out elements to corresponding gin elements with
! appropriate type conversions.
gin%type = int(gin_out%type)
gin%state = int(gin_out%state)
gin%keysym = int(gin_out%keysym)
gin%button = int(gin_out%button)
gin%subwindow = int(gin_out%subwindow)
call copystring2f( gin%string, gin_out%string )
gin%pX = int(gin_out%pX)
gin%pY = int(gin_out%pY)
gin%dX = real(gin_out%dX, kind=private_double)
gin%dY = real(gin_out%dY, kind=private_double)
gin%wX = real(gin_out%wX, kind=private_double)
gin%wY = real(gin_out%wY, kind=private_double)
end function plGetCursor_impl
end module plplot_graphics
! The bind(c) attribute exposes the pltr routine which ought to be private
module plplot_private_exposed
use iso_c_binding, only: c_ptr, c_f_pointer
use plplot_types, only: private_plflt
implicit none
private :: c_ptr, private_plflt
contains
subroutine plplot_private_pltr( x, y, tx, ty, tr_in ) bind(c)
real(kind=private_plflt), value, intent(in) :: x, y
real(kind=private_plflt), intent(out) :: tx, ty
type(c_ptr), value, intent(in) :: tr_in
real(kind=private_plflt), dimension(:), pointer :: tr
call c_f_pointer( tr_in, tr, [6] )
tx = tr(1) * x + tr(2) * y + tr(3)
ty = tr(4) * x + tr(5) * y + tr(6)
end subroutine plplot_private_pltr
end module plplot_private_exposed

View File

@ -0,0 +1,363 @@
; You should not normally edit this generated file. Instead, check its consistency
; with the symbols in the plplotfortran library using the
; (Unix) target "check_ifort_definitions_file". If that target reports an
; inconsistency (via a cmp message) between the generated
; plplotfortran_ifort.def_compare file in the build tree and
; plplotfortran_ifort.def in the source tree, then copy that generated
; plplotfortran_ifort.def_compare on top of plplotfortran_ifort.def and
; check in that result.
LIBRARY plplotfortran.dll
EXPORTS
PLPLOT_DOUBLE_mp_PLARC_IMPL
PLPLOT_DOUBLE_mp_PLAXES_IMPL
PLPLOT_DOUBLE_mp_PLBIN_IMPL
PLPLOT_DOUBLE_mp_PLBOX3_IMPL
PLPLOT_DOUBLE_mp_PLBOX_IMPL
PLPLOT_DOUBLE_mp_PLBTIME_IMPL
PLPLOT_DOUBLE_mp_PLCALC_WORLD_IMPL
PLPLOT_DOUBLE_mp_PLCOL1_IMPL
PLPLOT_DOUBLE_mp_PLCOLORBAR_IMPL
PLPLOT_DOUBLE_mp_PLCONFIGTIME_IMPL
PLPLOT_DOUBLE_mp_PLCONT_IMPL
PLPLOT_DOUBLE_mp_PLCONT_IMPL_0
PLPLOT_DOUBLE_mp_PLCONT_IMPL_1
PLPLOT_DOUBLE_mp_PLCONT_IMPL_2
PLPLOT_DOUBLE_mp_PLCONT_IMPL_DATA
PLPLOT_DOUBLE_mp_PLCONT_IMPL_TR
PLPLOT_DOUBLE_mp_PLCTIME_IMPL
PLPLOT_DOUBLE_mp_PLENV0_IMPL
PLPLOT_DOUBLE_mp_PLENV_IMPL
PLPLOT_DOUBLE_mp_PLERRX_IMPL
PLPLOT_DOUBLE_mp_PLERRY_IMPL
PLPLOT_DOUBLE_mp_PLFILL3_IMPL
PLPLOT_DOUBLE_mp_PLFILL_IMPL
PLPLOT_DOUBLE_mp_PLGCHR_IMPL
PLPLOT_DOUBLE_mp_PLGCMAP1_RANGE_IMPL
PLPLOT_DOUBLE_mp_PLGCOL0A_IMPL
PLPLOT_DOUBLE_mp_PLGCOLBGA_IMPL
PLPLOT_DOUBLE_mp_PLGDIDEV_IMPL
PLPLOT_DOUBLE_mp_PLGDIORI_IMPL
PLPLOT_DOUBLE_mp_PLGDIPLT_IMPL
PLPLOT_DOUBLE_mp_PLGPAGE_IMPL
PLPLOT_DOUBLE_mp_PLGRADIENT_IMPL
PLPLOT_DOUBLE_mp_PLGRIDDATA_IMPL
PLPLOT_DOUBLE_mp_PLGSPA_IMPL
PLPLOT_DOUBLE_mp_PLGVPD_IMPL
PLPLOT_DOUBLE_mp_PLGVPW_IMPL
PLPLOT_DOUBLE_mp_PLHIST_IMPL
PLPLOT_DOUBLE_mp_PLHLSRGB_IMPL
PLPLOT_DOUBLE_mp_PLIMAGEFR_IMPL
PLPLOT_DOUBLE_mp_PLIMAGEFR_IMPL_1
PLPLOT_DOUBLE_mp_PLIMAGEFR_IMPL_2
PLPLOT_DOUBLE_mp_PLIMAGEFR_IMPL_DATA
PLPLOT_DOUBLE_mp_PLIMAGEFR_IMPL_NULL
PLPLOT_DOUBLE_mp_PLIMAGEFR_IMPL_TR
PLPLOT_DOUBLE_mp_PLIMAGE_IMPL
PLPLOT_DOUBLE_mp_PLJOIN_IMPL
PLPLOT_DOUBLE_mp_PLLABELER
PLPLOT_DOUBLE_mp_PLLABELER_DATA
PLPLOT_DOUBLE_mp_PLLEGEND_IMPL
PLPLOT_DOUBLE_mp_PLLIGHTSOURCE_IMPL
PLPLOT_DOUBLE_mp_PLLINE3_IMPL
PLPLOT_DOUBLE_mp_PLLINE_IMPL
PLPLOT_DOUBLE_mp_PLMAPFILL_IMPL
PLPLOT_DOUBLE_mp_PLMAPFILL_IMPL_NULL
PLPLOT_DOUBLE_mp_PLMAPFORM
PLPLOT_DOUBLE_mp_PLMAPLINE_IMPL
PLPLOT_DOUBLE_mp_PLMAPLINE_IMPL_NULL
PLPLOT_DOUBLE_mp_PLMAPSTRING_IMPL
PLPLOT_DOUBLE_mp_PLMAPSTRING_IMPL_NULL
PLPLOT_DOUBLE_mp_PLMAPTEX_IMPL
PLPLOT_DOUBLE_mp_PLMAPTEX_IMPL_NULL
PLPLOT_DOUBLE_mp_PLMAP_IMPL
PLPLOT_DOUBLE_mp_PLMAP_IMPL_NULL
PLPLOT_DOUBLE_mp_PLMERIDIANS_IMPL
PLPLOT_DOUBLE_mp_PLMERIDIANS_IMPL_NULL
PLPLOT_DOUBLE_mp_PLMESHC_IMPL
PLPLOT_DOUBLE_mp_PLMESH_IMPL
PLPLOT_DOUBLE_mp_PLMTEX3_IMPL
PLPLOT_DOUBLE_mp_PLMTEX_IMPL
PLPLOT_DOUBLE_mp_PLOT3DCL_IMPL
PLPLOT_DOUBLE_mp_PLOT3DC_IMPL
PLPLOT_DOUBLE_mp_PLOT3D_IMPL
PLPLOT_DOUBLE_mp_PLPATH_IMPL
PLPLOT_DOUBLE_mp_PLPOIN3_IMPL
PLPLOT_DOUBLE_mp_PLPOIN_IMPL
PLPLOT_DOUBLE_mp_PLPOLY3_IMPL
PLPLOT_DOUBLE_mp_PLPTEX3_IMPL
PLPLOT_DOUBLE_mp_PLPTEX_IMPL
PLPLOT_DOUBLE_mp_PLRANDD_IMPL
PLPLOT_DOUBLE_mp_PLRGBHLS_IMPL
PLPLOT_DOUBLE_mp_PLSCHR_IMPL
PLPLOT_DOUBLE_mp_PLSCMAP0A_IMPL
PLPLOT_DOUBLE_mp_PLSCMAP1A_IMPL
PLPLOT_DOUBLE_mp_PLSCMAP1LA_IMPL
PLPLOT_DOUBLE_mp_PLSCMAP1L_IMPL
PLPLOT_DOUBLE_mp_PLSCMAP1_RANGE_IMPL
PLPLOT_DOUBLE_mp_PLSCOL0A_IMPL
PLPLOT_DOUBLE_mp_PLSCOLBGA_IMPL
PLPLOT_DOUBLE_mp_PLSDIDEV_IMPL
PLPLOT_DOUBLE_mp_PLSDIMAP_IMPL
PLPLOT_DOUBLE_mp_PLSDIORI_IMPL
PLPLOT_DOUBLE_mp_PLSDIPLT_IMPL
PLPLOT_DOUBLE_mp_PLSDIPLZ_IMPL
PLPLOT_DOUBLE_mp_PLSHADES_IMPL
PLPLOT_DOUBLE_mp_PLSHADES_IMPL_0
PLPLOT_DOUBLE_mp_PLSHADES_IMPL_1
PLPLOT_DOUBLE_mp_PLSHADES_IMPL_2
PLPLOT_DOUBLE_mp_PLSHADES_IMPL_DATA
PLPLOT_DOUBLE_mp_PLSHADES_IMPL_TR
PLPLOT_DOUBLE_mp_PLSHADE_IMPL
PLPLOT_DOUBLE_mp_PLSHADE_IMPL_0
PLPLOT_DOUBLE_mp_PLSHADE_IMPL_1
PLPLOT_DOUBLE_mp_PLSHADE_IMPL_2
PLPLOT_DOUBLE_mp_PLSHADE_IMPL_DATA
PLPLOT_DOUBLE_mp_PLSHADE_IMPL_TR
PLPLOT_DOUBLE_mp_PLSLABELFUNC_IMPL
PLPLOT_DOUBLE_mp_PLSLABELFUNC_IMPL_DATA
PLPLOT_DOUBLE_mp_PLSLABELFUNC_IMPL_NULL
PLPLOT_DOUBLE_mp_PLSMAJ_IMPL
PLPLOT_DOUBLE_mp_PLSMIN_IMPL
PLPLOT_DOUBLE_mp_PLSPAGE_IMPL
PLPLOT_DOUBLE_mp_PLSSYM_IMPL
PLPLOT_DOUBLE_mp_PLSTRANSFORM_IMPL
PLPLOT_DOUBLE_mp_PLSTRANSFORM_IMPL_DATA
PLPLOT_DOUBLE_mp_PLSTRANSFORM_IMPL_NULL
PLPLOT_DOUBLE_mp_PLSTRING3_IMPL
PLPLOT_DOUBLE_mp_PLSTRING_IMPL
PLPLOT_DOUBLE_mp_PLSTRIPA_IMPL
PLPLOT_DOUBLE_mp_PLSTRIPC_IMPL
PLPLOT_DOUBLE_mp_PLSURF3DL_IMPL
PLPLOT_DOUBLE_mp_PLSURF3D_IMPL
PLPLOT_DOUBLE_mp_PLSVECT_IMPL
PLPLOT_DOUBLE_mp_PLSVPA_IMPL
PLPLOT_DOUBLE_mp_PLSYM_IMPL
PLPLOT_DOUBLE_mp_PLTRANSFORM
PLPLOT_DOUBLE_mp_PLTRANSFORM_DATA
PLPLOT_DOUBLE_mp_PLVASP_IMPL
PLPLOT_DOUBLE_mp_PLVECT_IMPL
PLPLOT_DOUBLE_mp_PLVECT_IMPL_0
PLPLOT_DOUBLE_mp_PLVECT_IMPL_1
PLPLOT_DOUBLE_mp_PLVECT_IMPL_2
PLPLOT_DOUBLE_mp_PLVECT_IMPL_DATA
PLPLOT_DOUBLE_mp_PLVECT_IMPL_TR
PLPLOT_DOUBLE_mp_PLVPAS_IMPL
PLPLOT_DOUBLE_mp_PLVPOR_IMPL
PLPLOT_DOUBLE_mp_PLW3D_IMPL
PLPLOT_DOUBLE_mp_PLWIDTH_IMPL
PLPLOT_DOUBLE_mp_PLWIND_IMPL
PLPLOT_DOUBLE_mp_PL_SETCONTLABELPARAM_IMPL
PLPLOT_GRAPHICS_mp_PLGETCURSOR_IMPL
PLPLOT_SINGLE_mp_PLARC_IMPL
PLPLOT_SINGLE_mp_PLAXES_IMPL
PLPLOT_SINGLE_mp_PLBIN_IMPL
PLPLOT_SINGLE_mp_PLBOX3_IMPL
PLPLOT_SINGLE_mp_PLBOX_IMPL
PLPLOT_SINGLE_mp_PLBTIME_IMPL
PLPLOT_SINGLE_mp_PLCALC_WORLD_IMPL
PLPLOT_SINGLE_mp_PLCOL1_IMPL
PLPLOT_SINGLE_mp_PLCOLORBAR_IMPL
PLPLOT_SINGLE_mp_PLCONFIGTIME_IMPL
PLPLOT_SINGLE_mp_PLCONT_IMPL
PLPLOT_SINGLE_mp_PLCONT_IMPL_0
PLPLOT_SINGLE_mp_PLCONT_IMPL_1
PLPLOT_SINGLE_mp_PLCONT_IMPL_2
PLPLOT_SINGLE_mp_PLCONT_IMPL_DATA
PLPLOT_SINGLE_mp_PLCONT_IMPL_TR
PLPLOT_SINGLE_mp_PLCTIME_IMPL
PLPLOT_SINGLE_mp_PLENV0_IMPL
PLPLOT_SINGLE_mp_PLENV_IMPL
PLPLOT_SINGLE_mp_PLERRX_IMPL
PLPLOT_SINGLE_mp_PLERRY_IMPL
PLPLOT_SINGLE_mp_PLFILL3_IMPL
PLPLOT_SINGLE_mp_PLFILL_IMPL
PLPLOT_SINGLE_mp_PLGCHR_IMPL
PLPLOT_SINGLE_mp_PLGCMAP1_RANGE_IMPL
PLPLOT_SINGLE_mp_PLGCOL0A_IMPL
PLPLOT_SINGLE_mp_PLGCOLBGA_IMPL
PLPLOT_SINGLE_mp_PLGDIDEV_IMPL
PLPLOT_SINGLE_mp_PLGDIORI_IMPL
PLPLOT_SINGLE_mp_PLGDIPLT_IMPL
PLPLOT_SINGLE_mp_PLGPAGE_IMPL
PLPLOT_SINGLE_mp_PLGRADIENT_IMPL
PLPLOT_SINGLE_mp_PLGRIDDATA_IMPL
PLPLOT_SINGLE_mp_PLGSPA_IMPL
PLPLOT_SINGLE_mp_PLGVPD_IMPL
PLPLOT_SINGLE_mp_PLGVPW_IMPL
PLPLOT_SINGLE_mp_PLHIST_IMPL
PLPLOT_SINGLE_mp_PLHLSRGB_IMPL
PLPLOT_SINGLE_mp_PLIMAGEFR_IMPL
PLPLOT_SINGLE_mp_PLIMAGEFR_IMPL_1
PLPLOT_SINGLE_mp_PLIMAGEFR_IMPL_2
PLPLOT_SINGLE_mp_PLIMAGEFR_IMPL_DATA
PLPLOT_SINGLE_mp_PLIMAGEFR_IMPL_NULL
PLPLOT_SINGLE_mp_PLIMAGEFR_IMPL_TR
PLPLOT_SINGLE_mp_PLIMAGE_IMPL
PLPLOT_SINGLE_mp_PLJOIN_IMPL
PLPLOT_SINGLE_mp_PLLABELER
PLPLOT_SINGLE_mp_PLLABELER_DATA
PLPLOT_SINGLE_mp_PLLEGEND_IMPL
PLPLOT_SINGLE_mp_PLLIGHTSOURCE_IMPL
PLPLOT_SINGLE_mp_PLLINE3_IMPL
PLPLOT_SINGLE_mp_PLLINE_IMPL
PLPLOT_SINGLE_mp_PLMAPFILL_IMPL
PLPLOT_SINGLE_mp_PLMAPFILL_IMPL_NULL
PLPLOT_SINGLE_mp_PLMAPFORM
PLPLOT_SINGLE_mp_PLMAPLINE_IMPL
PLPLOT_SINGLE_mp_PLMAPLINE_IMPL_NULL
PLPLOT_SINGLE_mp_PLMAPSTRING_IMPL
PLPLOT_SINGLE_mp_PLMAPSTRING_IMPL_NULL
PLPLOT_SINGLE_mp_PLMAPTEX_IMPL
PLPLOT_SINGLE_mp_PLMAPTEX_IMPL_NULL
PLPLOT_SINGLE_mp_PLMAP_IMPL
PLPLOT_SINGLE_mp_PLMAP_IMPL_NULL
PLPLOT_SINGLE_mp_PLMERIDIANS_IMPL
PLPLOT_SINGLE_mp_PLMERIDIANS_IMPL_NULL
PLPLOT_SINGLE_mp_PLMESHC_IMPL
PLPLOT_SINGLE_mp_PLMESH_IMPL
PLPLOT_SINGLE_mp_PLMTEX3_IMPL
PLPLOT_SINGLE_mp_PLMTEX_IMPL
PLPLOT_SINGLE_mp_PLOT3DCL_IMPL
PLPLOT_SINGLE_mp_PLOT3DC_IMPL
PLPLOT_SINGLE_mp_PLOT3D_IMPL
PLPLOT_SINGLE_mp_PLPATH_IMPL
PLPLOT_SINGLE_mp_PLPOIN3_IMPL
PLPLOT_SINGLE_mp_PLPOIN_IMPL
PLPLOT_SINGLE_mp_PLPOLY3_IMPL
PLPLOT_SINGLE_mp_PLPTEX3_IMPL
PLPLOT_SINGLE_mp_PLPTEX_IMPL
PLPLOT_SINGLE_mp_PLRGBHLS_IMPL
PLPLOT_SINGLE_mp_PLSCHR_IMPL
PLPLOT_SINGLE_mp_PLSCMAP0A_IMPL
PLPLOT_SINGLE_mp_PLSCMAP1A_IMPL
PLPLOT_SINGLE_mp_PLSCMAP1LA_IMPL
PLPLOT_SINGLE_mp_PLSCMAP1L_IMPL
PLPLOT_SINGLE_mp_PLSCMAP1_RANGE_IMPL
PLPLOT_SINGLE_mp_PLSCOL0A_IMPL
PLPLOT_SINGLE_mp_PLSCOLBGA_IMPL
PLPLOT_SINGLE_mp_PLSDIDEV_IMPL
PLPLOT_SINGLE_mp_PLSDIMAP_IMPL
PLPLOT_SINGLE_mp_PLSDIORI_IMPL
PLPLOT_SINGLE_mp_PLSDIPLT_IMPL
PLPLOT_SINGLE_mp_PLSDIPLZ_IMPL
PLPLOT_SINGLE_mp_PLSHADES_IMPL
PLPLOT_SINGLE_mp_PLSHADES_IMPL_0
PLPLOT_SINGLE_mp_PLSHADES_IMPL_1
PLPLOT_SINGLE_mp_PLSHADES_IMPL_2
PLPLOT_SINGLE_mp_PLSHADES_IMPL_DATA
PLPLOT_SINGLE_mp_PLSHADES_IMPL_TR
PLPLOT_SINGLE_mp_PLSHADE_IMPL
PLPLOT_SINGLE_mp_PLSHADE_IMPL_0
PLPLOT_SINGLE_mp_PLSHADE_IMPL_1
PLPLOT_SINGLE_mp_PLSHADE_IMPL_2
PLPLOT_SINGLE_mp_PLSHADE_IMPL_DATA
PLPLOT_SINGLE_mp_PLSHADE_IMPL_TR
PLPLOT_SINGLE_mp_PLSMAJ_IMPL
PLPLOT_SINGLE_mp_PLSMIN_IMPL
PLPLOT_SINGLE_mp_PLSPAGE_IMPL
PLPLOT_SINGLE_mp_PLSSYM_IMPL
PLPLOT_SINGLE_mp_PLSTRING3_IMPL
PLPLOT_SINGLE_mp_PLSTRING_IMPL
PLPLOT_SINGLE_mp_PLSTRIPA_IMPL
PLPLOT_SINGLE_mp_PLSTRIPC_IMPL
PLPLOT_SINGLE_mp_PLSURF3DL_IMPL
PLPLOT_SINGLE_mp_PLSURF3D_IMPL
PLPLOT_SINGLE_mp_PLSVECT_IMPL
PLPLOT_SINGLE_mp_PLSVPA_IMPL
PLPLOT_SINGLE_mp_PLSYM_IMPL
PLPLOT_SINGLE_mp_PLTRANSFORM
PLPLOT_SINGLE_mp_PLTRANSFORM_DATA
PLPLOT_SINGLE_mp_PLVASP_IMPL
PLPLOT_SINGLE_mp_PLVECT_IMPL
PLPLOT_SINGLE_mp_PLVECT_IMPL_0
PLPLOT_SINGLE_mp_PLVECT_IMPL_1
PLPLOT_SINGLE_mp_PLVECT_IMPL_2
PLPLOT_SINGLE_mp_PLVECT_IMPL_DATA
PLPLOT_SINGLE_mp_PLVECT_IMPL_TR
PLPLOT_SINGLE_mp_PLVPAS_IMPL
PLPLOT_SINGLE_mp_PLVPOR_IMPL
PLPLOT_SINGLE_mp_PLW3D_IMPL
PLPLOT_SINGLE_mp_PLWIDTH_IMPL
PLPLOT_SINGLE_mp_PLWIND_IMPL
PLPLOT_SINGLE_mp_PL_SETCONTLABELPARAM_IMPL
PLPLOT_mp_PLADV_IMPL
PLPLOT_mp_PLBOP_IMPL
PLPLOT_mp_PLCLEAR_IMPL
PLPLOT_mp_PLCOL0_IMPL
PLPLOT_mp_PLCPSTRM_IMPL
PLPLOT_mp_PLEND1_IMPL
PLPLOT_mp_PLEND_IMPL
PLPLOT_mp_PLEOP_IMPL
PLPLOT_mp_PLFAMADV_IMPL
PLPLOT_mp_PLFLUSH_IMPL
PLPLOT_mp_PLFONTLD_IMPL
PLPLOT_mp_PLFONT_IMPL
PLPLOT_mp_PLGCOL0_IMPL
PLPLOT_mp_PLGCOLBG_IMPL
PLPLOT_mp_PLGCOMPRESSION_IMPL
PLPLOT_mp_PLGDEV_IMPL
PLPLOT_mp_PLGDRAWMODE_IMPL
PLPLOT_mp_PLGET_ARGUMENTS_DYNAMIC
PLPLOT_mp_PLGET_ARGUMENTS_STATIC
PLPLOT_mp_PLGET_ARGUMENTS_STATIC_LENGTH
PLPLOT_mp_PLGFAM_IMPL
PLPLOT_mp_PLGFCI_IMPL
PLPLOT_mp_PLGFNAM_IMPL
PLPLOT_mp_PLGFONT_IMPL
PLPLOT_mp_PLGLEVEL_IMPL
PLPLOT_mp_PLGRA_IMPL
PLPLOT_mp_PLGSTRM_IMPL
PLPLOT_mp_PLGVER_IMPL
PLPLOT_mp_PLGXAX_IMPL
PLPLOT_mp_PLGYAX_IMPL
PLPLOT_mp_PLGZAX_IMPL
PLPLOT_mp_PLINIT_IMPL
PLPLOT_mp_PLLAB_IMPL
PLPLOT_mp_PLLSTY_IMPL
PLPLOT_mp_PLMKSTRM_IMPL
PLPLOT_mp_PLPARSEOPTS_BRIEF
PLPLOT_mp_PLPARSEOPTS_DYNAMIC
PLPLOT_mp_PLPARSEOPTS_STATIC
PLPLOT_mp_PLPARSEOPTS_STATIC_LENGTH
PLPLOT_mp_PLPAT_IMPL
PLPLOT_mp_PLPREC_IMPL
PLPLOT_mp_PLPSTY_IMPL
PLPLOT_mp_PLREPLOT_IMPL
PLPLOT_mp_PLSCMAP0N_IMPL
PLPLOT_mp_PLSCMAP0_IMPL
PLPLOT_mp_PLSCMAP1N_IMPL
PLPLOT_mp_PLSCMAP1_IMPL
PLPLOT_mp_PLSCOL0_IMPL
PLPLOT_mp_PLSCOLBG_IMPL
PLPLOT_mp_PLSCOLOR_IMPL
PLPLOT_mp_PLSCOMPRESSION_IMPL
PLPLOT_mp_PLSDEV_IMPL
PLPLOT_mp_PLSDRAWMODE_IMPL
PLPLOT_mp_PLSEED_IMPL
PLPLOT_mp_PLSESC_IMPL
PLPLOT_mp_PLSETOPT_IMPL
PLPLOT_mp_PLSFAM_IMPL
PLPLOT_mp_PLSFCI_IMPL
PLPLOT_mp_PLSFNAM_IMPL
PLPLOT_mp_PLSFONT_IMPL
PLPLOT_mp_PLSMEMA_IMPL
PLPLOT_mp_PLSMEM_IMPL
PLPLOT_mp_PLSORI_IMPL
PLPLOT_mp_PLSPAL0_IMPL
PLPLOT_mp_PLSPAL1_IMPL
PLPLOT_mp_PLSPAUSE_IMPL
PLPLOT_mp_PLSSTRM_IMPL
PLPLOT_mp_PLSSUB_IMPL
PLPLOT_mp_PLSTART_IMPL
PLPLOT_mp_PLSTAR_IMPL
PLPLOT_mp_PLSTRIPD_IMPL
PLPLOT_mp_PLSTYL_IMPL
PLPLOT_mp_PLSVECT_NONE
PLPLOT_mp_PLSXAX_IMPL
PLPLOT_mp_PLSYAX_IMPL
PLPLOT_mp_PLSZAX_IMPL
PLPLOT_mp_PLTEXT_IMPL
PLPLOT_mp_PLTIMEFMT_IMPL
PLPLOT_mp_PLVSTA_IMPL
PLPLOT_mp_PLXORMOD_IMPL
PLPLOT_mp_PL_SETCONTLABELFORMAT_IMPL

View File

@ -0,0 +1,197 @@
# bindings/java/CMakeLists.txt
# Copyright (C) 2006 Andrew Ross
# Copyright (C) 2017-2019 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; 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 PLplot; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
if(ENABLE_java)
# Swig generated java files. Order no longer matters since class
# dependencies are explicitly handled now.
set(
SWIG_JAVA_FILES
plplotjavacJNI.java
PLGraphicsIn.java
plplotjavacConstants.java
plplotjavac.java
)
# List of swig-generated + configured java files
set(
JAVA_GEN_FILES
config.java
${SWIG_JAVA_FILES}
)
# List of swig-generated + configured java files with full path names
# Need this otherwise cmake will look in the source directory for the
# .java files.
string(
REGEX REPLACE "([a-zA-z]*)\\.java"
"${CMAKE_CURRENT_BINARY_DIR}/\\1.java"
JAVA_GEN_FILES_FULL
"${JAVA_GEN_FILES}"
)
# Full pathnames for all java files.
set(
JAVA_FILES_FULL
${JAVA_GEN_FILES_FULL}
${CMAKE_CURRENT_SOURCE_DIR}/PLStream.java
${CMAKE_CURRENT_SOURCE_DIR}/PLCallbackMapform.java
${CMAKE_CURRENT_SOURCE_DIR}/PLCallbackLabel.java
${CMAKE_CURRENT_SOURCE_DIR}/PLCallbackCT.java
)
# Explicit full-path class dependencies for the foreach loop below which
# should build classes in the correct order regardless of whether it
# is a parallel build or not and regardless of the order of JAVA_FILES_FULL.
# These are hand-crafted dependencies based on scanning the appropriate
# Java sources. Apparently CMake has a java dependency scanner which
# might be good enough to do this task as well, but I have avoided it because
# I (AWI) am under the impression that CMake support of java is still in its
# infancy.
set(class_root ${CMAKE_CURRENT_BINARY_DIR}/plplot/core)
set(
${class_root}/plplotjavacJNI.class_DEPENDS
${class_root}/PLCallbackMapform.class
${class_root}/PLCallbackLabel.class
${class_root}/PLCallbackCT.class
)
set(
${class_root}/PLGraphicsIn.class_DEPENDS
${class_root}/plplotjavacJNI.class
)
set(
${class_root}/plplotjavacConstants.class_DEPENDS
${class_root}/plplotjavacJNI.class
)
set(
${class_root}/plplotjavac.class_DEPENDS
${class_root}/plplotjavacConstants.class
${class_root}/PLGraphicsIn.class
${class_root}/plplotjavacJNI.class
${class_root}/PLCallbackMapform.class
${class_root}/PLCallbackLabel.class
${class_root}/PLCallbackCT.class
)
set(
${class_root}/PLStream.class_DEPENDS
${class_root}/plplotjavacConstants.class
${class_root}/config.class
${class_root}/plplotjavac.class
${class_root}/PLCallbackMapform.class
${class_root}/PLCallbackLabel.class
${class_root}/PLCallbackCT.class
)
# This is currently the include list for swig, the C wrapper and the
# the java classpath. Not particular pretty...
set(java_interface_INCLUDE_PATHS
${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/lib/qsastime
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/include
${CMAKE_BINARY_DIR}/lib/qsastime
${JAVA_INCLUDE_PATH}
${CMAKE_SOURCE_DIR}/bindings/swig-support
)
# On some systems JAVA_INCLUDE_PATH2 returns JAVA_INCLUDE_PATH2-NOTFOUND
if(JAVA_INCLUDE_PATH2)
set(java_interface_INCLUDE_PATHS
${java_interface_INCLUDE_PATHS}
${JAVA_INCLUDE_PATH2}
)
endif(JAVA_INCLUDE_PATH2)
include_directories(${java_interface_INCLUDE_PATHS})
# Can't use source file properties as we have to quote the flags in that
# case and it breaks swig. Doh! I would call this a cmake bug.
if(SWIG_JAVA_NOPGCPP)
#This version of swig supports the -nopgcpp option
set(CMAKE_SWIG_FLAGS -DPL_DOUBLE_INTERFACE -DSWIG_JAVA -package plplot.core -nopgcpp)
else(SWIG_JAVA_NOPGCPP)
set(CMAKE_SWIG_FLAGS -DPL_DOUBLE_INTERFACE -DSWIG_JAVA -package plplot.core)
endif(SWIG_JAVA_NOPGCPP)
set(CMAKE_SWIG_OUTDIR ${CMAKE_CURRENT_BINARY_DIR})
# This may be needed in future when we use CMake java support to build the
# class files, but it obviously is not correct now when we use custom commands
# to build the class files using file dependencies to keep things straight.
## set_source_files_properties(${JAVA_GEN_FILES_FULL} PROPERTIES GENERATED ON)
set(SWIG_MODULE_plplotjavac_wrap_EXTRA_DEPS
${CMAKE_SOURCE_DIR}/bindings/swig-support/plplotcapi.i)
set_source_files_properties(
plplotjavac.i
PROPERTIES SWIG_MODULE_NAME plplotjavac
)
# plplotjavac_wrap depends on the plplot library.
set(LIB_INSTALL_RPATH ${LIB_DIR})
# Create swig-generated java files and swig-generated C wrapper source
# code. Also, build that source code into a shared object (a.k.a. "dll")
# that can be dynamically loaded by java.
configure_library_build(plplotjavac_wrap java plplotjavac.i PLPLOT::plplot "${LIB_INSTALL_RPATH}" ${JAVAWRAPPER_DIR})
# Create config.java. Other generated java files created by swig above.
set(PLPLOTJAVAC_WRAP_DLL $<TARGET_FILE_NAME:PLPLOT::plplotjavac_wrap>)
configure_file_generate(
${CMAKE_CURRENT_SOURCE_DIR}/config.java.in
${CMAKE_CURRENT_BINARY_DIR}/config.java
@ONLY
)
set(JAVA_CLASSES)
foreach( srcfile ${JAVA_FILES_FULL} )
get_filename_component(fileroot ${srcfile} NAME_WE)
set(output_file ${CMAKE_CURRENT_BINARY_DIR}/plplot/core/${fileroot}.class)
list(APPEND JAVA_CLASSES ${output_file})
add_custom_command(
OUTPUT ${output_file}
COMMAND ${CMAKE_Java_COMPILER}
${JAVACFLAGS} -classpath ${CMAKE_CURRENT_BINARY_DIR} ${srcfile} -d ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${srcfile} ${${output_file}_DEPENDS}
VERBATIM
)
endforeach( srcfile ${JAVA_FILES_FULL} )
add_custom_target(plplot_core ALL DEPENDS ${JAVA_CLASSES})
# Need to keep track of file dependencies since this is a custom target.
set_property(GLOBAL PROPERTY FILES_plplot_core ${JAVA_CLASSES})
# Ensure that swig is executed before we try to compile the java
# classes which file-depend (see above custom_command DEPENDS) on
# the java files created by swig (amongst others).
add_dependencies(plplot_core PLPLOT::plplotjavac_wrap)
# Installed as part of the example/java directory
#install(FILES ${CMAKE_BINARY_DIR}/plplot.jar DESTINATION ${JAR_DIR})
endif(ENABLE_java)

View File

@ -0,0 +1,7 @@
package plplot.core;
public interface PLCallbackCT
{
public void coordTransform( double x, double y, double xt[], double yt[], Object data );
};

View File

@ -0,0 +1,7 @@
package plplot.core;
public interface PLCallbackLabel
{
public String label( int axis, double value );
};

View File

@ -0,0 +1,7 @@
package plplot.core;
public interface PLCallbackMapform
{
public void mapform( double[] x, double[] y );
};

1371
src/3rdparty/plplot/bindings/java/PLStream.java vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,89 @@
Here is how to generate the Java interface to PLplot using swig.
PREREQUISITE: swig. Version 1.3.36 works fine for me, but it has been a long
time since we have had any version dependency problems for swig.
(1) Install a Java SDK (Software Development Kit). I use a free version
from Debian Lenny consisting of gcj, gij, and fastjar, but apparently other
free java versions and also proprietary versions of java work fine.
(2) If the java include files are not in a default include directory then
you need to tell CMake where they are. I use (although I am not sure
whether this is necessary any longer)
export CMAKE_INCLUDE_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.3/include
(3) The rest is highly automated. We use a CMake-based build system
so we run "cmake" to configure the build, "make" to build, and "make
install" to install. For more details see our wiki at
<https://sourceforge.net/p/plplot/wiki>.
For the curious, here are some more details about the 'make' and 'make
install' steps above.
'make' automatically runs swig on plplotjavac.i
(which does an include of ../swig-support/plplotcapi.i) to generate all the
interface files that are needed for further processing. To understand these
two *.i files and what they do, you should read the latest java interface
documentation from swig. The result is a complete
interface (aside from the limitations mentioned below) for Java to the
PLplot common API.
The files generated by swig are necessary java files and plplotjavac_wrap.c.
'make' builds the java interface shared object module (DLL)
plplotjavac_wrap.SOBJEXT from plplotjavac_wrap.c. 'make' also builds the
class files corresponding to the swig-generated java files, the configured
config.java file, and the PLStream.java file which is hand-crafted (swig
might be able to do this in future) so that calling a method in the class
will ensure the stream is correctly set before calling the underlying API
function. The relevant java files and corresponding class files that are
compiled from them make up the plplot.core package.
'make install' installs the relevant java and class files that are part of
the plplot.core package in $prefix/share/java/plplot/core,
installs the shared object module (DLL) plplotjavac_wrap.SOBJEXT for the
java PLplot interface in the $prefix/lib/jni, and also installs
(from ../../examples/java) the example java scripts and corresponding class
files that are part of the plplot.examples package into
$prefix/share/plplot5.3.1/java/plplot/examples. For more details about the
examples, please see ../../examples/java/README.javademos or the installed
version of that file in $prefix/share/plplot$version/examples/java/. Copies of
the java files are also in this directory for convenience.
At the end of the install process all the files in
$prefix/share/java/plplot/ are bundled into a jar file
$prefix/share/java/plplot.jar and the plplot directory is
deleted.
Here is how to add a new function to the Java API for PLplot:
Edit ../swig-support/plplotcapi.i. (If you want just a Java interface to
this PLplot function and not a python or any other interface, then wrap your
entry with #ifdef SWIG_JAVA ... #endif, but ordinarily you will be adding
functions for all swig-generated interfaces so you will not use a java-only
#ifdef at all.) Find a function with the same argument types that you have
in your new function, and copy those argument types and argument names
*EXACTLY*. The typedefs in plplotjavac.i process argument type and argument
name patterns to produce the required java files and java interface code. So
give it the same pattern (white space doesn't matter), and you will get the
same argument processing that worked before for the old function. In the
unlikely event that you have a new pattern of argument list, then it is time
to dig into the Java interface documentation for swig.
Finally, hand edit PLStream.java to add typically 3 lines of boiler-plate
code for each added function copying the appropriate pattern from other
functions.
Limitation of the current swig-generated Java interface to PLplot:
* A user-friendly (UF) wrapper to the raw java interface should be made to
give us a variety of different simplified argument lists similarly to the
way plplot.py wraps the plplotc extension module. I assume that java is
more powerful than C so that it makes sense to write the UF interface in
java rather than C. Note the raw interface only allows two-dimensional xg,
and yg arrays to plcont, plshades, and plshade. The options of no xg, yg,
and one-dimensional xg, and yg should also be allowed for the UI interface.
Also note the raw interface to plparseopts demands you must be explicit
about ORing in pls.PL_PARSE_NOPROGRAM to the parse mode parameter. This
idiosyncrasy of Java should be hidden for the UF interface.
Alan W. Irwin (2009-12-01)

View File

@ -0,0 +1,27 @@
// -*-java-*-
//
// Copyright (C) 2004 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
package plplot.core;
public class config {
// Must be installed absolute path name of generated DLL
public final static String libname = "@PLPLOTJAVAC_WRAP_DLL@";
public final static String libdir = "@JAVAWRAPPER_HARDDIR@";
}

2138
src/3rdparty/plplot/bindings/java/plplotjavac.i vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,58 @@
# bindings/lua/CMakeLists.txt
# Copyright (C) 2008 Werner Smekal
# Copyright (C) 2017-2019 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; 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 PLplot; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
if(ENABLE_lua)
# This is currently the include list for swig.
set(lua_interface_INCLUDE_PATHS
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/lib/qsastime
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/include
${CMAKE_BINARY_DIR}/lib/qsastime
${CMAKE_CURRENT_BINARY_DIR}
${LUA_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/bindings/swig-support
)
include_directories(${lua_interface_INCLUDE_PATHS})
set(CMAKE_SWIG_FLAGS -DSWIG_LUA -module ${WRITEABLE_TARGET}plplotluac)
set(CMAKE_SWIG_OUTDIR ${CMAKE_CURRENT_BINARY_DIR})
set_source_files_properties(plplotluac.i
PROPERTIES SWIG_MODULE_NAME plplotluac
)
set(SWIG_MODULE_plplotluac_EXTRA_DEPS
${CMAKE_SOURCE_DIR}/bindings/swig-support/plplotcapi.i)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/lua_namespace.i.in
${CMAKE_CURRENT_BINARY_DIR}/lua_namespace.i
@ONLY
)
# plplotluac depends on the plplot library.
set(LIB_INSTALL_RPATH ${LIB_DIR})
# Configure build of swig-generated C wrapper.
configure_library_build(plplotluac lua plplotluac.i "PLPLOT::plplot;${LUA_LIBRARIES}" "${LIB_INSTALL_RPATH}" ${LUA_DIR})
endif(ENABLE_lua)

View File

@ -0,0 +1,5 @@
// Assign the module a shorter name
%luacode {
pl = @WRITEABLE_TARGET@plplotluac
}

1638
src/3rdparty/plplot/bindings/lua/plplotluac.i vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,560 @@
# -*- mode: cmake -*-
# bindings/ocaml/CMakeLists.txt
#
#
# Copyright (C) 2008 Andrew Ross
# Copyright (C) 2009 Hezekiah M. Carty
# Copyright (C) 2009-2018 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; 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 PLplot; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
if(ENABLE_ocaml)
# Need these escaped versions when there is a space in the full pathname of these variables.
string(REPLACE " " "\\ " CMAKE_SOURCE_DIR_ESCAPED ${CMAKE_SOURCE_DIR})
string(REPLACE " " "\\ " CMAKE_CURRENT_SOURCE_DIR_ESCAPED ${CMAKE_CURRENT_SOURCE_DIR})
string(REPLACE " " "\\ " CMAKE_BINARY_DIR_ESCAPED ${CMAKE_BINARY_DIR})
string(REPLACE " " "\\ " CMAKE_INSTALL_LIBDIR_ESCAPED ${CMAKE_INSTALL_LIBDIR})
# Optionally build the Plcairo module
add_subdirectory(plcairo)
# optional command to check consistency of plplot_h.inc.
if(GENERATE_PLPLOT_H_INC)
add_custom_target(
check_plplot_h.inc
COMMAND ${CMAKE_COMMAND} -E echo "Check that ${CMAKE_CURRENT_SOURCE_DIR}/plplot_h.inc is consistent with what should be same file generated with ${CMAKE_CURRENT_SOURCE_DIR}/touchup.ml and ${CMAKE_CURRENT_SOURCE_DIR}/bindings/ocaml/plplot_h"
COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_CURRENT_BINARY_DIR}/generated_plplot_h.inc
# For space in pathname case quoted escaped touch.ml does not
# work for some reason so must copy it to the WORKING_DIRECTORY.
# Furthermore, for this same case must remove absolute directory
# location from generated_plplot_h.inc. But plplot_h is fine in
# its present quoted and escaped form, go figure.
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/touchup.ml
${CMAKE_CURRENT_BINARY_DIR}/touchup.ml
# N.B. This only works on Debian if the libpcre-ocaml-dev package is installed.
COMMAND ${OCAML} touchup.ml "${CMAKE_CURRENT_SOURCE_DIR_ESCAPED}/plplot_h" generated_plplot_h.inc
COMMAND cmp ${CMAKE_CURRENT_SOURCE_DIR}/plplot_h.inc ${CMAKE_CURRENT_BINARY_DIR}/generated_plplot_h.inc
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
VERBATIM
)
add_dependencies(check_all check_plplot_h.inc)
endif(GENERATE_PLPLOT_H_INC)
#Detailed CMake logic to build ocaml bindings for PLplot.
# camlidl produces most of the C and OCaml code required to bind PLplot
# My (AWI) experiments show OCaml build tools such as ${CAMLIDL} and
# ${OCAMLC} do work properly when their arguments refer to pathnames
# with spaces, but it is necessary to both quote and escape those
# blanks as appropriate. To simplify this task, the general
# approach I am taking below when running OCaml build tools as
# COMMANDS for custom commands is to use the VERBATIM version of all
# such custom commands; the quoted variables
# ${CMAKE_SOURCE_DIR_ESCAPED} or ${CMAKE_CURRENT_SOURCE_DIR_ESCAPED}
# when referring to source-tree locations, never using
# ${CMAKE_CURRENT_BINARY_DIR} in wherever it occurs in an OCaml
# build command (since the build is done in that directory), and the
# quoted variable ${CMAKE_BINARY_DIR_ESCAPED} to help refer to other
# build-tree locations used by OCaml build tools. The result is
# that the only files that need to be copied from anywhere in the
# source tree to ${CMAKE_CURRENT_BINARY_DIR} are particular
# ${CMAKE_CURRENT_SOURCE_DIR} files that are mentioned on the OCaml
# build tool command line.
# Generate build tree names of files generated by camlidl.
set(camlidl_GENERATED_SOURCE)
set(SUFFIX_LIST .mli .ml _stubs.c .h)
foreach(SUFFIX IN LISTS SUFFIX_LIST)
list(APPEND camlidl_GENERATED_SOURCE ${CMAKE_CURRENT_BINARY_DIR}/plplot_core${SUFFIX})
endforeach(SUFFIX IN LISTS SUFFIX_LIST)
#message(STATUS "DEBUG:camlidl_GENERATED_SOURCE = ${camlidl_GENERATED_SOURCE}")
add_custom_command(
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/plplot_core.idl
${camlidl_GENERATED_SOURCE}
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/plplot_core.idl
${CMAKE_CURRENT_BINARY_DIR}/plplot_core.idl
# -I "${CMAKE_CURRENT_SOURCE_DIR_ESCAPED}" required to get access to plplot_h.inc.
COMMAND ${CAMLIDL} -I "${CMAKE_CURRENT_SOURCE_DIR_ESCAPED}" -header plplot_core.idl
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/plplot_core.idl
${CMAKE_CURRENT_SOURCE_DIR}/plplot_h.inc
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
VERBATIM
)
# ocamlc -c compiles *.c into *.o.
add_custom_command(
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/plplot_core_stubs.o
${CMAKE_CURRENT_BINARY_DIR}/plplot_impl.c
${CMAKE_CURRENT_BINARY_DIR}/plplot_impl.o
COMMAND ${OCAMLC} -ccopt -I${CAMLIDL_LIB_DIR} -c plplot_core_stubs.c
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/plplot_impl.c
${CMAKE_CURRENT_BINARY_DIR}/plplot_impl.c
COMMAND ${OCAMLC} -ccopt "-I${CMAKE_SOURCE_DIR_ESCAPED}/include" -ccopt "-I${CMAKE_BINARY_DIR_ESCAPED}/include" -ccopt "-I${CMAKE_SOURCE_DIR_ESCAPED}/lib/qsastime" -ccopt "-I${CMAKE_BINARY_DIR_ESCAPED}/lib/qsastime" -ccopt -I../../include -ccopt -I../.. -ccopt -I${CAMLIDL_LIB_DIR} -ccopt -DPLPLOT_HAVE_CONFIG_H -c plplot_impl.c
DEPENDS
${camlidl_GENERATED_SOURCE}
${CMAKE_CURRENT_SOURCE_DIR}/plplot_impl.c
PLPLOT::plplot
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
VERBATIM
)
# Determine ocaml library flags for build tree and install tree.
set(ocaml_LIBRARIES_FLAGS)
set(installed_ocaml_LIBRARIES_FLAGS)
if(NOT BUILD_SHARED_LIBS)
# Order of these libraries matters for second use
# of this list below.
set(library_LIST PLPLOT::plplot PLPLOT::csirocsa PLPLOT::csironn PLPLOT::qsastime)
if(PLD_cgm)
list(APPEND library_LIST PLPLOT::nistcd)
endif(PLD_cgm)
foreach(library IN LISTS library_LIST)
# N.B. the INTERFACE_LINK_LIBRARIES property refers to all libraries
# that ${library} depends on, but not the library itself!
get_target_property(LIBRARY_LIST ${library} INTERFACE_LINK_LIBRARIES)
#message(STATUS "DEBUG: library = ${library} has INTERFACE_LINK_LIBRARIES property = ${LIBRARY_LIST}")
list(APPEND ocaml_LIBRARIES_FLAGS ${LIBRARY_LIST})
endforeach(library in LISTS library_LIST)
# Get rid of internal symbolic targets and symbolic Qt5 targets from the list
#message(STATUS "DEBUG: (original) ocaml_LIBRARIES_FLAGS = ${ocaml_LIBRARIES_FLAGS}")
list(FILTER ocaml_LIBRARIES_FLAGS EXCLUDE REGEX "^PLPLOT::csirocsa$|^PLPLOT::csironn$|^PLPLOT::nistcd$|^PLPLOT::qsastime$|^Qt5::")
#message(STATUS "DEBUG: (filtered) ocaml_LIBRARIES_FLAGS = ${ocaml_LIBRARIES_FLAGS}")
# Add C++ libraries in case there is at least one C++ device
# driver in libplplot.
list(APPEND ocaml_LIBRARIES_FLAGS ${cxx_compiler_library_pathname_list})
#message(STATUS "DEBUG: raw ocaml_LIBRARIES_FLAGS = ${ocaml_LIBRARIES_FLAGS}")
# Add back actual list of Qt5 libraries to replace the symbolic
# form of Qt5 libraries that were removed above.
if(PLPLOT_USE_QT5)
list(APPEND ocaml_LIBRARIES_FLAGS ${pc_qt_LIBRARIES_LIST})
#message(STATUS "DEBUG: (Qt5 added) ocaml_LIBRARIES_FLAGS = ${ocaml_LIBRARIES_FLAGS}")
endif(PLPLOT_USE_QT5)
# There is a long-standing bug for cmake where the regexp "^[^-]"
# acts the same as "[^-]", i.e., the starting anchor is ignored.
# So workaround that bug by inserting an empty field to start the
# list and then remove that empty field as the last step in
# ocaml_LIBRARIES_FLAGS processing.
set(ocaml_LIBRARIES_FLAGS ";${ocaml_LIBRARIES_FLAGS}")
# Prepend all "-" options with -ccopt.
string(REGEX REPLACE ";-" ";-ccopt;-" ocaml_LIBRARIES_FLAGS "${ocaml_LIBRARIES_FLAGS}")
#message(STATUS "DEBUG: (\"-\" options processed) ocaml_LIBRARIES_FLAGS = ${ocaml_LIBRARIES_FLAGS}")
# Prepend -cclib to every list item that does not start already with "-"
string(REGEX REPLACE ";([^-])" ";-cclib;\\1" ocaml_LIBRARIES_FLAGS "${ocaml_LIBRARIES_FLAGS}")
#message(STATUS "DEBUG: (inserted -cclib) ocaml_LIBRARIES_FLAGS = ${ocaml_LIBRARIES_FLAGS}")
# Delete starting empty field.
list(REMOVE_AT ocaml_LIBRARIES_FLAGS 0)
#message(STATUS "DEBUG: (removed starting empty field) ocaml_LIBRARIES_FLAGS = ${ocaml_LIBRARIES_FLAGS}")
# Installed version depends on install-tree locations for internal libraries
# rather than build-tree locations so must use a distinct variable for
# the installed case.
set(installed_ocaml_LIBRARIES_FLAGS ${ocaml_LIBRARIES_FLAGS})
# Order matters so prepend (N.B. in reverse order) plplot and the internal libraries that were removed in target-name form above to the list of FLAGS.
if(PLD_cgm)
set(ocaml_LIBRARIES_FLAGS -ccopt "-L${CMAKE_BINARY_DIR_ESCAPED}/lib/nistcd" -cclib -l${WRITEABLE_TARGET}nistcd ${ocaml_LIBRARIES_FLAGS})
set(installed_ocaml_LIBRARIES_FLAGS -cclib -l${WRITEABLE_TARGET}nistcd ${installed_ocaml_LIBRARIES_FLAGS})
endif(PLD_cgm)
set(ocaml_LIBRARIES_FLAGS -ccopt "-L${CMAKE_BINARY_DIR_ESCAPED}/lib/qsastime" -cclib -l${WRITEABLE_TARGET}qsastime ${ocaml_LIBRARIES_FLAGS})
set(installed_ocaml_LIBRARIES_FLAGS -cclib -l${WRITEABLE_TARGET}qsastime ${installed_ocaml_LIBRARIES_FLAGS})
set(ocaml_LIBRARIES_FLAGS -ccopt "-L${CMAKE_BINARY_DIR_ESCAPED}/lib/nn" -cclib -l${WRITEABLE_TARGET}csironn ${ocaml_LIBRARIES_FLAGS})
set(installed_ocaml_LIBRARIES_FLAGS -cclib -l${WRITEABLE_TARGET}csironn ${installed_ocaml_LIBRARIES_FLAGS})
set(ocaml_LIBRARIES_FLAGS -ccopt "-L${CMAKE_BINARY_DIR_ESCAPED}/lib/csa" -cclib -l${WRITEABLE_TARGET}csirocsa ${ocaml_LIBRARIES_FLAGS})
set(installed_ocaml_LIBRARIES_FLAGS -cclib -l${WRITEABLE_TARGET}csirocsa ${installed_ocaml_LIBRARIES_FLAGS})
set(ocaml_LIBRARIES_FLAGS -ccopt "-L${CMAKE_BINARY_DIR_ESCAPED}/src" -cclib -l${WRITEABLE_TARGET}plplot ${ocaml_LIBRARIES_FLAGS})
set(installed_ocaml_LIBRARIES_FLAGS -ccopt "-L${CMAKE_INSTALL_LIBDIR_ESCAPED}" -cclib -l${WRITEABLE_TARGET}plplot ${installed_ocaml_LIBRARIES_FLAGS})
#message(STATUS "DEBUG: (internal libraries processed) ocaml_LIBRARIES_FLAGS = ${ocaml_LIBRARIES_FLAGS}")
else(NOT BUILD_SHARED_LIBS)
# Add plplot library.
list(APPEND ocaml_LIBRARIES_FLAGS -ccopt "-L${CMAKE_BINARY_DIR_ESCAPED}/src" -cclib -l${WRITEABLE_TARGET}plplot)
list(APPEND installed_ocaml_LIBRARIES_FLAGS -ccopt "-L${CMAKE_INSTALL_LIBDIR_ESCAPED}" -cclib -l${WRITEABLE_TARGET}plplot)
endif(NOT BUILD_SHARED_LIBS)
# ocamlmklib links *.o into *.so and *.a
add_custom_command(
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/dllplplot_stubs.so
${CMAKE_CURRENT_BINARY_DIR}/libplplot_stubs.a
# N.B. every attempt to get rpath to work for dllplplot_stubs.so
# generated by this command has failed (as measured by "dll -r
# dllplplot_stubs.so" and "readelf -d dllplplot_stubs.so|grep -i
# rpath") for the ocamlopt case including specifying rpath with
# the -dllpath "${CMAKE_SOURCE_DIR_ESCAPED}/src" option or using
# any other of the 4 aliases of this option according to the
# ocamlmklib man page, or using a specific -ccopt "-Wl,-rpath
# -Wl,${CMAKE_SOURCE_DIR_ESCAPED}/src" (a form that is known to
# work for ocamlopt, and which the ocamlmklib documentation says
# [apparently incorrectly] is passed on to both ocamlc and
# ocamlopt as appropriate). This failure is likely the cause
# of the ldd -r errors for the ocaml examples unless they are created
# with ocamlc or ocamlopt using the appropriate rpath option.
COMMAND ${OCAMLMKLIB} -o plplot_stubs -L${CAMLIDL_LIB_DIR} -lcamlidl ${ocaml_LIBRARIES_FLAGS} plplot_core_stubs.o plplot_impl.o
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/plplot_core_stubs.o
${CMAKE_CURRENT_BINARY_DIR}/plplot_impl.o
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
VERBATIM
)
add_custom_command(
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/dllinstalled_plplot_stubs.so
${CMAKE_CURRENT_BINARY_DIR}/libinstalled_plplot_stubs.a
# N.B. every attempt to get rpath to work for dllplplot_stubs.so
# generated by this command has failed (as measured by "dll -r
# dllplplot_stubs.so" and "readelf -d dllplplot_stubs.so|grep -i
# rpath") for the ocamlopt case including specifying rpath with
# the -dllpath "${CMAKE_SOURCE_DIR_ESCAPED}/src" option or using
# any other of the 4 aliases of this option according to the
# ocamlmklib man page, or using a specific -ccopt "-Wl,-rpath
# -Wl,${CMAKE_SOURCE_DIR_ESCAPED}/src" (a form that is known to
# work for ocamlopt, and which the ocamlmklib documentation says
# [apparently incorrectly] is passed on to both ocamlc and
# ocamlopt as appropriate). This failure is likely the cause
# of the ldd -r errors for the ocaml examples unless they are created
# with ocamlc or ocamlopt using the appropriate rpath option.
COMMAND ${OCAMLMKLIB} -o installed_plplot_stubs -L${CAMLIDL_LIB_DIR} -lcamlidl ${installed_ocaml_LIBRARIES_FLAGS} plplot_core_stubs.o plplot_impl.o
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/plplot_core_stubs.o
${CMAKE_CURRENT_BINARY_DIR}/plplot_impl.o
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
VERBATIM
)
add_custom_target(target_lib_plplot_stubs
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/dllplplot_stubs.so
${CMAKE_CURRENT_BINARY_DIR}/libplplot_stubs.a
${CMAKE_CURRENT_BINARY_DIR}/dllinstalled_plplot_stubs.so
${CMAKE_CURRENT_BINARY_DIR}/libinstalled_plplot_stubs.a
)
# ocamlc -c compiles *.mli into *.cmi
add_custom_command(
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/plplot_core.cmi
${CMAKE_CURRENT_BINARY_DIR}/plplot.mli
${CMAKE_CURRENT_BINARY_DIR}/plplot.cmi
COMMAND ${OCAMLC} -c plplot_core.mli
# ocamlc *.mli source file must be in ${CMAKE_CURRENT_BINARY_DIR}.
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/plplot.mli
${CMAKE_CURRENT_BINARY_DIR}/plplot.mli
COMMAND ${OCAMLC} -c plplot.mli
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/plplot_core.mli
${CMAKE_CURRENT_SOURCE_DIR}/plplot.mli
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
VERBATIM
)
add_custom_target(target_plplot_cmi
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/plplot_core.cmi
${CMAKE_CURRENT_BINARY_DIR}/plplot.mli
${CMAKE_CURRENT_BINARY_DIR}/plplot.cmi
)
# Have separate custom command for this copy step because ${CMAKE_CURRENT_BINARY_DIR}/plplot.ml
# used in two different custom commands below.
add_custom_command(
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/plplot.ml
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/plplot.ml
${CMAKE_CURRENT_BINARY_DIR}/plplot.ml
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/plplot.ml
VERBATIM
)
# ocamlc -c compiles *.ml into *.cmo and simultaneously checks against
# *.cmi produced from *.mli above.
add_custom_command(
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/plplot_core.cmo
${CMAKE_CURRENT_BINARY_DIR}/plplot.cmo
COMMAND ${OCAMLC} -c plplot_core.ml
# ${CMAKE_CURRENT_BINARY_DIR}/plplot.ml created by previous custom command.
COMMAND ${OCAMLC} -c plplot.ml
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/plplot_core.ml
${CMAKE_CURRENT_BINARY_DIR}/plplot.ml
${CMAKE_CURRENT_BINARY_DIR}/plplot_core.cmi
${CMAKE_CURRENT_BINARY_DIR}/plplot.cmi
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
VERBATIM
)
add_custom_target(target_plplot_cmo
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/plplot_core.cmo
${CMAKE_CURRENT_BINARY_DIR}/plplot.cmo
)
# ocamlc -a -custom builds a *.cma library from *.cmo
add_custom_command(
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/plplot.cma
COMMAND ${OCAMLC} -a -custom -o plplot.cma plplot_core.cmo plplot.cmo -dllib -lplplot_stubs -ccopt -L. -cclib -lplplot_stubs -ccopt -L${CAMLIDL_LIB_DIR} -cclib -lcamlidl ${ocaml_LIBRARIES_FLAGS}
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/plplot_core.cmo
${CMAKE_CURRENT_BINARY_DIR}/plplot.cmo
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
VERBATIM
)
add_custom_command(
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/installed_plplot.cma
COMMAND ${OCAMLC} -a -custom -o installed_plplot.cma plplot_core.cmo plplot.cmo -dllib -lplplot_stubs -ccopt -L. -cclib -lplplot_stubs -ccopt -L${CAMLIDL_LIB_DIR} -cclib -lcamlidl ${installed_ocaml_LIBRARIES_FLAGS}
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/plplot_core.cmo
${CMAKE_CURRENT_BINARY_DIR}/plplot.cmo
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
VERBATIM
)
add_custom_target(target_plplot_cma
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/plplot.cma
${CMAKE_CURRENT_BINARY_DIR}/installed_plplot.cma
)
# These targets depend on common files in their respective
# file-dependency chains. Therefore, to avoid screwing up parallel
# builds must serialize with these target depends.
add_dependencies(target_plplot_cmi target_lib_plplot_stubs)
add_dependencies(target_plplot_cmo target_plplot_cmi)
add_dependencies(target_plplot_cma target_plplot_cmo)
add_custom_target(plplot_ocaml ALL)
if(OCAMLOPT)
# ocamlopt compiles *.ml into *.o and *.cmx and simultaneously
# checks against *.cmi produced from *.mli above.
add_custom_command(
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/plplot_core.cmx
${CMAKE_CURRENT_BINARY_DIR}/plplot_core.o
${CMAKE_CURRENT_BINARY_DIR}/plplot.cmx
${CMAKE_CURRENT_BINARY_DIR}/plplot.o
COMMAND ${OCAMLOPT} -c plplot_core.ml
# ${CMAKE_CURRENT_BINARY_DIR}/plplot.ml created by previous custom command.
COMMAND ${OCAMLOPT} -c plplot.ml
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/plplot_core.ml
${CMAKE_CURRENT_BINARY_DIR}/plplot.ml
${CMAKE_CURRENT_BINARY_DIR}/plplot_core.cmi
${CMAKE_CURRENT_BINARY_DIR}/plplot.cmi
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
VERBATIM
)
add_custom_target(target_plplot_cmx
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/plplot_core.cmx
${CMAKE_CURRENT_BINARY_DIR}/plplot_core.o
${CMAKE_CURRENT_BINARY_DIR}/plplot.cmx
${CMAKE_CURRENT_BINARY_DIR}/plplot.o
)
# ocamlopt -a builds the libraries *.cmxa and *.a respectively from
# the *.cmx and *.o files. The plplot_stubs library also plays
# a role.
add_custom_command(
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/plplot.cmxa
${CMAKE_CURRENT_BINARY_DIR}/plplot.a
COMMAND ${OCAMLOPT} -a -o plplot.cmxa plplot_core.cmx plplot.cmx -ccopt -L. -cclib -lplplot_stubs -ccopt -L${CAMLIDL_LIB_DIR} -cclib -lcamlidl ${ocaml_LIBRARIES_FLAGS}
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/plplot_core.cmx
${CMAKE_CURRENT_BINARY_DIR}/plplot.cmx
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
VERBATIM
)
add_custom_command(
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/installed_plplot.cmxa
${CMAKE_CURRENT_BINARY_DIR}/installed_plplot.a
COMMAND ${OCAMLOPT} -a -o installed_plplot.cmxa plplot_core.cmx plplot.cmx -ccopt -L. -cclib -lplplot_stubs -ccopt -L${CAMLIDL_LIB_DIR} -cclib -lcamlidl ${installed_ocaml_LIBRARIES_FLAGS}
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/plplot_core.cmx
${CMAKE_CURRENT_BINARY_DIR}/plplot.cmx
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
VERBATIM
)
add_custom_target(target_plplot_cmxa
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/plplot.cmxa
${CMAKE_CURRENT_BINARY_DIR}/plplot.a
${CMAKE_CURRENT_BINARY_DIR}/installed_plplot.cmxa
${CMAKE_CURRENT_BINARY_DIR}/installed_plplot.a
)
# Must serialize these targets against highest dependency ocamlc
# target, target_plplot_cma, because of common custom commands in
# their file-dependency chains which would be screwed up in a
# parallel build without this serialization.
add_dependencies(target_plplot_cmx target_plplot_cma)
add_dependencies(target_plplot_cmxa target_plplot_cmx)
add_dependencies(plplot_ocaml target_plplot_cmxa)
# Need to keep track of file dependencies since this is a custom target.
set_property(GLOBAL PROPERTY FILES_plplot_ocaml
${CMAKE_CURRENT_BINARY_DIR}/plplot.cmxa
${CMAKE_CURRENT_BINARY_DIR}/plplot.a
)
else (OCAMLOPT)
add_dependencies(plplot_ocaml target_plplot_cma)
# Need to keep track of file dependencies since this is a custom target.
set_property(GLOBAL PROPERTY FILES_plplot_ocaml
${CMAKE_CURRENT_BINARY_DIR}/plplot.cma
)
endif(OCAMLOPT)
if(OCAMLDOC)
# Build OCaml API reference documentation
set(OCAMLDOC_FILE_LIST
Plplot.Plot.html
Plplot.Quick_plot.html
Plplot.html
index.html
index_attributes.html
index_class_types.html
index_classes.html
index_exceptions.html
index_methods.html
index_module_types.html
index_modules.html
index_types.html
index_values.html
style.css
type_Plplot.Plot.html
type_Plplot.Quick_plot.html
type_Plplot.html
)
set(OCAMLDOC_FILES)
foreach(html_file ${OCAMLDOC_FILE_LIST})
list(APPEND OCAMLDOC_FILES ${CMAKE_CURRENT_BINARY_DIR}/${html_file})
endforeach(html_file ${OCAMLDOC_FILE_LIST})
# ocamldoc builds the module's documentation using specially formatted
# comments in the source file.
add_custom_command(
OUTPUT ${OCAMLDOC_FILES}
COMMAND ${OCAMLDOC} -html plplot.mli
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/plplot.mli
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
VERBATIM
)
add_custom_target(target_build_ocaml_doc DEPENDS ${OCAMLDOC_FILES})
# associated custom command has common file depends with custom command
# that is associated with target_plplot_cmi. Therefore must serialize
# the two custom targets.
add_dependencies(target_plplot_cmi target_build_ocaml_doc)
endif(OCAMLDOC)
# Basic build done, now trying to finish up by adapting bits
# and pieces of old build procedure below.
# Configure the META file
configure_file(META.in ${CMAKE_CURRENT_BINARY_DIR}/META)
# Most files should be installed in the plplot subdirectory
# Install files that do not have to be renamed.
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/plplot.cmi
${CMAKE_CURRENT_BINARY_DIR}/plplot.mli
${CMAKE_CURRENT_BINARY_DIR}/META
DESTINATION ${OCAML_INSTALL_DIR}/plplot
)
if(OCAMLOPT)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/plplot.cmx
DESTINATION ${OCAML_INSTALL_DIR}/plplot
)
endif(OCAMLOPT)
# Install files that have to be renamed.
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/libinstalled_plplot_stubs.a
DESTINATION ${OCAML_INSTALL_DIR}/plplot
RENAME libplplot_stubs.a
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/installed_plplot.cma
DESTINATION ${OCAML_INSTALL_DIR}/plplot
RENAME plplot.cma
)
if(OCAMLOPT)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/installed_plplot.cmxa
DESTINATION ${OCAML_INSTALL_DIR}/plplot
RENAME plplot.cmxa
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/installed_plplot.a
DESTINATION ${OCAML_INSTALL_DIR}/plplot
RENAME plplot.a
)
endif(OCAMLOPT)
# Shared library stubs go in stublibs. Use SO_PERMISSIONS to be
# consistent with permissions used for other shared objects.
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/dllinstalled_plplot_stubs.so
DESTINATION ${OCAML_INSTALL_DIR}/stublibs
PERMISSIONS ${SO_PERMISSIONS}
RENAME dllplplot_stubs.so
)
# Configure pkg-config *.pc file corresponding to plplot.cma
# Nothing should have to be done here for the static case since
# that should all be taken care of by the configuration of
# plplot.pc.
pkg_config_file("ocaml" "OCaml" " OCaml binding" "plplot" "" "")
endif(ENABLE_ocaml)

9
src/3rdparty/plplot/bindings/ocaml/META.in vendored Executable file
View File

@ -0,0 +1,9 @@
# findlib META file for ocaml-plplot
requires = ""
description = "PLplot library bindings"
version = "@PLPLOT_VERSION@"
browse_interfaces = " Plplot "
linkopts = "-ccopt \"-L@LIB_DIR@\""
archive(byte) = "plplot.cma"
archive(native) = "plplot.cmxa"

123
src/3rdparty/plplot/bindings/ocaml/README vendored Executable file
View File

@ -0,0 +1,123 @@
This is an interface to PLplot (http://plplot.org/) for the
Objective Caml language.
* REQUIREMENTS
- OCaml (currently tested with 4.0.1 and later, but earlier versions
may work.)
- camlidl
* FILES
This is a list of the files which make up the OCaml bindings, along with a
description of their purpose.
- plplot_h:
This is a simplified version of include/plplot.h
- touchup.ml:
This script processes plplot_h to add some annotations to make the
file ready for use with camlidl.
N.B. the above two files are used to indirectly generate plplot_h.inc on Linux
as follows:
Use the CMake option -DGENERATE_PLPLOT_H_INC=ON, and build the target
check_plplot_h.inc. That target uses the above two files to generate
bindings/ocaml/generated_plplot_h.inc in the build tree, and compares
that result with bindings/ocaml/plplot_h.inc in the source tree. If
those two files differ, the check_plplot_h.inc target will fail, and
you should look carefully at the differences to make sure they are
what is desired from your change(s) to plplot_h and/or touchup.ml.
Assuming the changes are the desired ones, copy
bindings/ocaml/generated_plplot_h.inc in the build tree to
bindings/ocaml/plplot_h.inc which will make this target succeed until
the next change to plplot_h and/or touchup.ml.
Code generation (used in the CMake build system to automatically generate code):
- plplot_h.inc:
This is a simplified and annotated version of include/plplot.h,
generated by touchup.ml, which contains camlidl-ready definitions of
most of the PLplot functions.
- plplot_core.idl:
This file (which includes plotplot_h.inc) contains the definitions
of all of the functions and data types required to generate the
OCaml binding for the C PLplot API. camlidl uses this file to
produce the C and OCaml code required to interface with the core
PLplot API.
Hand-written source code (used in the CMake build system):
- plplot_impl.c:
This file contains C stubs for functions which are not currently
handled correctly by camlidl. For example, this includes functions
which take callbacks and void pointers as arguments.
- plplot.mli:
This file contains the Plplot OCaml module interface definition and
ocamldoc comments.
- plplot.ml:
This file contains an OCaml-specific interface to parts of the OCaml
binding for the C PLplot API. For example, higher level wrappers
for the OCaml API for pllegend and plcolorbar are implemented here.
This is a work-in-progress by Hez for those interested in a native
OCaml look for plotting, but it is not a file where changes need to
be made when introducing new API in order to get our standard OCaml
examples to work correctly (i.e., give the same results as the
corresponding C examples).
Misc:
- META.cmake (processed by CMake to produce META)
A findlib-compatible META-file. The PLplot OCaml bindings can be
used with findlib (ocamlfind and the OCaml toplevel). Please see
the OCaml section of the PLplot documentation for more information
on using findlib with the OCaml PLplot bindings.
- README
This file.
* NOTES
Changes to the above files are typically required when implementing
additional PLplot API. There are two broad categories to consider
here.
1. PLplot API that can be generated by camlidl using plplot_h and
touchup.ml
This category is the vast majority of PLplot API. In this category I
recently added plsurf3dl to the OCaml binding. That addition required
the following changes:
- Update plplot_h to describe the C API of the added routine for the
benefit of camlidl.
- Update touchup.ml to handle the unique index arguments of that
function. It turned out that there is some bug in touchup.ml so I
could not do that by adding a stanza to manual_function_attributes,
but adding a stanza to the list in the parameter_attributes function
did the job.
- Update plplot_h.inc using the procedure described above.
2. PLplot API that cannot be generated by camlidl (e.g., if the
function arguments include a callback function.) In this category I
recently added plmapline, plmapstring, plmaptex, and plmapfill
following what had previously been done for plmap. Those additions
required the following changes:
- Update plplot_impl.c to add these additional plmap* variants.
- Update plplot_core.idl to add these additional plmap* variants
To follow up with adding PLplot API in either category 1. or 2. the following change
is required:
- Update plplot.mli to describe the OCaml module interface definition
of the added routine(s). If you forget to do this or there is some
inconsistency in how you describe the interface definition, then
attempting to build the plplot_ocaml target will error out with a
fairly good description of the inconsistency.

View File

@ -0,0 +1,273 @@
# -*- mode: cmake -*-
# bindings/ocaml/plcairo/CMakeLists.txt
#
#
# Copyright (C) 2008 Andrew Ross
# Copyright (C) 2009-2018 Alan W. Irwin
# Copyright (C) 2009 Hezekiah M. Carty
#
# 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 PLplot; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
if(ENABLE_ocaml AND OCAML_HAS_CAIRO)
# locations of plplot.cma and plplot.cmxa
set(PATH_TO_PLPLOT_CMA ${CMAKE_BINARY_DIR}/bindings/ocaml)
set(PATH_TO_PLPLOT_CMXA ${CMAKE_BINARY_DIR}/bindings/ocaml)
# ocamlc -c compiles *.c into *.o.
# ocamlmklib links *.o into *.so and *.a
string(REGEX REPLACE " " ";" CAIRO_LINK_FLAGS_LIST "${CAIRO_LINK_FLAGS}")
#message(STATUS "DEBUG: CAIRO_LINK_FLAGS_LIST = ${CAIRO_LINK_FLAGS_LIST}")
add_custom_command(
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/plcairo_impl.o
${CMAKE_CURRENT_BINARY_DIR}/dllplcairo_stubs.so
${CMAKE_CURRENT_BINARY_DIR}/libplcairo_stubs.a
COMMAND ${OCAMLC} -ccopt "${CAIRO_COMPILE_FLAGS}" -cclib "${CAIRO_LINK_FLAGS}" -ccopt -I${CMAKE_SOURCE_DIR}/include -ccopt -I${CMAKE_BINARY_DIR}/include -ccopt -I${CMAKE_SOURCE_DIR}/lib/qsastime -ccopt -I${CMAKE_BINARY_DIR} -ccopt -I${CMAKE_BINARY_DIR}/lib/qsastime -ccopt -DPLPLOT_HAVE_CONFIG_H -c ${CMAKE_CURRENT_SOURCE_DIR}/plcairo_impl.c
COMMAND ${OCAMLMKLIB} -o plcairo_stubs ${CAIRO_LINK_FLAGS_LIST} -L${CMAKE_BINARY_DIR}/src -l${WRITEABLE_TARGET}plplot ${CMAKE_CURRENT_BINARY_DIR}/plcairo_impl.o
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/plcairo_impl.c
plplot
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_target(target_lib_plcairo_stubs
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/dllplcairo_stubs.so
${CMAKE_CURRENT_BINARY_DIR}/libplcairo_stubs.a
)
# ocamlfind ocamlc -c compiles *.mli into *.cmi
add_custom_command(
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/plcairo.mli
${CMAKE_CURRENT_BINARY_DIR}/plcairo.cmi
# ocamlc *.mli source file must be in ${CMAKE_CURRENT_BINARY_DIR}.
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/plcairo.mli
${CMAKE_CURRENT_BINARY_DIR}/plcairo.mli
COMMAND ${OCAMLFIND} ocamlc -package cairo2 -c ${CMAKE_CURRENT_BINARY_DIR}/plcairo.mli
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/plcairo.mli
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_target(target_plcairo_cmi
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/plcairo.mli
${CMAKE_CURRENT_BINARY_DIR}/plcairo.cmi
)
# ocamlfind ocamlc -c compiles *.ml into *.cmo and simultaneously
# checks against *.cmi produced from *.mli above.
add_custom_command(
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/plcairo.cmo
${CMAKE_CURRENT_BINARY_DIR}/plcairo.ml
# ocamlc and ocamlopt *.ml source file must be in
# ${CMAKE_CURRENT_BINARY_DIR}.
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/plcairo.ml
${CMAKE_CURRENT_BINARY_DIR}/plcairo.ml
COMMAND ${OCAMLFIND} ocamlc -package cairo2 -I ${PATH_TO_PLPLOT_CMA} plplot.cma -c ${CMAKE_CURRENT_BINARY_DIR}/plcairo.ml
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/plcairo.ml
${CMAKE_CURRENT_BINARY_DIR}/plcairo.cmi
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_target(target_plcairo_cmo
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/plcairo.cmo
${CMAKE_CURRENT_BINARY_DIR}/plcairo.ml
)
# ocamlc -a -custom builds a *.cma library from *.cmo
add_custom_command(
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/plcairo.cma
COMMAND ${OCAMLC} -a -custom -o ${CMAKE_CURRENT_BINARY_DIR}/plcairo.cma -I ${PATH_TO_PLPLOT_CMA} plplot.cma ${CMAKE_CURRENT_BINARY_DIR}/plcairo.cmo -dllib -lplcairo_stubs -ccopt -L${CMAKE_CURRENT_BINARY_DIR} -cclib -lplcairo_stubs -ccopt -L${CMAKE_BINARY_DIR}/src -cclib -l${WRITEABLE_TARGET}plplot -dllpath ${CMAKE_BINARY_DIR}/src
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/plcairo.cmo
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_target(target_plcairo_cma
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/plcairo.cma
)
# These targets depend on common files in their respective
# file-dependency chains. Therefore, to avoid screwing up parallel
# builds must serialize with target depends.
add_dependencies(target_plcairo_cmi target_lib_plcairo_stubs target_plplot_cma)
add_dependencies(target_plcairo_cmo target_plcairo_cmi)
add_dependencies(target_plcairo_cma target_plcairo_cmo)
add_custom_target(plcairo_ocaml ALL)
if(OCAMLOPT)
# ocamlfind ocamlopt compiles *.ml into *.o and *.cmx and simultaneously
# checks against *.cmi produced from *.mli above.
add_custom_command(
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/plcairo.cmx
${CMAKE_CURRENT_BINARY_DIR}/plcairo.o
${CMAKE_CURRENT_BINARY_DIR}/plcairo.ml
# ocamlc and ocamlopt *.ml source file must be in
# ${CMAKE_CURRENT_BINARY_DIR}.
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/plcairo.ml
${CMAKE_CURRENT_BINARY_DIR}/plcairo.ml
COMMAND ${OCAMLFIND} ocamlopt -package cairo2 -I ${PATH_TO_PLPLOT_CMXA} -c ${CMAKE_CURRENT_BINARY_DIR}/plcairo.ml
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/plcairo.ml
${CMAKE_CURRENT_BINARY_DIR}/plcairo.cmi
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_target(target_plcairo_cmx
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/plcairo.cmx
${CMAKE_CURRENT_BINARY_DIR}/plcairo.o
${CMAKE_CURRENT_BINARY_DIR}/plcairo.ml
)
# ocamlopt -a builds the libraries *.cmxa and *.a respectively from
# the *.cmx and *.o files. The plplot_stubs library also plays
# a role.
add_custom_command(
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/plcairo.cmxa
${CMAKE_CURRENT_BINARY_DIR}/plcairo.a
COMMAND ${OCAMLOPT} -a -o ${CMAKE_CURRENT_BINARY_DIR}/plcairo.cmxa -I ${PATH_TO_PLPLOT_CMXA} ${CMAKE_CURRENT_BINARY_DIR}/plcairo.cmx -ccopt -L${CMAKE_CURRENT_BINARY_DIR} -cclib -lplcairo_stubs -ccopt -L${CMAKE_BINARY_DIR}/src -cclib -l${WRITEABLE_TARGET}plplot
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/plcairo.cmx
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_target(target_plcairo_cmxa
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/plcairo.cmxa
)
# Must serialize these targets against highest dependency ocamlc
# target, target_plplot_cma, because of common custom commands in
# their file-dependency chains which would be screwed up in a
# parallel build without this serialization.
add_dependencies(target_plcairo_cmx target_plcairo_cma target_plplot_cmxa)
add_dependencies(target_plcairo_cmxa target_plcairo_cmx)
add_dependencies(plcairo_ocaml target_plcairo_cmxa)
# Need to keep track of file dependencies since this is a custom target.
set_property(GLOBAL PROPERTY FILES_plcairo_ocaml
${CMAKE_CURRENT_BINARY_DIR}/plcairo.cmxa
${CMAKE_CURRENT_BINARY_DIR}/plcairo.a
)
else (OCAMLOPT)
add_dependencies(plcairo_ocaml target_plcairo_cma)
# Need to keep track of file dependencies since this is a custom target.
set_property(GLOBAL PROPERTY FILES_plcairo_ocaml
${CMAKE_CURRENT_BINARY_DIR}/plcairo.cma
)
endif(OCAMLOPT)
if(OCAMLFIND AND OCAMLDOC)
# Build OCaml API reference documentation
set(OCAMLDOC_FILE_LIST
Plcairo.html
index.html
index_attributes.html
index_class_types.html
index_classes.html
index_exceptions.html
index_methods.html
index_module_types.html
index_modules.html
index_types.html
index_values.html
style.css
type_Plcairo.html
)
set(OCAMLDOC_FILES)
foreach(html_file ${OCAMLDOC_FILE_LIST})
list(APPEND OCAMLDOC_FILES ${CMAKE_CURRENT_BINARY_DIR}/${html_file})
endforeach(html_file ${OCAMLDOC_FILE_LIST})
# ocamldoc builds the module's documentation using specially formatted
# comments in the source file. Source can be a .ml or a .mli.
add_custom_command(
OUTPUT ${OCAMLDOC_FILES}
COMMAND ${OCAMLFIND} doc -package cairo2 -html ${CMAKE_CURRENT_SOURCE_DIR}/plcairo.mli
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/plcairo.mli
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_target(target_build_ocaml_plcairo_doc DEPENDS ${OCAMLDOC_FILES})
# associated custom command has common file depends with custom command
# that is associated with target_plplot_cmi. Therefore must serialize
# the two custom targets.
add_dependencies(target_plcairo_cmi target_build_ocaml_plcairo_doc)
endif(OCAMLFIND AND OCAMLDOC)
# These targets depend on common files in their respective
# file-dependency chains. Therefore, to avoid screwing up parallel
# builds must serialize with target depends.
add_dependencies(target_plcairo_cmi target_lib_plcairo_stubs)
# ocamlc used regardless
add_dependencies(target_plcairo_cmo target_plcairo_cmi)
add_dependencies(target_plcairo_cma target_plcairo_cmo)
# ocamlopt only used if OCAMLOPT is true.
if(OCAMLOPT)
add_dependencies(target_plcairo_cmx target_plcairo_cmi)
add_dependencies(target_plcairo_cmxa target_plcairo_cmx)
endif(OCAMLOPT)
# Basic build done, now trying to finish up by adapting bits
# and pieces of old build procedure below.
# Configure the META file
configure_file(META.in ${CMAKE_CURRENT_BINARY_DIR}/META)
add_custom_target(plplot_ocaml_plcairo ALL)
if (OCAMLOPT)
add_dependencies(plplot_ocaml_plcairo target_plcairo_cma target_plcairo_cmxa)
else (OCAMLOPT)
add_dependencies(plplot_ocaml_plcairo target_plcairo_cma)
endif (OCAMLOPT)
set(OCAML_FULL_INSTALL_FILES
${CMAKE_CURRENT_BINARY_DIR}/plcairo.cma
${CMAKE_CURRENT_BINARY_DIR}/plcairo.cmi
${CMAKE_CURRENT_BINARY_DIR}/libplcairo_stubs.a
${CMAKE_CURRENT_BINARY_DIR}/plcairo.mli
)
if (OCAMLOPT)
set(OCAML_FULL_INSTALL_FILES
${OCAML_FULL_INSTALL_FILES}
${CMAKE_CURRENT_BINARY_DIR}/plcairo.cmxa
${CMAKE_CURRENT_BINARY_DIR}/plcairo.a
)
endif (OCAMLOPT)
# Most files go in the plcairo subdirectory
install(FILES ${OCAML_FULL_INSTALL_FILES} ${CMAKE_CURRENT_BINARY_DIR}/META
DESTINATION ${OCAML_INSTALL_DIR}/plcairo
)
# Shared library stubs go in stublibs. Use SO_PERMISSIONS to be
# consistent with permissions used for other shared objects.
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/dllplcairo_stubs.so
DESTINATION ${OCAML_INSTALL_DIR}/stublibs
PERMISSIONS ${SO_PERMISSIONS}
)
endif(ENABLE_ocaml AND OCAML_HAS_CAIRO)

View File

@ -0,0 +1,9 @@
# Specifications for PLplot Cairo library
requires = "plplot"
requires += "cairo"
description = "PLplot Cairo extras"
version = "@PLPLOT_VERSION@"
browse_interfaces = " Plcairo "
archive(byte) = "plcairo.cma"
archive(native) = "plcairo.cmxa"

View File

@ -0,0 +1,291 @@
(*
Copyright 2008, 2009, 2010 Hezekiah M. Carty
This file is part of PLplot.
PLplot is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with PLplot. If not, see <http://www.gnu.org/licenses/>.
*)
(** Support for the extcairo PLplot device from OCaml. *)
open Plplot
open Printf
module Option = struct
let may f o =
match o with
| Some x -> f x
| None -> ()
let default x_default o =
match o with
| Some x -> x
| None -> x_default
let map_default f x_default o =
match o with
| Some x -> f x
| None -> x_default
end
(** A record to keep track of the Cairo surface and context information *)
type 'a t = {
width : float; (** Width in device units *)
height : float; (** Height in device units *)
surface : Cairo.Surface.t; (** Cairo surface to plot to *)
context : Cairo.context; (** Cairo context to plot to *)
file : 'a option; (** An optional file name or stream for the plot output *)
clear : bool; (** Should each new page be cleared? *)
plstream : int; (** PLplot stream number associated with this plot *)
}
(** Types of Cairo surfaces available for {!init}. *)
type 'a plcairo_sfc_t =
width:int -> height:int -> string option -> 'a option * Cairo.Surface.t
(** Provide PLplot with a Cairo context to plot on. *)
external plset_cairo_context : Cairo.context -> unit = "ml_set_plplot_cairo_context"
(** Get the various components of a {!t} instance *)
let plget_dims t = t.width, t.height
let plget_surface t = t.surface
let plget_context t = t.context
let plget_stream t = t.plstream
let plget_output t = t.file
(** [plblit_to_cairo ?xoff ?yoff ?scale_by plcairo dest] *)
let plblit_to_cairo ?(xoff = 0.0) ?(yoff = 0.0) ?scale_by t dest =
let x, y =
match scale_by with
| None -> 1.0, 1.0
| Some scale -> (
match scale with
| `width width -> let scale = width /. t.width in scale, scale
| `height height -> let scale = height /. t.height in scale, scale
| `both (width, height) -> width /. t.width, height /. t.height
)
in
Cairo.save dest;
begin
Cairo.scale ~x ~y dest;
Cairo.set_source_surface dest t.surface xoff yoff;
Cairo.paint dest;
end;
Cairo.restore dest;
()
(** [plrasterize ?alpha t f] applies the plotting function [f ()] to [t] *)
let plrasterize ?alpha ?(antialias = Cairo.ANTIALIAS_NONE) t f =
(* TODO FIXME: This function should only pain the actual (semi-)opaque pixels
in the source image. As it is, each call to this function will generate
an image the size of the source canvas which will often not be the
desired effect. *)
(* Create a Cairo image surface and context to plot the rasterized image
on. This will be a duplicate in size and shape of the current plot's
surface. Leave the background transparent, so only the plotted image
is transfered over to the main plot surface. *)
let img_sfc =
Cairo.Image.create
Cairo.Image.ARGB32
~width:(int_of_float t.width)
~height:(int_of_float t.height)
in
let img_context = Cairo.create img_sfc in
(* Assign the transformation matrix from the main plot context to maintain
consistency. It will also have to be applied to the main plot context
again once back to it. *)
let t_matrix = Cairo.get_matrix t.context in
Cairo.set_matrix img_context t_matrix;
plset_cairo_context img_context;
(* Make sure antialiasing is turned OFF for the. The output looks bad
otherwise. *)
Cairo.set_antialias img_context antialias;
(* This will now be plotted on to the Cairo image surface. *)
f ();
(* Blit the raster image on to the main plot surface *)
Cairo.set_source_surface t.context img_sfc 0.0 0.0;
Cairo.paint ?alpha t.context;
(* Now set PLplot back to using the proper plot context. *)
plset_cairo_context t.context;
Cairo.set_matrix t.context t_matrix;
(* Don't forget to do a [Cairo.surface_finish] when everything is done!
That isn't done here because the plot may not be finished yet. *)
()
(*
(** FIXME TODO XXX : I don't think this works properly yet.
[plxy_to_cairoxy ~x ~y context] will convert the plot world
coordinates [x, y] to Cairo device coordinates. *)
let plxy_to_cairoxy context ~x ~y =
(* Normalized device coordinates *)
let nxmin, nxmax, nymin, nymax = plgvpd () in
(* World (plot-space) coordinates *)
let wxmin, wxmax, wymin, wymax = plgvpw () in
(* Cairo device coordinates *)
let xmin = context.width *. nxmin in
let xmax = context.width *. nxmax in
let ymin = context.height *. nymin in
let ymax = context.height *. nymax in
(* World coordinates -> Cairo coordinates *)
xmin +. ((xmax -. xmin) *. (x /. (wxmax -. wxmin))),
ymin +. ((ymax -. ymin) *. (y /. (wymax -. wymin)))
*)
(** [with_stream ?stream f] calls [f ()] with [stream] as the active
plotting stream if [stream] is present. Otherwise it just calls
[f ()]. *)
let with_stream ?stream f =
match stream with
| None -> f ()
| Some s ->
let old_stream = plgstrm () in
plsstrm s.plstream;
let result = f () in
plsstrm old_stream;
result
(** [plcairo_new_page t] will advance the Cairo context associated with [t] to
a new page, for devices which support this. *)
let plcairo_new_page t =
Cairo.show_page t.context;
(* TODO: Is the call to plclear () the right thing to do here? *)
if t.clear then with_stream ~stream:t (fun () -> pladv 0; plclear ()) else ()
(** The following 4 functions provide a relatively simple way to setup an
appropriate Cairo surface for use with this library and the extcairo
driver. They should be passed as the [init] argument to the
[plinit_cairo] function.*)
let plpscairo ~width ~height filename =
let outfile =
match filename with
| Some f -> open_out f
| None -> raise (Invalid_argument "plpscairo needs a filename")
in
Some outfile,
Cairo.PS.create_for_stream
~output:(fun bytes -> output_string outfile bytes)
~width:(float_of_int width)
~height:(float_of_int height)
let plpdfcairo ~width ~height filename =
let outfile =
match filename with
| Some f -> open_out f
| None -> raise (Invalid_argument "plpdfcairo needs a filename")
in
Some outfile,
Cairo.PDF.create_for_stream
~output:(fun bytes -> output_string outfile bytes)
~width:(float_of_int width)
~height:(float_of_int height)
let plimagecairo ~width ~height (filename : string option) =
filename,
Cairo.Image.create Cairo.Image.RGB24 ~width ~height
let plimagecairo_rgba ~width ~height (filename : string option) =
filename,
Cairo.Image.create Cairo.Image.ARGB32 ~width ~height
(** [plinit_cairo ?filename ?clear ?pre (width, height) init] creates a Cairo
context and associates it with a new PLplot stream. *)
let plinit_cairo ?filename ?(clear = false) ?pre
(width, height) (init : 'a plcairo_sfc_t) =
let file, sfc = init ~width ~height filename in
let context = Cairo.create sfc in
(* Associate the Cairo context with PLplot, then initialize PLplot *)
let old_stream = plgstrm () in
let new_stream = plmkstrm () in
plsdev "extcairo";
plsetopt "geometry" (sprintf "%dx%d" width height);
Option.may (fun f -> f ()) pre;
plinit ();
(* Associate our new Cairo context with the PLplot stream. *)
plset_cairo_context context;
(* Clear the plot if requested and restore the previously active plot
stream. *)
if clear then (pladv 0; plclear ()) else ();
plsstrm old_stream;
(* Return the Cairo information so that the plot surface can be manipulated
and/or saved late. *)
{
width = float_of_int width;
height = float_of_int height;
surface = sfc;
context = context;
file = file;
clear = clear;
plstream = new_stream;
}
(** [plcairo_make_active t] sets PLplot to using the plot stream associated
with [t] the active plot stream. *)
let plcairo_make_active t = plsstrm t.plstream
(** [plcairo_finish t] calls [Cairo.surface_finish] on the Cairo surface
associated with [t]. *)
let plcairo_finish t =
Cairo.Surface.finish t.surface;
()
(** [plsave_cairo_image ?filename t] saves the plot surface in [t]
as a png to its associated file. If [filename] is given then the file is
saved with that name instead. {!Plplot.plend} should be called first or
the plotting may not be complete!
Raises [Invalid_argument "No filename associated with this plot" if no
filename is provided and [t] does not have a filename associated with it. *)
let plsave_cairo_image ?filename t =
let output_filename =
match filename with
| Some f -> f
| None -> (
match t.file with
| Some f -> f
| None -> invalid_arg "No filename associated with this plot"
)
in
Cairo.PNG.write t.surface output_filename;
()
(** [plsave_cairo ?filename t] is like {!plsave_cairo_image} but for
non-image surfaces. *)
let plsave_cairo t =
match t.file with
| Some fout ->
plcairo_finish t;
close_out fout;
()
| None -> invalid_arg "No filename associated with this plot"
(** NOTE TODO FIXME : This function will almost definitely change in a future
revision.
[plcairo_copy_plot t driver filename] copies the plot stream from
[t] to a new output stream, using the plot driver [driver], saving the
output to [filename]. *)
let plcairo_copy_plot t driver filename =
(* Get the current stream so we can restore it when done. *)
let old_stream = plgstrm () in
(* Make a new plot stream *)
ignore (plmkstrm ());
plsdev driver;
plsfnam filename;
let geometry = sprintf "%.0fx%.0f" t.width t.height in
plsetopt "geometry" geometry;
plinit ();
plcpstrm t.plstream true;
plreplot ();
plend1 ();
plsstrm old_stream;
()

View File

@ -0,0 +1,111 @@
(*
Copyright 2008, 2009, 2010 Hezekiah M. Carty
This file is part of PLplot.
PLplot is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with PLplot. If not, see <http://www.gnu.org/licenses/>.
*)
(** A record to keep track of the Cairo surface and context information *)
type 'a t
(** Types of Cairo surfaces available for {!plinit_cairo}. *)
type 'a plcairo_sfc_t
(** Provide PLplot with a Cairo context to plot on. *)
external plset_cairo_context : Cairo.context -> unit
= "ml_set_plplot_cairo_context"
(** Get the [(width, height)] of the surface in device units. *)
val plget_dims : 'a t -> float * float
(** Get the Cairo surface associated with [t]. *)
val plget_surface : 'a t -> Cairo.Surface.t
(** Get the Cairo context associated with [t]. *)
val plget_context : 'a t -> Cairo.context
(** Get the PLplot stream number associated with [t]. *)
val plget_stream : 'a t -> int
(** Get the output (filename, output stream or nothing) associated with [t]. *)
val plget_output : 'a t -> 'a option
(** [plblit_to_cairo ?xoff ?yoff ?scale_by plcairo dest]
blits the contents of [plcairo] to [dest].
Optionally, offset the blit by [xoff] and [yoff] and
scale by [`width w], [`height h] or [`both (w, h)]. *)
val plblit_to_cairo :
?xoff:float ->
?yoff:float ->
?scale_by:[< `both of float * float | `height of float | `width of float ] ->
'a t -> Cairo.context -> unit
(** [plrasterize ?alpha t f] applies the plotting function [f ()] to [t],
with the difference that the output will be rasterized for all plot
output drivers, including vector-based output drivers such as PS, PDF and
SVG.
The [alpha] parameter may be provided to make the rasterized overlay
transparent, even if the current color palette is not.
Note that the plotting done by [f ()] will not be antialiased by default. *)
val plrasterize :
?alpha:float ->
?antialias:Cairo.antialias -> 'a t -> (unit -> 'b) -> unit
(** [plcairo_new_page t] will advance the Cairo context associated with [t] to
a new page, for devices which support this. *)
val plcairo_new_page : 'a t -> unit
(** The following 4 functions provide a relatively simple way to setup an
appropriate Cairo surface for use with this library and the extcairo
driver. They should be passed as the [init] argument to the
[plinit_cairo] function.*)
val plpscairo : out_channel plcairo_sfc_t
val plpdfcairo : out_channel plcairo_sfc_t
val plimagecairo : string plcairo_sfc_t
val plimagecairo_rgba : string plcairo_sfc_t
(** [plinit_cairo ?filename ?clear ?pre (width, height) init] creates a Cairo
context and associates it with a new PLplot stream. *)
val plinit_cairo :
?filename:string ->
?clear:bool ->
?pre:(unit -> unit) ->
int * int -> 'a plcairo_sfc_t -> 'a t
(** [plcairo_make_active t] sets PLplot to using the plot stream associated
with [t] the active plot stream. *)
val plcairo_make_active : 'a t -> unit
(** [plcairo_finish t] calls [Cairo.surface_finish] on the Cairo surface
associated with [t]. *)
val plcairo_finish : 'a t -> unit
(** [plsave_cairo_image ?filename t] saves the plot surface in [t]
as a png to its associated file. If [filename] is given then the file is
saved with that name instead. One of [Plplot.plflush], [Plplot.plend] or
[Plplot.plend1] should be called first or the plotting may not be complete!
Raises [Invalid_argument "No filename associated with this plot"] if no
filename is provided and [t] does not have a filename associated with it. *)
val plsave_cairo_image : ?filename:string -> string t -> unit
(** [plsave_cairo ?filename t] is like {!plsave_cairo_image} but for
non-image surfaces. *)
val plsave_cairo : out_channel t -> unit
(** NOTE: This function will almost definitely change in a future revision.
[plcairo_copy_plot t driver filename] copies the plot stream from
[t] to a new output stream, using the plot driver [driver], saving the
output to [filename]. *)
val plcairo_copy_plot : 'a t -> string -> string -> unit

View File

@ -0,0 +1,47 @@
//
// Copyright 2008 Hezekiah M. Carty
//
// This file is part of PLplot.
//
// PLplot is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with PLplot. If not, see <http://www.gnu.org/licenses/>.
//
#include <plplotP.h>
// The "usual" OCaml includes
#include <caml/alloc.h>
#include <caml/callback.h>
#include <caml/fail.h>
#include <caml/memory.h>
#include <caml/misc.h>
#include <caml/mlvalues.h>
#include <caml/bigarray.h>
#include <plplot.h>
#include <cairo.h>
//* OCaml Cairo integration.
// Get a Cairo context from OCaml. These #defines are from the
// OCaml Cairo bindings.
#define wPointer_val( t, val ) ( *( (t **) Data_custom_val( val ) ) )
#define cairo_t_val( v ) wPointer_val( cairo_t, v )
value ml_set_plplot_cairo_context( value context )
{
CAMLparam1( context );
pl_cmd( PLESC_DEVINIT, cairo_t_val( context ) );
CAMLreturn( Val_unit );
}

View File

@ -0,0 +1,49 @@
(*
Copyright 2008, 2009 Hezekiah M. Carty
This file is part of PLplot.
PLplot is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with PLplot. If not, see <http://www.gnu.org/licenses/>.
*)
(* This is a Cairo-only example, meant as an illustration and test of the
technique used in the Plcairo.rasterize function. *)
open Cairo
let () =
let img =
Cairo.image_surface_create
Cairo.FORMAT_ARGB32 ~width:100 ~height:100
in
let outfile = open_out "test.ps" in
let ps =
Cairo_ps.surface_create_for_channel outfile
~width_in_points:1000.0 ~height_in_points:1000.0
in
let ct_img = Cairo.create img in
let ct_ps = Cairo.create ps in
(* Draw something on the image *)
Cairo.rectangle ~x:10.0 ~y:10.0 ~width:80.0 ~height:80.0 ct_img;
Cairo.fill ct_img;
Cairo.stroke ct_img;
(* Blit the image out to the Postscript. *)
Cairo.set_source_surface ct_ps img 0.0 0.0;
Cairo.paint ct_ps;
Cairo.surface_finish ps;
(* Save the files *)
Cairo_png.surface_write_to_file img "test.png";
close_out outfile;

View File

@ -0,0 +1,95 @@
(*
Copyright 2008, 2009 Hezekiah M. Carty
This file is part of PLplot.
PLplot is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with PLplot. If not, see <http://www.gnu.org/licenses/>.
*)
(* An example of using PLplot + Plcairo + Cairo + lablgtk to show a plot in a
Gtk+ application. This is meant to be run from the OCaml toplevel, after
running "make" in the plcairo/ directory. *)
#use "topfind";;
#thread;;
#require "cairo.lablgtk2";;
#require "plplot";;
#directory "../_build/";;
#load "plcairo.cma";;
open Plplot
(* The plot surface size *)
let plot_width = 1600
let plot_height = 1000
(* The size of the GUI view of the plot *)
let gui_width = plot_width / 2
let gui_height = plot_height / 2
(** Get a Cairo context from the Gtk drawing area. *)
let get_cairo w =
Cairo_lablgtk.create w#misc#window
(** Redraw the plot contents. *)
let redraw w plcairo _ =
let cr = get_cairo w in
let { Gtk.width = width ; Gtk.height = height } =
w#misc#allocation in
let width = float_of_int width in
let height = float_of_int height in
Plcairo.blit_to_cairo ~dest:cr ~dim:(`Both (width, height))
~xoff:0.0 ~yoff:0.0 plcairo;
true
let () =
(* Make a simple plot. *)
let plcairo =
Plcairo.init_cairo ~width:plot_width ~height:plot_height
~clear:true Plcairo.imagecairo
in
Plcairo.make_active plcairo;
plenv (-180.0) 180.0 (-90.0) 90.0 1 0;
plmap "globe" (-180.0) 180.0 (-90.0) 90.0;
pllab "Latitude" "Longitude" "It's Earth!";
plend ();
(* DO NOT call Plcairo.finish yet. The Cairo surface needs to remain active
in order to use it in the GUI. *)
(* Create a window for the app. *)
let w = GWindow.window ~title:"PLplot + Gtk Integration Demo" () in
(* Quit cleanly when the close button is clicked. *)
ignore (w#connect#destroy GMain.quit);
(* Put a box and frame around the plot. *)
let b = GPack.vbox ~spacing:6 ~border_width:12 ~packing:w#add () in
let f =
GBin.frame ~shadow_type:`IN ~packing:(b#pack ~expand:true ~fill:true) ()
in
(* This drawing_area is where the plot will be displayed. *)
let area =
GMisc.drawing_area
~width:gui_width ~height:gui_height ~packing:f#add ()
in
(* Be sure to update the plot display when required. *)
ignore (area#event#connect#expose (redraw area plcairo));
(* Show the window and enter the main Gtk+ application loop. *)
w#show ();
GMain.main ()

View File

@ -0,0 +1,45 @@
(*
Copyright 2008, 2009 Hezekiah M. Carty
This file is part of PLplot.
PLplot is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with PLplot. If not, see <http://www.gnu.org/licenses/>.
*)
(* Test for multiple plot pages. *)
open Plplot
let () =
(* Initialize PLplot with the extcairo device and create a new plot stream. *)
let plcairo =
Plcairo.init_cairo ~clear:true ~width:400 ~height:400 ~filename:"test.pdf"
Plcairo.pdfcairo
in
(* Plcairo.init_cairo restores the current active plot stream, so we need to
make the plcairo stream active in order to plot on it. *)
Plcairo.make_active plcairo;
plenv 0.0 1.0 0.0 1.0 1 0;
pljoin 0.0 0.0 1.0 1.0;
(* The extcairo device does not automatically advance pages. This must be
done "by hand". The following function call is equivalent to:
Cairo.show_page plcairo.context;
*)
Plcairo.new_page plcairo;
plenv 0.0 1.0 0.0 1.0 1 0;
pljoin 0.0 1.0 1.0 0.0;
plend ();
(* Save the [plcairo] plot to its associated filename ("test.pdf"). *)
Plcairo.save_to_file plcairo;
()

1442
src/3rdparty/plplot/bindings/ocaml/plplot.ml vendored Executable file

File diff suppressed because it is too large Load Diff

1106
src/3rdparty/plplot/bindings/ocaml/plplot.mli vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,373 @@
// Copyright 2007, 2008, 2009, 2010, 2011 Hezekiah M. Carty
// Copyright 2018 Alan W. Irwin
// This file is part of ocaml-plplot.
// ocaml-plplot is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 2 of the License, or
// (at your option) any later version.
// ocaml-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 Lesser General Public License for more details.
// You should have received a copy of the GNU Lesser General Public License
// along with ocaml-plplot. If not, see <http://www.gnu.org/licenses/>.
// Taken from the plplot.h 3D plot style definitions
enum plplot3d_style_enum {
PL_DIFFUSE = 0,
PL_DRAW_LINEX = 1,
PL_DRAW_LINEY = 2,
PL_DRAW_LINEXY = 3,
PL_MAG_COLOR = 4,
PL_BASE_CONT = 8,
PL_TOP_CONT = 16,
PL_SURF_CONT = 32,
PL_DRAW_SIDES = 64,
PL_FACETED = 128,
PL_MESH = 256
};
typedef [set] enum plplot3d_style_enum plplot3d_style;
enum plplot_bin_enum {
PL_BIN_DEFAULT = 0,
PL_BIN_CENTRED = 1,
PL_BIN_NOEXPAND = 2,
PL_BIN_NOEMPTY = 4,
};
typedef [set] enum plplot_bin_enum plplot_bin_style;
enum plplot_hist_enum {
PL_HIST_DEFAULT = 0,
PL_HIST_NOSCALING = 1,
PL_HIST_IGNORE_OUTLIERS = 2,
PL_HIST_NOEXPAND = 8,
PL_HIST_NOEMPTY = 16,
};
typedef [set] enum plplot_hist_enum plplot_hist_style;
enum plplot_run_level_enum {
PL_UNINITIALIZED = 0,
PL_INITIALIZED = 1,
PL_VIEWPORT_DEFINED = 2,
PL_WORLD_COORDINATES_DEFINED = 3,
};
typedef enum plplot_run_level_enum plplot_run_level;
enum plplot_position_enum {
PL_POSITION_NULL = 0x0,
PL_POSITION_LEFT = 0x1,
PL_POSITION_RIGHT = 0x2,
PL_POSITION_TOP = 0x4,
PL_POSITION_BOTTOM = 0x8,
PL_POSITION_INSIDE = 0x10,
PL_POSITION_OUTSIDE = 0x20,
PL_POSITION_VIEWPORT = 0x40,
PL_POSITION_SUBPAGE = 0x80,
};
typedef [set] enum plplot_position_enum plplot_position_opt;
enum plplot_legend_enum {
PL_LEGEND_NULL = 0x0,
PL_LEGEND_NONE = 0x1,
PL_LEGEND_COLOR_BOX = 0x2,
PL_LEGEND_LINE = 0x4,
PL_LEGEND_SYMBOL = 0x8,
PL_LEGEND_TEXT_LEFT = 0x10,
PL_LEGEND_BACKGROUND = 0x20,
PL_LEGEND_BOUNDING_BOX = 0x40,
PL_LEGEND_ROW_MAJOR = 0x80,
};
typedef [set] enum plplot_legend_enum plplot_legend_opt;
enum plplot_colorbar_enum {
PL_COLORBAR_NULL = 0x0,
PL_COLORBAR_LABEL_LEFT = 0x1,
PL_COLORBAR_LABEL_RIGHT = 0x2,
PL_COLORBAR_LABEL_TOP = 0x4,
PL_COLORBAR_LABEL_BOTTOM = 0x8,
PL_COLORBAR_IMAGE = 0x10,
PL_COLORBAR_SHADE = 0x20,
PL_COLORBAR_GRADIENT = 0x40,
PL_COLORBAR_CAP_NONE = 0x80,
PL_COLORBAR_CAP_LOW = 0x100,
PL_COLORBAR_CAP_HIGH = 0x200,
PL_COLORBAR_SHADE_LABEL = 0x400,
PL_COLORBAR_ORIENT_RIGHT = 0x800,
PL_COLORBAR_ORIENT_TOP = 0x1000,
PL_COLORBAR_ORIENT_LEFT = 0x2000,
PL_COLORBAR_ORIENT_BOTTOM = 0x4000,
PL_COLORBAR_BACKGROUND = 0x8000,
PL_COLORBAR_BOUNDING_BOX = 0x10000,
};
typedef [set] enum plplot_colorbar_enum plplot_colorbar_opt;
enum plplot_fci_family_enum {
// = These are legal values for font family attribute
PL_FCI_FAMILY_UNCHANGED = -1,
PL_FCI_SANS = 0x0,
PL_FCI_SERIF = 0x1,
PL_FCI_MONO = 0x2,
PL_FCI_SCRIPT = 0x3,
PL_FCI_SYMBOL = 0x4
};
enum plplot_fci_style_enum {
// = These are legal values for font style attribute
PL_FCI_STYLE_UNCHANGED = -1,
PL_FCI_UPRIGHT = 0x0,
PL_FCI_ITALIC = 0x1,
PL_FCI_OBLIQUE = 0x2
};
enum plplot_fci_weight_enum {
// = These are legal values for font weight attribute
PL_FCI_WEIGHT_UNCHANGED = -1,
PL_FCI_MEDIUM = 0x0,
PL_FCI_BOLD = 0x1
};
enum plplot_draw_mode_enum {
// Flags for drawing mode
PL_DRAWMODE_UNKNOWN = 0x0,
PL_DRAWMODE_DEFAULT = 0x1,
PL_DRAWMODE_REPLACE = 0x2,
PL_DRAWMODE_XOR = 0x4
};
// Any function which has a nonzero_error_int return type will raise
// an Invalid_argument error if the return value is <> 0.
typedef [errorcheck(plplot_check_nonzero_result), errorcode] int nonzero_error_int;
// Include the prototype for this to avoid implicit declaration warnings
quote(h, "void plplot_check_nonzero_result(int result);");
// This is a simplified and modified version of the plplot.h file.
#include "plplot_h.inc"
// MAINTENANCE 2017-10: These argument #defines are copied from plplot_h.
// Not all of them are used below.
#define PLFLT double
#define PLUNICODE long long
#define PLINT int
#define PLBOOL boolean
#define PLCHAR_VECTOR const char *
#define PLCHAR_NC_VECTOR char *
#define PLFLT_NC_SCALAR double *
#define PLFLT_VECTOR double *
#define PLFLT_MATRIX double **
#define PLUNICODE_NC_SCALAR long long *
#define PLINT_NC_SCALAR int *
#define PLINT_VECTOR int *
#define PLDLLIMPEXP
#define PLBOOL_NC_SCALAR boolean *
#define PLBOOL_VECTOR boolean *
// These functions require(d) some manual assistance to get them to work
// properly
[mlname(plcont)] void ml_plcont(
[size_is(nx,ny)] PLFLT_MATRIX f, PLINT nx, PLINT ny,
PLINT kx, PLINT lx, PLINT ky, PLINT ly,
[size_is(nlevel)] PLFLT_VECTOR clevel, PLINT nlevel);
[mlname(plshade)] void ml_plshade(
[size_is(nx,ny)] PLFLT_MATRIX a, PLINT nx, PLINT ny,
PLFLT left, PLFLT right, PLFLT bottom, PLFLT top,
PLFLT shade_min, PLFLT shade_max,
PLINT sh_cmap, PLFLT sh_color, PLFLT sh_width,
PLINT min_color, PLFLT min_width,
PLINT max_color, PLFLT max_width,
PLBOOL rectangular);
[mlname(plshades)] void ml_plshades(
[size_is(nx,ny)] PLFLT_MATRIX a, PLINT nx, PLINT ny,
PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax,
[size_is(nlevel)] PLFLT_VECTOR clevel, PLINT nlevel, PLFLT fill_width,
PLINT cont_color, PLFLT cont_width,
PLBOOL rectangular);
[mlname(plimagefr)] void ml_plimagefr(
[size_is(nx, ny)] PLFLT_MATRIX idata, PLINT nx, PLINT ny,
PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax,
PLFLT zmin, PLFLT zmax,
PLFLT valuemin, PLFLT valuemax);
[mlname(plvect)] void ml_plvect(
[size_is(nx,ny)] PLFLT_MATRIX u, [size_is(nx,ny)] PLFLT_MATRIX v,
PLINT nx, PLINT ny, PLFLT scale);
[mlname(plmap)] void ml_plmap(
[string] PLCHAR_VECTOR name,
PLFLT minx, PLFLT maxx, PLFLT miny, PLFLT maxy);
[mlname(plmapline)] void ml_plmapline(
[string] PLCHAR_VECTOR name,
PLFLT minx, PLFLT maxx, PLFLT miny, PLFLT maxy,
[size_is(nplotentries)] PLINT_VECTOR plotentries, PLINT nplotentries);
[mlname(plmapstring)] void ml_plmapstring(
[string] PLCHAR_VECTOR name, [string] PLCHAR_VECTOR string,
PLFLT minx, PLFLT maxx, PLFLT miny, PLFLT maxy,
[size_is(nplotentries)] PLINT_VECTOR plotentries, PLINT nplotentries);
[mlname(plmaptex)] void ml_plmaptex(
[string] PLCHAR_VECTOR name, PLFLT dx, PLFLT dy, PLFLT just, [string] PLCHAR_VECTOR text,
PLFLT minx, PLFLT maxx, PLFLT miny, PLFLT maxy,
PLINT plotentry);
[mlname(plmapfill)] void ml_plmapfill(
[string] PLCHAR_VECTOR name,
PLFLT minx, PLFLT maxx, PLFLT miny, PLFLT maxy,
[size_is(nplotentries)] PLINT_VECTOR plotentries, PLINT nplotentries);
[mlname(plmeridians)] void ml_plmeridians(
PLFLT dlong, PLFLT dlat,
PLFLT minlong, PLFLT maxlong, PLFLT minlat, PLFLT maxlat);
[mlname(plpoly3)] void ml_plpoly3(
PLINT n, [size_is(n)] PLFLT_VECTOR x, [size_is(n)] PLFLT_VECTOR y, [size_is(n)] PLFLT_VECTOR z,
PLINT ndraw, [size_is(ndraw)] PLBOOL_VECTOR draw, PLBOOL ifcc);
// The following are for the pltr functions
[mlname(pltr0)] void ml_pltr0(
PLFLT x, PLFLT y, [out] PLFLT_VECTOR tx, [out] PLFLT_VECTOR ty);
// XXX The following are non-standard functions
[mlname(plsvect_reset)] void ml_plsvect_reset(void);
int plg_current_col0(void);
PLFLT plg_current_col1(void);
PLFLT plgwidth(void);
PLFLT plgchrht(void);
#define QUOTEME(x) #x
#define RAW_ML(x) quote(mlmli, QUOTEME(x));
// plstripc function
quote(mlmli,
"external plstripc : string -> string -> float -> float -> float -> float -> \
float -> float -> float -> bool -> bool -> int -> int -> \
int array -> int array -> string array -> string -> \
string -> string -> int = \"ml_plstripc_byte\" \"ml_plstripc\"");
// pltr callback functions, hand-wrapped
quote(mlmli,
"external pltr1 : float array -> float array -> float -> float -> float * float \
= \"ml_pltr1\"");
quote(mlmli,
"external pltr2 : float array array -> float array array -> float -> float -> float * float \
= \"ml_pltr2\"");
// Setting the translation function for the contouring and plotting functions
quote(ml,
"let plset_pltr (f : float -> float -> (float * float)) =\
Callback.register \"caml_plplot_plotter\" f");
quote(mli, "val plset_pltr : (float -> float -> (float * float)) -> unit");
quote(ml, "let plunset_pltr () = Callback.register \"caml_plplot_plotter\" 0");
quote(mli, "val plunset_pltr : unit -> unit");
// Setting the translation function for the map drawing functions
quote(ml,
"let plset_mapform (f : float -> float -> (float * float)) =\
Callback.register \"caml_plplot_mapform\" f");
quote(mli, "val plset_mapform : (float -> float -> (float * float)) -> unit");
quote(ml,
"let plunset_mapform () = Callback.register \"caml_plplot_mapform\" 0");
quote(mli, "val plunset_mapform : unit -> unit");
// Setting the "defined" function for the shading functions
quote(ml,
"let plset_defined (f : float -> float -> int) =\
Callback.register \"caml_plplot_defined\" f");
quote(mli, "val plset_defined : (float -> float -> int) -> unit");
quote(ml,
"let plunset_defined () = Callback.register \"caml_plplot_defined\" 0");
quote(mli, "val plunset_defined : unit -> unit");
// Setting the translation function for the global coordinate transform
quote(ml, "external ml_plstransform : unit -> unit = \"ml_plstransform\"");
quote(ml,
"let plstransform (f : float -> float -> (float * float)) =\
Callback.register \"caml_plplot_transform\" f;\
ml_plstransform ()");
quote(mli, "val plstransform : (float -> float -> (float * float)) -> unit");
quote(ml,
"let plunset_transform () =\
Callback.register \"caml_plplot_transform\" 0;\
ml_plstransform ()");
quote(mli, "val plunset_transform : unit -> unit");
// Hand-translated PL_GRID_* flags for use with plgriddata
quote(mlmli, "type plplot_grid_method_type = \
PL_GRID_CSA | \
PL_GRID_DTLI | \
PL_GRID_NNI | \
PL_GRID_NNIDW | \
PL_GRID_NNLI | \
PL_GRID_NNAIDW");
// Hand-translated PL_PARSE_* flags for use with plparseopts
quote(mlmli, "type plplot_parse_method_type = \
PL_PARSE_PARTIAL | \
PL_PARSE_FULL | \
PL_PARSE_QUIET | \
PL_PARSE_NODELETE | \
PL_PARSE_SHOWALL | \
PL_PARSE_OVERRIDE | \
PL_PARSE_NOPROGRAM | \
PL_PARSE_NODASH | \
PL_PARSE_SKIP");
// Data type to reference axes
quote(mlmli, "type plplot_axis_type = \
PL_X_AXIS | \
PL_Y_AXIS | \
PL_Z_AXIS");
// Custom axis labeling
quote(ml, "external ml_plslabelfunc : unit -> unit = \"ml_plslabelfunc\"");
quote(ml,
"let plslabelfunc (f : plplot_axis_type -> float -> string) =\
Callback.register \"caml_plplot_customlabel\" f;\
ml_plslabelfunc ()");
quote(mli, "val plslabelfunc : (plplot_axis_type -> float -> string) -> unit");
quote(ml,
"let plunset_labelfunc () =\
Callback.register \"caml_plplot_customlabel\" 0;\
ml_plslabelfunc ()");
quote(mli, "val plunset_labelfunc : unit -> unit");
// Custom plabort handling
quote(ml, "external ml_plsabort : unit -> unit = \"ml_plsabort\"");
quote(ml,
"let plsabort (f : string -> unit) =\
Callback.register \"caml_plplot_abort\" f;\
ml_plsabort ()");
quote(mli, "val plsabort : (string -> unit) -> unit");
quote(ml,
"let plunset_abort () =\
Callback.register \"caml_plplot_abort\" 0;\
ml_plsabort ()");
quote(mli, "val plunset_abort : unit -> unit");
// Custom plexit handling
quote(ml, "external ml_plsexit : unit -> unit = \"ml_plsexit\"");
quote(ml,
"let plsexit (f : string -> int) =\
Callback.register \"caml_plplot_exit\" f;\
ml_plsexit ()");
quote(mli, "val plsexit : (string -> int) -> unit");
quote(ml,
"let plunset_exit () =\
Callback.register \"caml_plplot_exit\" 0;\
ml_plsexit ()");
quote(mli, "val plunset_exit : unit -> unit");
RAW_ML(external plgriddata : float array -> float array -> float array -> float array -> float array -> plplot_grid_method_type -> float -> float array array = "ml_plgriddata_bytecode" "ml_plgriddata")
RAW_ML(external plparseopts : string array -> plplot_parse_method_type list -> unit = "ml_plparseopts")
RAW_ML(external pllegend : plplot_legend_opt -> plplot_position_opt -> float -> float -> float -> int -> int -> int -> int -> int -> plplot_legend_opt array -> float -> float -> float -> float -> int array -> string array -> int array -> int array -> float array -> float array -> int array -> int array -> float array -> int array -> float array -> int array -> string array -> float * float = "ml_pllegend_byte" "ml_pllegend")
RAW_ML(external plcolorbar : plplot_colorbar_opt -> plplot_position_opt -> float -> float -> float -> float -> int -> int -> int -> float -> float -> int -> float -> plplot_colorbar_opt array -> string array -> string array -> float array -> int array -> float array array -> float * float = "ml_plcolorbar_byte" "ml_plcolorbar")

1343
src/3rdparty/plplot/bindings/ocaml/plplot_h vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,154 @@
[mlname(pl_setcontlabelformat)] void c_pl_setcontlabelformat ( int lexp, int sigdig );
[mlname(pl_setcontlabelparam)] void c_pl_setcontlabelparam ( double offset, double size, double spacing, int active );
[mlname(pladv)] void c_pladv ( int page );
[mlname(plarc)] void c_plarc ( double x, double y, double a, double b, double angle1, double angle2, double rotate, boolean fill );
[mlname(plaxes)] void c_plaxes ( double x0, double y0, [string] const char * xopt, double xtick, int nxsub, [string] const char * yopt, double ytick, int nysub );
[mlname(plbin)] void c_plbin ( int nbin, [in, size_is(nbin)] double * x, [in, size_is(nbin)] double * y, plplot_bin_style opt );
[mlname(plbtime)] void c_plbtime ( [out] int * year, [out] int * month, [out] int * day, [out] int * hour, [out] int * min, [out] double * sec, double ctime );
[mlname(plbop)] void c_plbop ( void );
[mlname(plbox)] void c_plbox ( [string] const char * xopt, double xtick, int nxsub, [string] const char * yopt, double ytick, int nysub );
[mlname(plbox3)] void c_plbox3 ( [string] const char * xopt, [string] const char * xlabel, double xtick, int nxsub, [string] const char * yopt, [string] const char * ylabel, double ytick, int nysub, [string] const char * zopt, [string] const char * zlabel, double ztick, int nzsub );
[mlname(plcalc_world)] void c_plcalc_world ( double rx, double ry, [out] double * wx, [out] double * wy, [out] int * window );
[mlname(plclear)] void c_plclear ( void );
[mlname(plcol0)] void c_plcol0 ( int icol0 );
[mlname(plcol1)] void c_plcol1 ( double col1 );
[mlname(plconfigtime)] void c_plconfigtime ( double scale, double offset1, double offset2, int ccontrol, boolean ifbtime_offset, int year, int month, int day, int hour, int min, double sec );
[mlname(plcpstrm)] void c_plcpstrm ( int iplsr, boolean flags );
[mlname(plctime)] void c_plctime ( int year, int month, int day, int hour, int min, double sec, [out] double * ctime );
[mlname(plend)] void c_plend ( void );
[mlname(plend1)] void c_plend1 ( void );
[mlname(plenv)] void c_plenv ( double xmin, double xmax, double ymin, double ymax, int just, int axis );
[mlname(plenv0)] void c_plenv0 ( double xmin, double xmax, double ymin, double ymax, int just, int axis );
[mlname(pleop)] void c_pleop ( void );
[mlname(plerrx)] void c_plerrx ( int n, [in, size_is(n)] double * xmin, [in, size_is(n)] double * xmax, [in, size_is(n)] double * y );
[mlname(plerry)] void c_plerry ( int n, [in, size_is(n)] double * x, [in, size_is(n)] double * ymin, [in, size_is(n)] double * ymax );
[mlname(plfamadv)] void c_plfamadv ( void );
[mlname(plfill)] void c_plfill ( int n, [in, size_is(n)] double * x, [in, size_is(n)] double * y );
[mlname(plfill3)] void c_plfill3 ( int n, [in, size_is(n)] double * x, [in, size_is(n)] double * y, [in, size_is(n)] double * z );
[mlname(plflush)] void c_plflush ( void );
[mlname(plfont)] void c_plfont ( int ifont );
[mlname(plfontld)] void c_plfontld ( int fnt );
[mlname(plgchr)] void c_plgchr ( [out] double * p_def, [out] double * p_ht );
[mlname(plgcmap1_range)] void c_plgcmap1_range ( [out] double * min_color, [out] double * max_color );
[mlname(plgcol0)] void c_plgcol0 ( int icol0, [out] int * r, [out] int * g, [out] int * b );
[mlname(plgcol0a)] void c_plgcol0a ( int icol0, [out] int * r, [out] int * g, [out] int * b, [out] double * alpha );
[mlname(plgcolbg)] void c_plgcolbg ( [out] int * r, [out] int * g, [out] int * b );
[mlname(plgcolbga)] void c_plgcolbga ( [out] int * r, [out] int * g, [out] int * b, [out] double * alpha );
[mlname(plgcompression)] void c_plgcompression ( [out] int * compression );
[mlname(plgdev)] void c_plgdev ( [string, out, length_is(1024)] char * p_dev );
[mlname(plgdidev)] void c_plgdidev ( [out] double * p_mar, [out] double * p_aspect, [out] double * p_jx, [out] double * p_jy );
[mlname(plgdiori)] void c_plgdiori ( [out] double * p_rot );
[mlname(plgdiplt)] void c_plgdiplt ( [out] double * p_xmin, [out] double * p_ymin, [out] double * p_xmax, [out] double * p_ymax );
[mlname(plgdrawmode)] enum plplot_draw_mode_enum c_plgdrawmode ( void );
[mlname(plgfci)] void c_plgfci ( [out] long long * p_fci );
[mlname(plgfam)] void c_plgfam ( [out] int * p_fam, [out] int * p_num, [out] int * p_bmax );
[mlname(plgfnam)] void c_plgfnam ( [string, out, length_is(1024)] char * fnam );
[mlname(plgfont)] void c_plgfont ( [out] int * p_family, [out] int * p_style, [out] int * p_weight );
[mlname(plglevel)] void c_plglevel ( [out] plplot_run_level * p_level );
[mlname(plgpage)] void c_plgpage ( [out] double * p_xp, [out] double * p_yp, [out] int * p_xleng, [out] int * p_yleng, [out] int * p_xoff, [out] int * p_yoff );
[mlname(plgra)] void c_plgra ( void );
[mlname(plgradient)] void c_plgradient ( int n, [in, size_is(n)] double * x, [in, size_is(n)] double * y, double angle );
[mlname(plgspa)] void c_plgspa ( [out] double * xmin, [out] double * xmax, [out] double * ymin, [out] double * ymax );
[mlname(plgstrm)] void c_plgstrm ( [out] int * p_strm );
[mlname(plgver)] void c_plgver ( [string, out, length_is(1024)] char * p_ver );
[mlname(plgvpd)] void c_plgvpd ( [out] double * p_xmin, [out] double * p_xmax, [out] double * p_ymin, [out] double * p_ymax );
[mlname(plgvpw)] void c_plgvpw ( [out] double * p_xmin, [out] double * p_xmax, [out] double * p_ymin, [out] double * p_ymax );
[mlname(plgxax)] void c_plgxax ( [out] int * p_digmax, [out] int * p_digits );
[mlname(plgyax)] void c_plgyax ( [out] int * p_digmax, [out] int * p_digits );
[mlname(plgzax)] void c_plgzax ( [out] int * p_digmax, [out] int * p_digits );
[mlname(plhist)] void c_plhist ( int n, [in, size_is(n)] double * data, double datmin, double datmax, int nbin, plplot_hist_style opt );
[mlname(plhlsrgb)] void c_plhlsrgb ( double h, double l, double s, [out] double * p_r, [out] double * p_g, [out] double * p_b );
[mlname(plinit)] void c_plinit ( void );
[mlname(pljoin)] void c_pljoin ( double x1, double y1, double x2, double y2 );
[mlname(pllab)] void c_pllab ( [string] const char * xlabel, [string] const char * ylabel, [string] const char * tlabel );
[mlname(pllightsource)] void c_pllightsource ( double x, double y, double z );
[mlname(plline)] void c_plline ( int n, [in, size_is(n)] double * x, [in, size_is(n)] double * y );
[mlname(plline3)] void c_plline3 ( int n, [in, size_is(n)] double * x, [in, size_is(n)] double * y, [in, size_is(n)] double * z );
[mlname(pllsty)] void c_pllsty ( int lin );
[mlname(plmesh)] void c_plmesh ( [size_is(nx), in] double * x, [size_is(ny), in] double * y, [size_is(nx, ny), in] double ** z, int nx, int ny, plplot3d_style opt );
[mlname(plmeshc)] void c_plmeshc ( [size_is(nx), in] double * x, [size_is(ny), in] double * y, [size_is(nx, ny), in] double ** z, int nx, int ny, plplot3d_style opt, [size_is(nlevel), in] double * clevel, int nlevel );
[mlname(plmkstrm)] void c_plmkstrm ( [out] int * p_strm );
[mlname(plmtex)] void c_plmtex ( [string] const char * side, double disp, double pos, double just, [string] const char * text );
[mlname(plmtex3)] void c_plmtex3 ( [string] const char * side, double disp, double pos, double just, [string] const char * text );
[mlname(plot3d)] void c_plot3d ( [size_is(nx), in] double * x, [size_is(ny), in] double * y, [size_is(nx, ny), in] double ** z, int nx, int ny, plplot3d_style opt, boolean side );
[mlname(plot3dc)] void c_plot3dc ( [size_is(nx), in] double * x, [size_is(ny), in] double * y, [size_is(nx, ny), in] double ** z, int nx, int ny, plplot3d_style opt, [size_is(nlevel), in] double * clevel, int nlevel );
[mlname(plot3dcl)] void c_plot3dcl ( [size_is(nx), in] double * x, [size_is(ny), in] double * y, [size_is(nx, ny), in] double ** z, int nx, int ny, plplot3d_style opt, [size_is(nlevel), in] double * clevel, int nlevel, int indexxmin, int indexxmax, [size_is(indexxmax), in] int * indexymin, [size_is(indexxmax), in] int * indexymax );
[mlname(plpat)] void c_plpat ( int nlin, [in, size_is(nlin)] int * inc, [in, size_is(nlin)] int * del );
[mlname(plpath)] void c_plpath ( int n, double x1, double y1, double x2, double y2 );
[mlname(plpoin)] void c_plpoin ( int n, [in, size_is(n)] double * x, [in, size_is(n)] double * y, int code );
[mlname(plpoin3)] void c_plpoin3 ( int n, [in, size_is(n)] double * x, [in, size_is(n)] double * y, [in, size_is(n)] double * z, int code );
[mlname(plprec)] void c_plprec ( int setp, int prec );
[mlname(plpsty)] void c_plpsty ( int patt );
[mlname(plptex)] void c_plptex ( double x, double y, double dx, double dy, double just, [string] const char * text );
[mlname(plptex3)] void c_plptex3 ( double wx, double wy, double wz, double dx, double dy, double dz, double sx, double sy, double sz, double just, [string] const char * text );
[mlname(plrandd)] double c_plrandd ( void );
[mlname(plreplot)] void c_plreplot ( void );
[mlname(plrgbhls)] void c_plrgbhls ( double r, double g, double b, [out] double * p_h, [out] double * p_l, [out] double * p_s );
[mlname(plschr)] void c_plschr ( double def, double scale );
[mlname(plscmap0)] void c_plscmap0 ( [size_is(ncol0), in] int * r, [size_is(ncol0), in] int * g, [size_is(ncol0), in] int * b, int ncol0 );
[mlname(plscmap0a)] void c_plscmap0a ( [size_is(ncol0), in] int * r, [size_is(ncol0), in] int * g, [size_is(ncol0), in] int * b, [size_is(ncol0), in] double * alpha, int ncol0 );
[mlname(plscmap0n)] void c_plscmap0n ( int ncol0 );
[mlname(plscmap1)] void c_plscmap1 ( [size_is(ncol1), in] int * r, [size_is(ncol1), in] int * g, [size_is(ncol1), in] int * b, int ncol1 );
[mlname(plscmap1a)] void c_plscmap1a ( [size_is(ncol1), in] int * r, [size_is(ncol1), in] int * g, [size_is(ncol1), in] int * b, [size_is(ncol1), in] double * alpha, int ncol1 );
[mlname(plscmap1l)] void c_plscmap1l ( boolean itype, int npts, [size_is(npts), in, size_is(npts)] double * intensity, [size_is(npts), in, size_is(npts)] double * coord1, [size_is(npts), in, size_is(npts)] double * coord2, [size_is(npts), in, size_is(npts)] double * coord3, [in, size_is(npts), in, size_is(npts), unique] boolean * alt_hue_path );
[mlname(plscmap1la)] void c_plscmap1la ( boolean itype, int npts, [size_is(npts), in, size_is(npts)] double * intensity, [size_is(npts), in, size_is(npts)] double * coord1, [size_is(npts), in, size_is(npts)] double * coord2, [size_is(npts), in, size_is(npts)] double * coord3, [size_is(npts), in, size_is(npts)] double * alpha, [in, size_is(npts), in, size_is(npts), unique] boolean * alt_hue_path );
[mlname(plscmap1n)] void c_plscmap1n ( int ncol1 );
[mlname(plscmap1_range)] void c_plscmap1_range ( double min_color, double max_color );
[mlname(plscol0)] void c_plscol0 ( int icol0, int r, int g, int b );
[mlname(plscol0a)] void c_plscol0a ( int icol0, int r, int g, int b, double alpha );
[mlname(plscolbg)] void c_plscolbg ( int r, int g, int b );
[mlname(plscolbga)] void c_plscolbga ( int r, int g, int b, double alpha );
[mlname(plscolor)] void c_plscolor ( int color );
[mlname(plscompression)] void c_plscompression ( int compression );
[mlname(plsdev)] void c_plsdev ( [string] const char * devname );
[mlname(plsdidev)] void c_plsdidev ( double mar, double aspect, double jx, double jy );
[mlname(plsdimap)] void c_plsdimap ( int dimxmin, int dimxmax, int dimymin, int dimymax, double dimxpmm, double dimypmm );
[mlname(plsdiori)] void c_plsdiori ( double rot );
[mlname(plsdiplt)] void c_plsdiplt ( double xmin, double ymin, double xmax, double ymax );
[mlname(plsdiplz)] void c_plsdiplz ( double xmin, double ymin, double xmax, double ymax );
[mlname(plsdrawmode)] void c_plsdrawmode ( enum plplot_draw_mode_enum mode );
[mlname(plseed)] void c_plseed ( [int64] unsigned int seed );
[mlname(plsesc)] void c_plsesc ( char esc );
[mlname(plsfam)] void c_plsfam ( int fam, int num, int bmax );
[mlname(plsfci)] void c_plsfci ( long long fci );
[mlname(plsfnam)] void c_plsfnam ( [string] const char * fnam );
[mlname(plsfont)] void c_plsfont ( enum plplot_fci_family_enum family, enum plplot_fci_style_enum style, enum plplot_fci_weight_enum weight );
[mlname(plsmaj)] void c_plsmaj ( double def, double scale );
[mlname(plsmin)] void c_plsmin ( double def, double scale );
[mlname(plsori)] void c_plsori ( int ori );
[mlname(plspage)] void c_plspage ( double xp, double yp, int xleng, int yleng, int xoff, int yoff );
[mlname(plspal0)] void c_plspal0 ( [string] const char * filename );
[mlname(plspal1)] void c_plspal1 ( [string] const char * filename, boolean interpolate );
[mlname(plspause)] void c_plspause ( boolean pause );
[mlname(plsstrm)] void c_plsstrm ( int strm );
[mlname(plssub)] void c_plssub ( int nx, int ny );
[mlname(plssym)] void c_plssym ( double def, double scale );
[mlname(plstar)] void c_plstar ( int nx, int ny );
[mlname(plstart)] void c_plstart ( [string] const char * devname, int nx, int ny );
[mlname(plstring)] void c_plstring ( int n, [in, size_is(n)] double * x, [in, size_is(n)] double * y, [string] const char * string );
[mlname(plstring3)] void c_plstring3 ( int n, [in, size_is(n)] double * x, [in, size_is(n)] double * y, [in, size_is(n)] double * z, [string] const char * string );
[mlname(plstripa)] void c_plstripa ( int id, int pen, double x, double y );
[mlname(plstripd)] void c_plstripd ( int id );
[mlname(plimage)] void c_plimage ( [in, size_is(nx, ny)] double ** idata, int nx, int ny, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, double Dxmin, double Dxmax, double Dymin, double Dymax );
[mlname(plstyl)] void c_plstyl ( int nms, [size_is(nms)] int * mark, [size_is(nms)] int * space );
[mlname(plsurf3d)] void c_plsurf3d ( [size_is(nx), in] double * x, [size_is(ny), in] double * y, [size_is(nx, ny), in] double ** z, int nx, int ny, plplot3d_style opt, [size_is(nlevel), in] double * clevel, int nlevel );
[mlname(plsurf3dl)] void c_plsurf3dl ( [size_is(nx), in] double * x, [size_is(ny), in] double * y, [size_is(nx, ny), in] double ** z, int nx, int ny, plplot3d_style opt, [size_is(nlevel), in] double * clevel, int nlevel, int indexxmin, int indexxmax, [size_is(indexxmax), in] int * indexymin, [size_is(indexxmax), in] int * indexymax );
[mlname(plsvect)] void c_plsvect ( [in, size_is(npts)] double * arrowx, [in, size_is(npts)] double * arrowy, int npts, boolean fill );
[mlname(plsvpa)] void c_plsvpa ( double xmin, double xmax, double ymin, double ymax );
[mlname(plsxax)] void c_plsxax ( int digmax, int digits );
void plsxwin ( int window_id );
[mlname(plsyax)] void c_plsyax ( int digmax, int digits );
[mlname(plsym)] void c_plsym ( int n, [in, size_is(n)] double * x, [in, size_is(n)] double * y, int code );
[mlname(plszax)] void c_plszax ( int digmax, int digits );
[mlname(pltext)] void c_pltext ( void );
[mlname(pltimefmt)] void c_pltimefmt ( [string] const char * fmt );
[mlname(plvasp)] void c_plvasp ( double aspect );
[mlname(plvpas)] void c_plvpas ( double xmin, double xmax, double ymin, double ymax, double aspect );
[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 xmin, double xmax, double ymin, double ymax, double zmin, double zmax, double alt, double az );
[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 );
void plMinMax2dGrid ( [size_is(nx, ny)] double ** f, int nx, int ny, [out] double * fmax, [out] double * fmin );

1181
src/3rdparty/plplot/bindings/ocaml/plplot_impl.c vendored Executable file

File diff suppressed because it is too large Load Diff

469
src/3rdparty/plplot/bindings/ocaml/touchup.ml vendored Executable file
View File

@ -0,0 +1,469 @@
#use "topfind";;
#require "unix";;
#require "pcre";;
type attribute_spec = {
function_name: string;
function_attrs: string list option;
parameter_attrs: (string * string list) list option;
}
(* These functions all require special handling beyond the more general rules
below. *)
let manual_function_attributes =
[
{
function_name = "c_plimage";
function_attrs = None;
parameter_attrs = Some ["idata", ["in"; "size_is(nx, ny)"]];
};
{
function_name = "c_plstyl";
function_attrs = None;
parameter_attrs = Some ["mark", ["size_is(nms)"]; "space", ["size_is(nms)"]];
};
{
function_name = "plMinMax2dGrid";
function_attrs = None;
parameter_attrs = Some ["f", ["size_is(nx, ny)"]; "fmax", ["out"]; "fmin", ["out"]];
};
{
function_name = "c_plscmap1l";
function_attrs = None;
parameter_attrs = Some ["alt_hue_path", ["in"; "size_is(npts)"; "unique"]];
};
{
function_name = "c_plscmap1la";
function_attrs = None;
parameter_attrs = Some ["alt_hue_path", ["in"; "size_is(npts)"; "unique"]];
};
{
function_name = "c_plxormod";
function_attrs = None;
parameter_attrs = Some ["status", ["out"]];
};
{
function_name = "c_plrgbhls";
function_attrs = None;
parameter_attrs = Some ["p_h", ["out"]; "p_l", ["out"]; "p_s", ["out"]];
};
{
function_name = "c_plhlsrgb";
function_attrs = None;
parameter_attrs = Some ["p_r", ["out"]; "p_g", ["out"]; "p_b", ["out"]];
};
{
function_name = "c_plmkstrm";
function_attrs = None;
parameter_attrs = Some ["p_strm", ["out"]];
};
{
function_name = "c_plbin";
function_attrs = None;
parameter_attrs = Some ["x", ["in"; "size_is(nbin)"];
"y", ["in"; "size_is(nbin)"]];
};
{
function_name = "c_plpat";
function_attrs = None;
parameter_attrs = Some ["inc", ["in"; "size_is(nlin)"];
"del", ["in"; "size_is(nlin)"]];
};
{
function_name = "c_plctime";
function_attrs = None;
parameter_attrs = Some ["ctime", ["out"]];
};
(* For now, this will be wrapped by hand...
{
function_name = "c_plcolorbar";
function_attrs = None;
parameter_attrs = Some ["values", ["in"; "size_is(n_values)"];
"p_colorbar_width", ["out"];
"p_colorbar_height", ["out"]];
};
{
function_name = "c_plgriddata";
function_attrs = None;
parameter_attrs = Some ["xg", ["in"; "size_is(nptsx)"]; "yg", ["in"; "size_is(nptsy)"]; "zg", ["out"; "size_is(nptsx,nptsy)"]];
};
*)
]
(* Length to allocate for output strings. *)
let max_string_length = "1024"
(* Functions to read in everything on STDOUT from a given command. *)
(* Many thanks to Richard M. Jones for the following two functions! *)
(** Read in all of the lines from an input source *)
let rec input_all_lines chan =
try
let line = input_line chan in
line :: input_all_lines chan
with
End_of_file -> []
(** Read everything output on STDOUT from a given command-line *)
let pget cmd =
let chan = Unix.open_process_in cmd in
let lines = input_all_lines chan in
let stat = Unix.close_process_in chan in
(match stat with
Unix.WEXITED 0 -> ()
| Unix.WEXITED i ->
failwith ("command failed with code " ^ string_of_int i)
| Unix.WSIGNALED i ->
failwith ("command killed by signal " ^ string_of_int i)
| Unix.WSTOPPED i ->
failwith ("command stopped by signal " ^ string_of_int i));
lines
(** Read in a file, pre-processed with cpp, and return the output as a list of
lines. *)
let read_file filename =
let preprocessed_text = pget ("cpp " ^ filename) in
let l = List.map (fun l -> l ^ "\n") preprocessed_text in
(*
let text_blob =
List.fold_left (^) "" l
in
print_endline text_blob;
text_blob
*)
l
(** Utility functions *)
let (|>) x f = f x
let id x = x
(** Clean up the text a bit, minimizing whitespace and cutting out leftover
cruft from the preprocessor. *)
let cleanup_lines l =
(* Strip out #-started preprocessor lines, as well as lines with only
whitespace. *)
let blob =
let filtered =
List.filter (
fun line ->
if Pcre.pmatch ~pat:"^#|^\\s+$" line then
false
else
true
) l
in
List.fold_left (^) "" filtered
in
blob
(* Compress lengths of whitespace down to a single character *)
|> Pcre.replace ~pat:"\\s+" ~templ:" "
(* Put newlines back in after each ; *)
|> Pcre.replace ~pat:"; " ~templ:";\n"
(** Given a list of attributes, return a camlidl-ready string representing those
attributes. *)
let make_attribute_string attributes =
match attributes with
[] -> ""
| a ->
"[" ^ String.concat ", " a ^"]"
(** Get rid of extraneous whitespace (leading, trailing, runs) *)
let minimize_whitespace s =
s
|> Pcre.replace ~pat:"^\\s+" ~templ:""
|> Pcre.replace ~pat:"\\s+$" ~templ:""
|> Pcre.replace ~pat:"\\s+" ~templ:" "
(** Generate attributes specific to a given function, based in its return type
and name. *)
let function_attributes return_type name =
let check_re re =
if Pcre.pmatch ~pat:re name then
Pcre.extract ~pat:re ~full_match:false name
else
[||]
in
let name_checks =
[
(* OCaml values can not begin with a capital letter. Translate a name
like FOObar to foo_bar for OCaml. *)
"^([A-Z]+)(.*)$",
(
fun a -> ["mlname(" ^ (
match Array.length a with
1 -> String.lowercase_ascii a.(0)
| 2 ->
String.lowercase_ascii a.(0) ^ "_" ^ a.(1)
| _ -> raise (Failure "Bad result in function caps check")
) ^ ")"]
);
(* Plplot names many of their functions c_* to avoid clashes with certain
language bindings. There's no need to carry this over to OCaml.
This turns c_foo in to foo. *)
"^c_(\\w+)$", (fun a -> ["mlname(" ^ a.(0) ^ ")"]);
]
in
let type_checks =
[
(* Treat strings properly *)
"char\\s*\\*",
["string"; "length_is(" ^ max_string_length ^ ")"]
]
in
(* Attributes based on the function name *)
let name_attrs =
List.map (
fun (re,attrf) ->
let a = check_re re in if Array.length a > 0 then attrf a else []
) name_checks
|> List.flatten
in
(* Attributes based on the function type *)
let type_attrs =
List.map (
fun (re,attrs) -> if Pcre.pmatch ~pat:re return_type then attrs else []
) type_checks
|> List.flatten
in
(* Any other attributes, specified manually *)
let manual_attrs =
try
let fa =
List.find (fun fa -> fa.function_name = name) manual_function_attributes
in
match fa.function_attrs with
| Some a -> a
| None -> []
with
| Not_found -> []
in
name_attrs @ type_attrs @ manual_attrs
(** Generate attributes for function parameters *)
let parameter_attributes function_name types names =
let pmatch re str = Pcre.pmatch ~pat:re str in
let non_get_functions = ["c_plgriddata"; "c_plgra"; "c_plgradient"] in
(* If all of the pieces are true, then the attribute(s) is(are) appropriate
for this parameter. This is basically a long list of special cases
which usually, but not always, apply to multiple functions. *)
let checks p_type p_name =
[
(* Order goes:
function_name check
type check
attribute name check
misc. check (anything, as long as it's a bool)
attributes, if all of the above are true
*)
(* OCaml does not support unsigned integer values in its standard library
so use Int64.t values for unsigned ints to be safe. *)
true,
pmatch "unsigned int" p_type,
true,
true,
["int64"];
(* "get" functions *)
pmatch "^c_plg" function_name,
pmatch "\\*" p_type,
true,
not (List.mem function_name non_get_functions),
["out"] @
if pmatch "char" p_type then ["length_is(" ^ max_string_length ^ ")"]
else [];
(* Strings *)
true,
pmatch "(?:const )?char\\s*\\*$" p_type,
true,
true,
["string"];
(* Pointers to arrays of n elements *)
true,
pmatch "\\*" p_type && not (pmatch "const char" p_type),
true,
List.mem "n" names,
["in"; "size_is(n)"];
(* Pointers to arrays of npts elements *)
true,
pmatch "\\*" p_type,
not (pmatch "^[xyz]g$" p_name),
List.mem "npts" names,
["in"; "size_is(npts)"];
(* x and y dimensions *)
true,
pmatch "\\*" p_type,
p_name = "x" || p_name = "y",
List.mem ("n" ^ p_name) names,
["size_is(n" ^ p_name ^ ")"; "in"];
(* z dimensions *)
true,
pmatch "\\*\\*" p_type,
p_name = "z",
List.mem "nx" names && List.mem "ny" names,
["size_is(nx, ny)"; "in"];
(* Contouring levels *)
true,
true,
p_name = "clevel",
List.mem "nlevel" names,
["size_is(nlevel)"; "in"];
(* Color maps *)
true,
pmatch "\\*" p_type,
p_name = "r" || p_name = "g" || p_name = "b" || p_name = "alpha",
List.mem "ncol0" names,
["size_is(ncol0)"; "in"];
true,
pmatch "\\*" p_type,
p_name = "r" || p_name = "g" || p_name = "b" || p_name = "alpha",
List.mem "ncol1" names,
["size_is(ncol1)"; "in"];
(* Linear relationship color maps *)
pmatch "c_plscmap1l" function_name,
pmatch "\\*" p_type,
List.mem p_name ["intensity"; "coord1"; "coord2"; "coord3"; "alpha"],
true,
["size_is(npts)"];
(* Relative to world coordinates *)
function_name = "c_plcalc_world",
pmatch "\\*" p_type,
List.mem p_name ["wx"; "wy"; "window"],
true,
["out"];
(* Time conversion *)
function_name = "c_plbtime",
pmatch "\\*" p_type,
true,
true,
["out"];
(* Index limits *)
true,
pmatch "\\*" p_type,
List.mem p_name ["indexymin"; "indexymax"],
true,
["size_is(indexxmax)"; "in"];
]
in
let attr_hash = Hashtbl.create 10 in
let perform_check param_type param_name =
(* Any other attributes, specified manually *)
let manual_attrs =
try
let fa =
List.find (fun fa -> fa.function_name = function_name)
manual_function_attributes
in
match fa.parameter_attrs with
| Some a -> List.assoc param_name a
| None -> []
with
| Not_found -> []
in
Hashtbl.add attr_hash param_name manual_attrs;
(* Check for attributes, filter the ones we don't want, then add the rest
to the attribute hash. *)
checks param_type param_name
|> List.filter (
fun (function_check, type_check, name_check, other_check, _) ->
List.for_all id [function_check; type_check; name_check; other_check]
)
|> List.iter (fun (_,_,_,_,attrs) -> Hashtbl.add attr_hash param_name attrs)
in
List.iter2 perform_check types names;
attr_hash
(** Build a string from a list of attributes *)
let build_attribute_list l =
List.map (
fun (attrs, t, n) ->
String.concat " " [make_attribute_string attrs; t; n]
) l
(** Given a C function prototype, chop it up and find out what camlidl
attributes it should have. *)
let process_prototype line =
(* This is an ugly, but for now effective, regexp to parse the PLplot function
prototypes. *)
let pieces =
line
|> Pcre.extract ~pat:"^((?:(?:const|unsigned|enum) )?\\w+ (?:\\*\\s*)?)(\\w+)\\s*\\(([\\w\\s\\*\\[\\],]*)\\)" ~full_match:false
|> Array.map minimize_whitespace
in
(* Get the return type, name and arg list separately *)
let return_type = pieces.(0) in
let function_name = pieces.(1) in
let params =
pieces.(2)
|> Pcre.split ~pat:","
|> List.map minimize_whitespace
in
let param_types, param_names =
params
|> List.map (
fun param ->
let p = Pcre.extract ~pat:"(.*)?\\b(\\w+)" ~full_match:false param in
minimize_whitespace p.(0), minimize_whitespace p.(1)
)
|> List.split
in
let f_attrs = function_attributes return_type function_name in
let p_attrs = parameter_attributes function_name param_types param_names in
let params_with_attrs =
List.map2
(fun t n -> Hashtbl.find_all p_attrs n |> List.flatten, t, n)
param_types param_names
in
String.concat " " (
[
make_attribute_string f_attrs;
return_type;
function_name; "(";
]
@ [String.concat ", " (build_attribute_list params_with_attrs)]
@ [");"]
)
(** Write a list of lines out to the given filename *)
let write_file filename lines =
let fout = open_out filename in
List.iter (output_string fout) lines;
close_out fout;
()
(** Given input and output filenames, process the contents of the input file
and write the results to the output file, which should be ready for
consumption by camlidl. *)
let process_file () =
let infile, outfile =
if Array.length Sys.argv = 3 then
Sys.argv.(1), Sys.argv.(2)
else
"plplot_h", "plplot_h.inc"
in
read_file infile
|> cleanup_lines
|> Pcre.split ~pat:"\n"
|> List.map minimize_whitespace
|> List.map (
fun l ->
try
process_prototype l
with
| Not_found ->
failwith ("Unhandled or malformed prototype: " ^ l)
)
|> List.map minimize_whitespace
|> List.map (fun l -> l ^ "\n")
|> write_file outfile
let () =
if !Sys.interactive then
()
else
process_file ();
()

21
src/3rdparty/plplot/bindings/octave/BUGS vendored Executable file
View File

@ -0,0 +1,21 @@
There must be more... see ToDo, they are mostly there
0-There is no support for NaNs or Infs
1-There are problems when plotting negative values with logaritm axis.
A partial fix is provided in 0.3.1. However, the plot line is split into
several lines.
2-This is not a bug, but a PLplot feature: there is no autoscale, as
in gnuplot. This means that, after the first plot, after executing hold(),
further plotting will be clipped to the viewport defined by the first plot.
IT IS possible to redefine the viewport, but the previous plots will not
be redrawn to the new viewport. Also, one would have to erase the previous
frame box and draw a new one.
4-`ginput' lets the cross-hair drawn in the plot. Don't know how to avoid it.
Issue 'plflush' at the command line as a remedy.
5-bottom_title and top_title can't be used.

View File

@ -0,0 +1,110 @@
# bindings/octave/CMakeLists.txt for PLplot
# Copyright (C) 2006-2019 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; 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 PLplot; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
# Build and install octave interface to PLplot.
if(ENABLE_octave)
add_subdirectory(PLplot)
add_subdirectory(misc)
# Install renamed documentation files.
set(docfiles
BUGS
FGA
INSTALL
README
ToDo
USAGE
)
foreach(doc ${docfiles})
install(FILES ${doc} DESTINATION ${DOC_DIR} RENAME ${doc}.octave)
endforeach(doc ${docfiles})
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/octave_version.pl.in
${CMAKE_CURRENT_BINARY_DIR}/octave_version.pl
@ONLY
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/octaverc.in
${CMAKE_CURRENT_BINARY_DIR}/.octaverc
@ONLY
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/plplot_stub.m.in
${CMAKE_CURRENT_BINARY_DIR}/plplot_stub.m
@ONLY
)
set(octave_interface_INCLUDE_PATHS
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/lib/qsastime
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/include
${CMAKE_BINARY_DIR}/lib/qsastime
${CMAKE_CURRENT_BINARY_DIR}
${OCTAVE_INCLUDE_PATH}
${CMAKE_SOURCE_DIR}/bindings/swig-support
)
include_directories(${octave_interface_INCLUDE_PATHS})
# The -module option only used to workaround some bug in CMake swig
# support for Octave which does not allow module name prefixes such
# as ${WRITEABLE_TARGET} without specifying -module explicitly this
# way.
set(CMAKE_SWIG_FLAGS -module ${WRITEABLE_TARGET}plplot_octave -DSWIG_OCTAVE)
set(CMAKE_SWIG_OUTDIR ${CMAKE_CURRENT_BINARY_DIR})
set_source_files_properties(plplot_octave.i
PROPERTIES
SWIG_MODULE_NAME ${WRITEABLE_TARGET}plplot_octave
CPLUSPLUS ON
)
set(SWIG_MODULE_plplot_octave_EXTRA_DEPS
${CMAKE_SOURCE_DIR}/bindings/swig-support/swig_documentation.i
${CMAKE_SOURCE_DIR}/bindings/swig-support/plplotcapi.i
)
# Configure build of swig-generated C++ wrapper.
set(octave_tll_list
PLPLOT::plplot
"${OCTAVE_LIBRARIES}"
"${OCTINTERP_LIBRARIES}"
)
# plplot_octave depends on the plplot library.
set(LIB_INSTALL_RPATH ${LIB_DIR})
# (Reasonable) assumption here is that OCTAVE_LIBRARIES and
# OCTINTERP_LIBRARIES have the same path.
# plplot_octave depends on the octave libraries.
get_filename_component(OCTAVE_INSTALL_RPATH "${OCTAVE_LIBRARIES}" PATH)
list(APPEND LIB_INSTALL_RPATH ${OCTAVE_INSTALL_RPATH})
# Have to be specific about install permissions (likely because of the
# ".oct" suffix set by UseSWIG.cmake and also demanded by octave
# itself). Use SO_PERMISSIONS to be consistent with permissions
# used for other shared objects.
configure_library_build(plplot_octave octave plplot_octave.i "${octave_tll_list}" "${LIB_INSTALL_RPATH}" ${OCTAVE_OCT_DIR} "${SO_PERMISSIONS}")
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/plplot_stub.m
DESTINATION ${PLPLOT_OCTAVE_DIR}
)
endif(ENABLE_octave)

67
src/3rdparty/plplot/bindings/octave/FGA vendored Executable file
View File

@ -0,0 +1,67 @@
plplot_octave FGA (frequently given answers):
--Make sure that you have octave-2.0.16 or latter, matwrap and perl.
Make sure that you have a correctly installed octave, configured with
--enable-shared and --enable-dl. The command
ldd `which octave`
should report octave dynamic libs, liboctave.so, libcruft.so and
liboctinterp.so
--If you have problems, please try first to see if you can sucessefully
compile and run the oregonator.cc and hello.cc files in the examples
directory of the Octave distribution. If they don't run, fix first
octave (configure with above options and reinstall).
--If you have a problem with the Tk demos in the plplot distribution,
probably your Xserver is not secure. Use 'xauth' or rebuild tk without
security. But you don't need Tk (although useful); the default is to
use the Xwindows driver.
--The demos in the plplot_octave distribution should be run in the
extracted directory from plplot_octave, as there are needed script files
in directories misc, demos and PLplot. To run the plplot_octave demos,
you must provide a LOADPATH that start at the current directory; being
there.
--There are problems with `semilogy, semilogx and loglog',
-- there are no such thing as 'replot'. The equivalent, 'plreplot', does
not do what you want. Also, 'title', 'xlabel' and 'ylabel' must be given
*before* the plot command. The general idea is that plot attributes should
be set before plotting the data.
--In hold mode, the first plot defines the viewport, so further plots
don't rescale the axis.
--check that plplot_octave.oct find its shared libs, in case you have
build plplot with shared libs. Try 'ldd ./plplot_octave.oct' and you will
see either a list of needed and founded shared libs, or an error. In
this case, you can specify where to find them using LD_LIBRARY_PATH or
LD_RUN_PATH, or still recompiling plplot_octave.oct with the `-r' flag
to gcc (this might vary with the OS).
--The xwin driver does not respond to deiconify/resize events. This is
a well know misfeature of plplot.
--The xwin driver does not handle exposure events. If your plot window
becomes obscured by other window, then, when you bring it to the front,
(part) of your plot has vanished. Use 'plreplot' to refresh it. If you
are using XFree, at least in version 3.3.3 you can start the Xserver
with the '-wm' option; it will save obscured windows and you don't need
to issue 'plreplot'. Also, the AfterStep window manager has an option
for the same, I think that it is the `SaveUnders' one:
# Miscellaneous voodoo commands - they may help you, they may not
AppsBackingStore
BackingStore
SaveUnders
Please keep reporting problems and how you solve them,
Thanks,
Joao

169
src/3rdparty/plplot/bindings/octave/INSTALL vendored Executable file
View File

@ -0,0 +1,169 @@
Read also the USAGE file.
Build and install:
The Octave binding for PLplot is now automatically generated with swig.
Simply use the normal cmake command to configure PLplot, then
<build_tool> install
to build PLplot including its Octave binding, and install PLplot including
its Octave binding and associated Octave examples.
N.B. <build_tool> is typically the make command, but CMake allows for
many others.
Automatic Testing:
In the build tree anytime after the cmake command is executed with
the -DBUILD_TEST=ON option execute
<build_tool> help |grep octave
to find all test targets associated with octave. Generally, those targets
have names which remind what they do. So, e.g., test_octave_psc tests
all our standard Octave examples using -dev psc and
test_octave_xwin tests some special interactive Octave examples using
-dev xwin.
Hand Testing (these direction may be out of date because automatic testing is
so convenient):
'cd' to the directory bindings/octave within the build tree.
Invoke octave, (the path is automatically set by the configured
.octaverc file which exists in that directory).
Load the octave binding of PLplot.
plplot_stub;
Check the plplot version by typing "plgver". You should get the same
version that you have just compiled, not some other version that might
be installed.
There are several Octave demos, 'p1' up to 'p20'. Try them:
octave> for i=[1:15 19:20]; feval(sprintf("p%d",i));kbhit;endfor;oneplot
and a set of script files that emulate the well known x??c plplot demos. Try:
octave> plplot_octave_demo
Demo x14c might fail, if you have problems with tk.
You can set some preferences in the file 'pldef.m'
Don't worry if you see the following warning:
warning: empty matrix found in matrix list
You can avoid it setting "empty_list_elements_ok = 1;" in your
~/.octaverc Octave startup file (see below). This is being corrected
in plplot_octave, meanwhile keep remembering me :-).
Using:
After testing, type "make install". The default path to installation
is <installation prefix>/share/share/plplot_octave. If you don't like
the default <installation prefix> which is /usr/local, reconfigure
PLplot using your preferred -DCMAKE_INSTALL_PREFIX=<installation
prefix> option for CMake.
There are three paths that you can add to LOADPATH:
1-The *needed* path is <installation prefix>/share/plplot_octave//
2-The demos path is <installation prefix>/lib/plplotx.y.z/examples/octave//
3-The path to switch between PLplot and gnuplot is <installation prefix>/share/octave//
Note: If you are using octave2.9 then LOADPATH is obsolete and you must
use addpath instead. Note also that a trailing // no longer includes
all subdirectories. You must explicitly add them. In particular you need
the support subdirectory of plplot_octave.
If you want to test the installation with the demos, call octave and
set the LOADPATH as in
LOADPATH ="<installation prefix>/lib/plplotx.y.z/examples/octave//:\
<installation prefix>/share/plplot_octave//:"
You can now repeat the demos you already tried. Or just type 'p1'<CR>,
'p2'<CR> ... my preferred test is "plot(sin(1:10),'-o')". As usual,
'help command' gives you some help.
For everyday usage, you must setup your LOADPATH to include the install
path *before* the standard Octave LOADPATH. The best way of doing it
is to use the file ~/.octaverc to set it up. Add the following line to
it, using of course the real install prefix:
LOADPATH="<installation prefix>/share/plplot_octave//:<other path>:<other path>";
You can use the standard Octave plot commands if in the LOADPATH a
":" appears *before* the plplot_octave path, as in
LOADPATH=":<installation prefix>/share/plplot_octave//:<other path>:<other path>";
You can use the command toggle_plplot_use to change between the two
sets of commands, but for this you must set an additional path in LOADPATH.
It must be set as:
LOADPATH="<installation prefix>/share/plplot_octave//:<installation prefix>/share/octave//:"
You are done. You can now use almost all the standard Octave plot
commands plus a whole bunch of new ones.
If you want to use another driver othen than the "xwin" one, which is
the defaul, you must first open a new plot window using "figure", e.g.
figure(1,"tk")
p1
fig(2,"xwin") # fig() is an alias to figure()
p2
To print or save a plot, use
save_fig("foo.ps")
save_fig("|lp","ps")
Use `lp_setup' to setup your printer.
If you just want to use the PLplot API, use it as you would from a C
program, with the exception that you don't need to specify matrices
dimensions; e.g., for plline(n,x,y) you just need to call it as
plline(x,y), where x and y are column vectors. Look at the various
x??c.m examples in the demos directory.
You can't call API functions whose arguments are pointers to
functions. Some wrappers for common situations are however available.
What you get:
You have a 'demo' directory, with the equivalent octave script files
x??c.m of PLplot C demos, and some new demos, p??.m.
You have a 'PLplot' directory with modified versions of the standard
octave plot command, plus a lot of new ones ready for Octave usage. You
must have it on your LOADPATH before the standard octave/gnuplot plot
scripts. If you install it in the default directory, use the octave
command `octave_plplot_path' to setup the path. You can change between
the default gnuplot plotter and octave_plplot using the octave command
`use_plplot'.
You have a misc directory with some other octave demos/utilities.
You have an etc directory where the "documentation" is (not anymore,
documentation is built from the main documentation file, api.xml.
You have the directory where the README, INSTALL, PROBLEMS,
BUGS, ToDo, are, plus 'plplot_octave_org.h', etc.
As with every program, except D. Knuth ones, the programs in this
package are not finished nor bug free. Please report bugs and send
patches. I will not send checks for each bug discovered :-)
Enjoy,
Joao
Update for octave 2.9 by Andrew Ross.
Update for CMake by Alan W. Irwin.

View File

@ -0,0 +1,130 @@
# bindings/octave/PLplot/CMakeLists.txt for PLplot
###
### Process this file with cmake to produce Makefile
###
# Copyright (C) 2006-2017 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; 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 PLplot; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
# Install octave support (in support subdirectory), binding "m", and user "m"
# files.
add_subdirectory(support)
set(binding_m_files
arrow.m
arrows.m
autostyle.m
axis.m
axis_set.m
bgr.m
blue.m
bone.m
bottom_title.m
clip.m
closeallfig.m
closefig.m
colormap.m
comet.m
contour.m
cool.m
copper.m
drawnow.m
fig.m
fig_raise.m
fig_state.m
figure.m
fill.m
free_fig.m
ginput.m
green.m
grid.m
griddata.m
gtext.m
hls2rgb.m
hold.m
hot.m
hsv.m
ishold.m
label_plot.m
legend.m
loglog.m
lp_setup.m
mesh.m
meshc.m
meshz.m
mplot.m
multiplot.m
oneplot.m
peaks.m
pink.m
plclearplot.m
plclg.m
plcolormap.m
pldef.m
plimage.m
plot.m
plot3.m
plot_border.m
plot_margin.m
plrb.m
plsetopt.m
polar.m
prism.m
red.m
rgb2hls.m
rgbplot.m
save_fig.m
semilogx.m
semilogy.m
set_view.m
shade.m
shading.m
shg.m
stopdraw.m
stripc.m
stripc_add.m
stripc_del.m
struct_contains.m
subplot.m
subwindow.m
surf.m
surfc.m
surfl.m
tdeblank.m
text.m
title.m
top_title.m
xlabel.m
xticks.m
ylabel.m
yticks.m
zlabel.m
zoom.m
)
install(FILES ${binding_m_files} DESTINATION ${PLPLOT_OCTAVE_DIR})
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/plplot_octave_path.m.in
${CMAKE_CURRENT_BINARY_DIR}/plplot_octave_path.m
@ONLY
)
set(user_m_files
use_plplot.m
${CMAKE_CURRENT_BINARY_DIR}/plplot_octave_path.m
toggle_plplot_use.m
)
install(FILES ${user_m_files} DESTINATION ${OCTAVE_M_DIR})

View File

@ -0,0 +1,59 @@
## Copyright (C) 1998-2003 Joao Cardoso.
##
## This program is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by the
## Free Software Foundation; either version 2 of the License, or (at your
## option) any later version.
##
## This program 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
## General Public License for more details.
##
## This file is part of plplot_octave.
## arrow (coord, mag, rot, col)
## arrow (col)
##
## plot one arrow of color col, magnitude mag, rotation rot (degrees)
## with origin at point coord[2]
## magnitude = 1 means arrow lenght = 1 in world coordinates
##
## with only one argument, uses the mouse to define begin and end points
function arrow (coord, mag, rot, col)
__pl_init;
if (nargin == 1) # col
[x1, y1] = ginput(1);
[x2, y2] = ginput(1);
mag = sqrt((x2-x1).^2 + (y2-y1).^2);
rot = 180*atan((y2-y1)/(x2-x1))/pi;
if (x2 < x1)
rot = rot+180;
endif
arrow([x1, y1], mag, rot, coord);
return
endif
if (nargin == 4)
x = [0; 1; 0.75; 1; 0.75];
y = [0; 0; 0.1; 0; -0.1];
rot = -rot*pi/180;
t = [cos(rot), -sin(rot)
sin(rot), cos(rot)];
xx = (x .* t(1,1) .+ y .* t(2,1)) .* mag + coord(1);
yy = (x .* t(1,2) .+ y .* t(2,2)) .* mag + coord(2);
plcol0(col);plline(xx,yy);
plflush; pleop;
endif
endfunction

View File

@ -0,0 +1,23 @@
## Copyright (C) 1998-2003 Joao Cardoso.
##
## This program is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by the
## Free Software Foundation; either version 2 of the License, or (at your
## option) any later version.
##
## This program 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
## General Public License for more details.
##
## This file is part of plplot_octave.
## arrows( X, Y, dx, dy)
## plot an array of arrows (partly emulates matlab quiver)
function arrows( X, Y, dx, dy)
__pl_init;
plvect2(dx,dy,1,X,Y);
endfunction

View File

@ -0,0 +1,60 @@
## Copyright (C) 1998-2003 Joao Cardoso.
##
## This program is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by the
## Free Software Foundation; either version 2 of the License, or (at your
## option) any later version.
##
## This program 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
## General Public License for more details.
##
## This file is part of plplot_octave.
## st = autostyle "on" | "off" | 1 | 0
##
## if set increases line style after each plot.
## return current status;
## Usefull for B&W plots
function st = autostyle(x)
global __pl
global pl_automatic_replot
strm = __pl_init;
if (nargin == 1)
if (ischar (x))
if (strcmp ("off", x))
__pl.line_style(strm) = 0;
elseif (strcmp ("on", x))
__pl.line_style(strm) = 1;
else
help autostyle
endif
elseif (isscalar(x))
if (x == 0)
__pl.line_style(strm) = 0;
elseif (x == 1)
__pl.line_style(strm) = 1;
endif
else
help autostyle
return;
endif
elseif (nargin > 1)
help autostyle
return;
endif
st = __pl.line_style(strm);
if (exist("pl_automatic_replot"))
if (pl_automatic_replot)
__pl_plotit;
endif
endif
endfunction

View File

@ -0,0 +1,203 @@
## Copyright (C) 1996 John W. Eaton
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2, or (at your option)
## any later version.
##
## Octave 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
## General Public License for more details.
## usage: ax = axis ()
## axis (ax | opt)
## axis (ax, opt)
##
## Sets the axis limits.
##
## With no arguments, turns "autoscaling" on, and returns the current axis
##
## "ax" can be a 2, 4 or 6 element row vector that sets the minimum and
## maximum lower and upper limits of the data that will be plotted:
## [xmin, xmax], [xmin, xmax, ymin, ymax], [xmin, xmax, ymin, ymax, zmin, zmax]
##
## "opt" is an option string, that:
##
## control the aspect ratio of the axes:
## "square" Force a square aspect ratio.
## "equal" Force x distance to equal y-distance.
## "normal" Restore the balance.
## "auto" Set the specified axes to have nice limits around the data.
## "manual" Fix the current axes limits.
## "tight" Fix axes to the limits of the data.
## "image" Equivalent to "tight" and "equal".
##
## affect the appearance of tic marks (note, if there are no tic marks
## for an axis, there can be no labels):
## "on" Turn tic marks and labels on for all axes.
## "off" Turn tic marks off for all axes.
## "tic[xy]" Turn tic marks on for all axes, or turn them on for
## the specified axes and off for the remainder.
## "label[xy] Turn tic labels on for all axes, or turn them on
## for the specified axes and off for the remainder.
## "nolabel" Turn tic labels off for all axes.
##
## affect the appearance of the x and y coordinate axis
## "axison" Turn on the x and y coordinate axis
## "axisoff" Turn off the x and y coordinate axis
##
## returns current axis state:
## [s1,s2,s3] = axis('state') returns current settings
## Author: jwe
## Modified: jc
function curr_axis = axis (ax, opt)
## the idea is that _pl.axis always has the current max/min axis, either
## as setup by the user, or automaticaly. It interacts with hold mode.
global __pl
global pl_automatic_replot
strm = __pl_init;
if (nargin == 0)
__pl.axis_st(strm) = 0;
__pl.aspect(strm) = 0;
curr_axis = __pl.axis(strm,:);
elseif (nargin == 1 && ischar (ax))
opt = ax; ax = [];
elseif (nargin == 1 && isvector (ax))
opt = "";
else
usage "axis"
endif
if (nargin != 0 && !isempty (ax))
len = length (ax);
if (len != 2 && len != 4 && len != 6)
error ("axis: expecting vector with 2, 4, or 6 elements.\n");
endif
__pl.axis_st(strm) = 1;
if (len > 1)
__pl.axis(strm, [1, 2]) = [ax(1), ax(2)];
endif
if (len > 3)
__pl.axis(strm, [3, 4]) = [ax(3), ax(4)];
endif
if (len > 5)
__pl.axis(strm, [5, 6]) = [ax(5), ax(6)];
endif
elseif (nargin != 0 && !isempty(opt))
switch(opt)
case "state" ## [s1, s2, s3] = axis('state') returns current settings
## S1 = 'auto' or 'manual'.
if (__pl.axis_st(strm) == 0 && __pl.margin(strm) == 1)
S1 = "auto";
elseif (__pl.axis_st(strm) == 1)
S1 = "manual";
elseif (__pl.axis_st(strm) == 0 && __pl.margin(strm) == 0)
S1 = "tight";
elseif (__pl.aspect(strm) == 1 &&__pl.axis_st(strm) == 0)
S1 = "image";
endif
## S2 = 'on' or 'off'.
S2 = "off";
if (__pl.xticks(strm,3) == 1 && __pl.yticks(strm,3) == 1)
S2 = "on";
endif
## S3 = 'xy' or 'ij'.
S3 = "xy";
curr_axis = [S1; S2; S3];
## aspect ratio
case "square"
__pl.aspect(strm) = 2;
case "equal"
__pl.aspect(strm) = 1;
case "normal"
__pl.axis_st(strm) = 0;
__pl.aspect(strm) = 0;
## the way axis limits are interpreted.
case "auto"
__pl.axis_st(strm) = 0;
__pl.margin(strm) = 1;
case "manual" ## fix the current axis
__pl.axis_st(strm) = 1;
case "tight"
__pl.axis_st(strm) = 0;
__pl.margin(strm) = 0;
case "image"
__pl.aspect(strm) = 1;
__pl.margin(strm) = 0;
## the appearance of tic marks
case "on" ## tic marks and tick labels on for all axes
__pl.xticks(strm,3) = 1;
__pl.xticks(strm,4) = 1;
__pl.yticks(strm,3) = 1;
__pl.yticks(strm,4) = 1;
case "off" ## tic marks off for all axes
__pl.xticks(strm,3) = 0;
__pl.yticks(strm,3) = 0;
case "ticxy" ## on for the specified axes and off for the remainder.
__pl.xticks(strm,3) = 1;
__pl.yticks(strm,3) = 1;
case "ticx"
__pl.xticks(strm,3) = 1;
__pl.yticks(strm,3) = 0;
case "ticy"
__pl.xticks(strm,3) = 0;
__pl.yticks(strm,3) = 1;
## the appearance of tic labels
case "labelxy" ## on for the specified axes and off for the remainder.
__pl.xticks(strm,4) = 1;
__pl.yticks(strm,4) = 1;
case "labelx"
__pl.xticks(strm,4) = 1;
__pl.yticks(strm,4) = 0;
case "labely"
__pl.xticks(strm,4) = 0;
__pl.yticks(strm,4) = 1;
case "nolabel" ## Turn tic labels off for all axes.
__pl.xticks(strm,4) = 0;
__pl.yticks(strm,4) = 0;
## the direction of increasing values on the axes
case "ij"
warning("axis: option 'ij' not supported.");
case "xy"
1; ## default
## the appearance of the xy axis
case "axison"
__pl.axisxy(strm) = 1;
case "axisoff"
__pl.axisxy(strm) = 0;
otherwise
error("axis: option '%s' not recognized.\n", tdeblank(opt));
endswitch
endif
if (exist("pl_automatic_replot"))
if (pl_automatic_replot)
__pl_plotit;
endif
endif
endfunction

View File

@ -0,0 +1,28 @@
## Copyright (C) 1998-2003 Joao Cardoso.
##
## This program is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by the
## Free Software Foundation; either version 2 of the License, or (at your
## option) any later version.
##
## This program 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
## General Public License for more details.
##
## This file is part of plplot_octave.
## st = axis_set
##
## return current axis status
## st = 0 => autoscale
## st = 1 => axis are set
function st = axis_set
global __pl
strm = __pl_init;
st = __pl.axis_st(strm);
endfunction

View File

@ -0,0 +1,50 @@
## Copyright (C) 2002-2003 Joao Cardoso.
##
## This program is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by the
## Free Software Foundation; either version 2 of the License, or (at your
## option) any later version.
##
## This program 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
## General Public License for more details.
##
## This file is part of plplot_octave.
## map = bgr(n)
##
## return a colormap of size 'n' going from blue to green to red.
## Good for coloring magnitude colored surfaces.
## Without arguments, map has lenght 64
function map = bgr(n)
if (nargin != 1)
n = 64;
endif
i = fix(linspace (1, n, 5));
rg = i(1):i(2);
r(1,rg) = 0;
g(1,rg) = linspace(0,1,length(rg));
b(1,rg) = 1;
rg = i(2):i(3);
r(1,rg) = 0;
g(1,rg) = 1;
b(1,rg) = linspace(1,0,length(rg));
rg = i(3):i(4);
r(1,rg) = linspace(0,1,length(rg));
g(1,rg) = 1;
b(1,rg) = 0;
rg = i(4):i(5);
r(1,rg) = 1;
g(1,rg) = linspace(1,0,length(rg));
b(1,rg) = 0;
map = [r', g', b'];
endfunction

View File

@ -0,0 +1,27 @@
## Copyright (C) 1999 Paul Kienzle
##
## This program is free software and may be used for any purpose. This
## copyright notice must be maintained. Paul Kienzle is not responsible
## for the consequences of using this software.
## Colormap.
##
## map = blue (number)
## Author: Paul Kienzle <pkienzle@cs.indiana.edu>
## Created: Sept 99
## Modified: jc
function map = blue (number)
if (nargin == 0)
number = 64;
elseif (nargin > 1)
usage ("blue (number)");
endif
gr = [0:(number-1)]';
map = [zeros(number,1), zeros(number,1), gr] / (number - 1);
endfunction

Some files were not shown because too many files have changed in this diff Show More