1 /****************************************************************************
2  *                  csg.h
3  *
4  * This module contains all defines, typedefs, and prototypes for CSG.CPP.
5  *
6  * from Persistence of Vision(tm) Ray Tracer version 3.6.
7  * Copyright 1991-2003 Persistence of Vision Team
8  * Copyright 2003-2004 Persistence of Vision Raytracer Pty. Ltd.
9  *---------------------------------------------------------------------------
10  * NOTICE: This source code file is provided so that users may experiment
11  * with enhancements to POV-Ray and to port the software to platforms other
12  * than those supported by the POV-Ray developers. There are strict rules
13  * regarding how you are permitted to use this file. These rules are contained
14  * in the distribution and derivative versions licenses which should have been
15  * provided with this file.
16  *
17  * These licences may be found online, linked from the end-user license
18  * agreement that is located at http://www.povray.org/povlegal.html
19  *---------------------------------------------------------------------------
20  * This program is based on the popular DKB raytracer version 2.12.
21  * DKBTrace was originally written by David K. Buck.
22  * DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
23  *---------------------------------------------------------------------------
24  *
25  *===========================================================================
26  * This file is part of MegaPOV, a modified and unofficial version of POV-Ray
27  * For more information on MegaPOV visit our website:
28  * http://megapov.inetart.net/
29  *===========================================================================
30  *
31  * $RCSfile: csg.h,v $
32  * $Revision: 1.8 $
33  * $Author: chris $
34  *
35  *****************************************************************************/
36 
37 
38 #ifndef CSG_H
39 #define CSG_H
40 
41 BEGIN_POV_NAMESPACE
42 
43 /*****************************************************************************
44 * Global preprocessor defines
45 ******************************************************************************/
46 
47 #define UNION_OBJECT        (IS_COMPOUND_OBJECT)
48 #define MERGE_OBJECT        (IS_COMPOUND_OBJECT)
49 #define INTERSECTION_OBJECT (IS_COMPOUND_OBJECT)
50 
51 /* CSG types */
52 
53 #define CSG_UNION_TYPE             1
54 #define CSG_INTERSECTION_TYPE      2
55 #define CSG_DIFFERENCE_TYPE        4
56 #define CSG_MERGE_TYPE             8
57 #define CSG_SINGLE_TYPE           16
58 
59 
60 
61 /*****************************************************************************
62 * Global typedefs
63 ******************************************************************************/
64 
65 typedef struct CSG_Struct CSG;
66 
67 struct CSG_Struct
68 {
69   COMPOUND_FIELDS
70   int do_split;
71 };
72 
73 
74 
75 /*****************************************************************************
76 * Global variables
77 ******************************************************************************/
78 
79 extern METHODS CSG_Intersection_Methods;
80 extern METHODS CSG_Merge_Methods;
81 extern METHODS CSG_Union_Methods;
82 
83 
84 
85 /*****************************************************************************
86 * Global functions
87 ******************************************************************************/
88 
89 CSG *Create_CSG_Union (void);
90 CSG *Create_CSG_Merge (void);
91 CSG *Create_CSG_Intersection (void);
92 void Compute_CSG_BBox (OBJECT *Object);
93 void Determine_CSG_Textures(CSG *Csg, VECTOR IPoint, int *Count, TEXTURE **Textures, DBL *Weights);
94 
95 END_POV_NAMESPACE
96 
97 #endif
98