Ignore:
Timestamp:
01/29/07 19:00:03 (17 years ago)
Author:
mattausch
Message:

debug version: something wrong with the pvs!

File:
1 edited

Legend:

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

    r2064 r2065  
    742742        vector<int>::const_iterator iit, iit_end = strategies.end(); 
    743743 
     744        cout << "===============================\n" << endl; 
    744745        for (iit = strategies.begin(); iit != iit_end; ++ iit) 
    745746        { 
     
    762763                 << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; 
    763764 
     765        cout << "===============================\n" << endl; 
    764766        return (int)passSamples.size(); 
    765767} 
     
    18101812{ 
    18111813 
    1812         if ((vc->GetPvs().EvalPvsCost() > maxPvsSize) || 
    1813                 (vc->GetPvs().EvalPvsCost() < minPvsSize)) 
    1814         { 
     1814        const float pvsCost = vc->GetPvs().EvalPvsCost(); 
     1815 
     1816        if ((pvsCost > maxPvsSize) || (pvsCost < minPvsSize)) 
     1817        { 
     1818                cout << "err: " << pvsCost << " " << minPvsSize << " " << maxPvsSize << endl; 
    18151819                return false; 
    18161820        } 
     
    26872691                                                                          const bool useHitObjects) 
    26882692{ 
    2689   if (!useHitObjects) { 
    2690         VssRayContainer::const_iterator it, it_end = rays.end(); 
    2691         for (it = rays.begin(); it != it_end; ++ it) { 
    2692           VssRay *vssRay = *it; 
    2693           // set only the termination object 
    2694           vssRay->mTerminationObject = GetIntersectable( 
    2695                                                                                                         *vssRay, 
    2696                                                                                                         true); 
    2697         } 
    2698   } 
     2693        if (!useHitObjects)  
     2694        { 
     2695                VssRayContainer::const_iterator it, it_end = rays.end(); 
     2696         
     2697                for (it = rays.begin(); it != it_end; ++ it)  
     2698                { 
     2699                        VssRay *vssRay = *it; 
     2700                        // set only the termination object 
     2701                        vssRay->mTerminationObject = GetIntersectable( 
     2702                                *vssRay, 
     2703                                true); 
     2704                } 
     2705        } 
    26992706} 
    27002707 
     
    27562763 
    27572764        if (!GetViewSpaceBox().GetRaySegment(hray, tmin, tmax) || (tmin > tmax)) { 
    2758           //      cerr<<"ray outside view space box\n"; 
     2765          // cerr<<"ray outside view space box\n"; 
    27592766          return 0; 
    27602767        } 
     
    27852792        if (storeViewCells) 
    27862793        {        
    2787           cerr<<"Store viewcells should not be used in the test!"<<endl; 
     2794          // cerr << "Store viewcells should not be used in the test!" << endl; 
    27882795          // copy viewcells memory efficiently 
    27892796#if VSS_STORE_VIEWCELLS 
     
    53205327                { 
    53215328                        cout << "exporting view cells after post process ... "; 
     5329 
    53225330                        if (0) 
    53235331                        {       // export view space box 
     
    63066314                        if (!node->IsLeaf()) 
    63076315                        { 
    6308                                 cout << "error, can only do leaves" << endl; 
     6316                                cout << "error, can only process leaves" << endl; 
    63096317                                return 0; 
    63106318                        } 
     
    63726380                const int savedColorCode = mColorCode; 
    63736381 
    6374                 const float maxRenderCost = UpdateObjectCosts(); 
     6382                const float maxRenderCost = -1;//UpdateObjectCosts(); 
    63756383                cout << "maxRenderCost: " << maxRenderCost << endl; 
    63766384                mColorCode = 0; // 0 = random, 1 = export pvs 
    6377  
    6378                 if (0) 
    6379                 mHierarchyManager->ExportObjectSpaceHierarchy(exporter, objects,  
    6380                                                                                                           CLAMP_TO_BOX ? &bbox : NULL, maxRenderCost, false); 
    6381                  
    6382  
    6383                 //ExportViewCellsForViz(exporter, CLAMP_TO_BOX ? &bbox : NULL, mColorCode, GetClipPlane()); 
    6384                 ExportViewCellsForViz(exporter, NULL, mColorCode, GetClipPlane()); 
    6385  
    6386                 delete exporter; 
    6387  
    6388                 cout << "finished in " << TimeDiff(starttime, GetTime()) * 1e-3f << " secs" << endl; 
    6389                 mColorCode = savedColorCode; 
    6390         } 
    6391  
    6392         exporter = Exporter::GetExporter("final_object_partition.wrl"); 
    6393  
    6394         if (exporter) 
    6395         { 
    6396                 if (CLAMP_TO_BOX) 
    6397                 {        
    6398                         exporter->mClampToBox = true;    
    6399                 } 
    6400  
    6401                 EvaluateViewCellsStats(); 
    6402  
    6403                 const long starttime = GetTime(); 
    6404                 cout << "exporting final objects (after initial construction + post process) ... "; 
    6405  
    6406                 // matt: hack for clamping scene 
    6407                 AxisAlignedBox3 bbox = mViewSpaceBox; 
    6408                 bbox.Scale(scale); 
    6409  
    6410                 // hack color code (show pvs size) 
    6411                 const int savedColorCode = mColorCode; 
    6412  
    6413                 mColorCode = 1; // 0 = random, 1 = export pvs 
    6414                 // don't visualize render cost 
    6415                 const float maxRenderCost = -1; 
    64166385 
    64176386                if (1) 
     
    64206389                 
    64216390 
    6422                 //ExportViewCellsForViz(exporter, CLAMP_TO_BOX ? &bbox : NULL, mColorCode, GetClipPlane()); 
    6423                 if (0) 
     6391                if (1) 
     6392                { 
     6393                        //ExportViewCellsForViz(exporter, CLAMP_TO_BOX ? &bbox : NULL, mColorCode, GetClipPlane()); 
    64246394                        ExportViewCellsForViz(exporter, NULL, mColorCode, GetClipPlane()); 
     6395                } 
     6396 
     6397                delete exporter; 
     6398 
     6399                cout << "finished in " << TimeDiff(starttime, GetTime()) * 1e-3f << " secs" << endl; 
     6400                mColorCode = savedColorCode; 
     6401        } 
     6402 
     6403        exporter = Exporter::GetExporter("final_object_partition.wrl"); 
     6404 
     6405        if (exporter) 
     6406        { 
     6407                if (CLAMP_TO_BOX) 
     6408                {        
     6409                        exporter->mClampToBox = true;    
     6410                } 
     6411 
     6412                EvaluateViewCellsStats(); 
     6413 
     6414                const long starttime = GetTime(); 
     6415                cout << "exporting final objects (after initial construction + post process) ... "; 
     6416 
     6417                // matt: hack for clamping scene 
     6418                AxisAlignedBox3 bbox = mViewSpaceBox; 
     6419                bbox.Scale(scale); 
     6420 
     6421                // hack color code (show pvs size) 
     6422                const int savedColorCode = mColorCode; 
     6423 
     6424                mColorCode = 1; // 0 = random, 1 = export pvs 
     6425                // don't visualize render cost 
     6426                const float maxRenderCost = -1; 
     6427 
     6428                if (1) 
     6429                mHierarchyManager->ExportObjectSpaceHierarchy(exporter, objects,  
     6430                                                                                                          CLAMP_TO_BOX ? &bbox : NULL, maxRenderCost, false); 
     6431                 
     6432 
     6433                if (1) 
     6434                { 
     6435                        ExportViewCellsForViz(exporter, NULL, mColorCode, GetClipPlane()); 
     6436                        //ExportViewCellsForViz(exporter, CLAMP_TO_BOX ? &bbox : NULL, mColorCode, GetClipPlane()); 
     6437                } 
    64256438 
    64266439                delete exporter; 
Note: See TracChangeset for help on using the changeset viewer.