#include "ViewCell.h" #include "Mesh.h" #include "Intersectable.h" #include "MeshKdTree.h" #include "Triangle3.h" #include #include ViewCell::ViewCell(): MeshInstance(NULL), mPiercingRays(0) { } ViewCell::ViewCell(Mesh *mesh): MeshInstance(mesh), mPiercingRays(0) { } const ViewCellPvs &ViewCell::GetPvs() const { return mPvs; } ViewCellPvs &ViewCell::GetPvs() { return mPvs; } int ViewCell::Type() const { return VIEW_CELL; } void ViewCell::AddPassingRay(const Ray &ray, const int contributions) { mPassingRays.AddRay(ray, contributions); } /************************************************************************/ /* class ViewCellsStatistics implementation */ /************************************************************************/ void ViewCellsStatistics::Print(ostream &app) const { app << "=========== View Cells Statistics ===============\n"; app << setprecision(4); //app << "#N_CTIME ( Construction time [s] )\n" << Time() << " \n"; app << "#N_OVERALLPVS ( objects in PVS )\n" << pvs << endl; app << "#N_PMAXPVS ( largest PVS )\n" << maxPvs << endl; app << "#N_PMINPVS ( smallest PVS )\n" << minPvs << endl; app << "#N_PAVGPVS ( average PVS )\n" << AvgPvs() << endl; app << "#N_PEMPTYPVS ( view cells with PVS smaller 2 )\n" << emptyPvs << endl; app << "#N_VIEWCELLS ( number of view cells)\n" << viewCells << endl; app << "#N_AVGLEAVES (average number of leaves per view cell )\n" << AvgLeaves() << endl; app << "#N_MAXLEAVES ( maximal number of leaves per view cell )\n" << maxLeaves << endl; app << "========== End of View Cells Statistics ==========\n"; }