- Timestamp:
- 12/19/05 02:50:17 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.h
r469 r470 84 84 typedef HierarchyViewCell<VspKdLeaf *> VspKdViewCell; 85 85 86 /*class BspViewCell: public ViewCell87 {88 public:89 BspViewCell(): mBspLeaves(0) {}90 BspViewCell(Mesh *mesh):91 ViewCell(mesh), mBspLeaves(0) {}92 86 93 /// Leaves of the hierarchy which are part of this view cell. 94 std::vector<BspLeaf *> mBspLeaves; 95 }; 96 */ 97 /*class VspKdViewCell: public ViewCell 98 { 99 public: 100 VspKdViewCell(): mLeaves(0) {} 101 VspKdViewCell(Mesh *mesh): 102 ViewCell(mesh), mLeaves(0) {} 103 104 /// Leaves of the hierarchy which are part of this view cell. 105 std::vector<VspKdLeaf *> mLeaves; 106 }; 87 /** Statistics for a view cell partition. 107 88 */ 108 89 class ViewCellsStatistics: public StatisticsBase -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp
r469 r470 17 17 mConstructionSamples(0), 18 18 mPostProcessSamples(0), 19 mVisualizationSamples(0) 19 mVisualizationSamples(0), 20 mTotalAreaValid(false), 21 mTotalArea(0.0f) 20 22 { 21 23 // post processing stuff … … 277 279 } 278 280 281 float ViewCellsManager::GetVolume(ViewCell *viewCell) const 282 { 283 return viewCell->GetVolume(); 284 } 285 286 287 288 float ViewCellsManager::GetArea(ViewCell *viewCell) const 289 { 290 return 0.0f; 291 } 292 293 294 295 float ViewCellsManager::GetTotalArea() 296 { 297 // if already computed 298 if (mTotalAreaValid) 299 return mTotalArea; 300 301 mTotalArea = 0; 302 ViewCellContainer::const_iterator it, it_end = mViewCells.end(); 303 304 for (it = mViewCells.begin(); it != it_end; ++ it) 305 mTotalArea += GetArea(*it); 306 307 mTotalAreaValid = true; 308 309 return mTotalArea; 310 } 311 279 312 /**********************************************************************/ 280 313 /* BspViewCellsManager implementation */ … … 349 382 } 350 383 351 352 float BspViewCellsManager::GetProbability(ViewCell *viewCell) const 384 float BspViewCellsManager::GetArea(ViewCell *viewCell) const 353 385 { 354 386 PolygonContainer geom; … … 358 390 359 391 const float area = Polygon3::GetArea(geom); 360 const float accArea = mBspTree->GetBoundingBox().SurfaceArea();361 362 392 CLEAR_CONTAINER(geom); 363 393 364 return area / accArea; 365 } 366 394 return area; 395 } 396 397 398 float BspViewCellsManager::GetProbability(ViewCell *viewCell) const 399 { 400 PolygonContainer geom; 401 402 // compute view cell area 403 mBspTree->ConstructGeometry(dynamic_cast<BspViewCell *>(viewCell), geom); 404 405 const float area = Polygon3::GetArea(geom); 406 const float viewspaceArea = GetTotalArea();// mBspTree->GetBoundingBox().SurfaceArea(); 407 408 CLEAR_CONTAINER(geom); 409 410 return area / viewspaceArea; 411 } 367 412 368 413 float BspViewCellsManager::GetRendercost(ViewCell *viewCell, float objRendercost) const -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.h
r469 r470 189 189 VssRayContainer &savedRays) const; 190 190 191 /** Returns total area of view cells. 192 */ 193 float GetTotalArea(); 194 195 /** Returns area of one view cell. 196 */ 197 float GetArea(ViewCell *viewCell) const; 198 199 /** Returns volume of view cells. 200 */ 201 float GetVolume(ViewCell *viewCell) const; 202 191 203 protected: 192 204 … … 209 221 int mMinPvs; 210 222 int mMaxPvs; 223 224 float mTotalAreaValid; 225 float mTotalArea; 211 226 }; 212 227 … … 248 263 float GetProbability(ViewCell *viewCell) const; 249 264 float GetRendercost(ViewCell *viewCell, float objRendercost) const; 265 266 float GetArea(ViewCell *viewCell) const; 250 267 251 268 protected: -
trunk/VUT/GtpVisibilityPreprocessor/src/VspKdTree.cpp
r469 r470 2163 2163 2164 2164 //Debug << mMinViewCells << " " << mMaxCostRatio << endl; 2165 2166 2165 // use priority queue to merge leaves 2167 2166 while (!mergeQueue.empty() &&
Note: See TracChangeset
for help on using the changeset viewer.