Changeset 1047 for GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
- Timestamp:
- 06/21/06 18:26:17 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1027 r1047 1747 1747 Environment::GetSingleton()->GetIntValue("ViewCells.Visualization.clipPlaneAxis", axis); 1748 1748 1749 Vector3 normal(0,0,0); 1750 normal[axis] = 1; 1751 1752 mClipPlane = Plane3(normal, point); 1749 mClipPlane = AxisAlignedPlane(axis, point[axis]); 1753 1750 } 1754 1751 … … 2428 2425 } 2429 2426 2427 2428 2430 2429 /**********************************************************************/ 2431 2430 /* BspViewCellsManager implementation */ … … 2927 2926 void BspViewCellsManager::ExportViewCellGeometry(Exporter *exporter, 2928 2927 ViewCell *vc, 2929 const Plane3*clipPlane) const2928 const AxisAlignedPlane *clipPlane) const 2930 2929 { 2931 2930 // export mesh if available … … 2938 2937 if (clipPlane) 2939 2938 { 2939 const Plane3 plane = clipPlane->GetPlane(); 2940 2940 2941 ViewCellContainer leaves; 2941 2942 mViewCellsTree->CollectLeaves(vc, leaves); … … 2953 2954 2954 2955 const float eps = 0.00000001f; 2955 const int cf = geom.Side( *clipPlane, eps);2956 const int cf = geom.Side(plane, eps); 2956 2957 2957 2958 if (cf == -1) … … 2963 2964 geom.SplitGeometry(front, 2964 2965 back, 2965 *clipPlane,2966 plane, 2966 2967 mViewSpaceBox, 2967 2968 eps); … … 3067 3068 3068 3069 3069 bool BspViewCellsManager::ExportViewCells(const string filename, const bool exportPvs, const ObjectContainer &objects) 3070 bool BspViewCellsManager::ExportViewCells(const string filename, 3071 const bool exportPvs, 3072 const ObjectContainer &objects) 3070 3073 { 3071 3074 #if STILL_HAS_TODO … … 3472 3475 void KdViewCellsManager::ExportViewCellGeometry(Exporter *exporter, 3473 3476 ViewCell *vc, 3474 const Plane3*clipPlane) const3477 const AxisAlignedPlane *clipPlane) const 3475 3478 { 3476 3479 ViewCellContainer leaves; … … 4154 4157 //-- export view cells 4155 4158 if (1) 4156 { // hack pvs 4159 { 4160 // hack pvs 4157 4161 const int savedColorCode = mColorCode; 4158 4162 mColorCode = 1; … … 4178 4182 4179 4183 // export rays 4180 if ( 1&& mExportRays)4184 if (0 && mExportRays) 4181 4185 { 4182 4186 exporter->ExportRays(visRays, RgbColor(0, 1, 0)); … … 4359 4363 { 4360 4364 // output rays stored with the view cells during subdivision 4361 if ( 0)4365 if (1) 4362 4366 { 4363 4367 VssRayContainer vcRays; … … 4394 4398 } 4395 4399 4400 Debug << "here233 " << (int)vcRays.size() << endl; 4401 4396 4402 //-- export rays piercing this view cell 4397 4403 exporter->ExportRays(vcRays, RgbColor(1, 1, 1)); … … 4399 4405 4400 4406 // associate new rays with output view cell 4401 if ( 1)4407 if (0) 4402 4408 { 4403 4409 VssRayContainer vcRays; … … 4580 4586 void VspBspViewCellsManager::ExportViewCellGeometry(Exporter *exporter, 4581 4587 ViewCell *vc, 4582 const Plane3*clipPlane) const4588 const AxisAlignedPlane *clipPlane) const 4583 4589 { 4584 4590 if (clipPlane) 4585 4591 { 4592 const Plane3 plane = clipPlane->GetPlane(); 4593 4586 4594 ViewCellContainer leaves; 4587 4595 mViewCellsTree->CollectLeaves(vc, leaves); … … 4599 4607 4600 4608 const float eps = 0.00000001f; 4601 const int cf = geom.Side( *clipPlane, eps);4609 const int cf = geom.Side(plane, eps); 4602 4610 4603 4611 if (cf == -1) … … 4609 4617 geom.SplitGeometry(front, 4610 4618 back, 4611 *clipPlane,4619 plane, 4612 4620 mViewSpaceBox, 4613 4621 eps); … … 4780 4788 4781 4789 /**************************************************************************/ 4782 /* Vsp BspViewCellsManager implementation */4790 /* VspOspViewCellsManager implementation */ 4783 4791 /**************************************************************************/ 4784 4792 … … 5136 5144 { 5137 5145 viewPoint = mViewSpaceBox.GetRandomPoint(); 5146 5138 5147 if (mVspTree->ViewPointValid(viewPoint)) 5139 5148 { … … 5149 5158 void VspOspViewCellsManager::ExportViewCellGeometry(Exporter *exporter, 5150 5159 ViewCell *vc, 5151 const Plane3*clipPlane) const5160 const AxisAlignedPlane *clipPlane) const 5152 5161 { 5153 5162 ViewCellContainer leaves; … … 5156 5165 ViewCellContainer::const_iterator it, it_end = leaves.end(); 5157 5166 5167 Plane3 plane; 5168 5169 if (clipPlane) 5170 plane = clipPlane->GetPlane(); 5171 5158 5172 for (it = leaves.begin(); it != it_end; ++ it) 5159 5173 { … … 5162 5176 5163 5177 const AxisAlignedBox3 box = mVspTree->GetBBox(vspVc->mLeaf); 5164 5165 if (!clipPlane || !box.Side(*clipPlane)) 5178 5179 if (clipPlane) 5180 { 5181 if (box.Side(plane) == -1) 5182 exporter->ExportBox(box); 5183 else if (box.Side(plane) == 0) 5184 { 5185 AxisAlignedBox3 fbox, bbox; 5186 5187 box.Split(clipPlane->mAxis, clipPlane->mPosition, fbox, bbox); 5188 5189 exporter->ExportBox(bbox); 5190 } 5191 } 5192 else 5193 { 5166 5194 exporter->ExportBox(box); 5195 } 5167 5196 } 5168 5197 } … … 5191 5220 //-- export view cells 5192 5221 if (1) 5193 { // hack pvs 5222 { 5223 // hack pvs 5194 5224 const int savedColorCode = mColorCode; 5195 mColorCode = 1;5225 mColorCode = 0; 5196 5226 5197 5227 Exporter *exporter = Exporter::GetExporter("final_view_cells.wrl"); … … 5215 5245 5216 5246 // export rays 5217 if ( 1&& mExportRays)5247 if (0 && mExportRays) 5218 5248 { 5219 5249 exporter->ExportRays(visRays, RgbColor(0, 1, 0)); … … 5292 5322 { 5293 5323 // output rays stored with the view cells during subdivision 5294 if ( 0)5324 if (1) 5295 5325 { 5296 5326 VssRayContainer vcRays; … … 5298 5328 5299 5329 raysOut = min((int)rays.size(), 100); 5330 5331 Debug << "here12 " << raysOut << endl; 5300 5332 5301 5333 // collect intial view cells … … 5307 5339 for (vit = leaves.begin(); vit != vit_end; ++ vit) 5308 5340 { 5309 BspLeaf *vcLeaf = dynamic_cast<BspViewCell *>(*vit)->mLeaf;5341 VspLeaf *vcLeaf = dynamic_cast<VspViewCell *>(*vit)->mLeaf; 5310 5342 5311 5343 VssRayContainer::const_iterator rit, rit_end = vcLeaf->mVssRays.end(); … … 5332 5364 5333 5365 // associate new rays with output view cell 5334 if ( 1)5366 if (0) 5335 5367 { 5336 5368 VssRayContainer vcRays;
Note: See TracChangeset
for help on using the changeset viewer.