本文整理汇总了C++中TMultiMap类的典型用法代码示例。如果您正苦于以下问题:C++ TMultiMap类的具体用法?C++ TMultiMap怎么用?C++ TMultiMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TMultiMap类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: guard
void USetupDefinition::DoInstallSteps( FInstallPoll* Poll )
{
guard(USetupDefinition::DoInstallSteps);
// Handle all install steps.
BeginSteps();
TotalBytes = 0;
InstallTree( TEXT("ProcessPreCopy"), Poll, (INSTALL_STEP)ProcessPreCopy );
InstallTree( TEXT("ProcessCopy"), Poll, (INSTALL_STEP)ProcessCopy );
InstallTree( TEXT("ProcessExtra"), Poll, (INSTALL_STEP)ProcessExtra );
InstallTree( TEXT("ProcessPostCopy"), Poll, (INSTALL_STEP)ProcessPostCopy );
Exists = FolderExists = 1;
RegistryFolder = DestPath;
if( IsMasterProduct )
GConfig->SetString( TEXT("Setup"), TEXT("MasterProduct"), *Product, *(DestPath * TEXT("System") * SETUP_INI) );
TMultiMap<FString,FString>* Map = GConfig->GetSectionPrivate( TEXT("Setup"), 1, 0, *(DestPath * TEXT("System") * SETUP_INI) );
Map->AddUnique( TEXT("Group"), *Product );
for( TArray<FSavedIni>::TIterator It(SavedIni); It; ++It )
GConfig->SetString( *It->Section, *It->Key, *It->SavedValue, *It->File );
UninstallLogAdd( TEXT("Caption"), *LocalProduct, 1, 0 );
RootGroup->UninstallLog.Remove( TEXT("Version") );
UninstallLogAdd( TEXT("Version"), *Version, 1, 0 );
for( INT i=0; i<Requires.Num(); i++ )
{
USetupProduct* SetupProduct = new(GetOuter(),*Requires(i))USetupProduct;
if( SetupProduct->Product!=Product )
UninstallLogAdd( TEXT("Requires"), *SetupProduct->Product, 0, 0 );
}
EndSteps();
unguard;
}
开发者ID:LighFusion,项目名称:surreal,代码行数:32,代码来源:USetupDefinition.cpp
示例2: GetRankedMap
void AShooterGameState::GetRankedMap(int32 TeamIndex, RankedPlayerMap& OutRankedMap) const
{
OutRankedMap.Empty();
//first, we need to go over all the PlayerStates, grab their score, and rank them
TMultiMap<int32, AShooterPlayerState*> SortedMap;
for(int32 i = 0; i < PlayerArray.Num(); ++i)
{
int32 Score = 0;
AShooterPlayerState* CurPlayerState = Cast<AShooterPlayerState>(PlayerArray[i]);
if (CurPlayerState && (CurPlayerState->GetTeamNum() == TeamIndex))
{
SortedMap.Add(FMath::TruncToInt(CurPlayerState->Score), CurPlayerState);
}
}
//sort by the keys
SortedMap.KeySort(TGreater<int32>());
//now, add them back to the ranked map
OutRankedMap.Empty();
int32 Rank = 0;
for(TMultiMap<int32, AShooterPlayerState*>::TIterator It(SortedMap); It; ++It)
{
OutRankedMap.Add(Rank++, It.Value());
}
}
开发者ID:rob422lou,项目名称:Perdix,代码行数:29,代码来源:ShooterGameState.cpp
示例3: FixupPackageDependenciesForChunks
bool FChunkManifestGenerator::SaveManifests(FSandboxPlatformFile* InSandboxFile)
{
// Always do package dependency work, is required to modify asset registry
FixupPackageDependenciesForChunks(InSandboxFile);
if (bGenerateChunks)
{
for (auto Platform : Platforms)
{
if (!GenerateStreamingInstallManifest(Platform->PlatformName()))
{
return false;
}
// Generate map for the platform abstraction
TMultiMap<FString, int32> ChunkMap; // asset -> ChunkIDs map
TSet<int32> ChunkIDsInUse;
const FString PlatformName = Platform->PlatformName();
// Collect all unique chunk indices and map all files to their chunks
for (int32 ChunkIndex = 0; ChunkIndex < FinalChunkManifests.Num(); ++ChunkIndex)
{
if (FinalChunkManifests[ChunkIndex] && FinalChunkManifests[ChunkIndex]->Num())
{
ChunkIDsInUse.Add(ChunkIndex);
for (auto& Filename : *FinalChunkManifests[ChunkIndex])
{
FString PlatFilename = Filename.Value.Replace(TEXT("[Platform]"), *PlatformName);
ChunkMap.Add(PlatFilename, ChunkIndex);
}
}
}
// Sort our chunk IDs and file paths
ChunkMap.KeySort(TLess<FString>());
ChunkIDsInUse.Sort(TLess<int32>());
// Platform abstraction will generate any required platform-specific files for the chunks
if (!Platform->GenerateStreamingInstallManifest(ChunkMap, ChunkIDsInUse))
{
return false;
}
}
GenerateAssetChunkInformationCSV(FPaths::Combine(*FPaths::GameLogDir(), TEXT("ChunkLists")));
}
return true;
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:50,代码来源:ChunkManifestGenerator.cpp
示例4: AssociateSuppress
virtual void AssociateSuppress(FLogCategoryBase* Destination)
{
FName NameFName(Destination->CategoryFName);
check(Destination);
check(!Associations.Find(Destination)); // should not have this address already registered
Associations.Add(Destination, NameFName);
bool bFoundExisting = false;
for (TMultiMap<FName, FLogCategoryBase*>::TKeyIterator It(ReverseAssociations, NameFName); It; ++It)
{
if (It.Value() == Destination)
{
UE_LOG(LogHAL, Fatal,TEXT("Log suppression category %s was somehow declared twice with the same data."), *NameFName.ToString());
}
// if it is registered, it better be the same
if (It.Value()->CompileTimeVerbosity != Destination->CompileTimeVerbosity)
{
UE_LOG(LogHAL, Fatal,TEXT("Log suppression category %s is defined multiple times with different compile time verbosity."), *NameFName.ToString());
}
// we take whatever the existing one has to keep them in sync always
checkSlow(!(It.Value()->Verbosity & ELogVerbosity::BreakOnLog)); // this bit is factored out of this variable, always
Destination->Verbosity = It.Value()->Verbosity;
Destination->DebugBreakOnLog = It.Value()->DebugBreakOnLog;
Destination->DefaultVerbosity = It.Value()->DefaultVerbosity;
bFoundExisting = true;
}
ReverseAssociations.Add(NameFName, Destination);
if (bFoundExisting)
{
return; // in no case is there anything more to do...we want to match the other ones
}
SetupSuppress(Destination, NameFName); // this might be done again later if this is being set up before appInit is called
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:32,代码来源:OutputDevices.cpp
示例5: LinkToParents
// Creates child/parent relationship between the nodes
static void LinkToParents(TMultiMap<UObject*, FRefGraphItem*>& InputGraphNodeList, FRefGraphItem* NodeToLink)
{
for (auto It = InputGraphNodeList.CreateConstIterator(); It; ++It)
{
if (It.Value()->Link.ReferencedObj == NodeToLink->Link.ReferencedBy)
{
It.Value()->Children.Push(NodeToLink);
NodeToLink->Parents.Push(It.Value());
}
}
}
开发者ID:colwalder,项目名称:unrealengine,代码行数:12,代码来源:ReferenceChainSearch.cpp
示例6: CollectAttenuationShapesForVisualization
void FAttenuationSettings::CollectAttenuationShapesForVisualization(TMultiMap<EAttenuationShape::Type, AttenuationShapeDetails>& ShapeDetailsMap) const
{
if (bAttenuate)
{
AttenuationShapeDetails ShapeDetails;
ShapeDetails.Extents = AttenuationShapeExtents;
ShapeDetails.Falloff = FalloffDistance;
ShapeDetails.ConeOffset = ConeOffset;
ShapeDetailsMap.Add(AttenuationShape, ShapeDetails);
}
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:12,代码来源:SoundAttenuation.cpp
示例7: LoadAllClasses
/**
* Loads all of the UClass-es used by code so we can search for commandlets
*/
static void LoadAllClasses(void)
{
TArray<FString> ScriptPackageNames;
TMultiMap<FString,FString>* Sec = GConfig->GetSectionPrivate( TEXT("UnrealEd.EditorEngine"), 0, 1, GEngineIni );
if (Sec != NULL)
{
// Get the list of all code packages
Sec->MultiFind( FString(TEXT("EditPackages")), ScriptPackageNames );
// Iterate through loading each package
for (INT Index = 0; Index < ScriptPackageNames.Num(); Index++)
{
// Loading without LOAD_Verify should load all objects
UPackage* Package = UObject::LoadPackage(NULL,*ScriptPackageNames(Index),LOAD_NoWarn | LOAD_Quiet);
if (Package == NULL)
{
warnf(TEXT("Error loading package %s"),*ScriptPackageNames(Index));
}
}
}
else
{
warnf(TEXT("Error finding the code packages"));
}
}
开发者ID:LiuKeHua,项目名称:colorful-engine,代码行数:27,代码来源:UHelpCommandlet.cpp
示例8: SCOPE_CYCLE_COUNTER
void URuntimeMeshLibrary::CalculateTangentsForMesh(TFunction<int32(int32 Index)> IndexAccessor, TFunction<FVector(int32 Index)> VertexAccessor, TFunction<FVector2D(int32 Index)> UVAccessor,
TFunction<void(int32 Index, FVector TangentX, FVector TangentY, FVector TangentZ)> TangentSetter, int32 NumVertices, int32 NumUVs, int32 NumIndices, bool bCreateSmoothNormals)
{
SCOPE_CYCLE_COUNTER(STAT_RuntimeMeshLibrary_CalculateTangentsForMesh);
if (NumVertices == 0 || NumIndices == 0)
{
return;
}
// Calculate the duplicate vertices map if we're wanting smooth normals. Don't find duplicates if we don't want smooth normals
// that will cause it to only smooth across faces sharing a common vertex, not across faces with vertices of common position
const TMultiMap<uint32, uint32> DuplicateVertexMap = bCreateSmoothNormals ? FRuntimeMeshInternalUtilities::FindDuplicateVerticesMap(VertexAccessor, NumVertices) : TMultiMap<uint32, uint32>();
// Number of triangles
const int32 NumTris = NumIndices / 3;
// Map of vertex to triangles in Triangles array
TMultiMap<uint32, uint32> VertToTriMap;
// Map of vertex to triangles to consider for normal calculation
TMultiMap<uint32, uint32> VertToTriSmoothMap;
// Normal/tangents for each face
TArray<FVector> FaceTangentX, FaceTangentY, FaceTangentZ;
FaceTangentX.AddUninitialized(NumTris);
FaceTangentY.AddUninitialized(NumTris);
FaceTangentZ.AddUninitialized(NumTris);
// Iterate over triangles
for (int TriIdx = 0; TriIdx < NumTris; TriIdx++)
{
uint32 CornerIndex[3];
FVector P[3];
for (int32 CornerIdx = 0; CornerIdx < 3; CornerIdx++)
{
// Find vert index (clamped within range)
uint32 VertIndex = FMath::Min(IndexAccessor((TriIdx * 3) + CornerIdx), NumVertices - 1);
CornerIndex[CornerIdx] = VertIndex;
P[CornerIdx] = VertexAccessor(VertIndex);
// Find/add this vert to index buffer
TArray<uint32> VertOverlaps;
DuplicateVertexMap.MultiFind(VertIndex, VertOverlaps);
// Remember which triangles map to this vert
VertToTriMap.AddUnique(VertIndex, TriIdx);
VertToTriSmoothMap.AddUnique(VertIndex, TriIdx);
// Also update map of triangles that 'overlap' this vert (ie don't match UV, but do match smoothing) and should be considered when calculating normal
for (int32 OverlapIdx = 0; OverlapIdx < VertOverlaps.Num(); OverlapIdx++)
{
// For each vert we overlap..
int32 OverlapVertIdx = VertOverlaps[OverlapIdx];
// Add this triangle to that vert
VertToTriSmoothMap.AddUnique(OverlapVertIdx, TriIdx);
// And add all of its triangles to us
TArray<uint32> OverlapTris;
VertToTriMap.MultiFind(OverlapVertIdx, OverlapTris);
for (int32 OverlapTriIdx = 0; OverlapTriIdx < OverlapTris.Num(); OverlapTriIdx++)
{
VertToTriSmoothMap.AddUnique(VertIndex, OverlapTris[OverlapTriIdx]);
}
}
}
// Calculate triangle edge vectors and normal
const FVector Edge21 = P[1] - P[2];
const FVector Edge20 = P[0] - P[2];
const FVector TriNormal = (Edge21 ^ Edge20).GetSafeNormal();
// If we have UVs, use those to calculate
if (NumUVs == NumVertices)
{
const FVector2D T1 = UVAccessor(CornerIndex[0]);
const FVector2D T2 = UVAccessor(CornerIndex[1]);
const FVector2D T3 = UVAccessor(CornerIndex[2]);
// float X1 = P[1].X - P[0].X;
// float X2 = P[2].X - P[0].X;
// float Y1 = P[1].Y - P[0].Y;
// float Y2 = P[2].Y - P[0].Y;
// float Z1 = P[1].Z - P[0].Z;
// float Z2 = P[2].Z - P[0].Z;
//
// float S1 = U1.X - U0.X;
// float S2 = U2.X - U0.X;
// float T1 = U1.Y - U0.Y;
// float T2 = U2.Y - U0.Y;
//
// float R = 1.0f / (S1 * T2 - S2 * T1);
// FaceTangentX[TriIdx] = FVector((T2 * X1 - T1 * X2) * R, (T2 * Y1 - T1 * Y2) * R,
// (T2 * Z1 - T1 * Z2) * R);
// FaceTangentY[TriIdx] = FVector((S1 * X2 - S2 * X1) * R, (S1 * Y2 - S2 * Y1) * R,
// (S1 * Z2 - S2 * Z1) * R);
//.........这里部分代码省略.........
开发者ID:Koderz,项目名称:UE4RuntimeMeshComponent,代码行数:101,代码来源:RuntimeMeshLibrary.cpp
示例9: CalucluateItemDrop
AItem* AMech_RPGCharacter::CalucluateItemDrop(UGroup* inGroup, ItemEnumns::ItemType type) {
TMultiMap<int32, int32> gradeMap;
int32 outputGrade;
int32 outputQuality;
bool upgradeGrade = FMath::RandHelper(100) <= 70;// upgradeGradeChance;
bool upgradeQuality = FMath::RandHelper(100) <= 70; //upgradeQualityChance;
float totalItems = 0;
float lowestGrade = AItem::HighestItemLevel;
float totalGrade = 0;
float meanGrade = 0;
int32 modeGrade = 0;
float lowestQuality = 20;
float totalQuality = 0;
float meanQuality = 0;
int32 modeQuality = 0;
for (AMech_RPGCharacter* member : inGroup->GetMembers()) {
//for (AItem* item : member->GetInventory()->GetItems()) {
AItem* item = member->GetCurrentWeapon();
if (item != nullptr && item->GetType() == type) {
totalItems++;
totalGrade += item->GetGrade();
totalQuality += item->GetQuality();
if (!gradeMap.Contains(item->GetGrade())) {
gradeMap.Add(item->GetGrade(), 1);
}
else {
gradeMap.Add(item->GetGrade(), (int32)(*gradeMap.Find(item->GetGrade()) + 1));
}
if (item->GetQuality() < lowestQuality) {
lowestQuality = item->GetQuality();
}
if (item->GetGrade() < lowestGrade) {
lowestGrade = item->GetGrade();
}
}
//}
}
meanGrade = totalGrade / totalItems;
meanQuality = totalQuality / totalItems;
TPair<int32, int32> heighestValue;
heighestValue.Key = 1;
heighestValue.Value = 0;
for (auto& map : gradeMap) {
// Found a higher quantity
if (map.Value > heighestValue.Value) {
heighestValue = map;
}
// Found the same quantity, only set if the grade is higher
else if (map.Value == heighestValue.Value && map.Key > heighestValue.Key) {
heighestValue = map;
}
}
//if (upgradeGrade)
meanGrade++;
//if (upgradeQuality)
meanQuality++;
outputGrade = FMath::RoundHalfToEven(MAX(meanGrade, heighestValue.Key));
outputQuality = FMath::RoundHalfToEven(meanQuality);
AItem* newItem = AItem::CreateItemByType(type, GetWorld(), outputGrade, outputQuality);
if (newItem != nullptr) {
newItem->SetItemOwner(this);
return newItem;
}
return nullptr;
}
开发者ID:belven,项目名称:Mech_RPG,代码行数:79,代码来源:Mech_RPGCharacter.cpp
示例10: UE_LOG
//.........这里部分代码省略.........
UE_LOG( LogStats, Warning, TEXT( "Broken cycle scope end %s/%s, current %s" ),
*ThreadFName.ToString(),
*ShortName.ToString(),
*StackState->Current.ToString() );
// The stack is completely broken, only has the thread name and the last cycle scope.
// Rollback to the thread node.
StackState->bIsBrokenCallstack = true;
StackState->Stack.Empty();
StackState->Stack.Add( ThreadFName );
StackState->Current = ThreadFName;
}
}
}
}
if( bAtLeastOneMessage )
{
PreviousSeconds -= NumSecondsBetweenLogs;
}
}
if( bAtLeastOnePacket )
{
PreviousSeconds -= NumSecondsBetweenLogs;
}
}
UE_LOG( LogStats, Warning, TEXT( "NumMemoryOperations: %llu" ), NumMemoryOperations );
UE_LOG( LogStats, Warning, TEXT( "SequenceAllocationNum: %i" ), SequenceAllocationArray.Num() );
// Pass 2.
/*
TMap<uint32,FAllocationInfo> UniqueSeq;
TMultiMap<uint32,FAllocationInfo> OriginalAllocs;
TMultiMap<uint32,FAllocationInfo> BrokenAllocs;
for( const FAllocationInfo& Alloc : SequenceAllocationArray )
{
const FAllocationInfo* Found = UniqueSeq.Find(Alloc.SequenceTag);
if( !Found )
{
UniqueSeq.Add(Alloc.SequenceTag,Alloc);
}
else
{
OriginalAllocs.Add(Alloc.SequenceTag, *Found);
BrokenAllocs.Add(Alloc.SequenceTag, Alloc);
}
}
*/
// Sort all memory operation by the sequence tag, iterate through all operation and generate memory usage.
SequenceAllocationArray.Sort( TLess<FAllocationInfo>() );
// Alive allocations.
TMap<uint64, FAllocationInfo> AllocationMap;
TMultiMap<uint64, FAllocationInfo> FreeWithoutAllocMap;
TMultiMap<uint64, FAllocationInfo> DuplicatedAllocMap;
int32 NumDuplicatedMemoryOperations = 0;
int32 NumFWAMemoryOperations = 0; // FreeWithoutAlloc
UE_LOG( LogStats, Warning, TEXT( "Generating memory operations map" ) );
const int32 NumSequenceAllocations = SequenceAllocationArray.Num();
const int32 OnePercent = FMath::Max( NumSequenceAllocations / 100, 1024 );
for( int32 Index = 0; Index < NumSequenceAllocations; Index++ )
{
if( Index % OnePercent )
开发者ID:johndpope,项目名称:UE4,代码行数:67,代码来源:StatsDumpMemoryCommand.cpp
示例11: SCOPED_DRAW_EVENT
void FRCPassPostProcessSelectionOutlineColor::Process(FRenderingCompositePassContext& Context)
{
SCOPED_DRAW_EVENT(Context.RHICmdList, PostProcessSelectionOutlineBuffer, DEC_SCENE_ITEMS);
const FPooledRenderTargetDesc* SceneColorInputDesc = GetInputDesc(ePId_Input0);
if(!SceneColorInputDesc)
{
// input is not hooked up correctly
return;
}
const FViewInfo& View = Context.View;
FIntRect ViewRect = View.ViewRect;
FIntPoint SrcSize = SceneColorInputDesc->Extent;
// Get the output render target
const FSceneRenderTargetItem& DestRenderTarget = PassOutputs[0].RequestSurface(Context);
// Set the render target/viewport.
SetRenderTarget(Context.RHICmdList, FTextureRHIParamRef(), DestRenderTarget.TargetableTexture);
// This is a reversed Z depth surface, so 0.0f is the far plane.
Context.RHICmdList.Clear(false, FLinearColor(0, 0, 0, 0), true, 0.0f, true, 0, FIntRect());
Context.SetViewportAndCallRHI(ViewRect);
if (View.Family->EngineShowFlags.Selection)
{
const bool bUseGetMeshElements = ShouldUseGetDynamicMeshElements();
if (bUseGetMeshElements)
{
FHitProxyDrawingPolicyFactory::ContextType FactoryContext;
//@todo - use memstack
TMap<FName, int32> ActorNameToStencilIndex;
ActorNameToStencilIndex.Add(NAME_BSP, 1);
Context.RHICmdList.SetRasterizerState(TStaticRasterizerState<>::GetRHI());
Context.RHICmdList.SetBlendState(TStaticBlendStateWriteMask<CW_NONE, CW_NONE, CW_NONE, CW_NONE>::GetRHI());
for (int32 MeshBatchIndex = 0; MeshBatchIndex < View.DynamicMeshElements.Num(); MeshBatchIndex++)
{
const FMeshBatchAndRelevance& MeshBatchAndRelevance = View.DynamicMeshElements[MeshBatchIndex];
const FPrimitiveSceneProxy* PrimitiveSceneProxy = MeshBatchAndRelevance.PrimitiveSceneProxy;
if (PrimitiveSceneProxy->IsSelected() && MeshBatchAndRelevance.Mesh->bUseSelectionOutline)
{
const int32* AssignedStencilIndexPtr = ActorNameToStencilIndex.Find(PrimitiveSceneProxy->GetOwnerName());
if (!AssignedStencilIndexPtr)
{
AssignedStencilIndexPtr = &ActorNameToStencilIndex.Add(PrimitiveSceneProxy->GetOwnerName(), ActorNameToStencilIndex.Num() + 1);
}
// This is a reversed Z depth surface, using CF_GreaterEqual.
// Note that the stencil value will overflow with enough selected objects
Context.RHICmdList.SetDepthStencilState(TStaticDepthStencilState<true, CF_GreaterEqual, true, CF_Always, SO_Keep, SO_Keep, SO_Replace>::GetRHI(), *AssignedStencilIndexPtr);
const FMeshBatch& MeshBatch = *MeshBatchAndRelevance.Mesh;
FHitProxyDrawingPolicyFactory::DrawDynamicMesh(Context.RHICmdList, View, FactoryContext, MeshBatch, false, true, MeshBatchAndRelevance.PrimitiveSceneProxy, MeshBatch.BatchHitProxyId);
}
}
}
else if (View.VisibleDynamicPrimitives.Num() > 0)
{
TDynamicPrimitiveDrawer<FHitProxyDrawingPolicyFactory> Drawer(Context.RHICmdList, &View, FHitProxyDrawingPolicyFactory::ContextType(), true, false, false, true);
TMultiMap<FName, const FPrimitiveSceneInfo*> PrimitivesByActor;
for (int32 PrimitiveIndex = 0; PrimitiveIndex < View.VisibleDynamicPrimitives.Num();PrimitiveIndex++)
{
const FPrimitiveSceneInfo* PrimitiveSceneInfo = View.VisibleDynamicPrimitives[PrimitiveIndex];
// Only draw the primitive if relevant
if(PrimitiveSceneInfo->Proxy->IsSelected())
{
PrimitivesByActor.Add(PrimitiveSceneInfo->Proxy->GetOwnerName(), PrimitiveSceneInfo);
}
}
if (PrimitivesByActor.Num())
{
// 0 means no object, 1 means BSP so we start with 2
uint32 StencilValue = 2;
Context.RHICmdList.SetRasterizerState(TStaticRasterizerState<>::GetRHI());
Context.RHICmdList.SetBlendState(TStaticBlendStateWriteMask<CW_NONE, CW_NONE, CW_NONE, CW_NONE>::GetRHI());
// Sort by actor
TArray<FName> Actors;
PrimitivesByActor.GetKeys(Actors);
for( TArray<FName>::TConstIterator ActorIt(Actors); ActorIt; ++ActorIt )
{
bool bBSP = *ActorIt == NAME_BSP;
if (bBSP)
{
// This is a reversed Z depth surface, using CF_GreaterEqual.
Context.RHICmdList.SetDepthStencilState(TStaticDepthStencilState<true, CF_GreaterEqual, true, CF_Always, SO_Keep, SO_Keep, SO_Replace>::GetRHI(), 1);
}
else
{
//.........这里部分代码省略.........
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:101,代码来源:PostProcessSelectionOutline.cpp
示例12: UpdateRows
void FPropertyTable::UpdateRows()
{
if( Orientation == EPropertyTableOrientation::AlignPropertiesInColumns )
{
TMultiMap< UObject*, TSharedRef< IPropertyTableRow > > RowsMap;
for (int RowIdx = 0; RowIdx < Rows.Num(); ++RowIdx)
{
RowsMap.Add(Rows[RowIdx]->GetDataSource()->AsUObject().Get(), Rows[RowIdx]);
}
Rows.Empty();
for( auto ObjectIter = SourceObjects.CreateConstIterator(); ObjectIter; ++ObjectIter )
{
const TWeakObjectPtr< UObject >& Object = *ObjectIter;
if( Object.IsValid() )
{
const TSharedRef< FObjectPropertyNode > ObjectNode = GetObjectPropertyNode( Object );
const TSharedPtr< FPropertyNode > PropertyNode = FPropertyNode::FindPropertyNodeByPath( RootPath, ObjectNode );
//@todo This system will need to change in order to properly support arrays [11/30/2012 Justin.Sargent]
if ( PropertyNode.IsValid() )
{
UProperty* Property = PropertyNode->GetProperty();
if ( Property != NULL && Property->IsA( UArrayProperty::StaticClass() ) )
{
for (int ChildIdx = 0; ChildIdx < PropertyNode->GetNumChildNodes(); ChildIdx++)
{
TSharedPtr< FPropertyNode > ChildNode = PropertyNode->GetChildNode( ChildIdx );
FPropertyInfo Extension;
Extension.Property = ChildNode->GetProperty();
Extension.ArrayIndex = ChildNode->GetArrayIndex();
TSharedRef< FPropertyPath > Path = FPropertyPath::CreateEmpty()->ExtendPath( Extension );
TArray< TSharedRef< IPropertyTableRow > > MapResults;
bool Found = false;
RowsMap.MultiFind(Object.Get(), MapResults);
for (int MapIdx = 0; MapIdx < MapResults.Num(); ++MapIdx)
{
if (FPropertyPath::AreEqual(Path, MapResults[MapIdx]->GetPartialPath()))
{
Found = true;
Rows.Add(MapResults[MapIdx]);
break;
}
}
if (!Found)
{
Rows.Add( MakeShareable( new FPropertyTableRow( SharedThis( this ), Object, Path ) ) );
}
}
}
else
{
TArray< TSharedRef< IPropertyTableRow > > MapResults;
bool Found = false;
RowsMap.MultiFind(Object.Get(), MapResults);
for (int MapIdx = 0; MapIdx < MapResults.Num(); ++MapIdx)
{
if (MapResults[MapIdx]->GetPartialPath()->GetNumProperties() == 0)
{
Found = true;
Rows.Add(MapResults[MapIdx]);
break;
}
}
if (!Found)
{
Rows.Add( MakeShareable( new FPropertyTableRow( SharedThis( this ), Object ) ) );
}
}
}
}
}
}
const TSharedPtr< IPropertyTableColumn > Column = SortedByColumn.Pin();
if ( Column.IsValid() && SortedColumnMode != EColumnSortMode::None )
{
Column->Sort( Rows, SortedColumnMode );
}
RowsChanged.Broadcast();
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:92,代码来源:PropertyTable.cpp
示例13: SCOPE_REDIRECT_TIMER
void FRedirectCollector::ResolveStringAssetReference(FString FilterPackage)
{
SCOPE_REDIRECT_TIMER(ResolveTimeTotal);
FName FilterPackageFName = NAME_None;
if (!FilterPackage.IsEmpty())
{
FilterPackageFName = FName(*FilterPackage);
}
TMultiMap<FName, FPackagePropertyPair> SkippedReferences;
SkippedReferences.Empty(StringAssetReferences.Num());
while ( StringAssetReferences.Num())
{
TMultiMap<FName, FPackagePropertyPair> CurrentReferences;
Swap(StringAssetReferences, CurrentReferences);
for (const auto& CurrentReference : CurrentReferences)
{
const FName& ToLoadFName = CurrentReference.Key;
const FPackagePropertyPair& RefFilenameAndProperty = CurrentReference.Value;
if ((FilterPackageFName != NAME_None) && // not using a filter
(FilterPackageFName != RefFilenameAndProperty.GetCachedPackageName()) && // this is the package we are looking for
(RefFilenameAndProperty.GetCachedPackageName() != NAME_None) // if we have an empty package name then process it straight away
)
{
// If we have a valid filter and it doesn't match, skip this reference
SkippedReferences.Add(ToLoadFName, RefFilenameAndProperty);
continue;
}
const FString ToLoad = ToLoadFName.ToString();
if (FCoreDelegates::LoadStringAssetReferenceInCook.IsBound())
{
SCOPE_REDIRECT_TIMER(ResolveTimeDelegate);
if (FCoreDelegates::LoadStringAssetReferenceInCook.Execute(ToLoad) == false)
{
// Skip this reference
continue;
}
}
if (ToLoad.Len() > 0 )
{
SCOPE_REDIRECT_TIMER(ResolveTimeLoad);
UE_LOG(LogRedirectors, Verbose, TEXT("String Asset Reference '%s'"), *ToLoad);
UE_CLOG(RefFilenameAndProperty.GetProperty().ToString().Len(), LogRedirectors, Verbose, TEXT(" Referenced by '%s'"), *RefFilenameAndProperty.GetProperty().ToString());
StringAssetRefFilenameStack.Push(RefFilenameAndProperty.GetPackage().ToString());
UObject *Loaded = LoadObject<UObject>(NULL, *ToLoad, NULL, RefFilenameAndProperty.GetReferencedByEditorOnlyProperty() ? LOAD_EditorOnly : LOAD_None, NULL);
StringAssetRefFilenameStack.Pop();
UObjectRedirector* Redirector = dynamic_cast<UObjectRedirector*>(Loaded);
if (Redirector)
{
UE_LOG(LogRedirectors, Verbose, TEXT(" Found redir '%s'"), *Redirector->GetFullName());
FRedirection Redir;
Redir.PackageFilename = RefFilenameAndProperty.GetPackage().ToString();
Redir.RedirectorName = Redirector->GetFullName();
Redir.RedirectorPackageFilename = Redirector->GetLinker()->Filename;
CA_SUPPRESS(28182)
Redir.DestinationObjectName = Redirector->DestinationObject->GetFullName();
Redirections.AddUnique(Redir);
Loaded = Redirector->DestinationObject;
}
if (Loaded)
{
if (FCoreUObjectDelegates::PackageLoadedFromStringAssetReference.IsBound())
{
FCoreUObjectDelegates::PackageLoadedFromStringAssetReference.Broadcast(Loaded->GetOutermost()->GetFName());
}
FString Dest = Loaded->GetPathName();
UE_LOG(LogRedirectors, Verbose, TEXT(" Resolved to '%s'"), *Dest);
if (Dest != ToLoad)
{
StringAssetRemap.Add(ToLoad, Dest);
}
}
else
{
const FString Referencer = RefFilenameAndProperty.GetProperty().ToString().Len() ? RefFilenameAndProperty.GetProperty().ToString() : TEXT("Unknown");
int32 DotIndex = ToLoad.Find(TEXT("."));
FString PackageName = DotIndex != INDEX_NONE ? ToLoad.Left(DotIndex) : ToLoad;
if (FLinkerLoad::IsKnownMissingPackage(FName(*PackageName)) == false)
{
UE_LOG(LogRedirectors, Warning, TEXT("String Asset Reference '%s' was not found! (Referencer '%s')"), *ToLoad, *Referencer);
}
}
}
}
//.........这里部分代码省略.........
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:101,代码来源:RedirectCollector.cpp
示例14: while
void FRedirectCollector::ResolveStringAssetReference(FString FilterPackage)
{
TMultiMap<FString, FPackagePropertyPair> SkippedReferences;
while (StringAssetReferences.Num())
{
TMultiMap<FString, FPackagePropertyPair>::TIterator First(StringAssetReferences);
FString ToLoad = First.Key();
FPackagePropertyPair RefFilenameAndProperty = First.Value();
First.RemoveCurrent();
if (FCoreDelegates::LoadStringAssetReferenceInCook.IsBound())
{
if (FCoreDelegates::LoadStringAssetReferenceInCook.Execute(ToLoad) == false)
{
// Skip this reference
continue;
}
}
if (!FilterPackage.IsEmpty() && FilterPackage != RefFilenameAndProperty.Package)
{
// If we have a valid filter and it doesn't match, skip this reference
SkippedReferences.Add(ToLoad, RefFilenameAndProperty);
continue;
}
if (ToLoad.Len() > 0)
{
UE_LOG(LogRedirectors, Verbose, TEXT("String Asset Reference '%s'"), *ToLoad);
UE_CLOG(RefFilenameAndProperty.Property.Len(), LogRedirectors, Verbose, TEXT(" Referenced by '%s'"), *RefFilenameAndProperty.Property);
StringAssetRefFilenameStack.Push(RefFilenameAndProperty.Package);
UObject *Loaded = LoadObject<UObject>(NULL, *ToLoad, NULL, RefFilenameAndProperty.bReferencedByEditorOnlyProperty ? LOAD_EditorOnly : LOAD_None, NULL);
StringAssetRefFilenameStack.Pop();
UObjectRedirector* Redirector = dynamic_cast<UObjectRedirector*>(Loaded);
if (Redirector)
{
UE_LOG(LogRedirectors, Verbose, TEXT(" Found redir '%s'"), *Redirector->GetFullName());
FRedirection Redir;
Redir.PackageFilename = RefFilenameAndProperty.Package;
Redir.RedirectorName = Redirector->GetFullName();
Redir.RedirectorPackageFilename = Redirector->GetLinker()->Filename;
CA_SUPPRESS(28182)
Redir.DestinationObjectName = Redirector->DestinationObject->GetFullName();
Redirections.AddUnique(Redir);
Loaded = Redirector->DestinationObject;
}
if (Loaded)
{
FString Dest = Loaded->GetPathName();
UE_LOG(LogRedirectors, Verbose, TEXT(" Resolved to '%s'"), *Dest);
if (Dest != ToLoad)
{
StringAssetRemap.Add(ToLoad, Dest);
}
}
else
{
const FString Referencer = RefFilenameAndProperty.Property.Len() ? RefFilenameAndProperty.Property : TEXT("Unknown");
UE_LOG(LogRedirectors, Warning, TEXT("String Asset Reference '%s' was not found! (Referencer '%s')"), *ToLoad, *Referencer);
}
}
}
// Add any skipped references back into the map for the next time this is called
StringAssetReferences = SkippedReferences;
}
开发者ID:WasPedro,项目名称:UnrealEngine4.11-HairWorks,代码行数:69,代码来源:RedirectCollector.cpp
示例15: DrawVisualization
void FAudioComponentVisualizer::DrawVisualization( const UActorComponent* Component, const FSceneView* View, FPrimitiveDrawInterface* PDI )
{
if(View->Family->EngineShowFlags.AudioRadius)
{
const UAudioComponent* AudioComp = Cast<const UAudioComponent>(Component);
if(AudioComp != NULL)
{
const FTransform& Transform = AudioComp->ComponentToWorld;
TMultiMap<EAttenuationShape::Type, FAttenuationSettings::AttenuationShapeDetails> ShapeDetailsMap;
AudioComp->CollectAttenuationShapesForVisualization(ShapeDetailsMap);
FVector Translation = Transform.GetTranslation();
FVector UnitXAxis = Transform.GetUnitAxis( EAxis::X );
FVector UnitYAxis = Transform.GetUnitAxis( EAxis::Y );
FVector UnitZAxis = Transform.GetUnitAxis( EAxis::Z );
for ( auto It = ShapeDetailsMap.CreateConstIterator(); It; ++It )
{
FColor AudioOuterRadiusColor(255, 153, 0);
FColor AudioInnerRadiusColor(216, 130, 0);
const FAttenuationSettings::AttenuationShapeDetails& ShapeDetails = It.Value();
switch(It.Key())
{
case EAttenuationShape::Box:
if (ShapeDetails.Falloff > 0.f)
{
DrawOrientedWireBox( PDI, Translation, UnitXAxis, UnitYAxis, UnitZAxis, ShapeDetails.Extents + FVector(ShapeDetails.Falloff), AudioOuterRadiusColor, SDPG_World);
DrawOrientedWireBox( PDI, Translation, UnitXAxis, UnitYAxis, UnitZAxis, ShapeDetails.Extents, AudioInnerRadiusColor, SDPG_World);
}
else
{
DrawOrientedWireBox( PDI, Translation, UnitXAxis, UnitYAxis, UnitZAxis, ShapeDetails.Extents, AudioOuterRadiusColor, SDPG_World);
}
break;
case EAttenuationShape::Capsule:
if (ShapeDetails.Falloff > 0.f)
{
DrawWireCapsule( PDI, Translation, UnitXAxis, UnitYAxis, UnitZAxis, AudioOuterRadiusColor, ShapeDetails.Extents.Y + ShapeDetails.Falloff, ShapeDetails.Extents.X + ShapeDetails.Falloff, 25, SDPG_World);
DrawWireCapsule( PDI, Translation, UnitXAxis, UnitYAxis, UnitZAxis, AudioInnerRadiusColor, ShapeDetails.Extents.Y, ShapeDetails.Extents.X, 25, SDPG_World);
}
else
{
DrawWireCapsule( PDI, Translation, UnitXAxis, UnitYAxis, UnitZAxis, AudioOuterRadiusColor, ShapeDetails.Extents.Y, ShapeDetails.Extents.X, 25, SDPG_World);
}
break;
case EAttenuationShape::Cone:
{
FTransform Origin = Transform;
Origin.SetScale3D(FVector(1.f));
Origin.SetTranslation(Translation - (UnitXAxis * ShapeDetails.ConeOffset));
if (ShapeDetails.Falloff > 0.f || ShapeDetails.Extents.Z > 0.f)
{
float ConeRadius = ShapeDetails.Extents.X + ShapeDetails.Falloff + ShapeDetails.ConeOffset;
float ConeAngle = ShapeDetails.Extents.Y + ShapeDetails.Extents.Z;
DrawWireSphereCappedCone(PDI, Origin, ConeRadius, ConeAngle, 16, 4, 10, AudioOuterRadiusColor, SDPG_World);
ConeRadius = ShapeDetails.Extents.X + ShapeDetails.ConeOffset;
ConeAngle = ShapeDetails.Extents.Y;
DrawWireSphereCappedCone(PDI, Origin, ConeRadius, ConeAngle, 16, 4, 10, AudioInnerRadiusColor, SDPG_World );
}
else
{
const float ConeRadius = ShapeDetails.Extents.X + ShapeDetails.ConeOffset;
const float ConeAngle = ShapeDetails.Extents.Y;
DrawWireSphereCappedCone(PDI, Origin, ConeRadius, ConeAngle, 16, 4, 10, AudioOuterRadiusColor, SDPG_World );
}
}
break;
case EAttenuationShape::Sphere:
if (ShapeDetails.Falloff > 0.f)
{
DrawWireSphereAutoSides(PDI, Translation, AudioOuterRadiusColor, ShapeDetails.Extents.X + ShapeDetails.Falloff, SDPG_World);
DrawWireSphereAutoSides(PDI, Translation, AudioInnerRadiusColor, ShapeDetails.Extents.X, SDPG_World);
}
else
{
DrawWireSphereAutoSides(PDI, Translation, AudioOuterRadiusColor, ShapeDetails.Extents.X, SDPG_World);
}
break;
default:
check(false);
}
}
}
}
}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:96,代码来源:AudioComponentVisualizer.cpp
示例16: FindReferencedGraphNodes
// Internal helper function to find all graph nodes that reference the specified object
static int32 FindReferencedGraphNodes(TMultiMap<UObject*, FRefGraphItem*>& InputGraphNodeList, UObject* ReferencedObj, TArray<FRefGraphItem*>& FoundNodes)
{
InputGraphNodeList.MultiFind(ReferencedObj, FoundNodes);
return FoundNodes.Num();
}
开发者ID:colwalder,项目名称:unrealengine,代码行数:6,代码来源:ReferenceChainSearch.cpp
示例17: HandleAssetChangedEvent
void FPaperAtlasGenerator::HandleAssetChangedEvent(UPaperSpriteAtlas* Atlas)
{
Atlas->MaxWidth = FMath::Clamp(Atlas->MaxWidth, 16, 4096);
Atlas->MaxHeight = FMath::Clamp(Atlas->MaxHeight, 16, 4096);
// Find all sprites that reference the atlas and force them loaded
FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>(TEXT("AssetRegistry"));
TArray<FAssetData> AssetList;
TMultiMap<FName, FString> TagsAndValues;
TagsAndValues.Add(TEXT("AtlasGroupGUID"), Atlas->AtlasGUID.ToString(EGuidFormats::Digits));
AssetRegistryModule.Get().GetAssetsByTagValues(TagsAndValues, AssetList);
TIndirectArray<FSingleTexturePaperAtlas> AtlasGenerators;
// Start off with one page
new (AtlasGenerators) FSingleTexturePaperAtlas(Atlas->MaxWidth, Atlas->MaxHeight);
for (const FAssetData& SpriteRef : AssetList)
{
if (UPaperSprite* Sprite = Cast<UPaperSprite>(SpriteRef.GetAsset()))
{
//@TODO: Use the tight bounds instead of the source bounds
const FVector2D SpriteSizeFloat = Sprite->GetSourceSize();
const FIntPoint SpriteSize(FMath::TruncToInt(SpriteSizeFloat.X), FMath::TruncToInt(SpriteSizeFloat.Y));
if (Sprite->GetSourceTexture() == nullptr)
{
UE_LOG(LogPaper2DEditor, Error, TEXT("Sprite %s has no source texture and cannot be packed"), *(Sprite->GetPathName()));
continue;
}
//@TODO: Take padding into account (push this into the generator)
if ((SpriteSize.X > Atlas->MaxWidth) || (SpriteSize.Y >= Atlas->MaxHeight))
{
// This sprite cannot ever fit into an atlas page
UE_LOG(LogPaper2DEditor, Error, TEXT("Sprite %s (%d x %d) can never fit into atlas %s (%d x %d) due to maximum page size restrictions"),
*(Sprite->GetPathName()),
SpriteSize.X,
SpriteSize.Y,
*(Atlas->GetPathName()),
Atlas->MaxWidth,
Atlas->MaxHeight);
}
else
{
const FAtlasedTextureSlot* Slot = nullptr;
// Does it fit in any existing pages?
for (auto& Generator : AtlasGenerators)
{
Slot = Generator.AddSprite(Sprite);
if (Slot != nullptr)
{
break;
}
}
if (Slot == nullptr)
{
// Doesn't fit in any current pages, make a new one
FSingleTexturePaperAtlas* NewGenerator = new (AtlasGenerators) FSingleTexturePaperAtlas(Atlas->MaxWidth, Atlas->MaxHeight);
Slot = NewGenerator->AddSprite(Sprite);
}
if (Slot != nullptr)
{
UE_LOG(LogPaper2DEditor, Warning, TEXT("Allocated %s to (%d,%d)"), *(Sprite->GetPathName()), Slot->X, Slot->Y);
}
else
{
// ERROR: Didn't fit into a brand new page, maybe padding was wrong
UE_LOG(LogPaper2DEditor, Error, TEXT("Failed to allocate %s into a brand new page"), *(Sprite->GetPathName()));
}
}
}
}
// Turn the generators back into textures
Atlas->GeneratedTextures.Empty(AtlasGenerators.Num());
for (int32 GeneratorIndex = 0; GeneratorIndex < AtlasGenerators.Num(); ++GeneratorIndex)
{
FSingleTexturePaperAtlas& AtlasPage = AtlasGenerators[GeneratorIndex];
UTexture2D* Texture = NewNamedObject<UTexture2D>(Atlas, NAME_None, RF_Public);
Atlas->GeneratedTextures.Add(Texture);
AtlasPage.CopyToTexture(Texture);
// Now update the baked data for all the sprites to point there
for (auto& SpriteToSlot : AtlasPage.SpriteToSlotMap)
{
UPaperSprite* Sprite = SpriteToSlot.Key;
Sprite->Modify();
const FAtlasedTextureSlot* Slot = SpriteToSlot.Value;
Sprite->BakedSourceTexture = Texture;
Sprite->BakedSourceUV = FVector2D(Slot->X, Slot->Y);
Sprite->RebuildRenderData();
}
//.........这里部分代码省略.........
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:101,代码来源:PaperAtlasGenerator.cpp
示例18: UpdateColumns
void FPropertyTable::UpdateColumns()
{
if( Orientation == EPropertyTableOrientation::AlignPropertiesInColumns)
{
TMultiMap< UProperty*, TSharedRef< IPropertyTableColumn > > ColumnsMap;
for (int ColumnIdx = 0; ColumnIdx < Columns.Num()
|
请发表评论