Ignore:
Timestamp:
01/11/07 04:18:36 (18 years ago)
Author:
mattausch
Message:

early exit for global lines
preprocessor support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r1966 r1968  
    2121#include "IntelRayCaster.h" 
    2222#include "InternalRayCaster.h" 
    23  
     23#include "GlobalLinesRenderer.h" 
    2424 
    2525 
     
    134134mRayCaster(NULL), 
    135135mStopComputation(false), 
    136 mThread(NULL) 
     136mThread(NULL), 
     137mGlobalLinesRenderer(NULL) 
    137138{ 
    138139        Environment::GetSingleton()->GetBoolValue("Preprocessor.useGlRenderer", mUseGlRenderer); 
     
    174175                                                                                         mSamplesPerEvaluation); 
    175176 
    176          
    177177        Debug << "******* Preprocessor Options **********" << endl; 
    178178        Debug << "detect empty view space=" << mDetectEmptyViewSpace << endl; 
     
    211211        DEL_PTR(renderer); 
    212212        DEL_PTR(mRayCaster); 
     213 
     214        DEL_PTR(mGlobalLinesRenderer); 
    213215} 
    214216 
     
    10741076 
    10751077 
    1076 bool Preprocessor::InitRayCast(const string externKdTree, const string internKdTree) 
     1078bool Preprocessor::InitRayCast(const string externKdTree,  
     1079                                                           const string internKdTree) 
    10771080{ 
    10781081        // always try to load the kd tree 
     
    10811084        if (!LoadKdTree(internKdTree)) 
    10821085        { 
    1083                 cout << "error loading kd tree with filename " << internKdTree << ", rebuilding it instead ... " << endl; 
     1086                cout << "error loading kd tree with filename "  
     1087                         << internKdTree << ", rebuilding it instead ... " << endl; 
    10841088                // build new kd tree from scene geometry 
    10851089                BuildKdTree(); 
     
    10911095                if (!ExportKdTree(internKdTree)) 
    10921096                { 
    1093                         cout << " error exporting kd tree with filename " << internKdTree << endl; 
     1097                        cout << " error exporting kd tree with filename "  
     1098                                 << internKdTree << endl; 
    10941099                } 
    10951100                else 
    10961101                { 
    1097                         cout << "finished in " << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; 
     1102                        cout << "finished in "  
     1103                                 << TimeDiff(startTime, GetTime()) * 1e-3  
     1104                                 << " secs" << endl; 
    10981105                } 
    10991106        } 
     
    11141121 
    11151122        int rayCastMethod; 
    1116         Environment::GetSingleton()->GetIntValue("Preprocessor.rayCastMethod", rayCastMethod); 
     1123        Environment::GetSingleton()-> 
     1124                GetIntValue("Preprocessor.rayCastMethod", rayCastMethod); 
    11171125 
    11181126        if (rayCastMethod == 0) 
     
    11451153        for (int i = 0; i < (int)rays.size();) 
    11461154        { 
     1155                // HACK: does not really go together with the 16 ray bundles 
     1156                if (rays[i].mDistribution == SamplingStrategy::HW_GLOBAL_LINES_DISTRIBUTION) 
     1157                { 
     1158                        mGlobalLinesRenderer->CastGlobalLines(rays[i], vssRays); 
     1159                        i ++; 
     1160                        continue; 
     1161                } 
     1162 
    11471163                if (i + 16 < (int)rays.size())  
    11481164                { 
     
    11731189        if (rays.size() > 10000)  
    11741190        { 
    1175           cout<<endl; 
    1176          
    1177         long t2 = GetTime(); 
     1191                cout << endl; 
     1192 
     1193                long t2 = GetTime(); 
    11781194 
    11791195#if SHOW_RAYCAST_TIMING 
    1180         if (castDoubleRays) 
    1181                 cout << 2 * rays.size() / (1e3f * TimeDiff(t1, t2)) << "M rays/s" << endl; 
    1182         else 
    1183                 cout << rays.size() / (1e3f * TimeDiff(t1, t2)) << "M rays/s" << endl; 
     1196                if (castDoubleRays) 
     1197            cout << 2 * rays.size() / (1e3f * TimeDiff(t1, t2)) << "M rays/s" << endl; 
     1198                else 
     1199                        cout << rays.size() / (1e3f * TimeDiff(t1, t2)) << "M rays/s" << endl; 
    11841200#endif 
    11851201        } 
     
    12301246        ray.Init(point, direction, Ray::LOCAL_RAY);      
    12311247} 
     1248 
    12321249 
    12331250void Preprocessor::EvalViewCellHistogram() 
     
    13261343} 
    13271344 
    1328 } 
     1345 
     1346void Preprocessor::PrepareHwGlobalLines() 
     1347{ 
     1348        int texHeight, texWidth; 
     1349        float eps; 
     1350        int maxDepth; 
     1351        bool sampleReverse; 
     1352 
     1353        Environment::GetSingleton()->GetIntValue("Preprocessor.HwGlobalLines.texHeight", texHeight); 
     1354        Environment::GetSingleton()->GetIntValue("Preprocessor.HwGlobalLines.texHeight", texWidth); 
     1355        Environment::GetSingleton()->GetFloatValue("Preprocessor.HwGlobalLines.stepSize", eps); 
     1356        Environment::GetSingleton()->GetIntValue("Preprocessor.HwGlobalLines.maxDepth", maxDepth); 
     1357        Environment::GetSingleton()->GetBoolValue("Preprocessor.HwGlobalLines.sampleReverse", sampleReverse); 
     1358 
     1359        mGlobalLinesRenderer =  
     1360                new GlobalLinesRenderer(this, 
     1361                                                                texHeight, 
     1362                                                                texWidth, 
     1363                                                                eps, 
     1364                                                                maxDepth, 
     1365                                                                sampleReverse); 
     1366 
     1367        mGlobalLinesRenderer->InitGl(); 
     1368} 
     1369 
     1370} 
Note: See TracChangeset for help on using the changeset viewer.