123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- /*
- * 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
- *
- */
- #ifndef CRYINCLUDE_EDITORCOMMON_QTVIEWPANE_H
- #define CRYINCLUDE_EDITORCOMMON_QTVIEWPANE_H
- #pragma once
- #include "IEditor.h"
- #include "Include/IEditorClassFactory.h"
- #include "Include/ObjectEvent.h"
- #include "Objects/ClassDesc.h"
- #include <QRect>
- #include <QWidget>
- namespace Serialization {
- class IArchive;
- }
- using Serialization::IArchive;
- // ---------------------------------------------------------------------------
- template<class TObject>
- class CTemplateObjectClassDesc
- : public CObjectClassDesc
- {
- public:
- const char* m_className;
- const char* m_category;
- const char* m_textureIcon;
- ObjectType m_objectType;
- int m_order;
- const char* m_fileSpec;
- const char* m_toolClassName;
- CTemplateObjectClassDesc(const char* className, const char* category, const char* textureIcon, ObjectType objectType, int order = 100, const char* fileSpec = "", const char* toolClassName = nullptr)
- : m_className(className)
- , m_category(category)
- , m_textureIcon(textureIcon)
- , m_objectType(objectType)
- , m_order(order)
- , m_fileSpec(fileSpec)
- , m_toolClassName(toolClassName)
- {
- }
- REFGUID ClassID() override
- {
- return TObject::GetClassID();
- }
- QString GetFileSpec() override
- {
- return m_fileSpec;
- }
- ESystemClassID SystemClassID() override
- {
- return ESYSTEM_CLASS_OBJECT;
- };
- ObjectType GetObjectType() override
- {
- return m_objectType;
- }
- QString ClassName() override
- {
- return m_className;
- }
- QString Category() override
- {
- return m_category;
- }
- QString GetTextureIcon() override
- {
- return m_textureIcon;
- }
- QObject* CreateQObject() const override
- {
- return new TObject;
- }
- int GameCreationOrder() override
- {
- return m_order;
- };
- bool IsEnabled() const override
- {
- return TObject::IsEnabled();
- }
- QString GetToolClassName() override
- {
- return m_toolClassName ? m_toolClassName : CObjectClassDesc::GetToolClassName();
- }
- };
- #endif // CRYINCLUDE_EDITORCOMMON_QTVIEWPANE_H
|