Changeset 462 for trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.h
- Timestamp:
- 12/13/05 17:28:02 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.h
r454 r462 5 5 #include "Containers.h" 6 6 #include "Ray.h" 7 7 #include "Statistics.h" 8 8 //namespace GtpVisibilityPreprocessor { 9 9 … … 13 13 class BspLeaf; 14 14 class VspKdTree; 15 class VspKdTreeLeaf; 15 class VspKdLeaf; 16 16 17 17 18 /** … … 22 23 public: 23 24 ViewCell(); 25 24 26 /** Constructor taking a mesh representing the shape of the viewcell. 25 27 */ 26 28 ViewCell(Mesh *mesh); 29 30 31 virtual ~ViewCell() {} 27 32 /** Returns Pvs. 28 33 */ … … 67 72 ViewCell(mesh), mVspKdLeaves(0) {} 68 73 69 float GetSize() {return 0;}74 float GetSize() {return mSize;} 70 75 void SetSize(float size) {mSize = size;} 71 76 72 77 /// Leaves which hold this view cell. 73 vector<VspKd TreeLeaf *> mVspKdLeaves;78 vector<VspKdLeaf *> mVspKdLeaves; 74 79 75 80 protected: 76 81 float mSize; 77 82 }; 83 84 class ViewCellsStatistics: public StatisticsBase 85 { 86 public: 87 88 /// number of view cells 89 int viewCells; 90 91 /// size of the PVS 92 int pvs; 93 94 /// largest PVS of all view cells 95 int maxPvs; 96 97 /// smallest PVS of all view cells 98 int minPvs; 99 100 /// view cells with empty PVS 101 int emptyPvs; 102 103 /// number of leaves covering the view space 104 int leaves; 105 106 /// largest number of leaves covered by one view cell 107 int maxLeaves; 108 109 // Constructor 110 ViewCellsStatistics() 111 { 112 Reset(); 113 } 114 115 double AvgLeaves() const {return (double)leaves / (double)viewCells;}; 116 double AvgPvs() const {return (double)pvs / (double)viewCells;}; 117 118 void Reset() 119 { 120 viewCells = 0; 121 pvs = 0; 122 maxPvs = 0; 123 124 minPvs = 999999; 125 emptyPvs = 0; 126 leaves = 0; 127 maxLeaves = 0; 128 } 129 130 void Print(ostream &app) const; 131 132 friend ostream &operator<<(ostream &s, const ViewCellsStatistics &stat) 133 { 134 stat.Print(s); 135 return s; 136 } 137 }; 138 78 139 #endif
Note: See TracChangeset
for help on using the changeset viewer.