Ignore:
Timestamp:
02/15/07 14:45:30 (17 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
10 edited

Legend:

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

    r2115 r2119  
    365365{ 
    366366        friend class ViewCellsParseHandlers; 
     367        friend class ObjectsParseHandlers; 
    367368        friend class HierarchyManager; 
    368369 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ObjParser.cpp

    r2042 r2119  
    236236 
    237237        while (fgets(str, 1000, file) != NULL) 
    238         {++ line; 
     238        { 
     239                ++ line; 
    239240          switch (str[0])  
    240241                { 
    241242                case 'v': // vertex  or normal 
    242243                  { 
    243                         switch (str[1]) { 
     244                        switch (str[1])  
     245                        { 
    244246                        case 'n' : 
    245                           // normal do nothing 
    246                           break; 
     247                                // normal do nothing 
     248                                break; 
    247249                        default: 
    248                           float x, y, z; //cout << "v";  
    249                           sscanf(str + 1, "%f %f %f", &x, &y, &z); 
    250                           vertices.push_back(Vector3(x,y,z)); 
    251                           //cout << "vertex: " << vertices.back() << endl; 
     250                                float x, y, z; //cout << "v";    
     251                                sscanf(str + 1, "%f %f %f", &x, &y, &z); 
     252                                vertices.push_back(Vector3(x,y,z)); 
     253                          
    252254                        } 
    253255                        break; 
     
    258260                                { 
    259261                                        Face *face = LoadFace(str, vertices, hashTable); 
     262 
    260263                                        if (!face) break; 
    261264         
  • GTP/trunk/Lib/Vis/Preprocessing/src/ObjectsParser.cpp

    r2115 r2119  
    8888        //if (!is_sorted(mPvsObjects.begin(), mPvsObjects.end(), ilt)) 
    8989                sort(mPvsObjects.begin(), mPvsObjects.end(), ilt); 
    90  
     90Debug << "here333"; 
    9191        //if (!is_sorted(mPreprocessorObjects.begin(), mPreprocessorObjects.end(), ilt)) 
    9292                //sort(mPreprocessorObjects.begin(), mPreprocessorObjects.end(), ilt); 
     
    133133        if (element == "Leaf")  
    134134        { 
    135                 //cout << "l"; 
    136135                StartBvhLeaf(attributes); 
    137136        } 
     
    196195} 
    197196 
     197 
    198198void ObjectsParseHandlers::StartBvhLeaf(AttributeList& attributes) 
    199199{ 
     
    217217                        sscanf(ptr, "%f %f %f", &maxBox.x, &maxBox.y, &maxBox.z); 
    218218                } 
    219                 /*if (attrName == "objects") 
     219                if (attrName == "objects") 
    220220                { 
    221221                        StartBvhLeafObjects(objects, ptr); 
    222                 }*/ 
     222                } 
    223223        } 
    224224 
     
    227227        BvhLeaf *leaf = new BvhLeaf(box, NULL, (int)objects.size()); 
    228228 
    229         //leaf->mObjects = objects; 
    230         //BvHierarchy::AssociateObjectsWithLeaf(leaf); 
     229        leaf->mObjects = objects; 
     230        BvHierarchy::AssociateObjectsWithLeaf(leaf); 
    231231 
    232232        // new pvs object 
     
    370370 
    371371                        GzFileInputSource isource(myFilePath); 
     372                        Debug<<"here93" << endl; 
    372373                        parser->parse(isource); 
    373374#else 
     
    375376 
    376377#endif 
    377  
     378Debug<<"here932" << endl; 
    378379                        const unsigned long endMillis = XMLPlatformUtils::getCurrentMillis(); 
    379380                        duration = endMillis - startMillis; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ObjectsParser.h

    r2115 r2119  
    1515{ 
    1616public: 
    17   ObjectsParser(): Parser() {} 
     17         
     18        ObjectsParser(): Parser() {} 
    1819   
    19   bool ParseObjects(const string &filename,  
    20                                         ObjectContainer &pvsObjects, 
    21                                         const ObjectContainer &preprocessorObjects); 
     20        bool ParseObjects(const string &filename,  
     21                                          ObjectContainer &pvsObjects, 
     22                                          const ObjectContainer &preprocessorObjects); 
    2223}; 
    2324 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ObjectsParserXerces.h

    r2115 r2119  
    2525{ 
    2626public: 
     27 
     28        friend class BvHierarchy; 
    2729 
    2830        // ----------------------------------------------------------------------- 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r2117 r2119  
    479479        const int files = SplitFilenames(filename, filenames); 
    480480        cout << "number of input files: " << files << endl; 
     481 
    481482        bool result = false; 
    482483        bool isObj = false; 
     
    533534                 
    534535                                result = parser->ParseFile(filename,  
    535                                                                    mSceneGraph->GetRoot(), 
    536                                                                    mLoadMeshes, 
    537                                                                    fi); 
    538                                                  
     536                                                                                   mSceneGraph->GetRoot(), 
     537                                                                                   mLoadMeshes, 
     538                                                                                   fi); 
     539 
    539540                                cout << "loaded " << (int)mSceneGraph->GetRoot()->mGeometry.size() << " entities" << endl; 
     541 
    540542                                // only works for triangles 
    541543                                if (result && !mLoadMeshes) 
    542544                                { 
    543545                                        cout << "exporting binary obj to " << bnFile << "... " << endl; 
     546 
    544547                                        ExportBinaryObj(bnFile, mSceneGraph->GetRoot()); 
     548                                 
    545549                                        cout << "finished" << endl; 
    546550                                } 
    547551 
    548552                                delete parser; 
    549                         } 
    550                         else if (0) 
    551                         { 
    552                                 ExportBinaryObj("../data/test.bn", mSceneGraph->GetRoot()); 
    553553                        } 
    554554                } 
     
    741741 
    742742        Environment::GetSingleton()->GetStringValue("ViewCells.filename", buf); 
    743                  
    744743                cout << "loading objects from " << buf << endl; 
    745744 
    746745                // load objects which will be used as pvs entries 
    747746                ObjectContainer pvsObjects; 
    748  
    749                 LoadObjects(buf, pvsObjects, mObjects); 
     747                if (0) LoadObjects(buf, pvsObjects, mObjects); 
    750748 
    751749                cout << "loading view cells from " << buf << endl; 
     
    16491647{ 
    16501648        ObjectsParser parser; 
    1651  
     1649Debug << "here322 " << filename << endl; 
    16521650        const bool success = parser.ParseObjects(filename,  
    16531651                                                                                         pvsObjects,  
  • GTP/trunk/Lib/Vis/Preprocessing/src/PreprocessorFactory.cpp

    r1942 r2119  
    1414Preprocessor *PreprocessorFactory::CreatePreprocessor(const string &preprocessorType) 
    1515{ 
     16        Debug << "here9191" << endl; 
    1617        if (preprocessorType == "vss") 
    17         { 
     18        {Debug << "here21112" << endl; 
    1819                return new VssPreprocessor(); 
    1920        } 
  • GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.cpp

    r2105 r2119  
    22642264   
    22652265  int startIndex = (int)rays.size(); 
    2266   //  Debug<<"B"<<flush; 
    2267    
     2266     
    22682267  AxisAlignedBox3 box = GetBBox(leaf); 
    22692268  AxisAlignedBox3 dirBox = GetDirBBox(leaf); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r2117 r2119  
    26092609        } 
    26102610#else 
    2611         cout<<"b"; 
    26122611        pvs.AddSample(obj, pdf); 
    26132612#endif 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp

    r2115 r2119  
    464464        if (element == "BoundingBox") 
    465465        { 
    466                 // cout << "b"; 
    467466                StartBoundingBox(attributes); 
    468467        } 
Note: See TracChangeset for help on using the changeset viewer.