From: Braden M. <br...@en...> - 2007-07-09 14:51:25
|
On Mon, 2007-07-09 at 09:37 -0400, Larry Mullen wrote: > Thanks again Braden. I was able to build openvrml and everything else > in the project. I really appreciate your help. > > Couple more questions > > 1. If I run sdl_viewer.cpp with a valid url (example > http://www.3dtrue.com/vrml/wrl/vrmlelevator.wrl) I get the following > error > > unreachable URI > no alternative URI could be resolved Hm; could be a bug. I'll look into this. > 2. If I give the url as "file:///C:\temp\001\001.wrl" (which exists) I > get the following error > > invalid URI > no alternative URI could be resolved This is working as designed; URIs don't have '\' in them. Try using '/' instead. > 3. As you mentioned as reply to my initial questions, to verify that a > VRML is constructed correctly, I need to load it into a scene. So if > the following code does not throw an exception, that implies my VRML > is contructed properly, correct? > > try { > using std::string; > using std::vector; > const string url = argv[1]; > > sdl_viewer v(url); > browser b; > > vector<string> uri(1, url); > vector<string> parameter; > b.load_url(uri, parameter); > openvrml::scene s(b); > > s.load(*s.get_resource(uri).get()); > > > > > } catch (std::exception & ex) { > cerr << ex.what() << endl; > return EXIT_FAILURE; > } That's not very efficient; you end up loading the file twice. browser::load_url should be all you need. The problem, though, is that browser::load_url does not block. If you use it and you want to confirm it succeeded, you can add a browser_listener for the initialized event. However, it's probably easier for you just to use browser::set_world instead of browser::load_url. set_world blocks; and if it finishes without throwing, you're good. -- Braden McDaniel e-mail: <br...@en...> <http://endoframe.com> Jabber: <br...@ja...> |