本文整理汇总了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;
}
示例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());
}
}
}
示例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;
}
示例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();
}
示例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 ¶m : 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]);
}
}
示例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;
}
示例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();
}
}
示例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));
}
示例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;
}
示例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);
}
}
示例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);
}
示例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();
}
}
示例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);
}
}
}
}
}
示例14: applyElementsTo
IdList RefactoringApplier::applyElementsTo()
{
IdList result;
for (int i = 0; i < mApply->size(); ++i) {
result.append(mApply->at(i).second);
}
return result;
}
示例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;
}