Changeset 2539 for GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h
- Timestamp:
- 08/08/07 15:50:33 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h
r2387 r2539 547 547 */ 548 548 ViewCell *GetActiveViewCell(ViewCellLeaf *vc) const; 549 550 549 /** Sets the leaves to be the currently active view cells. 551 550 */ 552 551 void SetActiveSetToLeaves(); 553 554 552 /** Propagates pvs up the tree to the root and downwards the tree. 555 553 */ 556 554 void PropagatePvs(ViewCell *vc); 557 558 555 /** Exports view cells to file. 559 556 */ 560 557 bool Export(OUT_STREAM &stream, const bool exportPvs = false); 561 562 558 /** Export statistics of this view cell tree. 563 559 */ 564 560 void ExportStats(const std::string &mergeStats); 565 566 561 /** Sets root of hierarchy. 567 562 */ 568 563 void SetRoot(ViewCell *root); 569 570 564 /** Assignes unique ids to view cells. 571 565 */ 572 566 void CreateUniqueViewCellsIds(); 573 574 567 /** Resets pvs of whole tree. 575 568 */ 576 569 void ResetPvs(); 577 578 570 /** Counts pvs of the view cell taking the kd cells into account. 579 571 */ 580 572 int CountKdPvs(const ViewCellLeaf *vc) const; 581 582 573 /** Sets pointer to view cells manager. 583 574 */ 584 575 void SetViewCellsManager(ViewCellsManager *vcm); 585 576 586 void Update(); 577 ViewCellInterior *ImportBinInterior(IN_STREAM &stream, ViewCellInterior *parent); 578 579 ViewCellLeaf *ImportBinLeaf(IN_STREAM &stream, 580 ViewCellInterior *parent, 581 const ObjectContainer &pvsObjects); 582 583 void ExportBinInterior(OUT_STREAM &stream, ViewCellInterior *interior); 584 585 void ExportBinLeaf(OUT_STREAM &stream, ViewCell *leaf); 586 587 bool ExportBinary(OUT_STREAM &stream); 588 589 bool ImportBinary(IN_STREAM &stream, const ObjectContainer &pvsObjects); 590 591 ViewCell *ImportNextNode(IN_STREAM &stream, 592 ViewCellInterior *parent, 593 const ObjectContainer &objects); 587 594 588 595 protected: … … 601 608 */ 602 609 float ComputeMergedPvsCost(const ObjectPvs &pvs1, const ObjectPvs &pvs2) const; 603 604 610 /** Returns cost of this leaf according to current heuristics. 605 611 */ 606 612 float GetCostHeuristics(ViewCell *vc) const; 607 608 613 /** Returns cost of leaf. 609 614 */ 610 615 float GetRenderCost(ViewCell *vc) const; 611 612 616 /** Evaluates the merge cost of this merge candidate pair. 613 617 */ 614 618 void EvalMergeCost(MergeCandidate &mc) const; 615 616 619 /** Variance of leaf. 617 620 */ 618 621 float GetVariance(ViewCell *vc) const; 619 620 622 /** Standard deviation of leaf. 621 623 */ 622 624 float GetDeviation(ViewCell *vc) const; 623 624 625 /** Tries to set this merge candidate to valid. 625 626 @returns false if both view cells are the same 626 627 */ 627 628 bool ValidateMergeCandidate(MergeCandidate &mc) const; 628 629 629 /** Merge view cells of leaves l1 and l2. 630 630 @returns difference in pvs size 631 631 */ 632 632 ViewCellInterior *MergeViewCells(ViewCell *l, ViewCell *r, float &pvsDiff); 633 634 633 /** Shuffles, i.e. takes border leaf from view cell 1 and adds it 635 634 to view cell 2. 636 635 */ 637 636 void ShuffleLeaf(ViewCell *leaf, ViewCellInterior *vc1, ViewCellInterior *vc2) const; 638 639 637 /** Shuffles the leaves, i.e., tests if exchanging 640 638 the leaves helps in improving the view cells. 641 639 */ 642 640 bool ShuffleLeaves(MergeCandidate &mc) const; 643 644 641 /** Calculates cost for merge of view cell 1 and 2. 645 642 */ … … 647 644 ViewCellInterior *vc1, 648 645 ViewCellInterior *vc2) const; 649 650 646 /** Exports a snapshot of the merged view cells to disc. 651 647 */ … … 653 649 const ObjectContainer &objects, 654 650 const int numNewViewCells); 655 656 651 /** Merge queue must be reset after some time because expected value 657 652 may not be valid. 658 653 */ 659 654 void ResetMergeQueue(); 660 661 655 /** Updates the current cut of view cells. 662 656 @returns number of newly merged view cells 663 657 */ 664 658 int UpdateActiveViewCells(ViewCellContainer &viewCells); 665 666 659 /** Helper function pullling pvs as high up in the tree as possible. 667 660 */ 668 661 void PullUpVisibility(ViewCellInterior *interior); 669 670 662 /** Compress pvs of view cell and children. 671 663 */ 672 664 void CompressViewCellsPvs(ViewCell *root); 673 674 665 /** Returns memory usage of view cells. 675 666 */ 676 667 float GetMemUsage() const; 677 678 668 /** Exports single view cell. 679 669 NOTE: should be in exporter!! 680 670 */ 681 671 void ExportViewCell(ViewCell *viewCell, OUT_STREAM &stream, const bool exportPvs); 682 683 672 /** Exports pvs of a view cell. 684 673 */ 685 674 void ExportPvs(ViewCell *viewCell, OUT_STREAM &stream); 686 687 675 /** Counts the logical number of entries in the pvs this view cell. 688 676 The pvs is assumed to be stored using lossless compression. 689 677 */ 690 678 int GetEntriesInPvsForCompressedStorage(ViewCell *vc) const; 691 692 679 /** Computes pvs size of this view cell. 693 680 The pvs is assumed to be stored using lossless compression. 694 681 */ 695 682 float GetPvsCostForCompressedStorage(ViewCell *vc) const; 696 697 683 /** Computes pvs size of this view cell. 698 684 The pvs is assumed to be stored in the leaves. 699 685 */ 700 686 float GetPvsCostForLeafStorage(ViewCell *vc) const; 701 702 687 /** Counts the logical number of entries in the pvs this view cell. 703 688 The pvs is assumed to be stored using the leaves. 704 689 */ 705 690 int GetEntriesInPvsForLeafStorage(ViewCell *vc) const; 706 707 691 /** Update stats for the log. 708 692 */ 709 693 void UpdateStats(std::ofstream &stats, 710 694 const ViewCellsTreeStats &vcStats); 711 712 695 713 696
Note: See TracChangeset
for help on using the changeset viewer.