本文整理汇总了C++中KstScalarPtr::setTagName方法的典型用法代码示例。如果您正苦于以下问题:C++ KstScalarPtr::setTagName方法的具体用法?C++ KstScalarPtr::setTagName怎么用?C++ KstScalarPtr::setTagName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KstScalarPtr
的用法示例。
在下文中一共展示了KstScalarPtr::setTagName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: makeDuplicate
KstDataObjectPtr KstPlugin::makeDuplicate(KstDataObjectDataObjectMap& duplicatedMap) {
KstPluginPtr plugin = new KstPlugin;
// use same inputs
for (KstVectorMap::ConstIterator iter = _inputVectors.begin(); iter != _inputVectors.end(); ++iter) {
plugin->inputVectors().insert(iter.key(), iter.data());
}
for (KstScalarMap::ConstIterator iter = _inputScalars.begin(); iter != _inputScalars.end(); ++iter) {
plugin->inputScalars().insert(iter.key(), iter.data());
}
for (KstStringMap::ConstIterator iter = _inputStrings.begin(); iter != _inputStrings.end(); ++iter) {
plugin->inputStrings().insert(iter.key(), iter.data());
}
// create new outputs
for (KstVectorMap::ConstIterator iter = outputVectors().begin(); iter != outputVectors().end(); ++iter) {
KstVectorPtr v = new KstVector;
v->writeLock();
plugin->outputVectors().insert(iter.key(), v);
v->setTagName(iter.data()->tagName() + "'");
v->setProvider(plugin.data());
KST::addVectorToList(v);
v->writeUnlock();
}
for (KstScalarMap::ConstIterator iter = outputScalars().begin(); iter != outputScalars().end(); ++iter) {
KstScalarPtr s = new KstScalar;
s->writeLock();
plugin->outputScalars().insert(iter.key(), s);
s->setTagName(iter.data()->tagName() + "'");
s->setProvider(plugin.data());
s->writeUnlock();
}
for (KstStringMap::ConstIterator iter = outputStrings().begin(); iter != outputStrings().end(); ++iter) {
KstStringPtr s = new KstString;
s->writeLock();
plugin->outputStrings().insert(iter.key(), s);
s->setTagName(iter.data()->tagName() + "'");
s->setProvider(plugin.data());
s->writeUnlock();
}
// set the same plugin
plugin->setPlugin(_plugin);
plugin->setTagName(tagName() + "'");
duplicatedMap.insert(this, KstDataObjectPtr(plugin));
return KstDataObjectPtr(plugin);
}
示例2: saveOutputs
bool KstPluginDialogI::saveOutputs(KstCPluginPtr plugin, KstSharedPtr<Plugin> p) {
const QValueList<Plugin::Data::IOValue>& otable = p->data()._outputs;
for (QValueList<Plugin::Data::IOValue>::ConstIterator it = otable.begin(); it != otable.end(); ++it) {
QObject *field = _w->_pluginInputOutputFrame->child((*it)._name.latin1(), "QLineEdit");
if (!field) {
continue; // Some are unsupported
}
QLineEdit *li = static_cast<QLineEdit*>(field);
if (li->text().isEmpty()) {
li->setText((*it)._name);
}
QString nt = li->text();
if ((*it)._type == Plugin::Data::IOValue::TableType) {
if (!KstData::self()->vectorTagNameNotUnique(nt, false)) {
// Implicitly creates it if it doesn't exist
KstVectorPtr v = plugin->outputVectors()[(*it)._name];
if (!v) {
KstWriteLocker blockVectorUpdates(&KST::vectorList.lock());
v = new KstVector(KstObjectTag(nt, plugin->tag()), 0, plugin.data());
plugin->outputVectors().insert((*it)._name, v);
}
v->setTagName(KstObjectTag(nt, plugin->tag()));
} else if (plugin->outputVectors()[(*it)._name]->tagName() != nt) {
while (KstData::self()->vectorTagNameNotUnique(nt, false)) {
nt += "'";
}
KstVectorPtr v;
if (plugin->outputVectors().contains((*it)._name)) {
v = plugin->outputVectors()[(*it)._name];
} else {
KstWriteLocker blockVectorUpdates(&KST::vectorList.lock());
v = new KstVector(KstObjectTag(nt, plugin->tag()), 0, plugin.data());
plugin->outputVectors().insert((*it)._name, v);
}
v->setTagName(KstObjectTag(nt, plugin->tag()));
}
} else if ((*it)._type == Plugin::Data::IOValue::StringType) {
if (!KstData::self()->vectorTagNameNotUnique(nt, false)) {
KstStringPtr s;
if (plugin->outputStrings().contains((*it)._name)) {
s = plugin->outputStrings()[(*it)._name];
} else {
KstWriteLocker blockStringUpdates(&KST::stringList.lock());
s = new KstString(KstObjectTag(nt, plugin->tag()), plugin.data());
plugin->outputStrings().insert((*it)._name, s);
}
s->setTagName(KstObjectTag(nt, plugin->tag()));
} else if (plugin->outputStrings()[(*it)._name]->tagName() != nt) {
while (KstData::self()->vectorTagNameNotUnique(nt, false)) {
nt += "'";
}
KstStringPtr s;
if (plugin->outputStrings().contains((*it)._name)) {
s = plugin->outputStrings()[(*it)._name];
} else {
KstWriteLocker blockStringUpdates(&KST::stringList.lock());
s = new KstString(KstObjectTag(nt, plugin->tag()), plugin.data());
plugin->outputStrings().insert((*it)._name, s);
}
s->setTagName(KstObjectTag(nt, plugin->tag()));
}
} else if ((*it)._type == Plugin::Data::IOValue::PidType) {
// Nothing
} else if ((*it)._type == Plugin::Data::IOValue::FloatType) {
if (!KstData::self()->vectorTagNameNotUnique(nt, false)) {
KstScalarPtr s;
if (plugin->outputScalars().contains((*it)._name)) {
s = plugin->outputScalars()[(*it)._name];
} else {
KstWriteLocker blockScalarUpdates(&KST::scalarList.lock());
s = new KstScalar(KstObjectTag(nt, plugin->tag()), plugin.data());
plugin->outputScalars().insert((*it)._name, s);
}
s->setTagName(KstObjectTag(nt, plugin->tag()));
} else if (plugin->outputScalars()[(*it)._name]->tagName() != nt) {
while (KstData::self()->vectorTagNameNotUnique(nt, false)) {
nt += "'";
}
KstScalarPtr s;
if (plugin->outputScalars().contains((*it)._name)) {
s = plugin->outputScalars()[(*it)._name];
} else {
KstWriteLocker blockScalarUpdates(&KST::scalarList.lock());
s = new KstScalar(KstObjectTag(nt, plugin->tag()), plugin.data());
plugin->outputScalars().insert((*it)._name, s);
}
s->setTagName(KstObjectTag(nt, plugin->tag()));
}
}
}
return true;
}