Ignore:
Timestamp:
05/18/08 00:30:13 (16 years ago)
Author:
mattausch
Message:

fixed several problems

File:
1 edited

Legend:

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

    r2648 r2686  
    136136 
    137137        ViewCellPoints *currentViewCell = NULL; 
    138         int i = 0; 
    139         int j = 0; 
     138 
     139        AxisAlignedBox3 bbox = mViewCellsManager->GetViewSpaceBox(); 
    140140 
    141141        string buf; 
     
    152152                                currentViewCell->first = mViewCellsManager->GetViewCellById(id); 
    153153                                         
    154                                 if (1)//i ++ < 5) 
    155                                 { 
    156                                         viewCells.push_back(currentViewCell); 
    157                                         j = 0; 
    158                                 } 
     154                                viewCells.push_back(currentViewCell); 
     155 
    159156                                break; 
    160157                        } 
     
    164161                                sscanf(buf.c_str(), "p %f %f %f %f %f %f", &pt.x, &pt.y, &pt.z, &dir.x, &dir.y, &dir.z); 
    165162                                 
     163                                if (0) 
     164                                { 
     165                                        // add new point to view space box 
     166                                        if (!bbox.IsInside(pt)) 
     167                                                bbox.Include(pt); 
     168                                } 
     169                                else 
     170                                { 
     171                                        // other variant: clamp to box 
     172                                        bbox.ClampToBox(pt); 
     173                                } 
     174 
    166175                                SimpleRay ray(pt, dir, 0, 1); 
    167176 
    168                                 if (1)//j ++ < 5) 
    169                                         currentViewCell->second.push_back(ray); 
     177                                // no view cell specified => create dummy view cell 
     178                                if (!currentViewCell) 
     179                                { 
     180                                        currentViewCell = new ViewCellPoints(); 
     181                                        viewCells.push_back(currentViewCell); 
     182                                        currentViewCell->first = NULL; 
     183                                } 
     184 
     185                                currentViewCell->second.push_back(ray); 
    170186 
    171187                                break; 
     
    175191                } 
    176192        } 
     193 
     194        // set updated view space box containing all view points 
     195        mViewCellsManager->SetViewSpaceBox(bbox); 
    177196 
    178197        return true; 
Note: See TracChangeset for help on using the changeset viewer.