source: GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.h @ 1520

Revision 1520, 2.5 KB checked in by mattausch, 18 years ago (diff)

moved raycasting out of preprocessor into specific ray casting interface

RevLine 
[1020]1#ifndef _SamplingStategy_H__
2#define _SamplingStategy_H__
3
4
5namespace GtpVisibilityPreprocessor {
6
7
8class Preprocessor;
9struct SimpleRay;
10
11/** This class generates a specific sampling strategy.
12*/
13class 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,
29                 OBJECTS_INTERIOR_DISTRIBUTION
30         };
31
[1020]32         /** Default constructor
33     */
[1520]34         SamplingStrategy(const Preprocessor &preprocessor);
[1020]35
[1520]36         virtual ~SamplingStrategy();
[1020]37
38         /** Each strategy has to implement this function.
39                 @returns true if generated valid sample.
40         */
41         virtual bool GenerateSample(SimpleRay &ray) const = 0;
42
43protected:
44
45        const Preprocessor &mPreprocessor;
46
47};
48
49
50class ObjectBasedDistribution: public SamplingStrategy
51{
52 public:
53       
54         ObjectBasedDistribution(const Preprocessor &preprocessor):
55         SamplingStrategy(preprocessor) {}
56
57         virtual bool GenerateSample(SimpleRay &ray) const;
58};
59
60
61class ObjectDirectionBasedDistribution: public SamplingStrategy
62{
63 public:
64         ObjectDirectionBasedDistribution(const Preprocessor &preprocessor):
65         SamplingStrategy(preprocessor) {}
66        virtual bool GenerateSample(SimpleRay &ray) const;
67};
68
69
70class DirectionBasedDistribution: public SamplingStrategy
71{
72 public:
73        DirectionBasedDistribution(const Preprocessor &preprocessor):
74         SamplingStrategy(preprocessor) {}
75        virtual bool GenerateSample(SimpleRay &ray) const;
76};
77
78
79class DirectionBoxBasedDistribution: public SamplingStrategy
80{
81 public:
82         DirectionBoxBasedDistribution(const Preprocessor &preprocessor):
83           SamplingStrategy(preprocessor) {}
84           
85           virtual bool GenerateSample(SimpleRay &ray) const;
86};
87
88
89class SpatialBoxBasedDistribution: public SamplingStrategy
90{
91 public:
92         SpatialBoxBasedDistribution(const Preprocessor &preprocessor):
93         SamplingStrategy(preprocessor) {}
94         
95         virtual bool GenerateSample(SimpleRay &ray) const;
96};
97
98
99/** This strategy generates samples inside of the objects, e.g.,
100        for sampling the inside of a colon.
101*/
[1021]102/*class ObjectsInteriorDistribution: public SamplingStrategy
[1020]103{
104 public:
105         ObjectsInteriorDistribution(const Preprocessor &preprocessor):
106         SamplingStrategy(preprocessor) {}
107         
108         virtual bool GenerateSample(SimpleRay &ray) const;
109};
[1021]110*/
[1020]111};
112
113#endif
Note: See TracBrowser for help on using the repository browser.