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


C++ UObject::CheckDefaultSubobjects方法代码示例

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


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

示例1: Apply

/**
 * Enacts the transaction.
 */
void FTransaction::Apply()
{
	checkSlow(Inc==1||Inc==-1);

	// Figure out direction.
	const int32 Start = Inc==1 ? 0             : Records.Num()-1;
	const int32 End   = Inc==1 ? Records.Num() :              -1;

	// Init objects.
	TArray<UObject*> ChangedObjects;
	for( int32 i=Start; i!=End; i+=Inc )
	{
		Records[i].bRestored = false;
		if(ChangedObjects.Find(Records[i].Object) == INDEX_NONE)
		{
			Records[i].Object->CheckDefaultSubobjects();
			Records[i].Object->PreEditUndo();
			ChangedObjects.Add(Records[i].Object);
		}
	}
	for( int32 i=Start; i!=End; i+=Inc )
	{
		Records[i].Restore( this );
	}

	NumModelsModified = 0;		// Count the number of UModels that were changed.
	for(int32 ObjectIndex = 0;ObjectIndex < ChangedObjects.Num();ObjectIndex++)
	{
		UObject* ChangedObject = ChangedObjects[ObjectIndex];
		UModel* Model = Cast<UModel>(ChangedObject);
		if( Model && Model->Nodes.Num() )
		{
			FBSPOps::bspBuildBounds( Model );
			++NumModelsModified;
		}
		ChangedObject->PostEditUndo();
	}
	
	// Rebuild BSP here instead of waiting for the next tick since
	// multiple transaction events can occur in a single tick
	if (ABrush::NeedsRebuild())
	{
		GEditor->RebuildAlteredBSP();
	}

	// Flip it.
	if( bFlip )
	{
		Inc *= -1;
	}
	for(int32 ObjectIndex = 0;ObjectIndex < ChangedObjects.Num();ObjectIndex++)
	{
		UObject* ChangedObject = ChangedObjects[ObjectIndex];
		ChangedObject->CheckDefaultSubobjects();
	}
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:59,代码来源:EditorTransaction.cpp

示例2: Apply

/**
 * Enacts the transaction.
 */
void FTransaction::Apply()
{
	checkSlow(Inc==1||Inc==-1);

	// Figure out direction.
	const int32 Start = Inc==1 ? 0             : Records.Num()-1;
	const int32 End   = Inc==1 ? Records.Num() :              -1;

	// Init objects.
	for( int32 i=Start; i!=End; i+=Inc )
	{
		FObjectRecord& Record = Records[i];
		Record.bRestored = false;

		UObject* Object = Record.Object.Get();
		if (Object)
		{
			if (!ChangedObjects.Contains(Object))
			{
				Object->CheckDefaultSubobjects();
				Object->PreEditUndo();
			}

			ChangedObjects.Add(Object, Record.ObjectAnnotation);
		}
	}

	if (bFlip)
	{
		for (int32 i = Start; i != End; i += Inc)
		{
			Records[i].Save(this);
		}
		for (int32 i = Start; i != End; i += Inc)
		{
			Records[i].Load(this);
		}
	}
	else
	{
		for (int32 i = Start; i != End; i += Inc)
		{
			Records[i].Restore(this);
		}
	}

	// An Actor's components must always get its PostEditUndo before the owning Actor so do a quick sort
	ChangedObjects.KeySort([](UObject& A, UObject& B)
	{
		UActorComponent* BAsComponent = Cast<UActorComponent>(&B);
		return (BAsComponent ? (BAsComponent->GetOwner() != &A) : true);
	});

	TArray<ULevel*> LevelsToCommitModelSurface;
	NumModelsModified = 0;		// Count the number of UModels that were changed.
	for (auto ChangedObjectIt : ChangedObjects)
	{
		UObject* ChangedObject = ChangedObjectIt.Key;
		UModel* Model = Cast<UModel>(ChangedObject);
		if (Model && Model->Nodes.Num())
		{
			FBSPOps::bspBuildBounds(Model);
			++NumModelsModified;
		}
		
		if (UModelComponent* ModelComponent = Cast<UModelComponent>(ChangedObject))
		{
			ULevel* Level = ModelComponent->GetTypedOuter<ULevel>();
			check(Level);
			LevelsToCommitModelSurface.AddUnique(Level);
		}

		TSharedPtr<ITransactionObjectAnnotation> ChangedObjectTransactionAnnotation = ChangedObjectIt.Value;
		if (ChangedObjectTransactionAnnotation.IsValid())
		{
			ChangedObject->PostEditUndo(ChangedObjectTransactionAnnotation);
		}
		else
		{
			ChangedObject->PostEditUndo();
		}
	}

	// Commit model surfaces for unique levels within the transaction
	for (ULevel* Level : LevelsToCommitModelSurface)
	{
		Level->CommitModelSurfaces();
	}

	// Flip it.
	if (bFlip)
	{
		Inc *= -1;
	}
	for (auto ChangedObjectIt : ChangedObjects)
	{
		UObject* ChangedObject = ChangedObjectIt.Key;
//.........这里部分代码省略.........
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:101,代码来源:EditorTransaction.cpp


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