Files
UnrealEngineUWP/Engine/Source/Developer/ScreenShotComparisonTools/Private/ScreenShotBaseNode.cpp
kevin hamilton 6b46dd0ced Merging //depot/Partners/Zombie/UE4-iOS/...to //depot/UE4/...
Automation: Milestone 3 and fixes for milestone 2

 -Added new EditorShot command to take editor screenshots
 -Made the ExterialTool options use the dierctory picker
 -Fixed a bug with the StaticMeshEditor test if the tutorial pops up
 -StaticMeshUV test now uses async package loading
 -Added a display every Nth screenshot to the screenshot compre tab
 -Added support to disable screenshots or request full size ones
 -Changed the screenshots so they save to the game directory even if you run the frontend by itself
 -Added screenshot support for the load all maps tests

[CL 2071712 by kevin hamilton in Main branch]
2014-05-13 12:08:56 -04:00

112 lines
2.7 KiB
C++

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
/*=============================================================================
ScreenShotData.cpp: Implements the FScreenShotData class.
=============================================================================*/
#include "ScreenShotComparisonToolsPrivatePCH.h"
/* IScreenShotData interface
*****************************************************************************/
void FScreenShotBaseNode::AddScreenShotData( const FScreenShotDataItem& InScreenDataItem )
{
TSharedRef<IScreenShotData> ScreenShotNode = AddChild( InScreenDataItem.ViewName );
ScreenShotNode->AddScreenShotData( InScreenDataItem );
}
const FString& FScreenShotBaseNode::GetAssetName() const
{
// This could be a dynamic brush. At the moment, it is just a brush name
return AssetName;
}
TArray<IScreenShotDataPtr>& FScreenShotBaseNode::GetChildren()
{
return Children;
}
TArray<IScreenShotDataPtr>& FScreenShotBaseNode::GetFilteredChildren()
{
// Get the child list after filtering
return FilteredChildren;
}
const FString& FScreenShotBaseNode::GetName() const
{
// The item name e.g. screen shot number / platform name
return ItemName;
}
EScreenShotDataType::Type FScreenShotBaseNode::GetScreenNodeType()
{
return EScreenShotDataType::SSDT_Base;
};
void FScreenShotBaseNode::SetDisplayEveryNthScreenshot( int32 NewDisplayEveryNth )
{
for ( int32 Index = 0; Index < Children.Num(); Index++ )
{
Children[Index]->SetDisplayEveryNthScreenshot(NewDisplayEveryNth);
}
}
bool FScreenShotBaseNode::SetFilter( TSharedPtr< ScreenShotFilterCollection > ScreenFilter )
{
FilteredChildren.Empty();
if ( ScreenFilter.IsValid() )
{
for ( int32 Index = 0; Index < Children.Num(); Index++ )
{
if ( Children[Index]->SetFilter( ScreenFilter ) )
{
FilteredChildren.Add( Children[Index] );
}
}
}
return true;
}
/* FScreenShotBaseNode implementation
*****************************************************************************/
IScreenShotDataRef FScreenShotBaseNode::AddChild( const FString& ChildName )
{
// See if child node exists - if not, add one
TSharedPtr< IScreenShotData > ScreenShotNode = NULL;
for ( int32 Index = 0; Index < Children.Num(); Index++ )
{
if ( Children[Index]->GetName() == ChildName )
{
ScreenShotNode = Children[ Index ];
break;
}
}
if ( !ScreenShotNode.IsValid() )
{
ScreenShotNode = CreateNode( ChildName );
}
return ScreenShotNode.ToSharedRef();
}
IScreenShotDataRef FScreenShotBaseNode::CreateNode( const FString& ChildName )
{
TSharedPtr< IScreenShotData > ScreenShotNode = MakeShareable( new FScreenShotScreenNode( ChildName ) );
Children.Add( ScreenShotNode.ToSharedRef() );
return ScreenShotNode.ToSharedRef();
}