当前位置: 首页>>代码示例>>C++>>正文


C++ IdList类代码示例

本文整理汇总了C++中IdList的典型用法代码示例。如果您正苦于以下问题:C++ IdList类的具体用法?C++ IdList怎么用?C++ IdList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了IdList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: IdList

/** @cond doxygenLibsbmlInternal */
IdList*
SBMLLevelVersionConverter::collectSpeciesReferenceIds()
{
  IdList* srids = new IdList();

  for (unsigned int i = 0; i < mDocument->getModel()->getNumReactions(); i++)
  {
    Reaction *r = mDocument->getModel()->getReaction(i);
    for (unsigned int j = 0; j < r->getNumReactants(); j++)
    {
      if (r->getReactant(j)->isSetId())
      {
        srids->append(r->getReactant(j)->getId());
      }
    }
    for (unsigned int j = 0; j < r->getNumProducts(); j++)
    {
      if (r->getProduct(j)->isSetId())
      {
        srids->append(r->getProduct(j)->getId());
      }
    }
  }

  return srids;
}
开发者ID:copasi,项目名称:copasi-dependencies,代码行数:27,代码来源:SBMLLevelVersionConverter.cpp

示例2: removeOne

void CreateRemoveCommandImplementation::removeOne(ElementInfo &element)
{
	if (element.id() == element.logicalId()) {
		mLogicalApi.removeReferencesTo(element.id());
		mLogicalApi.removeReferencesFrom(element.id());
		mLogicalApi.removeElement(element.id());
		mGraphicalApi.removeElement(element.id());
	} else {
		element.setAllGraphicalProperties(mGraphicalApi.properties(element.id()));
		if (!mLogicalApi.logicalRepoApi().exist(element.logicalId())) {
			mGraphicalApi.removeElement(element.id());
			return;
		}

		element.setAllLogicalProperties(mGraphicalApi.properties(element.logicalId()));
		const IdList graphicalIds = mGraphicalApi.graphicalIdsByLogicalId(element.logicalId());
		mGraphicalApi.removeElement(element.id());
		// Checking that the only graphical part is our element itself
		// (bijection between graphical and logical parts)
		if (graphicalIds.count() == 1 && graphicalIds[0] == element.id()) {
			mLogicalApi.removeReferencesTo(element.logicalId());
			mLogicalApi.removeReferencesFrom(element.logicalId());
			mLogicalApi.removeElement(element.logicalId());
		}
	}
}
开发者ID:Antropovi,项目名称:qreal,代码行数:26,代码来源:createRemoveCommandImplementation.cpp

示例3: currentIndex

int QWizardContainer::currentIndex() const
{
    const IdList idList = m_wizard->pageIds();
    const int currentId = m_wizard->currentId();
    const int rc = idList.empty() ? -1 : idList.indexOf(currentId);
    return rc;
}
开发者ID:kileven,项目名称:qt5,代码行数:7,代码来源:qwizard_container.cpp

示例4: refreshAllPalettes

void CreateRemoveCommandImplementation::remove()
{
	if (mIsFromLogicalModel) {
		mLogicalApi.removeReferencesTo(mId);
		mLogicalApi.removeReferencesFrom(mId);
		mLogicalApi.removeElement(mId);
		mGraphicalApi.removeElement(mId);
	} else {
		mGraphicalPropertiesSnapshot = mGraphicalApi.properties(mId);
		const Id logicalId = mGraphicalApi.logicalId(mId);
		if (!mLogicalApi.logicalRepoApi().exist(logicalId)) {
			mGraphicalApi.removeElement(mId);
			refreshAllPalettes();
			return;
		}

		mOldLogicalId = logicalId;
		mLogicalPropertiesSnapshot = mGraphicalApi.properties(logicalId);
		const IdList graphicalIds = mGraphicalApi.graphicalIdsByLogicalId(logicalId);
		mGraphicalApi.removeElement(mId);
		// Checking that the only graphical part is our element itself
		// (bijection between graphical and logical parts)
		if (graphicalIds.count() == 1 && graphicalIds[0] == mId) {
			mLogicalApi.removeReferencesTo(logicalId);
			mLogicalApi.removeReferencesFrom(logicalId);
			mLogicalApi.removeElement(logicalId);
		}
	}

	refreshAllPalettes();
}
开发者ID:Smirnov-Mikhail,项目名称:qreal,代码行数:31,代码来源:createRemoveCommandImplementation.cpp

示例5: error

void SubprogramBlock::run()
{
	const Id logicalId = mGraphicalModelApi->logicalId(id());

	const QString name = mLogicalModelApi->name(logicalId);

	const QString validName = utils::NameNormalizer::normalizeStrongly(name, false);
	if (validName.isEmpty()) {
		error(tr("Please enter valid c-style name for subprogram \"") + name + "\"");
		return;
	}

	const QList<DynamicParameter> parameters = dynamicParameters();
	for (const DynamicParameter &param : parameters) {
		if (param.type == "bool") {
			setVariableValue<bool>(param.name, evalCode<bool>(param.code));
		} else if (param.type == "int") {
			setVariableValue<int>(param.name, evalCode<int>(param.code));
		} else if (param.type == "float") {
			setVariableValue<qreal>(param.name, evalCode<qreal>(param.code));
		} else {
			setVariableValue<QString>(param.name, evalCode<QString>(param.code));
		}
	}

	const Id logicalDiagram = mLogicalModelApi->logicalRepoApi().outgoingExplosion(logicalId);
	const IdList diagrams = mGraphicalModelApi->graphicalIdsByLogicalId(logicalDiagram);
	if (!diagrams.isEmpty()) {
		emit stepInto(diagrams[0]);
	}
}
开发者ID:qreal,项目名称:qreal,代码行数:31,代码来源:subprogramBlock.cpp

示例6: regExp

IdList Repository::findElementsByName(const QString &name, bool sensitivity, bool regExpression) const
{
	const Qt::CaseSensitivity caseSensitivity = sensitivity ? Qt::CaseSensitive : Qt::CaseInsensitive;

	const QRegExp regExp(name, caseSensitivity);
	IdList result;

	if (regExpression){
		for (Object * const element : mObjects.values()) {
			if (element->property("name").toString().contains(regExp)
					&& !isLogicalId(mObjects.key(element))) {
				result.append(mObjects.key(element));
			}
		}
	} else {
		for (Object * const element : mObjects.values()) {
			if (element->property("name").toString().contains(name, caseSensitivity)
					&& !isLogicalId(mObjects.key(element))) {
				result.append(mObjects.key(element));
			}
		}
	}

	return result;
}
开发者ID:qreal,项目名称:qreal,代码行数:25,代码来源:repository.cpp

示例7: acos

void ConstraintBase::ModifyToSatisfy() {
    if(type == Type::ANGLE) {
        Vector a = SK.GetEntity(entityA)->VectorGetNum();
        Vector b = SK.GetEntity(entityB)->VectorGetNum();
        if(other) a = a.ScaledBy(-1);
        if(workplane.v != EntityBase::FREE_IN_3D.v) {
            a = a.ProjectVectorInto(workplane);
            b = b.ProjectVectorInto(workplane);
        }
        double c = (a.Dot(b))/(a.Magnitude() * b.Magnitude());
        valA = acos(c)*180/PI;
    } else {
        // We'll fix these ones up by looking at their symbolic equation;
        // that means no extra work.
        IdList<Equation,hEquation> l = {};
        // Generate the equations even if this is a reference dimension
        GenerateReal(&l);
        ssassert(l.n == 1, "Expected constraint to generate a single equation");

        // These equations are written in the form f(...) - d = 0, where
        // d is the value of the valA.
        valA += (l.elem[0].e)->Eval();

        l.Clear();
    }
}
开发者ID:blondegeek,项目名称:solvespace-1,代码行数:26,代码来源:constrainteq.cpp

示例8: graphicalIdsByLogicalId

IdList GraphicalModelAssistApi::graphicalIdsByLogicalId(Id const &logicalId) const
{
	IdList result;
	QList<QPersistentModelIndex> indexes = mGraphicalModel.indexesWithLogicalId(logicalId);
	foreach (QPersistentModelIndex index, indexes) {
		result.append(idByIndex(index));
	}
开发者ID:ArtemKopylov,项目名称:qreal,代码行数:7,代码来源:graphicalModelAssistApi.cpp

示例9: error

bool Block::initNextBlocks()
{
    if (id().isNull() || id() == Id::rootId()) {
        error(tr("Control flow break detected, stopping"));
        return false;
    }

    const IdList links = mGraphicalModelApi->graphicalRepoApi().outgoingLinks(id());

    if (links.count() > 1) {
        error(tr("Too many outgoing links"));
        return false;
    }

    if (links.count() == 0) {
        error(tr("No outgoing links, please connect this block to something or use Final Node to end program"));
        return false;
    }

    if (links.count() == 1) {
        const Id nextBlockId = mGraphicalModelApi->graphicalRepoApi().otherEntityFromLink(links[0], id());
        if (nextBlockId.isNull() || nextBlockId == Id::rootId()) {
            error(tr("Outgoing link is not connected"));
            return false;
        }

        mNextBlockId = nextBlockId;
    }

    return true;
}
开发者ID:Smirnov-Mikhail,项目名称:qreal,代码行数:31,代码来源:block.cpp

示例10: foreach

QString JavaHandler::generateToJava(QString const &pathToDir)
{
	mErrorText = "";
	this->pathToDir = pathToDir;

	Id repoId = ROOT_ID;

	if (checkTheModel()) {
		IdList allDiagrams = mApi.children(repoId);
		IdList classDiagrams;

		//separate just class diagrams, because they are the main diagrams, others are connected
		foreach (Id const aDiagram, allDiagrams) {
			if (objectType(aDiagram) == "ClassDiagram_ClassDiagramNode") {
				classDiagrams.append(aDiagram);
			}
			if (objectType(aDiagram) == "ActivityDiagram_ActivityDiagramNode") {
				//If there is no connected Class Methods it won't be serialized
				IdList incomingConnections = mApi.incomingConnections(aDiagram);
				if (incomingConnections.isEmpty()) {
					addError("Unable to serialize object " + objectType(aDiagram) + " with type: " + aDiagram.toString() + ". It is not connected to some class method.");
				}
			}
		}

		foreach (Id const classDiagram, classDiagrams) {
			serializeChildren(classDiagram);
		}
	}
开发者ID:nfrey,项目名称:qreal,代码行数:29,代码来源:javaHandler.cpp

示例11: InternEditList

bool QueueEditor::EditEntry(DownloadQueue* downloadQueue, int ID, DownloadQueue::EEditAction action, int offset, const char* text)
{
	m_downloadQueue = downloadQueue;
	IdList cIdList;
	cIdList.push_back(ID);
	return InternEditList(nullptr, &cIdList, action, offset, text);
}
开发者ID:ta264,项目名称:nzbget,代码行数:7,代码来源:QueueEditor.cpp

示例12: acos

void ConstraintBase::ModifyToSatisfy(void) {
    if(type == ANGLE) {
        Vector a = SK.GetEntity(entityA)->VectorGetNum();
        Vector b = SK.GetEntity(entityB)->VectorGetNum();
        if(other) a = a.ScaledBy(-1);
        if(workplane.v != EntityBase::FREE_IN_3D.v) {
            a = a.ProjectVectorInto(workplane);
            b = b.ProjectVectorInto(workplane);
        }
        double c = (a.Dot(b))/(a.Magnitude() * b.Magnitude());
        valA = acos(c)*180/PI;
    } else {
        // We'll fix these ones up by looking at their symbolic equation;
        // that means no extra work.
        IdList<Equation,hEquation> l;
        // An uninit IdList could lead us to free some random address, bad.
        ZERO(&l);
        // Generate the equations even if this is a reference dimension
        GenerateReal(&l);
        if(l.n != 1) oops();

        // These equations are written in the form f(...) - d = 0, where
        // d is the value of the valA.
        valA += (l.elem[0].e)->Eval();

        l.Clear();
    }
}
开发者ID:BBBSnowball,项目名称:python-solvespace,代码行数:28,代码来源:constrainteq.cpp

示例13: elementsFromBlock

IdList RefactoringApplier::elementsFromBlock(QString const &blockType) const
{
	IdList list;
	IdList resultList;
	IdList const refactoringElements = mRefactoringRepoApi->children(Id::rootId());
	foreach (Id const &refactoringElement, refactoringElements) {
		if (mRefactoringRepoApi->isGraphicalElement(refactoringElement)) {
			if (refactoringElement.element() == "RefactoringDiagramNode") {
				list = mRefactoringRepoApi->children(refactoringElement);
				foreach (Id const &id, list) {
					if (id.element() == blockType) {
						resultList.append(mRefactoringRepoApi->children(id));
						break;
					}
				}
				foreach (Id const &id, list) {
					if (id.element() == "Link" && resultList.contains(toInRule(id))
							&& resultList.contains(fromInRule(id)))
					{
						resultList.append(id);
					}
				}
			}
		}
	}
开发者ID:BogdanKl,项目名称:qreal,代码行数:25,代码来源:refactoringApplier.cpp

示例14: applyElementsTo

IdList RefactoringApplier::applyElementsTo()
{
	IdList result;
	for (int i = 0; i < mApply->size(); ++i) {
		result.append(mApply->at(i).second);
	}
	return result;
}
开发者ID:qreal,项目名称:qreal,代码行数:8,代码来源:refactoringApplier.cpp

示例15: s

/*******************************************************************
* Function Name: join
********************************************************************/
string Ini::join( IdList &id )
{
	string	s("");

	for (Ini::IdList::const_iterator cursor = id.begin(); cursor != id.end(); cursor++)
		s += *cursor;
	return s;
}
开发者ID:melkyades,项目名称:cdpp,代码行数:11,代码来源:ini.cpp


注:本文中的IdList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。