Files
UnrealEngineUWP/Engine/Source/Editor/TextureAlignMode/Public/TextureAlignEdMode.h
Ryan Vance 7c51ff94af Merging //UE4/Dev-Main to Dev-VR (//UE4/Dev-VR)
CL 1 of 8
#rb integration

[CL 4748712 by Ryan Vance in Dev-VR branch]
2019-01-17 18:54:05 -05:00

82 lines
2.5 KiB
C++

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Modules/ModuleInterface.h"
#include "UnrealWidget.h"
#include "EdMode.h"
#include "EditorModeTools.h"
class FEditorViewportClient;
class FEdModeTexture;
class FScopedTransaction;
class FViewport;
/**
* Texture mode module
*/
class FTextureAlignModeModule : public IModuleInterface
{
private:
TSharedPtr<class FEdModeTexture> EdModeTexture;
public:
/**
* Called right after the module's DLL has been loaded and the module object has been created
*/
virtual void StartupModule() override;
/**
* Called before the module is unloaded, right before the module object is destroyed.
*/
virtual void ShutdownModule() override;};
/**
* Allows texture alignment on BSP surfaces via the widget.
*/
class FEdModeTexture : public FEdMode
{
public:
FEdModeTexture();
virtual ~FEdModeTexture();
/** Stores the coordinate system that was active when the mode was entered so it can restore it later. */
ECoordSystem SaveCoordSystem;
virtual void Enter() override;
virtual void Exit() override;
virtual FVector GetWidgetLocation() const override;
virtual bool ShouldDrawWidget() const override;
virtual bool GetCustomDrawingCoordinateSystem( FMatrix& InMatrix, void* InData ) override;
virtual bool GetCustomInputCoordinateSystem( FMatrix& InMatrix, void* InData ) override;
virtual EAxisList::Type GetWidgetAxisToDraw( FWidget::EWidgetMode InWidgetMode ) const override;
virtual bool StartTracking(FEditorViewportClient* InViewportClient, FViewport* InViewport) override;
virtual bool EndTracking(FEditorViewportClient* InViewportClient, FViewport* InViewport) override;
virtual bool AllowWidgetMove() override { return false; }
virtual bool IsCompatibleWith(FEditorModeID OtherModeID) const override;
protected:
/** The current transaction. */
FScopedTransaction* ScopedTransaction;
/* The world that brush that we started tracking with belongs to. Cleared when tracking ends. */
UWorld* TrackingWorld;
};
/**
* FModeTool_Texture
*/
class FModeTool_Texture : public FModeTool
{
public:
FModeTool_Texture();
virtual bool InputDelta(FEditorViewportClient* InViewportClient,FViewport* InViewport,FVector& InDrag,FRotator& InRot,FVector& InScale);
// override these to allow this tool to keep track of the users dragging during a single drag event
virtual bool StartModify() { PreviousInputDrag = FVector::ZeroVector; return true; }
virtual bool EndModify() { return true; }
private:
FVector PreviousInputDrag;
};