Changeset 292 for trunk


Ignore:
Timestamp:
09/19/05 19:04:55 (19 years ago)
Author:
mattausch
Message:
 
Location:
trunk/VUT/GtpVisibilityPreprocessor
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env

    r289 r292  
    6666BspTree { 
    6767#       splitPlaneStrategy leastSplits 
    68 #       splitPlaneStrategy balancedTree 
     68        splitPlaneStrategy balancedTree 
    6969#       splitPlaneStrategy nextPolygon 
    70         splitPlaneStrategy combined 
     70#       splitPlaneStrategy combined 
    7171#       constructionMethod rays 
    7272        constructionMethod viewCells 
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp

    r291 r292  
    603603 
    604604                        //leaf->mViewCellIdx = counter; 
    605                         Debug << "insert view cell" << endl; 
     605                        Debug << "insert view cell " << tData.mViewCell << endl; 
    606606 
    607607                        leaf->SetViewCell(dynamic_cast<ViewCell *>(tData.mViewCell)); 
     
    629629        if ((backPolys->size() == 0) && (coincident.size() > 1))  
    630630        { 
    631                 Debug << "WARNING: size " << coincident.size() << " at depth " << tData.mDepth << ", #back polys: " << (int)backPolys->size() << ", #front polys: " << (int)frontPolys->size() << endl; 
     631                Debug << "WARNING: size " << (int)coincident.size() << " at depth " << tData.mDepth << ", #back polys: " << (int)backPolys->size() << ", #front polys: " << (int)frontPolys->size() << endl; 
    632632                for (int i=0; i<coincident.size(); ++i) 
    633                         Debug << "coincident " << i << " vc " << *coincident[i]->mParent << endl; 
     633                        Debug << "coincident poly " << i << ", vc: " << coincident[i]->mParent << "\n" << *coincident[i] << endl; 
    634634        } 
    635635        //Debug << "coincident size: " << coincident.size() << endl; 
  • trunk/VUT/GtpVisibilityPreprocessor/src/X3dExporter.cpp

    r289 r292  
    88#include "ViewCell.h" 
    99#include "Polygon3.h" 
    10  
     10ViewCellContainer X3dExporter::foundViewCells; // TODO: delete later 
    1111 
    1212X3dExporter::X3dExporter(const string filename):Exporter(filename) 
     
    395395                SetFilled(); 
    396396 
    397         ViewCellContainer mFoundViewCells; 
     397        //ViewCellContainer foundViewCells; 
    398398 
    399399        if (tree.StorePolys()) 
     
    436436                                ViewCell *viewCell = dynamic_cast<BspLeaf *>(node)->GetViewCell(); 
    437437                                if (viewCell) 
    438                                         mFoundViewCells.push_back(viewCell); 
     438                                        foundViewCells.push_back(viewCell); 
    439439                        } 
    440440                        else 
     
    447447                } 
    448448 
    449                 Debug << "Number of view cells with dublicates: " << (int)mFoundViewCells.size() << endl; 
     449                Debug << "Number of view cells with dublicates: " << (int)foundViewCells.size() << endl; 
    450450 
    451451        //-- erase dublicates 
    452                 sort(mFoundViewCells.begin(), mFoundViewCells.end()); 
    453                 ViewCellContainer::iterator new_end = unique(mFoundViewCells.begin(), mFoundViewCells.end()); 
    454                 mFoundViewCells.erase(new_end, mFoundViewCells.end()); 
    455                 ExportViewCells(&mFoundViewCells); 
    456  
    457                 Debug << "Number of view cells after erasing dublicates: " << (int)mFoundViewCells.size() << endl; 
     452                sort(foundViewCells.begin(), foundViewCells.end()); 
     453                ViewCellContainer::iterator new_end = unique(foundViewCells.begin(), foundViewCells.end()); 
     454                foundViewCells.erase(new_end, foundViewCells.end()); 
     455                ExportViewCells(&foundViewCells); 
     456 
     457                Debug << "Number of view cells after erasing dublicates: " << (int)foundViewCells.size() << endl; 
    458458        } 
    459459 
  • trunk/VUT/GtpVisibilityPreprocessor/src/X3dExporter.h

    r263 r292  
    6969  virtual void  
    7070  ExportViewCells(ViewCellContainer *viewCells); 
    71  
     71static ViewCellContainer foundViewCells; // todo: delete later 
    7272protected: 
    7373  virtual void 
  • trunk/VUT/GtpVisibilityPreprocessor/src/main.cpp

    r289 r292  
    88#include "MeshKdTree.h" 
    99#include "Exporter.h" 
     10#include "X3dExporter.h" // delete later 
    1011 
    1112#define USE_EXE_PATH false 
     
    4647                  p->GenerateViewCells(); 
    4748 
    48           Exporter *exporter = Exporter::GetExporter("viewcells.x3d"); 
    49           if (exporter)  
    50           {      
    51           exporter->ExportViewCells(&p->mViewCells); // export view cells 
    52                   delete exporter; 
    53           } 
    54           Debug << "Viewcells loaded / generated. Number of view cells: " << p->mViewCells.size() << endl; 
     49         Debug << "Viewcells loaded / generated. Number of view cells: " << p->mViewCells.size() << endl; 
    5550  } 
    5651 
     
    5853  p->BspTreeStatistics(Debug); 
    5954  p->Export("vc_bsptree.x3d", false, false, true); 
     55 
     56 
     57  // export the complementary view cells, i.e., the view cells not in the tree. 
     58  Exporter *exporter = Exporter::GetExporter("viewcells_compl.x3d"); 
     59 
     60  ViewCellContainer::iterator vc_compl_it; 
     61  ViewCellContainer vc_compl(p->mViewCells.size() + X3dExporter::foundViewCells.size()); 
     62 
     63  Debug << "here1" << endl; 
     64  sort(p->mViewCells.begin(), p->mViewCells.end()); 
     65  Debug << "here2.5 " << X3dExporter::foundViewCells.size() << endl; 
     66   
     67  vc_compl_it = set_difference(p->mViewCells.begin(), p->mViewCells.end(),  
     68                                 X3dExporter::foundViewCells.begin(), X3dExporter::foundViewCells.end(), 
     69                                 vc_compl.begin()); 
     70 
     71  Debug << "here2" << endl; 
     72  
     73  vc_compl.erase(vc_compl_it, vc_compl.end()); 
     74   
     75  Debug << "Complementary view cells: " << vc_compl.size() << endl; 
     76 
     77  if (exporter)  
     78  {      
     79          exporter->ExportViewCells(&vc_compl); // export view cells 
     80          delete exporter; 
     81  }Debug << "here4" << endl; 
    6082 
    6183#endif 
Note: See TracChangeset for help on using the changeset viewer.