Ignore:
Timestamp:
05/12/06 18:36:52 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r944 r955  
    1818 
    1919 
     20 
     21 
    2022namespace GtpVisibilityPreprocessor { 
    2123 
     
    508510        PostProcess(preprocessor->mObjects, postProcessSamples); 
    509511 
    510         cout << "time needed for  post processing (merge) step: " 
     512        cout << "time needed for post processing (merge) step: " 
    511513                 << TimeDiff(startTime, GetTime()) *1e-3 << " secs" << endl; 
    512514 
    513         Debug << "time needed for  post processing (merge) step: " 
     515        Debug << "time needed for post processing (merge) step: " 
    514516                 << TimeDiff(startTime, GetTime()) *1e-3 << " secs" << endl; 
    515517 
     
    20372039 
    20382040 
    2039 bool ViewCellsManager::ExportBoundingBoxes(ofstream &xmlstream,  
    2040                                                                                    const ObjectContainer &objects) const 
    2041 { 
    2042         //-- export the view cells and the pvs 
    2043         xmlstream << "<BoundingBoxes>" << endl; 
    2044  
    2045         ObjectContainer::const_iterator oit, oit_end = objects.end(); 
    2046  
    2047         for (oit = objects.begin(); oit != oit_end; ++ oit) 
    2048         { 
    2049                         MeshInstance *mi = dynamic_cast<MeshInstance *>(*oit); 
    2050                         const AxisAlignedBox3 box = mi->GetBox(); 
    2051  
    2052                         //-- the bounding boxes 
    2053                         xmlstream << "<BoundingBox" << " id=\"" << mi->GetId() << "\"" 
    2054                                       << " min=\"" << box.Min().x << " " << box.Min().y << " " << box.Min().z << "\"" 
    2055                                           << " max=\"" << box.Max().x << " " << box.Max().y << " " << box.Max().z << "\" />" << endl; 
    2056         } 
    2057  
    2058         xmlstream << "</BoundingBoxes>" << endl; 
    2059  
    2060         return true; 
    2061 } 
    2062  
    2063  
    20642041/**********************************************************************/ 
    20652042/*                 BspViewCellsManager implementation                 */ 
     
    27722749bool BspViewCellsManager::ExportViewCells(const string filename, const bool exportPvs, const ObjectContainer &objects) 
    27732750{ 
     2751#if STILL_HAS_TODO 
    27742752        cout << "exporting view cells to xml ... "; 
    27752753        std::ofstream stream; 
     
    28092787 
    28102788        cout << "finished" << endl; 
    2811  
     2789#endif 
    28122790        return true; 
    28132791} 
     
    47734751{ 
    47744752        cout << "exporting view cells to xml ... "; 
    4775         std::ofstream stream; 
     4753         
     4754        //ogzstream stream(filename.c_str()); 
     4755        std::ofstream stream(filename.c_str()); 
    47764756 
    47774757        // for output we need unique ids for each view cell 
    47784758        CreateUniqueViewCellIds(); 
    47794759 
    4780         stream.open(filename.c_str()); 
    47814760        stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"<<endl; 
    47824761        stream << "<Visibility_Solution>" << endl; 
     
    47874766                   << " max=\"" << mViewSpaceBox.Max().x << " " << mViewSpaceBox.Max().y << " " << mViewSpaceBox.Max().z << "\" />" << endl; 
    47884767 
    4789         ExportBoundingBoxes(stream, objects); 
    4790  
    4791         //-- the type of the view cells hierarchy 
    4792         stream << "<Hierarchy name=\"vspBspTree\" />" << endl; 
     4768         
     4769        //-- export bounding boxes 
     4770        stream << "<BoundingBoxes>" << endl; 
     4771 
     4772        ObjectContainer::const_iterator oit, oit_end = objects.end(); 
     4773 
     4774        for (oit = objects.begin(); oit != oit_end; ++ oit) 
     4775        { 
     4776                        MeshInstance *mi = dynamic_cast<MeshInstance *>(*oit); 
     4777                        const AxisAlignedBox3 box = mi->GetBox(); 
     4778 
     4779                        //-- the bounding boxes 
     4780                        stream << "<BoundingBox" << " id=\"" << mi->GetId() << "\"" 
     4781                                   << " min=\"" << box.Min().x << " " << box.Min().y << " " << box.Min().z << "\"" 
     4782                                   << " max=\"" << box.Max().x << " " << box.Max().y << " " << box.Max().z << "\" />" << endl; 
     4783        } 
     4784 
     4785        stream << "</BoundingBoxes>" << endl; 
     4786 
    47934787 
    47944788        //-- export the view cells and the pvs 
    47954789        const int numViewCells = mCurrentViewCellsStats.viewCells; 
    47964790 
    4797         stream << "<ViewCells number=\"" << numViewCells << "\" />" << endl; 
     4791        stream << "<ViewCells number=\"" << numViewCells << "\" >" << endl; 
    47984792         
    47994793        mViewCellsTree->Export(stream, exportPvs); 
     
    48034797 
    48044798        //-- export the spatial hierarchy 
    4805         stream << "<Hierarchy>" << endl; 
     4799         
     4800        // the type of the view cells hierarchy 
     4801        stream << "<Hierarchy name=\"vspBspTree\" />" << endl; 
    48064802        mVspBspTree->Export(stream); 
    48074803        stream << endl << "</Hierarchy>" << endl; 
     
    48104806 
    48114807        stream << "</Visibility_Solution>" << endl; 
     4808 
     4809 
    48124810        stream.close(); 
    4813  
    48144811        cout << "finished" << endl; 
    48154812 
Note: See TracChangeset for help on using the changeset viewer.