Ignore:
Timestamp:
05/12/06 18:36:52 (19 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/scripts/generate_viewcells.env

    r944 r955  
    3030        detectEmptyViewSpace true 
    3131        loadPolygonsAsMeshes false 
     32        applyVisibilityFilter false 
     33        applyVisibilitySpatialFilter false 
    3234} 
    3335 
  • GTP/trunk/Lib/Vis/Preprocessing/scripts/vienna_simple.env

    r942 r955  
    3030        detectEmptyViewSpace true 
    3131        loadPolygonsAsMeshes false 
     32        applyVisibilityFilter false 
     33        applyVisibilitySpatialFilter false 
    3234} 
    3335 
     
    356358                missTolerance           6 
    357359                globalCostMissTolerance 4 
    358                 #minGlobalCostRatio      0.0000001 
    359                 minGlobalCostRatio      0.0001 
     360                minGlobalCostRatio      0.0000001 
     361                #minGlobalCostRatio      0.0001 
    360362                maxViewCells            5000 
    361363         
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp

    r938 r955  
    1313#include <stack> 
    1414 
     15 
     16 
    1517namespace GtpVisibilityPreprocessor { 
     18 
    1619 
    1720 
     
    19441947 
    19451948bool ViewCellsTree::Export(ofstream &stream, const bool exportPvs) 
     1949//bool ViewCellsTree::Export(ogzstream &stream, const bool exportPvs) 
    19461950{ 
    19471951        // export recursivly all view cells from the root 
     
    19801984 
    19811985 
     1986//void ViewCellsTree::ExportPvs(ViewCell *viewCell, ogzstream &stream) 
    19821987void ViewCellsTree::ExportPvs(ViewCell *viewCell, ofstream &stream) 
    19831988{ 
     
    19921997 
    19931998void ViewCellsTree::ExportViewCell(ViewCell *viewCell, ofstream &stream, const bool exportPvs) 
     1999//void ViewCellsTree::ExportViewCell(ViewCell *viewCell, ogzstream &stream, const bool exportPvs) 
    19942000{ 
    19952001        if (viewCell->IsLeaf()) 
     
    20032009                //-- export pvs 
    20042010                if (exportPvs) 
     2011                { 
    20052012                        ExportPvs(viewCell, stream); 
    2006          
     2013                } 
     2014 
    20072015                stream << "\" />" << endl; 
    20082016                //stream << " </Leaf>" << endl; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h

    r938 r955  
    77#include "Statistics.h" 
    88#include "Material.h" 
    9 //namespace GtpVisibilityPreprocessor { 
     9//#include "bzip2stream.hpp" 
     10#include "gzstream.h" 
     11 
     12//class ogzstream; 
    1013 
    1114namespace GtpVisibilityPreprocessor { 
     
    2528class Environment; 
    2629 
     30 
    2731/** Statistics for a view cell partition. 
    2832*/ 
     
    436440        /** Exports view cells to file. 
    437441        */ 
    438     bool Export(ofstream &stream, const bool exportPvs = false); 
     442        bool Export(ofstream &stream, const bool exportPvs = false); 
     443    //bool Export(ogzstream &stream, const bool exportPvs = false); 
    439444 
    440445        /** Export statistics of this view cell tree. 
     
    541546        */ 
    542547        void ExportViewCell(ViewCell *viewCell, ofstream &stream, const bool exportPvs); 
     548        //void ExportViewCell(ViewCell *viewCell, ogzstream &stream, const bool exportPvs); 
    543549 
    544550        /** Exports pvs of a view cell. 
    545551        */ 
    546552        void ExportPvs(ViewCell *viewCell, ofstream &stream); 
     553        //void ExportPvs(ViewCell *viewCell, ogzstream &stream); 
    547554 
    548555 
  • 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 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h

    r944 r955  
    465465        /** Exports bounding boxes as xml stream 
    466466        */ 
    467         bool ExportBoundingBoxes(ofstream &xmlstream, const ObjectContainer &objects) const; 
     467        //bool ExportBoundingBoxes(ofstream &xmlstream, const ObjectContainer &objects) const; 
    468468 
    469469        /** Intersects box with the tree and returns the number of intersected boxes. 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp

    r944 r955  
    755755        const unsigned long startMillis = XMLPlatformUtils::getCurrentMillis(); 
    756756        parser->parse(filename.c_str()); 
     757        //ogzstream stream; parser->parse(stream); 
    757758        const unsigned long endMillis = XMLPlatformUtils::getCurrentMillis(); 
    758759        duration = endMillis - startMillis; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h

    r938 r955  
    88#include "Mesh.h" 
    99#include "BoundingBoxConverter.h" 
     10//#include "gzstream.h" 
    1011 
    1112namespace GtpVisibilityPreprocessor { 
     
    179180  return target; 
    180181} 
    181  
    182182} 
    183183 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp

    r882 r955  
    38463846 
    38473847bool VspBspTree::Export(ofstream &stream) 
     3848//bool VspBspTree::Export(ogzstream &stream) 
    38483849{ 
    38493850        ExportNode(mRoot, stream); 
     
    38543855 
    38553856void VspBspTree::ExportNode(BspNode *node, ofstream &stream) 
     3857//void VspBspTree::ExportNode(BspNode *node, ogzstream &stream) 
    38563858{ 
    38573859        if (node->IsLeaf()) 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h

    r882 r955  
    1010#include "RayInfo.h" 
    1111#include "ViewCellBsp.h" 
     12 
     13 
    1214 
    1315namespace GtpVisibilityPreprocessor { 
     
    325327        /** Writes tree to output stream 
    326328        */ 
     329        //bool Export(ogzstream &stream); 
    327330        bool Export(ofstream &stream); 
    328331 
     
    691694 
    692695        /** Writes the node to disk 
    693                 @note: should be implemented as visitor 
     696                @note: should be implemented as visitor. 
    694697        */ 
    695698        void ExportNode(BspNode *node, ofstream &stream); 
     699        //void ExportNode(BspNode *node, ogzstream &stream); 
    696700 
    697701        /** Returns estimated memory usage of tree. 
Note: See TracChangeset for help on using the changeset viewer.