[235] | 1 | #include "ViewCell.h"
|
---|
| 2 | #include "Mesh.h"
|
---|
[308] | 3 | #include "Intersectable.h"
|
---|
[235] | 4 | #include "MeshKdTree.h"
|
---|
| 5 | #include "Triangle3.h"
|
---|
[463] | 6 | #include <time.h>
|
---|
[462] | 7 | #include <iomanip>
|
---|
[235] | 8 |
|
---|
[352] | 9 | ViewCell::ViewCell(): MeshInstance(NULL), mPiercingRays(0)
|
---|
[265] | 10 | {
|
---|
| 11 | }
|
---|
[235] | 12 |
|
---|
[372] | 13 | ViewCell::ViewCell(Mesh *mesh): MeshInstance(mesh), mPiercingRays(0)
|
---|
| 14 | {
|
---|
| 15 | }
|
---|
| 16 |
|
---|
[419] | 17 | const ViewCellPvs &ViewCell::GetPvs() const
|
---|
| 18 | {
|
---|
| 19 | return mPvs;
|
---|
| 20 | }
|
---|
| 21 |
|
---|
[372] | 22 | ViewCellPvs &ViewCell::GetPvs()
|
---|
| 23 | {
|
---|
| 24 | return mPvs;
|
---|
| 25 | }
|
---|
| 26 |
|
---|
[235] | 27 | int ViewCell::Type() const
|
---|
| 28 | {
|
---|
[308] | 29 | return VIEW_CELL;
|
---|
[235] | 30 | }
|
---|
| 31 |
|
---|
[372] | 32 | void ViewCell::AddPassingRay(const Ray &ray, const int contributions)
|
---|
| 33 | {
|
---|
| 34 | mPassingRays.AddRay(ray, contributions);
|
---|
[462] | 35 | }
|
---|
| 36 |
|
---|
| 37 | /************************************************************************/
|
---|
| 38 | /* class ViewCellsStatistics implementation */
|
---|
| 39 | /************************************************************************/
|
---|
| 40 |
|
---|
[463] | 41 | void ViewCellsStatistics::Print(ostream &app) const
|
---|
| 42 | {
|
---|
| 43 | app << "=========== View Cells Statistics ===============\n";
|
---|
| 44 |
|
---|
| 45 | app << setprecision(4);
|
---|
| 46 |
|
---|
| 47 | //app << "#N_CTIME ( Construction time [s] )\n" << Time() << " \n";
|
---|
| 48 |
|
---|
| 49 | app << "#N_OVERALLPVS ( objects in PVS )\n" << pvs << endl;
|
---|
| 50 |
|
---|
| 51 | app << "#N_PMAXPVS ( largest PVS )\n" << maxPvs << endl;
|
---|
| 52 |
|
---|
| 53 | app << "#N_PMINPVS ( smallest PVS )\n" << minPvs << endl;
|
---|
| 54 |
|
---|
| 55 | app << "#N_PAVGPVS ( average PVS )\n" << AvgPvs() << endl;
|
---|
| 56 |
|
---|
| 57 | app << "#N_PEMPTYPVS ( view cells with PVS smaller 2 )\n" << emptyPvs << endl;
|
---|
| 58 |
|
---|
| 59 | app << "#N_VIEWCELLS ( number of view cells)\n" << viewCells << endl;
|
---|
| 60 |
|
---|
| 61 | app << "#N_AVGLEAVES (average number of leaves per view cell )\n" << AvgLeaves() << endl;
|
---|
| 62 |
|
---|
| 63 | app << "#N_MAXLEAVES ( maximal number of leaves per view cell )\n" << maxLeaves << endl;
|
---|
| 64 |
|
---|
| 65 | app << "========== End of View Cells Statistics ==========\n";
|
---|
| 66 | }
|
---|