Changeset 2530 for GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h
- Timestamp:
- 07/06/07 03:18:02 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h
r2353 r2530 197 197 */ 198 198 HierarchyManager(const int objectSpaceHierarchyType); 199 200 199 /** Hack: OspTree will copy the content from this kd tree. 201 200 Only view space hierarchy will be constructed. 202 201 */ 203 202 HierarchyManager(KdTree *kdTree); 204 205 203 /** Deletes space partition and view space partition. 206 204 */ 207 205 ~HierarchyManager(); 208 209 206 /** Constructs the view space and object space subdivision from a given set of rays 210 207 and a set of objects. … … 233 230 */ 234 231 int GetObjectSpaceSubdivisionType() const; 235 236 232 /** The type of view space space subdivison 237 233 */ 238 234 int GetViewSpaceSubdivisionType() const; 239 240 235 /** Sets a pointer to the view cells manager. 241 236 */ 242 237 void SetViewCellsManager(ViewCellsManager *vcm); 243 244 238 /** Sets a pointer to the view cells tree. 245 239 */ 246 240 void SetViewCellsTree(ViewCellsTree *vcTree); 247 248 241 /** Exports the object hierarchy to disc. 249 242 */ 250 243 void ExportObjectSpaceHierarchy(OUT_STREAM &stream); 251 252 244 /** Print out statistics. 253 245 */ 254 246 void PrintHierarchyStatistics(std::ostream &stream) const; 255 256 247 /** Returns the view space partition tree. 257 248 */ 258 249 VspTree *GetVspTree(); 259 260 250 /** Returns object space bounding box. 261 251 */ 262 252 AxisAlignedBox3 GetObjectSpaceBox() const; 263 264 253 /** Exports object space hierarchy for visualization. 265 254 */ … … 275 264 276 265 Intersectable *GetIntersectable(Intersectable *obj, const Vector3 &point) const; 277 278 266 /** Export object space partition bounding boxes. 279 267 */ … … 306 294 const float totalPvs, 307 295 const float raysPerObjects) const; 308 309 310 296 /** Casts line segment into the view cells tree. 311 297 @param origin the origin of the line segment … … 346 332 347 333 348 ////////////// ////////////////349 // the main loop334 ////////////// 335 // these functions implement the main loop 350 336 351 337 /** This is for interleaved construction / sequential construction. … … 355 341 const ObjectContainer &objects, 356 342 AxisAlignedBox3 *forcedViewSpace); 357 358 343 /** This is for interleaved construction using some objects 359 344 and some view space splits. … … 365 350 const int minSteps, 366 351 const int maxSteps); 367 368 352 /** Default subdivision method. 369 353 */ … … 371 355 372 356 373 ////////////////////////// //////////////////////357 ////////////////////////// 374 358 375 359 /** Evaluates the subdivision candidate and executes the split. … … 380 364 std::vector<SubdivisionCandidate *> &dirtyList 381 365 ); 382 383 366 /** Tests if hierarchy construction is finished. 384 367 */ 385 368 bool FinishedConstruction() const; 386 387 369 /** Returns next subdivision candidate from the split queue. 388 370 */ 389 371 SubdivisionCandidate *NextSubdivisionCandidate(SplitQueue &splitQueue); 390 391 372 /** Repairs the dirty entries of the subdivision candidate queue. The 392 373 list of entries is given in the dirty list. … … 397 378 SplitQueue &splitQueue, 398 379 const bool recomputeSplitPlaneOnRepair); 399 400 380 /** Collect subdivision candidates which were affected by the splits from the 401 381 chosenCandidates list. … … 403 383 void CollectDirtyCandidates(const SubdivisionCandidateContainer &chosenCandidates, 404 384 SubdivisionCandidateContainer &dirtyList); 405 406 385 /** Print subdivision stats for log. 407 386 */ … … 420 399 void CollectViewSpaceDirtyList(SubdivisionCandidate *sc, 421 400 SubdivisionCandidateContainer &dirtyList); 422 423 401 /** Collect affected object space candidates. 424 402 */ 425 403 void CollectObjectSpaceDirtyList(SubdivisionCandidate *sc, 426 404 SubdivisionCandidateContainer &dirtyList); 427 428 405 /** Export object space partition tree. 429 406 */ 430 407 void ExportOspTree(Exporter *exporter, 431 408 const ObjectContainer &objects) const; 432 433 409 /** Parse the environment variables. 434 410 */ … … 463 439 */ 464 440 bool ObjectSpaceSubdivisionConstructed() const; 465 466 441 /** Was view space subdivision already constructed? 467 442 */ 468 443 bool ViewSpaceSubdivisionConstructed() const; 469 470 444 /** Reset the split queue, i.e., reevaluate the split candidates. 471 445 */ 472 446 void ResetQueue(SplitQueue &splitQueue, const bool recomputeSplitPlane); 473 474 447 /** After the suddivision has ended, do some final tasks. 475 448 */ 476 449 void FinishObjectSpaceSubdivision(const ObjectContainer &objects, 477 450 const bool removeRayRefs = true) const; 478 479 451 /** Returns depth of object space subdivision. 480 452 */ 481 453 int GetObjectSpaceSubdivisionDepth() const; 482 483 454 /** Returns number of leaves in object space subdivision. 484 455 */ 485 456 int GetObjectSpaceSubdivisionLeaves() const; 486 457 int GetObjectSpaceSubdivisionNodes() const; 487 488 458 /** Construct object space partition interleaved with view space partition. 489 459 Each time the best object or view space candidate is selected … … 493 463 const ObjectContainer &objects, 494 464 AxisAlignedBox3 *forcedViewSpace); 495 496 465 /** Construct object space partition interleaved with view space partition. 497 466 The method chooses a number candidates of each type for subdivision. … … 505 474 const ObjectContainer &objects, 506 475 AxisAlignedBox3 *forcedViewSpace); 507 508 476 /** Use iteration to construct the object space hierarchy. 509 477 */ … … 511 479 const ObjectContainer &objects, 512 480 AxisAlignedBox3 *forcedViewSpace); 513 514 481 /** Based on a given subdivision, we try to optimize using an 515 482 multiple iteration over view and object space. … … 518 485 const ObjectContainer &objects, 519 486 AxisAlignedBox3 *forcedViewSpace); 520 521 487 /** Reset the object space subdivision. 522 488 E.g., deletes hierarchy and resets stats. … … 533 499 534 500 void CreateTraversalTree(); 501 535 502 536 503 /////////////////////////// … … 570 537 protected: 571 538 539 friend VspTree; 540 friend OspTree; 541 friend BvHierarchy; 542 friend ViewCellsParseHandlers; 543 544 572 545 /** construction types 573 546 sequential: construct first view space, then object space … … 580 553 /// type of hierarchy construction 581 554 int mConstructionType; 582 583 555 /// Type of object space partition 584 556 int mObjectSpaceSubdivisionType; … … 586 558 int mViewSpaceSubdivisionType; 587 559 588 /// the traversal queue560 /// the queue maintains the split candidates during traversal 589 561 SplitQueue mTQueue; 590 591 ////////////592 //-- helper variables593 594 // the original osp type595 int mSavedObjectSpaceSubdivisionType;596 // the original vsp type597 int mSavedViewSpaceSubdivisionType;598 562 599 563 … … 601 565 // Hierarchies 602 566 567 /// the bounding volume hierarchy 568 BvHierarchy *mBvHierarchy; 603 569 /// view space hierarchy 604 570 VspTree *mVspTree; … … 608 574 float mInitialRenderCost; 609 575 610 //float mMaxAvgRayContri;611 //float mMinAvgRayContri;612 613 576 float mMaxAvgRaysPerObject; 614 577 float mMinAvgRaysPerObject; 615 578 616 // quick hack: 617 public: 618 /// bounding volume hierarchy 619 BvHierarchy *mBvHierarchy; 620 579 580 /// an internal tree optimized for view cell traversal 621 581 bool mUseTraversalTree; 622 623 float mMinRenderCost;624 625 protected:626 582 627 583 … … 638 594 float mTermMaxMemory; 639 595 596 float mMinRenderCost; 597 640 598 641 599 //////////////////// … … 651 609 int mMinDepthForViewSpaceSubdivion; 652 610 653 //int mMinRenderCostDecrease;654 655 std::ofstream mSubdivisionStats;656 657 611 /// if the queue should be repaired after a subdivision steps 658 612 bool mRepairQueue; 659 613 660 614 bool mStartWithObjectSpace; 661 /** if multi level construction method should be used662 w here we iterate over both hierarchies until we663 converge to the optimum. 615 /** multi level construction method means that 616 we iterate over both hierarchies until we 617 converge to the optimum. 664 618 */ 665 619 bool mUseMultiLevelConstruction; 666 667 620 /// number of iteration steps for multilevel approach 668 621 int mNumMultiLevels; 669 670 622 /** if split plane should be recomputed for the repair. 671 623 Otherwise only the priority is recomputed, the 672 split plane itself stays the same 624 split plane itself stays the same. 673 625 */ 674 626 bool mRecomputeSplitPlaneOnRepair; 675 627 676 628 /** If memory should be considered during choosing 677 of the next split type during gradient method. 629 of the next split type during gradient method. 678 630 */ 679 631 bool mConsiderMemory; … … 684 636 685 637 int mTimeStamp; 686 friend VspTree;687 friend OspTree;688 friend BvHierarchy;689 638 690 639 float mPriority; 691 640 692 friend ViewCellsParseHandlers; 693 641 642 //////////// 643 //-- helper variables 644 645 // the original osp type 646 int mSavedObjectSpaceSubdivisionType; 647 // the original vsp type 648 int mSavedViewSpaceSubdivisionType; 649 650 651 /// this is just a cache used during evaluation 694 652 ViewCellContainer mOldViewCells; 653 654 std::ofstream mSubdivisionStats; 695 655 }; 696 656
Note: See TracChangeset
for help on using the changeset viewer.