[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 |
|
---|
[1520] | 17 | /** Sample rays of particular type
|
---|
| 18 | */
|
---|
| 19 | enum
|
---|
| 20 | {
|
---|
| 21 | OBJECT_BASED_DISTRIBUTION,
|
---|
| 22 | DIRECTION_BASED_DISTRIBUTION,
|
---|
| 23 | DIRECTION_BOX_BASED_DISTRIBUTION,
|
---|
| 24 | SPATIAL_BOX_BASED_DISTRIBUTION,
|
---|
| 25 | RSS_BASED_DISTRIBUTION,
|
---|
| 26 | RSS_SILHOUETTE_BASED_DISTRIBUTION,
|
---|
| 27 | VSS_BASED_DISTRIBUTION,
|
---|
| 28 | OBJECT_DIRECTION_BASED_DISTRIBUTION,
|
---|
[1695] | 29 | OBJECTS_INTERIOR_DISTRIBUTION,
|
---|
| 30 | REVERSE_OBJECT_BASED_DISTRIBUTION
|
---|
[1520] | 31 | };
|
---|
| 32 |
|
---|
[1020] | 33 | /** Default constructor
|
---|
| 34 | */
|
---|
[1520] | 35 | SamplingStrategy(const Preprocessor &preprocessor);
|
---|
[1020] | 36 |
|
---|
[1520] | 37 | virtual ~SamplingStrategy();
|
---|
[1020] | 38 |
|
---|
| 39 | /** Each strategy has to implement this function.
|
---|
| 40 | @returns true if generated valid sample.
|
---|
| 41 | */
|
---|
| 42 | virtual bool GenerateSample(SimpleRay &ray) const = 0;
|
---|
| 43 |
|
---|
| 44 | protected:
|
---|
| 45 |
|
---|
| 46 | const Preprocessor &mPreprocessor;
|
---|
| 47 |
|
---|
| 48 | };
|
---|
| 49 |
|
---|
| 50 |
|
---|
| 51 | class ObjectBasedDistribution: public SamplingStrategy
|
---|
| 52 | {
|
---|
| 53 | public:
|
---|
| 54 |
|
---|
| 55 | ObjectBasedDistribution(const Preprocessor &preprocessor):
|
---|
| 56 | SamplingStrategy(preprocessor) {}
|
---|
| 57 |
|
---|
| 58 | virtual bool GenerateSample(SimpleRay &ray) const;
|
---|
| 59 | };
|
---|
| 60 |
|
---|
| 61 |
|
---|
[1695] | 62 | class ReverseObjectBasedDistribution: public SamplingStrategy
|
---|
| 63 | {
|
---|
| 64 | public:
|
---|
| 65 |
|
---|
| 66 | ReverseObjectBasedDistribution(const Preprocessor &preprocessor):
|
---|
| 67 | SamplingStrategy(preprocessor) {}
|
---|
| 68 |
|
---|
| 69 | virtual bool GenerateSample(SimpleRay &ray) const;
|
---|
| 70 | };
|
---|
| 71 |
|
---|
| 72 |
|
---|
[1020] | 73 | class ObjectDirectionBasedDistribution: public SamplingStrategy
|
---|
| 74 | {
|
---|
| 75 | public:
|
---|
| 76 | ObjectDirectionBasedDistribution(const Preprocessor &preprocessor):
|
---|
| 77 | SamplingStrategy(preprocessor) {}
|
---|
| 78 | virtual bool GenerateSample(SimpleRay &ray) const;
|
---|
| 79 | };
|
---|
| 80 |
|
---|
| 81 |
|
---|
| 82 | class DirectionBasedDistribution: public SamplingStrategy
|
---|
| 83 | {
|
---|
| 84 | public:
|
---|
| 85 | DirectionBasedDistribution(const Preprocessor &preprocessor):
|
---|
| 86 | SamplingStrategy(preprocessor) {}
|
---|
| 87 | virtual bool GenerateSample(SimpleRay &ray) const;
|
---|
| 88 | };
|
---|
| 89 |
|
---|
| 90 |
|
---|
| 91 | class DirectionBoxBasedDistribution: public SamplingStrategy
|
---|
| 92 | {
|
---|
| 93 | public:
|
---|
| 94 | DirectionBoxBasedDistribution(const Preprocessor &preprocessor):
|
---|
| 95 | SamplingStrategy(preprocessor) {}
|
---|
| 96 |
|
---|
| 97 | virtual bool GenerateSample(SimpleRay &ray) const;
|
---|
| 98 | };
|
---|
| 99 |
|
---|
| 100 |
|
---|
| 101 | class SpatialBoxBasedDistribution: public SamplingStrategy
|
---|
| 102 | {
|
---|
| 103 | public:
|
---|
| 104 | SpatialBoxBasedDistribution(const Preprocessor &preprocessor):
|
---|
| 105 | SamplingStrategy(preprocessor) {}
|
---|
| 106 |
|
---|
| 107 | virtual bool GenerateSample(SimpleRay &ray) const;
|
---|
| 108 | };
|
---|
| 109 |
|
---|
| 110 |
|
---|
| 111 | /** This strategy generates samples inside of the objects, e.g.,
|
---|
| 112 | for sampling the inside of a colon.
|
---|
| 113 | */
|
---|
[1021] | 114 | /*class ObjectsInteriorDistribution: public SamplingStrategy
|
---|
[1020] | 115 | {
|
---|
| 116 | public:
|
---|
| 117 | ObjectsInteriorDistribution(const Preprocessor &preprocessor):
|
---|
| 118 | SamplingStrategy(preprocessor) {}
|
---|
| 119 |
|
---|
| 120 | virtual bool GenerateSample(SimpleRay &ray) const;
|
---|
| 121 | };
|
---|
[1021] | 122 | */
|
---|
[1020] | 123 | };
|
---|
| 124 |
|
---|
| 125 | #endif
|
---|