Bioplib
Protein Structure C Library
|
HPGL plotting functions. More...
#include <math.h>
#include <string.h>
#include <stdio.h>
#include "MathType.h"
#include "SysDefs.h"
#include "plotting.h"
Go to the source code of this file.
Macros | |
#define | FIXVERT |
#define | MAXBUFF 160 |
Functions | |
BOOL | blHPGLInit (char *filename, char *AltFont, REAL xmargin, REAL ymargin) |
void | blHPGLPen (int num) |
void | blHPGLMove (REAL x, REAL y) |
void | blHPGLDraw (REAL x, REAL y) |
void | blHPGLSetDash (int style) |
void | blHPGLFont (int font, REAL size) |
void | blHPGLLText (REAL x, REAL y, char *string) |
void | blHPGLCBText (REAL x, REAL y, REAL offset, char *text) |
void | blHPGLROffText (REAL x, REAL y, REAL offset, char *text) |
void | blHPGLLCText (REAL x, REAL y, char *text) |
void | blHPGLCTText (REAL x, REAL y, REAL offset, char *text) |
void | blHPGLVText (REAL x, REAL y, REAL xoff, char *text, int TitleFont, REAL TitleSize, char *label, int LabelFont, REAL LabelSize) |
void | blHPGLEnd (void) |
void | blHPGLShowText (char *text, BOOL orientation, int XBase, int YBase) |
HPGL plotting functions.
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.
Definition in file hpgl.c.
#define FIXVERT |
[in] | x | X coordinate |
[in] | y | Y coordinate |
[in] | offset | Y-offset (multiplied by font height). Move text up by this amount |
[in] | *text | Text to print |
Write centre-bottom justified text in HPGL
[in] | x | X coordinate |
[in] | y | Y coordinate |
[in] | offset | Y offset in points. Move text down by this. |
[in] | *text | Text to print |
Center Top justify text at x,y with y-offset in pts.
void blHPGLEnd | ( | void | ) |
void blHPGLFont | ( | int | font, |
REAL | size | ||
) |
[in] | font | Font number |
[in] | size | Point size of font |
Set font for HPGL plot
[in] | *filename | HPGL file name |
[in] | *AltFont | Alternative font used for Greek characters |
[in] | xmargin | Unprintable x margin |
[in] | ymargin | Unprintable y margin |
Initialise an HPGL plot. The parameters specify the unprintable margins on the output device.
The plot is also affected by global variables:
PSxpicsize X picture size PSypicsize Y picture size PSxoffset X offset PSyoffset Y offset
void blHPGLPen | ( | int | num | ) |
[in] | x | X coordinate |
[in] | y | Y coordinate |
[in] | offset | Move left by this amount (pts) |
[in] | *text | Text to print |
Print right-justified text to HPGL
void blHPGLSetDash | ( | int | style | ) |
void blHPGLShowText | ( | char * | text, |
BOOL | orientation, | ||
int | XBase, | ||
int | YBase | ||
) |
[in] | *text | Text to be displayed with control codes |
[in] | orientation | TRUE=vertical, FALSE=horizontal |
[in] | XBase | Position at which to start (device coords) |
[in] | YBase | Position at which to start (device coords) |
Displays the text, raising or lowering as appropriate and selecting alternate font where required. Used by the various ...Text() routines.
void blHPGLVText | ( | REAL | x, |
REAL | y, | ||
REAL | xoff, | ||
char * | text, | ||
int | TitleFont, | ||
REAL | TitleSize, | ||
char * | label, | ||
int | LabelFont, | ||
REAL | LabelSize | ||
) |
[in] | x | X coordinate (in data units) |
[in] | y | Y coordinate (in data units) |
[in] | xoff | X-offset in pts |
[in] | *text | Text to be written |
[in] | *TitleFont | Font in which to write it |
[in] | TitleSize | Size of font |
[in] | *label | Label to be used to calc x offset |
[in] | *LabelFont | Font of this label |
[in] | LabelSize | Size of this label |
Write vertical text centred on x,y offset back along x by the size of label and by xoff in pts The `label' specification is used to calculate an amount by which to move the text back. Typically this would be the longest data label on the graph's Y-axis. The FIXVERT code is used to correct character dimensions. Not sure if it is a bug in the PLT: interpreter which requires this, or whether it is standard HPGL. Define FIXVERT if it improves your output.