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


C++ IdList::append方法代码示例

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


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

示例1: elementsByPropertyContent

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

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

	for (Object * const element : mObjects.values()) {
		QMapIterator<QString, QVariant> iterator = element->propertiesIterator();
		if (regExpression) {
			while (iterator.hasNext()) {
				if (iterator.next().value().toString().contains(regExp)) {
					result.append(mObjects.key(element));
					break;
				}
			}
		} else {
			while (iterator.hasNext()) {
				if (iterator.next().value().toString().contains(propertyValue, caseSensitivity)) {
					result.append(mObjects.key(element));
					break;
				}
			}
		}
	}

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

示例2: 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

示例3: findElementsByName

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

示例4: 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

示例5: setItemsToDelete

void MultipleRemoveCommand::setItemsToDelete(IdList &itemsToDelete)
{
	IdList itemsToUpdate;

	addEdgesToBeDeleted(itemsToDelete);
	// QGraphicsScene::selectedItems() returns items in no particular order,
	// so we should handle parent-child relationships manually
	while (!itemsToDelete.isEmpty()) {
		const Id currentItem = itemsToDelete.at(0);
		const IdList children = mGraphicalApi.children(currentItem);
		foreach (const Id &child, children) {
			itemsToDelete.removeAll(child);
			// Child remove commands will be added in currentItem delete command
		}

		const bool isEdge = !mLogicalApi.editorManagerInterface().isGraphicalElementNode(currentItem);
		if (isEdge) {
			const Id src = mGraphicalApi.from(currentItem);
			if (src != Id() && !itemsToUpdate.contains(src)) {
				itemsToUpdate.append(src);
			}
			const Id dst = mGraphicalApi.to(currentItem);
			if (dst != Id() && !itemsToUpdate.contains(dst)) {
				itemsToUpdate.append(dst);
			}

			insertPreAction(graphicalDeleteCommand(currentItem), 0);
		} else {
			addPreAction(graphicalDeleteCommand(currentItem));
		}

		itemsToDelete.removeAll(currentItem);
	}
开发者ID:ecolog,项目名称:qreal,代码行数:33,代码来源:multipleRemoveCommand.cpp

示例6: idsOfAllChildrenOf

IdList Repository::idsOfAllChildrenOf(Id id) const
{
	IdList result;
	result.clear();
	result.append(id);
	IdList list = mObjects[id]->children();
	for (const Id &childId : list) {
		result.append(idsOfAllChildrenOf(childId));
	}

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

示例7: 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

示例8: generateToJava

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

示例9: 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

示例10: graphicalIdsByLogicalId

IdList GraphicalModelAssistApi::graphicalIdsByLogicalId(const Id &logicalId) const
{
	IdList result;
	QList<QPersistentModelIndex> indexes = mGraphicalModel.indexesWithLogicalId(logicalId);
	for (const QPersistentModelIndex &index : indexes) {
		result.append(idByIndex(index));
	}

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

示例11: allRules

IdList VisualInterpreterUnit::allRules() const
{
	IdList const elements = elementsFromActiveDiagram();
	IdList result;
	foreach (Id const &element, elements) {
		if (element.element() == "SemanticsRule") {
			result.append(element);
		}
	}
	return result;
}
开发者ID:IrinaShkviro,项目名称:qreal,代码行数:11,代码来源:visualInterpreterUnit.cpp

示例12: subprogramElementId

Id RefactoringApplier::subprogramElementId() const
{
	IdList result;
	IdList const after = elementsFromAfterBlock();
	for (Id const &id : after) {
		if (mRefactoringRepoApi->isGraphicalElement(id)
				&& (isNodeInRule(id)))
			result.append(id);
	}
	if (result.size() == 1)
		return result.first();
	return Id::rootId();
}
开发者ID:qreal,项目名称:qreal,代码行数:13,代码来源:refactoringApplier.cpp

示例13: diagramsFromList

IdList LogicalModelAssistApi::diagramsFromList(IdList const &list) const
{
	// TODO: diagrams are kinda special, so we need the editor to be able to
	// tell us whether this particular element is a diagram or not
	IdList result;
	foreach (Id type, list) {
		if (type.element().split("_").back().contains("Diagram", Qt::CaseInsensitive)) {
			if (!result.contains(type))
				result.append(type);
		}
	}
	return result;
}
开发者ID:fsulima,项目名称:qreal,代码行数:13,代码来源:logicalModelAssistApi.cpp

示例14: elementsByProperty

qReal::IdList Repository::elementsByProperty(const QString &property, bool sensitivity
		, bool regExpression) const
{
	IdList result;

	for (Object *element : mObjects.values()) {
		if ((element->hasProperty(property, sensitivity, regExpression))
				&& (!isLogicalId(mObjects.key(element)))) {
			result.append(mObjects.key(element));
		}
	}

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

示例15: logCycle

void 
FunctionDefinitionRecursion::determineCycles(const Model& m)
{
  IdIter it;
  IdRange range;
  IdList variables;
  IdMap logged;
  std::string id;
  variables.clear();

  /* create a list of variables that are cycles ie (x, x) */
  for (it = mIdMap.begin(); it != mIdMap.end(); it++)
  {
    if ((*it).first == (*it).second)
    {
      id = (*it).first;
      if (!variables.contains(id))
      {
        variables.append(id);
      }
    }
  }

  /* loop thru other dependencies for each; if the dependent is also
   * in the list then this is the cycle
   * keep a record of logged dependencies to avoid logging twice
   */
   
  for (unsigned int n = 0; n < variables.size(); n++)
  {
    id = variables.at((int)n);
    range = mIdMap.equal_range(id);
    for (it = range.first; it != range.second; it++)
    {
      if (((*it).second != id)
        && (variables.contains((*it).second))
        && !alreadyExistsInMap(logged, 
                   pair<const std::string, std::string>(id, (*it).second))
        && !alreadyExistsInMap(logged, 
                   pair<const std::string, std::string>((*it).second, id)))
      {
        logCycle(m.getFunctionDefinition(id), m.getFunctionDefinition((*it).second));
        logged.insert(pair<const std::string, std::string>(id, (*it).second));
      }
    }
  }
}
开发者ID:sbmlteam,项目名称:python-libsbml,代码行数:47,代码来源:FunctionDefinitionRecursion.cpp


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