Changeset 2005


Ignore:
Timestamp:
01/21/07 22:08:23 (17 years ago)
Author:
mattausch
Message:

using large address space

Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
6 edited

Legend:

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

    r2004 r2005  
    475475          
    476476        // assign the objects in sorted order 
    477         if (!TEST_POWERPLANT && mUseGlobalSorting) 
     477        if (mUseGlobalSorting) 
    478478        { 
    479479                AssignSortedObjects(sc, frontData, backData); 
     
    22262226        // create bvh traversal data 
    22272227        BvhTraversalData oData(bvhLeaf, 0, prop, nRays); 
     2228        cout << "here4" << endl; 
    22282229         
    22292230        // create sorted object lists for the first data 
    2230         if (!TEST_POWERPLANT && mUseGlobalSorting) 
     2231        if (mUseGlobalSorting) 
    22312232        { 
    22322233                AssignInitialSortedObjectList(oData, objects); 
    22332234        } 
    22342235         
    2235  
     2236        cout << "here6" << endl; 
    22362237        /////////////////// 
    22372238        //-- add first candidate for object space partition      
     
    22942295        for (int i = 0; i < 3; ++ i) 
    22952296        { 
     2297                cout << "here2 " << endl; 
    22962298                SortableEntryContainer *sortedObjects = new SortableEntryContainer(); 
    22972299 
     
    23142316                delete sortedObjects; 
    23152317        } 
    2316  
     2318cout << "here102" << endl; 
    23172319        // last sorted list: by size 
    23182320        tData.mSortedObjects[3] = new ObjectContainer(); 
     
    23932395        BvhTraversalData oData(bvhLeaf, 0, prop, nRays); 
    23942396 
    2395         if (!TEST_POWERPLANT && mUseGlobalSorting) 
     2397        if (mUseGlobalSorting) 
    23962398                AssignInitialSortedObjectList(oData, objects); 
    23972399         
  • GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp

    r2003 r2005  
    202202                return false; 
    203203 
    204         if (1 && GVS_DEBUG) 
     204        if (0 && GVS_DEBUG) 
    205205                mVssRays.push_back(new VssRay(*vssRay)); 
    206206 
     
    650650        } 
    651651 
    652         //exporter->ExportRays(vcRays, RgbColor(1, 0, 0)); 
    653         //exporter->ExportRays(vcRays2, RgbColor(0, 1, 0)); 
     652        exporter->ExportRays(vcRays, RgbColor(1, 0, 0)); 
     653        exporter->ExportRays(vcRays2, RgbColor(0, 1, 0)); 
    654654        exporter->ExportRays(vcRays3, RgbColor(1, 1, 1)); 
    655655} 
     
    10651065        } 
    10661066 
     1067        cout << "here4 " << mKdTree->GetBox() << endl; 
     1068        cout << "here5 " << mViewCellsManager->GetViewSpaceBox() << endl; 
    10671069        mGvsStats.Stop(); 
    10681070        mGvsStats.Print(mGvsStatsStream); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r2004 r2005  
    253253} 
    254254 
     255#define POWERPLANT_HACK 1 
    255256 
    256257bool Preprocessor::LoadBinaryObj(const string filename, 
     
    279280        samplesIn.read(reinterpret_cast<char *>(&numTriangles), sizeof(int)); 
    280281        root->mGeometry.reserve(numTriangles); 
    281         cout << "reserved " << numTriangles << " triangles " << endl; 
    282         //root->mGeometry.reserve(13000000); 
    283          
    284         cout << "using " << numTriangles * (sizeof(TriangleIntersectable) + sizeof(TriangleIntersectable *)) / (1024 * 1024) << " MBs" << endl; 
    285  
    286         //vector<Triangle3> dummy; 
    287         //cout << "using " << numTriangles * sizeof(Triangle3) / (1024 * 1024) << " MBs" << endl; 
    288         //dummy.reserve(numTriangles); 
     282        cout << "loading " << numTriangles << " triangles ("  
     283                 << numTriangles * (sizeof(TriangleIntersectable) + sizeof(TriangleIntersectable *)) / (1024 * 1024) << " MB)" << endl; 
    289284 
    290285        int i = 0; 
     
    296291                samplesIn.read(reinterpret_cast<char *>(tri.mVertices + 1), sizeof(Vector3)); 
    297292                samplesIn.read(reinterpret_cast<char *>(tri.mVertices + 2), sizeof(Vector3)); 
    298                  
     293 
    299294                // end of file reached 
    300295                if (samplesIn.eof()) 
     
    303298                TriangleIntersectable *obj = new TriangleIntersectable(tri); 
    304299                root->mGeometry.push_back(obj); 
    305                 //dummy.push_back(tri); 
     300                 
    306301                i ++; 
    307302         
    308                 if (i % 500000 == 0) 
    309                         cout << "idx: " << i << endl; 
     303                if (i % 500000 == 499999) 
     304                         cout<<"\r"<<i<<"/"<<numTriangles<<"\r"; 
    310305        } 
    311306         
  • GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj

    r2000 r2005  
    211211                                GenerateDebugInformation="FALSE" 
    212212                                SubSystem="1" 
     213                                LargeAddressAware="2" 
    213214                                OptimizeReferences="2" 
    214215                                EnableCOMDATFolding="2" 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp

    r1999 r2005  
    9595  , mHierarchyManager(NULL) 
    9696  , nViewCells(0) 
     97  , nObjects(0) 
    9798{ 
    9899        std::stable_sort(mObjects->begin(), mObjects->end(), ilt); 
     
    206207        // go one up in the tree 
    207208        if (mCurrentBspNode->GetParent()) 
    208         {       Debug << "]"; 
     209        {       //cout << "]"; 
    209210                mCurrentBspNode = mCurrentBspNode->GetParent(); 
    210211        } 
     
    216217        // go one up in the tree 
    217218        if (mCurrentBvhNode->GetParent()) 
    218         {       Debug << "]"; 
     219        {       //cout << "]"; 
    219220                mCurrentBvhNode = mCurrentBvhNode->GetParent(); 
    220221        } 
     
    226227        // go one up in the tree 
    227228        if (mCurrentOspNode->mParent) 
    228         {       Debug << "]"; 
     229        {        
     230                //cout << "]"; 
    229231                mCurrentOspNode = mCurrentOspNode->mParent; 
    230232        } 
     
    236238        // go one up in the tree 
    237239        if (mCurrentVspNode->GetParent()) 
    238         {       Debug << "]"; 
     240        {        
     241                //cout << "]"; 
    239242                mCurrentVspNode = mCurrentVspNode->GetParent(); 
    240243        } 
     
    246249        // go one up in the tree 
    247250        if (mCurrentViewCell->GetParent()) 
    248         {       Debug << "]"; 
     251        {        
     252                //cout << "]"; 
    249253                mCurrentViewCell = mCurrentViewCell->GetParent(); 
    250254        } 
     
    289293        if (element == "Interior")  
    290294        { 
    291                 Debug << "["; 
     295                //cout << "["; 
    292296                StartBspInterior(attributes); 
    293297        } 
     
    295299        if (element == "Leaf")  
    296300        { 
    297                 Debug << "l"; 
     301                //cout << "l"; 
    298302                StartBspLeaf(attributes); 
    299303        } 
     
    306310        if (element == "Interior")  
    307311        { 
    308                 Debug << "["; 
     312                //cout << "["; 
    309313                StartVspInterior(attributes); 
    310314        } 
    311315        if (element == "Leaf")  
    312316        { 
    313                 Debug << "l"; 
     317                //cout << "l"; 
    314318                StartVspLeaf(attributes); 
    315319        } 
     
    322326        if (element == "Interior")  
    323327        { 
    324                 Debug << "["; 
     328                //cout << "["; 
    325329                StartOspInterior(attributes); 
    326330        } 
     
    328332        if (element == "Leaf")  
    329333        { 
    330                 Debug << "l"; 
     334                //cout << "l"; 
    331335                StartOspLeaf(attributes); 
    332336        } 
     
    339343        if (element == "Interior")  
    340344        { 
    341                 Debug << "["; 
     345                //cout << "["; 
    342346                StartBvhInterior(attributes); 
    343347        } 
     
    345349        if (element == "Leaf")  
    346350        { 
    347                 Debug << "l"; 
     351                //cout << "l"; 
    348352                StartBvhLeaf(attributes); 
    349353        } 
     
    392396                                                                                                                   AttributeList& attributes) 
    393397{ 
    394         if (((nViewCells ++) % 1000) == 0) 
    395                 Debug << "\n " << nViewCells << " view cells parsed" << endl; 
    396398        // interiors + leaves interpreted view cells else 
    397399        if (element == "Interior")  
    398400        { 
    399                 Debug << "["; 
     401                //cout << "["; 
    400402                StartViewCell(attributes, false); 
    401403        } 
     
    403405        if (element == "Leaf")  
    404406        { 
    405                 Debug << "l"; 
     407                //cout << "l"; 
    406408                StartViewCell(attributes, true); 
    407409        } 
     
    417419        if (element == "ViewCells") 
    418420        { 
    419           Debug << "\nparsing view cells" << endl; 
     421                cout << "\nparsing view cells" << endl; 
    420422                 
    421423                mCurrentState = PARSE_VIEWCELLS; 
     
    428430        if (element == "ViewSpaceHierarchy") 
    429431        {                
    430                 Debug << "\nparsing view space hierarchy" << endl; 
     432                cout << "\nparsing view space hierarchy" << endl; 
    431433                mCurrentState = PARSE_VIEWSPACE_HIERARCHY; 
    432434                StartViewSpaceHierarchy(attributes); 
     
    436438        if (element == "ObjectSpaceHierarchy") 
    437439        { 
    438                 Debug << "\nparsing object space hierarchy" << endl; 
     440                cout << "\nparsing object space hierarchy" << endl; 
    439441                mCurrentState = PARSE_OBJECTSPACE_HIERARCHY; 
    440442                StartObjectSpaceHierarchy(attributes); 
     
    444446        if (element == "BoundingBox") 
    445447        { 
    446           //            Debug << "b"; 
     448                // cout << "b"; 
    447449                StartBoundingBox(attributes); 
    448450        } 
     
    452454        { 
    453455        case PARSE_VIEWSPACE_HIERARCHY: 
     456                if ((++ nViewCells % 1000) == 0) 
     457                        cout<<"\r"<<nViewCells<<" view cells parsed\r"; 
     458                 
    454459                StartViewSpaceHierarchyElement(element, attributes); 
    455460                break; 
    456461        case PARSE_OBJECTSPACE_HIERARCHY: 
     462                if ((++ nObjects % 1000) == 0) 
     463                 cout<<"\r"<< nObjects <<" objects parsed\r"; 
     464                 
    457465                StartObjectSpaceHierarchyElement(element, attributes); 
    458466                break; 
     
    703711                else 
    704712                { 
    705                         Debug << "error: view cell does not exist" << endl; 
     713                        cerr << "error: view cell does not exist" << endl; 
    706714                } 
    707715        } 
     
    882890                ViewCellContainer::iterator vit, vit_end = mViewCells.end(); 
    883891 
    884                 Debug << "exchanging boxes" << endl; 
    885892                int i = 0; 
    886893                // remove view cells and exchange them with the  
     
    888895                for (vit = mViewCells.begin(); vit != vit_end; ++ vit, ++ i) 
    889896                { 
    890                         if ((i % 1000) == 0) 
    891                                 Debug << "\n exchanged " << i << " boxes" << endl; 
     897                        //if ((i % 1000) == 0) 
     898                        //      Debug << "\n exchanged " << i << " boxes" << endl; 
    892899                        ViewCell *vc = (*vit); 
    893900 
     
    916923                        (*vit) = bspVc; 
    917924                } 
    918                 Debug << "finished" << endl; 
     925                cout << "finished creating view space hierarchy" << endl; 
    919926        } 
    920927        else if (mViewSpaceHierarchyType == VSP)  
     
    12791286                else 
    12801287                { 
    1281                         Debug << "error: object with id " << objId << " does not exist" << endl; 
     1288                        cerr << "error: object with id " << objId << " does not exist" << endl; 
    12821289                } 
    12831290        } 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h

    r1999 r2005  
    120120  int mObjectSpaceHierarchyType; 
    121121int nViewCells; 
     122int nObjects; 
    122123  //////////////////////////////// 
    123124 
Note: See TracChangeset for help on using the changeset viewer.