Ignore:
Timestamp:
11/17/05 02:26:30 (19 years ago)
Author:
mattausch
Message:
 
Location:
trunk/VUT/GtpVisibilityPreprocessor/src
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/Environment.cpp

    r414 r419  
    13151315          "20"); 
    13161316 
    1317   RegisterOption("ViewCells.maxViewCells", 
    1318           optInt, 
    1319           "-view_cells_max_viewcells=", 
    1320           "0"); 
    1321    
    13221317  RegisterOption("BspTree.Visualization.samples", 
    13231318          optInt, 
  • trunk/VUT/GtpVisibilityPreprocessor/src/Preprocessor.cpp

    r416 r419  
    3030{ 
    3131        X3dParser parser; 
    32         int maxViewCells = 0; 
     32         
    3333        environment->GetFloatValue("ViewCells.height", parser.mViewCellHeight); 
    34         environment->GetIntValue("ViewCells.maxViewCells", maxViewCells); 
    35  
    36         bool loaded = parser.ParseFile(filename, mViewCells); 
    37  
    38         if (maxViewCells > 0) 
    39         { 
    40                 while (mViewCells.size() > maxViewCells) 
    41                 { 
    42                         ViewCell *vc = mViewCells.back(); 
    43                         DEL_PTR(vc); 
    44                         mViewCells.pop_back(); 
    45                 } 
    46         } 
    47         return loaded; 
     34         
     35        return parser.ParseFile(filename, mViewCells); 
    4836} 
    4937 
     
    121109} 
    122110 
    123 bool 
    124 Preprocessor::GenerateViewCells() 
    125 { 
    126         // TODO 
    127         // HACK: derive view cells from the scene objects 
    128         ObjectContainer objects; 
    129  
    130         int maxViewCells = 0; 
    131         environment->GetIntValue("ViewCells.maxViewCells", maxViewCells); 
    132  
    133         mSceneGraph->CollectObjects(&objects); 
    134         ViewCell::DeriveViewCells(objects, mViewCells, maxViewCells); 
    135  
    136         return true; 
    137 } 
    138  
    139111int 
    140 SplitFilenames(const string str, 
    141                                                          vector<string> &filenames) 
     112SplitFilenames(const string str, vector<string> &filenames) 
    142113{ 
    143114        int pos = 0; 
  • trunk/VUT/GtpVisibilityPreprocessor/src/Preprocessor.h

    r411 r419  
    4646  */ 
    4747  virtual bool LoadViewCells(const string filename); 
    48    
    49   /** Generate the viewCells automatically. The particular algorithm to be used depends 
    50       on the environment setting. Initially the generated viewcells will cover the whole 
    51       bounding volume of the scene. They can be pruned later depending on the results 
    52       of visibility computations. 
    53       @return true on successful viewcell generation. 
    54   */ 
    55   virtual bool GenerateViewCells(); 
    5648   
    5749  /** Export all preprocessed data in a XML format understandable by the 
  • trunk/VUT/GtpVisibilityPreprocessor/src/RenderSimulator.cpp

    r418 r419  
    183183    mStat.avgRtWithoutOverhead = renderTime; 
    184184        mStat.avgRenderTime = renderTime + loadPvsOverhead; 
    185          
     185        mStat.maxCost /= pCrossVcTotal; 
     186        mStat.minCost /= pCrossVcTotal; 
     187 
    186188        mStat.Stop(); 
    187189 
  • trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp

    r418 r419  
    573573                        if (exporter) 
    574574                        { 
    575                                 exporter->ExportBspLeaves(*mBspTree, 350/*stat.maxPvs*/); 
     575                                exporter->ExportBspLeaves(*mBspTree, stat.maxPvs); 
    576576                                //exporter->ExportBspViewCellPartition(*mBspTree, 0); 
    577577                                delete exporter; 
     
    609609                        if (exporter) 
    610610                        { 
    611                                 exporter->ExportBspViewCellPartition(*mBspTree, 350/*stat.maxPvs*/); 
     611                                exporter->ExportBspViewCellPartition(*mBspTree, stat.maxPvs); 
    612612                                //exporter->ExportBspViewCellPartition(*mBspTree, 0); 
    613613                                delete exporter; 
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.cpp

    r384 r419  
    2727                return NULL; 
    2828        } 
     29} 
     30 
     31const ViewCellPvs &ViewCell::GetPvs() const 
     32{ 
     33        return mPvs; 
    2934} 
    3035 
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.h

    r411 r419  
    2323        */ 
    2424        ViewCell(Mesh *mesh); 
    25         /** Returns PvS.  
     25        /** Returns Pvs.  
    2626        */ 
     27        const ViewCellPvs &GetPvs() const; 
    2728        ViewCellPvs &GetPvs(); 
    2829 
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h

    r414 r419  
    770770 
    771771public: 
    772         /// Parses the environment and stores the global BSP tree parameters 
     772        /** Parses the environment and stores the global BSP tree parameters 
     773        */ 
    773774        static void ParseEnvironment(); 
    774775 
  • trunk/VUT/GtpVisibilityPreprocessor/src/VspKdTree.cpp

    r418 r419  
    2828int VspKdTreeLeaf::mailID = 0; 
    2929int VspKdTree::sTermMaxDepth = 10; 
    30 float VspKdTree::sTermMinSize = 0.1; 
     30float VspKdTree::sTermMinSize = 0.1f; 
    3131int VspKdTree::sTermMinPvs = 10; 
    3232int VspKdTree::sTermMinRays = 20; 
    33 float VspKdTree::sTermMaxCostRatio = 0.1; 
    34 float VspKdTree::sTermMaxRayContribution = 0.1; 
     33float VspKdTree::sTermMaxCostRatio = 0.1f; 
     34float VspKdTree::sTermMaxRayContribution = 0.1f; 
    3535 
    3636 
     
    7171 
    7272/**************************************************************/ 
    73  *                VspKdTreeInterior implementation            * 
     73/*                VspKdTreeInterior implementation            */ 
    7474/**************************************************************/ 
    7575 
     
    8181int VspKdTreeInterior::GetAccessTime() 
    8282{ 
    83         return lastAccessTime; 
     83        return mLastAccessTime; 
    8484} 
    8585 
     
    101101int VspKdTreeInterior::Type() const   
    102102{  
    103         return VspKdInterior;  
     103        return EInterior;  
    104104} 
    105105   
     
    112112void VspKdTreeInterior::Print(ostream &s) const  
    113113{ 
    114         if (axis == 0) 
     114        if (mAxis == 0) 
    115115                s << "x "; 
    116116        else 
    117                 if (axis == 1) 
     117                if (mAxis == 1) 
    118118                        s << "y "; 
    119119                else 
    120120                        s << "z "; 
    121         s << position << " "; 
     121        s << mPosition << " "; 
    122122 
    123123        mBack->Print(s); 
     
    127127int VspKdTreeInterior::ComputeRayIntersection(const RayInfo &rayData, float &t)  
    128128{ 
    129         return rayData.ComputeRayIntersection(axis, position, t); 
    130 } 
    131  
     129        return rayData.ComputeRayIntersection(mAxis, mPosition, t); 
     130} 
     131 
     132VspKdTreeNode *VspKdTreeInterior::GetBack() const 
     133{ 
     134        return mBack; 
     135} 
     136 
     137VspKdTreeNode *VspKdTreeInterior::GetFront() const 
     138{ 
     139        return mFront; 
     140} 
     141 
     142/**************************************************/ 
     143/*         class VspKdTree implementation         */ 
     144/**************************************************/ 
     145void VspKdTree::ParseEnvironment() 
     146{ 
     147        environment->GetIntValue("VspKdTree.Termination.maxDepth", sTermMaxDepth); 
     148        environment->GetIntValue("VspKdTree.Termination.minPvs", sTermMinPvs); 
     149        environment->GetIntValue("VspKdTree.Termination.minRays", sTermMinRays); 
     150        environment->GetFloatValue("VspKdTree.Termination.maxRayContribution", sTermMaxRayContribution); 
     151        environment->GetFloatValue("VspKdTree.Termination.maxCostRatio", sTermMaxCostRatio); 
     152 
     153        environment->GetFloatValue("VspKdTree.Termination.minSize", sTermMinSize); 
     154        sTermMinSize = sqr(sTermMinSize); 
     155} 
    132156 
    133157// Constructor 
    134158VspKdTree::VspKdTree() 
    135 { 
    136         environment->GetIntValue("VspKdTree.maxDepth", sTermMaxDepth); 
    137         environment->GetIntValue("VspKdTree.minPvs", sTermMinPvs); 
    138         environment->GetIntValue("VspKdTree.minRays", sTermMinRays); 
    139         environment->GetFloatValue("VspKdTree.maxRayContribution", sTermMaxRayContribution); 
    140         environment->GetFloatValue("VspKdTree.maxCostRatio", sTermMaxCostRatio); 
    141  
    142         environment->GetFloatValue("VspKdTree.minSize", sTermMinSize); 
    143         termMinSize = sqr(termMinSize); 
    144            
     159{          
    145160        environment->GetFloatValue("VspKdTree.epsilon", epsilon); 
    146161        environment->GetFloatValue("VspKdTree.ct_div_ci", ct_div_ci); 
     
    150165   
    151166   
    152         float refDirAngle; 
    153167        environment->GetIntValue("VspKdTree.accessTimeThreshold", accessTimeThreshold); 
    154168        //= 1000; 
     
    174188        } 
    175189 
    176         environment->GetBoolValue("VspKdTree.randomize", randomize); 
    177  
    178190        mRoot = NULL; 
    179191 
     
    184196VspKdTree::~VspKdTree() 
    185197{ 
    186         if (mRoot) 
    187                 delete mRoot; 
     198        DEL_PTR(mRoot); 
    188199} 
    189200 
     
    298309        maxMemory = maxStaticMemory; 
    299310 
    300         if (root) 
    301                 delete root; 
    302  
    303         root = new VspKdTreeLeaf(NULL, rays.size()); 
     311        DEL_PTR(mRoot); 
     312 
     313        mRoot = new VspKdTreeLeaf(NULL, (int)rays.size()); 
    304314 
    305315        // first construct a leaf that will get subdivide 
    306         VspKdTreeLeaf *leaf = (VspKdTreeLeaf *) root; 
     316        VspKdTreeLeaf *leaf = dynamic_cast<VspKdTreeLeaf *>(mRoot); 
    307317 
    308318         
    309319        mStat.nodes = 1; 
    310320         
    311         bbox.Initialize(); 
    312         dirBBox.Initialize(); 
    313    
     321        mBox.Initialize(); 
    314322         
    315323        for (VssRayContainer::const_iterator ri = rays.begin(); ri != rays.end(); ++ ri) 
     
    317325                leaf->AddRay(VspKdTreeNode::RayInfo(*ri)); 
    318326 
    319                 bbox.Include((*ri)->GetOrigin()); 
    320                 bbox.Include((*ri)->GetTermination());     
    321                  
    322                 dirBBox.Include(Vector3((*ri)->GetDirParametrization(0), (*ri)->GetDirParametrization(1), 0)); 
     327                mBox.Include((*ri)->GetOrigin()); 
     328                mBox.Include((*ri)->GetTermination());  
    323329        } 
    324330         
    325331        if (forcedBoundingBox) 
    326                 bbox = *forcedBoundingBox; 
    327  
    328         cout<<"Bbox = "<<bbox<<endl; 
    329         cout<<"Dirr Bbox = "<<dirBBox<<endl; 
    330  
    331         mStat.rays = leaf->rays.size(); 
     332                mBox = *forcedBoundingBox; 
     333 
     334        cout << "Bbox = " << mBox << endl; 
     335         
     336        mStat.rays = (int)leaf->rays.size(); 
    332337        leaf->UpdatePvsSize(); 
    333338         
     
    335340         
    336341        // Subdivide(); 
    337         root = Subdivide(TraversalData(leaf, bbox, 0)); 
     342        mRoot = Subdivide(TraversalData(leaf, mBox, 0)); 
    338343 
    339344        if (splitCandidates)  
     
    390395     
    391396                 
    392                 VspKdTreeNode *node = SubdivideNode((VspKdTreeLeaf *) data.node, 
    393                                                                                         data.bbox, backBox,     frontBox); 
     397                VspKdTreeNode *node = SubdivideNode((VspKdTreeLeaf *) data.mNode, 
     398                                                                                        data.mBox, backBox,     frontBox); 
    394399                if (result == NULL) 
    395400                        result = node; 
     
    400405 
    401406                        // push the children on the stack 
    402                         tStack.push(TraversalData(interior->back, backBox, data.depth+1)); 
    403                         tStack.push(TraversalData(interior->front, frontBox, data.depth+1)); 
     407                        tStack.push(TraversalData(interior->GetBack(), backBox, data.mDepth + 1)); 
     408                        tStack.push(TraversalData(interior->GetFront(), frontBox, data.mDepth + 1)); 
    404409                }  
    405410                else  
     
    453458  } 
    454459 
    455         if (costRatio > termMaxCostRatio)  
     460        if (costRatio > sTermMaxCostRatio)  
    456461        { 
    457462                //              cout<<"Too big cost ratio "<<costRatio<<endl; 
     
    496501        Intersectable::NewMail(3); 
    497502 
    498         if (axis <= VspKdTreeNode::SPLIT_Z) { 
    499     // this is the main ray classification loop! 
     503        // this is the main ray classification loop! 
    500504    for(VspKdTreeNode::RayInfoContainer::iterator ri = leaf->rays.begin(); 
    501505                ri != leaf->rays.end(); ri++) 
    502                 if ((*ri).mRay->IsActive())  
    503                 { 
    504                         // determine the side of this ray with respect to the plane 
    505                         int side = (*ri).ComputeRayIntersection(axis, position, (*ri).mRay->mT); 
    506                         //                              (*ri).mRay->mSide = side; 
     506        { 
     507                if (!(*ri).mRay->IsActive())  
     508                        continue; 
    507509                         
    508                         if (side <= 0) 
    509                                 raysBack ++; 
     510                // determine the side of this ray with respect to the plane 
     511                int side = (*ri).ComputeRayIntersection(axis, position, (*ri).mRay->mT); 
     512                //                              (*ri).mRay->mSide = side; 
     513                         
     514                if (side <= 0) 
     515                        ++ raysBack; 
    510516                                 
    511                         if (side >= 0) 
    512                                 raysFront++; 
     517                if (side >= 0) 
     518                        ++ raysFront; 
    513519                                 
    514                         AddObject2Pvs((*ri).mRay->mTerminationObject, side, pvsBack, pvsFront); 
    515                 } 
     520                AddObject2Pvs((*ri).mRay->mTerminationObject, side, pvsBack, pvsFront); 
     521        }        
     522 
     523        AxisAlignedBox3 box = GetBBox(leaf); 
     524         
     525        float minBox = box.Min(axis); 
     526        float maxBox = box.Max(axis); 
     527        float sizeBox = maxBox - minBox; 
    516528                 
    517                 AxisAlignedBox3 box = GetBBox(leaf); 
    518                  
    519                 float minBox = box.Min(axis); 
    520                 float maxBox = box.Max(axis); 
    521                 float sizeBox = maxBox - minBox; 
    522                  
    523                 //              float sum = raysBack*(position - minBox) + raysFront*(maxBox - position); 
    524                 float sum = pvsBack*(position - minBox) + pvsFront*(maxBox - position); 
    525  
    526                 newCost = ct_div_ci + sum/sizeBox; 
    527         }  
    528         else  
    529         { 
    530                 // directional split 
    531                 for(VspKdTreeNode::RayInfoContainer::iterator ri = leaf->rays.begin(); 
    532                         ri != leaf->rays.end(); ++ ri) 
    533                         if ((*ri).mRay->IsActive())  
    534                         { 
    535                                 // determine the side of this ray with respect to the plane 
    536                                 int side; 
    537                                 if ((*ri).mRay->GetDirParametrization(axis - 3) > position) 
    538                                         side = 1; 
    539                                 else 
    540                                         side = -1; 
    541  
    542                                 if (side <= 0) 
    543                                         raysBack++; 
    544                                  
    545                                 if (side >= 0) 
    546                                         raysFront++; 
    547  
    548                                 //                              (*ri).mRay->mSide = side; 
    549                                 AddObject2Pvs((*ri).mRay->mTerminationObject, side, pvsBack, pvsFront); 
    550                         } 
    551          
    552                         AxisAlignedBox3 box = GetDirBBox(leaf); 
    553                  
    554                         float minBox = box.Min(axis - 3); 
    555                         float maxBox = box.Max(axis - 3); 
    556                         float sizeBox = maxBox - minBox; 
    557                  
    558                         // float sum = raysBack*(position - minBox) + raysFront*(maxBox - position); 
    559                         float sum =     pvsBack*(position - minBox) + pvsFront*(maxBox - position); 
    560                 //              float sum = pvsBack + pvsFront; 
    561                 newCost = ct_div_ci + sum/sizeBox; 
    562         } 
    563  
     529        //              float sum = raysBack*(position - minBox) + raysFront*(maxBox - position); 
     530        float sum = pvsBack*(position - minBox) + pvsFront*(maxBox - position); 
     531 
     532        newCost = ct_div_ci + sum/sizeBox; 
     533         
    564534        //      cout<<axis<<" "<<pvsSize<<" "<<pvsBack<<" "<<pvsFront<<endl; 
    565535        //  float oldCost = leaf->rays.size(); 
    566         float oldCost = pvsSize; 
     536        float oldCost = (float)pvsSize; 
    567537         
    568538        float ratio = newCost / oldCost; 
     
    587557         
    588558        AxisAlignedBox3 sBox = GetBBox(leaf); 
    589         AxisAlignedBox3 dBox = GetDirBBox(leaf); 
    590559 
    591560        // int sAxis = box.Size().DrivingAxis(); 
    592561        int sAxis = sBox.Size().DrivingAxis(); 
    593         int dAxis = dBox.Size().DrivingAxis() + 3; 
    594  
     562         
    595563        bool onlyDrivingAxis = true;  
    596564 
    597565        for (axis = 0; axis < 6; ++ axis)  
    598566        { 
    599                 if (!onlyDrivingAxis || axis == sAxis || axis == dAxis)  
    600                 { 
    601                         if (axis < 3) 
    602                                 nPosition[axis] = (sBox.Min()[axis] + sBox.Max()[axis])*0.5f; 
    603                         else 
    604                                 nPosition[axis] = (dBox.Min()[axis-3] + dBox.Max()[axis-3])*0.5f; 
    605                          
     567                if (!onlyDrivingAxis || axis == sAxis)  
     568                { 
     569                        nPosition[axis] = (sBox.Min()[axis] + sBox.Max()[axis])*0.5f; 
     570                                                 
    606571                        nCostRatio[axis] = EvalCostRatio(leaf, 
    607572                                                                                         axis, 
     
    651616        // C = ct_div_ci  + (ql*rl + qr*rr)/queries 
    652617         
    653         int rl=0, rr = leaf->rays.size(); 
     618        int rl=0, rr = (int)leaf->rays.size(); 
    654619        int pl=0, pr = leaf->GetPvsSize(); 
    655620        float minBox = box.Min(axis); 
     
    657622        float sizeBox = maxBox - minBox; 
    658623         
    659         float minBand = minBox + 0.1*(maxBox - minBox); 
    660         float maxBand = minBox + 0.9*(maxBox - minBox); 
     624        float minBand = minBox + 0.1f*(maxBox - minBox); 
     625        float maxBand = minBox + 0.9f*(maxBox - minBox); 
    661626         
    662627        float sum = rr*sizeBox; 
     
    743708        } 
    744709 
    745         float oldCost = leaf->GetPvsSize(); 
     710        float oldCost = (float)leaf->GetPvsSize(); 
    746711        float newCost = ct_div_ci + minSum / sizeBox; 
    747712        float ratio = newCost / oldCost; 
     
    789754{ 
    790755        // the node became a leaf -> evaluate stats for leafs 
    791         VspKdTreeLeaf *leaf = (VspKdTreeLeaf *)data.node; 
    792  
    793         if (data.depth >= termMaxDepth) 
     756        VspKdTreeLeaf *leaf = dynamic_cast<VspKdTreeLeaf *>(data.mNode); 
     757 
     758        if (data.mDepth >= sTermMaxDepth) 
    794759                ++ mStat.maxDepthNodes; 
    795760   
    796761        //  if ( (int)(leaf->rays.size()) < termMinCost) 
    797762        //    stat.minCostNodes++; 
    798         if (leaf->GetPvsSize() < termMinPvs) 
     763        if (leaf->GetPvsSize() < sTermMinPvs) 
    799764                ++ mStat.minPvsNodes; 
    800765 
    801         if (leaf->GetPvsSize() < termMinRays) 
     766        if (leaf->GetPvsSize() < sTermMinRays) 
    802767                ++ mStat.minRaysNodes; 
    803768 
    804         if (0 && leaf->GetAvgRayContribution() > termMaxRayContribution) 
     769        if (0 && leaf->GetAvgRayContribution() > sTermMaxRayContribution) 
    805770                ++ mStat.maxRayContribNodes; 
    806771         
    807         if (SqrMagnitude(data.bbox.Size()) <= termMinSize)  
     772        if (SqrMagnitude(data.mBox.Size()) <= sTermMinSize)  
    808773                ++ mStat.minSizeNodes; 
    809774 
     
    819784                                                                                AxisAlignedBox3 &frontBBox) 
    820785{ 
    821         if ( (leaf->GetPvsSize() < termMinPvs) || (leaf->rays.size() < termMinRays) || 
     786        if ( (leaf->GetPvsSize() < sTermMinPvs) || (leaf->rays.size() < sTermMinRays) || 
    822787        // (leaf->GetAvgRayContribution() > termMaxRayContribution ) || 
    823        (leaf->depth >= termMaxDepth) || SqrMagnitude(box.Size()) <= termMinSize )  
     788       (leaf->mDepth >= sTermMaxDepth) || SqrMagnitude(box.Size()) <= sTermMinSize )  
    824789        { 
    825790 
    826791#if 0 
    827                 if (leaf->depth >= termMaxDepth) { 
    828                         cout<<"Warning: max depth reached depth="<<(int)leaf->depth<<" rays="<<leaf->rays.size()<<endl; 
     792                if (leaf->mDepth >= termMaxDepth) { 
     793                        cout<<"Warning: max depth reached depth="<<(int)leaf->mDepth<<" rays="<<leaf->rays.size()<<endl; 
    829794                        cout<<"Bbox: "<<GetBBox(leaf)<<" dirbbox:"<<GetDirBBox(leaf)<<endl; 
    830795                } 
     
    856821 
    857822        // add the new nodes to the tree 
    858         VspKdTreeInterior *node = new VspKdTreeInterior(leaf->parent); 
    859  
    860         node->axis = axis; 
    861         node->position = position; 
    862         node->bbox = box; 
    863         node->dirBBox = GetDirBBox(leaf); 
    864    
     823        VspKdTreeInterior *node = new VspKdTreeInterior(leaf->mParent); 
     824 
     825        node->mAxis = axis; 
     826        node->mPosition = position; 
     827        node->mBox = box; 
     828           
    865829        backBBox = box; 
    866830        frontBBox = box; 
     
    872836 
    873837        // replace a link from node's parent 
    874         if (leaf->parent) 
    875                 leaf->parent->ReplaceChildLink(leaf, node); 
     838        if (leaf->mParent) 
     839                leaf->mParent->ReplaceChildLink(leaf, node); 
    876840        // and setup child links 
    877841        node->SetupChildLinks(back, front); 
     
    967931        int released; 
    968932 
    969         tstack.push(root); 
     933        tstack.push(mRoot); 
    970934 
    971935        while (!tstack.empty())  
     
    976940                if (!node->IsLeaf())  
    977941                { 
    978                         VspKdTreeInterior *in = (VspKdTreeInterior *)node; 
     942                        VspKdTreeInterior *in = dynamic_cast<VspKdTreeInterior *>(node); 
    979943                        // cout<<"depth="<<(int)in->depth<<" time="<<in->lastAccessTime<<endl; 
    980                         if (in->depth >= minCollapseDepth && in->lastAccessTime <= maxAccessTime)  
     944                        if (in->mDepth >= minCollapseDepth && in->mLastAccessTime <= maxAccessTime)  
    981945                        { 
    982946                                released = CollapseSubtree(node, time); 
    983947                                break; 
    984948                        } 
    985                         if (in->back->GetAccessTime() <  in->front->GetAccessTime())  
     949                        if (in->GetBack()->GetAccessTime() <  in->GetFront()->GetAccessTime())  
    986950                        { 
    987                                 tstack.push(in->front); 
    988                                 tstack.push(in->back); 
     951                                tstack.push(in->GetFront()); 
     952                                tstack.push(in->GetBack()); 
    989953                        }  
    990954                        else  
    991955                        { 
    992                                 tstack.push(in->back); 
    993                                 tstack.push(in->front); 
     956                                tstack.push(in->GetBack()); 
     957                                tstack.push(in->GetFront()); 
    994958                        } 
    995959                } 
     
    1021985        // check if we should perform a dynamic subdivision of the leaf 
    1022986        if (// leaf->rays.size() > (unsigned)termMinCost && 
    1023                 (leaf->GetPvsSize() >= termMinPvs) &&  
     987                (leaf->GetPvsSize() >= sTermMinPvs) &&  
    1024988                (SqrMagnitude(leafBBox.Size()) > sizeThreshold) ) 
    1025989        { 
     
    10781042        stack<RayTraversalData> tstack; 
    10791043 
    1080         tstack.push(RayTraversalData(root, VspKdTreeNode::RayInfo(ray))); 
     1044        tstack.push(RayTraversalData(mRoot, VspKdTreeNode::RayInfo(ray))); 
    10811045   
    10821046        RayTraversalData data; 
     
    10881052                tstack.pop(); 
    10891053 
    1090                 if (!data.node->IsLeaf())  
     1054                if (!data.mNode->IsLeaf())  
    10911055                { 
    10921056                        // split the set of rays in two groups intersecting the 
     
    10991063                        // remove the ray from the leaf 
    11001064                        // find the ray in the leaf and swap it with the last ray... 
    1101                         VspKdTreeLeaf *leaf = (VspKdTreeLeaf *)data.node; 
     1065                        VspKdTreeLeaf *leaf = (VspKdTreeLeaf *)data.mNode; 
    11021066       
    11031067                        if (!leaf->Mailed())  
     
    11681132        stack<RayTraversalData> tstack; 
    11691133   
    1170         tstack.push(RayTraversalData(root, VspKdTreeNode::RayInfo(ray))); 
     1134        tstack.push(RayTraversalData(mRoot, VspKdTreeNode::RayInfo(ray))); 
    11711135   
    11721136        RayTraversalData data; 
     
    11771141                tstack.pop(); 
    11781142 
    1179                 if (!data.node->IsLeaf())  
     1143                if (!data.mNode->IsLeaf())  
    11801144                { 
    11811145                        TraverseInternalNode(data, tstack); 
     
    11851149                        // remove the ray from the leaf 
    11861150                        // find the ray in the leaf and swap it with the last ray... 
    1187                         VspKdTreeLeaf *leaf = (VspKdTreeLeaf *)data.node; 
    1188                         leaf->AddRay(data.rayData); 
     1151                        VspKdTreeLeaf *leaf = (VspKdTreeLeaf *)data.mNode; 
     1152                        leaf->AddRay(data.mRayData); 
    11891153                        ++ mStat.addedRayRefs; 
    11901154                } 
     
    11951159                                                                         stack<RayTraversalData> &tstack) 
    11961160{ 
    1197         VspKdTreeInterior *in =  (VspKdTreeInterior *) data.node; 
    1198    
    1199         if (in->axis <= VspKdTreeNode::SPLIT_Z)  
     1161        VspKdTreeInterior *in =  (VspKdTreeInterior *) data.mNode; 
     1162   
     1163        if (in->mAxis <= VspKdTreeNode::SPLIT_Z)  
    12001164        { 
    12011165            // determine the side of this ray with respect to the plane 
    1202                 int side = in->ComputeRayIntersection(data.rayData, data.rayData.mRay->mT); 
     1166                int side = in->ComputeRayIntersection(data.mRayData, data.mRayData.mRay->mT); 
    12031167     
    12041168      if (side == 0)  
    12051169          { 
    1206                 if (data.rayData.mRay->HasPosDir(in->axis))  
    1207                 { 
    1208                         tstack.push(RayTraversalData(in->back,  
    1209                                                 VspKdTreeNode::RayInfo(data.rayData.mRay, data.rayData.mMinT,  
    1210                                                                                            data.rayData.mRay->mT))); 
     1170                if (data.mRayData.mRay->HasPosDir(in->mAxis))  
     1171                { 
     1172                        tstack.push(RayTraversalData(in->GetBack(),  
     1173                                                VspKdTreeNode::RayInfo(data.mRayData.mRay, data.mRayData.mMinT,  
     1174                                                                                           data.mRayData.mRay->mT))); 
    12111175                                 
    1212                         tstack.push(RayTraversalData(in->front, 
    1213                                                 VspKdTreeNode::RayInfo(data.rayData.mRay, data.rayData.mRay->mT,  
    1214                                                                                            data.rayData.mMaxT))); 
     1176                        tstack.push(RayTraversalData(in->GetFront(), 
     1177                                                VspKdTreeNode::RayInfo(data.mRayData.mRay, data.mRayData.mRay->mT,  
     1178                                                                                           data.mRayData.mMaxT))); 
    12151179         
    12161180                }  
    12171181                else  
    12181182                { 
    1219                         tstack.push(RayTraversalData(in->back, 
    1220                                                                                  VspKdTreeNode::RayInfo(data.rayData.mRay, 
    1221                                                                                                                                 data.rayData.mRay->mT, 
    1222                                                                                                                                 data.rayData.mMaxT))); 
    1223                         tstack.push(RayTraversalData(in->front, 
    1224                                                                                  VspKdTreeNode::RayInfo(data.rayData.mRay, 
    1225                                                                                                                                 data.rayData.mMinT, 
    1226                                                                                                                                 data.rayData.mRay->mT))); 
     1183                        tstack.push(RayTraversalData(in->GetBack(), 
     1184                                                                                 VspKdTreeNode::RayInfo(data.mRayData.mRay, 
     1185                                                                                                                                data.mRayData.mRay->mT, 
     1186                                                                                                                                data.mRayData.mMaxT))); 
     1187                        tstack.push(RayTraversalData(in->GetFront(), 
     1188                                                                                 VspKdTreeNode::RayInfo(data.mRayData.mRay, 
     1189                                                                                                                                data.mRayData.mMinT, 
     1190                                                                                                                                data.mRayData.mRay->mT))); 
    12271191                } 
    12281192          }  
    12291193          else 
    12301194          if (side == 1) 
    1231                           tstack.push(RayTraversalData(in->front, data.rayData)); 
     1195                          tstack.push(RayTraversalData(in->GetFront(), data.mRayData)); 
    12321196                  else 
    1233                           tstack.push(RayTraversalData(in->back, data.rayData)); 
     1197                          tstack.push(RayTraversalData(in->GetBack(), data.mRayData)); 
    12341198        }  
    12351199        else  
    12361200        { 
    12371201                // directional split 
    1238                 if (data.rayData.mRay->GetDirParametrization(in->axis - 3) > in->position) 
    1239                         tstack.push(RayTraversalData(in->front, data.rayData)); 
     1202                if (data.mRayData.mRay->GetDirParametrization(in->mAxis - 3) > in->mPosition) 
     1203                        tstack.push(RayTraversalData(in->GetFront(), data.mRayData)); 
    12401204                else 
    1241                         tstack.push(RayTraversalData(in->back, data.rayData)); 
     1205                        tstack.push(RayTraversalData(in->GetBack(), data.mRayData)); 
    12421206        } 
    12431207} 
     
    12901254                else  
    12911255                { 
    1292                         tstack.push(((VspKdTreeInterior *)node)->back); 
    1293                         tstack.push(((VspKdTreeInterior *)node)->front); 
     1256                        tstack.push(((VspKdTreeInterior *)node)->GetFront()); 
     1257                        tstack.push(((VspKdTreeInterior *)node)->GetBack()); 
    12941258                } 
    12951259        } 
     
    12981262 
    12991263        // create a new node that will hold the rays 
    1300         VspKdTreeLeaf *newLeaf = new VspKdTreeLeaf(sroot->parent, rayCount); 
    1301          
    1302         if (newLeaf->parent) 
    1303                 newLeaf->parent->ReplaceChildLink(sroot, newLeaf); 
     1264        VspKdTreeLeaf *newLeaf = new VspKdTreeLeaf(sroot->mParent, rayCount); 
     1265         
     1266        if (newLeaf->mParent) 
     1267                newLeaf->mParent->ReplaceChildLink(sroot, newLeaf); 
    13041268 
    13051269        tstack.push(sroot); 
     
    13121276                if (node->IsLeaf())  
    13131277                { 
    1314                         VspKdTreeLeaf *leaf = (VspKdTreeLeaf *) node; 
     1278                        VspKdTreeLeaf *leaf = dynamic_cast<VspKdTreeLeaf *>(node); 
    13151279 
    13161280                        for(VspKdTreeNode::RayInfoContainer::iterator ri = leaf->rays.begin(); 
     
    13331297                else  
    13341298                { 
    1335                         tstack.push(((VspKdTreeInterior *)node)->back); 
    1336                         tstack.push(((VspKdTreeInterior *)node)->front); 
     1299                        VspKdTreeInterior *interior =  
     1300                                dynamic_cast<VspKdTreeInterior *>(node); 
     1301                        tstack.push(interior->GetBack()); 
     1302                        tstack.push(interior->GetFront()); 
    13371303                } 
    13381304        } 
     
    13681334{ 
    13691335        stack<VspKdTreeNode *> tstack; 
    1370         tstack.push(root); 
     1336        tstack.push(mRoot); 
    13711337 
    13721338        Intersectable::NewMail(); 
     
    14071373                else  
    14081374                { 
    1409                         VspKdTreeInterior *in = (VspKdTreeInterior *)node; 
    1410          
    1411                         if (in->axis < 3)  
     1375                        VspKdTreeInterior *in = dynamic_cast<VspKdTreeInterior *>(node); 
     1376         
     1377                        if (in->mAxis < 3)  
    14121378                        { 
    1413                                 if (box.Max(in->axis) >= in->position) 
    1414                                         tstack.push(in->front); 
     1379                                if (box.Max(in->mAxis) >= in->mPosition) 
     1380                                        tstack.push(in->GetFront()); 
    14151381                                 
    1416                                 if (box.Min(in->axis) <= in->position) 
    1417                                         tstack.push(in->back); 
     1382                                if (box.Min(in->mAxis) <= in->mPosition) 
     1383                                        tstack.push(in->GetBack()); 
    14181384                        }  
    14191385                        else  
    14201386                        { 
    14211387                                // both nodes for directional splits 
    1422                                 tstack.push(in->front); 
    1423                                 tstack.push(in->back); 
     1388                                tstack.push(in->GetFront()); 
     1389                                tstack.push(in->GetBack()); 
    14241390                        } 
    14251391                } 
     
    14341400{ 
    14351401        stack<VspKdTreeNode *> tstack; 
    1436         tstack.push(root); 
     1402        tstack.push(mRoot); 
    14371403         
    14381404        minRayContribution = 1.0f; 
     
    14621428                        VspKdTreeInterior *in = (VspKdTreeInterior *)node; 
    14631429                        // both nodes for directional splits 
    1464                         tstack.push(in->front); 
    1465                         tstack.push(in->back); 
    1466                 } 
    1467         } 
    1468          
    1469         cout<<"sum="<<sumRayContribution<<endl; 
    1470         cout<<"leaves="<<leaves<<endl; 
     1430                        tstack.push(in->GetFront()); 
     1431                        tstack.push(in->GetBack()); 
     1432                } 
     1433        } 
     1434         
     1435        cout << "sum=" << sumRayContribution << endl; 
     1436        cout << "leaves=" << leaves << endl; 
    14711437        avgRayContribution = sumRayContribution/(float)leaves; 
    14721438} 
     
    14771443{ 
    14781444        stack<VspKdTreeNode *> tstack; 
    1479         tstack.push(root); 
     1445        tstack.push(mRoot); 
    14801446         
    14811447        while (!tstack.empty())  
     
    14941460                        { 
    14951461                                Vector3 origin = GetBBox(leaf).GetRandomPoint(); 
    1496                                 Vector3 dirVector = GetDirBBox(leaf).GetRandomPoint(); 
     1462                                /*Vector3 dirVector = GetDirBBox(leaf).GetRandomPoint(); 
    14971463                                Vector3 direction = Vector3(sin(dirVector.x), sin(dirVector.y), cos(dirVector.x)); 
    14981464                                //cout<<"dir vector.x="<<dirVector.x<<"direction'.x="<<atan2(direction.x, direction.y)<<endl; 
    1499                                 rays.push_back(SimpleRay(origin, direction)); 
     1465                                rays.push_back(SimpleRay(origin, direction));*/ 
    15001466                        } 
    15011467                         
     
    15031469                else  
    15041470                { 
    1505                         VspKdTreeInterior *in = (VspKdTreeInterior *)node; 
     1471                        VspKdTreeInterior *in =  
     1472                                dynamic_cast<VspKdTreeInterior *>(node); 
    15061473                        // both nodes for directional splits 
    1507                         tstack.push(in->front); 
    1508                         tstack.push(in->back); 
     1474                        tstack.push(in->GetFront()); 
     1475                        tstack.push(in->GetBack()); 
    15091476                } 
    15101477        } 
     
    15171484{ 
    15181485        stack<VspKdTreeNode *> tstack; 
    1519         tstack.push(root); 
     1486        tstack.push(mRoot); 
    15201487 
    15211488        int sumPvs = 0; 
     
    15391506                        VspKdTreeInterior *in = (VspKdTreeInterior *)node; 
    15401507                        // both nodes for directional splits 
    1541                         tstack.push(in->front); 
    1542                         tstack.push(in->back); 
     1508                        tstack.push(in->GetFront()); 
     1509                        tstack.push(in->GetBack()); 
    15431510                } 
    15441511        } 
     
    15521519} 
    15531520 
    1554 AxisAlignedBox3 VspKdTree::GetBBox(const VspKdTreeNode *node)  
    1555 { 
    1556         if (node->parent == NULL) 
    1557                 return mBbox; 
     1521AxisAlignedBox3 VspKdTree::GetBBox(VspKdTreeNode *node) const 
     1522{ 
     1523        if (node->mParent == NULL) 
     1524                return mBox; 
    15581525 
    15591526        if (!node->IsLeaf()) 
    1560                 return ((VspKdTreeInterior *)node)->mBbox; 
    1561  
    1562         if (node->parent->axis >= 3) 
    1563                 return node->parent->mBbox; 
     1527                return (dynamic_cast<VspKdTreeInterior *>(node))->mBox; 
     1528 
     1529        if (node->mParent->mAxis >= 3) 
     1530                return node->mParent->mBox; 
    15641531     
    1565         AxisAlignedBox3 box(node->parent->mBbox); 
    1566         if (node->parent->front == node) 
    1567                 box.SetMin(node->parent->axis, node->parent->position); 
     1532        AxisAlignedBox3 box(node->mParent->mBox); 
     1533        if (node->mParent->mFront == node) 
     1534                box.SetMin(node->mParent->mAxis, node->mParent->mPosition); 
    15681535        else 
    1569                 box.SetMax(node->parent->axis, node->parent->position); 
    1570         return mBbox; 
     1536                box.SetMax(node->mParent->mAxis, node->mParent->mPosition); 
     1537 
     1538        return box; 
    15711539} 
    15721540 
     
    15751543        return GetPvsSize(mRoot, mBox); 
    15761544} 
     1545 
     1546const VspKdStatistics &VspKdTree::GetStatistics() const  
     1547{ 
     1548        return mStat; 
     1549} 
  • trunk/VUT/GtpVisibilityPreprocessor/src/VspKdTree.h

    r418 r419  
    115115public: 
    116116 
     117        friend class VspKdTree; 
    117118#define USE_FIXEDPOINT_T 1 
    118119 
     
    233234   
    234235  // link to the parent 
    235   VspKdTreeInterior *parent; 
     236  VspKdTreeInterior *mParent; 
    236237 
    237238  enum {SPLIT_X=0, SPLIT_Y, SPLIT_Z, SPLIT_DIRX, SPLIT_DIRY, SPLIT_DIRZ}; 
    238239   
    239240  // splitting axis 
    240   char axis; 
     241  char mAxis; 
    241242         
    242243  // depth 
    243   unsigned char depth; 
     244  unsigned char mDepth; 
    244245   
    245246  //  short depth; 
     
    251252   
    252253  virtual ~VspKdTreeNode() {}; 
    253   virtual int Type() const  = 0; 
    254    
    255  
    256   bool IsLeaf() const { return axis == -1; } 
     254  virtual int Type() const = 0; 
     255   
     256 
     257  bool IsLeaf() const { return mAxis == -1; } 
    257258   
    258259  virtual void Print(ostream &s) const = 0; 
    259260 
    260   virtual int GetAccessTime() { 
    261     return 0x7FFFFFF; 
     261  virtual int GetAccessTime()  
     262  { 
     263          return 0x7FFFFFF; 
    262264  } 
    263265 
     
    272274{ 
    273275public: 
    274          
     276        friend class VspKdTree; 
     277 
    275278        VspKdTreeInterior(VspKdTreeInterior *p); 
    276279                         
    277280        virtual int GetAccessTime(); 
    278281         
    279         virtual int Type(); 
     282        virtual int Type() const; 
    280283   
    281284        virtual ~VspKdTreeInterior(); 
    282285     
    283286        virtual void Print(ostream &s) const; 
     287 
     288        inline VspKdTreeNode *GetBack() const; 
     289        inline VspKdTreeNode *GetFront() const; 
    284290 
    285291protected: 
     
    299305 
    300306        // the bbox of the node 
    301         AxisAlignedBox3 mBbox; 
     307        AxisAlignedBox3 mBox; 
    302308 
    303309        // data for caching 
     
    310316// KD-tree node - leaf node 
    311317// -------------------------------------------------------------- 
    312 class VspKdTreeLeaf : public VspKdTreeNode 
     318class VspKdTreeLeaf: public VspKdTreeNode 
    313319{ 
    314 private: 
    315         int mPvsSize; 
    316320public: 
     321        friend class VspKdTree; 
     322 
    317323        static int mailID; 
    318324        int mailbox; 
     
    386392                return sqr(GetPvsSize()/((float)rays.size() + Limits::Small)); 
    387393        } 
    388  
     394private: 
     395        int mPvsSize; 
    389396}; 
    390397 
    391398// Inline functions 
    392399inline VspKdTreeNode::VspKdTreeNode(VspKdTreeInterior *p): 
    393 parent(p), axis(-1), depth(p ? p->depth + 1 : 0)  
     400mParent(p), mAxis(-1), mDepth(p ? p->mDepth + 1 : 0)  
    394401{} 
    395402 
     
    430437        struct TraversalData 
    431438        {   
    432                 VspKdTreeNode *node; 
    433                 AxisAlignedBox3 bbox; 
    434                 int depth; 
    435                 float priority; 
     439                VspKdTreeNode *mNode; 
     440                AxisAlignedBox3 mBox; 
     441                int mDepth; 
     442                float mPriority; 
    436443         
    437444                TraversalData() {} 
    438445 
    439446                TraversalData(VspKdTreeNode *n, const float p): 
    440                 node(n), priority(p) 
     447                mNode(n), mPriority(p) 
    441448                {} 
    442449 
    443450                TraversalData(VspKdTreeNode *n, const AxisAlignedBox3 &b, const int d): 
    444                 node(n), bbox(b), depth(d) {} 
     451                mNode(n), mBox(b), mDepth(d) {} 
    445452     
    446453                // comparator for the  
     
    449456                        bool operator()(const TraversalData a, const TraversalData b)  
    450457                        { 
    451                                 return a.priority < b.priority; 
     458                                return a.mPriority < b.mPriority; 
    452459                        } 
    453460                }; 
     
    459466                { 
    460467                        // return a.node->queries.size() < b.node->queries.size(); 
    461                         VspKdTreeLeaf *leafa = (VspKdTreeLeaf *) a.node; 
    462                         VspKdTreeLeaf *leafb = (VspKdTreeLeaf *) b.node; 
     468                        VspKdTreeLeaf *leafa = (VspKdTreeLeaf *) a.mNode; 
     469                        VspKdTreeLeaf *leafb = (VspKdTreeLeaf *) b.mNode; 
    463470#if 0 
    464471                        return 
    465                                 leafa->rays.size()*a.bbox.GetVolume() 
     472                                leafa->rays.size()*a.mBox.GetVolume() 
    466473                                < 
    467                                 leafb->rays.size()*b.bbox.GetVolume(); 
     474                                leafb->rays.size()*b.mBox.GetVolume(); 
    468475#endif 
    469476#if 1 
    470477                        return 
    471                                 leafa->GetPvsSize()*a.bbox.GetVolume() 
     478                                leafa->GetPvsSize()*a.mBox.GetVolume() 
    472479                                < 
    473                                 leafb->GetPvsSize()*b.bbox.GetVolume(); 
     480                                leafb->GetPvsSize()*b.mBox.GetVolume(); 
    474481#endif 
    475482#if 0 
     
    498505  struct RayTraversalData  
    499506  { 
    500           VspKdTreeNode::RayInfo rayData; 
    501           VspKdTreeNode *node; 
     507          VspKdTreeNode::RayInfo mRayData; 
     508          VspKdTreeNode *mNode; 
    502509       
    503510          RayTraversalData() {} 
    504511           
    505512          RayTraversalData(VspKdTreeNode *n, const VspKdTreeNode::RayInfo &data): 
    506           rayData(data), node(n) {} 
     513          mRayData(data), mNode(n) {} 
    507514  }; 
    508515         
     
    584591                                                int &pvsFront); 
    585592 
    586         AxisAlignedBox3 GetBBox(const VspKdTreeNode *node);      
     593        AxisAlignedBox3 GetBBox(VspKdTreeNode *node) const;      
    587594 
    588595        VspKdTreeNode * SubdivideLeaf(VspKdTreeLeaf *leaf, 
     
    620627        int CollapseSubtree(VspKdTreeNode *sroot, const int time); 
    621628 
    622         const VspKdStatistics &GetStatistics() const { 
    623                 return mStat; 
    624         } 
    625          
    626          
     629        const VspKdStatistics &GetStatistics() const; 
     630         
     631        int ReleaseMemory(const int time); 
     632 
     633        /** Parses the environment and stores the global BSP tree parameters 
     634        */ 
     635        static void ParseEnvironment(); 
     636 
    627637        ///////////////////////////// 
    628638        // Construction parameters 
    629639 
    630640        // max depth of the tree 
    631         int sTermMaxDepth; 
     641        static int sTermMaxDepth; 
    632642 
    633643        // minimal ratio of the volume of the cell and the query volume 
    634         float sTermMinSize; 
     644        static float sTermMinSize; 
    635645 
    636646        // minimal pvs per node to still get subdivided 
    637         int sTermMinPvs; 
     647        static int sTermMinPvs; 
    638648 
    639649        // minimal ray number per node to still get subdivided 
    640         int sTermMinRays; 
     650        static int sTermMinRays; 
    641651         
    642652        // maximal cost ration to subdivide a node 
    643         float sTermMaxCostRatio; 
     653        static float sTermMaxCostRatio; 
    644654         
    645655        // maximal contribution per ray to subdivide the node 
    646         float sTermMaxRayContribution; 
     656        static float sTermMaxRayContribution; 
    647657 
    648658protected: 
  • trunk/VUT/GtpVisibilityPreprocessor/src/X3dExporter.cpp

    r418 r419  
    585585bool X3dExporter::ExportVspKdTree(const VspKdTree &tree) 
    586586{ 
    587          if (mExportRayDensity)  
    588          { 
    589                  return ExportKdTreeRayDensity(tree); 
    590          } 
     587         /*if (mExportRayDensity) {       
     588         return ExportKdTreeRayDensity(tree); }*/ 
    591589      
    592590         stack<VspKdTreeNode *> tStack; 
     
    626624                 { 
    627625                         VspKdTreeInterior *interior = dynamic_cast<VspKdTreeInterior *>(node); 
    628                          tStack.push(interior->mFront); 
    629                          tStack.push(interior->mBack); 
     626                         tStack.push(interior->GetFront()); 
     627                         tStack.push(interior->GetBack()); 
    630628                 } 
    631629         } 
  • trunk/VUT/GtpVisibilityPreprocessor/src/main.cpp

    r409 r419  
    2424  MeshKdTree::ParseEnvironment(); 
    2525  BspTree::ParseEnvironment(); 
     26  VspKdTree::ParseEnvironment(); 
    2627 
    2728  char buff[128]; 
     
    6667          if (BspTree::sConstructionMethod == BspTree::FROM_INPUT_VIEW_CELLS) 
    6768          { 
    68                    // view cells input file name 
     69                  // view cells input file name 
    6970                  environment->GetStringValue("ViewCells.filename", buff); 
    7071                  string vcFilename(buff); 
    71  
    72                   if (vcFilename != "") 
    73                           p->LoadViewCells(vcFilename); 
    74                   else 
    75                           p->GenerateViewCells(); 
    76  
    77                   Debug << "Viewcells loaded / generated. Number of view cells: " << (int)p->mViewCells.size() << endl; 
     72                  p->LoadViewCells(vcFilename); 
     73                  Debug << (int)p->mViewCells.size() << " view cells loaded" << endl; 
    7874          } 
    7975         
Note: See TracChangeset for help on using the changeset viewer.