1 | #include "ViewCell.h"
|
---|
2 | #include "Mesh.h"
|
---|
3 | #include "Intersectable.h"
|
---|
4 | #include "MeshKdTree.h"
|
---|
5 | #include "Triangle3.h"
|
---|
6 | #include <time.h>
|
---|
7 | #include <iomanip>
|
---|
8 |
|
---|
9 | ViewCell::ViewCell(): MeshInstance(NULL), mPiercingRays(0)
|
---|
10 | {
|
---|
11 | }
|
---|
12 |
|
---|
13 | ViewCell::ViewCell(Mesh *mesh): MeshInstance(mesh), mPiercingRays(0)
|
---|
14 | {
|
---|
15 | }
|
---|
16 |
|
---|
17 | const ViewCellPvs &ViewCell::GetPvs() const
|
---|
18 | {
|
---|
19 | return mPvs;
|
---|
20 | }
|
---|
21 |
|
---|
22 | ViewCellPvs &ViewCell::GetPvs()
|
---|
23 | {
|
---|
24 | return mPvs;
|
---|
25 | }
|
---|
26 |
|
---|
27 | int ViewCell::Type() const
|
---|
28 | {
|
---|
29 | return VIEW_CELL;
|
---|
30 | }
|
---|
31 |
|
---|
32 | void ViewCell::AddPassingRay(const Ray &ray, const int contributions)
|
---|
33 | {
|
---|
34 | mPassingRays.AddRay(ray, contributions);
|
---|
35 | }
|
---|
36 |
|
---|
37 | /************************************************************************/
|
---|
38 | /* class ViewCellsStatistics implementation */
|
---|
39 | /************************************************************************/
|
---|
40 |
|
---|
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 | }
|
---|