WebViewEvent::WebViewEvent(const String &wvName, const String& _name, const std::vector<String>& _args) : InputEvent(InputDeviceWPtr(), IdPair(getEventId(), _name)), webview(wvName), name(_name), args(_args) { }
WebViewEvent::WebViewEvent(const String &wvName, const std::vector<DataReference<const char*> >& jsargs) : InputEvent(InputDeviceWPtr(), IdPair(getEventId(), jsargs.empty()?std::string():std::string(jsargs[0].data(), jsargs[0].length()))), webview(wvName) { if (jsargs.size() >= 1) { name = std::string(jsargs[0].data(), jsargs[0].length()); args.reserve(jsargs.size()-1); for (size_t i = 1; i < jsargs.size(); i++) { args.push_back(std::string(jsargs[i].data(), jsargs[i].length())); } } }
void DynamicConfidence::init() { cout << "Reading reconstruction" << endl; CHECK(theia::ReadReconstruction(file_io.getReconstruction(), &reconstruction)) << "Can not open reconstruction file"; CHECK_EQ(reconstruction.NumViews(), file_io.getTotalNum()); const vector<theia::ViewId> &vids = reconstruction.ViewIds(); orderedId.resize(vids.size()); for (auto i = 0; i < vids.size(); ++i) { const theia::View *v = reconstruction.View(vids[i]); std::string nstr = v->Name().substr(5, 5); int idx = atoi(nstr.c_str()); orderedId[i] = IdPair(idx, vids[i]); } std::sort(orderedId.begin(), orderedId.end(), [](const std::pair<int, theia::ViewId> &v1, const std::pair<int, theia::ViewId> &v2) { return v1.first < v2.first; }); }