Changeset 322


Ignore:
Timestamp:
10/13/05 01:53:40 (19 years ago)
Author:
mattausch
Message:
 
Location:
trunk/VUT/GtpVisibilityPreprocessor
Files:
7 edited

Legend:

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

    r321 r322  
    101101        #splitPlaneStrategy 72 
    102102         
    103         splitPlaneStrategy 72 
     103        splitPlaneStrategy 1 
    104104         
    105105        maxCandidates 50 
    106106         
    107107        Termination { 
    108                 maxPolysForAxisAligned 100 
    109                 maxPolygons 30 
     108                maxPolysForAxisAligned 1000 
     109                maxPolygons 50 
    110110                maxDepth 100 
    111111        } 
  • trunk/VUT/GtpVisibilityPreprocessor/src/Polygon3.cpp

    r321 r322  
    165165                // 3 vertices enough to decide coincident 
    166166                else if (((++ count) >= 3) && !onFrontSide && !onBackSide) 
    167                 //      && (DotProd(GetSupportingPlane().mNormal, plane.mNormal)  > 0)) 
    168167                {    
    169168                        return COINCIDENT;  
     
    179178                return FRONT_SIDE; 
    180179        } 
    181         //if (DotProd(GetNormal(), plane.mNormal)  < 0) return FRONT_SIDE; 
     180 
    182181        return COINCIDENT; // plane and polygon are coincident 
    183182} 
  • trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp

    r321 r322  
    254254                int index = 0; 
    255255                         
    256                 Debug << "starting new loop " << totalSamples << endl; 
    257  
    258256                // construct Bsp tree if not 
    259257                if ((mViewCellsType == Preprocessor::BSP_VIEW_CELLS) && 
     
    262260                        BuildBspTree(); 
    263261                } 
    264 Debug << "here" << totalSamples << endl; 
     262 
    265263                for (i = 0; i < objects.size(); i++) { 
    266264                        KdNode *nodeToSample = NULL; 
     
    471469    delete exporter; 
    472470  } 
    473  
    474471  if (1) { 
    475          
    476       if (mViewCellsType == BSP_VIEW_CELLS) 
    477           { 
    478                    for (int j = 0; j < pvsViewCells.size(); ++ j) 
    479                    { 
    480                            ViewCell *vc = pvsViewCells[j]; 
    481  
    482                            Intersectable::NewMail(); 
    483      
    484                            char s[64]; sprintf(s, "bsp-pvs%04d.x3d", j); 
    485                            Exporter *exporter = Exporter::GetExporter(s); 
    486                            exporter->SetFilled(); 
    487  
    488                            ViewCellPvsMap::iterator it = vc->GetPvs().mEntries.begin(); 
    489  
    490                            Material m;//= RandomMaterial(); 
    491                            m.mDiffuseColor = RgbColor(0, 1, 0); 
    492                            exporter->SetForcedMaterial(m); 
    493  
    494                            exporter->ExportViewCell(vc); 
    495  
    496                            Debug << "pvs size: " << (int)vc->GetPvs().GetSize() << " of " << (int)objects.size(); 
    497                            Debug << " exporting rays: " << (int)vcRays[j].size() << endl; 
    498  
    499                            exporter->SetWireframe(); 
    500                             
    501                            m.mDiffuseColor = RgbColor(1, 0, 1); 
    502                            exporter->SetForcedMaterial(m); 
    503  
    504                            if (1) 
    505                            { 
    506                                    exporter->ExportViewCells(mViewCells); 
    507                            } 
    508  
    509                            // export rays piercing this view cell 
    510                            exporter->ExportRays(vcRays[j], 1000, RgbColor(0, 1, 0)); 
    511  
    512                            m.mDiffuseColor = RgbColor(1, 0, 0); 
    513                            exporter->SetForcedMaterial(m); 
    514  
    515                            // output pvs of view cell 
    516                            for (; it != vc->GetPvs().mEntries.end(); ++ it)  
    517                            { 
    518                                    Intersectable *intersect = (*it).first; 
    519                                    if (!intersect->Mailed()) 
    520                                    { 
    521                                            exporter->ExportIntersectable(intersect); 
    522                                            intersect->Mail(); 
    523                                    }                     
    524                            } 
    525  
    526                            // output rest of the objects 
    527                            if (1) 
    528                            { 
    529                                    Material m;//= RandomMaterial(); 
    530                                    m.mDiffuseColor = RgbColor(0, 0, 1); 
    531                                    exporter->SetForcedMaterial(m); 
    532                   
    533                                    for (int j = 0; j < objects.size(); ++ j) 
    534                                            if (!objects[j]->Mailed()) 
    535                                            { 
    536                                                    exporter->ExportIntersectable(objects[j]); 
    537                                                    objects[j]->Mail(); 
    538                                            } 
    539                            } 
    540                            DEL_PTR(exporter); 
    541                    } 
    542           }        
    543  
    544     for (int k=0; k < pvsOut; k++) { 
     472  if (mViewCellsType == BSP_VIEW_CELLS) 
     473  { 
     474          for (int j = 0; j < pvsViewCells.size(); ++ j) 
     475                { 
     476                        ViewCell *vc = pvsViewCells[j]; 
     477 
     478                        Intersectable::NewMail(); 
     479 
     480                        char s[64]; sprintf(s, "bsp-pvs%04d.x3d", j); 
     481                        Exporter *exporter = Exporter::GetExporter(s); 
     482                        exporter->SetFilled(); 
     483 
     484                        ViewCellPvsMap::iterator it = vc->GetPvs().mEntries.begin(); 
     485 
     486                        Material m;//= RandomMaterial(); 
     487                        m.mDiffuseColor = RgbColor(0, 1, 0); 
     488                        exporter->SetForcedMaterial(m); 
     489 
     490                        exporter->ExportViewCell(vc); 
     491 
     492                        Debug << "pvs size: " << (int)vc->GetPvs().GetSize() << " of " << (int)objects.size(); 
     493                        Debug << " exporting rays: " << (int)vcRays[j].size() << endl; 
     494 
     495                        exporter->SetWireframe(); 
     496 
     497                        // export view cells 
     498                        m.mDiffuseColor = RgbColor(1, 0, 1); 
     499                        exporter->SetForcedMaterial(m); 
     500                        exporter->ExportViewCells(mViewCells); 
     501                         
     502                        // export rays piercing this view cell 
     503                        exporter->ExportRays(vcRays[j], 1000, RgbColor(0, 1, 0)); 
     504 
     505                        m.mDiffuseColor = RgbColor(1, 0, 0); 
     506                        exporter->SetForcedMaterial(m); 
     507 
     508                        // output pvs of view cell 
     509                        for (; it != vc->GetPvs().mEntries.end(); ++ it)  
     510                        { 
     511                                Intersectable *intersect = (*it).first; 
     512                                if (!intersect->Mailed()) 
     513                                { 
     514                                        exporter->ExportIntersectable(intersect); 
     515                                        intersect->Mail(); 
     516                                }                        
     517                        } 
     518 
     519                        // output rest of the objects 
     520                        if (1) 
     521                        { 
     522                                Material m;//= RandomMaterial(); 
     523                                m.mDiffuseColor = RgbColor(0, 0, 1); 
     524                                exporter->SetForcedMaterial(m); 
     525                 
     526                                for (int j = 0; j < objects.size(); ++ j) 
     527                                        if (!objects[j]->Mailed()) 
     528                                        { 
     529                                                exporter->ExportIntersectable(objects[j]); 
     530                                                objects[j]->Mail(); 
     531                                        } 
     532                        } 
     533                        DEL_PTR(exporter); 
     534                } 
     535  }   
     536 
     537   for (int k=0; k < pvsOut; k++) { 
    545538      Intersectable *object = objects[k]; 
    546539      char s[64]; 
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp

    r319 r322  
    2525 
    2626//-- factors for bsp tree split plane heuristics 
     27 
    2728float BspTree::sLeastSplitsFactor = 1.0f; 
    28 float BspTree::sBalancedPolysFactor = 2.0f; 
    29 float BspTree::sBalancedViewCellsFactor = 2.0f; 
    30 float BspTree::sVerticalSplitsFactor = 1.0f; // very important criterium for 2.5d scenes 
     29float BspTree::sBalancedPolysFactor = 1.0f; 
     30float BspTree::sBalancedViewCellsFactor = 1.0f; 
     31// NOTE:  very important criterium for 2.5d scenes 
     32float BspTree::sVerticalSplitsFactor = 1.0f; 
    3133float BspTree::sLargestPolyAreaFactor = 1.0f; 
    3234float BspTree::sBlockedRaysFactor = 1.0f; 
     35 
     36bool BspTree::sStoreSplitPolys = false; 
    3337 
    3438/** Evaluates split plane classification with respect to the plane's  
     
    4145float BspTree::sBalancedPolysTable[] = {-1, 1, 0, 0}; 
    4246 
    43 //int counter = 0; 
    44  
    4547/****************************************************************/ 
    4648/*                  class BspNode implementation                */ 
     
    179181                { 
    180182                        case Polygon3::COINCIDENT: 
    181                                 //Debug << "coincident" << endl;         
    182183                                coincident.push_back(poly); 
    183184                                break;                   
    184185                        case Polygon3::FRONT_SIDE:       
    185                                 //Debug << "front" << endl; 
    186186                                frontPolys.push_back(poly); 
    187187                                break; 
    188188                        case Polygon3::BACK_SIDE: 
    189                                 //Debug << "back" << endl; 
    190189                                backPolys.push_back(poly); 
    191190                                break; 
     
    262261BspTree::BspTree(ViewCell *viewCell):  
    263262mRoot(NULL),  
    264 mRootCell(viewCell), 
    265 //mStoreSplitPolys(true) 
    266 mStoreSplitPolys(false) 
     263mRootCell(viewCell) 
    267264{ 
    268265        Randomize(); // initialise random generator for heuristics 
     
    280277        app << setprecision(4); 
    281278 
    282         app << "#N_RAYS Number of rays )\n" 
    283                 << rays << endl; 
    284         app << "#N_DOMAINS  ( Number of query domains )\n" 
    285                 << queryDomains <<endl; 
    286  
    287279        app << "#N_NODES ( Number of nodes )\n" << nodes << "\n"; 
    288280 
     
    292284 
    293285        app << "#N_SPLITS ( Number of splits )\n" << splits << "\n"; 
    294  
    295         app << "#N_RAYREFS ( Number of rayRefs )\n" << 
    296         rayRefs << "\n"; 
    297  
    298         app << "#N_RAYRAYREFS  ( Number of rayRefs / ray )\n" << 
    299         rayRefs/(double)rays << "\n"; 
    300  
    301         app << "#N_LEAFRAYREFS  ( Number of rayRefs / leaf )\n" << 
    302         rayRefs/(double)Leaves() << "\n"; 
    303  
    304         app << "#N_MAXOBJECTREFS  ( Max number of rayRefs / leaf )\n" << 
    305         maxObjectRefs << "\n"; 
    306  
    307         app << "#N_NONEMPTYRAYREFS  ( Number of rayRefs in nonEmpty leaves / non empty leaf )\n" << 
    308         rayRefsNonZeroQuery/(double)(Leaves() - zeroQueryNodes) << "\n"; 
    309  
    310         app << "#N_LEAFDOMAINREFS  ( Number of query domain Refs / leaf )\n" << 
    311         objectRefs/(double)Leaves() << "\n"; 
    312  
    313         app << "#N_PEMPTYLEAVES  ( Percentage of leaves with zero query domains )\n"<< 
    314         zeroQueryNodes*100/(double)Leaves() << endl; 
    315286 
    316287        app << "#N_PMAXDEPTHLEAVES ( Percentage of leaves at maxdepth )\n"<< 
     
    323294        app << "#AVGDEPTH ( average depth )\n" << AvgDepth() << endl; 
    324295 
    325         app << "#N_ADDED_RAYREFS  ( Number of dynamically added ray references )\n"<< 
    326         addedRayRefs << endl; 
    327  
    328         app << "#N_REMOVED_RAYREFS  ( Number of dynamically removed ray references )\n" << 
    329         removedRayRefs << endl; 
    330  
    331         app << "#N_INPUT_POLYGONS (number of input polygons )\n" << 
    332                 polys << endl; 
     296        app << "#N_INPUT_POLYGONS (number of input polygons )\n" <<     polys << endl; 
    333297 
    334298        app << "#N_ROUTPUT_INPUT_POLYGONS ( ratio polygons after subdivision / input polygons )\n" << 
     
    394358 
    395359                        //-- filter view cell polygons down the tree until a leaf is reached 
    396                         if ((int)tData.mPolygons->size() > 0) 
     360                        if (!tData.mPolygons->empty()) 
    397361                        { 
    398362                                PolygonContainer *frontPolys = new PolygonContainer(); 
     
    408372                                                                                coincident, 
    409373                                                                                splits,  
    410                                                                                 mStoreSplitPolys); 
     374                                                                                sStoreSplitPolys); 
    411375                                 
    412376                                // extract view cells associated with the split polygons 
     
    425389 
    426390                                // don't need coincident polygons anymore 
    427                                 interior->ProcessPolygons(&coincident, mStoreSplitPolys); 
     391                                interior->ProcessPolygons(&coincident, sStoreSplitPolys); 
    428392 
    429393                                mStat.splits += splits; 
    430394 
    431395                                // push the children on the stack 
    432                                 tStack.push(BspTraversalData(interior->GetFront(), frontPolys, tData.mDepth + 1, frontViewCell)); 
    433                                 tStack.push(BspTraversalData(interior->GetBack(), backPolys, tData.mDepth + 1, backViewCell)); 
     396                                tStack.push(BspTraversalData(interior->GetFront(),  
     397                                                                                         frontPolys,  
     398                                                                                         tData.mDepth + 1,  
     399                                                                                         frontViewCell)); 
     400 
     401                                tStack.push(BspTraversalData(interior->GetBack(),  
     402                                                                                         backPolys,  
     403                                                                                         tData.mDepth + 1,  
     404                                                                                         backViewCell)); 
    434405                        } 
    435406 
     
    439410                else // reached leaf => subdivide current viewcell 
    440411                { 
    441                         //if (tData.mPolygons->size() > 0) Debug << "Subdividing further: polygon size: " << (int)tData.mPolygons->size() << ", view cell: " << tData.mViewCell << endl; 
    442412                        BspNode *root = Subdivide(tStack, tData);                
    443413 
    444414                        if (viewCells && root->IsLeaf()) 
    445                         {       // generate new view cell for each leaf 
     415                        {        
     416                                // generate new view cell for each leaf 
    446417                                ViewCell *viewCell = new ViewCell(); 
    447418                                viewCells->push_back(viewCell); 
     
    459430{ 
    460431        FaceContainer::const_iterator fi; 
    461         int polysNum = 0; 
    462  
     432         
    463433        // copy the face data to polygons 
    464434        for (fi = mesh->mFaces.begin(); fi != mesh->mFaces.end(); ++ fi) 
     
    467437                poly->mParent = parent; // set parent intersectable 
    468438                polys.push_back(poly); 
    469  
    470                 //if (!poly->Valid()) 
    471                 //      Debug << "Input polygon not valid: " << *poly << endl << "Area: " << poly->GetArea() << endl; 
    472                  
    473                 ++ polysNum; 
    474         } 
    475         return polysNum; 
    476 } 
    477  
    478 int BspTree::AddToPolygonSoup(const ViewCellContainer &viewCells, PolygonContainer &polys, int maxObjects) 
    479 { 
    480         int limit = (maxObjects > 0) ? Min((int)viewCells.size(), maxObjects) : (int)viewCells.size(); 
     439        } 
     440        return (int)mesh->mFaces.size(); 
     441} 
     442 
     443int BspTree::AddToPolygonSoup(const ViewCellContainer &viewCells,  
     444                                                          PolygonContainer &polys,  
     445                                                          int maxObjects) 
     446{ 
     447        int limit = (maxObjects > 0) ?  
     448                Min((int)viewCells.size(), maxObjects) : (int)viewCells.size(); 
    481449   
    482         for (int i = 0; i < limit; ++i) 
    483         {//if ((i == 12) ||(i==14)) 
     450        int polysSize = 0; 
     451 
     452        for (int i = 0; i < limit; ++ i) 
     453        { 
    484454                if (viewCells[i]->GetMesh()) // copy the mesh data to polygons 
    485455                { 
    486456                        mBox.Include(viewCells[i]->GetBox()); // add to BSP tree aabb 
    487                         AddMeshToPolygons(viewCells[i]->GetMesh(), polys, viewCells[i]); 
    488                 } 
    489         } 
    490  
    491         return (int)polys.size(); 
     457                        polysSize += AddMeshToPolygons(viewCells[i]->GetMesh(),  
     458                                                                                   polys, viewCells[i]); 
     459                } 
     460        } 
     461 
     462        return polysSize; 
    492463} 
    493464 
     
    644615                // clean up 
    645616                // remaining polygons are discarded or added to node 
    646                 leaf->ProcessPolygons(tData.mPolygons, mStoreSplitPolys); 
     617                leaf->ProcessPolygons(tData.mPolygons, sStoreSplitPolys); 
    647618                DEL_PTR(tData.mPolygons); 
    648619 
     
    682653         
    683654        // don't need coincident polygons anymore 
    684         interior->ProcessPolygons(&coincident, mStoreSplitPolys); 
     655        interior->ProcessPolygons(&coincident, sStoreSplitPolys); 
    685656 
    686657        // push the children on the stack 
     
    753724                                                        coincident,  
    754725                                                        splits,  
    755                                                         mStoreSplitPolys); 
     726                                                        sStoreSplitPolys); 
    756727         
    757728        mStat.splits += splits; 
     
    916887                        return Plane3(norm, position); 
    917888                } 
    918                 /*int axis = box.Size().DrivingAxis(); 
    919                 Vector3 norm(0,0,0); norm[axis] = 1; 
    920                 Vector3 position = (box.Min()[axis] + box.Max()[axis]) * 0.5f; 
    921                 return Plane3(norm, position);*/ 
    922889        } 
    923890 
    924891        // simplest strategy: just take next polygon 
    925         if (sSplitPlaneStrategy & NEXT_POLYGON) 
    926         { 
    927                 return polys.front()->GetSupportingPlane(); 
     892        if (sSplitPlaneStrategy & RANDOM_POLYGON) 
     893        { 
     894                return polys[Random((int)polys.size())]->GetSupportingPlane(); 
    928895        } 
    929896 
     
    949916                 
    950917                // evaluate current candidate 
    951                 float candidateCost = EvalSplitPlane(polys, candidatePlane); 
     918                float candidateCost = SplitPlaneCost(polys, candidatePlane); 
    952919                         
    953920                if (candidateCost < lowestCost) 
     
    964931int BspTree::GetNextCandidateIdx(int currentIdx, PolygonContainer &polys) 
    965932{ 
    966         int candidateIdx = Random(currentIdx--); 
    967          
     933        int candidateIdx = Random(currentIdx --); 
    968934        //Debug << "new candidate " << candidateIdx << endl; 
    969935 
     
    976942} 
    977943 
    978 float BspTree::EvalSplitPlane(PolygonContainer &polys,  
     944float BspTree::SplitPlaneCost(PolygonContainer &polys,  
    979945                                                          const Plane3 &candidatePlane) 
    980946{ 
     
    1029995                { 
    1030996                        if (classification == Polygon3::COINCIDENT) 
    1031                         {                
    1032                                 float area = (*it)->GetArea(); 
    1033                                 //Debug << "polygon area: " << area << " "; 
    1034                                 sumPolyArea += area; 
    1035                         } 
     997                                sumPolyArea += (*it)->GetArea(); 
    1036998                        //totalArea += area; 
    1037999                } 
     
    11501112        environment->GetFloatValue("MeshKdTree.splitBorder", sSplitBorder); 
    11511113        environment->GetFloatValue("MeshKdTree.Termination.maxCostRatio", sMaxCostRatio); 
     1114        environment->GetBoolValue("BspTree.storeSplitPolys", sStoreSplitPolys); 
    11521115 
    11531116    Debug << "BSP max depth: " << sTermMaxDepth << endl; 
     
    11561119         
    11571120        Debug << "Split plane strategy: "; 
    1158         if (sSplitPlaneStrategy & NEXT_POLYGON) 
    1159                 Debug << "next polygon "; 
     1121        if (sSplitPlaneStrategy & RANDOM_POLYGON) 
     1122                Debug << "random polygon "; 
    11601123        if (sSplitPlaneStrategy & AXIS_ALIGNED) 
    11611124                Debug << "axis aligned "; 
     
    12111174} 
    12121175 
    1213 bool BspTree::StorePolys() const 
    1214 { 
    1215         return mStoreSplitPolys; 
    1216 } 
    1217  
    12181176void BspTree::EvaluateLeafStats(const BspTraversalData &data) 
    12191177{ 
     
    12221180 
    12231181        if (data.mDepth >= sTermMaxDepth) 
    1224         { 
    12251182                ++ mStat.maxDepthNodes; 
    1226         } 
    1227  
    12281183        // store maximal and minimal depth 
    12291184        if (data.mDepth > mStat.maxDepth) 
     
    12351190        mStat.accumDepth += data.mDepth; 
    12361191 
    1237         if (leaf->mViewCell) 
    1238                 ++ mStat.viewCellLeaves; 
     1192        if (leaf->mViewCell != mRootCell) 
     1193                ++ mStat.viewCells; 
    12391194 
    12401195#ifdef _DEBUG 
    1241         Debug << "BSP Traversal data. Depth: " << data.mDepth << " (max: " << mTermMaxDepth << "), #polygons: " <<  
    1242           data.mPolygons->size() << " (max: " << sTermMaxPolygons << ")" << endl; 
     1196        Debug << "BSP Traversal data. Depth: " << data.mDepth  
     1197                  << " (max: " << mTermMaxDepth << "), #polygons: "  
     1198                  << data.mPolygons->size() << " (max: "  
     1199                  << sTermMaxPolygons << ")" << endl; 
    12431200#endif 
    12441201} 
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h

    r321 r322  
    2727}; 
    2828 
    29 class BspTreeStatistics // TODO: should have common superclass with KdTreeStatistics 
     29class BspTreeStatistics 
    3030{ 
    3131public: 
     
    4040  // minimal depth 
    4141  int minDepth; 
    42   // total number of query domains 
    43   int queryDomains; 
    44   // total number of ray references 
    45   int rayRefs; 
    46   // refs in non empty leafs 
    47   int rayRefsNonZeroQuery; 
    48   // total number of query references 
    49   int objectRefs; 
    50   // nodes with zero queries 
    51   int zeroQueryNodes; 
    5242  // max depth nodes 
    5343  int maxDepthNodes; 
    5444  // max number of rays per node 
    5545  int maxObjectRefs; 
    56   // number of dynamically added ray refs 
    57   int addedRayRefs; 
    58   // number of dynamically removed ray refs 
    59   int removedRayRefs; 
    60   // accumulated depth (used to compute average) 
     46   // accumulated depth (used to compute average) 
    6147  int accumDepth; 
    6248  // number of initial polygons 
    6349  int polys; 
    64   /// number of view cells in leaf 
    65   int viewCellLeaves; 
     50  /// number of view cells different to the view cell representing unbounded space. 
     51  int viewCells; 
    6652 
    6753  // Constructor 
     
    8066          nodes = 0; 
    8167          splits = 0; 
    82           rays = queryDomains = 0; 
    83           rayRefs = rayRefsNonZeroQuery = objectRefs = 0; 
    84           zeroQueryNodes = 0; 
    8568      maxDepthNodes = 0; 
    86  
    87           maxObjectRefs = 0; 
    88           addedRayRefs = removedRayRefs = 0; 
    8969          maxDepth = 0; 
    9070          minDepth = 99999; 
    9171          polys = 0; 
    9272          accumDepth = 0; 
    93           viewCellLeaves = 0; 
     73          viewCells = 0; 
    9474  } 
    9575 
     
    331311        BspNode *GetRoot() const; 
    332312 
    333         /** If the view cell polygons are stored in the nodes. 
    334         */ 
    335         bool StorePolys() const; 
    336  
    337313        /** Exports Bsp tree to file. 
    338314        */ 
     
    376352                @returns the cost of the candidate split plane 
    377353        */ 
    378         float EvalSplitPlane(PolygonContainer &polys,  
     354        float SplitPlaneCost(PolygonContainer &polys,  
    379355                                                 const Plane3 &candidatePlane); 
    380356 
  • trunk/VUT/GtpVisibilityPreprocessor/src/X3dExporter.cpp

    r318 r322  
    403403        //ViewCellContainer foundViewCells; 
    404404 
    405         if (tree.StorePolys()) 
     405        if (BspTree::sStoreSplitPolys) 
    406406        { 
    407407                while (!tStack.empty())  
     
    411411                        tStack.pop(); 
    412412         
    413                         if (tree.StorePolys()) // extract the polygons 
    414                         { 
    415                                 PolygonContainer::const_iterator it; 
    416                                 PolygonContainer::const_iterator it_end = node->GetPolygons()->end(); 
    417  
    418                                 for (it = node->GetPolygons()->begin(); it != it_end; ++ it) 
    419                                         ExportPolygon(*it); 
    420                         } 
    421  
     413                        PolygonContainer::const_iterator it; 
     414                        PolygonContainer::const_iterator it_end = node->GetPolygons()->end(); 
     415 
     416                        for (it = node->GetPolygons()->begin(); it != it_end; ++ it) 
     417                                ExportPolygon(*it); 
     418                         
    422419                        if (!node->IsLeaf())  
    423420                        { 
  • trunk/VUT/GtpVisibilityPreprocessor/src/main.cpp

    r321 r322  
    5757         
    5858          p->BuildBspTree(); 
    59            
     59          p->Export("vc_bsptree.x3d", false, false, true); 
    6060          p->BspTreeStatistics(Debug); 
    61           p->Export("vc_bsptree2.x3d", false, false, true); 
    62           
     61 
    6362          bool exportSplits = false; 
    6463          environment->GetBoolValue("BspTree.exportSplits", exportSplits); 
Note: See TracChangeset for help on using the changeset viewer.