[1020] | 1 | #ifndef _SamplingStategy_H__
|
---|
| 2 | #define _SamplingStategy_H__
|
---|
| 3 |
|
---|
| 4 |
|
---|
| 5 | namespace GtpVisibilityPreprocessor {
|
---|
| 6 |
|
---|
| 7 |
|
---|
| 8 | class Preprocessor;
|
---|
| 9 | struct SimpleRay;
|
---|
| 10 |
|
---|
| 11 | /** This class generates a specific sampling strategy.
|
---|
| 12 | */
|
---|
| 13 | class SamplingStrategy
|
---|
| 14 | {
|
---|
| 15 | public:
|
---|
| 16 |
|
---|
| 17 | /** Default constructor
|
---|
| 18 | */
|
---|
| 19 | SamplingStrategy(const Preprocessor &preprocessor): mPreprocessor(preprocessor)
|
---|
| 20 | {}
|
---|
| 21 |
|
---|
| 22 | virtual ~SamplingStrategy() {};
|
---|
| 23 |
|
---|
| 24 | /** Each strategy has to implement this function.
|
---|
| 25 | @returns true if generated valid sample.
|
---|
| 26 | */
|
---|
| 27 | virtual bool GenerateSample(SimpleRay &ray) const = 0;
|
---|
| 28 |
|
---|
| 29 | protected:
|
---|
| 30 |
|
---|
| 31 | const Preprocessor &mPreprocessor;
|
---|
| 32 |
|
---|
| 33 | };
|
---|
| 34 |
|
---|
| 35 |
|
---|
| 36 | class ObjectBasedDistribution: public SamplingStrategy
|
---|
| 37 | {
|
---|
| 38 | public:
|
---|
| 39 |
|
---|
| 40 | ObjectBasedDistribution(const Preprocessor &preprocessor):
|
---|
| 41 | SamplingStrategy(preprocessor) {}
|
---|
| 42 |
|
---|
| 43 | virtual bool GenerateSample(SimpleRay &ray) const;
|
---|
| 44 | };
|
---|
| 45 |
|
---|
| 46 |
|
---|
| 47 | class ObjectDirectionBasedDistribution: public SamplingStrategy
|
---|
| 48 | {
|
---|
| 49 | public:
|
---|
| 50 | ObjectDirectionBasedDistribution(const Preprocessor &preprocessor):
|
---|
| 51 | SamplingStrategy(preprocessor) {}
|
---|
| 52 | virtual bool GenerateSample(SimpleRay &ray) const;
|
---|
| 53 | };
|
---|
| 54 |
|
---|
| 55 |
|
---|
| 56 | class DirectionBasedDistribution: public SamplingStrategy
|
---|
| 57 | {
|
---|
| 58 | public:
|
---|
| 59 | DirectionBasedDistribution(const Preprocessor &preprocessor):
|
---|
| 60 | SamplingStrategy(preprocessor) {}
|
---|
| 61 | virtual bool GenerateSample(SimpleRay &ray) const;
|
---|
| 62 | };
|
---|
| 63 |
|
---|
| 64 |
|
---|
| 65 | class DirectionBoxBasedDistribution: public SamplingStrategy
|
---|
| 66 | {
|
---|
| 67 | public:
|
---|
| 68 | DirectionBoxBasedDistribution(const Preprocessor &preprocessor):
|
---|
| 69 | SamplingStrategy(preprocessor) {}
|
---|
| 70 |
|
---|
| 71 | virtual bool GenerateSample(SimpleRay &ray) const;
|
---|
| 72 | };
|
---|
| 73 |
|
---|
| 74 |
|
---|
| 75 | class SpatialBoxBasedDistribution: public SamplingStrategy
|
---|
| 76 | {
|
---|
| 77 | public:
|
---|
| 78 | SpatialBoxBasedDistribution(const Preprocessor &preprocessor):
|
---|
| 79 | SamplingStrategy(preprocessor) {}
|
---|
| 80 |
|
---|
| 81 | virtual bool GenerateSample(SimpleRay &ray) const;
|
---|
| 82 | };
|
---|
| 83 |
|
---|
| 84 |
|
---|
| 85 | /** This strategy generates samples inside of the objects, e.g.,
|
---|
| 86 | for sampling the inside of a colon.
|
---|
| 87 | */
|
---|
[1021] | 88 | /*class ObjectsInteriorDistribution: public SamplingStrategy
|
---|
[1020] | 89 | {
|
---|
| 90 | public:
|
---|
| 91 | ObjectsInteriorDistribution(const Preprocessor &preprocessor):
|
---|
| 92 | SamplingStrategy(preprocessor) {}
|
---|
| 93 |
|
---|
| 94 | virtual bool GenerateSample(SimpleRay &ray) const;
|
---|
| 95 | };
|
---|
[1021] | 96 | */
|
---|
[1020] | 97 | };
|
---|
| 98 |
|
---|
| 99 | #endif
|
---|