Files
UnrealEngineUWP/Engine/Source/Developer/LogVisualizer/Private/VisualLoggerTimeSliderController.h
Ben Marsh 8834d806ab Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3104200)
#lockdown Nick.Penwarden
#rb none

==========================
MAJOR FEATURES + CHANGES
==========================

Change 3096076 on 2016/08/22 by Matthew.Griffin

	Fixes for building with -nosharedPCH
	Added nodes for building with -nosharedPCH and -noPCH but not using them by default as they take so much longer than NonUnity and there are still errors with -noPCH

Change 3097064 on 2016/08/22 by Ben.Marsh

	Core: Refactoring OutputDevice.h, OutputDevices.h, FeedbackDevice.h, CallbackDevice.h into one-class per file, and files named after their classes.

Change 3097102 on 2016/08/22 by Ben.Marsh

	Core: Move log macros and related functionality into the Logging folder.

Change 3097240 on 2016/08/22 by Ben.Marsh

	Core: Move FCommandLine into its own header.

Change 3097258 on 2016/08/22 by Ben.Marsh

	Core: Move FFileHelper into its own header.

Change 3097279 on 2016/08/22 by Ben.Marsh

	Core: Split FArchive derived classes into separate headers per class.

Change 3097742 on 2016/08/23 by Ben.Marsh

	UnrealGameSync: Add the -r5 parameter to P4 sync command lines, to retry syncs on poor connections before failing.

Change 3099283 on 2016/08/24 by Ben.Marsh

	Core: Move math functions which are dependent on multiple class definitions into individual class headers. This forces an include order, but allows us to include individual math classes separately. Would ideally split out the FMath class into a Math namespace and declare/implement things like intersection tests and interpolation routines in separate headers.

Change 3099417 on 2016/08/24 by Ben.Marsh

	CoreUObject: Separating out UObject archive classes into separate headers.

Change 3099544 on 2016/08/24 by Ben.Marsh

	CoreUObject: Rename UTextProperty.h/cpp to TextProperty.h/cpp

Change 3099678 on 2016/08/24 by Ben.Marsh

	CoreUObject: Rename ObjectBase.h to ObjectMacros.h to avoid ambiguiity with UObjectBase.h, and move Interface.h/cpp into the UObject folder.

Change 3099951 on 2016/08/24 by Ben.Marsh

	Core: Split out ThreadingBase into class-per-file headers.

Change 3102385 on 2016/08/26 by Matthew.Griffin

	First round of fixes from attempting to compile Editor in Monolithic mode
	Changed multiple DetermineOptimalSpacing free functions to be members of their respective classes
	Changed duplicate FScopedTempFile classes to be named for their respective source control types (Git & SVN)
	Export Declaration of LogUnrealAudioDevice extern instead of defining it in multiple modules
	Changed duplicate FDiffResultItem struct to FTreeDiffResultItem
	Added FORCEINLINE to FFeaturedClasses functions in .inl file

Change 3102728 on 2016/08/26 by Ben.Marsh

	Core: Move threading classes from ThreadingBase.h into separate headers, and globals into CoreGlobals.h.

Change 3102850 on 2016/08/26 by Ben.Marsh

	Core: Move FCriticalSection into its own file (CriticalSection.h and platform-specific versions).

Change 3102877 on 2016/08/26 by Ben.Marsh

	Core: Move definitions of GLog, GError, GWarn into CoreGlobals.h

Change 3102898 on 2016/08/26 by Ben.Marsh

	Core: Move supporting assert functionality (the FDebug class) into AssertionMacros.h to remove circular header dependencies.

Change 3102956 on 2016/08/26 by Ben.Marsh

	Core: Move FExec into its own header (Misc/Exec.h)

Change 3102961 on 2016/08/26 by Ben.Marsh

	Core: Fix matrix functions referencing the forceinline'd FMatrix constructor before it's declared.

Change 3102982 on 2016/08/26 by Ben.Marsh

	Core: Move FMessageDialog into its own header (Misc/MessageDialog.h)

Change 3103008 on 2016/08/26 by Ben.Marsh

	Core: Move definition of LowLevelFatalError into AssertionMacros.h.

Change 3103040 on 2016/08/26 by Ben.Marsh

	Core: Move FError::Throwf (only enabled for UHT) into its own header in CoreUObject.

Change 3103057 on 2016/08/26 by Ben.Marsh

	Core: Move FMsg function definitions into the LogMacros.h header, where it's primarily used from.

Change 3103102 on 2016/08/26 by Ben.Marsh

	Core: Make the LogMacros.h header standalone. Untangles a few header dependencies necessary to include log macros early on. Global Core log channels are now defined in CoreGlobals.h

Change 3103160 on 2016/08/26 by Ben.Marsh

	CoreUObject: Separate Linker.h into LinkerLoad.h, LinkerSave.h, PackageFileSummary.h, ObjectResource.h (matching existing cpp files).

Change 3103265 on 2016/08/26 by Ben.Marsh

	Core: Split FScriptArray, TMRUArray, TTransArray, TIndirectArray into separate headers.

Change 3103642 on 2016/08/26 by Ben.Marsh

	Core: Remove reference to FMath function from allocator, to avoid unnecessarily bringing in math library.

[CL 3104315 by Ben Marsh in Main branch]
2016-08-29 10:27:24 -04:00

95 lines
4.1 KiB
C++

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Editor/SequencerWidgets/Public/ITimeSlider.h"
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;
};