~ubuntu-branches/ubuntu/karmic/python-scipy/karmic

« back to all changes in this revision

Viewing changes to Lib/sandbox/xplt/src/gist/cgm.h

  • Committer: Bazaar Package Importer
  • Author(s): Ondrej Certik
  • Date: 2008-06-16 22:58:01 UTC
  • mfrom: (2.1.24 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080616225801-irdhrpcwiocfbcmt
Tags: 0.6.0-12
* The description updated to match the current SciPy (Closes: #489149).
* Standards-Version bumped to 3.8.0 (no action needed)
* Build-Depends: netcdf-dev changed to libnetcdf-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * CGM.H
3
 
 *
4
 
 * $Id: cgm.h 685 2003-03-08 15:26:51Z travo $
5
 
 *
6
 
 * Declare the CGM binary metafile engine for GIST.
7
 
 *
8
 
 */
9
 
/*    Copyright (c) 1994.  The Regents of the University of California.
10
 
                    All rights reserved.  */
11
 
 
12
 
#ifndef CGM_H
13
 
#define CGM_H
14
 
 
15
 
#include "gist.h"
16
 
#include "engine.h"
17
 
 
18
 
#include <stdio.h>
19
 
#ifndef SEEK_CUR
20
 
/* Sun strikes again...  This may break other non-standard machines */
21
 
#define SEEK_CUR 1
22
 
#endif
23
 
 
24
 
/* This Engine is based on the ANSI CGM Standard, ANSI X3.122 - 1986
25
 
   Parts 1 and 3.  It is fully conforming with the following caveats:
26
 
   1. The font names in the FONT LIST metafile descriptor element are
27
 
      standard PostScript font names, rather than ISO standard names
28
 
      (which I couldn't find).  The font numbers match the numbering
29
 
      scheme used by the GPLOT program.
30
 
   2. A Gist smooth polyline is output using the ordinary POLYLINE
31
 
      primitive, preceded by an APPLICATION DATA comment.  This gives
32
 
      reasonable output (identical to that produced by the Gist X
33
 
      engine, in fact), but not as nice as the Gist PostScript engine.
34
 
 */
35
 
 
36
 
typedef unsigned char Octet;  /* as defined in the CGM standard */
37
 
#define MAX_PARTITION 0x7ffc  /* maximum length of a CELL ARRAY partition */
38
 
 
39
 
typedef struct CGMEngine CGMEngine;
40
 
struct CGMEngine {
41
 
  Engine e;
42
 
 
43
 
  /* --------------- Specific to CGMEngine ------------------- */
44
 
 
45
 
  char *filename;
46
 
  GpReal scale;   /* VDC units per Gist NDC unit, 25545.2 by default */
47
 
  long fileSize;  /* approximate maximum in bytes, default is 1 Meg */
48
 
  void (*IncrementName)(char *filename);
49
 
                  /* function to increment filename IN PLACE
50
 
                     (a reasonable default is supplied) */
51
 
  p_file *file;   /* 0 until file is actually written into */
52
 
  int state;      /* CGM state as described in fig. 12 of ANSI X3.122 */
53
 
 
54
 
  /* Page orientation and color table can only be changed at the beginning
55
 
     of each page, so the entries in the Engine base class are repeated
56
 
     here as the "currently in effect" values.  When a new page begins,
57
 
     these values are brought into agreement with those in the base
58
 
     class.  The ChangePalette virtual function temporarily resets colorMode
59
 
     to 0, to avoid any references to the new palette until the
60
 
     next page begins.  */
61
 
  int landscape;
62
 
  int colorMode;
63
 
  int nColors;
64
 
 
65
 
  int currentPage;  /* current page number, incremented by EndPage */
66
 
 
67
 
  /* The CGM engine must keep track of several graphical state
68
 
     parameters, mostly from gistA.  These are reset at the
69
 
     beginning of each page.  */
70
 
  GpBox clipBox;
71
 
  int curClip;
72
 
  unsigned long curColor[5];
73
 
  int curType;
74
 
  GpReal curWidth;
75
 
  int curMark;
76
 
  GpReal curSize;
77
 
  int curFont;
78
 
  GpReal curHeight;
79
 
  int curAlignH, curAlignV;
80
 
  int curPath;
81
 
  int curOpaque;  /* unlike Gist, this applies to more than text... */
82
 
  int curEtype;
83
 
  GpReal curEwidth;
84
 
};
85
 
 
86
 
extern CGMEngine *GisCGMEngine(Engine *engine);
87
 
 
88
 
/* Default CGM scale factor and maximum file size */
89
 
extern GpReal gCGMScale;
90
 
extern long gCGMFileSize;
91
 
 
92
 
/* To change away from the default fileSize, just change the
93
 
   CGMEngine fileSize member.  To change the CGM scale factor
94
 
   (the initial default value is 25545.2, which corresponds to
95
 
   2400 dpi resolution), use GcgmSetScale after creating the
96
 
   engine but BEFORE DRAWING ANYTHING WITH IT: */
97
 
extern void GcgmSetScale(CGMEngine *cgmEngine, GpReal scale);
98
 
 
99
 
#endif