Cogs.Core
|
Public Member Functions | |
Editor (Context *context) | |
void | initialize () override |
void | cleanup () override |
void | show () override |
void | processShortcuts () |
void | beginFrame () override |
bool | isActive () const override |
EditorState * | getState () override |
void | showText (const char *format,...) const |
Show the same type of label as ImGui::Text, but with the added ability to highlight and copy text. Max 255 characters. | |
bool | showModel (ModelHandle &modelHandle) |
bool | showTexture (const StringView &header, TextureHandle &textureHandle) override |
bool | showMaterialInstance (FieldInfo &fieldInfo, MaterialInstanceHandle &materialInstanceHandle) |
bool | imageButton (Icon icon, int size, int padding) |
void | clear (bool interactive=true) override |
void | open (const StringView &path, bool openInRoot, bool synchronous) override |
Open file. | |
void | save () override |
void | saveAs () override |
void | saveIncremental () override |
void | importStatic () |
void | exportEntities (bool exportScene=false) |
void | cut () override |
void | copy () override |
void | paste () override |
void | invokeCommand (const StringView &key) override |
void | destroy () override |
void | destroyPermanently () |
void | changeMode (EditingMode mode) |
void | focusSelected () |
void | focusAll () |
bool | focusBoundingBox (const Cogs::Geometry::DBoundingBox &boundingBox) |
void | setStatusbarText (const std::string &text, bool guiStatus) |
void | showHide (bool visible) |
Show or hide selected entity and all children. | |
void | hideUnselected () |
Make all non-selected entities invisible. | |
void | showAll () |
Make all entities visible. | |
void | selectFurthestAway () |
Search and select visible entity furthest away from selection. Ie.e. find outliers. | |
void | invertVisibility () |
void | selectAll () |
void | selectOne (EntityId id) |
void | clearCommands () |
void | onlineHelp (bool generalHelp) |
void | showLicenses () |
void | showAbout () |
EditorCommand * | doApply (std::unique_ptr< EditorCommand > &&newCommand) |
template<typename Command , typename... Args> | |
Command * | apply (Args... args) |
template<typename Command , typename... Args> | |
Command * | applySelected (Args... args) |
void | undo () |
void | redo () |
virtual void | initialize ()=0 |
virtual void | cleanup ()=0 |
virtual void | clear (bool interactive=true)=0 |
virtual void | open (const StringView &path, bool openInRoot, bool synchronous)=0 |
Open file. | |
virtual void | save ()=0 |
virtual void | saveAs ()=0 |
virtual void | saveIncremental ()=0 |
virtual void | exportScene (const StringView &path)=0 |
virtual void | cut ()=0 |
virtual void | copy ()=0 |
virtual void | paste ()=0 |
virtual void | invokeCommand (const StringView &key)=0 |
virtual void | destroy ()=0 |
virtual bool | isActive () const =0 |
virtual EntityIds | getSelected () const =0 |
virtual void | select (const EntityIds &ids, SelectMode mode=SelectMode::Exclusive)=0 |
virtual void | beginFrame ()=0 |
virtual void | show ()=0 |
virtual EditorState * | getState ()=0 |
virtual bool | showTexture (const StringView &header, TextureHandle &texture)=0 |
virtual struct EditorCommand * | createCommand (const StringView &key)=0 |
virtual void | createEntity (const StringView &type, const StringView &name)=0 |
Static Public Member Functions | |
static void COGSCORE_EDITOR_API | registerExtensionCommand (const StringView &key, CommandCreator creator) |
static COGSCORE_EDITOR_API std::vector< ExtensionCommand > & | getExtensionCommands () |
static void COGSCORE_EDITOR_API | registerExtensionItem (const StringView &key, const StringView &name) |
static COGSCORE_EDITOR_API std::vector< ExtensionItem > & | getExtensionItems () |
Private Member Functions | |
void | handleMouseEvent (const struct Cogs::Core::InputEvent &event) |
void | showEntities () |
void | showEntityDetails (ComponentModel::Entity *entity) |
void | showGizmo () |
void | selectLayer (ComponentModel::Entity *entity, StringView layer) |
void | setLayerVisibility (ComponentModel::Entity *entity, StringView layer, bool visible) |
bool | getLayerVisibility (const ComponentModel::Entity *entity, StringView layer) |
Returns true if any Node in layer is visible. | |
bool | isStandardEntity (const Cogs::ComponentModel::Entity *entity) const |
bool | isUserRootEntity (const Cogs::ComponentModel::Entity *entity) const |
Checks if the entity is. | |
void | openInternal (const StringView &path, bool openInRoot, bool synchronous, bool interactive) |
const std::string & | getStatusbarText () const |
bool | showingGuiStatusbarText () const |
float | getStatusbarHeight () const |
float | getToolbarHeight () const |
float | getSidebarWidth () const |
float | getInspectorWidth () const |
float | getMenuHeight () const |
virtual void | exportScene (const StringView &path) override |
virtual EntityIds | getSelected () const override |
virtual void | select (const EntityIds &ids, SelectMode mode=SelectMode::Exclusive) override |
virtual EditorCommand * | createCommand (const StringView &key) override |
virtual void | createEntity (const StringView &type, const StringView &name) override |
Private Attributes | |
Context * | context |
std::unique_ptr< struct EditorState > | state |
ModalEditorCommand * | modalCommand = nullptr |
std::vector< std::unique_ptr< EditorCommand > > | commands |
size_t | commandIndex = NoCommand |
std::unique_ptr< class MaterialEditor > | materialEditor |
std::vector< Cogs::Core::WeakEntityPtr > | standardEntities |
Set of entities created when the Editor loads. | |
int | textElementId = 0 |
bool | initialized = false |
bool | active = false |
float | minWidth = 50 |
float | sidebarWidth = 200 |
float | inspectorWidth = 250 |
float | menuHeight = 20 |
float | toolbarHeight = 40 |
glm::vec2 | buttonSize = glm::vec2{ 24 } |
float | statusbarHeight = 20 |
bool | showStatusbar = true |
std::string | statusbarText |
bool | guiStatusInStatusbar = true |
bool | showToolbar = true |
bool | showSidebar = true |
bool | showInspector = true |
bool | showMenu = true |
Static Private Attributes | |
static constexpr size_t | NoCommand = static_cast<size_t>(-1) |
|
explicit |
Definition at line 591 of file Editor.cpp.
|
inline |
|
inline |
|
overridevirtual |
Implements Cogs::Core::IEditor.
Definition at line 1584 of file Editor.cpp.
void Cogs::Core::Editor::changeMode | ( | EditingMode | mode | ) |
Definition at line 2583 of file Editor.cpp.
|
overridevirtual |
Implements Cogs::Core::IEditor.
Definition at line 670 of file Editor.cpp.
|
overridevirtual |
Implements Cogs::Core::IEditor.
Definition at line 2171 of file Editor.cpp.
void Cogs::Core::Editor::clearCommands | ( | ) |
Definition at line 2919 of file Editor.cpp.
|
overridevirtual |
Implements Cogs::Core::IEditor.
Definition at line 2534 of file Editor.cpp.
|
overrideprivatevirtual |
Implements Cogs::Core::IEditor.
Definition at line 2142 of file Editor.cpp.
|
overrideprivatevirtual |
Implements Cogs::Core::IEditor.
Definition at line 2147 of file Editor.cpp.
|
overridevirtual |
Implements Cogs::Core::IEditor.
Definition at line 2525 of file Editor.cpp.
|
overridevirtual |
Implements Cogs::Core::IEditor.
Definition at line 2569 of file Editor.cpp.
void Cogs::Core::Editor::destroyPermanently | ( | ) |
Definition at line 2576 of file Editor.cpp.
|
inline |
void Cogs::Core::Editor::exportEntities | ( | bool | exportScene = false | ) |
Definition at line 2492 of file Editor.cpp.
|
overrideprivatevirtual |
Implements Cogs::Core::IEditor.
Definition at line 2122 of file Editor.cpp.
void Cogs::Core::Editor::focusAll | ( | ) |
Definition at line 2606 of file Editor.cpp.
bool Cogs::Core::Editor::focusBoundingBox | ( | const Cogs::Geometry::DBoundingBox & | boundingBox | ) |
Definition at line 2633 of file Editor.cpp.
void Cogs::Core::Editor::focusSelected | ( | ) |
Definition at line 2590 of file Editor.cpp.
|
static |
Definition at line 610 of file Editor.cpp.
|
static |
Definition at line 625 of file Editor.cpp.
|
inlineprivate |
|
private |
Returns true if any Node in layer is visible.
Definition at line 2072 of file Editor.cpp.
References Cogs::ComponentModel::Entity::getComponent().
|
inlineprivate |
|
overrideprivatevirtual |
Implements Cogs::Core::IEditor.
Definition at line 2132 of file Editor.cpp.
|
inlineprivate |
|
overridevirtual |
Implements Cogs::Core::IEditor.
Definition at line 1826 of file Editor.cpp.
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
private |
Definition at line 1504 of file Editor.cpp.
void Cogs::Core::Editor::hideUnselected | ( | ) |
Make all non-selected entities invisible.
Definition at line 2761 of file Editor.cpp.
References Cogs::Core::EntityStore::getEntities(), Cogs::Core::EntityStore::getEntityPtr(), and Cogs::Core::Context::store.
bool Cogs::Core::Editor::imageButton | ( | Icon | icon, |
int | size, | ||
int | padding | ||
) |
Definition at line 2152 of file Editor.cpp.
void Cogs::Core::Editor::importStatic | ( | ) |
Definition at line 2453 of file Editor.cpp.
|
overridevirtual |
Implements Cogs::Core::IEditor.
Definition at line 633 of file Editor.cpp.
void Cogs::Core::Editor::invertVisibility | ( | ) |
Toggle visibility all entities. First hideUnselected, then invertVisibility makes only unselected entities visible
Definition at line 2871 of file Editor.cpp.
References Cogs::Core::EntityStore::getEntities(), and Cogs::Core::Context::store.
|
overridevirtual |
Implements Cogs::Core::IEditor.
Definition at line 2564 of file Editor.cpp.
|
inlineoverridevirtual |
Implements Cogs::Core::IEditor.
|
private |
Checks if the given entity is a Basic Cogs.Runtime entity. E.g. Should not change visibility or delete.
Definition at line 2093 of file Editor.cpp.
References Cogs::ComponentModel::Entity::getComponent().
|
private |
Checks if the entity is.
Definition at line 2109 of file Editor.cpp.
References Cogs::Core::EntityStore::getEntityParent(), and Cogs::Core::Context::store.
void Cogs::Core::Editor::onlineHelp | ( | bool | generalHelp | ) |
Definition at line 2925 of file Editor.cpp.
|
overridevirtual |
Open file.
path | Path of file |
openInRoot | True if open file as root entity, false if open below selected if one selected. |
synchronous | True if Syncronous read. |
Implements Cogs::Core::IEditor.
Definition at line 2348 of file Editor.cpp.
References Cogs::Core::EditorState::getAllSelectedIds(), Cogs::Core::EditorState::getSelectedId(), and Cogs::Core::EditorState::setSelection().
|
private |
Definition at line 2189 of file Editor.cpp.
|
overridevirtual |
Implements Cogs::Core::IEditor.
Definition at line 2557 of file Editor.cpp.
void Cogs::Core::Editor::processShortcuts | ( | ) |
Definition at line 1332 of file Editor.cpp.
void Cogs::Core::Editor::redo | ( | ) |
Definition at line 2956 of file Editor.cpp.
|
static |
Definition at line 602 of file Editor.cpp.
|
static |
Definition at line 617 of file Editor.cpp.
|
overridevirtual |
Implements Cogs::Core::IEditor.
Definition at line 2384 of file Editor.cpp.
|
overridevirtual |
Implements Cogs::Core::IEditor.
Definition at line 2395 of file Editor.cpp.
|
overridevirtual |
Implements Cogs::Core::IEditor.
Definition at line 2412 of file Editor.cpp.
|
overrideprivatevirtual |
Implements Cogs::Core::IEditor.
Definition at line 2137 of file Editor.cpp.
void Cogs::Core::Editor::selectAll | ( | ) |
Definition at line 2892 of file Editor.cpp.
void Cogs::Core::Editor::selectFurthestAway | ( | ) |
Search and select visible entity furthest away from selection. Ie.e. find outliers.
Definition at line 2813 of file Editor.cpp.
References Cogs::ComponentModel::Entity::getComponent(), Cogs::Core::EntityStore::getEntityPtr(), Cogs::ComponentModel::Entity::getId(), and Cogs::Core::Context::store.
|
private |
Definition at line 2028 of file Editor.cpp.
void Cogs::Core::Editor::selectOne | ( | EntityId | id | ) |
Definition at line 2912 of file Editor.cpp.
|
private |
Definition at line 2049 of file Editor.cpp.
void Cogs::Core::Editor::setStatusbarText | ( | const std::string & | text, |
bool | guiStatus | ||
) |
Update editor statusbar text
guiStatus | - TRUE if status is for GUI entry, false if application status |
Definition at line 2675 of file Editor.cpp.
|
overridevirtual |
Implements Cogs::Core::IEditor.
Definition at line 702 of file Editor.cpp.
void Cogs::Core::Editor::showAbout | ( | ) |
Definition at line 2940 of file Editor.cpp.
void Cogs::Core::Editor::showAll | ( | ) |
Make all entities visible.
Definition at line 2791 of file Editor.cpp.
References Cogs::ComponentModel::Entity::getComponent(), Cogs::Core::EntityStore::getEntities(), and Cogs::Core::Context::store.
|
private |
Definition at line 1952 of file Editor.cpp.
|
private |
Definition at line 2018 of file Editor.cpp.
|
private |
Definition at line 2023 of file Editor.cpp.
void Cogs::Core::Editor::showHide | ( | bool | visible | ) |
Show or hide selected entity and all children.
Definition at line 2740 of file Editor.cpp.
References Cogs::ComponentModel::Entity::getComponent(), Cogs::Core::EntityStore::getEntityPtr(), and Cogs::Core::Context::store.
|
inlineprivate |
void Cogs::Core::Editor::showLicenses | ( | ) |
Definition at line 2935 of file Editor.cpp.
bool Cogs::Core::Editor::showMaterialInstance | ( | FieldInfo & | fieldInfo, |
MaterialInstanceHandle & | materialInstanceHandle | ||
) |
Definition at line 1947 of file Editor.cpp.
bool Cogs::Core::Editor::showModel | ( | ModelHandle & | modelHandle | ) |
Definition at line 1862 of file Editor.cpp.
void Cogs::Core::Editor::showText | ( | const char * | format, |
... | |||
) | const |
Show the same type of label as ImGui::Text, but with the added ability to highlight and copy text. Max 255 characters.
Definition at line 1831 of file Editor.cpp.
|
overridevirtual |
Implements Cogs::Core::IEditor.
Definition at line 1896 of file Editor.cpp.
void Cogs::Core::Editor::undo | ( | ) |
Definition at line 2945 of file Editor.cpp.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticconstexprprivate |
|
private |
|
private |