00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * David Pritchard 00008 * Side Effects Software Inc 00009 * 123 Front Street West, Suite 1401 00010 * Toronto, Ontario 00011 * Canada M5J 2M2 00012 * 416-504-9876 00013 */ 00014 00015 #ifndef __GU_KDOPTree_h__ 00016 #define __GU_KDOPTree_h__ 00017 00018 #include "GU_API.h" 00019 #include <BV/BV_KDOPTree.h> 00020 00021 class GU_Detail; 00022 00023 /// This is a simple extension to BV_KDOPTree that includes debug output 00024 /// capability. 00025 template <int K> 00026 class GU_API GU_KDOPTree : public BV_KDOPTree<K> 00027 { 00028 public: 00029 typedef BV_KDOPTree<K> BaseClass; 00030 00031 GU_KDOPTree(); 00032 GU_KDOPTree(const GU_KDOPTree &); 00033 00034 GU_KDOPTree &operator=(const GU_KDOPTree &); 00035 00036 /// Create a GU_Detail showing the KDOPs at each level of the 00037 /// hierarchy. 00038 /// 00039 /// If the depth parameter is non-negative, then only leaves 00040 /// at the given depth level are included. 00041 /// If the onlyLeaf parameter is non-negative, then only boxes containing 00042 /// that primitive are included. 00043 void createDebugTree(GU_Detail &gdp, 00044 int depth = -1, 00045 int prim = -1) const; 00046 private: 00047 static bool outputTree(GU_Detail &gdp, const BV_KDOPNode<K> &node, 00048 int onlyDepth, int onlyLeaf, int depth); 00049 static void outputNode(GU_Detail &gdp, const BV_KDOPNode<K> &node); 00050 }; 00051 00052 typedef GU_KDOPTree<6> GU_AABBTree; 00053 typedef GU_KDOPTree<14> GU_14DOPTree; 00054 typedef GU_KDOPTree<18> GU_18DOPTree; 00055 typedef GU_KDOPTree<26> GU_26DOPTree; 00056 00057 #endif
1.5.9