Ignore:
Timestamp:
09/22/06 16:31:02 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.h

    r1460 r1473  
    33 
    44#include <fstream> 
     5#include <stack> 
    56using namespace std; 
    67 
     
    1011 
    1112class Exporter; 
     13class VssRay; 
    1214 
    13 /** Sampling based visibility preprocessing. The implementation is based on heuristical 
    14     sampling of view space */ 
     15 
     16typedef stack<VssRay *> RayQueue; 
     17 
     18/** Sampling based visibility preprocessing. The implementation is  
     19        based on heuristical sampling of view space. 
     20*/ 
    1521class GvsPreprocessor : public Preprocessor { 
    1622 
    1723public: 
    18   int mSamples; 
    19    
    20   GvsPreprocessor(); 
    21   ~GvsPreprocessor() {} 
    22    
    23   virtual bool ComputeVisibility(); 
    24    
    25    
     24 
     25        GvsPreprocessor(); 
     26        ~GvsPreprocessor() {} 
     27 
     28        virtual bool ComputeVisibility(); 
     29         
     30 
    2631protected: 
    27   ofstream mStats; 
    28    
     32 
     33        /** Runs the adaptive sampling. The method starts with a number of random rays given 
     34                by the queue and continues as long it finds new visible geometry (i.e., the queue is 
     35                not empty). 
     36 
     37                @returns the number of samples cast. 
     38        */ 
     39        int RunSampling(); 
     40 
     41        /** One pass of the sampling preprocessor. Continues as long as at least passSample 
     42                rays have been cast. 
     43                @returns the number of samples cast. 
     44        */ 
     45        int Pass(const int passSamples); 
     46 
     47        /** Generates the rays starting the adaptive visibility sampling process. 
     48        */ 
     49        int CastAvsSamples( 
     50                const int samplesPerPass,  
     51                const int sampleType,  
     52                RayQueue &passSamples); 
     53 
     54        /** Uses the information gained from the ray for doing adaptive border sampling. 
     55                This function tries to find the border of the triangle found visible by the 
     56                current ray. New rays are generated which sample this border. 
     57                 
     58                We use the following strategies: 
     59 
     60                a) if new triangle was found: adaptive border sampling 
     61                b) if triangle was found reverse sampling 
     62        */ 
     63        int HandleRay(VssRay &ray); 
     64 
     65        /**  
     66        */       
     67        int AdaptiveBorderSampling(VssRay &ray); 
     68         
     69        int ReverseSampling(VssRay &ray); 
     70 
     71        /** Cast samples according to a specific sampling strategy. 
     72        */ 
     73        int CastPassSamples( 
     74                const int samplesPerPass,  
     75                const int sampleType,  
     76                VssRayContainer &passSamples) const; 
     77 
     78 
     79 
     80        ////////////////////// 
     81 
     82        ofstream mStats; 
     83        int mSamples; 
     84        int mSamplesPerPass; 
     85        RayQueue mRayQueue;  
     86        int mSamplingType; 
     87        int mTotalSamples; 
    2988}; 
    3089 
Note: See TracChangeset for help on using the changeset viewer.