DissolveSampleGenerator.h

Go to the documentation of this file.
00001 /**<!-------------------------------------------------------------------->
00002    @class  DissolveSampleGenerator
00003    @author Travis Fischer (fisch0920@gmail.com)
00004    @date   Fall 2008
00005    
00006    @brief
00007       Cool dissolve effect which generates point samples uniformly over a 
00008    given 2D domain. The order in which the samples are generated looks random, 
00009    but it is actually quite deterministic and guaranteed to "visit" every 
00010    bucket in the domain.
00011    <!-------------------------------------------------------------------->**/
00012 
00013 #ifndef DISSOLVE_SAMPLE_GENERATOR_H_
00014 #define DISSOLVE_SAMPLE_GENERATOR_H_
00015 
00016 #include <renderers/generators/SampleGenerator.h>
00017 
00018 template <class SG>
00019 class DissolveSG : public SG {
00020    
00021    public:
00022       ///@name Main usage interface
00023       //@{-----------------------------------------------------------------
00024       
00025       virtual void generate(PointSampleList &outSamples, 
00026                             const Viewport &viewport);
00027       
00028       
00029       //@}-----------------------------------------------------------------
00030       
00031    protected:
00032       inline unsigned _getBitWidth(unsigned n) {
00033          unsigned width = 0;
00034          
00035          while(n) {
00036             n >>= 1;
00037             ++width;
00038          }
00039          
00040          return width;
00041       }
00042 };
00043 
00044 #endif // DISSOLVE_SAMPLE_GENERATOR_H_
00045 

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6