本文整理汇总了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 ) );
}
}
示例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));
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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));
}
示例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;
}
示例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;
}
示例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();
}
}
示例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));
}
示例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]);
}
示例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();
}
示例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;
}
}
}
}
}
示例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;
}
}
}
}
}