Changeset 12852

Show
Ignore:
Timestamp:
10/26/11 14:48:57 (2 years ago)
Author:
robert
Message:

Added password support into present3D's vnc support via the tag usage : <vnc password="mypassword">hostname</vnc>

Location:
OpenSceneGraph/trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/applications/present3D/present3D.cpp

    r12847 r12852  
    443443    } 
    444444 
     445    // set up any logins required for http access 
     446    std::string url, username, password; 
     447    while(arguments.read("--login",url, username, password)) 
     448    { 
     449        if (!osgDB::Registry::instance()->getAuthenticationMap()) 
     450        { 
     451            osgDB::Registry::instance()->setAuthenticationMap(new osgDB::AuthenticationMap); 
     452            osgDB::Registry::instance()->getAuthenticationMap()->addAuthenticationDetails( 
     453                url, 
     454                new osgDB::AuthenticationDetails(username, password) 
     455            ); 
     456        } 
     457    } 
     458 
     459 
    445460 
    446461#ifdef USE_SDL 
  • OpenSceneGraph/trunk/include/osgPresentation/SlideShowConstructor

    r12508 r12852  
    395395 
    396396    void addGraph(const std::string& filename,const std::string& options,const PositionData& positionData, const ImageData& imageData); 
    397     void addVNC(const std::string& filename,const PositionData& positionData, const ImageData& imageData); 
     397    void addVNC(const std::string& filename,const PositionData& positionData, const ImageData& imageData, const std::string& password); 
    398398    void addBrowser(const std::string& filename,const PositionData& positionData, const ImageData& imageData); 
    399399    void addPDF(const std::string& filename,const PositionData& positionData, const ImageData& imageData); 
  • OpenSceneGraph/trunk/src/osgPlugins/p3d/ReaderWriterP3D.cpp

    r12821 r12852  
    13141314            getProperties(cur,imageData); 
    13151315 
     1316            std::string password; 
     1317            getProperty(cur, "password", password); 
     1318 
    13161319            constructor.addVNC(cur->getTrimmedContents(), 
    13171320                                    positionRead ? positionData : constructor.getImagePositionData(), 
    1318                                     imageData); 
     1321                                    imageData, 
     1322                                    password 
     1323                              ); 
    13191324        } 
    13201325        else if (cur->name == "browser") 
  • OpenSceneGraph/trunk/src/osgPresentation/SlideShowConstructor.cpp

    r12843 r12852  
    12781278 
    12791279 
    1280 void SlideShowConstructor::addVNC(const std::string& hostname, const PositionData& positionData, const ImageData& imageData) 
    1281 { 
     1280void SlideShowConstructor::addVNC(const std::string& hostname, const PositionData& positionData, const ImageData& imageData, const std::string& password) 
     1281{ 
     1282    if (!password.empty()) 
     1283    { 
     1284        OSG_NOTICE<<"Setting password"<<std::endl; 
     1285        if (!osgDB::Registry::instance()->getAuthenticationMap()) osgDB::Registry::instance()->setAuthenticationMap(new osgDB::AuthenticationMap); 
     1286        osgDB::Registry::instance()->getAuthenticationMap()->addAuthenticationDetails(hostname, new osgDB::AuthenticationDetails("", password)); 
     1287    } 
     1288     
    12821289    addInteractiveImage(hostname+".vnc", positionData, imageData); 
    12831290}