Changeset 16 for abuse/trunk/src/intsect.cpp
- Timestamp:
- Nov 10, 2005, 8:08:09 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/intsect.cpp
r2 r16 2 2 #include <stdlib.h> 3 3 4 void pushback( long x1,long y1,long &x2,long&y2,5 long xp1, long yp1, long xp2, longyp2, int xdir, int ydir, int inside)4 void pushback(int32_t x1,int32_t y1,int32_t &x2,int32_t &y2, 5 int32_t xp1, int32_t yp1, int32_t xp2, int32_t yp2, int xdir, int ydir, int inside) 6 6 { 7 7 … … 15 15 16 16 17 /* int setback_intersect( long x1,long y1,long &x2,long&y2,18 long xp1, long yp1, long xp2, longyp2)17 /* int setback_intersect(int32_t x1,int32_t y1,int32_t &x2,int32_t &y2, 18 int32_t xp1, int32_t yp1, int32_t xp2, int32_t yp2) 19 19 { 20 longmx1,my1,b1,mx2,my2,b2,side1,side2,tx2,ty2;20 int32_t mx1,my1,b1,mx2,my2,b2,side1,side2,tx2,ty2; 21 21 my1=(y2-y1); 22 22 if (!my1) // is the first line strait across? … … 110 110 if (abs(mx1)>abs(my1)) 111 111 { 112 longae_bd=my1*mx2-mx1*my2;112 int32_t ae_bd=my1*mx2-mx1*my2; 113 113 CONDITION(ae_bd,"line intersect fuck up"); 114 114 tx2=(mx1*mx2*(b2-b1))/ae_bd+xadd; … … 117 117 else 118 118 { 119 longdb_ea=(my2*mx1-mx2*my1);119 int32_t db_ea=(my2*mx1-mx2*my1); 120 120 CONDITION(db_ea,"line intersect fuck up"); 121 121 ty2=(mx1*b1*my2-my1*mx2*b2)/db_ea+yadd; … … 137 137 138 138 139 int setback_intersect( long x1,long y1,long &x2,long&y2,140 long xp1, long yp1, long xp2, longyp2,141 longinside) // which side is inside the polygon? (0 always setback)139 int setback_intersect(int32_t x1,int32_t y1,int32_t &x2,int32_t &y2, 140 int32_t xp1, int32_t yp1, int32_t xp2, int32_t yp2, 141 int32_t inside) // which side is inside the polygon? (0 always setback) 142 142 { 143 143 // the line equations will be put in the form … … 145 145 // A B C 146 146 147 longa1,b1,c1,a2,b2,c2,r1,r2;147 int32_t a1,b1,c1,a2,b2,c2,r1,r2; 148 148 149 149 a1=y2-y1; … … 157 157 } 158 158 159 longxdiff,ydiff;160 /* longxdiff=abs(xp1-xp2),ydiff=yp1-yp2;159 int32_t xdiff,ydiff; 160 /* int32_t xdiff=abs(xp1-xp2),ydiff=yp1-yp2; 161 161 if (xdiff>=ydiff) // increment the endpoints 162 162 if (xp2<xp1) { xp2--; xp1++; } … … 187 187 inside==0 || r2==0) 188 188 { 189 longae=a1*b2,bd=b1*a2;189 int32_t ae=a1*b2,bd=b1*a2; 190 190 if (ae!=bd) // co-linear returns 0 191 191 {
Note: See TracChangeset
for help on using the changeset viewer.