#ifndef _DifferenceSampling_H__ #define _DifferenceSampling_H__ #include "common.h" //#include "ObjectPvs.h" class SimpleRay; namespace GtpVisibilityPreprocessor { /** This sampling strategy utilizes the spatial filter to find areas that are likely to be visible. First the filter is applied. The difference set of objects (filtered pvs - unfiltered pvs) gives you the objects which are not found visible yet but have a good probability that they are in fact visible, based on the current state of the sampling and the size of the filter. In fact the difference set is a probably visible set. Algorithm overview: We apply the filter for n times, each time with a higher filter radius. The difference set gives you the probable visible set. Then we use a certain #random samples for sampling the view cell border + the object border. We can use different filter sizes to estimate the probability distribution. The objects shouldreceived samples roughly according to their probability of becoming invisible. */ class DifferenceSampling: public SamplingStrategy { public: DifferenceSampling(Preprocessor &preprocessor); /** Compute the difference set between filtered and unfiltered pvs. */ void ComputeDifferenceSet(ViewCell *vc, ObjectContainer &differenceSet); private: virtual bool GenerateSample(SimpleRay &ray); //ObjectPvs mDifferencePvs; ObjectContainer mPvsDifference; ViewCell *mCurrentViewCell; int mNumSamples; }; } #endif