[2582] | 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 | |
---|
[2592] | 25 | |
---|
[2582] | 26 | namespace GtpVisibilityPreprocessor { |
---|
| 27 | |
---|
| 28 | #ifdef __SSE__ |
---|
| 29 | // The second parameter is |
---|
| 30 | // |
---|
| 31 | #define GPREFETCH(A, B) _mm_prefetch((const char*)A, B) |
---|
| 32 | #else |
---|
| 33 | #define GPREFETCH(A, B) |
---|
| 34 | #endif |
---|
[2602] | 35 | |
---|
[2582] | 36 | #if defined(__INTEL_COMPILER)||defined(_MSC_VER) |
---|
| 37 | // Intel compiler or Microsoft Compiler |
---|
| 38 | #define GALIGN16 __declspec(align(16)) |
---|
| 39 | #endif |
---|
| 40 | #ifndef __INTEL_COMPILER |
---|
| 41 | #ifdef __GNUC__ |
---|
| 42 | // GNU compiler - somehow correct, but it crashes during |
---|
| 43 | // compilation for GCC 4.1.2 !!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
| 44 | //#define GALIGN16 __attribute((aligned(16))) |
---|
| 45 | #undef GALIGN16 |
---|
| 46 | #define GALIGN16 |
---|
| 47 | #endif |
---|
| 48 | #endif |
---|
| 49 | |
---|
| 50 | |
---|
| 51 | // forward declarations |
---|
| 52 | class CObjectList; |
---|
| 53 | |
---|
| 54 | // The statistics for construction |
---|
| 55 | #define _KTB_CONSTR_STATS |
---|
| 56 | |
---|
| 57 | // If to use 8 Bytes representation of the node |
---|
| 58 | #define _KTB8Bytes |
---|
| 59 | |
---|
| 60 | // If to use allocated boxes in minbox nodes or allocate |
---|
| 61 | // them as a whole nodes, the difference is access time |
---|
| 62 | // when the boxes are not needed |
---|
| 63 | #define _SHORT_FORM_MINBOX |
---|
| 64 | |
---|
| 65 | // ----------------------------------------------- |
---|
| 66 | // The containter at the leaves or interior node (tagged object lists) |
---|
| 67 | // We use vector<CObject3D*> representation of object list |
---|
| 68 | typedef CObjectList* CKTBObjectContainer; |
---|
| 69 | |
---|
| 70 | // ============================================== |
---|
| 71 | // definition of axes of spatial subdivision |
---|
| 72 | |
---|
| 73 | class CKTBAxes |
---|
| 74 | { |
---|
| 75 | public: |
---|
| 76 | enum Axes { |
---|
| 77 | // The axes of a splitting plane |
---|
| 78 | EE_X_axis = 0, |
---|
| 79 | EE_Y_axis = 1, |
---|
| 80 | EE_Z_axis = 2, |
---|
| 81 | // The leaf node, full or empty |
---|
| 82 | EE_Leaf = 3, |
---|
| 83 | // The link node for DFS order representation |
---|
| 84 | EE_Link = 4, |
---|
| 85 | EE_X_axisBox = 5, |
---|
| 86 | EE_Y_axisBox = 6, |
---|
| 87 | EE_Z_axisBox = 7, |
---|
| 88 | }; |
---|
| 89 | enum { |
---|
| 90 | EE_Mask = 0x7 |
---|
| 91 | }; |
---|
| 92 | }; |
---|
| 93 | |
---|
| 94 | } |
---|
| 95 | |
---|
| 96 | #endif // __KTBCONF_H__ |
---|