Changeset 2544 for GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h
- Timestamp:
- 08/22/07 08:01:21 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h
r2539 r2544 25 25 26 26 27 //class ObjectPvs;28 29 27 30 28 /** Statistics for a view cell partition. 31 29 */ 32 33 30 class ViewCellsStatistics: public StatisticsBase 34 31 { … … 84 81 85 82 83 /** Statistics for a view cells tree. 84 */ 86 85 class ViewCellsTreeStats 87 86 { … … 142 141 143 142 144 /** 145 A view cell. View cells are regions in space. The visibility informations, 146 i.e., the primitives seen by the view cell are stored in a PVs. 147 A view cell can be represented in many different ways, e.g., 148 a mesh representation. 143 /** This class represents a view cell, which is a region in view space. 144 The objects seen by the view cell are stored in a pvs. 145 A view cell can be represented in many different ways, e.g., as a mesh. 149 146 */ 150 147 class ViewCell: public MeshInstance … … 156 153 157 154 ViewCell(); 158 159 155 /** Constructor taking a mesh representing the shape of the viewcell. 160 156 */ 161 157 ViewCell(Mesh *mesh); 162 163 158 /** Default destructor. 164 159 */ 165 160 virtual ~ViewCell(); 166 /** Returns Pvs.161 /** Returns const reference to pvs. 167 162 */ 168 163 const ObjectPvs &GetPvs() const; 169 /** Returns pvs.164 /** Returns reference to pvs. 170 165 */ 171 166 ObjectPvs &GetPvs(); … … 222 217 */ 223 218 bool GetValid() const; 224 225 219 /** Returns estimated render cost of this view cell. 226 220 */ 227 221 float GetRenderCost() const; 228 229 222 /** set color for visiualizations. 230 223 */ 231 224 void SetColor(const RgbColor &color); 232 233 225 /** get color for visualuzations. 234 226 */ 235 227 RgbColor GetColor() const; 236 237 228 /** Adds a sample to the pvs. 238 229 @param sample the sample to be added … … 241 232 */ 242 233 bool AddPvsSample(Intersectable *sample, const float pdf, float &contribution); 243 244 234 /** if this is a view cell correspending to a leaf in a hierarchy. 245 235 */ … … 257 247 */ 258 248 void SetMergeCost(const float mergeCost); 259 260 249 /** Returns merge cost needed to merge this leaf from other cells. 261 250 @hack The function is available for leaves also to have a common interface, … … 391 380 { 392 381 public: 393 ViewCellLeaf() { mActiveViewCell = this; } 394 ViewCellLeaf(Mesh *mesh): 395 ViewCell(mesh) { mActiveViewCell = this; } 382 383 ViewCellLeaf() 384 { 385 mActiveViewCell = this; 386 } 387 388 ViewCellLeaf(Mesh *mesh): ViewCell(mesh) 389 { 390 mActiveViewCell = this; 391 } 396 392 397 393 bool IsLeaf() const … … 454 450 public: 455 451 452 /** Default constructor. 453 */ 456 454 ViewCellsTree(); 457 458 455 /** View cells tree constructor taking a view cell mnanager as parameter 459 456 */ 460 457 ViewCellsTree(ViewCellsManager *vcm); 458 /** Destructor. 459 */ 461 460 ~ViewCellsTree(); 462 463 461 /** Returns number of leaves this view cell consists of. 464 462 */ 465 463 int GetNumInitialViewCells(ViewCell *vc) const; 466 467 464 /** Collects leaves corresponding to a view cell. 468 465 */ 469 466 void CollectLeaves(ViewCell *vc, ViewCellContainer &leaves) const; 470 471 467 /** Merges view cells according to some cost heuristics. 472 468 */ 473 469 int ConstructMergeTree(const VssRayContainer &rays, const ObjectContainer &objects); 474 475 470 /** Refines view cells using shuffling, i.e., border leaves 476 471 of two view cells are exchanged if the resulting view cells … … 479 474 */ 480 475 int RefineViewCells(const VssRayContainer &rays, const ObjectContainer &objects); 481 482 476 /** Assign colors to the viewcells so that they can be renderered interactively without 483 477 color flickering. 484 478 */ 485 479 void AssignRandomColors(); 486 487 480 /** Updates view cell stats for this particular view cell. 488 481 */ 489 482 void UpdateViewCellsStats(ViewCell *vc, ViewCellsStatistics &vcStat); 490 491 483 /** Get costs resulting from each merge step. 492 484 */ 493 485 void GetCostFunction(vector<float> &costFunction); 494 495 486 /** Returns storage cost resulting from each merge step. 496 487 */ 497 488 void GetStorageFunction(vector<int> &storageCost); 498 499 489 /** Returns optimal set of view cells for a given number of view cells. 500 490 */ 501 491 void CollectBestViewCellSet(ViewCellContainer &viewCells, const int numViewCells); 502 503 492 /** Root of view cells tree. 504 493 */ 505 494 ViewCell *GetRoot() const; 506 507 495 /** Returns pvs of view cell. 508 496 @note pvs is returned per reference if tree is not compressed, … … 510 498 */ 511 499 void GetPvs(ViewCell *vc, ObjectPvs &pvs) const; 512 513 500 /** Returns pvs size (i.e. the render cost of the stored objects) 514 501 */ 515 502 float GetTrianglesInPvs(ViewCell *vc) const; 516 517 503 /** Returns number of entries associated with this view cell. 518 504 … … 522 508 */ 523 509 int GetPvsEntries(ViewCell *vc) const; 524 525 510 /** Returns the number of physically stored entries in the view cells sub tree. 526 511 This can vary based on the current storage method 527 512 */ 528 513 int CountStoredPvsEntries(ViewCell *root) const; 529 530 514 /** Returns memory cost of this view cell. 531 515 */ 532 516 float GetMemoryCost(ViewCell *vc) const; 533 534 517 /** Sets method of storage for view cells. 535 518 */ 536 519 void SetViewCellsStorage(int type); 537 538 520 /** pvs storage methods 539 521 */ 540 522 enum {PVS_IN_INTERIORS, COMPRESSED, PVS_IN_LEAVES}; 541 542 523 /** If view cells in this tree have compressed pvs. 543 524 */ 544 525 int ViewCellsStorage() const; 545 546 526 /** Returns active view cell that is in the path of this view cell. 547 527 */ … … 736 716 int mMaxMergesPerPass; 737 717 float mAvgCostMaxDeviation; 718 719 int *mPvsIds; 720 ObjectContainer mTempObjects; 738 721 }; 739 722
Note: See TracChangeset
for help on using the changeset viewer.