示例#1
0
文件: list.cpp 项目: AMDmi3/osm2go
void list_view_scroll(GtkTreeView *view, GtkTreeSelection *sel, GtkTreeIter* iter) {
  GtkTreeModel *model = gtk_tree_view_get_model(view);

  gtk_tree_selection_select_iter(sel, iter);

  tree_path_guard mpath(gtk_tree_model_get_path(model, iter));
  gtk_tree_view_scroll_to_cell(view, mpath.get(), nullptr, FALSE, 0.0f, 0.0f);
}
示例#2
0
文件: kb.cpp 项目: lockcda/ckb
Kb::Kb(QObject *parent, const QString& path) :
    QThread(parent), devpath(path), cmdpath(path + "/cmd"),
    features("N/A"), firmware("N/A"), pollrate("N/A"),
    _currentProfile(0), _currentMode(0), _model(KeyMap::NO_MODEL),
    _hwProfile(0), prevProfile(0), prevMode(0),
    cmd(cmdpath), notifyNumber(1), _needsSave(false)
{
    memset(hwLoading, 0, sizeof(hwLoading));
    // Get the features, model, serial number, FW version (if available), and poll rate (if available) from /dev nodes
    QFile ftpath(path + "/features"), mpath(path + "/model"), spath(path + "/serial"), fwpath(path + "/fwversion"), ppath(path + "/pollrate");
    if(ftpath.open(QIODevice::ReadOnly)){
        features = ftpath.read(1000);
        features = features.trimmed();
        ftpath.close();
        // Read model from features (first word: vendor, second word: product)
        QStringList list = features.split(" ");
        if(list.length() < 2)
            return;
        _model = KeyMap::getModel(list[1]);
        if(_model == KeyMap::NO_MODEL)
            return;
    } else
        // Bail if features aren't readable
        return;
    if(mpath.open(QIODevice::ReadOnly)){
        usbModel = mpath.read(100);
        usbModel = usbModel.remove("Corsair").remove("Gaming").remove("Keyboard").remove("Mouse").remove("Bootloader").trimmed();
        mpath.close();
    }
    if(usbModel == "")
        usbModel = "Keyboard";
    if(spath.open(QIODevice::ReadOnly)){
        usbSerial = spath.read(100);
        usbSerial = usbSerial.trimmed().toUpper();
        spath.close();
    }
    if(usbSerial == "")
        usbSerial = "Unknown-" + usbModel;
    if(features.contains("fwversion") && fwpath.open(QIODevice::ReadOnly)){
        firmware = fwpath.read(100);
        firmware = QString::number(firmware.trimmed().toInt() / 100., 'f', 2);
        fwpath.close();
    }
    if(features.contains("pollrate") && ppath.open(QIODevice::ReadOnly)){
        pollrate = ppath.read(100);
        pollrate = pollrate.trimmed();
        ppath.close();
    }

    hwModeCount = (_model == KeyMap::K95) ? 3 : 1;
    // Open cmd in non-blocking mode so that it doesn't lock up if nothing is reading
    // (e.g. if the daemon crashed and didn't clean up the node)
    int fd = open(cmdpath.toLatin1().constData(), O_WRONLY | O_NONBLOCK);
    if(!cmd.open(fd, QIODevice::WriteOnly, QFileDevice::AutoCloseHandle))
        return;

    // Find an available notification node (if none is found, take notify1)
    for(int i = 1; i < 10; i++){
        QString notify = QString(path + "/notify%1").arg(i);
        if(!QFile::exists(notify)){
            notifyNumber = i;
            notifyPath = notify;
            break;
        }
    }
    cmd.write(QString("notifyon %1\n").arg(notifyNumber).toLatin1());
    cmd.flush();
    // Activate device, apply settings, and ask for hardware profile
    cmd.write(QString("fps %1\n").arg(_frameRate).toLatin1());
    cmd.write(QString("dither %1\n").arg(static_cast<int>(_dither)).toLatin1());
#ifdef Q_OS_MACX
    // Write ANSI/ISO flag to daemon (OSX only)
    cmd.write("layout ");
    cmd.write(KeyMap::isISO(_layout) ? "iso" : "ansi");
#endif
    cmd.write(QString("\nactive\n@%1 get :hwprofileid").arg(notifyNumber).toLatin1());
    hwLoading[0] = true;
    for(int i = 0; i < hwModeCount; i++){
        cmd.write(QString(" mode %1 get :hwid").arg(i + 1).toLatin1());
        hwLoading[i + 1] = true;
    }
    cmd.write("\n");
    cmd.flush();

    emit infoUpdated();
    activeDevices.insert(this);

    // Start a separate thread to read from the notification node
    start();
}
示例#3
0
GList<GURL>
DjVuMessage::GetProfilePaths(void)
{
  static bool first=true;
  static GList<GURL> realpaths;
  if(first)
  {
    first=false;
    GMap<GUTF8String,void *> pathsmap;
    GList<GURL> paths;
    GURL path;
    const GUTF8String envp(GOS::getenv(DjVuEnv));
    if(envp.length())
      appendPath(GURL::Filename::UTF8(envp),pathsmap,paths);
#if defined(WIN32) || defined(UNIX)
    GURL mpath(GetModulePath());
    if(!mpath.is_empty() && mpath.is_dir())
    {
#if defined(UNIX) && !defined(AUTOCONF) && !defined(NDEBUG)
      appendPath(GURL::UTF8(DebugModuleDjVuDir,mpath),pathsmap,paths);
#endif
      appendPath(mpath,pathsmap,paths);
      mpath=mpath.base();
      appendPath(GURL::UTF8(ModuleDjVuDir,mpath),pathsmap,paths);
      mpath=mpath.base();
      appendPath(GURL::UTF8(ModuleDjVuDir,mpath),pathsmap,paths);
    }
#endif
#if defined(AUTOCONF)
    GURL dpath = GURL::Filename::UTF8(DjVuDataDir);
    appendPath(dpath,pathsmap,paths);
#endif
#ifdef WIN32
    appendPath(RegOpenReadConfig(HKEY_CURRENT_USER),pathsmap,paths);
    appendPath(RegOpenReadConfig(HKEY_LOCAL_MACHINE),pathsmap,paths);
#else
    GUTF8String home=GOS::getenv("HOME");
# if HAVE_GETPWUID
    if (! home.length()) {
      struct passwd *pw=0;
      if ((pw = getpwuid(getuid())))
        home=GNativeString(pw->pw_dir);
    }
# endif
    if (home.length()) {
      GURL hpath = GURL::UTF8(LocalDjVuDir,GURL::Filename::UTF8(home));
      appendPath(hpath,pathsmap,paths);
    }
#endif
#ifdef LT_DEFAULT_PREFIX
    appendPath(GURL::Filename::UTF8(DjVuPrefixDir),pathsmap,paths);
#endif
    appendPath(GURL::Filename::UTF8(RootDjVuDir),pathsmap,paths);
    pathsmap.empty();

    GPosition pos;
    GList< GMap<GUTF8String,GP<lt_XMLTags> > > localemaps;
    for(pos=paths;pos;++pos)
    {
      path=GURL::UTF8(LanguageFile,paths[pos]);
      if(path.is_file())
      {
        const GP<lt_XMLTags> xml(lt_XMLTags::create(ByteStream::create(path,"rb")));
        const GPList<lt_XMLTags> Body(xml->get_Tags(bodystring));
        GPosition pos=Body;
        if(!pos || (pos != Body.lastpos()))
        {
          G_THROW( ERR_MSG("XMLAnno.extra_body") );
        }
        const GP<lt_XMLTags> GBody(Body[pos]);
        if(!GBody)
        {
          G_THROW( ERR_MSG("XMLAnno.no_body") );
        }
        GMap<GUTF8String,GP<lt_XMLTags> > localemap;
        lt_XMLTags::get_Maps(languagestring,localestring,Body,localemap);
        localemaps.append(localemap);
      }
    } 
    GList<GURL> localepaths;
    GList<GURL> osilocalepaths;

    // Need to do it the right way!
    GUTF8String defaultlocale = getenv("LANGUAGE");
    if (! defaultlocale) 
      {
        const GUTF8String oldlocale(setlocale(LC_MESSAGES,0));
        defaultlocale = setlocale(LC_MESSAGES,"");
        setlocale(LC_MESSAGES,(const char *)oldlocale);
      }
    // Unfathomable search.
    for(int loop=0; loop<2; loop++)
    {
      static const char sepchars[]=" _.@";
      const char *p=sepchars+sizeof(sepchars)-1;
      do
      {
        int sepcharpos=p[0]?defaultlocale.search(p[0]):defaultlocale.length();
        if(sepcharpos > 0)
        {
          const GUTF8String sublocale(defaultlocale,sepcharpos);
          const GUTF8String downcasesublocale("downcase^"+sublocale.downcase());
          for(pos=localemaps;pos;++pos) 
          {
            const GMap<GUTF8String,GP<lt_XMLTags> > &localemap=localemaps[pos];
            GPosition pos=localemap.contains(sublocale);
            if(!pos)
              pos=localemap.contains(downcasesublocale);
            if(pos)
            {
              const GMap<GUTF8String,GUTF8String>&args
                = localemap[pos]->get_args();
              pos = args.contains(srcstring);
              if (pos)
              {
                const GUTF8String src(args[pos]);
                for(pos=paths;pos;++pos)
                {
                  path=GURL::UTF8(src,paths[pos]);
                  if(path.is_dir())
                    localepaths.append(path);
                  path=GURL::UTF8(GUTF8String(opensourcedir)+"/"+src,paths[pos]);
                  if(path.is_dir())
                    osilocalepaths.append(path);
                }
              }
              // We don't need to check anymore language files.
              p=sepchars;
              break;
            }
          }
          if(!pos)
          {
            for(pos=paths;pos;++pos)
            {
              path=GURL::UTF8(sublocale,paths[pos]);
              if(path.is_dir())
              {
                localepaths.append(path);
              }
              path=GURL::UTF8(GUTF8String(opensourcedir)+"/"+sublocale,paths[pos]);
              if(path.is_dir())
              {
                osilocalepaths.append(path);
              }
            }
          }
        }
      } while(p-- != sepchars);
      if((GPosition) localepaths)
        break;
      defaultlocale="C";
    }
    for(pos=localepaths;pos;++pos)
      appendPath(localepaths[pos],pathsmap,realpaths);
    for(pos=paths;pos;++pos)
      appendPath(paths[pos],pathsmap,realpaths);
    for(pos=osilocalepaths;pos;++pos)
      appendPath(osilocalepaths[pos],pathsmap,realpaths);
    for(pos=paths;pos;++pos)
      {
        path=GURL::UTF8(opensourcedir,paths[pos]);
        appendPath(path,pathsmap,realpaths);
      }
  }
  return realpaths;
}
示例#4
0
void InitMaps()
{
    hash_map<wstring,WORD> slots;

    // process boots map file
    hash_map<DWORD,wstring> mapFile;
    wstring mpath(getPesInfo()->gdbDir);
    mpath += L"GDB\\boots\\map.txt";
    if (!readMap(mpath.c_str(), mapFile))
    {
        LOG1S(L"Couldn't open boots map for reading: {%s}",mpath.c_str());
    }
    else
    {
        int slot = 0;
        for (hash_map<DWORD,wstring>::iterator it = mapFile.begin(); it != mapFile.end(); it++)
        {
            wstring boot(it->second);
            string_strip(boot);
            if (!boot.empty())
                string_strip_quotes(boot);

            if (!boot.empty())
            {
                // check that the file exists, so that we don't crash
                // later, when it's attempted to replace a boot.
                wstring filename(getPesInfo()->gdbDir);
                filename += L"GDB\\boots\\" + boot;
                HANDLE handle;
                DWORD size;
                if (OpenFileIfExists(filename.c_str(), handle, size))
                {
                    CloseHandle(handle);
                    if (slot >= MAX_BOOTS)
                    {
                        LOG2N(L"ERROR in bootserver map: Too many boots: %d (MAX supported = %d). Aborting map processing", slot, MAX_BOOTS);
                        break;
                    }

                    hash_map<wstring,WORD>::iterator wit = slots.find(boot);
                    if (wit != slots.end())
                    {
                        // boot already has an assigned slot
                        _boot_slots.insert(pair<DWORD,WORD>(
                                    it->first, wit->second));
                    }
                    else
                    {
                        _boot_slots.insert(pair<DWORD,WORD>(
                                    it->first, FIRST_EXTRA_BOOT_SLOT + slot));
                        slots.insert(pair<wstring,WORD>(
                                    boot, FIRST_EXTRA_BOOT_SLOT + slot));
                        slot++;
                    }
                }
                else
                    LOG1N1S(L"ERROR in bootserver map for ID = %d: FAILED to open boot BIN \"%s\". Skipping", it->first, boot.c_str());
            }
        }
    }

    if (_bootserv_config._random_boots)
    {
        // enumerate all boots and add them to the slots list
        wstring dir(getPesInfo()->gdbDir);
        dir += L"GDB\\boots\\";

        // normalize the path
        wchar_t fullpath[MAX_PATH];
        GetFullPathName(dir.c_str(), MAX_PATH, fullpath, 0);
        dir = fullpath;

        int count;
        LOG(L"Enumerating all boots in GDB...");
        EnumerateBoots(dir, count);
        _num_random_boots = count;
        LOG1N(L"_num_random_boots = %d", _num_random_boots);
    }

    // initialize fast bin lookup table
    for (hash_map<wstring,WORD>::iterator sit = slots.begin();
            sit != slots.end();
            sit++)
    {
        _fast_bin_table[sit->second - FIRST_EXTRA_BOOT_SLOT] = 
            new wstring(sit->first);
        if (k_bootserv.debug)
            LOG1N1S(L"slot %d <-- boot {%s}", sit->second, sit->first.c_str());
    }

    LOG1N(L"Total assigned GDB boots: %d", slots.size());
    LOG1N(L"Total random GDB boots: %d", _num_random_boots);

    if (slots.size() > 0)
        _num_slots = FIRST_EXTRA_BOOT_SLOT + slots.size();
    if (_num_random_boots > 0)
        _num_slots = FIRST_RANDOM_BOOT_SLOT + _num_random_boots;
    LOG1N(L"_num_slots = %d", _num_slots);
}
示例#5
0
文件: mtgui.cpp 项目: nuin/MrMTgui
void modeltest::CreateGUIControls(void)
{
	//char line[1000];
	wxString title = "MrMTgui";

	this->SetSize(8,8,700,450);
	this->SetTitle(wxString(title));
	this->Center();

	wxIcon icon;
	wxBitmap bitmap(wxT("mtgui.png"), wxBITMAP_TYPE_PNG);
	icon.CopyFromBitmap(bitmap);
	this->SetIcon(icon);
	
	wxPanel *mainPanel = new wxPanel(this, mpanel, wxDefaultPosition, wxDefaultSize);

	wxStaticText *MT = new wxStaticText(mainPanel, -1,"ModelTest", wxPoint(16,10),wxDefaultSize);
	wxStaticText *MrMT = new wxStaticText(mainPanel, -1,"MrModelTest", wxPoint(580,10),wxDefaultSize);

	//ModelTest "panel" - left side///////////////////////////////////////////////////////////////////
	runPAUP =  new wxButton(mainPanel, paupBt, _("Run PAUP") ,wxPoint(16, 30) ,wxSize(95,30));
	selectFile =  new wxButton(mainPanel, fileBt, _("Select file ...") , wxPoint(16,70),wxSize(95,30));
	parameters = new wxButton(mainPanel, paramBt, _("Parameters"), wxPoint(16,110), wxSize(95,30));
	runModel =  new wxButton(mainPanel, modelBt, _("Modeltest !!") , wxPoint(16,150),wxSize(95,30));
	runModel->SetToolTip(wxT("Run modeltest and get your results"));
	checkBIC = new wxCheckBox(mainPanel, -1, _T("Use BIC (-b)"), wxPoint(16, 190), wxDefaultSize);

	inNexus =  new wxButton(mainPanel, nexus, _("Edit NEXUS") ,wxPoint(16, 230) ,wxSize(95,30));
	inNexus->Enable(false);
	/////////////////////////////////////////////////////////////////////////////////////////////////

	//MrModelTest "panel"- right side////////////////////////////////////////////////////////////////
	runBayes =  new wxButton(mainPanel, bayesBt, _("Run Paup") ,wxPoint(580, 30) ,wxSize(95,30));
	selectFileMr =  new wxButton(mainPanel, fileMrBt, _("Select file ...") , wxPoint(580,70),wxSize(95,30));
	//parameters = new wxButton(mainPanel, paramBt, _("Parameters"), wxPoint(16,100), wxSize(95,30));
	runMr =  new wxButton(mainPanel, mrBt, _("MrModeltest !!!") , wxPoint(580,150),wxSize(95,30));
	runMr->SetToolTip(wxT("Run MrModeltest and get your results"));
	inMrNexus =  new wxButton(mainPanel, mrNexus, _("Edit NEXUS") ,wxPoint(580, 190) ,wxSize(95,30));
	inMrNexus->Enable(false);
	/////////////////////////////////////////////////////////////////////////////////////////////////

	modelpath =  new wxButton(mainPanel, pathBt, _("MT path") ,wxPoint(120, 350) ,wxSize(95,30) );
	modelpath->Enable(false);
	pauppath = new wxButton(mainPanel, pathPaup, _("PAUP path") ,wxPoint(225, 350), wxSize(95,30));
	pauppath->Enable(false);

	mrpath = new wxButton(mainPanel, mrpathBt, _("MrMT path") ,wxPoint(478, 350) ,wxSize(95,30));
	mrpath ->Enable(false);
#ifdef __WXMSW__
	char line[1000];
	modelpath->Enable(true);
	pauppath->Enable(true);
	//inNexus->Enable(true);
	//bayespath->Enable(true);
	mrpath->Enable(true);
#endif

	saveScores = new wxButton(mainPanel, saveScBt, _("Save scores") ,wxPoint(16, 270) ,wxSize(95,30));
	this->saveScores->Enable(false);
	saveScoresMr = new wxButton(mainPanel, saveScBtMr, _("Save scores") ,wxPoint(580, 230) ,wxSize(95,30));
	this->saveScoresMr->Enable(false);

	help =  new wxButton(mainPanel, helpMT, _("Help") ,wxPoint(16, 350) ,wxSize(95,30) );

	outputText =  new wxTextCtrl(mainPanel, outTxt, "" , wxPoint(120,20),wxSize(450,280) , wxVSCROLL | wxHSCROLL |wxTE_MULTILINE | wxTE_READONLY );
	outputText->SetToolTip(wxT("Your results will be displayed here"));
	outputText->AppendText(_("Your result will be displayed here"));
	outputText->SetFont(wxFont(8, wxMODERN, wxNORMAL, wxNORMAL, FALSE, _T(""), wxFONTENCODING_SYSTEM));
	//selectNexusStatic =  new wxStaticText(mainPanel, ID_WXSTATICTEXT1 ," Select your PAUP result file clicking on the Select button.\ After running ModelTest, you can select your Nexus file to automatically include the resulting PAUP block by clicking on Edit Nexus File." ,wxPoint(16,10),wxSize(480,30));

#ifdef __WXMSW__
	ifstream mpath("modelpath.ini");
	ifstream mrpath("MrModelpath.ini");
	ifstream ppath("pauppath.ini");

	if(!mpath)
	{
		wxMessageBox("The path to ModelTest3* executable is not set.\nYou can do it by clicking the button MT path");
		this->runModel->Enable(false);   
	}
	else
	{
		mpath.getline(line, 1000);
		modelP = line;
	}
	mpath.close();

	if(!mrpath)
	{
		wxMessageBox("The path to MrModelTest2.2 executable is not set.\nYou can do it by clicking the button MrMT path");
		this->runMr->Enable(false); 
	}
	else
	{
		mrpath.getline(line, 1000);
		mrModelP = line;
	}

	if(!ppath)
	{
		this->outputText->WriteText("\n\n\nThe path to PAUP is not set.\n You can do it by clicking the button PAUP path");
		this->runPAUP->Enable(false);
		this->runBayes->Enable(false);
	}
	else
	{
		ppath.getline(line, 1000);
		paupP = line;
		ppath.getline(line, 1000);
		paupDir = line;
	}
	mpath.close();
	mrpath.close();
	ppath.close();
#endif
}
示例#6
0
文件: PDST.cpp 项目: jvgomez/ompl
ompl::base::PlannerStatus ompl::control::PDST::solve(const base::PlannerTerminationCondition &ptc)
{
    // Make sure the planner is configured correctly.
    // ompl::base::Planner::checkValidity checks that there is at least one
    // start state and an ompl::base::Goal object specified and throws an
    // exception if this is not the case.
    checkValidity();

    // depending on how the planning problem is set up, this may be necessary
    bsp_->bounds_ = projectionEvaluator_->getBounds();
    base::Goal *goal = pdef_->getGoal().get();
    goalSampler_ = dynamic_cast<ompl::base::GoalSampleableRegion *>(goal);

    // Ensure that we have a state sampler AND a control sampler
    if (!sampler_)
        sampler_ = si_->allocStateSampler();
    if (!controlSampler_)
        controlSampler_ = siC_->allocDirectedControlSampler();

    // Initialize to correct values depending on whether or not previous calls to solve
    // generated an approximate or exact solution. If solve is being called for the first
    // time then initializes hasSolution to false and isApproximate to true.
    double distanceToGoal, closestDistanceToGoal = std::numeric_limits<double>::infinity();
    bool hasSolution = lastGoalMotion_ != nullptr;
    bool isApproximate = !hasSolution || !goal->isSatisfied(lastGoalMotion_->endState_, &closestDistanceToGoal);
    unsigned int ndim = projectionEvaluator_->getDimension();

    // If an exact solution has already been found, do not run for another iteration.
    if (hasSolution && !isApproximate)
        return ompl::base::PlannerStatus::EXACT_SOLUTION;

    // Initialize tree with start state(s)
    while (const base::State *st = pis_.nextStart())
    {
        auto *startMotion = new Motion(si_->cloneState(st));
        bsp_->addMotion(startMotion);
        startMotion->heapElement_ = priorityQueue_.insert(startMotion);
    }

    if (priorityQueue_.empty())
    {
        OMPL_ERROR("%s: There are no valid initial states!", getName().c_str());
        return base::PlannerStatus::INVALID_START;
    }

    OMPL_INFORM("%s: Starting planning with %u states already in datastructure", getName().c_str(),
                priorityQueue_.size());

    base::State *tmpState1 = si_->allocState(), *tmpState2 = si_->allocState();
    base::EuclideanProjection tmpProj1(ndim), tmpProj2(ndim);
    while (!ptc)
    {
        // Get the top priority path.
        Motion *motionSelected = priorityQueue_.top()->data;
        motionSelected->updatePriority();
        priorityQueue_.update(motionSelected->heapElement_);

        Motion *newMotion = propagateFrom(motionSelected, tmpState1, tmpState2);
        if (newMotion == nullptr)
            continue;

        addMotion(newMotion, bsp_, tmpState1, tmpState2, tmpProj1, tmpProj2);

        // Check if the newMotion reached the goal.
        hasSolution = goal->isSatisfied(newMotion->endState_, &distanceToGoal);
        if (hasSolution)
        {
            closestDistanceToGoal = distanceToGoal;
            lastGoalMotion_ = newMotion;
            isApproximate = false;
            break;
        }
        else if (distanceToGoal < closestDistanceToGoal)
        {
            closestDistanceToGoal = distanceToGoal;
            lastGoalMotion_ = newMotion;
        }

        // subdivide cell that contained selected motion, put motions of that
        // cell in subcells and split motions so that they contained within
        // one subcell
        Cell *cellSelected = motionSelected->cell_;
        std::vector<Motion *> motions;
        cellSelected->subdivide(ndim);
        motions.swap(cellSelected->motions_);
        for (auto &motion : motions)
            addMotion(motion, cellSelected, tmpState1, tmpState2, tmpProj1, tmpProj2);
    }

    if (lastGoalMotion_ != nullptr)
        hasSolution = true;

    // If a solution path has been computed, save it in the problem definition object.
    if (hasSolution)
    {
        Motion *m;
        std::vector<unsigned int> durations(
            1, findDurationAndAncestor(lastGoalMotion_, lastGoalMotion_->endState_, tmpState1, m));
        std::vector<Motion *> mpath(1, m);

        while (m->parent_)
        {
            durations.push_back(findDurationAndAncestor(m->parent_, m->startState_, tmpState1, m));
            mpath.push_back(m);
        }

        auto path(std::make_shared<PathControl>(si_));
        double dt = siC_->getPropagationStepSize();
        path->append(mpath.back()->endState_);
        for (int i = (int)mpath.size() - 2; i > 0; i--)
            path->append(mpath[i - 1]->startState_, mpath[i]->control_, durations[i] * dt);
        path->append(lastGoalMotion_->endState_, mpath[0]->control_, durations[0] * dt);
        pdef_->addSolutionPath(path, isApproximate, closestDistanceToGoal, getName());
    }

    si_->freeState(tmpState1);
    si_->freeState(tmpState2);

    OMPL_INFORM("%s: Created %u states and %u cells", getName().c_str(), priorityQueue_.size(), bsp_->size());

    return base::PlannerStatus(hasSolution, isApproximate);
}
void SvgElementVisitor::visit(clan::DomElement &e)
{
	if (e.get_namespace_uri() != Svg::svg_ns) return;

	// To do: do a more efficient search for the correct handler

	auto local_name = e.get_local_name();
	if (local_name == "a") a(e);
	else if (local_name == "altGlyph") altGlyph(e);
	else if (local_name == "altGlyphDef") altGlyphDef(e);
	else if (local_name == "altGlyphItem") altGlyphItem(e);
	else if (local_name == "animate") animate(e);
	else if (local_name == "animateColor") animateColor(e);
	else if (local_name == "animateMotion") animateMotion(e);
	else if (local_name == "animateTransform") animateTransform(e);
	else if (local_name == "circle") circle(e);
	else if (local_name == "clipPath") clipPath(e);
	else if (local_name == "color-profile") color_profile(e);
	else if (local_name == "cursor") cursor(e);
	else if (local_name == "defs") defs(e);
	else if (local_name == "desc") desc(e);
	else if (local_name == "ellipse") ellipse(e);
	else if (local_name == "feBlend") feBlend(e);
	else if (local_name == "feColorMatrix") feColorMatrix(e);
	else if (local_name == "feComponentTransfer") feComponentTransfer(e);
	else if (local_name == "feComposite") feComposite(e);
	else if (local_name == "feConvolveMatrix") feConvolveMatrix(e);
	else if (local_name == "feDiffuseLighting") feDiffuseLighting(e);
	else if (local_name == "feDisplacementMap") feDisplacementMap(e);
	else if (local_name == "feDistantLight") feDistantLight(e);
	else if (local_name == "feFlood") feFlood(e);
	else if (local_name == "feFuncA") feFuncA(e);
	else if (local_name == "feFuncB") feFuncB(e);
	else if (local_name == "feFuncG") feFuncG(e);
	else if (local_name == "feFuncR") feFuncR(e);
	else if (local_name == "feGaussianBlur") feGaussianBlur(e);
	else if (local_name == "feImage") feImage(e);
	else if (local_name == "feMerge") feMerge(e);
	else if (local_name == "feMergeNode") feMergeNode(e);
	else if (local_name == "feMorphology") feMorphology(e);
	else if (local_name == "feOffset") feOffset(e);
	else if (local_name == "fePointLight") fePointLight(e);
	else if (local_name == "feSpecularLighting") feSpecularLighting(e);
	else if (local_name == "feSpotLight") feSpotLight(e);
	else if (local_name == "feTile") feTile(e);
	else if (local_name == "feTurbulence") feTurbulence(e);
	else if (local_name == "filter") filter(e);
	else if (local_name == "font") font(e);
	else if (local_name == "font-face") font_face(e);
	else if (local_name == "font-face-format") font_face_format(e);
	else if (local_name == "font-face-name") font_face_name(e);
	else if (local_name == "font-face-src") font_face_src(e);
	else if (local_name == "font-face-uri") font_face_uri(e);
	else if (local_name == "foreignObject") foreignObject(e);
	else if (local_name == "g") g(e);
	else if (local_name == "glyph") glyph(e);
	else if (local_name == "glyphRef") glyphRef(e);
	else if (local_name == "hkern") hkern(e);
	else if (local_name == "image") image(e);
	else if (local_name == "line") line(e);
	else if (local_name == "linearGradient") linearGradient(e);
	else if (local_name == "marker") marker(e);
	else if (local_name == "mask") mask(e);
	else if (local_name == "metadata") metadata(e);
	else if (local_name == "missing-glyph") missing_glyph(e);
	else if (local_name == "mpath") mpath(e);
	else if (local_name == "path") path(e);
	else if (local_name == "pattern") pattern(e);
	else if (local_name == "polygon") polygon(e);
	else if (local_name == "polyline") polyline(e);
	else if (local_name == "radialGradient") radialGradient(e);
	else if (local_name == "rect") rect(e);
	else if (local_name == "script") script(e);
	else if (local_name == "set") set(e);
	else if (local_name == "stop") stop(e);
	else if (local_name == "style") style(e);
	else if (local_name == "svg") svg(e);
	else if (local_name == "switch") switch_(e);
	else if (local_name == "symbol") symbol(e);
	else if (local_name == "text") text(e);
	else if (local_name == "textPath") textPath(e);
	else if (local_name == "title") title(e);
	else if (local_name == "tref") tref(e);
	else if (local_name == "tspan") tspan(e);
	else if (local_name == "use") use(e);
	else if (local_name == "view") view(e);
	else if (local_name == "vkern") vkern(e);
}