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

  1. /*****************************************************************************
  2. *   "Irit" - the 3d polygonal solid modeller.                     *
  3. *                                         *
  4. * Written by:  Gershon Elber                Ver 0.2, Mar. 1990   *
  5. ******************************************************************************
  6. * General, local to module, definitions of polygon adjacencies module.       *
  7. *****************************************************************************/
  8.  
  9. #ifndef    ADJACENCY_LH
  10. #define    ADJACENCY_LH
  11.  
  12. #define HASH_TABLE_SIZE  100
  13. #define HASH_TABLE_SIZE1 101                 /* One above the above. */
  14. #define HASH_TABLE_SIZE2 50                   /* Half of the above. */
  15.  
  16. typedef struct HashTableEntry {
  17.     int Key;
  18.     struct PolygonStruct *Pl;
  19.     struct VertexStruct *V;
  20.     struct HashTableEntry *Pnext;
  21. } HashTableEntry;
  22.  
  23. typedef struct HashTableStruct {
  24.     struct HashTableEntry *Entry[HASH_TABLE_SIZE1];
  25. } HashTableStruct;
  26.  
  27. /* Prototypes of local function of adjacecies module: */
  28. static void InsertHashTable(HashTableStruct *HashTbl, PolygonStruct *Pl,
  29.                             VertexStruct *V);
  30. static int EdgeKey(VertexStruct *V);
  31. static HashTableEntry *FindMatchEdge(HashTableStruct *HashTbl, int EntryNum,
  32.                             HashTableEntry *PHash);
  33. static int SameEdges(PointType V1E1, PointType V2E1,
  34.              PointType V1E2, PointType V2E2);
  35.  
  36. static void InsertSecondHashTable(HashTableStruct *SecondHashTbl,
  37.                             HashTableEntry *PHash);
  38. static void SecondEdgeKey(VertexStruct *V, int *Key1, int *Key2);
  39. static HashTableEntry *FindSecondMatchEdge(HashTableStruct *SecondHashTbl,
  40.                     int EntryNum, HashTableEntry *PHash);
  41. static int TestSameDir(PointType Pt11, PointType Pt12,
  42.             PointType Pt21, PointType Pt22);
  43. static void DeleteHashTable(HashTableStruct *SecondHashTable,
  44.                         VertexStruct *V, int EntryNum);
  45.  
  46. #endif    /* ADJACENCY_LH */
  47.