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 ObjectPvs &ViewCell::GetPvs() const
|
---|
18 | {
|
---|
19 | return mPvs;
|
---|
20 | }
|
---|
21 |
|
---|
22 | ObjectPvs &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 | float ViewCell::GetVolume() const
|
---|
38 | {
|
---|
39 | return mVolume;
|
---|
40 | }
|
---|
41 |
|
---|
42 | void ViewCell::SetVolume(float volume)
|
---|
43 | {
|
---|
44 | mVolume = volume;
|
---|
45 | }
|
---|
46 |
|
---|
47 | /************************************************************************/
|
---|
48 | /* class ViewCellsStatistics implementation */
|
---|
49 | /************************************************************************/
|
---|
50 |
|
---|
51 | void ViewCellsStatistics::Print(ostream &app) const
|
---|
52 | {
|
---|
53 | app << "=========== View Cells Statistics ===============\n";
|
---|
54 |
|
---|
55 | app << setprecision(4);
|
---|
56 |
|
---|
57 | //app << "#N_CTIME ( Construction time [s] )\n" << Time() << " \n";
|
---|
58 |
|
---|
59 | app << "#N_OVERALLPVS ( objects in PVS )\n" << pvs << endl;
|
---|
60 |
|
---|
61 | app << "#N_PMAXPVS ( largest PVS )\n" << maxPvs << endl;
|
---|
62 |
|
---|
63 | app << "#N_PMINPVS ( smallest PVS )\n" << minPvs << endl;
|
---|
64 |
|
---|
65 | app << "#N_PAVGPVS ( average PVS )\n" << AvgPvs() << endl;
|
---|
66 |
|
---|
67 | app << "#N_PEMPTYPVS ( view cells with PVS smaller 2 )\n" << emptyPvs << endl;
|
---|
68 |
|
---|
69 | app << "#N_VIEWCELLS ( number of view cells)\n" << viewCells << endl;
|
---|
70 |
|
---|
71 | app << "#N_AVGLEAVES (average number of leaves per view cell )\n" << AvgLeaves() << endl;
|
---|
72 |
|
---|
73 | app << "#N_MAXLEAVES ( maximal number of leaves per view cell )\n" << maxLeaves << endl;
|
---|
74 |
|
---|
75 | app << "========== End of View Cells Statistics ==========\n";
|
---|
76 | }
|
---|