1 | #ifndef _DifferenceSampling_H__
|
---|
2 | #define _DifferenceSampling_H__
|
---|
3 |
|
---|
4 | #include "common.h"
|
---|
5 | //#include "ObjectPvs.h"
|
---|
6 |
|
---|
7 | class SimpleRay;
|
---|
8 |
|
---|
9 | namespace GtpVisibilityPreprocessor {
|
---|
10 |
|
---|
11 |
|
---|
12 | /** This sampling strategy utilizes the spatial filter to find
|
---|
13 | areas that are likely to be visible.
|
---|
14 |
|
---|
15 | First the filter is applied. The difference set of objects
|
---|
16 | (filtered pvs - unfiltered pvs) gives you the objects which
|
---|
17 | are not found visible yet but have a good probability that they
|
---|
18 | are in fact visible, based on the current
|
---|
19 | state of the sampling and the size of the filter. In fact the
|
---|
20 | difference set is a probably visible set.
|
---|
21 |
|
---|
22 | Algorithm overview:
|
---|
23 | We apply the filter for n times, each time with a higher filter radius.
|
---|
24 | The difference set gives you the probable visible set.
|
---|
25 | Then we use a certain #random samples for sampling the view cell border +
|
---|
26 | the object border. We can use different filter sizes to estimate the probability
|
---|
27 | distribution. The objects shouldreceived samples
|
---|
28 | roughly according to their probability of becoming invisible.
|
---|
29 | */
|
---|
30 | class DifferenceSampling: public SamplingStrategy
|
---|
31 | {
|
---|
32 | public:
|
---|
33 | DifferenceSampling(Preprocessor &preprocessor);
|
---|
34 | /** Compute the difference set between filtered and unfiltered pvs.
|
---|
35 | */
|
---|
36 | void ComputeDifferenceSet(ViewCell *vc, ObjectContainer &differenceSet);
|
---|
37 |
|
---|
38 | private:
|
---|
39 |
|
---|
40 | virtual bool GenerateSample(SimpleRay &ray);
|
---|
41 |
|
---|
42 | //ObjectPvs mDifferencePvs;
|
---|
43 | ObjectContainer mPvsDifference;
|
---|
44 |
|
---|
45 | ViewCell *mCurrentViewCell;
|
---|
46 | int mNumSamples;
|
---|
47 | };
|
---|
48 |
|
---|
49 |
|
---|
50 | }
|
---|
51 |
|
---|
52 | #endif
|
---|
53 |
|
---|