本文整理汇总了C++中KstMatrixPtr::tagName方法的典型用法代码示例。如果您正苦于以下问题:C++ KstMatrixPtr::tagName方法的具体用法?C++ KstMatrixPtr::tagName怎么用?C++ KstMatrixPtr::tagName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KstMatrixPtr
的用法示例。
在下文中一共展示了KstMatrixPtr::tagName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QObject
KstObjectItem::KstObjectItem(QListViewItem *parent, KstMatrixPtr x, KstDataManagerI *dm, int localUseCount)
: QObject(), QListViewItem(parent), _rtti(RTTI_OBJ_MATRIX), _name(x->tagName()), _dm(dm) {
assert(x);
_inUse = false;
setText(0, x->tagName());
setText(1, i18n("Slave Matrix"));
x = 0L; // keep the counts in sync
update(true, localUseCount);
}
示例2: fillFieldsForEdit
void KstMatrixDialog::fillFieldsForEdit() {
KstMatrixPtr mp;
mp = kst_cast<KstMatrix>(_dp);
if (mp) {
KstRMatrixPtr rmp;
mp->readLock();
_tagName->setText(mp->tagName());
_w->_minX->setText(QString::number(mp->minX()));
_w->_minY->setText(QString::number(mp->minY()));
_w->_xStep->setText(QString::number(mp->xStepSize()));
_w->_yStep->setText(QString::number(mp->yStepSize()));
mp->unlock();
_w->_sourceGroup->hide();
rmp = kst_cast<KstRMatrix>(mp);
if (rmp) {
fillFieldsForRMatrixEdit();
} else {
fillFieldsForSMatrixEdit();
}
updateEnables();
adjustSize();
resize(minimumSizeHint());
setFixedHeight(height());
}
}
示例3: hitsMapTag
QString BinnedMap::hitsMapTag() const {
KstMatrixPtr m = hitsMap();
if (m) {
return m->tagName();
}
return QString::null;
}
示例4: createGradient
QString KstIfaceImpl::createGradient(const QString& name, bool xDirection, double zAtMin, double zAtMax,
int xNumSteps, int yNumSteps, double xMin, double yMin,
double xStepSize, double yStepSize) {
// make sure tag name is unique
// make sure name is unique, else generate a unique one
KST::matrixList.lock().readLock();
QString matrixName;
if (name.isEmpty()) {
matrixName = "M" + QString::number(KST::matrixList.count() + 1);
} else {
matrixName = name;
}
while (KstData::self()->matrixTagNameNotUnique(matrixName, false)) {
matrixName = "M" + QString::number(KST::matrixList.count() + 1);
}
KST::matrixList.lock().unlock();
// create the gradient matrix
KstMatrixPtr p = new KstSMatrix(matrixName, xNumSteps, yNumSteps, xMin, yMin, xStepSize, yStepSize,
zAtMin, zAtMax, xDirection);
KST::addMatrixToList(p);
if (p) {
_doc->forceUpdate();
_doc->setModified();
return p->tagName();
}
return QString::null;
}
示例5: loadMatrix
QString KstIfaceImpl::loadMatrix(const QString& name, const QString& file, const QString& field,
int xStart, int yStart, int xNumSteps, int yNumSteps,
int skipFrames, bool boxcarFilter) {
KstDataSourcePtr src;
/* generate or find the kstfile */
KST::dataSourceList.lock().writeLock();
KstDataSourceList::Iterator it = KST::dataSourceList.findReusableFileName(file);
if (it == KST::dataSourceList.end()) {
src = KstDataSource::loadSource(file);
if (!src || !src->isValid()) {
KST::dataSourceList.lock().unlock();
return QString::null;
}
if (src->isEmpty()) {
KST::dataSourceList.lock().unlock();
return QString::null;
}
KST::dataSourceList.append(src);
} else {
src = *it;
}
src->writeLock();
KST::dataSourceList.lock().unlock();
// make sure field is valid
if (!src->isValidMatrix(field)) {
src->unlock();
return QString::null;
}
// make sure name is unique, else generate a unique one
KST::matrixList.lock().readLock();
QString matrixName;
if (name.isEmpty()) {
matrixName = "M" + QString::number(KST::matrixList.count() + 1);
} else {
matrixName = name;
}
while (KstData::self()->matrixTagNameNotUnique(matrixName, false)) {
matrixName = "M" + QString::number(KST::matrixList.count() + 1);
}
KST::matrixList.lock().unlock();
KstMatrixPtr p = new KstRMatrix(src, field, matrixName, xStart, yStart, xNumSteps, yNumSteps,
boxcarFilter, skipFrames > 0, skipFrames);
KST::addMatrixToList(p);
src->unlock();
if (p) {
_doc->forceUpdate();
_doc->setModified();
return p->tagName();
}
return QString::null;
}
示例6: newMatrixCreated
void MatrixSelector::newMatrixCreated( KstMatrixPtr v ) {
QString name;
v->readLock();
name = v->tagName();
v->unlock();
v = 0L; // deref
emit newMatrixCreated(name);
}
示例7: editObject
bool KstMatrixDialog::editObject() {
//
// if editing multiple objects, edit each one...
//
if (_editMultipleMode) {
// xxx _fileNameDirty = !_w->_fileName->url().isEmpty();
_gradientZAtMinDirty = !_w->_gradientZAtMin->text().isEmpty();
_gradientZAtMaxDirty = !_w->_gradientZAtMax->text().isEmpty();
_minXDirty = !_w->_minX->text().isEmpty();
_minYDirty = !_w->_minY->text().isEmpty();
_yStepDirty = !_w->_yStep->text().isEmpty();
_xStepDirty = !_w->_xStep->text().isEmpty();
_xStartDirty = _w->_xStart->text() != " ";
_yStartDirty = _w->_yStart->text() != " ";
_xNumStepsDirty = _w->_xNumSteps->text() != " ";
_yNumStepsDirty = _w->_yNumSteps->text() != " ";
_skipDirty = _w->_skip->text() != " ";
_nXDirty = _w->_nX->text() != " ";
_nYDirty = _w->_nY->text() != " ";
bool didEdit = false;
int i;
for (i = 0; i < _editMultipleWidget->_objectList->count(); i++) {
if (_editMultipleWidget->_objectList->item(i)->isSelected()) {
KstMatrixPtr mxPtr;
//
// get the pointer to the object...
//
KST::matrixList.lock().readLock();
mxPtr = *KST::matrixList.findTag(_editMultipleWidget->_objectList->item(i)->text());
KST::matrixList.lock().unlock();
if (!mxPtr) {
return false;
}
if (!editSingleObject(mxPtr)) {
return false;
}
didEdit = true;
}
}
if (!didEdit) {
QMessageBox::warning(this, QObject::tr("Kst"), QObject::tr("Select one or more objects to edit."));
return false;
}
} else {
KstMatrixPtr mp;
QString tagName;
mp = kst_cast<KstMatrix>(_dp);
tagName = _tagName->text();
if (!mp || (tagName != mp->tagName() && KstData::self()->dataTagNameNotUnique(tagName))) {
_tagName->setFocus();
return false;
}
mp->writeLock();
mp->setTag(KstObjectTag(tagName, mp->tag().context())); // FIXME: can't change tag context
mp->unlock();
//
// then edit the object...
//
_fileNameDirty = true;
_fieldDirty = true;
_xStartDirty = true;
_xStartCountFromEndDirty = true;
_yStartDirty = true;
_yStartCountFromEndDirty = true;
_xNumStepsDirty = true;
_xNumStepsReadToEndDirty = true;
_yNumStepsDirty = true;
_yNumStepsReadToEndDirty = true;
_gradientXDirty = true;
_gradientYDirty = true;
_gradientZAtMinDirty = true;
_gradientZAtMaxDirty = true;
_minXDirty = true;
_minYDirty = true;
_xStepDirty = true;
_yStepDirty = true;
_doSkipDirty = true;
_skipDirty = true;
_doAveDirty = true;
_nXDirty = true;
_nYDirty = true;
if (!editSingleObject(mp)) {
//.........这里部分代码省略.........
示例8: setSelection
void MatrixSelector::setSelection( KstMatrixPtr v ) {
v->readLock();
setSelection(v->tagName());
v->unlock();
}