File: clip.h

package info (click to toggle)
yorick 1.5.08-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 7,508 kB
  • ctags: 7,937
  • sloc: ansic: 75,604; cpp: 1,282; lisp: 1,217; sh: 1,026; makefile: 616; fortran: 19
file content (65 lines) | stat: -rw-r--r-- 1,847 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
    CLIP.H (ANSI C version)
    Routines to perform floating point clipping operations.

    $Id: clip.h,v 1.1 1993/08/27 17:08:43 munro Exp $

    Interface routines:

    *** include "clip.h" to define xClip, yClip ***
    int nc;
    ClipSetup(xmin, xmax, ymin, ymax);

       *** to draw an open curve, use ***
    if (ClipBegin(x, y, n, 0)) DrawPolyline(x, y, n);
    else while (nc=ClipMore()) DrawPolyline(xClip, yClip, nc);

       *** to draw a closed curve, use ***
    if (ClipBegin(x, y, n, 1)) DrawPolygon(x, y, n);
    else while (nc=ClipMore()) DrawPolyline(xClip, yClip, nc);

       *** to draw a set of unconnected points, use ***
    if (nc=ClipPoints(x, y, n)) DrawPolymarker(xClip, yClip, nc);

       *** to draw a closed filled curve, use ***
    if (nc=ClipFilled(x, y, n)) DrawFilledPolygon(xClip, yClip, nc);

       *** to draw a disjoint segments, use ***
    if (nc=ClipDisjoint(x0, y0, x1, y1, n))
       DrawDisjoint(xClip, yClip, xClip1, yClip1, nc);
 */
/*    Copyright (c) 1994.  The Regents of the University of California.
                    All rights reserved.  */

#ifndef CLIP_H
#define CLIP_H

#ifndef GIST_H
#ifndef SINGLE_P
typedef double GpReal;
#else
typedef float GpReal;
#endif
#endif

extern GpReal *xClip, *yClip, *xClip1, *yClip1;

extern void ClipFreeWS(void);

extern void ClipSetup(GpReal xmn, GpReal xmx, GpReal ymn, GpReal ymx);

extern int ClipBegin(const GpReal* xx, const GpReal* yy, int nn, int clsd);

extern int ClipMore(void);

extern int ClipPoints(const GpReal* xx, const GpReal* yy, int nn);

extern int ClipFilled(const GpReal* xx, const GpReal* yy, int nn);

extern int ClipDisjoint(const GpReal* x0, const GpReal* y0,
			const GpReal* x1, const GpReal* y1, int nn);

extern int ClipTest(const GpReal* xx, const GpReal* yy, int nn, int clsd,
		    const GpReal* box);

#endif