コード例 #1
0
void MappingParameters::updateParameters()
{
    if (!mapping_ || isLocked()) return;

    updateMappingParameters();
    emit parametersUpdated();
}
コード例 #2
0
ファイル: mkiimodel.cpp プロジェクト: leuat/GeometryLibrary
void MKIIModel::createParameters()
{
    m_parameters->createParameter("A0", 0.5, 0, 1, 0.00001);
    m_parameters->createParameter("A1", 0.25, 0, 1, 0.00001);
    m_parameters->createParameter("A2", 0.12, 0, 1, 0.00001);
    m_parameters->createParameter("scale", 0.01, 0.001, 0.1, 0.00001);
    m_parameters->createParameter("threshold", 0.1, -0.4, 0.4, 0.00001);
    m_parameters->createParameter("inverted", 0, 0, 1, 1.0);
    m_parameters->createParameter("seed", 13.0, 1, 100, 1);
    m_parameters->createParameter("absolute", 0.0, 0, 1, 1);
    m_parameters->createParameter("skewscale", 1.0, 0, 1, 0.1);
    m_parameters->createParameter("skewamplitude", 0.0, 0, 1, 0.1);
    m_parameters->createParameter("steepness", 1.0, 0.5, 1.5, 0.000001);
    m_parameters->createParameter("noisetype", "simplex");
    Logger::write(QString("MKIIModel::createParameters: creating octaves=%1").arg(m_parameters->getValue("octaves")));
    Logger::write(QString("MKIIModel::createParameters: creating scale=%1").arg(m_parameters->getValue("scale")));
    Logger::write(QString("MKIIModel::createParameters: creating persistence=%1").arg(m_parameters->getValue("persistence")));
    Logger::write(QString("MKIIModel::createParameters: creating threshold=%1").arg(m_parameters->getValue("threshold")));
    Logger::write(QString("MKIIModel::createParameters: creating inverted=%1").arg(m_parameters->getValue("inverted")));
    Logger::write(QString("MKIIModel::createParameters: creating seed=%1").arg(m_parameters->getValue("seed")));
    Logger::write(QString("MKIIModel::createParameters: creating absolute=%1").arg(m_parameters->getValue("absolute")));
    Logger::write(QString("MKIIModel::createParameters: creating skewscale=%1").arg(m_parameters->getValue("skewscale")));
    Logger::write(QString("MKIIModel::createParameters: creating skewaplitude=%1").arg(m_parameters->getValue("skewamplitude")));
    Logger::write(QString("MKIIModel::createParameters: creating noisetype=%1").arg(m_parameters->getValue("noisetype")));
    Logger::write(QString("MKIIModel::createParameters: creating steepness=%1").arg(m_parameters->getValue("steepness")));
    parametersUpdated();
}
コード例 #3
0
ファイル: Mapping.cpp プロジェクト: cr8tr/omnidome
    void Mapping::showParameterWidget() {
      this->setupParameterWidget(widget(), dataModel()->mapping());

      if (this->parameterWidget()) {
        connect(this->parameterWidget(), SIGNAL(
                  parametersUpdated()), this,
                SIGNAL(dataModelChanged()));
      }
    }
コード例 #4
0
ファイル: model.cpp プロジェクト: leuat/GeometryLibrary
void Model::setParameters(Parameters *parameters)
{
    if (m_parameters == parameters)
        return;

    m_parameters = parameters;
    emit parametersChanged(parameters);
    parametersUpdated();
}
コード例 #5
0
ファイル: mkiimodel.cpp プロジェクト: leuat/GeometryLibrary
void MKIIModel::randomWalk()
{
    Logger::write(QString("MKIIModel::randomWalk: starting random walk"));
    double delta;

    delta = Random::nextGaussian(0, 0.5*m_parameters->getStepSize("scale"));
    m_parameters->setValue("scale", m_parameters->getValue("scale") + delta);
    m_parameters->fitBounds("scale");
    Logger::write(QString("RegularNoiseModel::randomWalk: changing scale with %1 to %2").arg(delta, m_parameters->getValue("scale")));

    delta = Random::nextGaussian(0, 0.5*m_parameters->getStepSize("A0"));
    m_parameters->setValue("A0", m_parameters->getValue("A0") + delta);
    m_parameters->fitBounds("A0");

    Logger::write(QString("MKIIModel::randomWalk: starting random walk"));
    delta = Random::nextGaussian(0, 0.5*m_parameters->getStepSize("A1"));
    m_parameters->setValue("A1", m_parameters->getValue("A1") + delta);
    m_parameters->fitBounds("A1");

    Logger::write(QString("MKIIModel::randomWalk: starting random walk"));
    delta = Random::nextGaussian(0, 0.5*m_parameters->getStepSize("A2"));
    m_parameters->setValue("A2", m_parameters->getValue("A2") + delta);
    m_parameters->fitBounds("A2");


    delta = Random::nextGaussian(0, m_parameters->getStepSize("threshold"));
    m_parameters->setValue("threshold", m_parameters->getValue("threshold") + delta);
    m_parameters->fitBounds("threshold");
    Logger::write(QString("MKIIModel::randomWalk: changing threshold with %1 to %2").arg(delta, m_parameters->getValue("threshold")));

    delta = Random::nextGaussian(0, 0.5*m_parameters->getStepSize("steepness"));
    m_parameters->setValue("steepness", m_parameters->getValue("steepness") + delta);
    m_parameters->fitBounds("steepness");
    Logger::write(QString("MKIIModel::randomWalk: changing steepness with %1 to %2").arg(delta, m_parameters->getValue("steepness")));

//    delta = Random::nextGaussian(0, 0.5*m_parameters->getStepSize("skewScale"));
//    m_parameters->setValue("skewScale", m_parameters->getValue("skewScale") + delta);
//    m_parameters->fitBounds("skewScale");
//    Logger::write(QString("MKIIModel::randomWalk: changing skewScale with %1 to %2").arg(delta, m_parameters->getValue("skewScale")));

//    delta = Random::nextGaussian(0, 0.5*m_parameters->getStepSize("skewAmplitude"));
//    m_parameters->setValue("skewAmplitude", m_parameters->getValue("skewAmplitude") + delta);
//    m_parameters->fitBounds("skewAmplitude");
//    Logger::write(QString("MKIIModel::randomWalk: changing skewAmplitude with %1 to %2").arg(delta, m_parameters->getValue("skewAmplitude")));

//    qDebug() << "Setting scale: " << m_parameters->getValue("scale") << " persistence: " << m_parameters->getValue("persistence") << " threshold: " << m_parameters->getValue("threshold") << " steepness: " << m_parameters->getValue("steepness");
    parametersUpdated();
}
コード例 #6
0
ファイル: mkiimodel.cpp プロジェクト: leuat/GeometryLibrary
void MKIIModel::loadParameters(CIniFile *iniFile)
{
    Logger::write(QString("MKIIModel::loadParameters: loading parameters from file %1").arg(QString::fromStdString(iniFile->filename)));

    m_parameters->setParameter("A0", iniFile->getdouble("A0"), 0.5, 0.000, 1);
    m_parameters->setParameter("A1", iniFile->getdouble("A1"), 0.25, 0.000, 1);
    m_parameters->setParameter("A2", iniFile->getdouble("A2"), 0.12, 0.000, 1);
    m_parameters->setParameter("scale", iniFile->getdouble("noise_scale"), 0.001, 0.1, 0.001);
    m_parameters->setParameter("threshold", iniFile->getdouble("noise_threshold"), -1, 1, 0.1);
    m_parameters->setParameter("inverted", iniFile->getdouble("noise_inverted"), 0, 1, 1);
    m_parameters->setParameter("seed", iniFile->getdouble("noise_seed"), 1, 100, 1);
    m_parameters->setParameter("absolute", iniFile->getdouble("noise_absolute"), 0, 1, 1);
    m_parameters->setParameter("skewscale", iniFile->getdouble("noise_skewscale"), 0, 1, 0.1);
    m_parameters->setParameter("skewamplitude", iniFile->getdouble("noise_skewamplitude"), 0, 1, 0.1);
    m_parameters->setParameter("noisetype", QString::fromStdString(iniFile->getstring("noise_noisetype")));
    m_parameters->setParameter("steepness", QString::fromStdString(iniFile->getstring("noise_steepness")));
    parametersUpdated();
}
コード例 #7
0
ファイル: Mapping.cpp プロジェクト: flair2005/omnidome
    Mapping::Mapping(QWidget* _parent) :
        CollapsibleGroupBox(_parent),
      ui_(new Ui::Mapping)
    {
        setTitle("Mapping");
      ui_->setupUi(widget());

      // Configure layout
      QLayout* _layout = new QVBoxLayout;
      _layout->setSpacing(2);
      _layout->setContentsMargins(0,0,0,0);
      ui_->widget->setLayout(_layout);

      // Update parameter when canvas has changed
      connect(ui_->widget,SIGNAL(parametersUpdated()),this,SIGNAL(mappingChanged()));

      connect(ui_->boxMappingSelect,SIGNAL(currentIndexChanged(QString)),this,SLOT(mappingTypeSelected(QString)));

      setDefaultMappingForCanvas();
    }
コード例 #8
0
    void MappingParameters::updateParameters()
    {
      if (!mapping_ || isLocked()) return;

      auto applyRotation = [&](mapping::Rotatable* _rotatable) 
      {
        _rotatable->setRoll(rotation_->x());
        _rotatable->setPitch(rotation_->y());
        _rotatable->setYaw(rotation_->z());
      };

      mapping_->setFlipHorizontal(getParamAsBool("Flip horizontal"));
      mapping_->setFlipVertical(getParamAsBool("Flip vertical"));

      if (mapping_->getTypeId() == "Equirectangular")
      {
        auto* _equirectangular = static_cast<mapping::Equirectangular*>(mapping_);
        _equirectangular->setStripTop(getParamAsFloat("Strip Top"));
        _equirectangular->setStripBottom(getParamAsFloat("Strip Bottom"));
        applyRotation(_equirectangular);
      } else
      if (mapping_->getTypeId() == "Fisheye")
      {
        auto* _fisheye = static_cast<mapping::Fisheye*>(mapping_);
        _fisheye->setStretch(getParamAsFloat("Stretch"));
        applyRotation(_fisheye);
      } else
      if (mapping_->getTypeId() == "CubeMap")
      {
        auto* _cubemap = static_cast<mapping::CubeMap*>(mapping_);
        applyRotation(_cubemap);
      } else
      if (mapping_->getTypeId() == "Planar")
      {
        auto* _planar = static_cast<mapping::Planar*>(mapping_);
        _planar->setOffset(QVector2D(getParamAsFloat("Offset X"),getParamAsFloat("Offset Y")));
        _planar->setStretch(QVector2D(getParamAsFloat("Stretch X"),getParamAsFloat("Stretch Y")));
      }

      emit parametersUpdated();
    }
コード例 #9
0
void ParameterLoader::readParametersFromFile(std::string filename)
{
	std::ifstream dataFile(filename.c_str());
	std::string line;
	while(std::getline(dataFile, line)) {
		std::stringstream linestream(line);
		std::string name;
		std::getline(linestream, name, ',');
		std::string val;
		std::getline(linestream, val, ',');
		parameters[name] = atof(val.c_str());
	}

	for (std::map<std::string, double>::iterator it=parameters.begin();
		 it!=parameters.end(); ++it) {
        std::cout << it->first << ", " << it->second << std::endl;
	}

	emit parametersRead();
    emit parametersUpdated(parameters);
}
コード例 #10
0
      MultiSetupDialog::MultiSetupDialog(omni::proj::MultiSetup* _multiSetup, Session* _session) :
        QDialog(nullptr),
        session_(_session),
        multiSetup_(_multiSetup),
        ui_(new Ui::MultiSetupDialog)
      {
        ui_->setupUi(this);

        ui_->btnReplace->setVisible(!session_->tunings().empty());


        this->setWindowTitle("Multi Projector Setup");
        ui_->preview->setSession(_session);
        ui_->preview->setMultiSetup(multiSetup_);
        ui_->parameters->setMultiSetup(multiSetup_);

        ui_->groupSetup->setTitle(multiSetup_->getTypeId().str());

        connect(ui_->parameters,SIGNAL(parametersUpdated()),ui_->preview,SLOT(updateProjectors()));

        connect(ui_->btnCancel,SIGNAL(clicked()),this,SLOT(cancel()));
        connect(ui_->btnAppend,SIGNAL(clicked()),this,SLOT(append()));
        connect(ui_->btnReplace,SIGNAL(clicked()),this,SLOT(replace()));
      }