source: GTP/trunk/Lib/Vis/Preprocessing/src/RandomViewCellsHandler.h @ 2598

Revision 2598, 2.2 KB checked in by mattausch, 16 years ago (diff)
Line 
1#ifndef _RandomViewCellsHandler_H__
2#define _RandomViewCellsHandler_H__
3
4#include "Containers.h"
5#include "SimpleRay.h"
6
7
8namespace GtpVisibilityPreprocessor {
9
10class ViewCell;
11class ViewCellsManager;
12
13typedef pair<ViewCell *, SimpleRayContainer> ViewCellPoints;
14typedef vector<ViewCellPoints *> ViewCellPointsList;
15
16
17/** This class functions define a system to generate, export and import a list
18        of random view cells and valid view points.
19*/
20
21class RandomViewCellsHandler
22{
23        //friend class ViewCellsManager;
24
25public:
26
27        RandomViewCellsHandler(ViewCellsManager *vcManager);
28        ~RandomViewCellsHandler();
29
30        /** Exports list of random view cells.
31        */
32        bool ExportRandomViewCells(const string &filename);
33        /** Returns the stored list of view cells and view points.
34        */
35        ViewCellPointsList *GetViewCellPointsList();
36        /** Load list of view cells using the current list of view points.
37        */
38        bool ImportViewCellsList(const string &filename);
39
40
41protected:
42
43        bool GenerateRandomViewCells(ViewCellContainer &viewCells,
44                                                                 const int numViewCells);
45
46        bool GenerateRandomViewCells(ViewCellPointsList &viewCells,
47                                                                 const int nViewCells,
48                                                                 const int nViewPoints);
49
50
51        /** Generates a list of random view points in a view cells.
52                @param viewCell the view cells
53                @param numViewPoints the number of view points
54                @param viewPoints returns view points in this container.
55        */
56        bool GenerateViewPoints(ViewCell *viewCell,
57                                                        const int numViewPoints,
58                                                        SimpleRayContainer &viewPoints);
59
60        /** Load list of view cells and view points.
61        */
62        bool ImportViewCellsList(const string &filename,
63                                                         vector<ViewCellPoints *> &viewCells);
64
65        /** Exports list of random view cells and valid view points.
66        */
67        bool ExportRandomViewCells(const string &filename,
68                                                           const vector<ViewCellPoints *> &viewCells);
69
70        /** Generates a new valid random view point.
71        */
72        bool GenerateViewPoint(ViewCell *viewCell, SimpleRay &ray);
73
74        /** Returns true if this view cell is in valid view space.
75        */
76        bool IsValidViewSpace(ViewCell *vc);
77
78       
79protected:
80
81        ViewCellsManager *mViewCellsManager;
82
83        ViewCellPointsList mViewCellPointsList;
84};
85
86}
87
88
89#endif
Note: See TracBrowser for help on using the repository browser.