56904d1799
* Generic Cleanup Removals: * Unused cvars,member variables and defines * Windows media center edition support routines * CSystem - removed debug_GetCallStackRaw/GetRootWindowMessageHandler/ UnloadDLL/ShutdownModuleLibraries Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Fix CryMessageBox return values in Windows build Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Remove named selection group and a few smaller unused functionalities Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Remove ObjectManager export functionality + 2 deprecated functions Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Remove object legacy freeze/hide support from ObjectManager Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Remove ObjectManager duplicate name dection, as well as object renaming Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Remove ObjectManager serialization and selection callbacks Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * ObjectManager - remove MoveObjects/HitTestObject/EndEditParams and related members/functions Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Remove a bunch of unused clone related functionality + misc Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * ObjectManager - misc removals Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * ObjectManager - more removals Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Remove unused object selection/retrieval in ObjectManager and LoadObjects in ObjectLoader Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * CBaseObject - remove unused material layers mask support Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * More CBaseObject cleanups. Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * CBaseObject - remove SubObj functions and IMouseCreateCallback Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Remove unused procedural floor management, helper scale and tags. Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * CBaseObject - remove more unused methods. Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Removals in multiple places. CBaseObject - unused `OBJTYPE_DUMMY` flag removed, member `IsSameClass` CObjectArchive removed unused methods/members CObjectManager removed unused `Update` method Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * More removals IDisplayViewport - HitTestLine/GetGridStep/setHitcontext/ GetConstructionPlane Unused Cry_Matrix44 template specializations. Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * O3DE.exe Project-Centric "Open Editor" fix (#5852) * The O3DE.exe Open Editor button now attempts to open the Editor in the build directory of the project being opened. If their is no Editor within the build directory of the Project, it uses the Editor.exe in the current O3DE.exe executable directory if it exists Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Engine .gitignore now ignores the build directory if placed in the AutomatedTesting project Previously it was just ignoring a `[Bb]uild` directory if it was directly within the engine root. This change matches the behavior of the project templates. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Renamed the ProjectUtils GetEditorDirectory function to GetEditorExecutablePath Added a platform specific implementation for retrieving the path to the Editor executable in the GetEditorExectuablePath function. It first attempts to locate the Editor via checking the project build directory for an Editor executable before falling back to checking the binary directory of the currently running O3DE executable. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Correct the MacOS GetEditorExecutablePath to return the Editor path Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Adding missing C++20 std::erase implementations (#5735) There were already implementations for std::erase_if. This adds the counterpart AZStd::erase versions resolves #5734 Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * More removals and refactors `ShowMessage` and `CryMessageBox` return void now Simplify code in `CSystem::WarningV` Remove unused `CryGetTicksPerSec` Remove unused WinBase functionality Replace `nanosleep` call in WinBase with `std::this_thread::sleep_for` Remove unused Win32Wrapper routines Remove unused IFunctorBase.h and IEntityObjectListener.h Fix VectorAndArray.cpp compilation Use QMessageBox instead of CryMessageBox in the editor. Remove empty ArchiveVars platform specific files Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Fix test code. Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Remove an unused function Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * CBaseObject and undo description removals. Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * A bunch of removals * Remove IRenderNode * Remove editor's KDTree * Remove StatObjBus, InstanceStatObjEventBus::ReleaseData is redundant ( same functionality in the only available handler is triggered by `OnCryEditorCloseScene`) * Remove CExportManager::AddStatObj/AddMeshes/AddMesh, IExportManager::ExportSingleStatObj * Remove CIconManager/IIconManager::GetObject * Remove CBaseObject::IntersectRayMesh * Remove IIndexedMesh and related structs. * Unused IUndoObject::GetDescription and all derived implementations. * Unused CUndoBaseLibrary/CUndoBaseLibraryManager * Unused Matrix34_tpl typedefs * Legacy Xml classes cleanup Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Remove unused `Vec3ToVector3D` helper Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * fix - remove unused static variable Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> Co-authored-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
135 lines
5.3 KiB
C++
135 lines
5.3 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/PlatformIncl.h>
|
|
#include <AzCore/Math/Guid.h>
|
|
#include <CryCommon/platform.h>
|
|
#include <CryCommon/Cry_Geo.h>
|
|
#include <set>
|
|
|
|
// forward declarations.
|
|
class CEntityObject;
|
|
struct DisplayContext;
|
|
struct IGizmoManager;
|
|
class CTrackViewAnimNode;
|
|
class CUsedResources;
|
|
class CSelectionGroup;
|
|
class CObjectClassDesc;
|
|
class CObjectArchive;
|
|
class CViewport;
|
|
struct HitContext;
|
|
enum class ImageRotationDegrees;
|
|
class CBaseObject;
|
|
class XmlNodeRef;
|
|
|
|
#include "ObjectEvent.h"
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
typedef std::vector<CBaseObject*> CBaseObjectsArray;
|
|
typedef std::pair< bool(CALLBACK*)(CBaseObject const&, void*), void* > BaseObjectFilterFunctor;
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Interface to access editor objects scene graph.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////////
|
|
struct IObjectManager
|
|
{
|
|
public:
|
|
virtual ~IObjectManager() = default;
|
|
|
|
//! This callback will be called on response to object event.
|
|
struct EventListener
|
|
{
|
|
virtual void OnObjectEvent(CBaseObject*, int) = 0;
|
|
};
|
|
|
|
virtual CBaseObject* NewObject(CObjectClassDesc* cls, CBaseObject* prev = 0, const QString& file = "", const char* newObjectName = nullptr) = 0;
|
|
virtual CBaseObject* NewObject(const QString& typeName, CBaseObject* prev = 0, const QString& file = "", const char* newObjectName = nullptr) = 0;
|
|
virtual CBaseObject* NewObject(CObjectArchive& archive, CBaseObject* pUndoObject = 0, bool bMakeNewId = false) = 0;
|
|
|
|
virtual void DeleteObject(CBaseObject* obj) = 0;
|
|
virtual void DeleteSelection(CSelectionGroup* pSelection) = 0;
|
|
virtual void DeleteAllObjects() = 0;
|
|
|
|
//! Get number of objects manager by ObjectManager (not contain sub objects of groups).
|
|
virtual int GetObjectCount() const = 0;
|
|
|
|
//! Get array of objects, managed by manager (not contain sub objects of groups).
|
|
//! @param layer if 0 get objects for all layers, or layer to get objects from.
|
|
virtual void GetObjects(CBaseObjectsArray& objects) const = 0;
|
|
|
|
//! Display objects on specified display context.
|
|
virtual void Display(DisplayContext& dc) = 0;
|
|
|
|
//! Gets a radius to be used for hit tests on the axis helpers, like the transform gizmo.
|
|
//! @return the axis helper hit radius.
|
|
virtual int GetAxisHelperHitRadius() const = 0;
|
|
|
|
//! Send event to all objects.
|
|
//! Will cause OnEvent handler to be called on all objects.
|
|
virtual void SendEvent(ObjectEvent event) = 0;
|
|
|
|
//! Send event to all objects within given bounding box.
|
|
//! Will cause OnEvent handler to be called on objects within bounding box.
|
|
virtual void SendEvent(ObjectEvent event, const AABB& bounds) = 0;
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
//! Find object by ID.
|
|
virtual CBaseObject* FindObject(REFGUID guid) const = 0;
|
|
//////////////////////////////////////////////////////////////////////////
|
|
//! Find object by name.
|
|
virtual CBaseObject* FindObject(const QString& sName) const = 0;
|
|
//////////////////////////////////////////////////////////////////////////
|
|
//! Find objects of given type.
|
|
virtual void FindObjectsOfType(const QMetaObject* pClass, std::vector<CBaseObject*>& result) = 0;
|
|
virtual void FindObjectsOfType(ObjectType type, std::vector<CBaseObject*>& result) = 0;
|
|
//////////////////////////////////////////////////////////////////////////
|
|
//! Find objects which intersect with a given AABB.
|
|
virtual void FindObjectsInAABB(const AABB& aabb, std::vector<CBaseObject*>& result) const = 0;
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
// Object Selection.
|
|
//////////////////////////////////////////////////////////////////////////
|
|
virtual bool SelectObject(CBaseObject* obj, bool bUseMask = true) = 0;
|
|
virtual void UnselectObject(CBaseObject* obj) = 0;
|
|
|
|
//! Clear default selection set.
|
|
//! @Return number of objects removed from selection.
|
|
virtual int ClearSelection() = 0;
|
|
|
|
//! Get current selection.
|
|
virtual CSelectionGroup* GetSelection() const = 0;
|
|
|
|
//! Delete all objects in current selection group.
|
|
virtual void DeleteSelection() = 0;
|
|
|
|
//! Generates uniq name base on type name of object.
|
|
virtual QString GenerateUniqueObjectName(const QString& typeName) = 0;
|
|
//! Register object name in object manager, needed for generating uniq names.
|
|
virtual void RegisterObjectName(const QString& name) = 0;
|
|
|
|
//! Find object class by name.
|
|
virtual CObjectClassDesc* FindClass(const QString& className) = 0;
|
|
|
|
virtual void ChangeObjectId(REFGUID oldId, REFGUID newId) = 0;
|
|
|
|
virtual IGizmoManager* GetGizmoManager() = 0;
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
//! Invalidate visibily settings of objects.
|
|
virtual void InvalidateVisibleList() = 0;
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
// Gathers all resources used by all objects.
|
|
virtual void GatherUsedResources(CUsedResources& resources) = 0;
|
|
|
|
virtual bool IsLightClass(CBaseObject* pObject) = 0;
|
|
};
|