Ignore:
Timestamp:
01/15/08 14:54:09 (16 years ago)
Author:
mattausch
Message:

checking for null termination object (q: why does this happen?)

File:
1 edited

Legend:

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

    r2544 r2597  
    334334{ 
    335335        Intersectable *tObj = currentRay.mTerminationObject; 
     336        // q matt: can this be possible 
     337        if (!tObj) return 0; 
     338 
    336339        Triangle3 hitTriangle; 
    337340 
    338341        // other types not implemented yet 
    339342        if (tObj->Type() == Intersectable::TRIANGLE_INTERSECTABLE) 
    340         { 
    341343                hitTriangle = static_cast<TriangleIntersectable *>(tObj)->GetItem(); 
    342         } 
    343344        else 
    344         { 
    345345                cout << "border sampling: " << tObj->Type() << " not yet implemented" << endl; 
    346         } 
    347346 
    348347        VertexContainer enlargedTriangle; 
     
    407406 
    408407        VssRayContainer invalidSamples; 
     408 
    409409 
    410410        // handle rays 
     
    581581 
    582582        //CLEAR_CONTAINER(invalidSamples); 
    583         //Debug << "generated " <<  numSamples << " samples in " << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; 
     583        Debug << "generated " <<  numSamples << " samples in " << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; 
    584584        return (int)simpleRays.size(); 
    585585} 
     
    609609        while (!mRayQueue.empty())//&& (mGvsStats.mTotalSamples + castSamples < mTotalSamples) ) 
    610610        { 
     611                //cout << "queue size: " << mRayQueue.size() << endl; 
    611612                // handle next ray 
    612613                VssRay *ray = mRayQueue.top(); 
     
    616617 
    617618                castSamples += newSamples; 
    618  
    619619                //delete ray; 
    620620        } 
    621621 
    622         // HACK 
    623622        /*if (mRayCaster->mVssRayPool.mIndex > mSamplesPerPass) 
    624623        { 
     
    692691        ExportVssRays(exporter, mVssRays); 
    693692 
     693 
    694694        ///////////////// 
    695695        //-- export view cell geometry 
    696696 
    697         exporter->SetWireframe(); 
     697        //exporter->SetWireframe(); 
    698698 
    699699        m.mDiffuseColor = RgbColor(0, 1, 0); 
     
    742742void GvsPreprocessor::ProcessViewCell() 
    743743{ 
    744         //Intersectable::NewMail(); 
    745  
    746         // compute direct intersections with view cell 
     744        // compute object that directly intersect view cell 
    747745        IntersectWithViewCell(); 
    748746 
     
    751749        int passSamples = 0; 
    752750 
     751        //if (mCurrentViewCell->GetId() != 82975 )return; 
     752 
    753753        //while (mGvsStats.mPerViewCellSamples < mTotalSamples)  
    754754        while (1)  
     
    762762                if (!mOnlyRandomSampling) 
    763763                        newSamples += ProcessQueue(); 
    764  
     764                 
    765765                passSamples += newSamples; 
    766                 mGvsStats.mPerViewCellSamples += newSamples; 
    767                  
     766        mGvsStats.mPerViewCellSamples += newSamples; 
     767 
    768768                if (passSamples >= mGvsSamplesPerPass) 
    769769                { 
     
    781781                        // termination criterium 
    782782                        if (mGvsStats.mPassContribution < mMinContribution) 
    783                         { 
    784783                                break; 
    785                         } 
    786784 
    787785                        // reset 
     
    800798         
    801799        int i = 0; 
     800 
    802801        if (!vcPoints->empty()) 
    803802        { 
    804                 cout << "loading view cell list" << endl; 
     803                cout << "processing view cell list" << endl; 
    805804                 
    806805                vector<ViewCellPoints *>::const_iterator vit, vit_end = vcPoints->end(); 
     
    837836                                break; 
    838837                        } 
    839 //if (viewCell->GetId() == 36658) 
    840 //{ 
     838 
    841839                        mViewCells.push_back(viewCell); 
    842 //                      return; 
    843 //} 
    844840                } 
    845841 
     
    11281124        if (mPerViewCell) 
    11291125        { 
    1130                 // list of view cells to compute 
     1126                // provide list of view cells to compute 
    11311127                CompileViewCellsList(); 
     1128 
     1129                // start per view cell gvs 
    11321130                PerViewCellComputation(); 
    11331131 
Note: See TracChangeset for help on using the changeset viewer.