Ignore:
Timestamp:
12/10/08 15:57:06 (16 years ago)
Author:
mattausch
Message:

worked on video replay function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/WalkThroughRecorder.cpp

    r3219 r3220  
    1717 
    1818 
     19WalkThroughRecorder::~WalkThroughRecorder() 
     20{ 
     21        mFile.close(); 
     22} 
     23 
     24 
    1925void WalkThroughRecorder::WriteFrame(Camera *cam) 
    2026{ 
     
    2834{ 
    2935        ifstream file(filename.c_str()); 
    30         FrameInfo info; 
    31         int i=0; 
    3236 
    33         std::string token; 
     37        if (file.is_open()) 
     38        { 
     39                FrameInfo info; 
     40                int i=0; 
    3441 
    35         while(std::getline(file, token))  
     42                std::string token; 
     43 
     44                while(std::getline(file, token))  
     45                { 
     46                        std::stringstream line(token); 
     47 
     48                        line >> info; 
     49                        mFrameInfos.push_back(info); 
     50                } 
     51        } 
     52        else 
    3653        { 
    37                 std::stringstream line(token); 
     54                cerr << "problem: cannot open file " << filename << endl; 
     55        } 
    3856 
    39                 line >> info; 
    40                 mFrameInfos.push_back(info); 
    41         } 
     57        file.close(); 
    4258} 
    4359 
     
    4561bool WalkThroughPlayer::ReadNextFrame(Camera *cam) 
    4662{ 
     63        if (mFrameInfos.empty()) 
     64                return false; 
     65 
    4766        cam->SetDirection(mFrameInfos[mFrame].mDirection); 
    4867        cam->SetPosition(mFrameInfos[mFrame].mPosition); 
Note: See TracChangeset for help on using the changeset viewer.