Files
UnrealEngineUWP/Engine/Source/Editor/TextureAlignMode/Public/TextureAlignEdMode.h
Andrew Rodham ba3528c9d4 Made it possible for asset editors to maintain their own FEditorModeTools lists
Breaking changes include:
    * Rename of GEditorModeTools -> GLevelEditorModeTools to signify that it applies only to the level editor modes
    * Addition of FEditorModeRegistry, responsible for managing and creating new editor modes. Modes are no longer registered with an instance of the mode, instead with a mode factory that is able to create a new mode of that type.
    * Editor modes now operate on FEditorViewportClients rather than FLevelEditorViewportClients
    * Added ability to specify an FEditorModeTools when creating an FEditorViewport

Moved component vizualiser manager handling outside of individual editor modes, and into FLevelEditorViewportClient. This should make it easier to transplant in future.

This work addresses TTP#334640 - EDITOR: Investigate making editor modes a per-'editor' concept

Reviewed by Michael Noland, Matt Kuhlenschmidt

[CL 2109245 by Andrew Rodham in Main branch]
2014-06-18 10:16:16 -04:00

71 lines
2.2 KiB
C++

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once
/**
* 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();
virtual void Exit();
virtual FVector GetWidgetLocation() const;
virtual bool ShouldDrawWidget() const;
virtual bool GetCustomDrawingCoordinateSystem( FMatrix& InMatrix, void* InData );
virtual bool GetCustomInputCoordinateSystem( FMatrix& InMatrix, void* InData );
virtual EAxisList::Type GetWidgetAxisToDraw( FWidget::EWidgetMode InWidgetMode ) const;
virtual bool StartTracking(FEditorViewportClient* InViewportClient, FViewport* InViewport);
virtual bool EndTracking(FEditorViewportClient* InViewportClient, FViewport* InViewport);
virtual bool AllowWidgetMove() { 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;
};