source: trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.cpp @ 469

Revision 469, 1.8 KB checked in by mattausch, 19 years ago (diff)

updated view cells, view cell manager. changed rendersimulator

Line 
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
9ViewCell::ViewCell(): MeshInstance(NULL), mPiercingRays(0)
10{
11}
12
13ViewCell::ViewCell(Mesh *mesh): MeshInstance(mesh), mPiercingRays(0)
14{
15}
16
17const ObjectPvs &ViewCell::GetPvs() const
18{
19        return mPvs;
20}
21
22ObjectPvs &ViewCell::GetPvs()
23{
24        return mPvs;
25}
26
27int ViewCell::Type() const
28{
29        return VIEW_CELL;
30}
31
32void ViewCell::AddPassingRay(const Ray &ray, const int contributions)
33{
34        mPassingRays.AddRay(ray, contributions);
35}
36
37float ViewCell::GetVolume() const
38{
39        return mVolume;
40}
41
42void ViewCell::SetVolume(float volume)
43{
44        mVolume = volume;
45}
46
47/************************************************************************/
48/*                class ViewCellsStatistics implementation              */
49/************************************************************************/
50
51void 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}
Note: See TracBrowser for help on using the repository browser.