home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / i / iritsm3s.zip / poly3d-h / program.h < prev    next >
C/C++ Source or Header  |  1992-01-12  |  2KB  |  65 lines

  1. /*****************************************************************************
  2. * Definitions for the Poly3D-H program:                                      *
  3. *****************************************************************************/
  4.  
  5. #ifndef POLY_3D_H_H
  6. #define POLY_3D_H_H
  7.  
  8. #include "irit_sm.h"
  9. #include "genmat.h"
  10. #include "iritprsr.h"
  11. #include "cagd_lib.h"
  12.  
  13. #ifdef  EPSILON
  14. #undef  EPSILON
  15. #endif  /* EPSILON */
  16. #define EPSILON    1e-4  /* Make it smaller if you changed to double precision. */
  17.  
  18. #define  EDGE_HASH_TABLE_SIZE    500 /* Number of entries in edge hash table. */
  19. #define  EDGE_HASH_TABLE_SIZE1    499             /* One below the above. */
  20. #define  EDGE_HASH_TABLE_SIZE2    250               /* Half of above. */
  21. #define  POLY_HASH_TABLE_SIZE    500 /* Number of entries in poly hash table. */
  22. #define  POLY_HASH_TABLE_SIZE1    499             /* One below the above. */
  23. #define  POLY_HASH_TABLE_SIZE2    250               /* Half of above. */
  24.  
  25. #ifdef __MSDOS__
  26. #define  HIDDEN_COLOR    YELLOW            /* Color to draw hidden line result. */
  27. #else
  28. #define  HIDDEN_COLOR    14            /* Color to draw hidden line result. */
  29. #endif /* __MSDOS__ */
  30.  
  31. #define  DEFAULT_FINENESS    4      /* Default fineness of srf subdiv. */
  32.  
  33. typedef struct EdgeStruct {
  34.     struct EdgeStruct *Pnext;
  35.     IPVertexStruct *Vertex[2];               /* The two edge vertices. */
  36.     unsigned char Internal;           /* If edge is Internal (IRIT output). */
  37. } EdgeStruct;
  38.  
  39. /* The following are global setable variables (via config file poly3d-h.cfg) */
  40. extern int GlblMore, GlblNumEdge, GlblBackFacing, GlblInternal;
  41.  
  42. extern int NumOfPolygons;          /* Total number of polygons to handle. */
  43.  
  44. /* Global transformation matrix: */
  45. extern MatrixType GlblViewMat;           /* Current view/persp. of object. */
  46.  
  47. /* Data structures used by the hidden line modules: */
  48. extern int EdgeCount;
  49. extern EdgeStruct *EdgeHashTable[];
  50. extern IPPolygonStruct *PolyHashTable[];
  51.  
  52. /* And finally the prototypes of the Poly3D-H.c module: */
  53. VoidPtr MyMalloc(unsigned size);
  54. void MyFree(VoidPtr p);
  55. void MyExit(int ExitCode);
  56.  
  57. /* Prototypes of the PrepData.c module: */
  58. void PrepareViewData(IPObjectStruct *Objects);
  59. int CrossProd(RealType Pt1[3], RealType Pt2[3], RealType Pt3[3]);
  60.  
  61. /* Prototypes of the Out-Edge.c module: */
  62. void OutVisibleEdges(void);
  63.  
  64. #endif /* POLY_3D_H_H */
  65.