VLBUFFER.H 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /****************************************************************************
  2. * vlbuffer.h
  3. *
  4. * This module contains all defines, typedefs, and prototypes for VLBUFFER.C.
  5. *
  6. * from Persistence of Vision(tm) Ray Tracer
  7. * Copyright 1996,1999 Persistence of Vision Team
  8. *---------------------------------------------------------------------------
  9. * NOTICE: This source code file is provided so that users may experiment
  10. * with enhancements to POV-Ray and to port the software to platforms other
  11. * than those supported by the POV-Ray Team. There are strict rules under
  12. * which you are permitted to use this file. The rules are in the file
  13. * named POVLEGAL.DOC which should be distributed with this file.
  14. * If POVLEGAL.DOC is not available or for more info please contact the POV-Ray
  15. * Team Coordinator by email to team-coord@povray.org or visit us on the web at
  16. * http://www.povray.org. The latest version of POV-Ray may be found at this site.
  17. *
  18. * This program is based on the popular DKB raytracer version 2.12.
  19. * DKBTrace was originally written by David K. Buck.
  20. * DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
  21. *
  22. *****************************************************************************/
  23. #ifndef VLBUFFER_H
  24. #define VLBUFFER_H
  25. #include "bbox.h"
  26. /*****************************************************************************
  27. * Global preprocessor defines
  28. ******************************************************************************/
  29. /* flag to mark a node as pruned */
  30. #define PRUNE_CHECK 128
  31. #define PRUNE_TEMPORARY 128
  32. /* Define minimum and maximum values for buffer coordinates. */
  33. #define MIN_BUFFER_ENTRY -32000
  34. #define MAX_BUFFER_ENTRY 32000
  35. /* Define maximum number of clippoints. */
  36. #define MAX_CLIP_POINTS 20
  37. /* Define all six coordinate axes. */
  38. #define XaxisP 0
  39. #define XaxisM 1
  40. #define YaxisP 2
  41. #define YaxisM 3
  42. #define ZaxisP 4
  43. #define ZaxisM 5
  44. /*****************************************************************************
  45. * Global typedefs
  46. ******************************************************************************/
  47. typedef struct Project_Struct PROJECT;
  48. typedef struct Project_Tree_Node_Struct PROJECT_TREE_NODE;
  49. typedef struct Project_Tree_Leaf_Struct PROJECT_TREE_LEAF;
  50. typedef struct Project_Queue_Struct PROJECT_QUEUE;
  51. struct Project_Struct
  52. {
  53. int x1, y1, x2, y2;
  54. };
  55. /*
  56. * The following structure represent the bounding box hierarchy in 2d space.
  57. * Because is_leaf, Object and Project are the first elements in both
  58. * structures they can be accessed without knowing at which structure
  59. * a pointer is pointing.
  60. */
  61. struct Project_Tree_Node_Struct
  62. {
  63. unsigned short is_leaf;
  64. BBOX_TREE *Node;
  65. PROJECT Project;
  66. unsigned short Entries;
  67. PROJECT_TREE_NODE **Entry;
  68. };
  69. struct Project_Tree_Leaf_Struct
  70. {
  71. unsigned short is_leaf;
  72. BBOX_TREE *Node;
  73. PROJECT Project;
  74. };
  75. struct Project_Queue_Struct
  76. {
  77. unsigned QSize;
  78. unsigned Max_QSize;
  79. PROJECT_TREE_NODE **Queue;
  80. };
  81. /*****************************************************************************
  82. * Global variables
  83. ******************************************************************************/
  84. extern PROJECT_QUEUE *Node_Queue;
  85. extern PRIORITY_QUEUE *VLBuffer_Queue;
  86. /*****************************************************************************
  87. * Global functions
  88. ******************************************************************************/
  89. void Clip_Polygon (VECTOR *Points, int *PointCnt, VECTOR VX1, VECTOR VX2, VECTOR VY1, VECTOR VY2, DBL DX1, DBL DX2, DBL DY1, DBL DY2);
  90. void Initialize_VLBuffer_Code (void);
  91. void Reinitialize_VLBuffer_Code (void);
  92. void Deinitialize_VLBuffer_Code (void);
  93. void Destroy_Project_Tree (PROJECT_TREE_NODE *Node);
  94. #endif