| 1 |
– |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
| 2 |
– |
|
| 1 |
|
#ifndef lint |
| 2 |
< |
static char SCCSid[] = "$SunId$ SGI"; |
| 2 |
> |
static const char RCSid[] = "$Id$"; |
| 3 |
|
#endif |
| 6 |
– |
|
| 4 |
|
/* |
| 5 |
|
* sm_stree.c |
| 6 |
|
* An stree (spherical quadtree) is defined by an octahedron in |
| 13 |
|
#include "sm_list.h" |
| 14 |
|
#include "sm_flag.h" |
| 15 |
|
#include "sm_geom.h" |
| 16 |
+ |
#include "object.h" |
| 17 |
|
#include "sm_qtree.h" |
| 18 |
|
#include "sm_stree.h" |
| 19 |
|
|
| 448 |
|
id1 = id2; |
| 449 |
|
} |
| 450 |
|
} |
| 451 |
+ |
/* Assumption: know crosses plane:dont need to check for 'on' case */ |
| 452 |
+ |
intersect_edge_coord_plane(v0,v1,w,r) |
| 453 |
+ |
FVECT v0,v1; |
| 454 |
+ |
int w; |
| 455 |
+ |
FVECT r; |
| 456 |
+ |
{ |
| 457 |
+ |
FVECT dv; |
| 458 |
+ |
int wnext; |
| 459 |
+ |
double t; |
| 460 |
|
|
| 461 |
+ |
VSUB(dv,v1,v0); |
| 462 |
+ |
t = -v0[w]/dv[w]; |
| 463 |
+ |
r[w] = 0.0; |
| 464 |
+ |
wnext = (w+1)%3; |
| 465 |
+ |
r[wnext] = v0[wnext] + dv[wnext]*t; |
| 466 |
+ |
wnext = (w+2)%3; |
| 467 |
+ |
r[wnext] = v0[wnext] + dv[wnext]*t; |
| 468 |
+ |
} |
| 469 |
+ |
|
| 470 |
+ |
|
| 471 |
|
stVisit_clip(st,i,verts,vcnt,l,cell,func,n) |
| 472 |
|
STREE *st; |
| 473 |
|
int i; |
| 636 |
|
} |
| 637 |
|
|
| 638 |
|
|
| 622 |
– |
/* New Insertion code!!! */ |
| 623 |
– |
|
| 624 |
– |
|
| 639 |
|
BCOORD qtRoot[3][3] = { {MAXBCOORD2,0,0},{0,MAXBCOORD2,0},{0,0,MAXBCOORD2}}; |
| 640 |
|
|
| 641 |
|
|
| 751 |
|
i = stLocate_root(p); |
| 752 |
|
qt = ST_ROOT_QT(st,i); |
| 753 |
|
|
| 740 |
– |
/* Will return lowest level triangle containing point: It the |
| 741 |
– |
point is on an edge or vertex: will return first associated |
| 742 |
– |
triangle encountered in the child traversal- the others can |
| 743 |
– |
be derived using triangle adjacency information |
| 744 |
– |
*/ |
| 754 |
|
vert_to_qt_frame(i,p,bcoordi); |
| 755 |
|
ST_ROOT_QT(st,i) = qtInsert_point(i,qt,EMPTY,qtRoot[0],qtRoot[1], |
| 756 |
|
qtRoot[2],bcoordi,MAXBCOORD2>>1,f,0,&done); |