Bioplib
Protein Structure C Library
 All Data Structures Files Functions Variables Typedefs Macros Pages
Macros | Functions
plotting.h File Reference

Include file for using plotting routines. More...

#include <stdio.h>
#include "SysDefs.h"
#include "MathType.h"
#include "hpgl.h"
#include "ps.h"
#include "deprecated.h"

Go to the source code of this file.

Macros

#define DEST_SCREEN   0
 
#define DEST_PS   1
 
#define DEST_HPGL   2
 
#define _PLOTTING_H_DEPRECATED
 

Functions

BOOL blAMInitPlot (char *filename, char *title, int dest, REAL OutXSize, REAL OutYSize, REAL OutXOff, REAL OutYOff, char *AltFont, REAL xmargin, REAL ymargin, REAL DataXMin, REAL DataYMin, REAL DataXMax, REAL DataYMax)
 
void blAMSetPen (int dest, int pen)
 
void blAMMove (int dest, REAL x, REAL y)
 
void blAMDraw (int dest, REAL x, REAL y)
 
void blAMSetLineStyle (int dest, int style)
 
void blAMEndLine (int dest)
 
void blAMSetFont (int dest, char *PSFontName, REAL FontSize)
 
void blAMText (int dest, REAL x, REAL y, char *text)
 
void blAMCBText (int dest, REAL x, REAL y, char *text)
 
void blAMRText (int dest, REAL x, REAL y, REAL offset, char *text)
 
void blAMLCText (int dest, REAL x, REAL y, char *text)
 
void blAMCTText (int dest, REAL x, REAL y, REAL CTOffset, char *text)
 
void blAMEndPlot (int dest)
 
int blPS2HPGLFont (char *font)
 
char * blSimplifyText (char *string)
 

Detailed Description

Include file for using plotting routines.

Version
V1.3
Date
14.08.14
Author
Dr. Andrew C. R. Martin
Institute of Structural & Molecular Biology, University College London, Gower Street, London. WC1E 6BT.
andre.nosp@m.w@bi.nosp@m.oinf..nosp@m.org..nosp@m.uk andre.nosp@m.w.ma.nosp@m.rtin@.nosp@m.ucl..nosp@m.ac.uk

This code is NOT IN THE PUBLIC DOMAIN, but it may be copied according to the conditions laid out in the accompanying file COPYING.DOC.

The code may be modified as required, but any modifications must be documented so that the person responsible can be identified.

The code may not be sold commercially or included as part of a commercial product except as described in the file COPYING.DOC.

Description:

Usage:

Revision History:

Definition in file plotting.h.

Macro Definition Documentation

#define _PLOTTING_H_DEPRECATED

Definition at line 102 of file plotting.h.

#define DEST_HPGL   2

Definition at line 75 of file plotting.h.

#define DEST_PS   1

Definition at line 74 of file plotting.h.

#define DEST_SCREEN   0

Definition at line 73 of file plotting.h.

Function Documentation

void blAMCBText ( int  dest,
REAL  x,
REAL  y,
char *  text 
)
Parameters
[in]destDestination
[in]xX coordinate
[in]yY coordinate
[in]*textText to print

Centre-bottom justify text

  • 07.04.92 Handles screen
  • 10.04.92 Added log support
  • 29.04.92 Added check on log bounds
  • 07.05.92 Added PS support
  • 25.06.92 Added HPGL support
  • 16.07.92 Added DR2D support
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 563 of file plotting.c.

void blAMCTText ( int  dest,
REAL  x,
REAL  y,
REAL  CTOffset,
char *  text 
)
Parameters
[in]destDestination
[in]xX coordinate
[in]yY coordinate
[in]CTOffsetMove down by this amount (points)
[in]*textText to print

Centre/top justify text at position in data coordinates.

  • 06.04.92 Handles screen
  • 07.04.92 Fix to positioning
  • 10.04.92 Added log support
  • 29.04.92 Added check on log bounds
  • 07.05.92 Added PS support
  • 25.06.92 Added HPGL support
  • 01.07.92 Changed for new versions of PSCTText() and HPGLCTText() which take offset in points.
  • 16.07.92 Added DR2D support
  • 07.06.93 Added CTOffset param
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 718 of file plotting.c.

void blAMDraw ( int  dest,
REAL  x,
REAL  y 
)
Parameters
[in]destDestination
[in]xX coordinate
[in]yY coordinate

Draw to a position specified in data coordinates.

  • 06.04.92 Handles screen
  • 10.04.92 Added log support
  • 29.04.92 Added check on log bounds
  • 07.05.92 Added PS support
  • 25.06.92 Added HPGL support
  • 16.07.92 Added DR2D support
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 347 of file plotting.c.

void blAMEndLine ( int  dest)
Parameters
[in]destDestination

End a line; required by PostScript actually to draw on the paper.

  • 07.05.92 Original
  • 25.06.92 Added HPGL support
  • 16.07.92 Added DR2D support
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 432 of file plotting.c.

void blAMEndPlot ( int  dest)
Parameters
[in]destDestination

Close up a device after plotting.

  • 07.05.92 Original
  • 25.06.92 Added HPGL support
  • 01.07.92 Added blank WriteMessage() when plotting to screen
  • 16.07.92 Added DR2D support
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 764 of file plotting.c.

BOOL blAMInitPlot ( char *  filename,
char *  title,
int  dest,
REAL  OutXSize,
REAL  OutYSize,
REAL  OutXOff,
REAL  OutYOff,
char *  AltFont,
REAL  xmargin,
REAL  ymargin,
REAL  DataXMin,
REAL  DataYMin,
REAL  DataXMax,
REAL  DataYMax 
)
Parameters
[in]*filenameFile to open
[in]*titleTitle for plot
[in]destDestination (DEST_PS or DEST_HPGL)
[in]OutXSizeOutput plot X size (inches)
[in]OutYSizeOutput plot Y size (inches)
[in]OutXOffOutput plot X offset (inches)
[in]OutYOffOutput plot Y offset (inches)
[in]*AltFontAlternate font name
[in]xmarginUnprintable x margin (inches, HPGL) Sensible default: 0.58
[in]ymarginUnprintable y margin (inches, HPGL) Sensible default: 0.1465
[in]DataXMinMin data X value
[in]DataYMinMin data Y value
[in]DataXMaxMax data X value
[in]DataYMaxMax data Y value
Returns
TRUE: OK, FALSE: Failed

Initialise a device ready for plotting.

  • 07.05.92 Original
  • 25.06.92 Added HPGL support. Moved setting of PS globals to here.
  • 02.07.92 Put ClearWindow() in for screen plotting. Added seek to start of file for PS and HPGL file plotting.
  • 16.07.92 Added DR2D support
  • 17.07.92 Corrected call to InstallDR2DFonts() before InitDR2D(). Changed buffer to [40]. Added bounds calc'n for DR2D.
  • 20.07.92 Added alternate font parameter to DR2DInit(). Added check on DR2DInit() return.
  • 22.07.92 Consider x-axis labelling in finding max x. Corrected to consider precision for log axes
  • 24.07.92 Added extras parameter to ftostr
  • 27.07.92 Removed the specification of EPSF offsets since the PSFixBoundingBox() routine takes care of all this. Increased size of xmax border for DR2D plots.
  • 06.07.93 Changed parameters
  • 27.02.98 Removed unreachable breaks from switch() statement
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 204 of file plotting.c.

void blAMLCText ( int  dest,
REAL  x,
REAL  y,
char *  text 
)
Parameters
[in]destDestination
[in]xX coordinate
[in]yY coordinate
[in]*textText to print

Left/centre height justify text at position in data coordinates

  • 08.04.92 Handles screen
  • 10.04.92 Added log support
  • 29.04.92 Added check on log bounds
  • 06.05.92 Fix to height centering
  • 07.05.92 Added PS support
  • 08.05.92 Corrected Y-pos for PS
  • 25.06.92 Added HPGL support
  • 16.07.92 Added DR2D support
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 665 of file plotting.c.

void blAMMove ( int  dest,
REAL  x,
REAL  y 
)
Parameters
[in]destDestination
[in]xX coordinate
[in]yY coordinate

Move to a position specified in data coordinates.

  • 06.04.92 Handles screen
  • 10.04.92 Added log support
  • 29.04.92 Added check on log bounds
  • 07.05.92 Added PS support
  • 25.06.92 Added HPGL support
  • 16.07.92 Added DR2D support
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 303 of file plotting.c.

void blAMRText ( int  dest,
REAL  x,
REAL  y,
REAL  offset,
char *  text 
)
Parameters
[in]destDestination
[in]xX coordinate
[in]yY coordinate
[in]offsetMove left by this amount (in points)
[in]*textText to print

Right/centre justify text at position in data coordinates; offset is an x-offset specified in device coordinates (pt)

  • 06.04.92 Handles screen
  • 07.04.92 Fix to positioning
  • 10.04.92 Added log support
  • 29.04.92 Added check on log bounds
  • 07.05.92 Added PS support and offset
  • 25.06.92 Added HPGL support
  • 16.07.92 Added DR2D support
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 614 of file plotting.c.

void blAMSetFont ( int  dest,
char *  PSFontName,
REAL  FontSize 
)
Parameters
[in]destDestination
[in]*PSFontNamePostScript font name
[in]FontSizeSize (in points) of font

Sets the current font using PostScript font names. If producing HPGL output, a lookup table is used to translate this to an HPGL font number

  • 07.04.92 Framework
  • 05.05.92 Original for Screen
  • 07.05.92 Added PS support
  • 25.06.92 Added HPGL support.
  • 29.06.92 Modified to use new PS2AmigaFont() for HPGL
  • 13.07.92 Added DEF_FONT parameter to SetAmigaFont()
  • 16.07.92 Added DR2D support
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 472 of file plotting.c.

void blAMSetLineStyle ( int  dest,
int  style 
)
Parameters
[in]destDestination
[in]styleStyle number (0–5)

Set the line style

  • 08.04.92 Framework
  • 07.05.92 Original (screen & PS)
  • 25.06.92 Added HPGL support. Removed static store of style.
  • 05.07.92 Corrected line patterns. They don't have commas!
  • 16.07.92 Added DR2D support
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 392 of file plotting.c.

void blAMSetPen ( int  dest,
int  pen 
)
Parameters
[in]destDestination
[in]penPen number

Change pen

  • 06.04.92 Handles screen
  • 07.05.92 Added PS support
  • 25.06.92 Added HPGL support
  • 16.07.92 Added DR2D support
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 261 of file plotting.c.

void blAMText ( int  dest,
REAL  x,
REAL  y,
char *  text 
)
Parameters
[in]destDestination
[in]xX coordinate
[in]yY coordinate
[in]*textText to write

Left/bottom justify text at position in data coordinates

  • 08.04.92 Handles screen
  • 10.04.92 Added log support
  • 29.04.92 Added check on log bounds
  • 07.05.92 Added PS support
  • 25.06.92 Added HPGL support
  • 16.07.92 Added DR2D support
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 515 of file plotting.c.

int blPS2HPGLFont ( char *  font)
Parameters
[in]*fontPostScript font name
Returns
HPGL font number

Takes the PostScript font name and works out the best HPGL equivalent from a translation table. On the first call, the table is read from disk and space is allocated for it. If the routine is called with a NULL parameter, the space allocated for the table is freed. It is quite safe to call the routine again after this has occurred; the table will simply be re-read from disk.

If the requested translation is unsuccessful, 0 will be returned as the font number.

  • 06.07.93 Original By: ACRM
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 803 of file plotting.c.

char* blSimplifyText ( char *  string)
Parameters
[in]*stringString containing control codes
Returns
String with control codes removed

Removes control codes from a string for screen display. Also used for calculating string length. The returned string is stored as static within the routine

  • 06.05.92 Original
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 915 of file plotting.c.