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


C++ Change函数代码示例

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


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

示例1: Change

void QgsGeometryCheck::deleteFeatureGeometryPart( QgsFeature &feature, int partIdx, Changes &changes ) const
{
  QgsAbstractGeometryV2* geom = feature.geometry()->geometry();
  if ( dynamic_cast<QgsGeometryCollectionV2*>( geom ) )
  {
    static_cast<QgsGeometryCollectionV2*>( geom )->removeGeometry( partIdx );
    if ( static_cast<QgsGeometryCollectionV2*>( geom )->numGeometries() == 0 )
    {
      mFeaturePool->deleteFeature( feature );
      changes[feature.id()].append( Change( ChangeFeature, ChangeRemoved ) );
    }
    else
    {
      mFeaturePool->updateFeature( feature );
      changes[feature.id()].append( Change( ChangePart, ChangeRemoved, QgsVertexId( partIdx ) ) );
    }
  }
  else
  {
    mFeaturePool->deleteFeature( feature );
    changes[feature.id()].append( Change( ChangeFeature, ChangeRemoved ) );
  }
}
开发者ID:spatialthoughts,项目名称:QGIS,代码行数:23,代码来源:qgsgeometrycheck.cpp

示例2: ASSERT

void Selection::remove(Tile* tile, Item* item)
{
	ASSERT(subsession);
	ASSERT(tile);
	ASSERT(item);

	bool tmp = item->isSelected();
	item->deselect();
	Tile* new_tile = tile->deepCopy(editor.map);
	if(tmp) item->select();
	if(item->isBorder() && g_settings.getInteger(Config::BORDER_IS_GROUND)) new_tile->deselectGround();

	subsession->addChange(newd Change(new_tile));
}
开发者ID:HeavenIsLost,项目名称:rme,代码行数:14,代码来源:selection.cpp

示例3: main

int main(){
	int Option=1,
			Value,
			i;	       
	
	while(Option){
		printf("1) PUSH Stack\n2) POP Stack\n3) Print Stack\n4) Peep\n5) Change Stack\n0) Exit program\n"); 
		scanf("%d", &Option);  
		switch(Option){
		 case 1:
		   do{
				printf("Enter a +ve value: ");
 		    scanf("%d", &Value);
			 }while(Value<0);       
			 Push(Value);	/* allow possitive values */		   
			 printf("Stack PUSHed\n\n");
		   break;
		 case 2:
		   Pop();
		   printf("Stack POPed\n\n");
		   break;
		 case 3:
		   StackPrint();
		   break;
		 case 4:
			 printf("Enter a valid index: ");
		   scanf("%d", &Value);
		   Value = Peep(Value);
			 if(Value)
			 	printf("Value at asked index: %d\n\n", Value);
		   else
				printf("wrong index\n\n");
			 break;
		 case 5:
			 printf("Enter a valid index & value: ");
		   scanf("%d %d", &i, &Value);
			 Change(i,Value);
			 printf("Value changed\n\n");
		   break;
		 case 0:
		   DeleteStack();
		   break;
		 default:
			 printf("Enter a valid choice\n\n");
			 break;
		}
	}
  return 1;
}
开发者ID:Adesh,项目名称:cPrograms,代码行数:49,代码来源:Stack.c

示例4: Copy

int Copy(int copy, int index)
{
  if (test[copy] > move_pos[index][copy])
    if (copy > 0)
       return Change(copy - 1);
    else
    {
       No();
       return 0;
    }
  test[copy] = move_pos[index][copy];
  ++copy;
  while (copy < p) test[copy++] = 1;
  return 0;
}
开发者ID:antoshkaplus,项目名称:CompetitiveProgramming,代码行数:15,代码来源:mmind.c

示例5: ChangeById

int ChangeById(mlink * h, id_tm who, mem_t sz, maddr_t * addr)
{
	mlink *p = h;

	if (NULL == h || sz < 0)
		return -1;

	if (NULL == (p = FindById(p, who)))
		return -1;

	if (-1 == Change(p, sz, addr))
		return -1;

	return 0;
}
开发者ID:Qiuyongjie,项目名称:memlink,代码行数:15,代码来源:memfunc.c

示例6: main

int main()
{
	int i,j;
	for (i=0; i<3; i++)
	 for (j=0; j<3; j++)
	   scanf("%d",&a[i][j]);
	Change(a);
	for (i=0; i<3; i++)
	{
		for (j=0; j<3; j++)
		 printf("%d ",a[i][j]);
		 printf("\n");
	}
	return 0;
}
开发者ID:2015CLanguage,项目名称:Homework8,代码行数:15,代码来源:14151198_高威_7_4.c

示例7: ASSERT

void Selection::add(Tile* tile, Spawn* spawn)
{
	ASSERT(subsession);
	ASSERT(tile);
	ASSERT(spawn);

	if(spawn->isSelected()) return;

	// Make a copy of the tile with the item selected
	spawn->select();
	Tile* new_tile = tile->deepCopy(editor.map);
	spawn->deselect();

	subsession->addChange(newd Change(new_tile));
}
开发者ID:mattyx14,项目名称:rme,代码行数:15,代码来源:selection.cpp

示例8: ChangeByoff

int ChangeByoff(mlink * h, offset_t off, mem_t sz, maddr_t * addr)
{
	mlink *p = h;

	if (NULL == h || off > Count(h) || off < 0 || sz < 0)
		return -1;

	if (NULL == (p = FindByoff(p, off)))
		return -1;

	if (-1 == Change(p, sz, addr))
		return -1;

	return 0;
}
开发者ID:Qiuyongjie,项目名称:memlink,代码行数:15,代码来源:memfunc.c

示例9: Replace_min

bool ScrollListShape::setSelectDown(ulen pos) // pos -> down , -> up , unchanged
 {
  ulen count=info->getLineCount();

  Replace_min(pos,count);

  for(ulen i=pos; i<count ;i++)
    {
     if( info->getLine(i).type==ComboInfoText )
       {
        return Change(select,i);
       }
    }

  for(ulen i=pos; i-- ;)
    {
     if( info->getLine(i).type==ComboInfoText )
       {
        return Change(select,i);
       }
    }

  return false;
 }
开发者ID:SergeyStrukov,项目名称:CCore-2-99,代码行数:24,代码来源:Shape.ScrollList.cpp

示例10: Change

void Selection::clear()
{
	if(session) {
		for(TileVector::iterator it = tiles.begin(); it != tiles.end(); it++) {
			Tile* new_tile = (*it)->deepCopy(editor.map);
			new_tile->deselect();
			subsession->addChange(newd Change(new_tile));
		}
	} else {
		for(TileVector::iterator it = tiles.begin(); it != tiles.end(); it++) {
			(*it)->deselect();
		}
		tiles.clear();
	}
}
开发者ID:Codex-NG,项目名称:rme,代码行数:15,代码来源:selection.cpp

示例11: breakToken

void WhitespaceManager::breakToken(const FormatToken &Tok, unsigned Offset,
                                   unsigned ReplaceChars,
                                   StringRef PreviousPostfix,
                                   StringRef CurrentPrefix, bool InPPDirective,
                                   unsigned Spaces) {
  Changes.push_back(Change(
      true, SourceRange(Tok.getStartOfNonWhitespace().getLocWithOffset(Offset),
                        Tok.getStartOfNonWhitespace().getLocWithOffset(
                            Offset + ReplaceChars)),
      Spaces, Spaces, 1, PreviousPostfix, CurrentPrefix,
      // FIXME: Unify token adjustment, so we don't split it between
      // BreakableToken and the WhitespaceManager. That would also allow us to
      // correctly store a tok::TokenKind instead of rolling our own enum.
      tok::unknown, InPPDirective && !Tok.IsFirst));
}
开发者ID:mikea,项目名称:clang,代码行数:15,代码来源:WhitespaceManager.cpp

示例12: main

int main()
{
	freopen("name.in","r",stdin);
	freopen("name.out","w",stdout);
	scanf("%d",&n);
	for(int i=1;i<=n;i++) scanf("%d",&a[i][0]);
	for(int i=1;i<=n;i++) scanf("%d",&a[i][1]);
	Build(1,n);
	scanf("%d",&m);
	for(int i=1,x,y,z;i<=m;i++)
	{
		scanf("%d%d%d",&x,&y,&z);
		Change(1,x,y,z);
	}
	printf("%lld\n",t[1].sum[0]);
}
开发者ID:cjsoft,项目名称:inasdfz,代码行数:16,代码来源:name.cpp

示例13: SeriesEdit

//перенос релиза серии на 7 дней
void AnimeList::ModifySeries()
{
	Date release;
	if(seriesDate.IsCursor())
	{
		release = ~dateSeries;
		operator+=(release, 7);
		seriesDate.Set(1, release);
		series.number = seriesDate.Get(Series);
		series.release = release;
		SeriesEdit();
		ModifyAnimeSeries();
	}
	Change();
	ChangeSeries();
}
开发者ID:MagistrTot,项目名称:AnimeListOld,代码行数:17,代码来源:main.cpp

示例14: Change

void QQuickChangeSet::change(QVector<Change> *changes)
{
    QVector<Insert>::iterator insert = m_inserts.begin();
    QVector<Change>::iterator change = m_changes.begin();
    for (QVector<Change>::iterator cit = changes->begin(); cit != changes->end(); ++cit) {
        for (; insert != m_inserts.end() && insert->end() < cit->index; ++insert) {}
        for (; insert != m_inserts.end() && insert->index < cit->end(); ++insert) {
            const int offset = insert->index - cit->index;
            const int count = cit->count + cit->index - insert->index - insert->count;
            if (offset == 0) {
                cit->index = insert->index + insert->count;
                cit->count = count;
            } else {
                cit = changes->insert(++cit, Change(insert->index + insert->count, count));
                --cit;
                cit->count = offset;
            }
        }

        for (; change != m_changes.end() && change->index + change->count < cit->index; ++change) {}
        if (change == m_changes.end() || change->index > cit->index + cit->count) {
            if (cit->count > 0) {
                change = m_changes.insert(change, *cit);
                ++change;
            }
        } else {
            if (cit->index < change->index) {
                change->count += change->index - cit->index;
                change->index = cit->index;
            }

            if (cit->index + cit->count > change->index + change->count) {
                change->count = cit->index + cit->count - change->index;
                QVector<Change>::iterator cbegin = change;
                QVector<Change>::iterator cend = ++cbegin;
                for (; cend != m_changes.end() && cend->index <= change->index + change->count; ++cend) {
                    if (cend->index + cend->count > change->index + change->count)
                        change->count = cend->index + cend->count - change->index;
                }
                if (cbegin != cend) {
                    change = m_changes.erase(cbegin, cend);
                    --change;
                }
            }
        }
    }
}
开发者ID:crobertd,项目名称:qtdeclarative,代码行数:47,代码来源:qquickchangeset.cpp

示例15: Change

void QDeclarativeChangeSet::applyChanges(QVector<Change> &changes)
{
    QVector<Insert>::iterator insert = m_inserts.begin();
    QVector<Change>::iterator change = m_changes.begin();
    for (QVector<Change>::iterator cit = changes.begin(); cit != changes.end(); ++cit) {
        for (; insert != m_inserts.end() && insert->end() < cit->index; ++insert) {}
        for (; insert != m_inserts.end() && insert->index < cit->end(); ++insert) {
            const int offset = insert->index - cit->index;
            const int count = cit->count + cit->index - insert->index - insert->count;
            if (offset == 0) {
                cit->index = insert->index + insert->count;
                cit->count = count;
            } else {
                cit = changes.insert(++cit, Change(insert->index + insert->count, count));
                --cit;
                cit->count = offset;
            }
        }

        for (; change != m_changes.end() && change->index + change->count < cit->index; ++change) {}
        if (change == m_changes.end() || change->index > cit->index + cit->count) {
            if (cit->count > 0) {
                change = m_changes.insert(change, *cit);
                ++change;
            }
        } else {
            if (cit->index < change->index) {
                change->count += change->index - cit->index;
                change->index = cit->index;
            }

            if (cit->index + cit->count > change->index + change->count) {
                change->count = cit->index + cit->count - change->index;
                QVector<Change>::iterator rbegin = change;
                QVector<Change>::iterator rend = ++rbegin;
                for (; rend != m_changes.end() && rend->index <= change->index + change->count; ++rend) {
                    if (rend->index + rend->count > change->index + change->count)
                        change->count = rend->index + rend->count - change->index;
                }
                if (rbegin != rend) {
                    change = m_changes.erase(rbegin, rend);
                    --change;
                }
            }
        }
    }
}
开发者ID:yinyunqiao,项目名称:qtdeclarative,代码行数:47,代码来源:qdeclarativechangeset.cpp


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