本文整理汇总了C++中kstvectormap::Iterator::data方法的典型用法代码示例。如果您正苦于以下问题:C++ Iterator::data方法的具体用法?C++ Iterator::data怎么用?C++ Iterator::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kstvectormap::Iterator
的用法示例。
在下文中一共展示了Iterator::data方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: save
void KstPlugin::save(QTextStream &ts) {
if (_plugin.data() != 0L) {
ts << " <plugin>" << endl;
ts << " <tag>" << tagName() << "</tag>" << endl;
ts << " <name>" << _plugin->data()._name << "</name>" << endl;
for (KstVectorMap::Iterator i = _inputVectors.begin(); i != _inputVectors.end(); ++i) {
ts << " <ivector name=\"" << i.key() << "\">"
<< i.data()->tagName()
<< "</ivector>" << endl;
}
for (KstScalarMap::Iterator i = _inputScalars.begin(); i != _inputScalars.end(); ++i) {
ts << " <iscalar name=\"" << i.key() << "\">"
<< i.data()->tagName()
<< "</iscalar>" << endl;
}
for (KstVectorMap::Iterator i = _outputVectors.begin(); i != _outputVectors.end(); ++i) {
ts << " <ovector name=\"" << i.key() << "\">"
<< i.data()->tagName()
<< "</ovector>" << endl;
}
for (KstScalarMap::Iterator i = _outputScalars.begin(); i != _outputScalars.end(); ++i) {
ts << " <oscalar name=\"" << i.key() << "\">"
<< i.data()->tagName()
<< "</oscalar>" << endl;
}
ts << " </plugin>" << endl;
}
}
示例2: replaceDependency
void KstEquation::replaceDependency(KstVectorPtr oldVector, KstVectorPtr newVector) {
QString oldTag = oldVector->tagName();
QString newTag = newVector->tagName();
// replace all occurences of oldTag with newTag
QString newExp = _equation.replace("["+oldTag+"]", "["+newTag+"]");
// also replace all occurences of scalar stats for the oldVector
QDictIterator<KstScalar> scalarDictIter(oldVector->scalars());
for (; scalarDictIter.current(); ++scalarDictIter) {
QString oldTag = scalarDictIter.current()->tagName();
QString newTag = ((newVector->scalars())[scalarDictIter.currentKey()])->tagName();
newExp = newExp.replace("[" + oldTag + "]", "[" + newTag + "]");
}
setEquation(newExp);
// do the dependency replacements for _inputVectors, but don't call parent function as it
// replaces _inputScalars
for (KstVectorMap::Iterator j = _inputVectors.begin(); j != _inputVectors.end(); ++j) {
if (j.data() == oldVector) {
_inputVectors[j.key()] = newVector;
}
}
}
示例3: save
void BinnedMap::save(QTextStream& ts, const QString& indent) {
QString l2 = indent + " ";
ts << indent << "<plugin name=\"Binned Map\">" << endl;
ts << l2 << "<tag>" << QStyleSheet::escape(tagName()) << "</tag>" << endl;
for (KstVectorMap::Iterator i = _inputVectors.begin(); i != _inputVectors.end(); ++i) {
ts << l2 << "<ivector name=\"" << QStyleSheet::escape(i.key()) << "\">"
<< QStyleSheet::escape(i.data()->tagName())
<< "</ivector>" << endl;
}
for (KstMatrixMap::Iterator i = _outputMatrices.begin(); i != _outputMatrices.end(); ++i) {
ts << l2 << "<omatrix name=\"" << QStyleSheet::escape(i.key());
ts << "\">" << QStyleSheet::escape(i.data()->tagName())
<< "</omatrix>" << endl;
}
ts << 12 << "<minX>" << xMin() << "</minX>" << endl;
ts << 12 << "<maxX>" << xMax() << "</maxX>" << endl;
ts << 12 << "<minY>" << yMin() << "</minY>" << endl;
ts << 12 << "<maxY>" << yMax() << "</maxY>" << endl;
ts << 12 << "<nX>" << nX() << "</nX>" << endl;
ts << 12 << "<nY>" << nY() << "</nY>" << endl;
if (autoBin()) {
ts << 12 << "<autoBin/>" << endl;
}
ts << indent << "</plugin>" << endl;
}
示例4: save
void KstCPlugin::save(QTextStream &ts, const QString& indent) {
if (!_plugin) {
return;
}
QString l2 = indent + " ";
ts << indent << "<plugin>" << endl;
ts << l2 << "<tag>" << QStyleSheet::escape(tagName()) << "</tag>" << endl;
ts << l2 << "<name>" << QStyleSheet::escape(_plugin->data()._name) << "</name>" << endl;
for (KstVectorMap::Iterator i = _inputVectors.begin(); i != _inputVectors.end(); ++i) {
ts << l2 << "<ivector name=\"" << QStyleSheet::escape(i.key()) << "\">"
<< QStyleSheet::escape(i.data()->tag().tagString())
<< "</ivector>" << endl;
}
for (KstScalarMap::Iterator i = _inputScalars.begin(); i != _inputScalars.end(); ++i) {
ts << l2 << "<iscalar name=\"" << QStyleSheet::escape(i.key()) << "\">"
<< QStyleSheet::escape(i.data()->tag().tagString())
<< "</iscalar>" << endl;
}
for (KstStringMap::Iterator i = _inputStrings.begin(); i != _inputStrings.end(); ++i) {
ts << l2 << "<istring name=\"" << QStyleSheet::escape(i.key()) << "\">"
<< QStyleSheet::escape(i.data()->tag().tagString())
<< "</istring>" << endl;
}
for (KstVectorMap::Iterator i = _outputVectors.begin(); i != _outputVectors.end(); ++i) {
ts << l2 << "<ovector name=\"" << QStyleSheet::escape(i.key());
if (i.data()->isScalarList()) {
ts << "\" scalarList=\"1";
}
ts << "\">" << QStyleSheet::escape(i.data()->tag().tag())
<< "</ovector>" << endl;
}
for (KstScalarMap::Iterator i = _outputScalars.begin(); i != _outputScalars.end(); ++i) {
ts << l2 << "<oscalar name=\"" << QStyleSheet::escape(i.key()) << "\">"
<< QStyleSheet::escape(i.data()->tag().tag())
<< "</oscalar>" << endl;
}
for (KstStringMap::Iterator i = _outputStrings.begin(); i != _outputStrings.end(); ++i) {
ts << l2 << "<ostring name=\"" << QStyleSheet::escape(i.key()) << "\">"
<< QStyleSheet::escape(i.data()->tag().tag())
<< "</ostring>" << endl;
}
ts << indent << "</plugin>" << endl;
}
示例5: KstObjectItem
KstObjectItem::KstObjectItem(QListView *parent, KstDataObjectPtr x, KstDataManagerI *dm)
: QObject(), QListViewItem(parent), _rtti(RTTI_OBJ_OBJECT), _name(x->tagName()), _dm(dm) {
assert(x);
setText(0, x->tagName());
for (KstVectorMap::Iterator i = x->outputVectors().begin();
i != x->outputVectors().end();
++i) {
new KstObjectItem(this, i.data(), _dm);
}
x = 0L; // keep the counts in sync
update(false);
}
示例6: save
void CrossPowerSpectrum::save(QTextStream& ts, const QString& indent) {
QString l2 = indent + " ";
ts << indent << "<plugin name=\"Cross Power Spectrum\">" << endl;
ts << l2 << "<tag>" << QStyleSheet::escape(tagName()) << "</tag>" << endl;
for (KstVectorMap::Iterator i = _inputVectors.begin(); i != _inputVectors.end(); ++i) {
ts << l2 << "<ivector name=\"" << QStyleSheet::escape(i.key()) << "\">"
<< QStyleSheet::escape(i.data()->tagName())
<< "</ivector>" << endl;
}
for (KstScalarMap::Iterator i = _inputScalars.begin(); i != _inputScalars.end(); ++i) {
ts << l2 << "<iscalar name=\"" << QStyleSheet::escape(i.key()) << "\">"
<< QStyleSheet::escape(i.data()->tagName())
<< "</iscalar>" << endl;
}
for (KstStringMap::Iterator i = _inputStrings.begin(); i != _inputStrings.end(); ++i) {
ts << l2 << "<istring name=\"" << QStyleSheet::escape(i.key()) << "\">"
<< QStyleSheet::escape(i.data()->tagName())
<< "</istring>" << endl;
}
for (KstVectorMap::Iterator i = _outputVectors.begin(); i != _outputVectors.end(); ++i) {
ts << l2 << "<ovector name=\"" << QStyleSheet::escape(i.key());
if (i.data()->isScalarList()) {
ts << "\" scalarList=\"1";
}
ts << "\">" << QStyleSheet::escape(i.data()->tagName())
<< "</ovector>" << endl;
}
for (KstScalarMap::Iterator i = _outputScalars.begin(); i != _outputScalars.end(); ++i) {
ts << l2 << "<oscalar name=\"" << QStyleSheet::escape(i.key()) << "\">"
<< QStyleSheet::escape(i.data()->tagName())
<< "</oscalar>" << endl;
}
for (KstStringMap::Iterator i = _outputStrings.begin(); i != _outputStrings.end(); ++i) {
ts << l2 << "<ostring name=\"" << QStyleSheet::escape(i.key()) << "\">"
<< QStyleSheet::escape(i.data()->tagName())
<< "</ostring>" << endl;
}
ts << indent << "</plugin>" << endl;
}
示例7: setTagName
void KstCPlugin::setTagName(const QString &in_tag) {
KstObjectTag newTag(in_tag, tag().context());
if (newTag == tag()) {
return;
}
KstObject::setTagName(newTag);
for (KstVectorMap::Iterator iter = outputVectors().begin(); iter != outputVectors().end(); ++iter) {
(*iter)->setTagName(KstObjectTag(iter.data()->tag().tag(), tag()));
}
for (KstScalarMap::Iterator iter = outputScalars().begin(); iter != outputScalars().end(); ++iter) {
(*iter)->setTagName(KstObjectTag(iter.data()->tag().tag(), tag()));
}
for (KstStringMap::Iterator iter = outputStrings().begin(); iter != outputStrings().end(); ++iter) {
(*iter)->setTagName(KstObjectTag(iter.data()->tag().tag(), tag()));
}
}
示例8: QObject
KstObjectItem::KstObjectItem(QListView *parent, KstDataObjectPtr x, KstDataManagerI *dm, int localUseCount)
: QObject(), QListViewItem(parent), _rtti(RTTI_OBJ_OBJECT), _tag(x->tag()), _dm(dm) {
assert(x);
_inUse = false;
setText(0, x->tag().tag());
for (KstVectorMap::Iterator i = x->outputVectors().begin();
i != x->outputVectors().end();
++i) {
KstObjectItem *item = new KstObjectItem(this, i.data(), _dm);
connect(item, SIGNAL(updated()), this, SIGNAL(updated()));
}
for (KstMatrixMap::Iterator i = x->outputMatrices().begin();
i != x->outputMatrices().end();
++i) {
KstObjectItem *item = new KstObjectItem(this, i.data(), _dm);
connect(item, SIGNAL(updated()), this, SIGNAL(updated()));
}
x = 0L; // keep the counts in sync
update(false, localUseCount);
}
示例9: uses
bool KstEquation::uses(KstObjectPtr p) const {
// check VectorsUsed in addition to _input*'s
if (KstVectorPtr vect = kst_cast<KstVector>(p)) {
for (KstVectorMap::ConstIterator j = VectorsUsed.begin(); j != VectorsUsed.end(); ++j) {
if (j.data() == vect) {
return true;
}
}
} else if (KstDataObjectPtr obj = kst_cast<KstDataObject>(p) ) {
// check all connections from this expression to p
for (KstVectorMap::Iterator j = obj->outputVectors().begin(); j != obj->outputVectors().end(); ++j) {
for (KstVectorMap::ConstIterator k = VectorsUsed.begin(); k != VectorsUsed.end(); ++k) {
if (j.data() == k.data()) {
return true;
}
}
}
}
return KstDataObject::uses(p);
}
示例10: update
void KstObjectItem::update(bool recursive, int localUseCount) {
switch (_rtti) {
case RTTI_OBJ_DATA_VECTOR:
{
KST::vectorList.lock().readLock();
KstRVectorPtr x = kst_cast<KstRVector>(*KST::vectorList.findTag(_tag));
KST::vectorList.lock().unlock();
if (x) {
x->readLock();
// getUsage: subtract 1 for KstRVectorPtr x
bool inUse = (x->getUsage() - 1 - localUseCount) > 0;
if (inUse != _inUse) {
_inUse = inUse;
setPixmap(2, inUse ? _dm->yesPixmap() : QPixmap());
}
QString field;
if (inUse) {
field = QString::number(x->length());
} else {
field = "-";
}
if (text(3) != field) {
setText(3, field);
}
field = i18n("%3: %4 [%1..%2]").arg(x->reqStartFrame())
.arg(x->reqStartFrame() + x->reqNumFrames())
.arg(x->filename())
.arg(x->field());
if (text(4) != field) {
setText(4, field);
}
_removable = x->getUsage() == 2;
x->unlock();
}
// Hmmm what happens if this if() fails?? We become inconsistent?
break;
}
case RTTI_OBJ_STATIC_VECTOR:
{
KST::vectorList.lock().readLock();
KstSVectorPtr x = kst_cast<KstSVector>(*KST::vectorList.findTag(_tag));
KST::vectorList.lock().unlock();
if (x) {
x->readLock();
// getUsage: subtract 1 for KstRVectorPtr x
bool inUse = (x->getUsage() - 1 - localUseCount) > 0;
if (inUse != _inUse) {
_inUse = inUse;
setPixmap(2, inUse ? _dm->yesPixmap() : QPixmap());
}
QString field;
if (inUse) {
field = QString::number(x->length());
} else {
field = "-";
}
if (text(3) != field) {
setText(3, field);
}
field = i18n("%1 to %2").arg(x->min()).arg(x->max());
if (text(4) != field) {
setText(4, field);
}
_removable = x->getUsage() == 2;
x->unlock();
}
// Hmmm what happens if this if() fails?? We become inconsistent?
break;
}
case RTTI_OBJ_VECTOR:
{
KST::vectorList.lock().readLock();
KstVectorPtr x = *KST::vectorList.findTag(_tag);
KST::vectorList.lock().unlock();
if (x) {
x->readLock();
// getUsage:
// subtract 1 for KstVectorPtr x
bool inUse = (x->getUsage() - 1 - localUseCount) > 0;
if (inUse != _inUse) {
_inUse = inUse;
setPixmap(2, inUse ? _dm->yesPixmap() : QPixmap());
}
QString field = QString::number(x->length());
if (text(3) != field) {
setText(3, field);
}
field = i18n("[%1..%2]").arg(x->min()).arg(x->max());
if (text(4) != field) {
setText(4, field);
}
x->unlock();
_removable = false;
}
break;
}
case RTTI_OBJ_OBJECT:
{
KST::dataObjectList.lock().readLock();
KstDataObjectPtr x = *KST::dataObjectList.findTag(_tag.tag());
//.........这里部分代码省略.........