You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3209340 on 2016/11/23 by Ben.Marsh Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h. Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms. * Every header now includes everything it needs to compile. * There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first. * There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h. * Every .cpp file includes its matching .h file first. * This helps validate that each header is including everything it needs to compile. * No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more. * You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there. * There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible. * No engine code explicitly includes a precompiled header any more. * We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies. * PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files. Tool used to generate this transform is at Engine\Source\Programs\IncludeTool. [CL 3209342 by Ben Marsh in Main branch]
103 lines
4.3 KiB
C++
103 lines
4.3 KiB
C++
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Misc/Attribute.h"
|
|
#include "Input/CursorReply.h"
|
|
#include "Input/Reply.h"
|
|
#include "Widgets/SWidget.h"
|
|
#include "Widgets/Layout/SScrollBar.h"
|
|
#include "ITimeSlider.h"
|
|
|
|
class FSlateWindowElementList;
|
|
|
|
struct FVisualLoggerTimeSliderArgs : FTimeSliderArgs
|
|
{
|
|
FVisualLoggerTimeSliderArgs()
|
|
: CursorSize(0.05f)
|
|
{
|
|
ViewRange = TRange<float>(0.0f, 5.0f);
|
|
}
|
|
|
|
/** Cursor range for data like histogram graphs, etc. */
|
|
TAttribute< float > CursorSize;
|
|
};
|
|
|
|
/**
|
|
* A time slider controller for sequencer
|
|
* Draws and manages time data for a Sequencer
|
|
*/
|
|
class FVisualLoggerTimeSliderController : public ITimeSliderController
|
|
{
|
|
public:
|
|
FVisualLoggerTimeSliderController(const FVisualLoggerTimeSliderArgs& InArgs);
|
|
|
|
/**
|
|
* Determines the optimal spacing between tick marks in the slider for a given pixel density
|
|
* Increments until a minimum amount of slate units specified by MinTick is reached
|
|
*
|
|
* @param InPixelsPerInput The density of pixels between each input
|
|
* @param MinTick The minimum slate units per tick allowed
|
|
* @param MinTickSpacing The minimum tick spacing in time units allowed
|
|
* @return the optimal spacing in time units
|
|
*/
|
|
float DetermineOptimalSpacing(float InPixelsPerInput, uint32 MinTick, float MinTickSpacing) const;
|
|
void SetTimesliderArgs(const FVisualLoggerTimeSliderArgs& InArgs);
|
|
|
|
/** ITimeSliderController Interface */
|
|
virtual int32 OnPaintTimeSlider( bool bMirrorLabels, const FGeometry& AllottedGeometry, const FSlateRect& MyClippingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled ) const override;
|
|
virtual FReply OnMouseButtonDown( SWidget& WidgetOwner, const FGeometry& MyGeometry, const FPointerEvent& MouseEvent ) override;
|
|
virtual FReply OnMouseButtonUp( SWidget& WidgetOwner, const FGeometry& MyGeometry, const FPointerEvent& MouseEvent ) override;
|
|
virtual FReply OnMouseMove( SWidget& WidgetOwner, const FGeometry& MyGeometry, const FPointerEvent& MouseEvent ) override;
|
|
virtual FReply OnMouseWheel( SWidget& WidgetOwner, const FGeometry& MyGeometry, const FPointerEvent& MouseEvent ) override;
|
|
virtual FCursorReply OnCursorQuery( TSharedRef<const SWidget> WidgetOwner, const FGeometry& MyGeometry, const FPointerEvent& CursorEvent) const override { return FCursorReply::Unhandled(); }
|
|
|
|
/**
|
|
* Draws major tick lines in the section view
|
|
*/
|
|
int32 OnPaintSectionView( const FGeometry& AllottedGeometry, const FSlateRect& MyClippingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, bool bEnabled, bool bDisplayTickLines, bool bDisplayScrubPosition ) const;
|
|
FVisualLoggerTimeSliderArgs& GetTimeSliderArgs() { return TimeSliderArgs; }
|
|
/**
|
|
* Call this method when the user's interaction has changed the scrub position
|
|
*
|
|
* @param NewValue Value resulting from the user's interaction
|
|
* @param bIsScrubbing True if done via scrubbing, false if just releasing scrubbing
|
|
*/
|
|
void CommitScrubPosition( float NewValue, bool bIsScrubbing );
|
|
|
|
void SetExternalScrollbar(TSharedRef<SScrollBar> Scrollbar);
|
|
void SetTimeRange(float MinValue, float MaxValue);
|
|
void SetClampRange(float MinValue, float MaxValue);
|
|
bool IsPanning() { return bPanning; }
|
|
|
|
private:
|
|
|
|
/**
|
|
* Draws time tick marks
|
|
*
|
|
* @param OutDrawElements List to add draw elements to
|
|
* @param RangeToScreen Time range to screen space converter
|
|
* @param InArgs Parameters for drawing the tick lines
|
|
*/
|
|
void DrawTicks( FSlateWindowElementList& OutDrawElements, const struct FScrubRangeToScreen& RangeToScreen, struct FDrawTickArgs& InArgs ) const;
|
|
void HorizontalScrollBar_OnUserScrolled(float ScrollOffset);
|
|
private:
|
|
FVisualLoggerTimeSliderArgs TimeSliderArgs;
|
|
/** Brush for drawing an upwards facing scrub handle */
|
|
const FSlateBrush* ScrubHandleUp;
|
|
/** Brush for drawing a downwards facing scrub handle */
|
|
const FSlateBrush* ScrubHandleDown;
|
|
/** Brush for drawing cursor background to visualize corsor size */
|
|
const FSlateBrush* CursorBackground;
|
|
/** Total mouse delta during dragging **/
|
|
float DistanceDragged;
|
|
/** If we are dragging the scrubber */
|
|
bool bDraggingScrubber;
|
|
/** If we are currently panning the panel */
|
|
bool bPanning;
|
|
/***/
|
|
TSharedPtr<SScrollBar> Scrollbar;
|
|
FVector2D SoftwareCursorPosition;
|
|
};
|