本文整理汇总了C++中setParameter函数的典型用法代码示例。如果您正苦于以下问题:C++ setParameter函数的具体用法?C++ setParameter怎么用?C++ setParameter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setParameter函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: TEST_F
TEST_F(ClinicalTests, NeuroVesselsUSA) {
std::string name = "Neuro-Vessels-USA";
setParameter(parameters, "parameters", name);
if(!dataExists(name)) {
SUCCEED();
return;
}
loadParameterPreset(parameters, PARAMETERS_DIR);
try {
result = runClinicalData(parameters, name);
} catch(SIPL::SIPLException e) {
// Out of memory on GPU
// Try to run cropped version instead
std::cout << "Exception occurred. Trying cropped volume instead." << std::endl;
setParameter(parameters, "cropping", "no");
result = runClinicalData(parameters, name+"-cropped");
}
EXPECT_GT(1.5, result.averageDistanceFromCenterline);
EXPECT_LT(75.0, result.percentageExtractedCenterlines);
EXPECT_LT(0.7, result.precision);
EXPECT_LT(0.7, result.recall);
EXPECT_GT(200, result.incorrectCenterpoints);
}
开发者ID:573671712,项目名称:Tube-Segmentation-Framework,代码行数:24,代码来源:clinicalTests.cpp
示例2: setActiveDevice
void MidiOutFilter::setCurrentProgram (int index)
{
if (!init) {
programs[curProgram].icon = icon;
}
init=false;
JuceProgram* ap = &programs[index];
curProgram = index;
setActiveDevice(ap->device);
for (int i=0;i<getNumParameters();i++) {
setParameter(i, ap->param[i]);
}
icon = ap->icon;
}
开发者ID:Amcut,项目名称:pizmidi,代码行数:15,代码来源:midiOut.cpp
示例3: parameters
bool UffBondStrechCalculation::setup()
{
const UffAtomParameters *pa = parameters(atom(0));
const UffAtomParameters *pb = parameters(atom(1));
if(!pa || !pb){
return false;
}
// n = bondorder (1.5 for aromatic, 1.366 for amide)
chemkit::Real bondorder = bondOrder(atom(0), atom(1));
chemkit::Real r0 = bondLength(pa, pb, bondorder);
// parameter(1) = k_ij = 664.12 * (Z*_i * Z*_j) / r_ij^3
chemkit::Real za = pa->Z;
chemkit::Real zb = pb->Z;
chemkit::Real kb = 664.12 * (za * zb) / pow(r0, 3);
setParameter(0, kb);
setParameter(1, r0);
return true;
}
开发者ID:armando-2011,项目名称:chemkit,代码行数:24,代码来源:uffcalculation.cpp
示例4: atom
bool MmffOutOfPlaneBendingCalculation::setup(const MmffParameters *parameters)
{
const MmffAtom *a = atom(0);
const MmffAtom *b = atom(1);
const MmffAtom *c = atom(2);
const MmffAtom *d = atom(3);
const MmffOutOfPlaneBendingParameters *outOfPlaneBendingParameters = parameters->outOfPlaneBendingParameters(a, b, c, d);
if(!outOfPlaneBendingParameters){
return false;
}
setParameter(0, outOfPlaneBendingParameters->koop);
return true;
}
开发者ID:armando-2011,项目名称:chemkit,代码行数:15,代码来源:mmffcalculation.cpp
示例5: lock
/*update*/
void SphereShape::update()
{
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
if(!_dirty)
return;
float radius = _radius;
osg::Vec3 center = _center;
osg::Vec4 color = _color;
std::string vert = _vertex_shader;
std::string frag = _fragment_shader;
setParameter("radius", radius);
setParameter("x", center.x());
setParameter("y", center.y());
setParameter("z", center.z());
setParameter("r1", color[0]);
setParameter("g1", color[1]);
setParameter("b1", color[2]);
setParameter("a1", color[3]);
setParameter("vertex", vert);
setParameter("fragment", frag);
setPosition(center, radius);
setShapeColor(color);
setShaders(vert, frag);
dirtyBound();
//reset flag
_dirty = false;
}
开发者ID:Peachychan,项目名称:calvr_plugins,代码行数:37,代码来源:SphereShape.cpp
示例6: setParameter
QFFitAlgorithmLMFit::QFFitAlgorithmLMFit() {
// set default parameter values
lm_control_struct control = lm_control_double;
setParameter("ftol", control.ftol);
setParameter("xtol", control.xtol);
setParameter("gtol", control.gtol);
setParameter("epsilon", control.epsilon);
setParameter("stepbound", control.stepbound);
setParameter("max_iterations", control.patience);
}
开发者ID:jkriege2,项目名称:QuickFit3,代码行数:10,代码来源:qffitalgorithmlmfit.cpp
示例7: iniDefaultPath
void Settings::loadSettings(const QString & fileName, QByteArray * windowGeometry, QByteArray * windowState)
{
QString path = fileName;
if(fileName.isEmpty())
{
path = iniDefaultPath();
}
QSettings ini(path, QSettings::IniFormat);
for(ParametersMap::const_iterator iter = defaultParameters_.begin(); iter!=defaultParameters_.end(); ++iter)
{
const QString & key = iter.key();
QVariant value = ini.value(key, QVariant());
if(value.isValid())
{
QString str = value.toString();
if(str.contains(";") && str.size() != getParameter(key).toString().size())
{
// If a string list is modified, update the value
// (assuming that index < 10... one character for index)
QChar index = str.at(0);
str = getParameter(key).toString();
str[0] = index.toAscii();
value = QVariant(str);
printf("Updated list of parameter \"%s\"\n", key.toStdString().c_str());
}
setParameter(key, value);
}
}
if(windowGeometry)
{
QVariant value = ini.value("windowGeometry", QVariant());
if(value.isValid())
{
*windowGeometry = value.toByteArray();
}
}
if(windowState)
{
QVariant value = ini.value("windowState", QVariant());
if(value.isValid())
{
*windowState = value.toByteArray();
}
}
printf("Settings loaded from %s\n", path.toStdString().c_str());
}
开发者ID:moonwalkeryj,项目名称:GPKeypointsObjectDeteciton,代码行数:48,代码来源:Settings.cpp
示例8: AudioEffectX
mdaOverdrive::mdaOverdrive(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, 1, 3) // 1 program, 3 parameters
{
fParam1 = 0.0f;
fParam2 = 0.0f;
fParam3 = 0.5f;
setNumInputs(2);
setNumOutputs(2);
setUniqueID('mdaO'); // identify
DECLARE_VST_DEPRECATED(canMono) ();
canProcessReplacing();
strcpy(programName, "Soft Overdrive");
filt1 = filt2 = 0.0f;
setParameter(0, 0.0f);
}
开发者ID:arcanelab,项目名称:mda-VST-plug-ins,代码行数:16,代码来源:mdaOverdrive.cpp
示例9: UT_ASSERT
void AP_UnixDialog_Field::event_Insert(void)
{
UT_ASSERT(m_windowMain && m_listTypes && m_listFields);
// find item selected in the Types list box, save it to m_iTypeIndex
GtkTreeSelection * selection;
GtkTreeIter iter;
GtkTreeModel * model;
selection = gtk_tree_view_get_selection( GTK_TREE_VIEW(m_listTypes) );
// if there is no selection, or the selection's data (GtkListItem widget)
// is empty, return cancel. GTK can make this happen.
if ( !selection ||
!gtk_tree_selection_get_selected (selection, &model, &iter)
)
{
m_answer = AP_Dialog_Field::a_CANCEL;
return;
}
// get the ID of the selected Type
gtk_tree_model_get (model, &iter, 1, &m_iTypeIndex, -1);
// find item selected in the Field list box, save it to m_iFormatIndex
selection = gtk_tree_view_get_selection( GTK_TREE_VIEW(m_listFields) );
// if there is no selection, or the selection's data (GtkListItem widget)
// is empty, return cancel. GTK can make this happen.
if ( !selection ||
!gtk_tree_selection_get_selected (selection, &model, &iter)
)
{
m_answer = AP_Dialog_Field::a_CANCEL;
return;
}
// get the ID of the selected Type
gtk_tree_model_get (model, &iter, 1, &m_iFormatIndex, -1);
setParameter(gtk_entry_get_text(GTK_ENTRY(m_entryParam)));
m_answer = AP_Dialog_Field::a_OK;
}
开发者ID:lokeshguddu,项目名称:AbiWord,代码行数:46,代码来源:ap_UnixDialog_Field.cpp
示例10: setParameterAutomated
//------------------------------------------------------------------------
void Midi16CCRouter::setProgram (VstInt32 program) {
Midi16CCRouterProgram* ap = &programs[program];
curProgram = program;
if (automated) {
for (int i=0;i<kNumParams;i++) {
setParameterAutomated (i, ap->param[i]);
}
updateDisplay();
automated=false;
}
else {
for (int i=0;i<kNumParams;i++) {
setParameter (i, ap->param[i]);
}
}
}
开发者ID:Amcut,项目名称:pizmidi,代码行数:18,代码来源:midi16CCRouter.cpp
示例11: parameter
/**
* Sets a new value to a parameter by name.
* @param name :: The name of the parameter.
* @param value :: The new value
* @param explicitlySet :: A boolean flagging the parameter as explicitly set
* (by user)
*/
void ParamFunction::setParameter(const std::string &name, const double &value,
bool explicitlySet) {
auto it = std::find(m_parameterNames.cbegin(), m_parameterNames.cend(), name);
if (it == m_parameterNames.cend()) {
std::ostringstream msg;
msg << "ParamFunction tries to set value to non-exist parameter (" << name
<< ") "
<< "of function " << this->name();
msg << "\nAllowed parameters: ";
for (const auto ¶meterName : m_parameterNames) {
msg << parameterName << ", ";
}
throw std::invalid_argument(msg.str());
}
setParameter(static_cast<int>(it - m_parameterNames.begin()), value,
explicitlySet);
}
开发者ID:stuartcampbell,项目名称:mantid,代码行数:24,代码来源:ParamFunction.cpp
示例12: lock
void TextShape::update(std::string command)
{
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
_dirty = true;
// check for changed values
// TODO deal with triples for values e.g. color/backdrop
setParameter(command, "pos");
setParameter(command, "color");
setParameter(command, "bcolor");
setParameter(command, "size");
setParameter(command, "label");
setParameter(command, "enableOutline");
setParameter(command, "font");
}
开发者ID:CalVR,项目名称:calvr_plugins,代码行数:15,代码来源:TextShape.cpp
示例13: setParameter
void Mixer1::onParamChange() {
// get the signal sender
QObject* obj = QObject::sender();
// cast it to a midi-ui element
const MidiUI* ui = dynamic_cast<const MidiUI*>(obj);
if (!ui) {throw "invalid element attached";}
// get the new value to set (between [0,1])
Param param = ui->getParamType();
ParamValue val = ui->getValueAsParam();
// set
setParameter(param, val);
}
开发者ID:k-a-z-u,项目名称:KSynth,代码行数:17,代码来源:Mixer1.cpp
示例14: setParameter
//------------------------------------------------------------------------
void MidiVelocityScale::setProgram (VstInt32 program)
{
MidiVelocityScaleProgram* ap = &programs[program];
curProgram = program;
setParameter (kVel1, ap->fVel1);
setParameter (kVel2, ap->fVel2);
setParameter (kOffset, ap->fOffset);
setParameter (kOffVel1, ap->fOffVel1);
setParameter (kOffVel2, ap->fOffVel2);
setParameter (kOffOffset, ap->fOffOffset);
}
开发者ID:Amcut,项目名称:pizmidi,代码行数:13,代码来源:midiVelocityScale.cpp
示例15: setFrame
//--------------------------------------------------------------
void ofApp::update(){
//++ roundClock;
//if (roundClock % 2 != 0) return;
ofxUIToggle* live = (ofxUIToggle*)gui->getWidget("live");
ofxUIToggle* record = (ofxUIToggle*)gui->getWidget("record");
ofxUIIntSlider * frame = (ofxUIIntSlider *) gui->getWidget("frame");
if (!stop)
{
if (loadFrame < frame->getMax())
{
++ loadFrame;
setFrame();
}
}
device_->update();
if (live->getValue() || frame->getValue() == 0)
{
if (color_.isFrameNew() && depth_.isFrameNew())
{
img_originColor->setFromPixels(color_.getPixelsRef());
img_color->setFromPixels(depthProcessor.mapDepthToColor(color_.getPixelsRef(), depth_.getPixelsRef()));
//img_depth->setFromPixels(depth_.getPixelsRef(depth_.getNear(), depth_.getFar()));
img_depth->setFromPixels(depth_.getPixelsRef());
img_color->mirror(false, true);
img_depth->mirror(false, true);
img_originColor->mirror(false, true);
}
if (record->getValue() && color_.isFrameNew() && depth_.isFrameNew())
{
queue_originColor->Produce(img_originColor);
queue_color->Produce(img_color);
queue_depth->Produce(img_depth);
recorder.signal();
img_originColor = new ofImage(*img_originColor);
img_color = new ofImage(*img_color);
img_depth = new ofShortImage(*img_depth);
++ frameNum;
}
}
setParameter();
}
开发者ID:fuzerg,项目名称:KinectEditor,代码行数:46,代码来源:ofApp.cpp
示例16: iniPath
void Settings::loadSettings(const QString & fileName)
{
QString path = fileName;
if(fileName.isEmpty())
{
path = iniPath();
}
if(!path.isEmpty())
{
QSettings ini(path, QSettings::IniFormat);
for(ParametersMap::const_iterator iter = defaultParameters_.begin(); iter!=defaultParameters_.end(); ++iter)
{
const QString & key = iter.key();
QVariant value = ini.value(key, QVariant());
if(value.isValid())
{
QString str = value.toString();
if(str.contains(";") && str.size() != getParameter(key).toString().size())
{
// If a string list is modified, update the value
// (assuming that index < 10... one character for index)
QChar index = str.at(0);
str = getParameter(key).toString();
str[0] = index.toAscii();
value = QVariant(str);
UINFO("Updated list of parameter \"%s\"", key.toStdString().c_str());
}
setParameter(key, value);
}
}
UINFO("Settings loaded from %s.", path.toStdString().c_str());
}
else
{
parameters_ = defaultParameters_;
UINFO("Settings set to defaults.");
}
if(cv::gpu::getCudaEnabledDeviceCount() == 0)
{
Settings::setFeature2D_SURF_gpu(false);
Settings::setFeature2D_Fast_gpu(false);
Settings::setFeature2D_ORB_gpu(false);
}
}
开发者ID:r-ashraf-zein,项目名称:find-object,代码行数:45,代码来源:Settings.cpp
示例17: setParameter
void SynthEngine::reset() {
setParameter(SENGINE_LFO2_TO_CUTOFF, 0.0f);
setParameter(SENGINE_LFO1_TO_AMP, 0.0f);
setParameter(SENGINE_ENV1_TO_OSC1PW, 0.0f);
setParameter(SENGINE_ENV1_TO_OSC2PW, 0.0f);
setParameter(SENGINE_OSCMIX, 0.5f);
setParameter(SENGINE_AMPLEVEL, 1.0f);
setParameter(SENGINE_FILTFREQ, 1.0f);
setParameter(SENGINE_FILTRESO, -1.0f);
setParameter(SENGINE_ENV2_TO_CUTOFF, 0.0f);
setFilter24dB(0);
oscillators[0]->reset();
oscillators[1]->reset();
envelopes[0]->reset();
envelopes[1]->reset();
filters[0]->reset();
filters[1]->reset();
lfos[0]->reset();
lfos[1]->reset();
echo->reset();
}
开发者ID:eriser,项目名称:audio-1,代码行数:23,代码来源:synthengine.cpp
示例18: if
/*
* Load internal state from an archive.
*/
void Perturbation::loadParameters(Serializable::IArchive &ar)
{
loadParameter<int>(ar, "mode", mode_);
loadParameter<int>(ar, "nParameters", nParameters_);
parameter_.allocate(nParameters_);
parameters_.allocate(size_, nParameters_);
initialParameter_.allocate(nParameters_);
finalParameter_.allocate(nParameters_);
if (mode_ == 0) {
loadDMatrix<double>(ar, "parameters", parameters_, size_, nParameters_);
} else if (mode_ == 1) {
loadDArray<double>(ar, "initialParameter", initialParameter_, nParameters_);
loadDArray<double>(ar, "finalParameter", finalParameter_, nParameters_);
ar & parameters_;
}
ar & parameter_;
setParameter(); // Modify parameter of associated System
}
开发者ID:jglaser,项目名称:simpatico,代码行数:21,代码来源:Perturbation.cpp
示例19: AudioEffectX
mdaImage::mdaImage(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, 1, 6) // programs, parameters
{
fParam1 = 0.6f; //mode
fParam2 = 0.75f; //width
fParam3 = 0.5f; //skew
fParam4 = 0.75f; //centre
fParam5 = 0.5f; //balance
fParam6 = 0.5f; //output
setNumInputs(2);
setNumOutputs(2);
setUniqueID('mdaI'); // identify here
DECLARE_VST_DEPRECATED(canMono) ();
canProcessReplacing();
strcpy(programName, "Stereo Image / MS Matrix");
setParameter(0, 0.6f); //go and set initial values!
}
开发者ID:arcanelab,项目名称:mda-VST-plug-ins,代码行数:18,代码来源:mdaImage.cpp
示例20: update
void Clamp::updateClampMode(int index) {
if (index == 0) { // STEP
mode = STEP;
update(MODIFY);
emit setStepMode(true);
emit setPlotMode(false);
printf("Entering STEP mode\n");
}
else if (index == 1) { // RAMP
mode = RAMP;
minamp = 0;
setParameter("Min Amplitude (pA)", QString::number(minamp * 1e12)); // initialized in A, display in pA
update(MODIFY);
emit setStepMode(false);
plotFI = false;
printf("Entering RAMP mode\n");
}
}
开发者ID:RTXI,项目名称:current-clamp,代码行数:18,代码来源:current-clamp.cpp
注:本文中的setParameter函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论