Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.5 KiB

  1. #ifndef __geom_h_
  2. #define __geom_h_
  3. /*
  4. ** Copyright 1994, Silicon Graphics, Inc.
  5. ** All Rights Reserved.
  6. **
  7. ** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  8. ** the contents of this file may not be disclosed to third parties, copied or
  9. ** duplicated in any form, in whole or in part, without the prior written
  10. ** permission of Silicon Graphics, Inc.
  11. **
  12. ** RESTRICTED RIGHTS LEGEND:
  13. ** Use, duplication or disclosure by the Government is subject to restrictions
  14. ** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  15. ** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  16. ** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  17. ** rights reserved under the Copyright Laws of the United States.
  18. **
  19. ** Author: Eric Veach, July 1994.
  20. */
  21. #include "mesh.h"
  22. #ifdef NO_BRANCH_CONDITIONS
  23. /* MIPS architecture has special instructions to evaluate boolean
  24. * conditions -- more efficient than branching, IF you can get the
  25. * compiler to generate the right instructions (SGI compiler doesn't)
  26. */
  27. #define VertEq(u,v) (((u)->s == (v)->s) & ((u)->t == (v)->t))
  28. #define VertLeq(u,v) (((u)->s < (v)->s) | \
  29. ((u)->s == (v)->s & (u)->t <= (v)->t))
  30. #else
  31. #define VertEq(u,v) ((u)->s == (v)->s && (u)->t == (v)->t)
  32. #define VertLeq(u,v) (((u)->s < (v)->s) || \
  33. ((u)->s == (v)->s && (u)->t <= (v)->t))
  34. #endif
  35. #define EdgeEval(u,v,w) __gl_edgeEval(u,v,w)
  36. #define EdgeSign(u,v,w) __gl_edgeSign(u,v,w)
  37. /* Versions of VertLeq, EdgeSign, EdgeEval with s and t transposed. */
  38. #define TransLeq(u,v) (((u)->t < (v)->t) || \
  39. ((u)->t == (v)->t && (u)->s <= (v)->s))
  40. #define TransEval(u,v,w) __gl_transEval(u,v,w)
  41. #define TransSign(u,v,w) __gl_transSign(u,v,w)
  42. #define EdgeGoesLeft(e) VertLeq( (e)->Dst, (e)->Org )
  43. #define EdgeGoesRight(e) VertLeq( (e)->Org, (e)->Dst )
  44. #define ABS(x) ((x) < 0 ? -(x) : (x))
  45. #define VertL1dist(u,v) (ABS(u->s - v->s) + ABS(u->t - v->t))
  46. #define VertCCW(u,v,w) __gl_vertCCW(u,v,w)
  47. int __gl_vertLeq( GLUvertex *u, GLUvertex *v );
  48. GLdouble __gl_edgeEval( GLUvertex *u, GLUvertex *v, GLUvertex *w );
  49. GLdouble __gl_edgeSign( GLUvertex *u, GLUvertex *v, GLUvertex *w );
  50. GLdouble __gl_transEval( GLUvertex *u, GLUvertex *v, GLUvertex *w );
  51. GLdouble __gl_transSign( GLUvertex *u, GLUvertex *v, GLUvertex *w );
  52. int __gl_vertCCW( GLUvertex *u, GLUvertex *v, GLUvertex *w );
  53. void __gl_edgeIntersect( GLUvertex *o1, GLUvertex *d1,
  54. GLUvertex *o2, GLUvertex *d2,
  55. GLUvertex *v );
  56. #endif