• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ Change函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: replaceWhitespaceInToken

void WhitespaceManager::replaceWhitespaceInToken(
    const FormatToken &Tok, unsigned Offset, unsigned ReplaceChars,
    StringRef PreviousPostfix, StringRef CurrentPrefix, bool InPPDirective,
    unsigned Newlines, unsigned Spaces) {
  Changes.push_back(Change(
      true, SourceRange(Tok.getStartOfNonWhitespace().getLocWithOffset(Offset),
                        Tok.getStartOfNonWhitespace().getLocWithOffset(
                            Offset + ReplaceChars)),
      Spaces, Spaces, Newlines, PreviousPostfix, CurrentPrefix,
      // If we don't add a newline this change doesn't start a comment. Thus,
      // when we align line comments, we don't need to treat this change as one.
      // FIXME: We still need to take this change in account to properly
      // calculate the new length of the comment and to calculate the changes
      // for which to do the alignment when aligning comments.
      Tok.Type == TT_LineComment && Newlines > 0 ? tok::comment : tok::unknown,
      InPPDirective && !Tok.IsFirst));
}
开发者ID:IllusionRom-deprecated,项目名称:android_platform_external_clang,代码行数:17,代码来源:WhitespaceManager.cpp


示例17: CtrlLayout

void MeasuresTab::Init(ScatterCtrl& scatter) {
	CtrlLayout(*this);
	SizePos();
	
	pscatter = &scatter;
	
	xMin <<= scatter.GetXMin();
	xMax <<= scatter.GetXRange() + scatter.GetXMin();
	yMin <<= scatter.GetYMin();
	yMax <<= scatter.GetYRange() + scatter.GetYMin();
	yMin2 <<= scatter.GetYMin2();
	yMax2 <<= scatter.GetY2Range() + scatter.GetYMin2();
	
	butUpdate.WhenAction = THISBACK(Change);
	
	Change();
}
开发者ID:kolyden,项目名称:mirror,代码行数:17,代码来源:Properties.cpp


示例18: layerFeatureA

void QgsGeometryContainedCheck::fixError( QgsGeometryCheckError *error, int method, const QMap<QString, int> & /*mergeAttributeIndices*/, Changes &changes ) const
{
  QgsGeometryContainedCheckError *containerError = static_cast<QgsGeometryContainedCheckError *>( error );
  QgsFeaturePool *featurePoolA = mContext->featurePools[ error->layerId() ];
  QgsFeaturePool *featurePoolB = mContext->featurePools[ containerError->containingFeature().first ];

  QgsFeature featureA;
  QgsFeature featureB;
  if ( !featurePoolA->get( error->featureId(), featureA ) ||
       !featurePoolB->get( containerError->containingFeature().second, featureB ) )
  {
    error->setObsolete();
    return;
  }

  // Check if error still applies
  QgsGeometryCheckerUtils::LayerFeature layerFeatureA( featurePoolA, featureA, true );
  QgsGeometryCheckerUtils::LayerFeature layerFeatureB( featurePoolB, featureB, true );

  std::unique_ptr< QgsGeometryEngine > geomEngineA = QgsGeometryCheckerUtils::createGeomEngine( layerFeatureA.geometry(), mContext->tolerance );
  std::unique_ptr< QgsGeometryEngine > geomEngineB = QgsGeometryCheckerUtils::createGeomEngine( layerFeatureB.geometry(), mContext->tolerance );

  if ( !( geomEngineB->contains( layerFeatureA.geometry() ) && !geomEngineA->contains( layerFeatureB.geometry() ) ) )
  {
    error->setObsolete();
    return;
  }

  // Fix error
  if ( method == NoChange )
  {
    error->setFixed( method );
  }
  else if ( method == Delete )
  {
    changes[error->layerId()][featureA.id()].append( Change( ChangeFeature, ChangeRemoved ) );
    featurePoolA->deleteFeature( featureA.id() );
    error->setFixed( method );
  }
  else
  {
    error->setFixFailed( tr( "Unknown method" ) );
  }
}
开发者ID:CS-SI,项目名称:QGIS,代码行数:44,代码来源:qgsgeometrycontainedcheck.cpp


示例19: Change

size_t KeyBar::Change(const KeyBarTitles *Kbt)
{
	size_t Result=0;

	if (!Kbt)
		return Result;

	static DWORD Groups[]=
	{
		0,KBL_MAIN,
		KEY_SHIFT,KBL_SHIFT,
		KEY_CTRL,KBL_CTRL,
		KEY_ALT,KBL_ALT,
		KEY_CTRL|KEY_SHIFT,KBL_CTRLSHIFT,
		KEY_ALT|KEY_SHIFT,KBL_ALTSHIFT,
		KEY_CTRL|KEY_ALT,KBL_CTRLALT,
		KEY_CTRL|KEY_ALT|KEY_SHIFT,KBL_CTRLALTSHIFT,
	};

	for (size_t I = 0; I < Kbt->CountLabels; ++I)
	{

		WORD Pos=Kbt->Labels[I].Key.VirtualKeyCode;
		DWORD Shift=0,Flags=Kbt->Labels[I].Key.ControlKeyState;
		if(Flags&(LEFT_CTRL_PRESSED|RIGHT_CTRL_PRESSED)) Shift|=KEY_CTRL;
		if(Flags&(LEFT_ALT_PRESSED|RIGHT_ALT_PRESSED)) Shift|=KEY_ALT;
		if(Flags&SHIFT_PRESSED) Shift|=KEY_SHIFT;

		if (Pos >= VK_F1 && Pos <= VK_F24)
		{
			for (unsigned J=0; J < ARRAYSIZE(Groups); J+=2)
			{
				if (Groups[J] == Shift)
				{
					Change(Groups[J+1],Kbt->Labels[I].Text,Pos-VK_F1);
					Result++;
					break;
				}
			}
		}
	}

	return Result;
}
开发者ID:alexlav,项目名称:conemu,代码行数:44,代码来源:keybar.cpp


示例20: both

/*---------------------------------------------------------------------------
   This function will update either the video texture, or depth texture, or
   both (if applicable). It may also recofigure the filter if the selected
   input has a different resolution. Returns true if either of the textures
   were updated.
  ---------------------------------------------------------------------------*/
bool Filter::Update(Buffers &Buffer)
   {
   if (!Ready()) {return false;}

   //Test for resolution change, if applicable
   Change(Buffer);
   
   bool Updated = false;

   if (Buffer.VideoUpdated(VideoUpdateID) && EnableVideo)
      {
      Texture &VideoFront = Buffer.GetVideo();
      MutexControl Mutex(VideoFront.GetMutexHandle());
      if (Mutex.LockRequest())
         {
         Video.Bind(0);
         Video.Update(VideoFront);
         Video.Unbind(0);
         Mutex.Unlock();
         Updated |= true;
         }
      }

   if (Buffer.DepthUpdated(DepthUpdateID) && EnableDepth)
      {
      Texture &DepthFront = Buffer.GetDepth();
      MutexControl Mutex(DepthFront.GetMutexHandle());
      if (Mutex.LockRequest())
         {
         Depth.Bind(0);
         Depth.Update(DepthFront);
         Depth.Unbind(0);
         Mutex.Unlock();
         Updated |= true;
         }
      }

   #if defined (DEBUG)
      GLenum Error = glGetError();
      if (Error != GL_NO_ERROR) {throw dexception("OpenGL generated an error: %s", Debug::ErrorGL(Error));}
   #endif

   return Updated;
   }
开发者ID:DominikDeak,项目名称:KFX,代码行数:50,代码来源:filter.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ChangeDisplaySettings函数代码示例发布时间:2022-05-30
下一篇:
C++ Ch函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap