Changeset 1287 for GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.cpp
- Timestamp:
- 08/27/06 23:39:50 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.cpp
r1233 r1287 4 4 #include "KdTree.h" 5 5 #include "KdIntersectable.h" 6 #include "BvHierarchy.h" 6 7 7 8 … … 67 68 } 68 69 69 ExportGeometry(leaf->mObjects);70 if (0) ExportGeometry(leaf->mObjects); 70 71 } 71 72 … … 102 103 103 104 105 bool Exporter::ExportBvHierarchy(const BvHierarchy &bvHierarchy, 106 const int maxPvs) 107 { 108 vector<BvhLeaf *> leaves; 109 bvHierarchy.CollectLeaves(leaves); 110 111 mUseForcedMaterial = true; 112 113 vector<BvhLeaf *>::const_iterator it, it_end = leaves.end(); 114 115 Material white; 116 white.mDiffuseColor.r = 1; 117 white.mDiffuseColor.g = 1; 118 white.mDiffuseColor.b = 1; 119 int objSize = 0; 120 121 for (it = leaves.begin(); it != it_end; ++ it) 122 { 123 BvhLeaf *leaf = *it; 124 125 SetWireframe(); 126 SetForcedMaterial(white); 127 ExportBox(leaf->GetBoundingBox()); 128 129 SetFilled(); 130 131 if (maxPvs) // color code pvs 132 { 133 mForcedMaterial.mDiffuseColor.b = 1.0f; 134 const float importance = (float)leaf->mObjects.size() / (float)maxPvs; 135 136 mForcedMaterial.mDiffuseColor.r = importance; 137 mForcedMaterial.mDiffuseColor.g = 1.0f - mForcedMaterial.mDiffuseColor.r; 138 } 139 else 140 { 141 SetForcedMaterial(RandomMaterial()); 142 } 143 144 if (1) 145 { 146 SetFilled(); 147 ExportGeometry(leaf->mObjects); 148 objSize += leaf->mObjects.size(); 149 } 150 } 151 152 return true; 104 153 } 154 155 156 }
Note: See TracChangeset
for help on using the changeset viewer.