3
Installation instructions for Unix
4
1) Install the wxwidgets library either by compiling it yourself or using apt/rpm (2.6.0 is needed)
6
- Download wxWidgets 2.6.1 from http://www.wxwidgets.org (wxGTK package)
7
- Untar it to a folder and cd into the main dir.
8
- Make a directory called "buildgtk". Cd into buildgtk
9
- Run: ../configure --disable-debug --enable-gtk2 --enable-monolithic --enable-shared
11
- Run: sudo make install (library and developer files are installed to /usr/local)
12
2) Install at least automake 1.82 and libtool 1.4
13
3) download plplot 5.5.3 from cvs
14
4) build plplot library
15
- cd into plplot main directory
16
- run: cf/bootstrap.sh
17
- run: ./configure --enable-wxwidgets
19
- run: sudo make install
24
Installation instructions for Mac OS X
25
1) Install the wxwidgets library either by compiling it yourself or using the opendarwin port
26
+ Mac OS X G++ Compiler
27
- Download wxWidgets 2.6.1 from http://www.wxwidgets.org (wxMAC package).
28
- Untar it to a folder and cd into the main dir.
29
- Make a directory called "buildosx". cd into "buildosx".
30
- Run: ../configure --disable-debug --enable-monolithic --enable-shared
32
- Run: sudo make install (library and developer files are installed to /usr/local)
34
- download and install the port package from http://darwinports.opendarwin.org
36
PATH=/opt/local/bin:$PATH
37
MANPATH=/opt/local/share/man:$MANPATH
38
INFOPATH=/opt/local/share/info:$INFOPATH
39
to your ".profile" file in your home directory.
40
- run: sudo port -d selfupdate
41
- run: sudo port install wxWidgets (library and developer files are installed to /opt/local)
42
2) Install at least automake 1.82 and libtool 1.4, e.g. via opendarwin port:
43
- download and install the port package from http://darwinports.opendarwin.org
45
PATH=/opt/local/bin:$PATH
46
MANPATH=/opt/local/share/man:$MANPATH
47
INFOPATH=/opt/local/share/info:$INFOPATH
48
to your ".profile" file in your home directory.
49
- run: sudo port -d selfupdate
50
- run: sudo port install automake
51
- run: sudo port install libtool
52
- run: sudo ln -s /opt/local/bin/glibtool /opt/local/bin/libtool
53
- run: sudo ln -s /opt/local/bin/glibtoolize /opt/local/bin/libtoolize
54
3) download plplot 5.5.3 from cvs
55
4) build plplot library
56
- cd into plplot main directory
57
- run: cf/bootstrap.sh
58
- run: ./configure --enable-wxwidgets --with-wxwidgets-bindir=/opt/local/bin (port)
60
run: ./configure --enable-wxwidgets (self compiled in /usr/local)
62
- run: sudo make install
68
--------- Using the driver in a wxWidgets Application -------------------------------------
70
The wxWidgets driver is already capable of redirecting the plot to any canvas (wxDC), which can also be provided by a wxApp. The API is not quite ready for release, but it's easy to implement. First we need to inherit a class from plstream
77
class wxPLplotstream : public plstream
80
wxPLplotstream( wxDC *dc, int width, int height ); //!< Constructor.
81
void set_stream(); //!< Calls some code before every PLplot command.
82
void SetSize( int width, int height ); //!< Set new size of plot area.
83
void RenewPlot(); //!< Redo plot.
85
wxDC* m_dc; //!< Pointer to wxDC to plot into.
86
int m_width; //!< Width of dc/plot area.
87
int m_height; //!< Height of dc/plot area.
91
wxPLplotstream::wxPLplotstream( wxDC *dc, int width, int height ) :
92
m_dc(dc), m_width(width), m_height(height)
96
spage( 0.0, 0.0, m_width, m_height, 0, 0 );
97
SetOpt( "text", "1" ); // use freetype?
98
SetOpt( "smooth", "1" ); // antialiased text?
100
plP_esc( PLESC_DEVINIT, (void*)m_dc );
103
void wxPLplotstream::set_stream()
105
plstream::set_stream();
108
void wxPLplotstream::SetSize( int width, int height )
112
plP_esc( PLESC_CLEAR, NULL );
113
wxSize size( m_width, m_height );
114
plP_esc( PLESC_RESIZE, (void*)&size );
117
void wxPLplotstream::RenewPlot()
119
plP_esc( PLESC_CLEAR, NULL );
124
In the wxWidgets application a wxMemoryDC must be created (e.g. in the constructor of a wxWindow) and made known to the driver, e.g.
127
MemPlotDC = new wxMemoryDC;
128
MemPlotDCBitmap = new wxBitmap( 640, 400, -1 );
129
MemPlotDC->SelectObject( *MemPlotDCBitmap );
130
my_stream = new wxPLplotstream( (wxDC*)MemPlotDC, MemPlotDC_width, MemPlotDC_height );
133
The OnPaint() event handler looks like this (double buffering is used here)
136
void plotwindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
139
GetSize( &width, &height );
141
// Check if we window was resized (or dc is invalid)
142
if( (my_stream == NULL) || (MemPlotDC_width!=width) || (MemPlotDC_height!=height) ) {
143
MemPlotDC->SelectObject( wxNullBitmap );
144
if( MemPlotDCBitmap )
145
delete MemPlotDCBitmap;
146
MemPlotDCBitmap = new wxBitmap( width, height, -1 );
147
MemPlotDC->SelectObject( *MemPlotDCBitmap );
148
my_stream->SetSize( width, height );
150
MemPlotDC_width = width;
151
MemPlotDC_height = height;
154
wxPaintDC dc( this );
155
dc.SetClippingRegion( GetUpdateRegion() );
157
dc.Blit( 0, 0, width, height, MemPlotDC, 0, 0 );
161
The whole PLplot API is then available via the my_stream object.
164
--------- don't bother with stuff below this line -----------------------------------------
167
Installation instructions for Win32
169
- install wxWidgets 2.6.1 (see instructions below)
170
- NOT WORKING NOW: install gd library and/or freetype library (see instructions below)
171
- download the PLplot library from plplot.sf.net (version 5.5.3)
172
- Remark (Mac OS X): You need automake 1.8.2 and libtool 1.4 in order to compile PLplot.
173
Download and install fink (fink.sf.net) and install these programs.
174
- untar or unzip it in a suitable directory
175
- unzip or untar the wxPLplot package in sys/win32
176
- cd into sys/win32/wxplplot
179
. Set WXWIN environment variable (see wxWidgets instructions).
180
. For all compilers you need the mingw32-make program (www.mingw.org).
181
. Check the settings in config.mak.
182
. Run: mingw32-make COMPILER=bcc
183
. or: mingw32-make COMPILER=gcc
185
. Run: mingw32-make COMPILER=bcc
186
. or: mingw32-make COMPILER=gcc
191
Install the gd library for png, gif and jpeg drivers (Win32, NOT WORKING NOW)
193
- goto http://www.boutell.com/gd/ and download the precompiled Windows DLL at
194
the bottom ( http://www.boutell.com/gd/http/gdwin32.zip )
195
- extract to sys/win32/wxplplot
196
- enter sys/win32/wxplplot/gdwin32 and make a library from the dll
197
Borland BCC 5.5: implib -a bgd_bcc.lib bgd.dll
198
VC++: lib /machine:i386 /def:bgd.def
199
MingW: already in gdwin32 (libbgd.a)
201
Install the freetype library (Win32, NOT WORKING NOW)
204
Install wxWidgets 2.6.1
206
+ Win32 MingW Compiler
207
- Download the necessary files from www.mingw.org. Either the whole package mingw-3.1.0 or
208
the canditate releases from at least gcc-core, gcc-g++, binutils, mingw-runtime, w32api,
209
mingw-utils, mingw32-make and gdb. Install them in a directory and set the path file accordingly.
210
- Download wxWidgets 2.6.1 from http://www.wxwidgets.org (wxMSW package).
211
- Unzip it to a folder and set the WXWIN variable accordingly (system wide in System Settings/System).
212
- Goto %WXWIN%/build/msw.
213
- Run all or some of the following commands:
214
mingw32-make -f makefile.gcc BUILD=debug MONOLITHIC=1 SHARED=1
215
The wxWidgets (debug, shared) library will be build.
216
mingw32-make -f makefile.gcc BUILD=release MONOLITHIC=1 SHARED=1
217
The wxWidgets (release, shared) library will be build.
218
mingw32-make -f makefile.gcc BUILD=debug MONOLITHIC=1 SHARED=0
219
The wxWidgets (debug, static) library will be build.
220
mingw32-make -f makefile.gcc BUILD=release MONOLITHIC=1 SHARED=0.
221
The wxWidgets (release, static) library will be build.
222
- Copy both dlls from %%WXWIN%/lib/gcc_dll to a directory, where they can be found (e.g. sys/win32/wxplplot/examples directory).
223
- The same WXWIN variable must than be set for the wxplplot makefile.
225
+ Win32 Borland free command line tools (BCC 5.5.2)
226
- Install the Borland Compiler.
227
- Download wxWidgets 2.6.1 from http://www.wxwidgets.org (wxMSW package)
228
- Unzip it to a folder and set the WXWIN variable accordingly (system wide in System Settings/System).
229
- Goto %WXWIN%/build/msw.
230
- Run all or some of the following commands:
231
make -f makefile.bcc -DBUILD=debug -DMONOLITHIC=1 -DSHARED=1
232
The wxWidgets (debug, shared) library will be build.
233
make -f makefile.bcc -DBUILD=release -DMONOLITHIC=1 -DSHARED=1
234
The wxWidgets (release, shared) library will be build.
235
make -f makefile.bcc -DBUILD=debug -DMONOLITHIC=1 -DSHARED=0
236
The wxWidgets (debug, static) library will be build.
237
make -f makefile.bcc -DBUILD=release -DMONOLITHIC=1 -DSHARED=0.
238
The wxWidgets (release, static) library will be build.
239
- Copy both dlls from %%WXWIN%/lib/gcc_dll to a directory, where they can be found (e.g. sys/win32/wxplplot/examples directory).
240
- The same WXWIN variable must than be set for the wxplplot makefile.