home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / IRIT / IRITS.ZIP / CONVEXL.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-05  |  2.1 KB  |  51 lines

  1. /*****************************************************************************
  2. *   "Irit" - the 3d polygonal solid modeller.                     *
  3. *                                         *
  4. * Written by:  Gershon Elber                Ver 0.2, Mar. 1990   *
  5. ******************************************************************************
  6. *   Definitions, local to module, of the polygon convexity handler.         *
  7. *****************************************************************************/
  8.  
  9. #ifndef CONVEX_LH
  10. #define CONVEX_LH
  11.  
  12. /* Used to hold edges (V | V -> Pnext) that intersect with level y = Ylevel. */
  13. typedef struct InterYVrtxList {
  14.     ByteType InterYType;
  15.     struct VertexStruct *V;
  16.     struct InterYVrtxList *Pnext;
  17. } InterYVrtxList;
  18.  
  19. #define    INTER_Y_NONE    0               /* Y level intersection type. */
  20. #define    INTER_Y_START    1
  21. #define    INTER_Y_MIDDLE    2
  22.  
  23. #define LOOP_ABOVE_Y    0      /* Type of open loops extracted from polygon. */
  24. #define LOOP_BELOW_Y    1
  25.  
  26. /* Used to sort and combine the polygons above Ylevel together if possible.  */
  27. typedef struct SortPolysInX {
  28.     struct VertexStruct *VMinX, *VMaxX;
  29.     int Reverse;      /* If TRUE than VMinX vertex is AFTER VMaxX vertex. */
  30. } SortPolysInX;
  31.  
  32. /* The following are temporary flags used to mark vertices that were visited */
  33. /* by the loop tracing, at list once. As each vertex may be visited two at   */
  34. /* the most (as starting & as end point of open loop), this is enough.         */
  35. /* INTER_TAG is used to mark vertices that created brand new with intersected*/
  36. /* with the line y = Ylevel. Those are used to detect INTERNAL edges - if    */
  37. /* at list one end of it is INTER_TAG, that edge is INTERNAL (see Irit.h).   */
  38. #define INTER_TAG   0x40
  39. #define VISITED_TAG 0x80
  40.  
  41. #define    IS_INTER_VRTX(Vrtx)    ((Vrtx)->Tags & INTER_TAG)
  42. #define    SET_INTER_VRTX(Vrtx)    ((Vrtx)->Tags |= INTER_TAG)
  43. #define    RST_INTER_VRTX(Vrtx)    ((Vrtx)->Tags &= ~INTER_TAG)
  44.  
  45. #define    IS_VISITED_VRTX(Vrtx)    ((Vrtx)->Tags & VISITED_TAG)
  46. #define    SET_VISITED_VRTX(Vrtx)    ((Vrtx)->Tags |= VISITED_TAG)
  47. #define    RST_VISITED_VRTX(Vrtx)    ((Vrtx)->Tags &= ~VISITED_TAG)
  48.  
  49.  
  50. #endif /* CONVEX_LH */
  51.