ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/clip.c
(Generate patch)

Comparing ray/src/common/clip.c (file contents):
Revision 1.1 by greg, Thu Feb 2 10:33:01 1989 UTC vs.
Revision 2.2 by greg, Sun Dec 19 22:49:28 1993 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1986 Regents of the University of California */
1 > /* Copyright (c) 1993 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 10 | Line 10 | static char SCCSid[] = "$SunId$ LBL";
10   *     8/28/85
11   */
12  
13 + #include  "fvect.h"
14 +
15   #include  "plocate.h"
16  
17 + #define MAXITER         6       /* maximum possible number of iterations */
18  
19 +
20   clip(ep1, ep2, min, max)        /* clip a line segment to a box */
21 < double  *ep1, *ep2;
22 < double  min[3], max[3];
21 > FLOAT  *ep1, *ep2;
22 > FVECT  min, max;
23   {
24 +        int  itlim = MAXITER;
25          int  loc1, loc2;
26          int  accept;
27 <        double  *dp;
27 >        FLOAT  *dp;
28          double  d;
29          register int  i, j;
30  
# Line 39 | Line 44 | double  min[3], max[3];
44          
45          while (!((accept = !(loc1 | loc2)) || (loc1 & loc2))) {
46          
47 +                if (itlim-- <= 0)       /* past theoretical limit? */
48 +                        return(0);      /* quit fooling around */
49 +
50                  if (!loc1) {            /* make sure first point is outside */
51                          dp = ep1; ep1 = ep2; ep2 = dp;
52                          i = loc1; loc1 = loc2; loc2 = i;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines