1 | // =================================================================== |
---|
2 | // $Id: $ |
---|
3 | // |
---|
4 | // ktb.h |
---|
5 | // definition of classes for CKTB tree building up and traversal |
---|
6 | // |
---|
7 | // Class: CKTBNodeAbstract, SKTBNode, CKTBAllocMan, CKTBNodeIterator |
---|
8 | // |
---|
9 | // REPLACEMENT_STRING |
---|
10 | // |
---|
11 | // Copyright by Vlastimil Havran, 2006 - email to vhavran AT seznam.cz |
---|
12 | // Initial coding by Vlastimil Havran, 2006 |
---|
13 | |
---|
14 | #ifndef __KTBCONF_H__ |
---|
15 | #define __KTBCONF_H__ |
---|
16 | |
---|
17 | // GOLEM headers |
---|
18 | #include "configh.h" |
---|
19 | #include "subdivm.h" |
---|
20 | #ifdef __SSE__ |
---|
21 | // SSE supported |
---|
22 | #include <xmmintrin.h> |
---|
23 | #endif |
---|
24 | |
---|
25 | // If we support the use of SSE instructions for ray shooting |
---|
26 | //#define _USE_HAVRAN_SSE |
---|
27 | |
---|
28 | namespace GtpVisibilityPreprocessor { |
---|
29 | |
---|
30 | #ifdef __SSE__ |
---|
31 | // The second parameter is |
---|
32 | // |
---|
33 | #define GPREFETCH(A, B) _mm_prefetch((const char*)A, B) |
---|
34 | #else |
---|
35 | #define GPREFETCH(A, B) |
---|
36 | #endif |
---|
37 | |
---|
38 | #if defined(__INTEL_COMPILER)||defined(_MSC_VER) |
---|
39 | // Intel compiler or Microsoft Compiler |
---|
40 | #define GALIGN16 __declspec(align(16)) |
---|
41 | #endif |
---|
42 | #ifndef __INTEL_COMPILER |
---|
43 | #ifdef __GNUC__ |
---|
44 | // GNU compiler - somehow correct, but it crashes during |
---|
45 | // compilation for GCC 4.1.2 !!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
46 | //#define GALIGN16 __attribute((aligned(16))) |
---|
47 | #undef GALIGN16 |
---|
48 | #define GALIGN16 |
---|
49 | #endif |
---|
50 | #endif |
---|
51 | |
---|
52 | |
---|
53 | // forward declarations |
---|
54 | class CObjectList; |
---|
55 | |
---|
56 | // The statistics for construction |
---|
57 | #define _KTB_CONSTR_STATS |
---|
58 | |
---|
59 | // If to use 8 Bytes representation of the node |
---|
60 | #define _KTB8Bytes |
---|
61 | |
---|
62 | // If to use allocated boxes in minbox nodes or allocate |
---|
63 | // them as a whole nodes, the difference is access time |
---|
64 | // when the boxes are not needed |
---|
65 | #define _SHORT_FORM_MINBOX |
---|
66 | |
---|
67 | // ----------------------------------------------- |
---|
68 | // The containter at the leaves or interior node (tagged object lists) |
---|
69 | // We use vector<CObject3D*> representation of object list |
---|
70 | typedef CObjectList* CKTBObjectContainer; |
---|
71 | |
---|
72 | // ============================================== |
---|
73 | // definition of axes of spatial subdivision |
---|
74 | |
---|
75 | class CKTBAxes |
---|
76 | { |
---|
77 | public: |
---|
78 | enum Axes { |
---|
79 | // The axes of a splitting plane |
---|
80 | EE_X_axis = 0, |
---|
81 | EE_Y_axis = 1, |
---|
82 | EE_Z_axis = 2, |
---|
83 | // The leaf node, full or empty |
---|
84 | EE_Leaf = 3, |
---|
85 | // The link node for DFS order representation |
---|
86 | EE_Link = 4, |
---|
87 | EE_X_axisBox = 5, |
---|
88 | EE_Y_axisBox = 6, |
---|
89 | EE_Z_axisBox = 7, |
---|
90 | }; |
---|
91 | enum { |
---|
92 | EE_Mask = 0x7 |
---|
93 | }; |
---|
94 | }; |
---|
95 | |
---|
96 | } |
---|
97 | |
---|
98 | #endif // __KTBCONF_H__ |
---|