Пример #1
0
void GenGraphForm::setFilter()
{
    QString fname = presetFilter->currentText();
    if (fname == "") return;
    std::string name = (const char*)fname;
    if (presetFilters.count(name) > 0)
    {
        const std::set<std::string> & filt = presetFilters[name];
        settingFilter = true;
        this->showNodes->setChecked(filt.find("showNodes")!=filt.end());
        this->showObjects->setChecked(filt.find("showObjects")!=filt.end());
        this->showBehaviorModels->setChecked(filt.find("showBehaviorModels")!=filt.end());
        this->showCollisionModels->setChecked(filt.find("showCollisionModels")!=filt.end());
        this->showVisualModels->setChecked(filt.find("showVisualModels")!=filt.end());
        this->showMappings->setChecked(filt.find("showMappings")!=filt.end());
        this->showContext->setChecked(filt.find("showContext")!=filt.end());
        this->showCollisionPipeline->setChecked(filt.find("showCollisionPipeline")!=filt.end());
        this->showSolvers->setChecked(filt.find("showSolvers")!=filt.end());
        this->showMechanicalStates->setChecked(filt.find("showMechanicalStates")!=filt.end());
        this->showForceFields->setChecked(filt.find("showForceFields")!=filt.end());
        this->showInteractionForceFields->setChecked(filt.find("showInteractionForceFields")!=filt.end());
        this->showConstraints->setChecked(filt.find("showConstraints")!=filt.end());
        this->showMass->setChecked(filt.find("showMass")!=filt.end());
        this->showTopology->setChecked(filt.find("showTopology")!=filt.end());
        this->showMechanicalMappings->setChecked(filt.find("showMechanicalMappings")!=filt.end());
        settingFilter = false;
        displayButton->setEnabled(false);
        presetFilter->setCurrentText(fname);
    }
    else
    {
        //if (QMessage::question(this,"Graph Preset Filters",...)
        presetFilters[name] = getCurrentFilter();
    }
}
Пример #2
0
	//--------------------------------------------------------------------------
	void BaseFileDialog::writeConfig()
	{
		if(!getConfigSection().empty())
		{
			UISettings& ui = UISettings::getSingleton();
			ui.beginBatch();
			ui.setSetting<String>("CurrentPath", getConfigSection(), getCurrentPath());
			ui.setSetting<size_t>("CurrentFilter", getConfigSection(), getCurrentFilter());
			ui.setSetting<float>("SplitterHPosition", getConfigSection(), getSplitterHPosition());
			ui.endBatch();
		}
	}
Пример #3
0
void GenGraphForm::changeFilter()
{
	displayButton->setEnabled(false);
	if (settingFilter) return;
	std::set<std::string> filt = getCurrentFilter();
	for (std::map<std::string,std::set<std::string> >::const_iterator it = presetFilters.begin(); it != presetFilters.end(); ++it)
	{
		if (it->second == filt)
		{
			//presetFilter->setCurrentText(it->first.c_str());
			return;
		}
	}
	//presetFilter->setCurrentText("");
}