Files
o3de/Code/Framework/AzToolsFramework/Tests/FocusMode/EditorFocusModeFixture.h
T
Tom Hulton-Harrop d065eb9498 Initial improvements to fix viewport icon selection and draw order (#6284)
* wip fixes for entity viewport icons displaying in the correct order and handling selection correctly

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* add additional comment about z value

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* move manual sorting and some small tidy-up

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* update comment

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* updates following initial round of PR feedback

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* additional changes to support tests for entity icon intersection

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* add support to enable/disable icons separately from helpers

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* final tests added and small tidy-up to display EntityId correctly

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* update some manipulator test framework calls after utility functions were moved

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* fix for implicit cast

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* move icon scale values to AZ_CVARS

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* fix failing tests caught in AR and update some naming conventions for tests

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* update naming convention for members of ProjectedViewportRay

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* update other references to ProjectedViewportRay

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* update more references to ProjectedViewportRay change

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* update menus for python tests

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
2021-12-16 09:35:23 +00:00

56 lines
2.0 KiB
C++

/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <AzCore/Component/TransformBus.h>
#include <AzCore/UnitTest/TestTypes.h>
#include <AzCore/UserSettings/UserSettingsComponent.h>
#include <AzTest/AzTest.h>
#include <AzToolsFramework/ContainerEntity/ContainerEntityInterface.h>
#include <AzToolsFramework/FocusMode/FocusModeInterface.h>
#include <AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.h>
namespace UnitTest
{
class EditorFocusModeFixture : public ToolsApplicationFixture
{
protected:
void SetUpEditorFixtureImpl() override;
void TearDownEditorFixtureImpl() override;
void GenerateTestHierarchy();
AZ::EntityId CreateEditorEntity(const char* name, AZ::EntityId parentId);
AZStd::unordered_map<AZStd::string, AZ::EntityId> m_entityMap;
AzToolsFramework::ContainerEntityInterface* m_containerEntityInterface = nullptr;
AzToolsFramework::FocusModeInterface* m_focusModeInterface = nullptr;
public:
AzToolsFramework::EntityIdList GetSelectedEntities();
AzFramework::EntityContextId m_editorEntityContextId = AzFramework::EntityContextId::CreateNull();
AzFramework::CameraState m_cameraState;
inline static const AZ::Vector3 CameraPosition = AZ::Vector3(10.0f, 15.0f, 10.0f);
inline static const char* CityEntityName = "City";
inline static const char* StreetEntityName = "Street";
inline static const char* CarEntityName = "Car";
inline static const char* SportsCarEntityName = "SportsCar";
inline static const char* Passenger1EntityName = "Passenger1";
inline static const char* Passenger2EntityName = "Passenger2";
inline static AZ::Vector3 WorldCarEntityPosition = AZ::Vector3(5.0f, 15.0f, 0.0f);
};
} // namespace UnitTest