clean up object module

This commit is contained in:
IlyaShurupov 2024-03-23 12:32:57 +03:00 committed by Ilya Shurupov
parent e78885d452
commit f8c82b7e29
68 changed files with 1223 additions and 1229 deletions

View file

@ -8,6 +8,9 @@
#include "imgui.h"
#include "imgui_internal.h"
using namespace tp;
using namespace obj;
namespace ImGui {
bool SubMenuBegin(const char* desc, int level);
@ -104,7 +107,7 @@ void obj::ObjectsGUI::setClipboard(obj::Object* obj) {
mClipboard = obj;
if (mClipboard) {
obj::NDO->refinc(obj);
obj::NDO->increaseReferenceCount(obj);
}
}
@ -145,7 +148,7 @@ obj::ObjectsGUI::ObjectsGUI() { assert(obj::NDO && "Objects library is not initi
void obj::ObjectsGUI::cd(obj::Object* child, const std::string& name) {
mActive = child;
mViewStack.pushBack({ mActive, name });
obj::NDO->refinc(child);
obj::NDO->increaseReferenceCount(child);
}
void obj::ObjectsGUI::cdup() {
@ -587,7 +590,7 @@ void obj::ObjectsGUI::dictViewEdit(obj::DictObject* dict, const std::string& key
if (bool(idx)) {
// Notify("Object with such name Already Exists");
} else {
obj::NDO->refinc(obj);
obj::NDO->increaseReferenceCount(obj);
dict->remove(key);
auto id = std::string(mNameEdit);
dict->put(id, obj);
@ -915,7 +918,7 @@ void obj::ObjectsGUI::explorer() {
}
if (ImGui::Selectable("Instantiate ")) {
setClipboard(obj::NDO->instatiate(curretn_object));
setClipboard(obj::NDO->instantiate(curretn_object));
// Notify("Object copied to clipboard");
}
@ -1005,7 +1008,7 @@ void obj::ObjectsGUI::properties(const obj::ObjectType* type, bool top_of_tree_v
assert(mActive);
if (mActive->type != type) return;
ImGui::Text(" RefCount : %i", obj::NDO->getrefc(mActive));
ImGui::Text(" RefCount : %i", obj::NDO->getReferenceCount(mActive));
ImGui::Text(" Type : %s", type->name);

View file

@ -8,7 +8,7 @@
#include <string>
namespace obj {
namespace tp::obj {
class ObjectsGUI {
@ -24,7 +24,7 @@ namespace obj {
operator bool() { return obj; }
};
tp::List<ViewStackNode> mViewStack;
List<ViewStackNode> mViewStack;
obj::Object* mRoot = NULL;
obj::Object* mActive = NULL;
obj::Object* mClipboard = NULL;