Changeset 1294


Ignore:
Timestamp:
08/29/06 17:34:19 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
13 edited

Legend:

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

    r1293 r1294  
    213213        Environment::GetSingleton()->GetFloatValue("BvHierarchy.Termination.minGlobalCostRatio", 
    214214                mTermMinGlobalCostRatio); 
    215         Environment::GetSingleton()->GetIntValue("BvHierarchy.Termination.globalCostMissTolerance", mTermGlobalCostMissTolerance); 
     215        Environment::GetSingleton()->GetIntValue("BvHierarchy.Termination.globalCostMissTolerance",  
     216                mTermGlobalCostMissTolerance); 
    216217 
    217218        //-- factors for bsp tree split plane heuristics 
     
    285286        // add the new nodes to the tree 
    286287        BvhInterior *node = new BvhInterior(tData.mBoundingBox, leaf->GetParent()); 
    287         //cout << "bbox: " << tData.mBoundingBox << endl; 
    288  
     288         
    289289 
    290290        //-- the front and back traversal data is filled with the new values 
     
    292292        frontData.mDepth = backData.mDepth = tData.mDepth + 1; 
    293293 
    294         frontData.mBoundingBox = ComputeBoundingBox(frontObjects, &(tData.mBoundingBox)); 
    295         backData.mBoundingBox = ComputeBoundingBox(backObjects, &(tData.mBoundingBox)); 
     294        frontData.mBoundingBox = ComputeBoundingBox(frontObjects, &tData.mBoundingBox); 
     295        backData.mBoundingBox = ComputeBoundingBox(backObjects, &tData.mBoundingBox); 
    296296         
    297297        ///////////// 
     
    354354        if (!LocalTerminationCriteriaMet(tData) && !globalCriteriaMet) 
    355355        {        
     356                //-- continue subdivision 
     357 
    356358                BvhTraversalData tFrontData; 
    357359                BvhTraversalData tBackData; 
    358  
    359                 //-- continue subdivision 
    360                  
     360                         
    361361                // create new interior node and two leaf node 
    362362                newNode = SubdivideNode(sc->mFrontObjects, 
     
    392392 
    393393                // delete old leaf node 
    394                 DEL_PTR(tData.mNode); 
     394                //DEL_PTR(tData.mNode); 
    395395        } 
    396396 
     
    409409                        CollectRays(leaf->mObjects, leaf->mVssRays); 
    410410                } 
    411         } 
    412          
    413         tData.Clear(); // cleanup 
     411 
     412                // detach node so it won't get deleted 
     413                tData.mNode = NULL; 
     414        } 
    414415         
    415416        return newNode; 
     
    447448        const float renderCostDecr = oldRenderCost - newRenderCost; 
    448449 
    449         //Debug << "render cost decr: " << renderCostDecr << endl; 
     450        Debug << "\nbvh render cost decr: " << renderCostDecr << endl; 
    450451        splitCandidate.SetRenderCostDecrease(renderCostDecr); 
    451452 
    452 #if 0 
    453         const float priority = (float)-data.mDepth; 
     453#if 1 
     454        const float priority = (float)-splitCandidate.mParentData.mDepth; 
    454455#else    
    455456        // take render cost of node into account  
     
    469470        // matt: TODO 
    470471        return ( 0 
    471                 || (data.mNode->mObjects.size() < mTermMinObjects) 
    472                 || (data.mProbability <= mTermMinProbability) 
    473                 || (data.mDepth >= mTermMaxDepth) 
     472                //|| ((int)data.mNode->mObjects.size() < mTermMinObjects) 
     473                //|| (data.mProbability <= mTermMinProbability) 
     474                //|| (data.mDepth >= mTermMaxDepth) 
    474475                 ); 
    475476} 
     
    536537                AxisAlignedBox3 box = obj->GetBox(); 
    537538 
    538                 const float objMid = (box.Max(axis) + box.Min(axis)) * 0.5; 
     539                const float objMid = (box.Max(axis) + box.Min(axis)) * 0.5f; 
    539540 
    540541                // object mailed => belongs to back objects 
     
    936937 
    937938        const float viewSpaceVol = mVspTree->GetBoundingBox().GetVolume(); 
    938         Debug << "\n***** eval render cost *********\n"  
     939        /*Debug << "\nbvh render cost\n"  
    939940                  << "back p: " << pBack / viewSpaceVol << " front p " << pFront / viewSpaceVol << endl 
    940                   << "new rc: " << newRenderCost / viewSpaceVol << endl; 
     941                  << "new rc: " << newRenderCost / viewSpaceVol << endl;*/ 
    941942                  
    942943 
     
    13191320} 
    13201321 
     1322void BvHierarchy::CreateRoot(const ObjectContainer &objects) 
     1323{ 
     1324        //-- create new root 
     1325        AxisAlignedBox3 box = ComputeBoundingBox(objects); 
     1326        BvhLeaf *bvhleaf = new BvhLeaf(box, NULL, (int)objects.size()); 
     1327        bvhleaf->mObjects = objects; 
     1328 
     1329        mRoot = bvhleaf; 
     1330 
     1331        // associate root with current objects 
     1332        AssociateObjectsWithLeaf(bvhleaf); 
     1333} 
     1334 
    13211335 
    13221336SubdivisionCandidate *BvHierarchy::PrepareConstruction(const VssRayContainer &sampleRays, 
    1323                                                                                                            const ObjectContainer &objects 
    1324                                                                                                            //,AxisAlignedBox3 *forcedObjectSpace 
    1325                                                                                                            ) 
     1337                                                                                                           const ObjectContainer &objects) 
    13261338{ 
    13271339        // note matt: we assume that we have objects sorted by their id 
     
    13321344 
    13331345        // compute bounding box from objects 
    1334         mBoundingBox = ComputeBoundingBox(objects); 
     1346        // we assume that root was already created 
     1347        mBoundingBox = mRoot->GetBoundingBox(); 
     1348        BvhLeaf *bvhleaf = dynamic_cast<BvhLeaf *>(mRoot); 
    13351349 
    13361350        mTermMinProbability *= mBoundingBox.GetVolume(); 
    13371351        mGlobalCostMisses = 0; 
    13381352         
    1339         //-- create new root 
    1340  
    1341         BvhLeaf *bvhleaf = new BvhLeaf(mBoundingBox, NULL, (int)objects.size()); 
    1342         bvhleaf->mObjects = objects; 
    1343         mRoot = bvhleaf; 
    1344  
    13451353        // only rays intersecting objects in node are interesting 
    13461354        AssociateObjectsWithRays(sampleRays); 
    1347         // associate root with current objects 
    1348         AssociateObjectsWithLeaf(bvhleaf); 
    1349  
    1350         //-- add first candidate for object space partition 
    1351          
     1355         
     1356 
    13521357        // probabilty is voume of all "seen" view cells 
    13531358#if 1 
    1354         const float prop = EvalViewCellsVolume(bvhleaf->mObjects); 
     1359        const float prop = EvalViewCellsVolume(objects); 
    13551360#else 
    13561361        const float prop = GetBoundingBox().GetVolume(); 
     
    13601365        BvhTraversalData oData(bvhleaf, 0, mBoundingBox, prop); 
    13611366 
    1362         //-- first split candidate 
     1367        //-- add first candidate for object space partition      
    13631368        BvhSubdivisionCandidate *oSubdivisionCandidate =  
    13641369                new BvhSubdivisionCandidate(oData); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.h

    r1291 r1294  
    134134        virtual bool IsLeaf() const = 0; 
    135135 
    136         //virtual int Type() const = 0; 
    137  
    138136        /** Determines whether this node is a root 
    139137                @return true if root 
     
    205203        */ 
    206204        bool IsLeaf() const; 
    207         //int Type() const; 
    208  
     205         
    209206        BvhNode *GetBack() { return mBack; } 
    210207        BvhNode *GetFront() { return mFront; } 
     
    249246        bool IsLeaf() const; 
    250247         
    251         //int Type() const; 
    252  
    253248        SubdivisionCandidate *GetSubdivisionCandidate() const  
    254249        {  
     
    292287        {   
    293288        public: 
    294                 /// the current node 
    295                 BvhLeaf *mNode; 
    296                 /// current depth 
    297                 int mDepth; 
    298                 /// the probability that this node is seen 
    299                 float mProbability; 
    300                 /// the bounding box of the node 
    301                 AxisAlignedBox3 mBoundingBox; 
    302                 /// how often this branch has missed the max-cost ratio 
    303                 int mMaxCostMisses; 
    304                 /// current axis 
    305                 int mAxis; 
    306                 /// current priority 
    307                 float mPriority; 
    308  
    309  
     289                 
    310290                BvhTraversalData(): 
    311291                mNode(NULL), 
     
    335315                float GetCost() const 
    336316                { 
    337                         //cout << mPriority << endl; 
    338317                        return mPriority; 
    339318                } 
     
    342321                void Clear() 
    343322                { 
    344                         //DEL_PTR(mRays); 
     323                        DEL_PTR(mNode); 
    345324                } 
     325 
     326                /// the current node 
     327                BvhLeaf *mNode; 
     328                /// current depth 
     329                int mDepth; 
     330                /// the probability that this node is seen 
     331                float mProbability; 
     332                /// the bounding box of the node 
     333                AxisAlignedBox3 mBoundingBox; 
     334                /// how often this branch has missed the max-cost ratio 
     335                int mMaxCostMisses; 
     336                /// current axis 
     337                int mAxis; 
     338                /// current priority 
     339                float mPriority; 
     340 
    346341 
    347342                friend bool operator<(const BvhTraversalData &a, const BvhTraversalData &b) 
     
    356351        {   
    357352        public: 
    358                 static BvHierarchy *sBvHierarchy; 
    359  
    360                 /// parent data 
    361                 BvhTraversalData mParentData; 
    362                 ObjectContainer mFrontObjects; 
    363                 ObjectContainer mBackObjects; 
    364  
    365                 BvhSubdivisionCandidate(const BvhTraversalData &tData): mParentData(tData) 
     353 
     354        BvhSubdivisionCandidate(const BvhTraversalData &tData): mParentData(tData) 
    366355                {}; 
     356 
     357                ~BvhSubdivisionCandidate() { mParentData.Clear(); } 
    367358 
    368359                int Type() const { return OBJECT_SPACE; } 
     
    377368                        return sBvHierarchy->GlobalTerminationCriteriaMet(mParentData); 
    378369                } 
    379  
    380370 
    381371                BvhSubdivisionCandidate( 
     
    385375                mFrontObjects(frontObjects), mBackObjects(backObjects), mParentData(tData) 
    386376                {} 
     377 
     378                 
     379                static BvHierarchy *sBvHierarchy; 
     380 
     381                /// parent data 
     382                BvhTraversalData mParentData; 
     383                ObjectContainer mFrontObjects; 
     384                ObjectContainer mBackObjects; 
    387385        }; 
    388386 
     
    401399        }; 
    402400 
    403         //typedef std::priority_queue<VspTraversalData> VspOspTraversalQueue; 
    404401 
    405402        /** Default constructor creating an empty tree. 
     
    616613        float GetMemUsage() const; 
    617614 
    618  
     615        /** Creates new root of hierarchy. 
     616        */ 
     617        void CreateRoot(const ObjectContainer &objects); 
    619618 
    620619        ///////////////////////////// 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp

    r1293 r1294  
    14971497                "0"); 
    14981498 
    1499         RegisterOption("ViewCells.storeKdPvs", 
    1500                 optBool,  
    1501                 "view_cells_store_kd_pvs=",  
    1502                 "false"); 
    1503          
    1504  
     1499         
    15051500        /************************************************************************************/ 
    15061501        /*                         Render simulation related options                        */ 
     
    22202215                                        "vsp_construction_max_band=", 
    22212216                                        "0.99"); 
    2222  
    2223         RegisterOption("VspTree.useKdPvsForHeuristics", 
    2224                                         optBool, 
    2225                                         "vsp_use_kd_pvs_for_heuristics=", 
    2226                                         "true"); 
    2227  
    2228         RegisterOption("VspTree.storeKdPvs", 
    2229                                         optBool, 
    2230                                         "vsp_store_kd_pvs=", 
    2231                                         "true"); 
    22322217         
    22332218        RegisterOption("VspTree.maxTests", 
     
    22412226/*           Object space partition tree related options               */ 
    22422227/***********************************************************************/ 
     2228 
    22432229 
    22442230        RegisterOption("OspTree.Construction.randomize", 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GzBinFileInputStream.h

    r1264 r1294  
    111111    //  Unimplemented constructors and operators 
    112112    // ----------------------------------------------------------------------- 
     113 
    113114    GzBinFileInputStream(const GzBinFileInputStream&); 
    114115    GzBinFileInputStream& operator=(const GzBinFileInputStream&);    
     
    121122    //      per platform. 
    122123    // ----------------------------------------------------------------------- 
     124 
    123125    FileHandle              fSource; 
    124126    MemoryManager* const    fMemoryManager; 
     
    129131//  GzBinFileInputStream: Getter methods 
    130132// --------------------------------------------------------------------------- 
     133 
    131134inline bool GzBinFileInputStream::getIsOpen() const 
    132135{ 
    133         return (mStream.is_open());//(fSource != 0); 
     136        return bool (mStream.is_open());//(fSource != 0); 
    134137} 
    135138 
  • GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp

    r1293 r1294  
    9797 
    9898        Environment::GetSingleton()->GetIntValue( 
     99                "Hierarchy.Termination.maxLeaves", mTermMaxLeaves); 
     100 
     101        Environment::GetSingleton()->GetIntValue( 
    99102                "Hierarchy.Construction.type", mConstructionType); 
    100103 
    101         //Debug << "max depth: " << mTermMaxDepth << endl; 
     104        Debug << "******** Hierachy Manager Parameters ***********" << endl; 
     105        Debug << "max leaves: " << mTermMaxLeaves << endl; 
    102106        Debug << "min global cost ratio: " << mTermMinGlobalCostRatio << endl; 
    103107        Debug << "global cost miss tolerance: " << mTermGlobalCostMissTolerance << endl; 
     
    145149                                                                                   RayInfoContainer &objectSpaceRays) 
    146150{ 
    147         SubdivisionCandidate *vsc =  
    148                 mVspTree->PrepareConstruction(sampleRays, forcedViewSpace, viewSpaceRays); 
    149  
    150         mTQueue.Push(vsc); 
    151  
    152     SubdivisionCandidate *osc; 
     151        mHierarchyStats.Reset(); 
     152        mHierarchyStats.Start(); 
    153153 
    154154        switch (mObjectSpaceSubdivisonType) 
    155155        { 
    156156        case KD_BASED_OBJ_SUBDIV: 
    157                 osc = mOspTree->PrepareConstruction(sampleRays, objects, objectSpaceRays); 
    158                 mTQueue.Push(osc); 
    159                 break; 
    160         case BV_BASED_OBJ_SUBDIV: 
    161                 osc = mBvHierarchy->PrepareConstruction(sampleRays, objects); 
    162                 mTQueue.Push(osc); 
    163                 break; 
    164         default: 
    165                 break; 
    166         } 
     157                { 
     158                        SubdivisionCandidate *vsc =  
     159                                mVspTree->PrepareConstruction(sampleRays, forcedViewSpace, viewSpaceRays); 
     160                        mTQueue.Push(vsc); 
     161 
     162                        SubdivisionCandidate *osc; 
     163                        osc = mOspTree->PrepareConstruction(sampleRays, objects, objectSpaceRays); 
     164                        mTQueue.Push(osc); 
     165                } 
     166                break; 
     167        case BV_BASED_OBJ_SUBDIV: 
     168                { 
     169                        mBvHierarchy->CreateRoot(objects); 
     170 
     171                        SubdivisionCandidate *vsc =  
     172                                mVspTree->PrepareConstruction(sampleRays, forcedViewSpace, viewSpaceRays); 
     173                        mTQueue.Push(vsc); 
     174 
     175                        SubdivisionCandidate *osc; 
     176                        osc = mBvHierarchy->PrepareConstruction(sampleRays, objects); 
     177                        mTQueue.Push(osc); 
     178                } 
     179                break; 
     180        default: 
     181                break; 
     182        } 
     183 
     184        mTotalCost = (float)objects.size(); 
     185        Debug << " setting total cost to " << mTotalCost << endl; 
    167186} 
    168187 
     
    211230{ 
    212231        return (0 
    213                 || (mHierarchyStats.Leaves() >= mMaxLeaves)  
    214                 || (mGlobalCostMisses >= mTermGlobalCostMissTolerance) 
    215                 ||      candidate->GlobalTerminationCriteriaMet() 
     232                || (mHierarchyStats.Leaves() >= mTermMaxLeaves)  
     233                //|| (mGlobalCostMisses >= mTermGlobalCostMissTolerance) 
     234                //||    candidate->GlobalTerminationCriteriaMet() 
    216235                ); 
    217236} 
     
    250269                                                *objectSpaceRays); 
    251270 
    252         mHierarchyStats.Reset(); 
    253         mHierarchyStats.Start(); 
    254271 
    255272        cout << "Constructing view space / object space tree ... \n"; 
    256273        const long startTime = GetTime();        
    257274         
    258         RunConstruction(true); 
     275        const bool repairQueue = true; 
     276 
     277        // process object space candidates 
     278        RunConstruction(repairQueue); 
    259279 
    260280        cout << "finished in " << TimeDiff(startTime, GetTime())*1e-3 << " secs" << endl; 
     
    264284 
    265285 
     286void HierarchyManager::ConstructBvHierarchy(const VssRayContainer &sampleRays, 
     287                                                                                        const ObjectContainer &objects)  
     288 
     289{ 
     290        Debug << "\n$$$$$$$$$ bv hierarchy construction $$$$$$$$$$\n" << endl; 
     291        cout << "starting bv hierarchy construction ... " << endl; 
     292 
     293        mBvHierarchy->CreateRoot(objects); 
     294 
     295        // compute first candidate 
     296        SubdivisionCandidate *sc = 
     297                mBvHierarchy->PrepareConstruction(sampleRays, objects); 
     298 
     299        mTotalCost = mBvHierarchy->mTotalCost; 
     300        Debug << "reseting cost, new total cost: " << mTotalCost << endl; 
     301         
     302    mTQueue.Push(sc); 
     303 
     304        mBvHierarchy->mBvhStats.Reset(); 
     305        mBvHierarchy->mBvhStats.Start(); 
     306 
     307        const long startTime = GetTime(); 
     308        const bool repairQueue = false; 
     309 
     310        cout << "finished in " << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; 
     311 
     312        mBvHierarchy->mBvhStats.Stop(); 
     313} 
     314 
     315 
     316void HierarchyManager::ConstructOspTree(const VssRayContainer &sampleRays, 
     317                                                                                const ObjectContainer &objects)  
     318 
     319{ 
     320        RayInfoContainer *objectSpaceRays = new RayInfoContainer(); 
     321 
     322        Debug << "\n$$$$$$$$$ osp tree construction $$$$$$$$$$\n" << endl; 
     323        cout << "starting osp tree construction ... " << endl; 
     324 
     325        // start with one big kd cell - all objects can be seen from everywhere 
     326        // note: only true for view space = object space 
     327 
     328        // compute first candidate 
     329        SubdivisionCandidate *osc = 
     330                mOspTree->PrepareConstruction(sampleRays, objects, *objectSpaceRays); 
     331 
     332        mTotalCost = mOspTree->mTotalCost; 
     333        Debug << "reseting cost, new total cost: " << mTotalCost << endl; 
     334         
     335    mTQueue.Push(osc); 
     336 
     337        mOspTree->mOspStats.Reset(); 
     338        mOspTree->mOspStats.Start(); 
     339 
     340        const long startTime = GetTime(); 
     341                 
     342        cout << "finished in " << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; 
     343 
     344        mOspTree->mOspStats.Stop(); 
     345 
     346        ////////////////////////// 
     347        // matt: only for debugging purpose 
     348 
     349        const float rc = mOspTree->EvalRenderCost(sampleRays); 
     350 
     351        Debug << "My render cost evalulation: " << rc << endl; 
     352} 
     353 
     354 
     355 
    266356bool HierarchyManager::ApplySubdivisionCandidate(SubdivisionCandidate *sc) 
    267357{ 
    268358        const bool globalTerminationCriteriaMet = GlobalTerminationCriteriaMet(sc); 
    269  
    270359        const bool vspSplit = (sc->Type() == SubdivisionCandidate::VIEW_SPACE); 
    271360 
     
    289378                { 
    290379                        BvhNode *n = mBvHierarchy->Subdivide(mTQueue, sc, globalTerminationCriteriaMet); 
     380 
    291381                        if (n->IsLeaf()) // local or global termination criteria failed 
    292382                                return false; 
     
    305395        while (!FinishedConstruction()) 
    306396        { 
    307                 SubdivisionCandidate *splitCandidate = NextSubdivisionCandidate(); 
     397                mCurrentCandidate = NextSubdivisionCandidate(); 
    308398             
    309                 mTotalCost -= splitCandidate->GetRenderCostDecrease(); 
     399                mTotalCost -= mCurrentCandidate->GetRenderCostDecrease(); 
    310400 
    311401                // cost ratio of cost decrease / totalCost 
    312                 const float costRatio = splitCandidate->GetRenderCostDecrease() / mTotalCost; 
     402                const float costRatio = mCurrentCandidate->GetRenderCostDecrease() / mTotalCost; 
    313403 
    314404                //Debug << "ratio: " << costRatio << " min ratio: " << mTermMinGlobalCostRatio << endl; 
     
    318408                //-- subdivide leaf node 
    319409 
    320                 if (ApplySubdivisionCandidate(splitCandidate)) 
     410                if (ApplySubdivisionCandidate(mCurrentCandidate)) 
    321411                { 
    322412                        mHierarchyStats.nodes += 2; 
    323413 
    324414                        // subdivision successful 
    325                         EvalSubdivisionStats(*splitCandidate); 
     415                        EvalSubdivisionStats(*mCurrentCandidate); 
    326416                 
    327417                        // reevaluate candidates affected by the split 
     
    330420                        if (repair) RepairQueue(); 
    331421 
    332                         cout << "candidate: " << splitCandidate->Type() << ", priority: "  
    333                                  << splitCandidate->GetPriority() << endl; 
    334                 } 
    335  
    336                 DEL_PTR(splitCandidate); 
     422                        cout << "candidate: " << mCurrentCandidate->Type() << ", priority: "  
     423                                 << mCurrentCandidate->GetPriority() << endl; 
     424                } 
     425 
     426                DEL_PTR(mCurrentCandidate); 
    337427        } 
    338428} 
     
    345435 
    346436 
    347 void HierarchyManager::CollectObjectSpaceDirtyList( 
    348         SubdivisionCandidateContainer &dirtyList) 
     437void HierarchyManager::CollectObjectSpaceDirtyList(SubdivisionCandidateContainer &dirtyList) 
    349438{ 
    350439        switch (mObjectSpaceSubdivisonType) 
     
    383472void HierarchyManager::CollectDirtyCandidates(SubdivisionCandidateContainer &dirtyList) 
    384473{        
     474        Debug << "here65" << endl; 
    385475        // we have either a object space or view space split 
    386476        if (mCurrentCandidate->Type() == SubdivisionCandidate::VIEW_SPACE) 
    387477        { 
     478                Debug << "collected view space candidate" << endl; 
    388479                CollectViewSpaceDirtyList(dirtyList); 
    389480        } 
    390481        else // object space split 
    391482        {        
     483                Debug << "collecting object space candidate" << endl; 
    392484                CollectObjectSpaceDirtyList(dirtyList); 
    393485        } 
     
    423515        for (sit = dirtyList.begin(); sit != sit_end; ++ sit) 
    424516        { 
     517                Debug << "here4423" << endl; 
    425518                SubdivisionCandidate* sc = *sit; 
    426519 
     
    428521 
    429522                // reevaluate 
    430                 sc->EvalPriority(); 
     523                //sc->EvalPriority(); 
    431524 
    432525                // reinsert 
     
    553646        RayInfoContainer *viewSpaceRays = new RayInfoContainer(); 
    554647         
     648 
    555649        ///////////////////////////////////////////////////////////// 
    556650        // view space space partition 
    557651        ///////////////////////////////////////////////////////////// 
    558652 
     653 
    559654        // use objects for evaluating vsp tree construction 
    560655        const int savedobjectSpaceSubdivisionType = mObjectSpaceSubdivisonType; 
     
    610705                break; 
    611706        } 
    612 } 
    613  
    614  
    615 void HierarchyManager::ConstructBvHierarchy(const VssRayContainer &sampleRays, 
    616                                                                                         const ObjectContainer &objects 
    617                                                                                         //,AxisAlignedBox3 *forcedViewSpace 
    618                                                                                         )  
    619  
    620 { 
    621         Debug << "\n$$$$$$$$$ bv hierarchy construction $$$$$$$$$$\n" << endl; 
    622         cout << "starting bv hierarchy construction ... " << endl; 
    623  
    624         //ObjectContainer obj = objects; 
    625  
    626         // compute first candidate 
    627         SubdivisionCandidate *sc = 
    628                 mBvHierarchy->PrepareConstruction(sampleRays, objects); 
    629  
    630         mTotalCost = mBvHierarchy->mTotalCost; 
    631         Debug << "reseting cost, new total cost: " << mTotalCost << endl; 
    632          
    633     mTQueue.Push(sc); 
    634  
    635         mBvHierarchy->mBvhStats.Reset(); 
    636         mBvHierarchy->mBvhStats.Start(); 
    637  
    638         const long startTime = GetTime(); 
    639         const bool repairQueue = false; 
    640707 
    641708        // process object space candidates 
    642709        RunConstruction(repairQueue); 
    643          
    644         cout << "finished in " << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; 
    645  
    646         mBvHierarchy->mBvhStats.Stop(); 
    647 } 
    648  
    649  
    650 void HierarchyManager::ConstructOspTree(const VssRayContainer &sampleRays, 
    651                                                                                 const ObjectContainer &objects)  
    652  
    653 { 
    654         RayInfoContainer *objectSpaceRays = new RayInfoContainer(); 
    655  
    656         Debug << "\n$$$$$$$$$ osp tree construction $$$$$$$$$$\n" << endl; 
    657         cout << "starting osp tree construction ... " << endl; 
    658  
    659         // start with one big kd cell - all objects can be seen from everywhere 
    660         // note: only true for view space = object space 
    661  
    662         // compute first candidate 
    663         SubdivisionCandidate *osc = 
    664                 mOspTree->PrepareConstruction(sampleRays, objects, *objectSpaceRays); 
    665  
    666         mTotalCost = mOspTree->mTotalCost; 
    667         Debug << "reseting cost, new total cost: " << mTotalCost << endl; 
    668          
    669     mTQueue.Push(osc); 
    670  
    671         mOspTree->mOspStats.Reset(); 
    672         mOspTree->mOspStats.Start(); 
    673  
    674         const long startTime = GetTime(); 
    675         const bool repairQueue = false; 
    676          
    677         // process object space candidates 
    678         RunConstruction(repairQueue); 
    679          
    680         cout << "finished in " << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; 
    681  
    682         mOspTree->mOspStats.Stop(); 
    683  
    684         ////////////////////////// 
    685         // matt: only for debugging purpose 
    686  
    687         const float rc = mOspTree->EvalRenderCost(sampleRays); 
    688  
    689         Debug << "My render cost evalulation: " << rc << endl; 
    690 } 
    691  
    692  
    693  
    694 } 
     710} 
     711 
     712 
     713} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h

    r1293 r1294  
    290290        HierarchyStatistics mHierarchyStats; 
    291291 
    292         int mMaxLeaves; 
     292        int mTermMaxLeaves; 
    293293        ofstream mSubdivisionStats; 
    294294}; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/OspTree.cpp

    r1291 r1294  
    895895        } 
    896896 
    897         Debug << "here32 " << touchedViewCells.size() << endl; 
     897        Debug << "here32 " << (int)touchedViewCells.size() << endl; 
    898898        return renderCost; 
    899899} 
     
    17931793                } 
    17941794        } 
    1795         Debug << "here65 " << touchedObjects.size() << endl; 
     1795        Debug << "here65 " << (int)touchedObjects.size() << endl; 
    17961796        ObjectContainer::const_iterator it, it_end = touchedObjects.end(); 
    17971797        for (it = touchedObjects.begin(); it != it_end; ++ it) 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r1293 r1294  
    475475} 
    476476 
     477 
    477478HierarchyManager *Preprocessor::CreateHierarchyManager(const char *name) 
    478479{ 
     
    850851                                                                         ) 
    851852{ 
     853#ifdef GTP_INTERNAL 
    852854        VssRay *vssRay  = NULL; 
    853855        int hits = 0; 
     
    859861         
    860862        double normal[3]; 
    861 #ifdef GTP_INTERNAL 
     863 
    862864        hittriangle = mlrtaIntersectAS(&viewPoint.x, 
    863865                                                                   &direction.x, 
    864866                                                                   normal, 
    865867                                                                   dist); 
    866 #else 
    867         hittriangle = -1; 
    868 #endif 
     868 
    869869        if (hittriangle !=-1 ) { 
    870870          if (hittriangle >= mFaceParents.size()) 
     
    881881        } 
    882882 
     883         
    883884        Vector3 dir = -direction; 
    884 #ifdef GTP_INTERNAL 
    885885        hittriangle = mlrtaIntersectAS(&viewPoint.x, 
    886886                                                                   &dir.x, 
    887887                                                                   normal, 
    888888                                                                   dist); 
    889 #else 
    890         hittriangle = -1; 
    891 #endif 
    892889 
    893890        if (hittriangle !=-1 ) { 
     
    913910                                          box 
    914911                                          ); 
     912#else 
     913        return -1; 
     914#endif 
    915915} 
    916916 
     
    929929                return 0; 
    930930         
     931#ifdef GTP_INTERNAL 
    931932        float pforg[3]; 
    932933        float pfdir[3]; 
     
    936937        pfdir[0] = direction[0]; pfdir[1] = direction[1]; pfdir[2] = direction[2]; 
    937938 
    938         float dist = 0; 
    939 #ifdef GTP_INTERNAL 
     939        float dist; 
    940940        const int hittriangle = mlrtaIntersectAS(pforg, pfdir, pfnorm, dist); 
    941 #else 
    942         const int hittriangle = -1; 
    943 #endif 
    944941 
    945942        if (hittriangle == -1) 
     
    970967          } 
    971968        } 
     969 
     970#else 
     971        const int hittriangle = -1; 
     972        return NULL; 
     973#endif 
     974 
     975         
    972976         
    973977} 
     
    13301334        { 
    13311335        case INTEL_RAYCASTER: { 
    1332           float dist; 
     1336          
    13331337          int hittriangle; 
     1338           
     1339 
     1340#ifdef GTP_INTERNAL 
     1341          float dist;  
    13341342          double n[3]; 
    13351343 
    1336 #ifdef GTP_INTERNAL 
    13371344          hittriangle = mlrtaIntersectAS(&viewPoint.x, 
    13381345                                                                         &direction.x, 
     
    13401347                                                                         dist); 
    13411348 
    1342 #else 
    1343         hittriangle = -1; 
    1344 #endif 
    1345  
    1346           if (hittriangle !=-1 ) { 
     1349           if (hittriangle !=-1 ) { 
    13471350                if (hittriangle >= mFaceParents.size()) 
    13481351                  cerr<<"Warning: traingle index out of range! "<<hittriangle<<endl; 
     
    13531356                } 
    13541357          } 
     1358#else 
     1359        hittriangle = -1; 
     1360#endif 
     1361 
     1362          
    13551363          break; 
    13561364        } 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h

    r1284 r1294  
    227227                                                          ) = 0; 
    228228 
     229        /** Returns a stats about the global pvs. 
     230        */ 
    229231        virtual void GetPvsStatistics(PvsStatistics &stat); 
    230232 
     
    378380                                                                                vector<MergeCandidate> &candidates); 
    379381 
     382        /** Collects n view cells and stores it as the active view cells. 
     383        */ 
    380384        void CollectViewCells(const int n); 
    381385 
     
    453457        ////////////////////////////////////////////////////////7 
    454458        // visiblity filter options 
     459 
    455460        // TODO: write own visibiltiy filter class 
    456461        void ApplyFilter(KdTree *kdTree, 
     
    472477        float GetAbsFilterWidth(); 
    473478 
    474          
    475479        /** Returns the bounding box of filter width. 
    476480        */ 
    477481        AxisAlignedBox3 GetFilterBBox(const Vector3 &viewPoint, const float width) const; 
    478482 
     483        ////////////////////////////////////////////////////////////////// 
    479484 
    480485        /** Returns true if the view cell is equivalent to a  
     
    482487                view cell. 
    483488                e.g. to see if the spatial tree can be reduced on this location 
     489                note: not implemented 
    484490        */ 
    485491        virtual bool EqualToSpatialNode(ViewCell *viewCell) const; 
     
    502508protected: 
    503509 
    504         /** Exports bounding boxes as xml stream 
    505         */ 
    506         //bool ExportBoundingBoxes(ofstream &xmlstream, const ObjectContainer &objects) const; 
    507  
    508510        /** Intersects box with the tree and returns the number of intersected boxes. 
    509511                @returns number of view cells found 
     
    520522        bool ViewCellsTreeConstructed() const; 
    521523 
     524        /** Requests preprocessor to cast samplesPerPass samples of a specific type. 
     525        */ 
    522526        int CastPassSamples(const int samplesPerPass,  
    523527                                                const int sampleType,  
     
    717721                                                ViewCellContainer &viewcells); 
    718722         
     723        /** Returns the probability that the view point lies 
     724                in this view cells. 
     725        */ 
    719726        float GetProbability(ViewCell *viewCell); 
    720          
    721  
    722         /** Get a viewcell containing the specified point  
     727 
     728        /** Get a viewcell containing the specified point. 
    723729        */ 
    724730        ViewCell *GetViewCell(const Vector3 &point, const bool active = false) const; 
    725731 
     732        /** Creates mesh for this view cell. 
     733        */ 
    726734        void CreateMesh(ViewCell *vc); 
    727735 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp

    r1287 r1294  
    12431243 
    12441244                if (attrName == "min")  
    1245                 {cout << "here6" << endl; 
     1245                { 
    12461246                        sscanf(ptr, "%f %f %f", &minBox.x, &minBox.y, &minBox.z); 
    12471247                } 
    12481248                if (attrName == "max")  
    1249                 {cout << "here7" << endl; 
     1249                { 
    12501250                        sscanf(ptr, "%f %f %f", &maxBox.x, &maxBox.y, &maxBox.z); 
    12511251                } 
     
    12621262        } 
    12631263        else 
    1264         {cout << "here18" << endl; 
     1264        { 
    12651265                mHierarchyManager->mBvHierarchy->mRoot = interior; 
    12661266        } 
    1267 cout << "here28" << endl; 
     1267 
    12681268        mCurrentBvhNode = interior; 
    12691269} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp

    r1293 r1294  
    527527inline bool VspTree::LocalTerminationCriteriaMet(const VspTraversalData &data) const 
    528528{ 
    529         const bool localTerminationCriteriaMet = ( 
    530                 ((int)data.mRays->size() <= mTermMinRays) || 
    531                 (data.mPvs <= mTermMinPvs)   || 
    532                 (data.mProbability <= mTermMinProbability) || 
    533                 (data.GetAvgRayContribution() > mTermMaxRayContribution) || 
    534                 (data.mDepth >= mTermMaxDepth) 
     529        const bool localTerminationCriteriaMet = (0 
     530                //|| ((int)data.mRays->size() <= mTermMinRays) 
     531                //|| (data.mPvs <= mTermMinPvs) 
     532                //|| (data.mProbability <= mTermMinProbability) 
     533                //|| (data.GetAvgRayContribution() > mTermMaxRayContribution) 
     534                //|| (data.mDepth >= mTermMaxDepth) 
    535535                ); 
    536536 
     
    545545        } 
    546546 
    547         return localTerminationCriteriaMet; 
    548                  
     547        return localTerminationCriteriaMet;              
    549548} 
    550549 
     
    552551inline bool VspTree::GlobalTerminationCriteriaMet(const VspTraversalData &data) const 
    553552{ 
    554         const bool terminationCriteriaMet = ( 
    555                 // mOutOfMemory ||  
    556                 (mVspStats.Leaves() >= mMaxViewCells) ||  
    557         (mGlobalCostMisses >= mTermGlobalCostMissTolerance)  
     553        const bool terminationCriteriaMet = (0 
     554                // || mOutOfMemory 
     555                || (mVspStats.Leaves() >= mMaxViewCells) 
     556        || (mGlobalCostMisses >= mTermGlobalCostMissTolerance)  
    558557                ); 
    559558 
     
    674673 
    675674                // delete old leaf node 
    676                 DEL_PTR(tData.mNode); 
     675                //DEL_PTR(tData.mNode); 
    677676        } 
    678677 
     
    713712                // finally evaluate statistics for this leaf 
    714713                EvaluateLeafStats(tData); 
    715         } 
    716  
    717         //-- cleanup 
    718         tData.Clear(); 
    719          
     714 
     715                // detach node so it won't get deleted 
     716                tData.mNode = NULL; 
     717        } 
     718 
    720719        return newNode; 
    721720} 
     
    750749        splitCandidate.SetRenderCostDecrease(renderCostDecr); 
    751750 
    752 #if 0 
    753         const float priority = (float)-data.mDepth; 
     751#if 1 
     752        const float priority = (float)-splitCandidate.mParentData.mDepth; 
    754753#else    
    755754 
     
    14261425        const float renderCostDecrease = (oldRenderCost - newRenderCost) / viewSpaceVol; 
    14271426         
    1428         Debug << "\n==== eval render cost decrease ===" << endl 
     1427        Debug << "\neval vsp render cost decrease" << endl 
    14291428                  << "back pvs: " << pvsBack << " front pvs " << pvsFront << " total pvs: " << totalPvs << endl  
    14301429                  << "back p: " << pBack / viewSpaceVol << " front p " << pFront / viewSpaceVol << " p: " << pOverall / viewSpaceVol << endl 
     
    26302629 
    26312630        //-- prepare view space partition 
    2632  
    2633         // add first candidate for view space partition 
     2631        const float prop = mBoundingBox.GetVolume(); 
     2632         
     2633        // we assume that leaf was already created 
    26342634        VspLeaf *leaf = new VspLeaf(); 
    26352635        mRoot = leaf; 
    2636  
    2637         const float prop = mBoundingBox.GetVolume(); 
    26382636 
    26392637        // first vsp traversal data 
     
    26492647                oit_end = leaf->GetViewCell()->GetPvs().mEntries.end(); 
    26502648 
    2651  
    26522649        for (oit = leaf->GetViewCell()->GetPvs().mEntries.begin(); oit != oit_end; ++ oit) 
    26532650        { 
     
    26582655 
    26592656        //-- compute first split candidate 
    2660  
    26612657        VspSubdivisionCandidate *splitCandidate = new VspSubdivisionCandidate(vData); 
    26622658    EvalSubdivisionCandidate(*splitCandidate); 
     
    26692665 
    26702666 
    2671 void VspTree::CollectDirtyCandidates(VspSubdivisionCandidate *sc,  
    2672                                                                          vector<SubdivisionCandidate *> &dirtyList) 
    2673 { 
    2674         VspTraversalData &tData = sc->mParentData; 
    2675         VspLeaf *node = tData.mNode; 
    2676          
    2677         KdLeaf::NewMail(); 
    2678  
    2679         RayInfoContainer::const_iterator rit, rit_end = tData.mRays->end(); 
    2680  
    2681         // add all kd nodes seen by the rays 
    2682         for (rit = tData.mRays->begin(); rit != rit_end; ++ rit) 
    2683         { 
    2684                 VssRay *ray = (*rit).mRay; 
    2685          
    2686                 KdLeaf *leaf = mHierarchyManager->mOspTree->GetLeaf(ray->mOrigin, ray->mOriginNode); 
    2687          
    2688                 if (!leaf->Mailed()) 
    2689                 { 
    2690                         leaf->Mail(); 
    2691                         dirtyList.push_back(leaf->mSubdivisionCandidate); 
    2692                 } 
    2693                  
    2694                 leaf = mHierarchyManager->mOspTree->GetLeaf(ray->mTermination, ray->mTerminationNode); 
    2695          
    2696                 if (!leaf->Mailed()) 
    2697                 { 
    2698                         leaf->Mail(); 
    2699                         dirtyList.push_back(leaf->mSubdivisionCandidate); 
    2700                 } 
    2701         } 
    2702 } 
    2703  
    2704  
    2705 int VspTree::EvalMaxEventContribution(const VssRay &ray,  
    2706                                                                           const bool isTermination) const 
     2667void VspTree::CollectDirtyCandidate(const VssRay &ray,  
     2668                                                                        const bool isTermination, 
     2669                                                                        vector<SubdivisionCandidate *> &dirtyList) const 
    27072670{ 
    27082671        Intersectable *obj; 
     
    27122675        ray.GetSampleData(isTermination, pt, &obj, &node); 
    27132676 
     2677        if (!obj) return; 
     2678 
     2679        switch (mHierarchyManager->GetObjectSpaceSubdivisonType()) 
     2680        { 
     2681        case HierarchyManager::KD_BASED_OBJ_SUBDIV: 
     2682                { 
     2683                        KdLeaf *leaf = mHierarchyManager->mOspTree->GetLeaf(pt, node); 
     2684 
     2685                        if (!leaf->Mailed()) 
     2686                        { 
     2687                                leaf->Mail(); 
     2688                                dirtyList.push_back(leaf->mSubdivisionCandidate); 
     2689                        } 
     2690 
     2691                        break; 
     2692                } 
     2693        case HierarchyManager::BV_BASED_OBJ_SUBDIV: 
     2694                { 
     2695                } 
     2696                break; 
     2697        default: 
     2698                break; 
     2699        } 
     2700} 
     2701 
     2702 
     2703void VspTree::CollectDirtyCandidates(VspSubdivisionCandidate *sc,  
     2704                                                                         vector<SubdivisionCandidate *> &dirtyList) 
     2705{ 
     2706        VspTraversalData &tData = sc->mParentData; 
     2707        VspLeaf *node = tData.mNode; 
     2708         
     2709        KdLeaf::NewMail(); 
     2710        BvhLeaf::NewMail(); 
     2711 
     2712        RayInfoContainer::const_iterator rit, rit_end = tData.mRays->end(); 
     2713 
     2714        // add all kd nodes seen by the rays 
     2715        for (rit = tData.mRays->begin(); rit != rit_end; ++ rit) 
     2716        { 
     2717                VssRay *ray = (*rit).mRay; 
     2718         
     2719                CollectDirtyCandidate(*ray, true, dirtyList); 
     2720                CollectDirtyCandidate(*ray, false, dirtyList); 
     2721        } 
     2722} 
     2723 
     2724 
     2725int VspTree::EvalMaxEventContribution(const VssRay &ray,  
     2726                                                                          const bool isTermination) const 
     2727{ 
     2728        Intersectable *obj; 
     2729        Vector3 pt; 
     2730        KdNode *node; 
     2731 
     2732        ray.GetSampleData(isTermination, pt, &obj, &node); 
     2733 
    27142734        if (!obj)  
    27152735                return 0; 
     
    27172737        int pvs = 0; 
    27182738 
    2719         switch ( mHierarchyManager->GetObjectSpaceSubdivisonType()) 
     2739        switch (mHierarchyManager->GetObjectSpaceSubdivisonType()) 
    27202740        { 
    27212741        case HierarchyManager::NO_OBJ_SUBDIV: 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.h

    r1292 r1294  
    342342        {   
    343343        public: 
     344                 
     345                /** Returns average ray contribution. 
     346                */ 
     347                float GetAvgRayContribution() const 
     348                { 
     349                        return (float)mPvs / ((float)mRays->size() + Limits::Small); 
     350                } 
     351 
     352 
     353                VspTraversalData(): 
     354                mNode(NULL), 
     355                mDepth(0), 
     356                mRays(NULL), 
     357                mPvs(0), 
     358                mProbability(0.0), 
     359                mMaxCostMisses(0),  
     360                mPriority(0) 
     361                {} 
     362                 
     363                VspTraversalData(VspLeaf *node,  
     364                                                 const int depth,  
     365                                                 RayInfoContainer *rays, 
     366                                                 const int pvs, 
     367                                                 const float p, 
     368                                                 const AxisAlignedBox3 &box): 
     369                mNode(node),  
     370                mDepth(depth),  
     371                mRays(rays), 
     372                mPvs(pvs), 
     373                mProbability(p), 
     374                mBoundingBox(box), 
     375                mMaxCostMisses(0), 
     376                mPriority(0) 
     377                {} 
     378 
     379                VspTraversalData(const int depth,  
     380                                                 RayInfoContainer *rays, 
     381                                                 const AxisAlignedBox3 &box):  
     382                mNode(NULL),  
     383                mDepth(depth),  
     384                mRays(rays), 
     385                mPvs(0), 
     386                mProbability(0), 
     387                mMaxCostMisses(0), 
     388                mBoundingBox(box) 
     389                {} 
     390 
     391                /** Returns cost of the traversal data. 
     392                */ 
     393                float GetCost() const 
     394                { 
     395                        return mPriority; 
     396                } 
     397 
     398                /// deletes contents and sets them to NULL 
     399                void Clear() 
     400                { 
     401                        DEL_PTR(mRays); 
     402                        DEL_PTR(mNode); 
     403                } 
     404 
    344405                /// the current node 
    345406                VspLeaf *mNode; 
     
    360421 
    361422                 
    362                 /** Returns average ray contribution. 
    363                 */ 
    364                 float GetAvgRayContribution() const 
    365                 { 
    366                         return (float)mPvs / ((float)mRays->size() + Limits::Small); 
    367                 } 
    368  
    369  
    370                 VspTraversalData(): 
    371                 mNode(NULL), 
    372                 mDepth(0), 
    373                 mRays(NULL), 
    374                 mPvs(0), 
    375                 mProbability(0.0), 
    376                 mMaxCostMisses(0),  
    377                 mPriority(0) 
    378                 {} 
    379                  
    380                 VspTraversalData(VspLeaf *node,  
    381                                                  const int depth,  
    382                                                  RayInfoContainer *rays, 
    383                                                  const int pvs, 
    384                                                  const float p, 
    385                                                  const AxisAlignedBox3 &box): 
    386                 mNode(node),  
    387                 mDepth(depth),  
    388                 mRays(rays), 
    389                 mPvs(pvs), 
    390                 mProbability(p), 
    391                 mBoundingBox(box), 
    392                 mMaxCostMisses(0), 
    393                 mPriority(0) 
    394                 {} 
    395  
    396                 VspTraversalData(const int depth,  
    397                                                  RayInfoContainer *rays, 
    398                                                  const AxisAlignedBox3 &box):  
    399                 mNode(NULL),  
    400                 mDepth(depth),  
    401                 mRays(rays), 
    402                 mPvs(0), 
    403                 mProbability(0), 
    404                 mMaxCostMisses(0), 
    405                 mBoundingBox(box) 
    406                 {} 
    407  
    408                 /** Returns cost of the traversal data. 
    409                 */ 
    410                 float GetCost() const 
    411                 { 
    412                         //cout << mPriority << endl; 
    413                         return mPriority; 
    414                 } 
    415  
    416                 /// deletes contents and sets them to NULL 
    417                 void Clear() 
    418                 { 
    419                         DEL_PTR(mRays); 
    420                 } 
    421  
    422423                friend bool operator<(const VspTraversalData &a, const VspTraversalData &b) 
    423424                { 
     
    441442                VspSubdivisionCandidate(const VspTraversalData &tData): mParentData(tData) 
    442443                {}; 
     444 
     445                ~VspSubdivisionCandidate() { mParentData.Clear(); } 
    443446 
    444447                int Type() const { return VIEW_SPACE; } 
     
    922925        */ 
    923926        void CollectDirtyCandidates(VspSubdivisionCandidate *sc, vector<SubdivisionCandidate *> &dirtyList); 
     927 
     928        void CollectDirtyCandidate( 
     929                const VssRay &ray,  
     930                const bool isTermination, 
     931                vector<SubdivisionCandidate *> &dirtyList) const; 
    924932 
    925933        /** Rays will be clipped to the bounding box. 
  • GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp

    r1292 r1294  
    112112  string result = filename; 
    113113 
    114   int pos = filename.rfind(a, filename.size()-1); 
     114  int pos = filename.rfind(a, (int)filename.size() - 1); 
    115115  if (pos == filename.size() - a.size()) { 
    116116        result.replace(pos, a.size(), b); 
Note: See TracChangeset for help on using the changeset viewer.