From c99202c278e7dfd3bd0fc886dbbb3e6a55dd30c3 Mon Sep 17 00:00:00 2001 From: aquiles Date: Tue, 2 Nov 2010 13:47:24 +0100 Subject: [PATCH] Added: Georges Editor Qt first revision --- code/ryzom/tools/leveldesign/CMakeLists.txt | 4 + .../georges_editor_qt/CMakeLists.txt | 19 + .../georges_editor_qt/data/georges_editor.cfg | 11 + .../data/georges_editor_default.cfg | 113 ++++ .../georges_editor_qt/src/CMakeLists.txt | 35 ++ .../georges_editor_qt/src/callback.cpp | 27 + .../georges_editor_qt/src/callback.h | 320 ++++++++++++ .../georges_editor_qt/src/configuration.cpp | 242 +++++++++ .../georges_editor_qt/src/configuration.h | 92 ++++ .../georges_editor_qt/src/entity.cpp | 269 ++++++++++ .../georges_editor_qt/src/entity.h | 217 ++++++++ .../src/filesystem_model.cpp | 70 +++ .../georges_editor_qt/src/filesystem_model.h | 43 ++ .../georges_editor_qt/src/formitem.cpp | 103 ++++ .../georges_editor_qt/src/formitem.h | 68 +++ .../georges_editor_qt/src/georges.cpp | 46 ++ .../georges_editor_qt/src/georges.h | 64 +++ .../src/georges_dirtree_dialog.cpp | 130 +++++ .../src/georges_dirtree_dialog.h | 64 +++ .../src/georges_dirtree_form.ui | 51 ++ .../src/georges_editor_qt.qrc | 13 + .../src/georges_treeview_dialog.cpp | 271 ++++++++++ .../src/georges_treeview_dialog.h | 80 +++ .../src/georges_treeview_form.ui | 122 +++++ .../src/georgesform_model.cpp | 442 ++++++++++++++++ .../georges_editor_qt/src/georgesform_model.h | 74 +++ .../src/georgesform_proxy_model.cpp | 56 ++ .../src/georgesform_proxy_model.h | 42 ++ .../georges_editor_qt/src/images/.directory | 3 + .../georges_editor_qt/src/images/go-down.png | Bin 0 -> 2404 bytes .../georges_editor_qt/src/images/go-up.png | Bin 0 -> 2426 bytes .../georges_editor_qt/src/images/khead.png | Bin 0 -> 1344 bytes .../georges_editor_qt/src/images/list-add.png | Bin 0 -> 2658 bytes .../src/images/list-remove.png | Bin 0 -> 1592 bytes .../georges_editor_qt/src/images/nel.png | Bin 0 -> 15587 bytes .../src/images/open-file.png | Bin 0 -> 1088 bytes .../src/images/pqrticles.png | Bin 0 -> 8318 bytes .../src/images/preferences.png | Bin 0 -> 10286 bytes .../georges_editor_qt/src/log_dialog.cpp | 58 +++ .../georges_editor_qt/src/log_dialog.h | 54 ++ .../georges_editor_qt/src/log_form.ui | 56 ++ .../georges_editor_qt/src/main.cpp | 116 +++++ .../georges_editor_qt/src/main_window.cpp | 488 ++++++++++++++++++ .../georges_editor_qt/src/main_window.h | 122 +++++ .../georges_editor_qt/src/modules.cpp | 44 ++ .../georges_editor_qt/src/modules.h | 44 ++ .../georges_editor_qt/src/object_viewer.cpp | 411 +++++++++++++++ .../georges_editor_qt/src/object_viewer.h | 191 +++++++ .../src/objectviewer_dialog.cpp | 408 +++++++++++++++ .../src/objectviewer_dialog.h | 108 ++++ .../src/objectviewer_form.ui | 28 + .../georges_editor_qt/src/qt_displayer.cpp | 113 ++++ .../georges_editor_qt/src/qt_displayer.h | 53 ++ .../georges_editor_qt/src/settings_dialog.cpp | 200 +++++++ .../georges_editor_qt/src/settings_dialog.h | 65 +++ .../georges_editor_qt/src/settings_form.ui | 227 ++++++++ .../georges_editor_qt/src/spindelegate.cpp | 275 ++++++++++ .../georges_editor_qt/src/spindelegate.h | 44 ++ .../georges_editor_qt/src/stdpch.cpp | 19 + .../georges_editor_qt/src/stdpch.h | 33 ++ 60 files changed, 6248 insertions(+) create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/CMakeLists.txt create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/data/georges_editor.cfg create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/data/georges_editor_default.cfg create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/CMakeLists.txt create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/callback.cpp create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/callback.h create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/configuration.cpp create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/configuration.h create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/entity.cpp create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/entity.h create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/filesystem_model.cpp create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/filesystem_model.h create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/formitem.cpp create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/formitem.h create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/georges.cpp create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/georges.h create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_dirtree_dialog.cpp create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_dirtree_dialog.h create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_dirtree_form.ui create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_editor_qt.qrc create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_dialog.cpp create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_dialog.h create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_form.ui create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_model.cpp create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_model.h create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_proxy_model.cpp create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_proxy_model.h create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/images/.directory create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/images/go-down.png create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/images/go-up.png create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/images/khead.png create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/images/list-add.png create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/images/list-remove.png create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/images/nel.png create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/images/open-file.png create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/images/pqrticles.png create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/images/preferences.png create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/log_dialog.cpp create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/log_dialog.h create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/log_form.ui create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/main.cpp create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/main_window.cpp create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/main_window.h create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/modules.cpp create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/modules.h create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/object_viewer.cpp create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/object_viewer.h create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/objectviewer_dialog.cpp create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/objectviewer_dialog.h create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/objectviewer_form.ui create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/qt_displayer.cpp create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/qt_displayer.h create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/settings_dialog.cpp create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/settings_dialog.h create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/settings_form.ui create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/spindelegate.cpp create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/spindelegate.h create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/stdpch.cpp create mode 100644 code/ryzom/tools/leveldesign/georges_editor_qt/src/stdpch.h diff --git a/code/ryzom/tools/leveldesign/CMakeLists.txt b/code/ryzom/tools/leveldesign/CMakeLists.txt index 0e49fedf0..37489d924 100644 --- a/code/ryzom/tools/leveldesign/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/CMakeLists.txt @@ -9,6 +9,10 @@ IF(WIN32) ADD_SUBDIRECTORY(world_editor) ENDIF(WIN32) +IF(WITH_QT) + ADD_SUBDIRECTORY(georges_editor_qt) +ENDIF(WITH_QT) + # folders not handled yet. #georges_convert #georges_dll diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/CMakeLists.txt b/code/ryzom/tools/leveldesign/georges_editor_qt/CMakeLists.txt new file mode 100644 index 000000000..0354cbeeb --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/CMakeLists.txt @@ -0,0 +1,19 @@ +#----------------------------------------------------------------------------- +# +# Georges Editor Qt +# Copyright (C) 2010 Adrian Jäkel +# +#----------------------------------------------------------------------------- + +# This tells the application(s) where to find the installed data. +ADD_DEFINITIONS(-DDATA_DIR="\\"${NL_SHARE_PREFIX}/georges_editor_qt/\\"") + +ADD_SUBDIRECTORY(src) + +INSTALL(DIRECTORY data/ + DESTINATION share/georges_editor_qt/data + COMPONENT data + PATTERN "CVS" EXCLUDE + PATTERN ".svn" EXCLUDE + PATTERN "Makefile*" EXCLUDE) + diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/data/georges_editor.cfg b/code/ryzom/tools/leveldesign/georges_editor_qt/data/georges_editor.cfg new file mode 100644 index 000000000..ebea3b459 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/data/georges_editor.cfg @@ -0,0 +1,11 @@ +RootConfigFilename = "georges_editor_default.cfg"; +SearchPaths = { + "G:/ryzom_assets/ryzom_assets/Stuff/Matis", "G:/ryzom_assets/bnps/characters_shapes" +}; +GraphicsDriver = "OpenGL"; +BackgroundColor = { + 173, 205, 234 +}; +LeveldesignPath = "D:/Dev/Ryzom/code/ryzom/common/data_leveldesign/leveldesign"; +QtWindowState = "%00%00%00%FF%00%00%00%00%FD%00%00%00%03%00%00%00%00%00%00%02%A6%00%00%00%E9%FC%02%00%00%00%01%FB%00%00%00%2A%00C%00G%00e%00o%00r%00g%00e%00s%00D%00i%00r%00T%00r%00e%00e%00D%00i%00a%00l%00o%00g%01%00%00%00%3B%00%00%00%E9%00%00%00t%00%FF%FF%FF%00%00%00%02%00%00%00%00%00%00%00%00%FC%01%00%00%00%01%FB%00%00%00%26%00C%00O%00b%00j%00e%00c%00t%00V%00i%00e%00w%00e%00r%00D%00i%00a%00l%00o%00g%00%00%00%00%00%FF%FF%FF%FF%00%00%00N%00%FF%FF%FF%00%00%00%03%00%00%02%A6%00%00%01c%FC%01%00%00%00%01%FB%00%00%00%22%00C%00G%00e%00o%00r%00g%00e%00s%00L%00o%00g%00D%00i%00a%00l%00o%00g%01%00%00%00%00%00%00%02%A6%00%00%00%5D%00%FF%FF%FF%00%00%00%00%00%00%00%E9%00%00%00%04%00%00%00%04%00%00%00%08%00%00%00%08%FC%00%00%00%01%00%00%00%02%00%00%00%01%FF%FF%FF%FF%01%00%00%00%00%FF%FF%FF%FF%00%00%00%00%00%00%00%00"; +QtWindowGeometry = "%01%D9%D0%CB%00%01%00%00%00%00%00%D6%00%00%00%C0%00%00%03%83%00%00%03%82%00%00%00%DA%00%00%00%DE%00%00%03%7F%00%00%03~%00%00%00%00%00%00"; diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/data/georges_editor_default.cfg b/code/ryzom/tools/leveldesign/georges_editor_qt/data/georges_editor_default.cfg new file mode 100644 index 000000000..93343bce4 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/data/georges_editor_default.cfg @@ -0,0 +1,113 @@ +////////////////////////////////////////////////////////////////////////////// +// Config file for Georges Editor Qt //////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +// +// This file is used to setup the georges editor tool. +// + + +////////////////////////////////////////////////////////////////////////////// +// NeL Qt //////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +// Root directory where we can find the client datas (zones, tiles, maps, ...) +// You must uncomment this line on GNU/Linux and comment the next one +//SearchPaths = { "/usr/local/share/games/nel_qt/" }; +SearchPaths = { "data" }; +LeveldesignPath = ""; + +// Which extensions to remap to what if needed (pairs of 2) +RemapExtensions = { "png", "tga" }; + +// The language code of the client +LanguageCode = "en"; + +// If changes to the config should be saved on exit +SaveConfig = 1; + + +////////////////////////////////////////////////////////////////////////////// +// Qt //////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +QtStyle = "Cleanlooks"; +QtPalette = 0; +QtWindowState = ""; +QtWindowGeometry = ""; + +////////////////////////////////////////////////////////////////////////////// +// Graphics ////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +// Use OpenGL or Direct3D (Windows) +GraphicsEnabled = 1; +GraphicsDrivers = { "OpenGL", "Direct3D" }; +GraphicsDriver = "OpenGL"; + +// Font name used for all text in the client (it can be a .ttf, .fon, .pfb) +FontName = "andbasr.ttf"; +FontShadow = 1; + +// Background color +BackgroundColor = { 151, 156, 182 }; + +SunDirection = { -2.935, +0.107, -1.22 }; +SunAmbient = { 190, 170, 150 }; +SunDiffuse = { 255, 248, 255 }; +SunSpecular = { 255, 255, 255}; + +////////////////////////////////////////////////////////////////////////////// +// Time ////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +FpsSmoothing = 64; + +////////////////////////////////////////////////////////////////////////////// +// Interface ///////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +// This setting is used to bind keys to actions. +// "key_handler", "args", "***", "Key1|Key2", +// *** -> CTRL, SHIFT, ALT don't matter +// --- -> CTRL, SHIFT, ALT must all be disabled +// -+- -> only SHIFT must be down +KeySettings = { + "screenshot", "", "***", "KeyF5", + "command", "set_state Exit", "-+-", "KeyESCAPE", + "command", "set_state Login", "+--", "KeyESCAPE", + "command", "set_state Unload", "***", "KeyF8", + "command", "set_state Demo", "***", "KeyF7", + "move_forward", "", "***", "KeyUP|KeyZ|KeyW", + "move_backward", "", "***", "KeyDOWN|KeyS", + "move_left", "", "***", "KeyLEFT|KeyQ|KeyA", + "move_right", "", "***", "KeyRIGHT|KeyD", + "move_forward", "", "***", "KeyZ|KeyW", + "move_backward", "", "***", "KeyS", + "move_left", "", "***", "KeyQ|KeyA", + "move_right", "", "***", "KeyD", + "chat_begin", "", "***", "KeyT", + "chat_send", "", "***", "KeyENTER", + "chat_leave", "", "***", "KeyESCAPE", + "display_test", "", "***", "KeyTAB", + "send_action", "0", "---", "Key1", + "send_action", "1", "---", "Key2", + "send_action", "2", "---", "Key3", + "send_action", "3", "---", "Key4", + "send_action", "4", "---", "Key5", + "send_action", "5", "---", "Key6", + "send_action", "6", "---", "Key7", + "send_action", "7", "---", "Key8", + "send_action", "8", "---", "Key9", + "send_action", "9", "---", "Key0", + "demo_crystal_spawn", "", "---", "KeyO", + "demo_crystal_explode", "", "---", "KeyP", + "free_camera_forward", "", "---", "KeyNUMPAD8", + "free_camera_backward", "", "---", "KeyNUMPAD2", + "free_camera_left", "", "---", "KeyNUMPAD4", + "free_camera_right", "", "---", "KeyNUMPAD6", + "switch_camera", "", "---", "KeyF4", + "switch_ui_visible" ,"", "---", "KeyF6", +}; + +// end of file diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/CMakeLists.txt b/code/ryzom/tools/leveldesign/georges_editor_qt/src/CMakeLists.txt new file mode 100644 index 000000000..9c4f37aaf --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/CMakeLists.txt @@ -0,0 +1,35 @@ +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${LIBXML2_INCLUDE_DIR} ${NEL_INCLUDE_DIR} ${QT_INCLUDES}) +INCLUDE( ${QT_USE_FILE} ) + +FILE(GLOB GEORGES_EDITOR_SRC *.cpp) +SET(GEORGES_EDITOR_HDR georges_dirtree_dialog.h georges_treeview_dialog.h georgesform_model.h main_window.h + log_dialog.h objectviewer_dialog.h settings_dialog.h) +SET(GEORGES_EDITOR_UIS settings_form.ui objectviewer_form.ui log_form.ui georges_treeview_form.ui georges_dirtree_form.ui) +SET(GEORGES_EDITOR_RCS georges_editor_qt.qrc) + +SET(QT_USE_QTGUI TRUE) +SET(QT_USE_QTOPENGL TRUE) + +QT4_ADD_RESOURCES( GEORGES_EDITOR_RC_SRCS ${GEORGES_EDITOR_RCS} ) +QT4_WRAP_CPP( GEORGES_EDITOR_MOC_SRCS ${GEORGES_EDITOR_HDR} ) +QT4_WRAP_UI( GEORGES_EDITOR_UI_HDRS ${GEORGES_EDITOR_UIS} ) + +ADD_EXECUTABLE(georges_editor_qt WIN32 ${GEORGES_EDITOR_SRC} ${GEORGES_EDITOR_MOC_SRCS} ${GEORGES_EDITOR_RC_SRCS} ${GEORGES_EDITOR_UI_HDRS}) + +TARGET_LINK_LIBRARIES(georges_editor_qt + nelmisc + nel3d + nelgeorges + ${QT_LIBRARIES} + ${QT_QTOPENGL_LIBRARY} + ${QT_QTMAIN_LIBRARY}) + +ADD_DEFINITIONS(-DQT_NO_KEYWORDS ${LIBXML2_DEFINITIONS} ${QT_DEFINITIONS}) +NL_DEFAULT_PROPS(georges_editor_qt "Ryzom, Tools, World: Georges Editor Qt") +NL_ADD_RUNTIME_FLAGS(georges_editor_qt) + +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(georges_editor_qt ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) +ENDIF(WITH_PCH) + +INSTALL(TARGETS georges_editor_qt RUNTIME DESTINATION bin COMPONENT runtime) diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/callback.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/callback.cpp new file mode 100644 index 000000000..c09c6e357 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/callback.cpp @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2010 by authors + * + * This file is part of NEL QT. + * NEL QT is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * NEL QT is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with NEL QT; see the file COPYING. If not, see + * . + */ + +#include +#include "callback.h" + +namespace NLQT { + +} /* namespace NLQT */ + +/* end of file */ diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/callback.h b/code/ryzom/tools/leveldesign/georges_editor_qt/src/callback.h new file mode 100644 index 000000000..eba33d564 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/callback.h @@ -0,0 +1,320 @@ +/* + * Copyright (C) 2010 by authors + * + * This file is part of NEL QT. + * NEL QT is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * NEL QT is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with NEL QT; see the file COPYING. If not, see + * . + */ + +#ifndef NLQT_CALLBACK_H +#define NLQT_CALLBACK_H +#include + +// STL includes + +// NeL includes +#include + +// Project includes + +namespace NLQT { + +#define NLQT_CALLBACK_TEMPLATE \ +/** \ + * \brief NLQT_CALLBACK_ARGS_CLASS \ + * \date 2009-03-03 18:09GMT \ + * \author Jan Boon (Kaetemi) \ + * Awesome callback template \ + */ \ +template \ +class NLQT_CALLBACK_ARGS_CLASS \ +{ \ + /* Very simple reference counting callback base */ \ + class CCallbackBase \ + { \ + public: \ + CCallbackBase() : m_RefCount(0) \ + { \ + \ + } \ + \ + virtual ~CCallbackBase() \ + { \ + nlassert(!m_RefCount); \ + } \ + \ + void refAdd() \ + { \ + ++m_RefCount; \ + } \ + \ + void refRemove() \ + { \ + --m_RefCount; \ + if (!m_RefCount) \ + delete this; \ + } \ + \ + virtual TReturn callback(NLQT_CALLBACK_ARGS_DECL) = 0; \ + \ + virtual bool equals(const CCallbackBase *callbackBase) = 0; \ + \ + /* disable copy */ \ + CCallbackBase(const CCallbackBase &); \ + CCallbackBase &operator=(const CCallbackBase &); \ + \ + private: \ + uint m_RefCount; \ + }; \ + \ + typedef TReturn TCallbackFunction(NLQT_CALLBACK_ARGS_DECL); \ + class CCallbackFunction : public CCallbackBase \ + { \ + public: \ + CCallbackFunction(TCallbackFunction *callbackFunction) : m_CallbackFunction(callbackFunction) \ + { \ + nlassert(m_CallbackFunction); \ + } \ + \ + virtual ~CCallbackFunction() \ + { \ + m_CallbackFunction = NULL; \ + } \ + \ + virtual TReturn callback(NLQT_CALLBACK_ARGS_DECL) \ + { \ + return m_CallbackFunction(NLQT_CALLBACK_ARGS_IMPL); \ + } \ + \ + virtual bool equals(const CCallbackBase *callbackBase) \ + { \ + const CCallbackFunction *callbackFunction = \ + dynamic_cast(callbackBase); \ + if (!callbackFunction) return false; \ + return m_CallbackFunction == callbackFunction->m_CallbackFunction; \ + } \ + \ + private: \ + TCallbackFunction *m_CallbackFunction; \ + }; \ + \ + template \ + class CCallbackMethod : public CCallbackBase \ + { \ + typedef TReturn (TClass::*TCallbackMethod)(NLQT_CALLBACK_ARGS_DECL); \ + public: \ + CCallbackMethod(TClass *callbackObject, TCallbackMethod callbackMethod) : m_CallbackObject(callbackObject), m_CallbackMethod(callbackMethod) \ + { \ + nlassert(m_CallbackObject); \ + nlassert(m_CallbackMethod); \ + } \ + \ + virtual ~CCallbackMethod() \ + { \ + m_CallbackObject = NULL; \ + m_CallbackMethod = NULL; \ + } \ + \ + virtual TReturn callback(NLQT_CALLBACK_ARGS_DECL) \ + { \ + return (m_CallbackObject->*m_CallbackMethod)(NLQT_CALLBACK_ARGS_IMPL); \ + } \ + \ + virtual bool equals(const CCallbackBase *callbackBase) \ + { \ + const CCallbackMethod *callbackMethod = \ + dynamic_cast(callbackBase); \ + if (!callbackMethod) return false; \ + return m_CallbackObject == callbackMethod->m_CallbackObject \ + && m_CallbackMethod == callbackMethod->m_CallbackMethod; \ + } \ + \ + private: \ + TClass *m_CallbackObject; \ + TCallbackMethod m_CallbackMethod; \ + }; \ + \ +public: \ + CCallback() : m_CallbackBase(NULL) \ + { \ + \ + } \ + \ + CCallback(TCallbackFunction *callbackFunction) : m_CallbackBase(new CCallbackFunction(callbackFunction)) \ + { \ + nlassert(m_CallbackBase); \ + m_CallbackBase->refAdd(); \ + } \ + \ + template \ + CCallback(TClass *callbackObject, TReturn (TClass::*callbackMethod)(NLQT_CALLBACK_ARGS_DECL)) : m_CallbackBase(new CCallbackMethod(callbackObject, callbackMethod)) \ + { \ + nlassert(m_CallbackBase); \ + m_CallbackBase->refAdd(); \ + } \ + \ + CCallback(const CCallback &callback) \ + { \ + m_CallbackBase = callback.m_CallbackBase; \ + if (m_CallbackBase) \ + m_CallbackBase->refAdd(); \ + } \ + \ + CCallback &operator=(const CCallback &callback) \ + { \ + if (m_CallbackBase != callback.m_CallbackBase) \ + { \ + if (m_CallbackBase) \ + m_CallbackBase->refRemove(); \ + m_CallbackBase = callback.m_CallbackBase; \ + if (m_CallbackBase) \ + m_CallbackBase->refAdd(); \ + } \ + return *this; \ + } \ + \ + ~CCallback() \ + { \ + if (m_CallbackBase) \ + { \ + m_CallbackBase->refRemove(); \ + m_CallbackBase = NULL; \ + } \ + } \ + \ + TReturn callback(NLQT_CALLBACK_ARGS_DECL) \ + { \ + nlassert(m_CallbackBase); \ + return m_CallbackBase->callback(NLQT_CALLBACK_ARGS_IMPL); \ + } \ + \ + TReturn operator()(NLQT_CALLBACK_ARGS_DECL) \ + { \ + nlassert(m_CallbackBase); \ + return m_CallbackBase->callback(NLQT_CALLBACK_ARGS_IMPL); \ + } \ + \ + bool valid() const \ + { \ + return m_CallbackBase != NULL; \ + } \ + \ + operator bool() const \ + { \ + return m_CallbackBase != NULL; \ + } \ + \ + bool operator==(const CCallback &callback) \ + { \ + return m_CallbackBase->equals(callback.m_CallbackBase); \ + } \ + \ +private: \ + CCallbackBase *m_CallbackBase; \ + \ +}; /* class CCallback */ \ + +template +class CCallback; + +#define NLQT_CALLBACK_ARGS_CLASS CCallback +#define NLQT_CALLBACK_ARGS_TYPENAME +#define NLQT_CALLBACK_ARGS_DECL +#define NLQT_CALLBACK_ARGS_IMPL +NLQT_CALLBACK_TEMPLATE +#undef NLQT_CALLBACK_ARGS_CLASS +#undef NLQT_CALLBACK_ARGS_TYPENAME +#undef NLQT_CALLBACK_ARGS_DECL +#undef NLQT_CALLBACK_ARGS_IMPL + +#define NLQT_CALLBACK_ARGS_CLASS CCallback +#define NLQT_CALLBACK_ARGS_TYPENAME , typename TArgsA +#define NLQT_CALLBACK_ARGS_DECL TArgsA argsA +#define NLQT_CALLBACK_ARGS_IMPL argsA +NLQT_CALLBACK_TEMPLATE +#undef NLQT_CALLBACK_ARGS_CLASS +#undef NLQT_CALLBACK_ARGS_TYPENAME +#undef NLQT_CALLBACK_ARGS_DECL +#undef NLQT_CALLBACK_ARGS_IMPL + +#define NLQT_CALLBACK_ARGS_CLASS CCallback +#define NLQT_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB +#define NLQT_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB +#define NLQT_CALLBACK_ARGS_IMPL argsA, argsB +NLQT_CALLBACK_TEMPLATE +#undef NLQT_CALLBACK_ARGS_CLASS +#undef NLQT_CALLBACK_ARGS_TYPENAME +#undef NLQT_CALLBACK_ARGS_DECL +#undef NLQT_CALLBACK_ARGS_IMPL + +#define NLQT_CALLBACK_ARGS_CLASS CCallback +#define NLQT_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB, typename TArgsC +#define NLQT_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB, TArgsC argsC +#define NLQT_CALLBACK_ARGS_IMPL argsA, argsB, argsC +NLQT_CALLBACK_TEMPLATE +#undef NLQT_CALLBACK_ARGS_CLASS +#undef NLQT_CALLBACK_ARGS_TYPENAME +#undef NLQT_CALLBACK_ARGS_DECL +#undef NLQT_CALLBACK_ARGS_IMPL + +#define NLQT_CALLBACK_ARGS_CLASS CCallback +#define NLQT_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB, typename TArgsC, typename TArgsD +#define NLQT_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB, TArgsC argsC, TArgsD argsD +#define NLQT_CALLBACK_ARGS_IMPL argsA, argsB, argsC, argsD +NLQT_CALLBACK_TEMPLATE +#undef NLQT_CALLBACK_ARGS_CLASS +#undef NLQT_CALLBACK_ARGS_TYPENAME +#undef NLQT_CALLBACK_ARGS_DECL +#undef NLQT_CALLBACK_ARGS_IMPL + +#define NLQT_CALLBACK_ARGS_CLASS CCallback +#define NLQT_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB, typename TArgsC, typename TArgsD, typename TArgsE +#define NLQT_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB, TArgsC argsC, TArgsD argsD, TArgsE argsE +#define NLQT_CALLBACK_ARGS_IMPL argsA, argsB, argsC, argsD, argsE +NLQT_CALLBACK_TEMPLATE +#undef NLQT_CALLBACK_ARGS_CLASS +#undef NLQT_CALLBACK_ARGS_TYPENAME +#undef NLQT_CALLBACK_ARGS_DECL +#undef NLQT_CALLBACK_ARGS_IMPL + +#define NLQT_CALLBACK_ARGS_CLASS CCallback +#define NLQT_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB, typename TArgsC, typename TArgsD, typename TArgsE, typename TArgsF +#define NLQT_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB, TArgsC argsC, TArgsD argsD, TArgsE argsE, TArgsF argsF +#define NLQT_CALLBACK_ARGS_IMPL argsA, argsB, argsC, argsD, argsE, argsF +NLQT_CALLBACK_TEMPLATE +#undef NLQT_CALLBACK_ARGS_CLASS +#undef NLQT_CALLBACK_ARGS_TYPENAME +#undef NLQT_CALLBACK_ARGS_DECL +#undef NLQT_CALLBACK_ARGS_IMPL + +#define NLQT_CALLBACK_ARGS_CLASS CCallback +#define NLQT_CALLBACK_ARGS_TYPENAME , typename TArgsA, typename TArgsB, typename TArgsC, typename TArgsD, typename TArgsE, typename TArgsF, typename TArgsG +#define NLQT_CALLBACK_ARGS_DECL TArgsA argsA, TArgsB argsB, TArgsC argsC, TArgsD argsD, TArgsE argsE, TArgsF argsF, TArgsG argsG +#define NLQT_CALLBACK_ARGS_IMPL argsA, argsB, argsC, argsD, argsE, argsF, argsG +NLQT_CALLBACK_TEMPLATE +#undef NLQT_CALLBACK_ARGS_CLASS +#undef NLQT_CALLBACK_ARGS_TYPENAME +#undef NLQT_CALLBACK_ARGS_DECL +#undef NLQT_CALLBACK_ARGS_IMPL +#undef NLQT_CALLBACK_ARGS_CLASSNAME + +#undef NLQT_CALLBACK_TEMPLATE + +typedef CCallback CEmptyCallback; + +} /* namespace NLQT */ + +#endif /* #ifndef NLQT_CALLBACK_H */ + +/* end of file */ diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/configuration.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/configuration.cpp new file mode 100644 index 000000000..2276dcd93 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/configuration.cpp @@ -0,0 +1,242 @@ +/* + Georges Editor Qt + Copyright (C) 2010 Adrian Jaekel + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +*/ + +#include "configuration.h" + +// STL includes + +// Qt includes +#include + +// NeL includes +#include +#include +#include +#include + +#include "modules.h" + +#include + +using namespace std; +using namespace NLMISC; + +namespace NLQT { + +CConfiguration::CConfiguration() +{ + +} + +CConfiguration::~CConfiguration() +{ + +} + +void CConfiguration::init() +{ + // verify data + nlassert(!ConfigCallbacks.size()); + + // load config + QFile file(NLQT_CONFIG_FILE); + if (!file.exists()) { + file.open( QIODevice::WriteOnly | QIODevice::Text ); + file.write("GraphicsDrivers = { \"OpenGL\", \"Direct3D\" };"); + file.write("\nSearchPaths = {\"\"};"); + file.write("\nRemapExtensions = { \"png\", \"tga\" };"); + file.write("\nBackgroundColor = { 0, 0, 0 };"); + file.write("\nQtStyle = \"\";"); + file.write("\nQtPalette = \"\";"); + file.close(); + } + + try { + ConfigFile.load(NLQT_CONFIG_FILE); + } catch(...) { + } + + // setup config file callback + Modules::config().setCallback("SearchPaths", CConfigCallback(this, &CConfiguration::cfcbSearchPaths)); + +} + +void CConfiguration::release() +{ + Modules::config().dropCallback("SearchPaths"); + + // save and release the config file + if (ConfigFile.exists("SaveConfig") && ConfigFile.getVarPtr("SaveConfig")->asBool()) + { + ConfigFile.save(); + } + ConfigFile.clear(); + + // release the search paths etc + CPath::releaseInstance(); + + // verify data + nlassert(!ConfigCallbacks.size()); +} + +void CConfiguration::updateUtilities() +{ + //H_AUTO2 + CConfigFile::checkConfigFiles(); +} + +void CConfiguration::configSearchPaths() +{ + cfcbSearchPaths(Modules::config().getConfigFile().getVar("SearchPaths")); +} + +std::string CConfiguration::configLeveldesignPath() +{ + std::string path = Modules::config().getValue("LeveldesignPath", QString("").toStdString()); + cfcbSearchPaths(Modules::config().getConfigFile().getVar("LeveldesignPath")); + + return path; +} + +void CConfiguration::configRemapExtensions() +{ + CConfigFile::CVar *var; + var = ConfigFile.getVarPtr("RemapExtensions"); + uint varsize = var->size(); + for (uint i = 0; i < varsize; i += 2) + CPath::remapExtension(var->asString(i), var->asString(i + 1), true); +} + +void CConfiguration::setAndCallback(const std::string &varName, CConfigCallback configCallback) +{ + ConfigCallbacks[varName] = configCallback; + ConfigFile.setCallback(varName, cbConfigCallback); + configCallback(*ConfigFile.getVarPtr(varName)); +} + +void CConfiguration::setCallback(const std::string &varName, CConfigCallback configCallback) +{ + ConfigCallbacks[varName] = configCallback; + ConfigFile.setCallback(varName, cbConfigCallback); +} + +void CConfiguration::dropCallback(const std::string &varName) +{ + ConfigFile.setCallback(varName, NULL); + ConfigCallbacks.erase(varName); +} + +float CConfiguration::getValue(const string &varName, float defaultValue) +{ + if (ConfigFile.exists(varName)) return ConfigFile.getVar(varName).asFloat(); + CConfigFile::CVar varToCopy; + varToCopy.forceAsDouble((double)defaultValue); + ConfigFile.insertVar(varName, varToCopy); + return defaultValue; +} + +double CConfiguration::getValue(const string &varName, double defaultValue) +{ + if (ConfigFile.exists(varName)) return ConfigFile.getVar(varName).asDouble(); + CConfigFile::CVar varToCopy; + varToCopy.forceAsDouble(defaultValue); + ConfigFile.insertVar(varName, varToCopy); + return defaultValue; +} + +int CConfiguration::getValue(const string &varName, int defaultValue) +{ + if (ConfigFile.exists(varName)) return ConfigFile.getVar(varName).asInt(); + CConfigFile::CVar varToCopy; + varToCopy.forceAsInt(defaultValue); + ConfigFile.insertVar(varName, varToCopy); + return defaultValue; +} + +string CConfiguration::getValue(const string &varName, const string &defaultValue) +{ + if (ConfigFile.exists(varName)) return ConfigFile.getVar(varName).asString(); + CConfigFile::CVar varToCopy; + varToCopy.forceAsString(defaultValue); + ConfigFile.insertVar(varName, varToCopy); + return defaultValue; +} + +ucstring CConfiguration::getValue(const string &varName, const ucstring &defaultValue) +{ + if (ConfigFile.exists(varName)) return ucstring::makeFromUtf8(ConfigFile.getVar(varName).asString()); + CConfigFile::CVar varToCopy; + varToCopy.forceAsString(defaultValue.toUtf8()); + ConfigFile.insertVar(varName, varToCopy); + return defaultValue; +} + +bool CConfiguration::getValue(const string &varName, bool defaultValue) +{ + if (ConfigFile.exists(varName)) return ConfigFile.getVar(varName).asBool(); + CConfigFile::CVar varToCopy; + varToCopy.forceAsInt(defaultValue ? 1 : 0); + ConfigFile.insertVar(varName, varToCopy); + return defaultValue; +} + +CRGBA CConfiguration::getValue(const string &varName, const CRGBA &defaultValue) +{ + if (ConfigFile.exists(varName)) + { + return getValue(ConfigFile.getVar(varName), defaultValue); + } + else + { + // create a new value only if one doesn't exist + CConfigFile::CVar varToCopy; + varToCopy.forceAsInt(defaultValue.R); + varToCopy.setAsInt(defaultValue.G, 1); + varToCopy.setAsInt(defaultValue.B, 2); + varToCopy.setAsInt(defaultValue.A, 3); + ConfigFile.insertVar(varName, varToCopy); + } + return defaultValue; +} + +CRGBA CConfiguration::getValue(const CConfigFile::CVar &var, const CRGBA &defaultValue) +{ + if (var.size() >= 3) + { + if (var.size() > 4) nlwarning("RGBA value in config value '%s' is too long, ignoring unused values"); + return CRGBA((uint8)var.asInt(0), (uint8)var.asInt(1), (uint8)var.asInt(2), var.size() >= 4 ? (uint8)var.asInt(3) : 255); + } + nlwarning("Invalid RGBA value in config value '%s', reverting to default { %i, %i, %i, %i }", var.Name.c_str(), (sint)defaultValue.R, (sint)defaultValue.G, (sint)defaultValue.B, (sint)defaultValue.A); + return defaultValue; +} + +void CConfiguration::cbConfigCallback(NLMISC::CConfigFile::CVar &var) +{ + Modules::config().ConfigCallbacks[var.Name](var); +} + +void CConfiguration::cfcbSearchPaths(NLMISC::CConfigFile::CVar &var) +{ + uint varsize = var.size(); + //CPath::clearMap(); + for (uint i = 0; i < varsize; ++i) + CPath::addSearchPath(var.asString(i), true, false); +} + +} /* namespace NLQT */ \ No newline at end of file diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/configuration.h b/code/ryzom/tools/leveldesign/georges_editor_qt/src/configuration.h new file mode 100644 index 000000000..5acedd7a5 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/configuration.h @@ -0,0 +1,92 @@ +/* + Georges Editor Qt + Copyright (C) 2010 Adrian Jaekel + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +*/ + +#ifndef CONFIGURATION_H +#define CONFIGURATION_H + +#include + +// STL includes +#include + +// NeL includes +#include +#include +#include + +// Project includes +#include "callback.h" + +#define NLQT_CONFIG_FILE "georges_editor.cfg" + +namespace NLQT { + +typedef CCallback CConfigCallback; + +/** + * CConfiguration + * \brief CConfiguration + * \date 2010-02-05 15:44GMT + * \author Jan Boon (Kaetemi) + */ +class CConfiguration +{ +public: + CConfiguration(); + virtual ~CConfiguration(); + + void init(); + void release(); + + void updateUtilities(); + void configSearchPaths(); + std::string configLeveldesignPath(); + void configRemapExtensions(); + + void setAndCallback(const std::string &varName, CConfigCallback configCallback); + void setCallback(const std::string &varName, CConfigCallback configCallback); + void dropCallback(const std::string &varName); + + float getValue(const std::string &varName, float defaultValue); + double getValue(const std::string &varName, double defaultValue); + int getValue(const std::string &varName, int defaultValue); + std::string getValue(const std::string &varName, const std::string &defaultValue); + ucstring getValue(const std::string &varName, const ucstring &defaultValue); + bool getValue(const std::string &varName, bool defaultValue); + NLMISC::CRGBA getValue(const std::string &varName, const NLMISC::CRGBA &defaultValue); + NLMISC::CRGBA getValue(const NLMISC::CConfigFile::CVar &var, const NLMISC::CRGBA &defaultValue); + + inline NLMISC::CConfigFile &getConfigFile() { return ConfigFile; } + +private: + static void cbConfigCallback(NLMISC::CConfigFile::CVar &var); + + void cfcbSearchPaths(NLMISC::CConfigFile::CVar &var); + + CConfiguration(const CConfiguration &); + CConfiguration &operator=(const CConfiguration &); + + NLMISC::CConfigFile ConfigFile; + std::map ConfigCallbacks; + +};/* class CConfiguration */ + +} /* namespace NLQT */ + +#endif // CONFIGURATION_H diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/entity.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/entity.cpp new file mode 100644 index 000000000..878b8e730 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/entity.cpp @@ -0,0 +1,269 @@ +/* + Georges Editor Qt + Copyright (C) 2010 Adrian Jaekel + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "entity.h" + +// NeL includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Project includes +#include "modules.h" + +using namespace NLMISC; +using namespace NL3D; + +namespace NLQT { + +CSlotInfo& CSlotInfo::operator=(const CSlotInfo & slotInfo) +{ + if ( this != &slotInfo) + { + Animation = slotInfo.Animation; + ClampMode = slotInfo.ClampMode; + Enable = slotInfo.Enable; + EndBlend = slotInfo.EndBlend; + EndTime = slotInfo.EndTime; + Offset = slotInfo.Offset; + Skeleton = slotInfo.Skeleton; + SkeletonInverted = slotInfo.SkeletonInverted; + Smoothness = slotInfo.Smoothness; + SpeedFactor = slotInfo.SpeedFactor; + StartBlend = slotInfo.StartBlend; + StartTime = slotInfo.StartTime; + } + return *this; +} + +CEntity::CEntity(void): + _Name(""), + _Instance(NULL), _Skeleton(NULL), + _PlayList(NULL), _AnimationSet(NULL) +{ +} + +CEntity::~CEntity(void) +{ +} + +void CEntity::loadAnimation(std::string &fileName) +{ + uint id = _AnimationSet->addAnimation(fileName.c_str(),CFile::getFilenameWithoutExtension(fileName).c_str()); + _AnimationList.push_back(_AnimationSet->getAnimationName(id)); + _AnimationSet->build(); + if (!_Skeleton.empty()) _PlayList->registerTransform(_Skeleton); + else _PlayList->registerTransform(_Instance); +} + +void CEntity::loadSWT(std::string &fileName) +{ + uint id = _AnimationSet->addSkeletonWeight(fileName.c_str(),CFile::getFilenameWithoutExtension(fileName).c_str()); + _SWTList.push_back(_AnimationSet->getSkeletonWeightName(id)); +} + +void CEntity::addAnimToPlayList(std::string &name) +{ + _PlayListAnimation.push_back(name); + + _AnimationStatus.EndAnim = this->getPlayListLength(); +} + +void CEntity::removeAnimToPlayList(uint row) +{ + if (row < _PlayListAnimation.size()) + _PlayListAnimation.erase(_PlayListAnimation.begin() + row); + + _AnimationStatus.EndAnim = this->getPlayListLength(); +} + +void CEntity::swapAnimToPlayList(uint row1, uint row2) +{ + if ((row1 < _PlayListAnimation.size()) && (row2 < _PlayListAnimation.size())) + std::swap(_PlayListAnimation[row1], _PlayListAnimation[row2]); +} + +void CEntity::playbackAnim(bool play) +{ + _AnimationStatus.PlayAnim = play; +} + +void CEntity::reset() +{ + _PlayListAnimation.clear(); + _AnimationList.clear(); + _SWTList.clear(); + + _PlayList->resetAllChannels(); +} + +float CEntity::getPlayListLength() +{ + // Accumul all the time + float time = 0; + for(size_t i = 0; i < _PlayListAnimation.size(); ++i) + time += getAnimLength(_PlayListAnimation[i]); + return time; +} + +float CEntity::getAnimLength(std::string name) +{ + uint id = _AnimationSet->getAnimationIdByName(name.c_str()); + NL3D::UAnimation *anim = _AnimationSet->getAnimation(id); + return anim->getEndTime() - anim->getBeginTime(); +} + +void CEntity::update(NL3D::TAnimationTime time) +{ + this->resetChannel(); + switch (_AnimationStatus.Mode) + { + case Mode::PlayList: + animatePlayList(time); + break; + case Mode::Mixer: + animateChannelMixer(); + break; + } +} + + +void CEntity::resetChannel() +{ + for(size_t i = 0; i < NL3D::CChannelMixer::NumAnimationSlot; i++) + _PlayList->setAnimation(i, UPlayList::empty); +} + +void CEntity::animatePlayList(NL3D::TAnimationTime time) +{ + if (!_PlayListAnimation.empty()) + { + // Animation index + uint id = _AnimationSet->getAnimationIdByName(_PlayListAnimation[0].c_str()); + + // Try channel AnimationSet + NL3D::UAnimation *anim = _AnimationSet->getAnimation(id); + + // Accumul time + float startTime = 0; + float endTime = anim->getEndTime() - anim->getBeginTime(); + + uint index = 0; + while (time >= endTime) + { + index++; + if (index < _PlayListAnimation.size()) + { + id = _AnimationSet->getAnimationIdByName(_PlayListAnimation[index].c_str()); + anim = _AnimationSet->getAnimation(id); + + // Add start time + startTime = endTime; + endTime = startTime + (anim->getEndTime() - anim->getBeginTime()); + } + else + break; + } + + // Time cropped ? + if (index >= _PlayListAnimation.size()) + { + // Yes + index--; + id = _AnimationSet->getAnimationIdByName(_PlayListAnimation[index].c_str()); + anim = _AnimationSet->getAnimation(id); + + // End time for last anim + startTime = anim->getEndTime() - time; + } + else + { + // No + id = _AnimationSet->getAnimationIdByName(_PlayListAnimation[index].c_str()); + anim = _AnimationSet->getAnimation(id); + + // Final time + startTime -= anim->getBeginTime(); + } + + // Set the slot + _PlayList->setAnimation(0, id); + _PlayList->setTimeOrigin(0, startTime); + _PlayList->setWeightSmoothness(0, 1.0f); + _PlayList->setStartWeight(0, 1, 0); + _PlayList->setEndWeight(0, 1, 1); + _PlayList->setWrapMode(0, UPlayList::Clamp); + } +} + +void CEntity::animateChannelMixer() +{ + for (uint i = 0; i < NL3D::CChannelMixer::NumAnimationSlot; i++) + { + if (_SlotInfo[i].Enable) + { + // Set the animation + uint animId = _AnimationSet->getAnimationIdByName(_SlotInfo[i].Animation); + if (animId == UAnimationSet::NotFound) + _PlayList->setAnimation(i, UPlayList::empty); + else + _PlayList->setAnimation(i, animId); + + // Set the skeleton weight + uint skelId = _AnimationSet->getSkeletonWeightIdByName(_SlotInfo[i].Skeleton); + if (skelId == UAnimationSet::NotFound) + _PlayList->setSkeletonWeight(i, UPlayList::empty, false); + else + _PlayList->setSkeletonWeight(i, skelId, _SlotInfo[i].SkeletonInverted); + + // Set others values + _PlayList->setTimeOrigin(i, _SlotInfo[i].Offset); + _PlayList->setSpeedFactor(i, _SlotInfo[i].SpeedFactor); + _PlayList->setStartWeight(i, _SlotInfo[i].StartBlend, _SlotInfo[i].StartTime); + _PlayList->setEndWeight(i, _SlotInfo[i].EndBlend, _SlotInfo[i].EndTime); + _PlayList->setWeightSmoothness(i, _SlotInfo[i].Smoothness); + + // Switch between wrap modes + switch (_SlotInfo[i].ClampMode) + { + case 0: + _PlayList->setWrapMode (i, UPlayList::Clamp); + break; + case 1: + _PlayList->setWrapMode (i, UPlayList::Repeat); + break; + case 2: + _PlayList->setWrapMode (i, UPlayList::Disable); + break; + } + } + } +} + +} /* namespace NLQT */ diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/entity.h b/code/ryzom/tools/leveldesign/georges_editor_qt/src/entity.h new file mode 100644 index 000000000..9ad938ec8 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/entity.h @@ -0,0 +1,217 @@ +/* + Georges Editor Qt + Copyright (C) 2010 Adrian Jaekel + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef ENTITY_H +#define ENTITY_H + +// STL includes +#include +#include +#include + +// NeL includes +#include "nel/3d/animation_time.h" +#include +#include +#include "nel/3d/channel_mixer.h" + +namespace NL3D { + class UPlayList; + class UAnimationSet; +} + +namespace NLQT { + +class CSlotInfo +{ +public: + CSlotInfo (): + Animation("empty"), Skeleton("empty"), + Offset(0), StartTime(0), EndTime(0), + StartBlend(1), EndBlend (1), Smoothness(1), + SpeedFactor(1), ClampMode(0), + SkeletonInverted(false), + Enable(true) {} ; + + std::string Animation; + std::string Skeleton; + float Offset; + float StartTime; + float EndTime; + + float StartBlend; + float EndBlend; + float Smoothness; + float SpeedFactor; + sint32 ClampMode; + bool SkeletonInverted; + bool Enable; + + CSlotInfo &operator=(const CSlotInfo &); +}; + + +/** +@class CEntity +Animated object. Allows you to upload animations for the shape. +Contains a built-in playlist. Has management and playback Playlists or Mixer. +*/ +class CEntity +{ +public: + struct Mode + { + enum List + { + PlayList = 1, + Mixer + }; + }; + + // will need for a single or multiple reproduction + struct SAnimationStatus + { + bool LoopAnim; + bool PlayAnim; + float CurrentTimeAnim; + float StartAnim; + float EndAnim; + float SpeedAnim; + int Mode; + + SAnimationStatus(): + LoopAnim(false), PlayAnim(false), + CurrentTimeAnim(0), StartAnim(0), + EndAnim(0), SpeedAnim(1), Mode(Mode::PlayList) {} + }; + + /// Constructor + CEntity(void); + + /// Destructor + ~CEntity(void); + + /// Loads a file animations + /// @param fileName - name animation file + void loadAnimation(std::string &fileName); + + /// Loads a file skeleton weight + void loadSWT(std::string &fileName); + + /// Adds an animation to a playlist + /// @param name - name loaded animations + void addAnimToPlayList(std::string &name); + + /// Removes the animation from a playlist + /// @param row - number of animations in the playlist + void removeAnimToPlayList(uint row); + + /// Swaps animations to a playlist + /// @param row1 - first number of animations in the playlist + /// @param row2 - second number of animations in the playlist + void swapAnimToPlayList(uint row1, uint row2); + + /// Playback animation + void playbackAnim(bool play); + + /// Reset playlist and animation + void reset(); + + /// Get the total time of animation playlist + /// @return total time of animation + float getPlayListLength(); + + /// get time length single animation + float getAnimLength(std::string name); + + /// Get slot infomation + void setSlotInfo(uint num, CSlotInfo& slotInfo) { _SlotInfo[num] = slotInfo; } + + /// Set use mode playlist or mixer + void setMode(int mode) { _AnimationStatus.Mode = mode; } + + /// Get information about the current status of playing a playlist + /// @return struct containing current information playback + SAnimationStatus& getStatus() { return _AnimationStatus; } + + /// Get name entity + /// @return name entity + std::string &getName() { return _Name; } + + /// Get slot information + CSlotInfo& getSlotInfo(uint num) { return _SlotInfo[num]; } + + /// Get list loaded animations files + std::vector& getAnimationList() { return _AnimationList; } + + /// Get playlist animations + std::vector& getPlayListAnimation() { return _PlayListAnimation; } + + /// Get list loaded skeleton weight template files + std::vector& getSWTList() { return _SWTList; } + +private: + + /// Update the animate from the playlist or channel mixer + /// @param time - current time in second + void update(NL3D::TAnimationTime time); + + void resetChannel(); + + /// Update the animate from the playlist + void animatePlayList(NL3D::TAnimationTime time); + + /// Update the animate from the mixer + void animateChannelMixer(); + + // The name of the entity + std::string _Name; + + SAnimationStatus _AnimationStatus; + + // The mesh instance associated to this entity + NL3D::UInstance _Instance; + + // The skeleton binded to the instance + NL3D::USkeleton _Skeleton; + + NL3D::UPlayList *_PlayList; + + NL3D::UAnimationSet *_AnimationSet; + + // Animation input file + std::vector _AnimationList; + + // Skeleton weight input file + std::vector _SWTList; + + // Play list animation + std::vector _PlayListAnimation; + + // Slot info for this object + CSlotInfo _SlotInfo[NL3D::CChannelMixer::NumAnimationSlot]; + + friend class CObjectViewer; +}; /* class CEntity */ + +typedef std::map CEntities; +typedef CEntities::iterator EIT; + +} /* namespace NLQT */ + +#endif // ENTITY_H diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/filesystem_model.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/filesystem_model.cpp new file mode 100644 index 000000000..3c52fcf78 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/filesystem_model.cpp @@ -0,0 +1,70 @@ +/* + Georges Editor Qt + Copyright (C) 2010 Adrian Jaekel + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "filesystem_model.h" + +#include +#include + +namespace NLQT { + + CFileSystemModel::CFileSystemModel(QString ldPath, QObject *parent) + : QFileSystemModel(parent), + _ldPath(ldPath){ + + } + CFileSystemModel::~CFileSystemModel() { + + } + + QVariant CFileSystemModel::data(const QModelIndex& index, int role) const { + + if (role == Qt::DecorationRole) { + if (_ldPath.isEmpty()) + return QVariant(); + if (isDir(index)) + return QApplication::style()->standardIcon(QStyle::SP_DirIcon); + } + if (_ldPath.isEmpty() && role == Qt::DisplayRole) { + if (index.parent().isValid()) + return QVariant(); + return QString("Set a correct leveldesign path ..."); + } + return QFileSystemModel::data(index, role); + } + + int CFileSystemModel::columnCount(const QModelIndex &/*parent*/) const + { + return 1; + } + + int CFileSystemModel::rowCount(const QModelIndex &parent) const + { + if (_ldPath.isEmpty()) { + if(parent.isValid()) { + return 0; + } else { + return qMin(QFileSystemModel::rowCount(parent),1); + } + } + return QFileSystemModel::rowCount(parent); + } + +} /* namespace NLQT */ + +/* end of file */ diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/filesystem_model.h b/code/ryzom/tools/leveldesign/georges_editor_qt/src/filesystem_model.h new file mode 100644 index 000000000..7e5ccdbd3 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/filesystem_model.h @@ -0,0 +1,43 @@ +/* + Georges Editor Qt + Copyright (C) 2010 Adrian Jaekel + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef FILESYSTEM_MODEL_H +#define FILESYSTEM_MODEL_H + +#include + +namespace NLQT { + + class CFileSystemModel : public QFileSystemModel + { + QString _ldPath; + + public: + CFileSystemModel(QString ldPath, QObject *parent = 0); + ~CFileSystemModel(); + + int columnCount(const QModelIndex &/*parent*/) const; + int rowCount(const QModelIndex &/*parent*/) const; + + QVariant data(const QModelIndex& index, int role) const ; + + };/* class CFileSystemModel */ + +} /* namespace NLQT */ + +#endif // FILESYSTEM_MODEL_H \ No newline at end of file diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/formitem.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/formitem.cpp new file mode 100644 index 000000000..aa2f4ce7c --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/formitem.cpp @@ -0,0 +1,103 @@ +/* +Georges Editor Qt +Copyright (C) 2010 Adrian Jaekel + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "formitem.h" + +// Qt includes + + +// NeL includes +#include + +namespace NLQT { + + CFormItem::CFormItem(NLGEORGES::UFormElm* elm, const QList &data, CFormItem *parent, + NLGEORGES::UFormElm::TWhereIsValue wV, NLGEORGES::UFormElm::TWhereIsNode wN) { + parentItem = parent; + itemData = data; + formElm = elm; + whereV = wV; + whereN = wN; + } + + CFormItem::~CFormItem() { + qDeleteAll(childItems); + } + + void CFormItem::appendChild(CFormItem *item) { + childItems.append(item); + } + + CFormItem *CFormItem::child(int row) { + return childItems.value(row); + } + + int CFormItem::childCount() const { + return childItems.count(); + } + + int CFormItem::columnCount() const { + return itemData.count(); + } + + QVariant CFormItem::data(int column) const { + return itemData.value(column); + } + + CFormItem *CFormItem::parent() + { + return parentItem; + } + + int CFormItem::row() const { + if (parentItem) + return parentItem->childItems.indexOf(const_cast(this)); + + return 0; + } + + bool CFormItem::setData(int column, const QVariant &value) { + if (column < 0 || column >= itemData.size()) + return false; + + itemData[column] = value; + if (formElm->isAtom()) { + const NLGEORGES::UType *type = formElm->getType(); + if (type) { + switch (type->getType()) { + case NLGEORGES::UType::UnsignedInt: + case NLGEORGES::UType::SignedInt: + case NLGEORGES::UType::Double: + case NLGEORGES::UType::String: + nldebug(QString("string %1 %2") + .arg(itemData[0].toString()).arg(value.toString()) + .toStdString().c_str()); + parentItem->formElm->setValueByName( + value.toString().toStdString().c_str(),itemData[0].toString().toStdString().c_str()); + break; + case NLGEORGES::UType::Color: + break; + default: + break; + } + } + } + //formElm->setValueByName(); + return true; + } +} diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/formitem.h b/code/ryzom/tools/leveldesign/georges_editor_qt/src/formitem.h new file mode 100644 index 000000000..c10d39c84 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/formitem.h @@ -0,0 +1,68 @@ +/* + Georges Editor Qt + Copyright (C) 2010 Adrian Jaekel + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef FORMITEM_H +#define FORMITEM_H + +// NeL includes +#include + +// Qt includes +#include +#include + +namespace NLQT { + + class CFormItem + + { + public: + CFormItem(NLGEORGES::UFormElm *elm, const QList &data, + CFormItem *parent = 0, + NLGEORGES::UFormElm::TWhereIsValue = NLGEORGES::UFormElm::ValueForm, + NLGEORGES::UFormElm::TWhereIsNode = NLGEORGES::UFormElm::NodeForm); + ~CFormItem(); + + void appendChild(CFormItem *child); + + CFormItem *child(int row); + int childCount() const; + int columnCount() const; + QVariant data(int column) const; + int row() const; + CFormItem *parent(); + bool setData(int column, const QVariant &value); + NLGEORGES::UFormElm* getFormElm() {return formElm;}; + NLGEORGES::UFormElm::TWhereIsValue CFormItem::valueFrom() { + return whereV; + } + NLGEORGES::UFormElm::TWhereIsNode CFormItem::nodeFrom() { + return whereN; + } + + private: + QList childItems; + QList itemData; + CFormItem *parentItem; + NLGEORGES::UFormElm* formElm; + NLGEORGES::UFormElm::TWhereIsValue whereV; + NLGEORGES::UFormElm::TWhereIsNode whereN; + }; // CFormItem + +} + #endif // FORMITEM_H \ No newline at end of file diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges.cpp new file mode 100644 index 000000000..aea247813 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges.cpp @@ -0,0 +1,46 @@ +/* +Georges Editor Qt +Copyright (C) 2010 Adrian Jaekel + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "georges.h" +#include "nel/misc/o_xml.h" + +// STL includes + +// NeL includes +#include +#include + +// Project includes + +using namespace NLGEORGES; + +namespace NLQT { + + CGeorges::CGeorges(): FormLoader(0) { + FormLoader = UFormLoader::createLoader(); + } + + CGeorges::~CGeorges() {} + + UForm *CGeorges::loadForm(std::string formName) { + UForm *form = FormLoader->loadForm(formName.c_str()); + + return form; + } + +} /* namespace NLQT */ diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges.h b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges.h new file mode 100644 index 000000000..aa1aac4f0 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges.h @@ -0,0 +1,64 @@ +/* + Georges Editor Qt + Copyright (C) 2010 Adrian Jaekel + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef GEORGES_H +#define GEORGES_H + +// Misc + +// STL includes +#include + +// NeL includes + +// Qt includes + +// Project includes + +namespace NLGEORGES +{ + class UForm; + class UFormLoader; +} + +using namespace NLGEORGES; + +namespace NLQT { + +/** +@class CGeorges +A CGeorges class loading and viewing sheets. +*/ +class CGeorges +{ +public: + /// Default constructor. + CGeorges(); + virtual ~CGeorges(); + + // Load the given form root + UForm* loadForm(std::string formName); + + // A form loader + UFormLoader *FormLoader; + +};/* class CGeorges */ + +} /* namespace NLQT */ + +#endif // GEORGES_H diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_dirtree_dialog.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_dirtree_dialog.cpp new file mode 100644 index 000000000..a0f150f87 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_dirtree_dialog.cpp @@ -0,0 +1,130 @@ +/* +Georges Editor Qt +Copyright (C) 2010 Adrian Jaekel + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +*/ + +#include "georges_dirtree_dialog.h" + +// Qt includes +#include +#include + +// NeL includes + +// Project includes +#include "modules.h" + +using namespace NLMISC; + +namespace NLQT { + + CGeorgesDirTreeDialog::CGeorgesDirTreeDialog(QString ldPath, QWidget *parent): + QDockWidget(parent), + _ldPath(ldPath){ + + _ui.setupUi(this); + + //QStyleOptionViewItem myButtonOption; + // const QStyleOptionViewItem *buttonOption = + // qstyleoption_cast(_ui.dirTree->style()); + + /*setStyleSheet(" \ + QTreeView { \ + alternate-background-color: yellow; \ + } \ + QTreeView::item { \ + border: 1px solid #d9d9d9; \ + border-top-color: transparent; \ + border-bottom-color: transparent; \ + } \ + QTreeView::item:hover { \ + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #e7effd, stop: 1 #cbdaf1);\ + border: 1px solid #bfcde4; \ + } \ + QTreeView::item:selected { \ + border: 1px solid #567dbc; \ + } \ + QTreeView::item:selected:active{ \ + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #6ea1f1, stop: 1 #567dbc);\ + } \ + QTreeView::item:selected:!active { \ + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #6b9be8, stop: 1 #577fbf);\ + }\ + ");*/ + //QString leveldata = Modules::config().getConfigFile().getVar("SearchPaths").asString().c_str(); + + _dirModel = new CFileSystemModel(_ldPath); + _ui.dirTree->setModel(_dirModel); + + QFileInfo info(_ldPath); + + if (!_ldPath.isEmpty() && info.isDir()) { + _dirModel->setRootPath(_ldPath); + _ui.dirTree->setRootIndex(_dirModel->index(_ldPath)); + } else { + _dirModel->setRootPath(QDir::currentPath()); + } + + _ui.dirTree->setAnimated(false); + _ui.dirTree->setIndentation(20); + //_ui.dirTree->setSortingEnabled(true); + + /*connect(_ui.dirTree, SIGNAL(clicked(QModelIndex)), + this, SLOT(fileSelected(QModelIndex)));*/ + connect(_ui.dirTree, SIGNAL(activated(QModelIndex)), + this, SLOT(fileSelected(QModelIndex))); +} + +CGeorgesDirTreeDialog::~CGeorgesDirTreeDialog() { + delete _dirModel; +} + +void CGeorgesDirTreeDialog::fileSelected(QModelIndex index) { + QString name; + if (index.isValid() && !_dirModel->isDir(index)) { + Q_EMIT selectedForm(_dirModel->fileName(index)); + } +} + +void CGeorgesDirTreeDialog::changeFile(QString file) { + QModelIndex index = _dirModel->index(file); + //_dirModel->; + _ui.dirTree->selectionModel()->select(index,QItemSelectionModel::ClearAndSelect); + _ui.dirTree->scrollTo(index,QAbstractItemView::PositionAtCenter); + fileSelected(index); +} + +void CGeorgesDirTreeDialog::ldPathChanged(QString path) { + _ldPath = path; + QFileInfo info(_ldPath); + + delete _dirModel; + + if (!_ldPath.isEmpty() && info.isDir()) { + _dirModel = new CFileSystemModel(_ldPath); + _ui.dirTree->setModel(_dirModel); + _dirModel->setRootPath(_ldPath); + _ui.dirTree->setRootIndex(_dirModel->index(_ldPath)); + } else { + _dirModel = new CFileSystemModel(""); + _ui.dirTree->setModel(_dirModel); + _dirModel->setRootPath(QDir::currentPath()); + _ldPath = ""; + } +} + +} /* namespace NLQT */ \ No newline at end of file diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_dirtree_dialog.h b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_dirtree_dialog.h new file mode 100644 index 000000000..c8a104dc6 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_dirtree_dialog.h @@ -0,0 +1,64 @@ +/* + Georges Editor Qt + Copyright (C) 2010 Adrian Jaekel + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef GEORGES_DIRTREE_DIALOG_H +#define GEORGES_DIRTREE_DIALOG_H + +// Qt includes +#include + +// STL includes + +// NeL includes + +// Project includes +#include "ui_georges_dirtree_form.h" +#include "filesystem_model.h" + +namespace NLQT { + +class CGeorgesDirTreeDialog: public QDockWidget +{ + Q_OBJECT + +public: + CGeorgesDirTreeDialog(QString ldPath, QWidget *parent = 0); + ~CGeorgesDirTreeDialog(); + +private: + Ui::CGeorgesDirTreeDialog _ui; + + CFileSystemModel *_dirModel; + QString _ldPath; + +Q_SIGNALS: + void selectedForm(QString); + +public Q_SLOTS: + void ldPathChanged(QString path); + +private Q_SLOTS: + void fileSelected(QModelIndex index); + void changeFile(QString file); + + friend class CMainWindow; +}; /* CGEorgesDirTreeDialog */ + +} /* namespace NLQT */ + +#endif // GEORGES_DIRTREE_DIALOG_H diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_dirtree_form.ui b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_dirtree_form.ui new file mode 100644 index 000000000..52296e1fa --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_dirtree_form.ui @@ -0,0 +1,51 @@ + + + CGeorgesDirTreeDialog + + + + 0 + 0 + 400 + 300 + + + + + 0 + 0 + + + + + 200 + 111 + + + + Dir Tree + + + + + 50 + 0 + + + + + + + + 0 + 0 + + + + + + + + + + diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_editor_qt.qrc b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_editor_qt.qrc new file mode 100644 index 000000000..58efbb3a0 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_editor_qt.qrc @@ -0,0 +1,13 @@ + + + images/nel.png + images/open-file.png + images/go-down.png + images/go-up.png + images/list-add.png + images/list-remove.png + images/preferences.png + images/pqrticles.png + images/khead.png + + diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_dialog.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_dialog.cpp new file mode 100644 index 000000000..ff0dd4ac4 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_dialog.cpp @@ -0,0 +1,271 @@ +/* +Georges Editor Qt +Copyright (C) 2010 Adrian Jaekel + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +*/ + +#include "georges_treeview_dialog.h" + +// Qt includes +#include +#include + +// NeL includes +#include +#include +#include +#include + +// Project includes +#include "modules.h" +#include "georgesform_model.h" +#include "georgesform_proxy_model.h" +#include "formitem.h" +#include "spindelegate.h" + +using namespace NLMISC; +using namespace NLGEORGES; + +namespace NLQT { + + CGeorgesTreeViewDialog::CGeorgesTreeViewDialog(QWidget *parent /*= 0*/, bool emptyView /*= false*/) + : QDockWidget(parent) + { + loadedForm = ""; + _modified = false; + + _ui.setupUi(this); + _ui.treeViewTabWidget->setTabEnabled (2,false); + + if (emptyView) { + _ui.treeViewTabWidget->clear(); + setWindowTitle("Form Area"); + } + + _ui.checkBoxParent->setStyleSheet("background-color: rgba(0,255,0,30)"); + _ui.checkBoxDefaults->setStyleSheet("background-color: rgba(255,0,0,30)"); + _form = 0; + + SpinBoxDelegate *spindelegate = new SpinBoxDelegate(this); + _ui.treeView->setItemDelegateForColumn(1, spindelegate); + + + connect(_ui.treeView, SIGNAL(doubleClicked (QModelIndex)), + this, SLOT(doubleClicked (QModelIndex))); + connect(_ui.checkBoxParent, SIGNAL(stateChanged(int)), + this, SLOT(showParentRows (int))); + } + + CGeorgesTreeViewDialog::~CGeorgesTreeViewDialog() + { + delete _ui.treeView->itemDelegateForColumn(1); + deleteLater(); + //QSettings settings("RyzomCore", "GeorgesQt"); + //settings.setValue("dirViewGeometry", saveGeometry()); + } + + void CGeorgesTreeViewDialog::selectedForm(QString formName) { + _form = Modules::georges().loadForm(formName.toStdString()); + + if (_form) { + UFormElm *root = 0; + root = &_form->getRootNode(); + + QStringList parents; + for (uint i = 0; i < _form->getNumParent(); i++) { + UForm *u = _form->getParentForm(i); + parents << u->getFilename().c_str(); + } + + QString comments; + comments = _form->getComment().c_str(); + + if (!comments.isEmpty()) { + _ui.treeViewTabWidget->setTabEnabled (1,true); + _ui.commentEdit->setPlainText(comments); + } + + QStringList strList; + std::set dependencies; + _form->getDependencies(dependencies); + + QMap< QString, QStringList> deps; + Q_FOREACH(std::string str, dependencies) { + QString file = str.c_str(); + if (file == formName) continue; + deps[file.remove(0,file.indexOf(".")+1)] << str.c_str(); + } + nlinfo("typ's %d",deps["typ"].count()); + nlinfo("dfn's %d",deps["dfn"].count()); + + //nlwarning(strList.join(";").toStdString().c_str()); + if (root) { + loadedForm = formName; + + CGeorgesFormModel *model = new CGeorgesFormModel(root,deps,comments,parents); + CGeorgesFormProxyModel *proxyModel = new CGeorgesFormProxyModel(); + proxyModel->setSourceModel(model); + _ui.treeView->setModel(proxyModel); + _ui.treeView->expandAll(); + _ui.treeView->resizeColumnToContents(0); + _ui.treeView->resizeColumnToContents(1); + _ui.treeView->resizeColumnToContents(2); + _ui.treeView->hideColumn(3); + + showParentRows(_ui.checkBoxParent->isChecked()); + + //_ui.treeView->setRowHidden(0,QModelIndex(),true); + connect(model, SIGNAL(dataChanged(const QModelIndex, const QModelIndex)), + this, SLOT(modifiedFile())); + + Modules::mainWin().setWindowTitle("Qt Georges Editor - " + formName); + //Modules::mainWin().getTabBar(); + } + } + } + + void CGeorgesTreeViewDialog::modifiedFile( ) { + if (!_modified) { + _modified = true; + setWindowTitle(windowTitle()+"*"); + Modules::mainWin().setWindowTitle(Modules::mainWin().windowTitle()+"*"); + Q_EMIT modified(_modified); + } + } + + void CGeorgesTreeViewDialog::write( ) { + + COFile file; + std::string s = CPath::lookup(loadedForm.toStdString()); + if (file.open (s)) { + try { + if (loadedForm.contains(".typ")) { + //nlassert (Type != NULL); + + //// Write the file + //// Modified ? + //if (IsModified ()) + //{ + // Type->Header.MinorVersion++; + // flushValueChange (); + //} + //Type->write (xmlStream.getDocument (), theApp.Georges4CVS); + //modify (NULL, NULL, false); + //flushValueChange (); + //UpdateAllViews (NULL); + //return TRUE; + } else if (loadedForm.contains(".dfn")) { + //nlassert (Dfn != NULL); + + //// Write the file + //if (IsModified ()) + //{ + // Dfn->Header.MinorVersion++; + // flushValueChange (); + //} + //Dfn->write (xmlStream.getDocument (), lpszPathName, theApp.Georges4CVS); + //modify (NULL, NULL, false); + //UpdateAllViews (NULL); + //return TRUE; + } else { + nlassert (_form != NULL); + + // Write the file + /*if (IsModified ()) + { + ((CForm*)(UForm*)Form)->Header.MinorVersion++; + }*/ + //((CForm*)(UForm*)Form)->write (xmlStream.getDocument (), lpszPathName, theApp.Georges4CVS); + _form->write(file, false); + setWindowTitle(windowTitle().remove("*")); + _modified = false; + //if (strcmp (xmlStream.getErrorString (), "") != 0) + //{ + // char message[512]; + // smprintf (message, 512, "Error while saving file: %s", xmlStream.getErrorString ()); + //theApp.outputError (message); + //} + //modify (NULL, NULL, false); + //flushValueChange (); + //UpdateAllViews (NULL); + + // Get the left view + //CView* pView = getLeftView (); + } + } catch (Exception &e) { + nlerror("Error while loading file: %s", e.what()); + } + } else { //if (!file.open()) + nlerror("Can't open the file %s for writing.", s); + } + } + + void CGeorgesTreeViewDialog::doubleClicked ( const QModelIndex & index ) { + if (index.column() == 1) return; + CFormItem *item = static_cast(index.internalPointer()); + + QString value = item->data(1).toString(); + QString path = CPath::lookup(value.toStdString(),false).c_str(); + + if (!path.isEmpty() && !path.contains(".shape")) + Q_EMIT changeFile(path); + if (path.contains(".shape")) { + Modules::objView().resetScene(); + Modules::config().configRemapExtensions(); + Modules::objView().loadMesh(path.toStdString(),""); + } + int i = 0; + } + + void CGeorgesTreeViewDialog::closeEvent(QCloseEvent *event) { + if (Modules::mainWin().getEmptyView() == this) { + event->ignore(); + } else { + Modules::mainWin().getTreeViewList().removeOne(this); + if(!Modules::mainWin().getTreeViewList().size()) { + Modules::mainWin().createEmptyView(); + } + deleteLater(); + } + } + + void CGeorgesTreeViewDialog::showParentRows(int newState) { + CGeorgesFormProxyModel * mp = dynamic_cast(_ui.treeView->model()); + CGeorgesFormModel *m = qobject_cast(mp->sourceModel()); + + for (int i = 0; i < m->rowCount(); i++) { + const QModelIndex in = m->index(i,0); + if (m->getItem(in)->nodeFrom() == UFormElm::NodeParentForm) { + if (newState == Qt::Checked) { + _ui.treeView->setRowHidden(in.row(),in.parent(),false); + } else { + _ui.treeView->setRowHidden(in.row(),in.parent(),true); + } + } else { // search childs // recursive? + for (int j = 0; j < m->rowCount(in); j++) { + const QModelIndex in2 = m->index(j,0,in); + if (m->getItem(in2)->nodeFrom() == UFormElm::NodeParentForm) { + if (newState == Qt::Checked) { + _ui.treeView->setRowHidden(in2.row(),in,false); + } else { + _ui.treeView->setRowHidden(in2.row(),in,true); + } + } + } + } // end of search childs + } + } +} /* namespace NLQT */ \ No newline at end of file diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_dialog.h b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_dialog.h new file mode 100644 index 000000000..d40d2b870 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_dialog.h @@ -0,0 +1,80 @@ +/* +Georges Editor Qt +Copyright (C) 2010 Adrian Jaekel + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef GEORGES_TREEVIEWER_DIALOG_H +#define GEORGES_TREEVIEWER_DIALOG_H + +#include "ui_georges_treeview_form.h" + +// Qt includes +#include + +// STL includes + +// NeL includes + +// Project includes + +namespace NLGEORGES +{ + class UForm; +} + +using namespace NLGEORGES; + +namespace NLQT { + + class CGeorgesTreeViewDialog: public QDockWidget + { + Q_OBJECT + + public: + CGeorgesTreeViewDialog(QWidget *parent = 0, bool empty = false); + ~CGeorgesTreeViewDialog(); + + bool modified() {return _modified;} + void setModified(bool m) {_modified = m;} + + void write ( ); + + QString loadedForm; + + protected: + void closeEvent(QCloseEvent *event); + + Q_SIGNALS: + void changeFile(QString); + void modified(bool); + public Q_SLOTS: + void selectedForm(QString); + private Q_SLOTS: + void doubleClicked ( const QModelIndex & index ); + void modifiedFile( ); + void showParentRows(int); + + private: + Ui::CGeorgesTreeViewDialog _ui; + UForm *_form; + + bool _modified; + + }; /* CGeorgesTreeViewDialog */ + +} /* namespace NLQT */ + +#endif // GEORGES_TREEVIEWER_DIALOG_H diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_form.ui b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_form.ui new file mode 100644 index 000000000..873747794 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_form.ui @@ -0,0 +1,122 @@ + + + CGeorgesTreeViewDialog + + + + 0 + 0 + 400 + 300 + + + + + 0 + 0 + + + + + 241 + 236 + + + + + + + + + + + QTabWidget::West + + + 0 + + + + Form + + + + 0 + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + + Parent + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Defaults + + + + + + + + Comment + + + + + + false + + + + + + + + Log + + + + + + + + + + + + + + + diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_model.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_model.cpp new file mode 100644 index 000000000..43fa322c0 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_model.cpp @@ -0,0 +1,442 @@ +/* + Georges Editor Qt + Copyright (C) 2010 Adrian Jaekel + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "georgesform_model.h" + +// NeL includes +#include +#include +#include +#include +#include +#include + +// Qt includes +#include +#include +#include +#include +#include + +// project includes +#include "formitem.h" + +using namespace NLGEORGES; + +namespace NLQT { + + CGeorgesFormModel::CGeorgesFormModel(UFormElm *rootElm, QMap< QString, QStringList> deps, + QString comment, QStringList parents, QObject *parent) : QAbstractItemModel(parent) { + + QList rootData; + rootData << "Value" << "Data" << "Extra" << "Type"; + _rootElm = rootElm; + _rootItem = new CFormItem(_rootElm, rootData); + _dependencies = deps; + _comments = comment; + _parents = parents; + _parentRows = new QList; + + setupModelData(); + } + + CGeorgesFormModel::~CGeorgesFormModel() { + delete _rootItem; + } + + /******************************************************************************/ + + QVariant CGeorgesFormModel::data(const QModelIndex &p_index, int p_role) const { + + if (!p_index.isValid()) + return QVariant(); + + switch (p_role) { + case Qt::DisplayRole: + { + return getItem(p_index)->data(p_index.column()); + } + case Qt::BackgroundRole: + { + if (getItem(p_index)->valueFrom() == UFormElm::ValueDefaultDfn) + return QBrush(QColor(255,0,0,30)); + if (getItem(p_index)->nodeFrom() == UFormElm::NodeParentForm) + return QBrush(QColor(0,255,0,30)); + return QVariant(); + } + case Qt::DecorationRole: + { + if (p_index.column() == 2) { + //p_index. + QModelIndex in = index(p_index.row(),p_index.column()-1,p_index.parent()); + CFormItem *item = getItem(in); + + QString value = item->data(1).toString(); + //QString path = NLMISC::CPath::lookup(value.toStdString(),false).c_str(); + + if (value.contains(".shape")) { + return QIcon(":/images/pqrticles.png"); + } else if(value.contains(".tga") || value.contains(".png")) { + qDebug() << p_index << p_role; + QString path = NLMISC::CPath::lookup(value.toStdString(),false).c_str(); + return QIcon(":/images/pqrticles.png"); + } + } + return QVariant(); + break; + } + default: + return QVariant(); + } + } + + /******************************************************************************/ + + CFormItem *CGeorgesFormModel::getItem(const QModelIndex &index) const { + if (index.isValid()) { + CFormItem *item = static_cast(index.internalPointer()); + if (item) return item; + } + return _rootItem; + } + + /******************************************************************************/ + + bool CGeorgesFormModel::setData(const QModelIndex &index, const QVariant &value, + int role) { + + if (role != Qt::EditRole) + return false; + + CFormItem *item = getItem(index); + bool result = item->setData(index.column(), value); + + if (result) + Q_EMIT dataChanged(index, index); + + return result; + } + + /******************************************************************************/ + + Qt::ItemFlags CGeorgesFormModel::flags(const QModelIndex& index) const { + + if (!index.isValid()) + return 0; + + Qt::ItemFlags returnValue = Qt::ItemIsSelectable | Qt::ItemIsEnabled; + + if(index.column() == 1) + returnValue |= Qt::ItemIsEditable; + + return returnValue; + + } + + /******************************************************************************/ + + QVariant CGeorgesFormModel::headerData(int section, + Qt::Orientation orientation, int role) const + { + if (orientation == Qt::Horizontal && role == Qt::DisplayRole) + return _rootItem->data(section); + + return QVariant(); + + } + + /******************************************************************************/ + + QModelIndex CGeorgesFormModel::index(int row, int column, const QModelIndex &parent) + const + { + if (!hasIndex(row, column, parent)) + return QModelIndex(); + + CFormItem *parentItem; + + if (!parent.isValid()) + parentItem = _rootItem; + else + parentItem = static_cast(parent.internalPointer()); + + CFormItem *childItem = parentItem->child(row); + if (childItem) + return createIndex(row, column, childItem); + else + return QModelIndex(); + } + + /******************************************************************************/ + + QModelIndex CGeorgesFormModel::parent(const QModelIndex &index) const + { + if (!index.isValid()) + return QModelIndex(); + + CFormItem *childItem = static_cast(index.internalPointer()); + CFormItem *parentItem = childItem->parent(); + + if (parentItem == _rootItem) + return QModelIndex(); + + return createIndex(parentItem->row(), 0, parentItem); + } + + /******************************************************************************/ + + int CGeorgesFormModel::rowCount(const QModelIndex &parent) const { + + CFormItem *parentItem; + if (parent.column() > 0) + return 0; + + if (!parent.isValid()) + parentItem = _rootItem; + else + parentItem = static_cast(parent.internalPointer()); + + return parentItem->childCount(); + + } + + /******************************************************************************/ + + int CGeorgesFormModel::columnCount(const QModelIndex &parent) const { + + if (parent.isValid()) + return static_cast(parent.internalPointer())->columnCount(); + else + return _rootItem->columnCount(); + + } + + /******************************************************************************/ + + void CGeorgesFormModel::loadFormData(UFormElm *root, CFormItem *parent) { + + if (!root) return; + + uint num = 0; + UFormElm::TWhereIsNode *whereN = new UFormElm::TWhereIsNode; + UFormElm::TWhereIsValue *whereV = new UFormElm::TWhereIsValue; + + if (root->isStruct()) { + //((CFormElm*)root)->getForm()->getComment(); + uint structSize = 0; + root->getStructSize(structSize); + while (num < structSize) { + // Append a new item to the current parent's list of children. + std::string elmName; + if(root->getStructNodeName(num, elmName)) { + QList columnData; + //QVariant value; + std::string value; + //NLMISC::CRGBA value_color; + //uint value_uint; + //sint value_sint; + //double value_double; + QString elmtType = ""; + UFormElm *elmt = 0; + if(root->getNodeByName(&elmt, elmName.c_str(), whereN, true)) { + if (elmt) { + if (elmt->isArray()) + elmtType = "Array"; + if (elmt->isStruct()) + elmtType = "Struct"; + if (elmt->isAtom()) { + elmtType = "Atom"; + uint numDefinitions = 0; + const UType *type = elmt->getType(); + if (type) { + numDefinitions = type->getNumDefinition(); + root->getValueByName(value, elmName.c_str(),UFormElm::Eval,whereV); + switch (type->getType()) { + case UType::UnsignedInt: + value = QString("%1").arg(QString("%1").arg(value.c_str()).toDouble()).toStdString(); + elmtType.append("_uint");break; + case UType::SignedInt: + value = QString("%1").arg(QString("%1").arg(value.c_str()).toDouble()).toStdString(); + elmtType.append("_sint");break; + case UType::Double: + value = QString("%1").arg(QString("%1").arg(value.c_str()).toDouble(),0,'f',1).toStdString(); + elmtType.append("_double");break; + case UType::String: + elmtType.append("_string");break; + case UType::Color: + elmtType.append("_color");break; + default: + elmtType.append("_unknownType"); + } + } + + if (numDefinitions) { + std::string l, v; + QString tmpLabel, tmpValue; + for (uint i = 0; i < numDefinitions; i++) { + type->getDefinition(i,l,v); + tmpLabel = l.c_str(); + tmpValue = v.c_str(); + if (type->getType() == UType::SignedInt) { + if (QString("%1").arg(value.c_str()).toDouble() == tmpValue.toDouble()) { + value = l; + break; + } + } + if (type->getType() == UType::String) { + if (QString(value.c_str()) == tmpValue) { + value = l; + break; + } + } + } + } + } + if (elmt->isVirtualStruct()){ + root->getValueByName(value, elmName.c_str(),UFormElm::Eval,whereV); + elmtType = "VirtualStruct"; + } + switch (*whereN) { + case UFormElm::NodeForm: + elmtType.append("_fromForm"); break; + case UFormElm::NodeParentForm: + elmtType.append("_fromParentForm"); break; + case UFormElm::NodeDfn: + elmtType.append("_isDFN"); break; + case UFormElm::NodeType: + elmtType.append("_isType"); break; + default: + elmtType.append("_noNode"); + } + switch (*whereV) { + case UFormElm::ValueForm: + elmtType.append("_formValue"); break; + case UFormElm::ValueParentForm: + elmtType.append("_parentValue"); break; + case UFormElm::ValueDefaultDfn: + elmtType.append("_dfnValue"); break; + case UFormElm::ValueDefaultType: + elmtType.append("_typeValue"); break; + default: + elmtType.append("_noValue"); + } + columnData << QString(elmName.c_str()) << QString(value.c_str()) << "" << elmtType; + parent->appendChild(new CFormItem(elmt, columnData, parent, *whereV, *whereN)); + //if (parents.last()->childCount() > 0) { + // parents << parents.last()->child(parents.last()->childCount()-1); + //} + loadFormData(elmt, parent->child(parent->childCount()-1)); + } else { + // add Defaults + //columnData << QString(elmName.c_str()) << QString("default") << QString("default"); + //parent->appendChild(new CFormItem(elmt, columnData, parent, UFormElm::ValueDefaultDfn, UFormElm::NodeDfn)); + } + } + } + + num++; + } + } + if (root->isArray()) { + uint arraySize = 0; + root->getArraySize(arraySize); + while (num < arraySize) { + std::string elmName; + if(root->getArrayNodeName(elmName, num)) { + QList columnData; + std::string value; + QString elmtType = ""; + //root->getValueByName(value, elmName.c_str()); + + UFormElm *elmt = 0; + if(root->getArrayNode(&elmt,0) && elmt) { + if (elmt->isArray()) + elmtType = "Array"; + if (elmt->isStruct()) { + elmtType = "Struct"; + } + if (elmt->isAtom()) { + elmt->getValue(value); + elmtType = "Atom"; + } + if (elmt->isVirtualStruct()) + elmtType = "VirtualStruct"; + columnData << QString(elmName.c_str()) << QString(value.c_str()) << "" << elmtType; + parent->appendChild(new CFormItem(elmt, columnData, parent)); + loadFormData(elmt, parent->child(parent->childCount()-1)); + } + } + num++; + } + } + } + + /******************************************************************************/ + + void CGeorgesFormModel::loadFormHeader() { + + CFormItem *fi_pars = new CFormItem(_rootElm, QList() << "parents", _rootItem); + _rootItem->appendChild(fi_pars); + + Q_FOREACH(QString str, _parents) { + fi_pars->appendChild(new CFormItem(_rootElm, QList() << str, fi_pars)); + } + + /*QStringList dfns = _dependencies["dfn"]; + QStringList typs = _dependencies["typ"]; + + _dependencies.remove("dfn"); + _dependencies.remove("typ"); + + CFormItem *fi_dep = new CFormItem(_rootElm, QList() << "dependencies", _rootItem); + _rootItem->appendChild(fi_dep); + + if (!dfns.isEmpty()) { + CFormItem *fi_dfn = new CFormItem(_rootElm, QList() << "dfn", fi_dep); + fi_dep->appendChild(fi_dfn); + foreach(QString str, dfns) { + fi_dfn->appendChild(new CFormItem(_rootElm, QList() << str, fi_dfn)); + } + } + if (!typs.isEmpty()) { + CFormItem *fi_typ = new CFormItem(_rootElm, QList() << "typ", fi_dep); + fi_dep->appendChild(fi_typ); + foreach(QString str, typs) { + fi_typ->appendChild(new CFormItem(_rootElm, QList() << str, fi_typ)); + } + } + if (!_dependencies.isEmpty()) { + CFormItem *fi_other = new CFormItem(_rootElm, QList() << "other", fi_dep); + fi_dep->appendChild(fi_other); + foreach(QStringList list, _dependencies) { + foreach(QString str, list) { + fi_other->appendChild(new CFormItem(_rootElm, QList() << str, fi_other)); + } + } + }*/ + } + + /******************************************************************************/ + + void CGeorgesFormModel::setupModelData() { + loadFormHeader(); + loadFormData(_rootElm, _rootItem); + } +} /* namespace NLQT */ + +/* end of file */ diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_model.h b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_model.h new file mode 100644 index 000000000..ce25e82b1 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_model.h @@ -0,0 +1,74 @@ +/* +Georges Viewer Qt +Copyright (C) 2010 Adrian Jaekel + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +*/ + +#ifndef GEORGESFORM_MODEL_H +#define GEORGESFORM_MODEL_H + +// Qt includes +#include +#include +#include +#include + +// project includes + +namespace NLGEORGES { + class UFormElm; +} + +namespace NLQT { + + class CFormItem; + + class CGeorgesFormModel : public QAbstractItemModel { + Q_OBJECT + + public: + CGeorgesFormModel(NLGEORGES::UFormElm *root, QMap< QString, QStringList> deps, + QString comment, QStringList parents, QObject *parent = 0); + ~CGeorgesFormModel(); + + QVariant data(const QModelIndex &index, int role) const; + bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); + Qt::ItemFlags flags(const QModelIndex &index) const; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; + QModelIndex parent(const QModelIndex &index) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const; + int columnCount(const QModelIndex &parent = QModelIndex()) const; + CFormItem *getItem(const QModelIndex &index) const; + CGeorgesFormModel *model() { return this; } + + private: + void setupModelData(); + void loadFormData(NLGEORGES::UFormElm *rootElm, CFormItem *parent); + void loadFormHeader(); + + CFormItem* _rootItem; + NLGEORGES::UFormElm* _rootElm; + QMap< QString, QStringList> _dependencies; + QString _comments; + QStringList _parents; + QList* _parentRows; + + };/* class CGeorgesFormModel */ + +} /* namespace NLQT */ + +#endif // GEORGESFORM_MODEL_H diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_proxy_model.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_proxy_model.cpp new file mode 100644 index 000000000..3847830da --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_proxy_model.cpp @@ -0,0 +1,56 @@ +/* + Georges Editor Qt + Copyright (C) 2010 Adrian Jaekel + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "georgesform_proxy_model.h" + +// NeL includes +#include + +namespace NLQT { + + bool CGeorgesFormProxyModel::filterAcceptsRow(int sourceRow, + const QModelIndex &sourceParent) const + { + nlinfo("CGeorgesFormProxyModel::filterAcceptsRow"); + //QModelIndex index0 = sourceModel()->index(sourceRow, 0, sourceParent); + //QModelIndex index1 = sourceModel()->index(sourceRow, 1, sourceParent); + //QModelIndex index2 = sourceModel()->index(sourceRow, 2, sourceParent); + + //return (sourceModel()->data(index0).toString().contains(filterRegExp()) + // || sourceModel()->data(index1).toString().contains(filterRegExp())) + // && dateInRange(sourceModel()->data(index2).toDate()); + + // if (getItem(p_index)->valueFrom() == UFormElm::ValueDefaultDfn) + // return QBrush(QColor(255,0,0,30)); + // if (getItem(p_index)->nodeFrom() == UFormElm::NodeParentForm) + // return QBrush(QColor(0,255,0,30)); + // return QVariant(); + return true; + } + +/******************************************************************************/ + + bool CGeorgesFormProxyModel::filterAcceptsColumn(int sourceRow, + const QModelIndex &sourceParent) const + { + nlinfo("CGeorgesFormProxyModel::filterAcceptsColumn"); + return QSortFilterProxyModel::filterAcceptsColumn(sourceRow, sourceParent); + } +} /* namespace NLQT */ + +/* end of file */ diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_proxy_model.h b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_proxy_model.h new file mode 100644 index 000000000..19fc28c41 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georgesform_proxy_model.h @@ -0,0 +1,42 @@ +/* +Georges Viewer Qt +Copyright (C) 2010 Adrian Jaekel + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +*/ + +#ifndef GEORGESFORM_PROXY_MODEL_H +#define GEORGESFORM_PROXY_MODEL_H + +// Qt includes +#include + +namespace NLQT { + + class CGeorgesFormProxyModel : public QSortFilterProxyModel { + + public: + CGeorgesFormProxyModel(QObject *parent = 0): QSortFilterProxyModel(parent){} + ~CGeorgesFormProxyModel() {} + + protected: + virtual bool filterAcceptsColumn ( int source_column, const QModelIndex & source_parent ) const ; + virtual bool filterAcceptsRow ( int source_row, const QModelIndex & source_parent ) const ; + + };/* class CGeorgesFormProxyModel */ + +} /* namespace NLQT */ + +#endif // GEORGESFORM_PROXY_MODEL_H diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/images/.directory b/code/ryzom/tools/leveldesign/georges_editor_qt/src/images/.directory new file mode 100644 index 000000000..cb8303c65 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/images/.directory @@ -0,0 +1,3 @@ +[Dolphin] +ShowPreview=true +Timestamp=2010,6,13,17,20,25 diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/images/go-down.png b/code/ryzom/tools/leveldesign/georges_editor_qt/src/images/go-down.png new file mode 100644 index 0000000000000000000000000000000000000000..780714b8fa8db3e15b9a258bccb3589e57ca5d80 GIT binary patch literal 2404 zcmV-q37htbP)#Y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~&B$SM*3Cy{Re4=SSL-Xg zUwCft2%Hmk-J}&uI!hZHaC*-{c&Q9LFQMUTcm{54En!o*WpQm7k`_T+k)iPpEIEau zkj4X~N=x)u5aeUzjpg(Sd|zLW8D9rEq7jl9(r%PhPULk#uwfV10Wacs6-x%E5PLKnR!OFbWJt zUfO_sRtZ57@-%s;xR@=Cm_H*v|AZ`#$0@DSm(q%ue#deGG9d|xh%`Z4Nos?jVFPFVEm7kY?$Y$(0|r)xkBl(I#7g&BcKKx{)ku@>M=W!AQ3M5 zPVfH)uAv>?eG`7r3=~YB<`Qf61r`zu(0hU?R=21iAPnRE!S+ai(jttIxFVsD{~_nSiH5$n32;e(JzN5WWh@KORfoN9>GW~62qTOed*4Jt zF>&gTU`3V@;0&h#As}tXoO>*Suz2wfNGWb%5E`#X5zmWvV8^BT!?}oIL2{Z1a}U9N z+L(hJjgjF9=zB9R*f3c9@I^o=saYtU*!G`mQ-i?RpuhYt;3gvmElt##2C$f2hAB4ySdF1kez7D7_ zkR*glDgz4quc*qZ3LH4A#BGnjV^4n`d-oj*OKK{e56+%Jlnx8WWUl}5j~YND4jMRO z(Bl=gW6{3y-te%a9U0wL0ZX=iDmvKH_oK6W|G4eFJ%4s{S)W+hT7V&Mt|12Aa|Hs6 zBut#u5saMH_VUprqT3#U^+|!RD)nUQ?RTF#cjz$wna&bH&U;ZvPO{P*=oC2DB;V_P s!Rv+knnu;DN0zNrtLa()Z+C0^F907|%u2o>TL1t607*qoM6N<$f_jRTD*ylh literal 0 HcmV?d00001 diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/images/khead.png b/code/ryzom/tools/leveldesign/georges_editor_qt/src/images/khead.png new file mode 100644 index 0000000000000000000000000000000000000000..23e50fdb30c5012f7af64abb8ad48170df140751 GIT binary patch literal 1344 zcmV-G1;6@Tg!Wf?E`Dz;me+PAN5 z_~!i`ZG8VdO}xoNyxb)f0C)g+1x70gsQ$+?iLuAKI+}T->f#ZVh^W3yb!7kq_CL90TT*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c6Os0z)*&p8NNpkwiV0Ys&WJ{oOH?a!5)1dAVe5pHwu{ z)|SkN1uM0v#n>pU)M`!;FE4C1Y&R=KUBPhn{;*eTE5?K)@>hl3o`BT6Vky|R)K3Tg zp)wWpPWvlAUO*B01RlwJduPExUy2s?3s^^Zwv)=s`QSGj6YL2r>g3zxrOxxQZ%;)H zK=TS|VQi_2L2+!HTYC9n}vd_2J3K#G?XRRdG#xFHJ8hWR&O%dTI!aDH*qe zDxZLJs~h;aKtQN25v2di5CvEHhZ(w9QY*yx#f$!^@ViDni3zy@#U-m$WJ3&rr7$c+ z-%?238`UzqGs13X2A|^)H)|8}jMKw(W~9mfhpxter2dt8!@Fm9oABB$ z#vZ(Q2I2PYDzEr;!Wvz$Y+B3s_oFJw^>oPfq^02eF7i@C9 zdgH}9Z3XUhw#SfKE?@Vc8`YkXo=$OZjyKqA{d&-c6{bW;qR+$n1h#12Q92?(WkYAQ znm!TGnNlqzx=k)JM~?X&TZ8Cg8Xh8?=Y-lBLgYtKHSi;x!myDN5QRm~I@pS1({fxK zhoD_sV0$;=2F31^g4vfuz$HmY`BAul!f_>a_u_&Rfy{utX%pu?Y=BWHu$oLD2g=N9 zjHh*HDd~e%k!b#~ZpFjL7}l}YG$Gc=X)RuPFd5=fVEZ`>{1eo@ZwLQ8+?|t$-K3ED qiLHEpt}$vqsE==;|M$c&4Fo(6DE0di@OlB@zYgtlu(@wVVf-IpnGuly literal 0 HcmV?d00001 diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/images/open-file.png b/code/ryzom/tools/leveldesign/georges_editor_qt/src/images/open-file.png new file mode 100644 index 0000000000000000000000000000000000000000..7422ad3338bb73f8a30502c3eb830be527c06c98 GIT binary patch literal 1088 zcmV-G1i$-#5-Pb$aXy!D< zshWoOdGA|i<_?Aspj{}X4gT8-VGT?Ttb(k@oUj$4_j-F(l?Nd*s->*j5Gyu-?{3F@^CcGLTmF+NY0&_CAPFTN7&^Ekn z5LI(|=re$EA!5Q$u|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!ydA4|_!w z2BF-okZba2+QZSHB&A?qYp>AKEFD86OkQ>n9BDHnA_qw|2r#|$NQ69}{Py>e&5;Nd z!gT&Y3Rwy5ATLzQO=Y<)DR4Hg7nBwBRb-_IvNQzo8oaElYEkS)mc6Q(6_Fi4m@c_&r^{<+?$VvvuWZWhyEv!lO8+|KuR2;fnG9UfHz41f=j;6yK(<=8?OIG5iV zfL1$)0m08r6TM}W21QBZ6l|iGl79;2-EC~R&!UnjRA7%F_nAA@31zHYUue-T+|_id z>ZZBr&1NL=n~E)x|oxD{A9NOCZwr#Q)8h+ z=K$KtrRws#-y|ka9_N5fk^Kkg*cA#uu0dfT$KUe6FN<90!3yjLWX-%@@Q`jz5AMw} z!UnK3w|9sD(gTverZamxEQbzSCL1$Nq!_YLppeXFj(-^?mUa)#lq#a1$-YYk*~qD! z!gDsDECwf^xu6&~17w5Kz)@mo`40^pc;^pUf93UQcPxQ6xcUwqe?QZwF;_vT7n|nO z7kNOommExSmzj|aVTo1&^TQQ9FC>kVnK3{pmZTSx-6idlTdTl7qypGkhcU^Bsm!i- zBD0qogvz05LKilk*|AX8ow>BN`SWOBENyw{WEDXi?Uh|S-`C==yk20=-^KR_(fQ~e zZGHZuQyUNdnST5B0nD!b@1M^hHphN|bN~e)r?oXUQAHp$5af{@Io^2>>2^$)b}8fd zj!>BDCdaevA5#Xqu>K5dIP1#f>|550iMxghCC+godhhVzP}c8*VXXUS?(d<%X(w*) zV}}x2YTGTeo2|9_lO8q!0&#b0qWn=#`wHw@2=ITqlRI*VHB|s%8U_M`;esT1m4cA& z(c(0o&G`Okiigz8Ft(F$mhWJC_)3^YPoa6xe!<^A9QiLAZu~udrJ*bU001R)MObuX zVRU6WV{&C-bY%cCFflMKFg7hQGgL7*IxsmpF*YkOGdeIZ=xu$&0000bbVXQnWMOn= zI&E)cX=Zr + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +*/ + +#include "log_dialog.h" + +// Qt includes +#include +#include +#include +#include + +// NeL includes + +// Project includes +#include "qt_displayer.h" + +namespace NLQT { + + CGeorgesLogDialog::CGeorgesLogDialog(QWidget *parent): + QDockWidget(parent){ + + _ui.setupUi(this); + + _displayer = new CQtDisplayer(_ui.plainTextEdit); + NLMISC::ErrorLog->addDisplayer(_displayer); + NLMISC::WarningLog->addDisplayer(_displayer); + NLMISC::DebugLog->addDisplayer(_displayer); + NLMISC::AssertLog->addDisplayer(_displayer); + NLMISC::InfoLog->addDisplayer(_displayer); + +} + +CGeorgesLogDialog::~CGeorgesLogDialog() { + NLMISC::ErrorLog->removeDisplayer(_displayer); + NLMISC::WarningLog->removeDisplayer(_displayer); + NLMISC::DebugLog->removeDisplayer(_displayer); + NLMISC::AssertLog->removeDisplayer(_displayer); + NLMISC::InfoLog->removeDisplayer(_displayer); + delete _displayer; +} + +} /* namespace NLQT */ \ No newline at end of file diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/log_dialog.h b/code/ryzom/tools/leveldesign/georges_editor_qt/src/log_dialog.h new file mode 100644 index 000000000..0dab4e9d8 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/log_dialog.h @@ -0,0 +1,54 @@ +/* + Georges Editor Qt + Copyright (C) 2010 Adrian Jaekel + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef LOG_DIALOG_H +#define LOG_DIALOG_H + +// Qt includes +#include + +// STL includes + +// NeL includes +#include + +// Project includes +#include "ui_log_form.h" + +namespace NLQT { + class CQtDisplayer; + +class CGeorgesLogDialog: public QDockWidget +{ + Q_OBJECT + +public: + CGeorgesLogDialog(QWidget *parent = 0); + ~CGeorgesLogDialog(); + +private: + Ui::CGeorgesLogDialog _ui; + + CQtDisplayer *_displayer; + + friend class CMainWindow; +}; /* CGeorgesLogDialog */ + +} /* namespace NLQT */ + +#endif // LOG_DIALOG_H diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/log_form.ui b/code/ryzom/tools/leveldesign/georges_editor_qt/src/log_form.ui new file mode 100644 index 000000000..7a22af13e --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/log_form.ui @@ -0,0 +1,56 @@ + + + CGeorgesLogDialog + + + + 0 + 0 + 472 + 310 + + + + + 0 + 0 + + + + + 89 + 122 + + + + + 524287 + 524287 + + + + Log + + + + + 0 + 0 + + + + + 0 + 100 + + + + + + + + + + + + diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/main.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/main.cpp new file mode 100644 index 000000000..cd2e1ef88 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/main.cpp @@ -0,0 +1,116 @@ +#include +#include + +// Qt includes +#include +#include +#include +#include + +// NeL includes +#include +#include +#include +#include +#include + +// Project includes +#include "modules.h" + +// nel_qt log file name +#define NLQT_LOG_FILE "nel_qt.log" + +// clear nel_qt log before use +#define NLQT_ERASE_LOG true + +#if !defined (NLQT_USE_LOG_LOG) +# define NLQT_USE_LOG_LOG true +#endif +#if !defined (NLQT_USE_LOG) +# define NLQT_USE_LOG 1 +#endif + +using namespace std; +using namespace NLMISC; + +namespace NLQT { + +namespace { + +CFileDisplayer *s_FileDisplayer = NULL; + +} /* anonymous namespace */ + +} /* namespace NLQT */ + +void messageHandler(QtMsgType p_type, const char* p_msg) { + + fprintf(stderr, "%s\n", p_msg); + + QFile file("qt.log"); + file.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text); + + QChar code; + switch (p_type) { + case QtDebugMsg: code = 'D'; break; + case QtWarningMsg: code = 'W'; break; + case QtCriticalMsg: code = 'C'; break; + case QtFatalMsg: code = 'F'; break; + } + QString dt = QDateTime::currentDateTime().toString("yyyyMMdd hh:mm:ss"); + + QTextStream(&file) << QString("%1 [%2] %3\n").arg(dt).arg(code).arg(QString(p_msg)); +} + +#ifndef DATA_DIR +# define DATA_DIR "." +#endif + + +#ifdef NL_OS_WINDOWS +# ifdef _UNICODE +# define tstring wstring +# else +# define tstring string +# endif +#endif + +sint main(int argc, char **argv) +{ + // go nel! + { + // use log.log if NEL_LOG_IN_FILE and NLQT_USE_LOG_LOG defined as 1 + createDebug(NULL, NLQT_USE_LOG_LOG, false); + if (QFile::exists("qt.log")) + QFile::remove("qt.log"); + + qInstallMsgHandler(messageHandler); +#if NLQT_USE_LOG + // create toverhex_client.log + // filedisplayer only deletes the 001 etc + if (NLQT_ERASE_LOG && CFile::isExists(NLQT_LOG_FILE)) + CFile::deleteFile(NLQT_LOG_FILE); + // initialize the log file + NLQT::s_FileDisplayer = new CFileDisplayer(); + NLQT::s_FileDisplayer->setParam(NLQT_LOG_FILE, NLQT_ERASE_LOG); + DebugLog->addDisplayer(NLQT::s_FileDisplayer); + InfoLog->addDisplayer(NLQT::s_FileDisplayer); + WarningLog->addDisplayer(NLQT::s_FileDisplayer); + AssertLog->addDisplayer(NLQT::s_FileDisplayer); + ErrorLog->addDisplayer(NLQT::s_FileDisplayer); +#endif + + nlinfo("Welcome to NeL!"); + + NLMISC::CPath::remapExtension("tga", "png", true); + } + + QApplication app(argc, argv); + + Modules::init(); + //Modules::mainWin().resize(800,600); + Modules::mainWin().show(); + int result = app.exec(); + Modules::release(); + return result; +} diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/main_window.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/main_window.cpp new file mode 100644 index 000000000..d2ce4d887 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/main_window.cpp @@ -0,0 +1,488 @@ +/* + Georges Editor Qt + Copyright (C) 2010 Adrian Jaekel + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "main_window.h" + +// STL includes + +// Qt includes +#include + +// NeL includes + +// Project includes +#include "modules.h" +#include "settings_dialog.h" +#include "log_dialog.h" +#include "objectviewer_dialog.h" +#include "georges_dirtree_dialog.h" +#include "georges_treeview_dialog.h" + +using namespace std; +using namespace NLMISC; + +namespace NLQT { + + +CMainWindow::CMainWindow(QWidget *parent) + : QMainWindow(parent), + _GeorgesLogDialog(0), _ObjectViewerDialog(0), + _GeorgesDirTreeDialog(0) +{ + setWindowTitle("Qt Georges Editor"); + + setDockNestingEnabled(true); + setCentralWidget(0); + setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea); + setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); + + // create log dock widget + _GeorgesLogDialog = new CGeorgesLogDialog(this); + addDockWidget(Qt::RightDockWidgetArea, _GeorgesLogDialog); + + // empty form view as placeholder + createEmptyView(); + _currentView = 0; + + // load and set leveldesign path from config + QString ldPath = Modules::config().configLeveldesignPath().c_str(); + QFileInfo info(ldPath); + if (!info.isDir()) ldPath = ""; + + // create georges dir dock widget + _GeorgesDirTreeDialog = new CGeorgesDirTreeDialog(ldPath, this); + addDockWidget(Qt::LeftDockWidgetArea, _GeorgesDirTreeDialog); + if (ldPath == "") { + if (QMessageBox::information(this, tr("Missing leveldesign path"), + tr("Your leveldesign path seems to be empty or incorrect.\nDo you want to set it now?"), + QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok) { + settings(); + } + } + + // create NeL viewport dock widget + _ObjectViewerDialog = new CObjectViewerDialog(this); + //_ObjectViewerDialog->setAllowedAreas(Qt::LeftDockWidgetArea ); + //_ObjectViewerDialog->hide(); + addDockWidget(Qt::LeftDockWidgetArea, _ObjectViewerDialog); + + createActions(); + createMenus(); + createToolBars(); + createStatusBar(); + + //_ObjectViewerDialog->toggleViewAction()->trigger(); + QSettings settings("georges_editor_qt.ini", QSettings::IniFormat); + settings.beginGroup("WindowSettings"); + restoreState(settings.value("QtWindowState").toByteArray()); + restoreGeometry(settings.value("QtWindowGeometry").toByteArray()); + settings.endGroup(); + + // setup Qt style and palette from config file + //_originalPalette = QApplication::palette(); + //Modules::config().setAndCallback("QtStyle", CConfigCallback(this, &CMainWindow::cfcbQtStyle)); + //Modules::config().setAndCallback("QtPalette", CConfigCallback(this, &CMainWindow::cfcbQtPalette)); + + setWindowIcon(QIcon(":/images/khead.png")); + + _statusBarTimer = new QTimer(this); + connect(_statusBarTimer, SIGNAL(timeout()), this, SLOT(updateStatusBar())); + _statusBarTimer->start(5000); + + connect(_GeorgesDirTreeDialog, SIGNAL(selectedForm(QString)), + this, SLOT(openTreeView(QString))); +} + +CMainWindow::~CMainWindow() +{ + // save state & geometry of window and widgets + QSettings settings("georges_editor_qt.ini", QSettings::IniFormat); + settings.beginGroup("WindowSettings"); + settings.setValue("QtWindowState", saveState()); + settings.setValue("QtWindowGeometry", saveGeometry()); + settings.endGroup(); + + //Modules::config().dropCallback("QtPalette"); + //Modules::config().dropCallback("QtStyle"); + + _statusBarTimer->stop(); + + delete _ObjectViewerDialog; + delete _GeorgesDirTreeDialog; + delete _GeorgesLogDialog; +} + +void CMainWindow::openTreeView(QString file) { + // create or/and raise tree view dock widget for current file + + setCurrentFile(file); + + CGeorgesTreeViewDialog *newView = 0; + + Q_FOREACH(CGeorgesTreeViewDialog* dlg, _treeViewList) { + if (dlg->loadedForm == file) + newView = dlg; + } + if (!newView) { + newView = new CGeorgesTreeViewDialog(this); + //newView->setAllowedAreas(Qt::TopDockWidgetArea | Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); + newView->setWindowTitle(file); + + if (_treeViewList.isEmpty()) { + _emptyView->deleteLater(); + addDockWidget(Qt::TopDockWidgetArea, newView); + } else { + tabifyDockWidget(_treeViewList.first(),newView); + QTabBar* tb = Modules::mainWin().getTabBar(); + if (tb) { + disconnect(tb, SIGNAL(currentChanged ( int ) ), + this,SLOT(tabChanged(int))); + connect(tb, SIGNAL(currentChanged ( int ) ), + this,SLOT(tabChanged(int))); + } + } + + _treeViewList.append(newView); + newView->selectedForm(file); + _currentView = newView; + + connect(newView, SIGNAL(changeFile(QString)), + _GeorgesDirTreeDialog, SLOT(changeFile(QString))); + connect(newView, SIGNAL(modified(bool)), + _saveAction, SLOT(setEnabled(bool))); + } + newView->raise(); +} + +void CMainWindow::settings() +{ + CSettingsDialog _settingsDialog(this); + + connect(&_settingsDialog,SIGNAL(ldPathChanged(QString)), + _GeorgesDirTreeDialog,SLOT(ldPathChanged(QString))); + + //_settingsDialog.show(); + _settingsDialog.exec(); +} + +void CMainWindow::about() +{ + QMessageBox::about(this, tr("About Georges Viewer Qt"), + tr("

Georges Viewer Qt

" + "Author: aquiles
Credits:Thx to dnk-88 for parts of his code")); +} + +void CMainWindow::updateStatusBar() +{ + //if (_isGraphicsInitialized) + // statusBar()->showMessage(QString(Modules::objView().getDriver()->getVideocardInformation())); +} + +void CMainWindow::open() +{ + /*QStringList fileNames = QFileDialog::getOpenFileNames(this, + tr("Open NeL data file"), _lastDir, + tr("All NeL files (*.shape *.ps);;" + "NeL shape files (*.shape);;" + "NeL particle system files (*.ps)")); + + setCursor(Qt::WaitCursor); + if (!fileNames.isEmpty()) + { + QStringList list = fileNames; + QStringList::Iterator it = list.begin(); + _lastDir = QFileInfo(*it).absolutePath(); + + QString skelFileName = QFileDialog::getOpenFileName(this, + tr("Open skeleton file"), _lastDir, + tr("NeL skeleton file (*.skel)")); + + while(it != list.end()) + { + loadFile(*it, skelFileName); + ++it; + } + _AnimationSetDialog->updateListObject(); + _AnimationSetDialog->updateListAnim(); + _SlotManagerDialog->updateUiSlots(); + } + setCursor(Qt::ArrowCursor);*/ +} + +void CMainWindow::save() +{ + if(!_currentView) + return; + + setCursor(Qt::WaitCursor); + + _currentView->write(); + setWindowTitle(windowTitle().remove("*")); + _saveAction->setEnabled(false); + + setCursor(Qt::ArrowCursor); +} + +void CMainWindow::create() +{ +} + +void CMainWindow::createEmptyView() +{ + _emptyView = new CGeorgesTreeViewDialog(this, true); + //_emptyView->setAllowedAreas(Qt::TopDockWidgetArea); + addDockWidget(Qt::TopDockWidgetArea,_emptyView); +} + +void CMainWindow::createActions() +{ + _openAction = new QAction(tr("&Open..."), this); + _openAction->setIcon(QApplication::style()->standardIcon(QStyle::SP_DialogOpenButton)); + _openAction->setShortcut(QKeySequence::Open); + _openAction->setStatusTip(tr("Open an existing file")); + connect(_openAction, SIGNAL(triggered()), this, SLOT(open())); + + _createAction = new QAction(tr("&New..."), this); + _createAction->setIcon(QApplication::style()->standardIcon(QStyle::SP_FileDialogNewFolder)); + _createAction->setShortcut(QKeySequence::New); + _createAction->setStatusTip(tr("Create a new file")); + connect(_createAction, SIGNAL(triggered()), this, SLOT(create())); + + _saveAction = new QAction(tr("&Save..."), this); + _saveAction->setIcon(QApplication::style()->standardIcon(QStyle::SP_DialogSaveButton)); + _saveAction->setShortcut(QKeySequence::Save); + _saveAction->setStatusTip(tr("Saves the current file")); + _saveAction->setDisabled(true); + connect(_saveAction, SIGNAL(triggered()), this, SLOT(save())); + + _exitAction = new QAction(tr("E&xit"), this); + _exitAction->setShortcut(QKeySequence::Close); + _exitAction->setIcon(QApplication::style()->standardIcon(QStyle::SP_DialogCloseButton)); + _exitAction->setStatusTip(tr("Exit the application")); + connect(_exitAction, SIGNAL(triggered()), this, SLOT(close())); + + _setBackColorAction = _ObjectViewerDialog->createSetBackgroundColor(this); + _setBackColorAction->setText(tr("Set &background color")); + _setBackColorAction->setStatusTip(tr("Set background color")); + + _settingsAction = new QAction(tr("&Settings"), this); + _settingsAction->setIcon(QIcon(":/images/preferences.png")); + _settingsAction->setStatusTip(tr("Settings")); + connect(_settingsAction, SIGNAL(triggered()), this, SLOT(settings())); + + _aboutAction = new QAction(tr("&About"), this); + _aboutAction->setStatusTip(tr("Show the application's About box")); + connect(_aboutAction, SIGNAL(triggered()), this, SLOT(about())); + + _aboutQtAction = new QAction(tr("About &Qt"), this); + _aboutQtAction->setStatusTip(tr("Show the Qt library's About box")); + connect(_aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); + + for (int i = 0; i < MaxRecentFiles; ++i) { + recentFileActs[i] = new QAction(this); + recentFileActs[i]->setVisible(false); + connect(recentFileActs[i], SIGNAL(triggered()), + this, SLOT(openRecentFile())); + } +} + +void CMainWindow::createMenus() +{ + _fileMenu = menuBar()->addMenu(tr("&File")); + _fileMenu->addAction(_createAction); + _fileMenu->addAction(_openAction); + _fileMenu->addAction(_saveAction); + _separatorAction = _fileMenu->addSeparator(); + for (int i = 0; i < MaxRecentFiles; ++i) + _fileMenu->addAction(recentFileActs[i]); + _fileMenu->addSeparator(); + _fileMenu->addAction(_exitAction); + updateRecentFileActions(); + + _viewMenu = menuBar()->addMenu(tr("&View")); + _viewMenu->addAction(_setBackColorAction); + if (_GeorgesDirTreeDialog) + _viewMenu->addAction(_GeorgesDirTreeDialog->toggleViewAction()); + + _toolsMenu = menuBar()->addMenu(tr("&Tools")); + if (_ObjectViewerDialog) { + _toolsMenu->addAction(_ObjectViewerDialog->toggleViewAction()); + _ObjectViewerDialog->toggleViewAction()->setIcon(QIcon(":/images/pqrticles.png")); + } + _toolsMenu->addSeparator(); + _toolsMenu->addAction(_settingsAction); + + menuBar()->addSeparator(); + + _helpMenu = menuBar()->addMenu(tr("&Help")); + _helpMenu->addAction(_aboutAction); + _helpMenu->addAction(_aboutQtAction); +} + +void CMainWindow::createToolBars() +{ + _fileToolBar = addToolBar(tr("&File")); + _fileToolBar->addAction(_createAction); + _fileToolBar->addAction(_openAction); + _fileToolBar->addAction(_saveAction); + + _toolsBar = addToolBar(tr("&Tools")); + if (_ObjectViewerDialog) + _toolsBar->addAction(_ObjectViewerDialog->toggleViewAction()); +} + +void CMainWindow::createStatusBar() +{ + statusBar()->showMessage(tr("StatusReady")); +} + +void CMainWindow::cfcbQtStyle(NLMISC::CConfigFile::CVar &var) +{ + QApplication::setStyle(QStyleFactory::create(var.asString().c_str())); +} + +void CMainWindow::cfcbQtPalette(NLMISC::CConfigFile::CVar &var) +{ + if (var.asBool()) QApplication::setPalette(QApplication::style()->standardPalette()); + else QApplication::setPalette(_originalPalette); +} + +QTabBar* CMainWindow::getTabBar() +{ + // get the QTabBar + QList tabList = findChildren(); + //tabList = _mainWindow->findChildren(); + //nlinfo(QString("%1 %2").arg(QString::number((int)this,16)). + // arg(QString::number((int)_mainWindow,16)). + // toStdString().c_str()); + QTabBar *tb = 0; + Q_FOREACH(QTabBar *tabBar, tabList){ + if (tabBar->parent() != this) + continue; + //nlinfo(QString("%1 %2 %3 %4").arg(tabBar->objectName()). + // arg(QString::number((int)tabBar,16)). + // arg(QString::number((int)tabBar->parentWidget(),16)). + // arg(QString::number((int)tabBar->parent(),16)). + // toStdString().c_str()); + for (int i = 0; i < tabBar->count(); i++) { + QString currentTab = tabBar->tabText(i); + //nlinfo(currentTab.toStdString().c_str()); + } + tb = tabBar; + } + return tb; +} + +void CMainWindow::tabChanged(int index) +{ + if (index == -1) { + setWindowTitle("Qt Georges Editor"); + return; + } + + QTabBar *tb = getTabBar(); + //nlinfo(QString("%1").arg(index).toStdString().c_str()); + + Q_FOREACH(CGeorgesTreeViewDialog* dlg, _treeViewList) { + if (dlg->windowTitle() == tb->tabText(index)) { + //nlinfo(QString("%1 modified %2").arg(tb->tabText(index)). + // arg(dlg->modified()). + // toStdString().c_str()); + _currentView = dlg; + setWindowTitle("Qt Georges Editor - " + tb->tabText(index)); + _saveAction->setEnabled(dlg->modified()); + } + } +} + + void CMainWindow::openRecentFile() + { + QAction *action = qobject_cast(sender()); + if (action) + loadFile(action->data().toString()); + } + + void CMainWindow::setCurrentFile(const QString &fileName) + { + //curFile = fileName; + //setWindowFilePath(curFile); + + QSettings settings("georges_editor_qt.ini", QSettings::IniFormat); + settings.beginGroup("RecentFileList"); + QStringList files = settings.value("List").toStringList(); + settings.endGroup(); + + files.removeAll(fileName); + files.prepend(fileName); + while (files.size() > MaxRecentFiles) + files.removeLast(); + + settings.beginGroup("RecentFileList"); + settings.setValue("List",files); + settings.endGroup(); + + Q_FOREACH (QWidget *widget, QApplication::topLevelWidgets()) { + CMainWindow *mainWin = qobject_cast(widget); + if (mainWin) + mainWin->updateRecentFileActions(); + } + } + + void CMainWindow::updateRecentFileActions() + { + QSettings settings("georges_editor_qt.ini", QSettings::IniFormat); + settings.beginGroup("RecentFileList"); + QStringList files = settings.value("List").toStringList(); + settings.endGroup(); + int numRecentFiles = qMin(files.size(), (int)MaxRecentFiles); + + for (int i = 0; i < numRecentFiles; ++i) { + QString text = tr("&%1 %2").arg(i + 1).arg(QFileInfo(files[i]).fileName()); + recentFileActs[i]->setText(text); + recentFileActs[i]->setData(files[i]); + recentFileActs[i]->setVisible(true); + } + for (int j = numRecentFiles; j < MaxRecentFiles; ++j) + recentFileActs[j]->setVisible(false); + + _separatorAction->setVisible(numRecentFiles > 0); + } + + void CMainWindow::loadFile(const QString &fileName) + { + /*QFile file(fileName); + if (!file.open(QFile::ReadOnly | QFile::Text)) { + QMessageBox::warning(this, tr("Recent Files"), + tr("Cannot read file %1:\n%2.") + .arg(fileName) + .arg(file.errorString())); + return; + } + + QTextStream in(&file); + QApplication::setOverrideCursor(Qt::WaitCursor); + textEdit->setPlainText(in.readAll()); + QApplication::restoreOverrideCursor();*/ + + openTreeView(fileName); + setCurrentFile(fileName); + //statusBar()->showMessage(tr("File loaded"), 2000); + } +} /* namespace NLQT */ + +/* end of file */ diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/main_window.h b/code/ryzom/tools/leveldesign/georges_editor_qt/src/main_window.h new file mode 100644 index 000000000..fa616e7bb --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/main_window.h @@ -0,0 +1,122 @@ +/* + Georges Editor Qt + Copyright (C) 2010 Adrian Jaekel + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +*/ + +#ifndef MAIN_WINDOW_H +#define MAIN_WINDOW_H +#include + +// STL includes + +// Qt includes + +#include +#include + +// NeL includes +#include + +// Project includes + +namespace NLMISC { + class CConfigFile; +} + +namespace NLQT { + + class CGeorgesLogDialog; + class CObjectViewerDialog; + class CGeorgesDirTreeDialog; + class CGeorgesTreeViewDialog; + + +class CMainWindow : public QMainWindow +{ + Q_OBJECT + +public: + CMainWindow(QWidget *parent = 0); + ~CMainWindow(); + + CGeorgesTreeViewDialog* getEmptyView() { return _emptyView;} + QList& getTreeViewList() { return _treeViewList; } + QTabBar* getTabBar(); + void createEmptyView(); + +private Q_SLOTS: + void open(); + void create(); + void save(); + void settings(); + void about(); + void updateStatusBar(); + void openTreeView(QString); + void tabChanged(int); + void openRecentFile(); + +private: + void createActions(); + void createMenus(); + void createToolBars(); + void createStatusBar(); + void createDialogs(); + + void loadFile(const QString &fileName); + void updateRecentFileActions(); + void setCurrentFile(const QString &fileName); + + void cfcbQtStyle(NLMISC::CConfigFile::CVar &var); + void cfcbQtPalette(NLMISC::CConfigFile::CVar &var); + + CGeorgesLogDialog *_GeorgesLogDialog; + CObjectViewerDialog *_ObjectViewerDialog; + CGeorgesDirTreeDialog *_GeorgesDirTreeDialog; + QList _treeViewList; + CGeorgesTreeViewDialog *_emptyView; + CGeorgesTreeViewDialog *_currentView; + + QPalette _originalPalette; + + QTimer *_statusBarTimer; + + QMenu *_fileMenu; + QMenu *_viewMenu; + QMenu *_toolsMenu; + QMenu *_helpMenu; + QToolBar *_fileToolBar; + QToolBar *_editToolBar; + QToolBar *_toolsBar; + QAction *_openAction; + QAction *_createAction; + QAction *_saveAction; + QAction *_exitAction; + QAction *_setBackColorAction; + QAction *_settingsAction; + QAction *_aboutAction; + QAction *_aboutQtAction; + QAction *_separatorAction; + + + enum { MaxRecentFiles = 5 }; + QAction *recentFileActs[MaxRecentFiles]; + +};/* class CMainWindow */ + +} /* namespace NLQT */ + +#endif // MAIN_WINDOW_H diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/modules.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/modules.cpp new file mode 100644 index 000000000..4dc5f462c --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/modules.cpp @@ -0,0 +1,44 @@ +/* + Georges Editor Qt + Copyright (C) 2010 Adrian Jaekel + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "modules.h" + +NLQT::CConfiguration *Modules::_configuration = NULL; +NLQT::CObjectViewer *Modules::_objectViewer = NULL; +NLQT::CGeorges *Modules::_georges = NULL; +NLQT::CMainWindow *Modules::_mainWindow = NULL; + +void Modules::init() +{ + if (_configuration == NULL) _configuration = new NLQT::CConfiguration; + config().init(); + + if (_objectViewer == NULL) _objectViewer = new NLQT::CObjectViewer; + if (_georges == NULL) _georges = new NLQT::CGeorges; + if (_mainWindow == NULL) _mainWindow = new NLQT::CMainWindow; +} + +void Modules::release() +{ + delete _mainWindow; _mainWindow = NULL; + delete _objectViewer; _objectViewer = NULL; + delete _georges; _georges = NULL; + + config().release(); + delete _configuration; _configuration = NULL; +} diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/modules.h b/code/ryzom/tools/leveldesign/georges_editor_qt/src/modules.h new file mode 100644 index 000000000..9a156ab41 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/modules.h @@ -0,0 +1,44 @@ +/* + Georges Editor Qt + Copyright (C) 2010 Adrian Jaekel + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef MODULES_H +#define MODULES_H + +#include "configuration.h" +#include "object_viewer.h" +#include "main_window.h" +#include "georges.h" + +class Modules +{ +public: + static void init(); + static void release(); + + static NLQT::CConfiguration &config() { return *_configuration; } + static NLQT::CObjectViewer &objView() { return *_objectViewer; } + static NLQT::CGeorges &georges() { return *_georges;} + static NLQT::CMainWindow &mainWin() { return *_mainWindow; } +private: + static NLQT::CConfiguration *_configuration; + static NLQT::CObjectViewer *_objectViewer; + static NLQT::CMainWindow *_mainWindow; + static NLQT::CGeorges *_georges; +}; + +#endif // MODULES_H diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/object_viewer.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/object_viewer.cpp new file mode 100644 index 000000000..a819d09b3 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/object_viewer.cpp @@ -0,0 +1,411 @@ +/* + Georges Editor Qt + Copyright (C) 2010 Adrian Jaekel + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "object_viewer.h" + +// STL includes + +// NeL includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +// Project includes +#include "modules.h" +#include "configuration.h" + +using namespace std; +using namespace NLMISC; +using namespace NL3D; + +namespace NLQT { + +CObjectViewer::CObjectViewer() + : _Driver(NULL), + _phi(0), _psi(0),_dist(20), + _CurrentInstance("") +{ + +} + +CObjectViewer::~CObjectViewer() +{ + +} + +void CObjectViewer::reinit(nlWindow wnd, uint16 w, uint16 h) +{ + nldebug("CObjectViewert::reinit"); + + //release(); + //init(wnd, w, h); + _Driver->setDisplay(wnd, NL3D::UDriver::CMode(w, h, 32)); +} + +void CObjectViewer::init(nlWindow wnd, uint16 w, uint16 h) +{ + //H_AUTO2 + nldebug("CObjectViewer::init"); + + // load and set remap extensions from config + //Modules::config().configRemapExtensions(); + + // load and set search paths from config + //Modules::config().configSearchPaths(); + + // set background color from config + Modules::config().setAndCallback("BackgroundColor", CConfigCallback(this, &CObjectViewer::cfcbBackgroundColor)); + + // set graphics driver from config + Modules::config().setAndCallback("GraphicsDriver",CConfigCallback(this,&CObjectViewer::cfcbGraphicsDriver)); + + // create the driver + nlassert(!_Driver); + + _Driver = UDriver::createDriver(NULL, _Direct3D, NULL); + nlassert(_Driver); + + // initialize the window with config file values + _Driver->setDisplay(wnd, NL3D::UDriver::CMode(w, h, 32)); + + _Light = ULight::createLight(); + + // set mode of the light + _Light->setMode(ULight::DirectionalLight); + + // set position of the light + _Light->setPosition(CVector(-20.f, 30.f, 10.f)); + + // white light + _Light->setAmbiant(CRGBA(255, 255, 255)); + + // set and enable the light + _Driver->setLight(0, *_Light); + _Driver->enableLight(0); + + // Create a scene + _Scene = _Driver->createScene(true); + + _PlayListManager = _Scene->createPlayListManager(); + + _Scene->enableLightingSystem(true); + + // create the camera + UCamera camera = _Scene->getCam(); + + camera.setTransformMode (UTransformable::DirectMatrix); + + setSizeViewport(w, h); + + // camera will look at entities + updateCamera(0,0,0); + + NLMISC::CVector hotSpot=NLMISC::CVector(0,0,0); + + _MouseListener = _Driver->create3dMouseListener(); + _MouseListener->setMatrix(Modules::objView().getScene()->getCam().getMatrix()); + _MouseListener->setFrustrum(Modules::objView().getScene()->getCam().getFrustum()); + _MouseListener->setHotSpot(hotSpot); + _MouseListener->setMouseMode(U3dMouseListener::edit3d); +} + +void CObjectViewer::release() +{ + //H_AUTO2 + nldebug("CObjectViewer::release"); + + Modules::config().dropCallback("BackgroundColor"); + Modules::config().dropCallback("GraphicsDriver"); + + _Driver->delete3dMouseListener(_MouseListener); + + // delete all entities + deleteEntities(); + + _Scene->deletePlayListManager(_PlayListManager); + + // delete the scene + _Driver->deleteScene(_Scene); + + // delete the light + delete _Light; + + // release driver + nlassert(_Driver); + _Driver->release(); + delete _Driver; + _Driver = NULL; +} + +void CObjectViewer::updateInput() +{ + _Driver->EventServer.pump(); + + // New matrix from camera + _Scene->getCam().setTransformMode(NL3D::UTransformable::DirectMatrix); + _Scene->getCam().setMatrix (_MouseListener->getViewMatrix()); +} + +void CObjectViewer::renderDriver() +{ + _Driver->clearBuffers(_BackgroundColor); +} + +void CObjectViewer::renderScene() +{ + // render the scene + _Scene->render(); +} + +void CObjectViewer::renderDebug2D() +{ +} + +void CObjectViewer::saveScreenshot(const std::string &nameFile, bool jpg, bool png, bool tga) +{ + //H_AUTO2 + + // FIXME: create screenshot path if it doesn't exist! + + // empty bitmap + CBitmap bitmap; + // copy the driver buffer to the bitmap + _Driver->getBuffer(bitmap); + // create the file name + string filename = std::string("./") + nameFile; + // write the bitmap as a jpg, png or tga to the file + if (jpg) + { + string newfilename = CFile::findNewFile(filename + ".jpg"); + COFile outputFile(newfilename); + bitmap.writeJPG(outputFile, 100); + nlinfo("Screenshot '%s' saved", newfilename.c_str()); + } + if (png) + { + string newfilename = CFile::findNewFile(filename + ".png"); + COFile outputFile(newfilename); + bitmap.writePNG(outputFile, 24); + nlinfo("Screenshot '%s' saved", newfilename.c_str()); + } + if (tga) + { + string newfilename = CFile::findNewFile(filename + ".tga"); + COFile outputFile(newfilename); + bitmap.writeTGA(outputFile, 24, false); + nlinfo("Screenshot '%s' saved", newfilename.c_str()); + } +} + +bool CObjectViewer::loadMesh(const std::string &meshFileName, const std::string &skelFileName) +{ + CPath::addSearchPath(CFile::getPath(meshFileName), false, false); + + // create instance of the mesh character + UInstance Entity = _Scene->createInstance(meshFileName); + + USkeleton Skeleton = _Scene->createSkeleton(skelFileName); + + // if we can't create entity, skip it + if (Entity.empty()) return false; + + // create a new entity + EIT eit = (_Entities.insert (make_pair (CFile::getFilenameWithoutExtension(meshFileName), CEntity()))).first; + CEntity &entity = (*eit).second; + + // set the entity up + entity._Name = CFile::getFilenameWithoutExtension(meshFileName); + entity._Instance = Entity; + if (!Skeleton.empty()) + { + entity._Skeleton = Skeleton; + entity._Skeleton.bindSkin (entity._Instance); + } + entity._AnimationSet = _Driver->createAnimationSet(false); + entity._PlayList = _PlayListManager->createPlayList(entity._AnimationSet); + return true; +} + +void CObjectViewer::resetScene() +{ + deleteEntities(); + + // Reset camera. + //.. + + // to load files with the same name but located in different directories + //CPath::clearMap(); + + // load and set search paths from config + //Modules::config().configSearchPaths(); + + _CurrentInstance = ""; + + nlinfo("Scene cleared"); +} + +void CObjectViewer::updateCamera(float deltaPsi, float deltaPhi, float deltaDist) +{ + _phi += deltaPhi; + _psi += deltaPsi; + _dist += deltaDist; + + if(_phi < -NLMISC::Pi/2) _phi -= deltaPhi; + if(_phi > NLMISC::Pi/2) _phi -= deltaPsi; + if (_dist < 1) _dist = 1; + + NLMISC::CQuat q0,q1,q2; + NLMISC::CVector up(0,0,1); + NLMISC::CVector v(0,0,1); + + q0.setAngleAxis(v,_psi); + v = NLMISC::CVector(0,1,0); + q1.setAngleAxis(v,_phi); + q2 = q0 * q1; + NLMISC::CMatrix m0; + m0.setRot(q2); + NLMISC::CVector camera = m0 * NLMISC::CVector(_dist,0,0); + + _Scene->getCam().lookAt(camera, up); +} + +void CObjectViewer::setBackgroundColor(NLMISC::CRGBA backgroundColor) +{ + _BackgroundColor = backgroundColor; + + // config file variable changes + Modules::config().getConfigFile().getVar("BackgroundColor").setAsInt(_BackgroundColor.R, 0); + Modules::config().getConfigFile().getVar("BackgroundColor").setAsInt(_BackgroundColor.G, 1); + Modules::config().getConfigFile().getVar("BackgroundColor").setAsInt(_BackgroundColor.B, 2); +} + +void CObjectViewer::setGraphicsDriver(bool Direct3D) +{ + _Direct3D = Direct3D; + + if (_Direct3D) Modules::config().getConfigFile().getVar("GraphicsDriver").setAsString("Direct3D"); + else Modules::config().getConfigFile().getVar("GraphicsDriver").setAsString("OpenGL"); +} + +void CObjectViewer::setSizeViewport(uint16 w, uint16 h) +{ + _Scene->getCam().setPerspective((float)Pi/2.f, (float)w/h, 0.1f, 1000); +} + +void CObjectViewer::getSizeViewport(float &left, float &right, float &bottom, float &top, float &znear, float &zfar) +{ + //_Scene->getCam().setPerspective((float)Pi/2.f, (float)w/h, 0.1f, 1000); + _Scene->getCam().getFrustum(left, right, bottom, top, znear, zfar); +} + +void CObjectViewer::setCurrentObject(const std::string &name) +{ + if ((_Entities.count(name) != 0) || ( name.empty() )) _CurrentInstance = name; + else nlerror ("Entity %s not found", name.c_str()); + nlinfo("set current entity %s", _CurrentInstance.c_str()); +} + +CEntity& CObjectViewer::getEntity(const std::string &name) +{ + if ( _Entities.count(name) == 0) nlerror("Entity %s not found", name.c_str()); + EIT eit = _Entities.find (name); + return (*eit).second; +} + +void CObjectViewer::getListObjects(std::vector &listObj) +{ + listObj.clear(); + for (EIT eit = _Entities.begin(); eit != _Entities.end(); ++eit) + listObj.push_back((*eit).second._Name); +} + +void CObjectViewer::deleteEntity(CEntity &entity) +{ + if (entity._PlayList != NULL) + { + _PlayListManager->deletePlayList (entity._PlayList); + entity._PlayList = NULL; + } + + if (entity._AnimationSet != NULL) + { + _Driver->deleteAnimationSet(entity._AnimationSet); + entity._AnimationSet = NULL; + } + + if (!entity._Skeleton.empty()) + { + entity._Skeleton.detachSkeletonSon(entity._Instance); + + _Scene->deleteSkeleton(entity._Skeleton); + entity._Skeleton = NULL; + } + + if (!entity._Instance.empty()) + { + _Scene->deleteInstance(entity._Instance); + entity._Instance = NULL; + } +} + +void CObjectViewer::deleteEntities() +{ + for (EIT eit = _Entities.begin(); eit != _Entities.end(); ++eit) + { + CEntity &entity = (*eit).second; + deleteEntity(entity); + } + _Entities.clear(); +} + +void CObjectViewer::cfcbBackgroundColor(NLMISC::CConfigFile::CVar &var) +{ + // read variable from config file + _BackgroundColor = CRGBA(var.asInt(0), var.asInt(1), var.asInt(2)); +} + +void CObjectViewer::cfcbGraphicsDriver(NLMISC::CConfigFile::CVar &var) +{ + // Choose driver opengl to work correctly under Linux example + _Direct3D = false; //_Driver = OpenGL; + +#ifdef NL_OS_WINDOWS + std::string driver = var.asString(); + if (driver == "Direct3D") _Direct3D = true; //m_Driver = Direct3D; + else if (driver == "OpenGL") _Direct3D = false; //m_Driver = OpenGL; + else nlwarning("Invalid driver specified, defaulting to OpenGL"); +#endif +} + +} /* namespace NLQT */ diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/object_viewer.h b/code/ryzom/tools/leveldesign/georges_editor_qt/src/object_viewer.h new file mode 100644 index 000000000..6da05a64c --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/object_viewer.h @@ -0,0 +1,191 @@ +/* + Georges Editor Qt + Copyright (C) 2010 Adrian Jaekel + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef OBJECT_VIEWER_H +#define OBJECT_VIEWER_H + +#include + +// STL includes +#include +#include + +// NeL includes +#include +#include +#include + +// Project includes +#include "entity.h" + +namespace NL3D { + class UDriver; + class UScene; + class ULight; + class UInstance; + class UCamera; + class USkeleton; + class UPlayListManager; + class U3dMouseListener; +} + +/** +namespace NLQT +@brief namespace NLQT +*/ +namespace NLQT { + +/** +@class CObjectViewer +A CObjectViewer class loading and viewing shape, particle system files. +*/ +class CObjectViewer +{ +public: + /// Default constructor. + CObjectViewer(); + + virtual ~CObjectViewer(); + + /// Init a driver and create scene. + /// @param wnd - handle window. + /// @param w - width window. + /// @param h - height window. + void init(nlWindow wnd, uint16 w, uint16 h); + + void reinit(nlWindow wnd, uint16 w, uint16 h); + + /// Release class. + void release(); + + /// Update mouse and keyboard events. And update camera matrix. + void updateInput(); + + /// Render Driver (clear all buffers and set background color). + void renderDriver(); + + /// Render current scene. + void renderScene(); + + /// Render Debug 2D (stuff for dev). + void renderDebug2D(); + + /// Make a screenshot of the current scene and save. + void saveScreenshot(const std::string &nameFile, bool jpg, bool png, bool tga); + + /// Load a mesh or particle system and add to current scene. + /// @param meshFileName - name loading shape or ps file. + /// @param skelFileName - name loading skeletin file. + /// @return true if file have been loaded, false if file have not been loaded. + bool loadMesh (const std::string &meshFileName, const std::string &skelFileName); + + /// Reset current scene. + void resetScene(); + + /// Update the navigation camera. + /// @param deltaPsi - delta angle horizontal (radians). + /// @param deltaPhi - delta angle vertical (radians). + /// @param deltaDist - delta distance. + void updateCamera(float deltaPsi, float deltaPhi, float deltaDist); + + /// Set the background color. + /// @param backgroundColor - background color. + void setBackgroundColor(NLMISC::CRGBA backgroundColor); + + /// Set type driver. + /// @param Direct3D - type driver (true - Direct3D) or (false -OpenGL) + void setGraphicsDriver(bool Direct3D); + + /// Set size viewport for correct set perspective + /// @param w - width window. + /// @param h - height window. + void setSizeViewport(uint16 w, uint16 h); + void getSizeViewport(float &left, float &right, float &bottom, float &top, float &znear, float &zfar); + + /// Select instance from the scene + /// @param name - name instance, "" if no instance edited + void setCurrentObject(const std::string &name); + + /// Get current instance from the scene + /// @return name current instance, "" if no instance edited + const std::string& getCurrentObject() { return _CurrentInstance; } + + /// Get entity from the scene + /// @return ref Entity + CEntity& getEntity(const std::string &name); + + /// Get full list instances from the scene + /// @param listObj - ref of return list instances + void getListObjects(std::vector &listObj); + + /// Get value background color. + /// @return background color. + NLMISC::CRGBA getBackgroundColor() { return _BackgroundColor; } + + /// Get type driver. + /// @return true if have used Direct3D driver, false OpenGL driver. + inline bool getDirect3D() { return _Direct3D; } + + /// Get a pointer to the driver. + /// @return pointer to the driver. + inline NL3D::UDriver *getDriver() { return _Driver; } + + /// Get a pointer to the scene. + /// @return pointer to the scene. + inline NL3D::UScene *getScene() { return _Scene; } + + /// Get a manager of playlist + /// @return pointer to the UPlayListManager + inline NL3D::UPlayListManager *getPlayListManager() { return _PlayListManager; } + +private: + void deleteEntity (CEntity &entity); + + /// Delete all entities + void deleteEntities(); + + /// Load background color from config file, intended for CConfiguration. + void cfcbBackgroundColor(NLMISC::CConfigFile::CVar &var); + void cfcbGraphicsDriver(NLMISC::CConfigFile::CVar &var); + + NLMISC::CRGBA _BackgroundColor; + + NL3D::UDriver *_Driver; + NL3D::UScene *_Scene; + NL3D::UPlayListManager *_PlayListManager; + NL3D::ULight *_Light; + NL3D::UCamera *_Camera; + NL3D::U3dMouseListener *_MouseListener; + + // The entities storage + CEntities _Entities; + + /// Camera parameters. + float _phi, _psi, _dist; + + bool _Direct3D; + + std::string _CurrentInstance; + + // a temporary solution, and later remove + friend class CAnimationSetDialog; +};/* class CObjectViewer */ + +} /* namespace NLQT */ + +#endif // OBJECT_VIEWER_H diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/objectviewer_dialog.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/objectviewer_dialog.cpp new file mode 100644 index 000000000..0fb8169ca --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/objectviewer_dialog.cpp @@ -0,0 +1,408 @@ +/* + Georges Editor Qt + Copyright (C) 2010 Adrian Jaekel + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "objectviewer_dialog.h" + +// Qt includes +#include +#include +#include +#include +#include + +// NeL includes +#include +#include + +#include +#include +#include + +// Project includes +#include "modules.h" + +using namespace std; +using namespace NL3D; + +namespace NLQT { + +CObjectViewerDialog::CObjectViewerDialog(QWidget *parent) +: _isGraphicsInitialized(false), _isGraphicsEnabled(false), QDockWidget(parent) +{ + _ui.setupUi(this); + + //widget = new QWidget(dockWidgetContents); + //widget->setObjectName(QString::fromUtf8("widget")); + + + _nlw = new QNLWidget(_ui.dockWidgetContents); + _nlw->setObjectName(QString::fromUtf8("nlwidget")); + _ui.gridLayout->addWidget(_nlw, 0, 0, 1, 1); + //nlw->setLayout(new QGridLayout(nlw)); + //_ui.widget = nlw; + //QWidget * w = widget(); + + _isGraphicsEnabled = true; + + // As a special case, a QTimer with a timeout of 0 will time out as soon as all the events in the window system's event queue have been processed. + // This can be used to do heavy work while providing a snappy user interface. + _mainTimer = new QTimer(this); + connect(_mainTimer, SIGNAL(timeout()), this, SLOT(updateRender())); + // timer->start(); // <- timeout 0 + // it's heavy on cpu, though, when no 3d driver initialized :) + _mainTimer->start(5); // 25fps +} + +CObjectViewerDialog::~CObjectViewerDialog() { + _mainTimer->stop(); +} + +void CObjectViewerDialog::init() +{ + connect(this, SIGNAL(topLevelChanged(bool)), + this, SLOT(topLevelChanged(bool))); + //H_AUTO2 + nldebug("CObjectViewerDialog::init %d",_nlw->winId()); + +#ifdef NL_OS_UNIX + dynamic_cast(widget())->makeCurrent(); +#endif // NL_OS_UNIX + + Modules::objView().init((nlWindow)_nlw->winId(), 20, 20); + setMouseTracking(true); +} + +void CObjectViewerDialog::setVisible(bool visible) +{ + // called by show() + // code assuming visible window needed to init the 3d driver + if (visible != isVisible()) + { + if (visible) + { + QDockWidget::setVisible(true); + updateInitialization(true); + } + else + { + updateInitialization(false); + QDockWidget::setVisible(false); + } + } +} + +void CObjectViewerDialog::updateInitialization(bool visible) +{ + //nldebug("CMainWindow::updateInitialization"); + bool done; + do + { + done = true; // set false whenever change + bool wantGraphics = _isGraphicsEnabled && visible; + // bool wantLandscape = wantGraphics && m_IsGraphicsInitialized && isLandscapeEnabled; + + // .. stuff that depends on other stuff goes on top to prioritize deinitialization + + // Landscape + // ... + + // Graphics (Driver) + if (_isGraphicsInitialized) + { + if (!wantGraphics) + { + _isGraphicsInitialized = false; + release(); + _mainTimer->stop(); + done = false; + } + + } + else + { + if (wantGraphics) + { + init(); + _isGraphicsInitialized = true; + _mainTimer->start(5); + done = false; + } + } + + + + } while (!done); +} + +void CObjectViewerDialog::updateRender() +{ + //nldebug("CMainWindow::updateRender"); + updateInitialization(isVisible()); + + //QModelIndex index = _dirModel->setRootPath("D:/Dev/Ryzom/code/ryzom/common/data_leveldesign/leveldesign"); + //_dirTree->setRootIndex(index); + + if (isVisible()) + { + // call all update functions + // 01. Update Utilities (configuration etc) + + // 02. Update Time (deltas) + // ... + + // 03. Update Receive (network, servertime, receive messages) + // ... + + // 04. Update Input (keyboard controls, etc) + if (_isGraphicsInitialized) + Modules::objView().updateInput(); + + // 05. Update Weather (sky, snow, wind, fog, sun) + // ... + + // 06. Update Entities (movement, do after possible tp from incoming messages etc) + // - Move other entities + // - Update self entity + // - Move bullets + // ... + + // 07. Update Landscape (async zone loading near entity) + // ... + + // 08. Update Collisions (entities) + // - Update entities + // - Update move container (swap with Update entities? todo: check code!) + // - Update bullets + // ... + + // 09. Update Animations (playlists) + // - Needs to be either before or after entities, not sure, + // there was a problem with wrong order a while ago!!! + + + //Modules::objView().updateAnimation(_AnimationDialog->getTime()); + + // 10. Update Camera (depends on entities) + // ... + + // 11. Update Interface (login, ui, etc) + // ... + + // 12. Update Sound (sound driver) + // ... + + // 13. Update Send (network, send new position etc) + // ... + + // 14. Update Debug (stuff for dev) + // ... + + if (_isGraphicsInitialized && !Modules::objView().getDriver()->isLost()) + { + // 01. Render Driver (background color) + Modules::objView().renderDriver(); // clear all buffers + + // 02. Render Sky (sky scene) + // ... + + // 04. Render Scene (entity scene) + Modules::objView().renderScene(); + + // 05. Render Effects (flare) + // ... + + // 06. Render Interface 3D (player names) + // ... + + // 07. Render Debug 3D + // ... + + // 08. Render Interface 2D (chatboxes etc, optionally does have 3d) + // ... + + // 09. Render Debug 2D (stuff for dev) + Modules::objView().renderDebug2D(); + + // swap 3d buffers + Modules::objView().getDriver()->swapBuffers(); + } + } +} + +void CObjectViewerDialog::release() +{ + //H_AUTO2 + nldebug("CObjectViewerDialog::release"); + + Modules::objView().release(); +} + +void CObjectViewerDialog::reinit() +{ + //H_AUTO2 + nldebug("CObjectViewerDialog::reinit"); + + Modules::objView().release(); + //Modules::objView().reinit(_ui.frame->winId(), width(), height()); +} + +QAction *CObjectViewerDialog::createSaveScreenshotAction(QObject *parent) +{ + QAction *action = new QAction(parent); + connect(action, SIGNAL(triggered()), this, SLOT(saveScreenshot())); + return action; +} + +QAction *CObjectViewerDialog::createSetBackgroundColor(QObject *parent) +{ + QAction *action = new QAction(parent); + connect(action, SIGNAL(triggered()), this, SLOT(setBackgroundColor())); + return action; +} + +void CObjectViewerDialog::saveScreenshot() +{ + Modules::objView().saveScreenshot("screenshot", false, true, false); +} + +void CObjectViewerDialog::setBackgroundColor() +{ + QColor color = QColorDialog::getColor(QColor(Modules::objView().getBackgroundColor().R, + Modules::objView().getBackgroundColor().G, + Modules::objView().getBackgroundColor().B)); + Modules::objView().setBackgroundColor(NLMISC::CRGBA(color.red(), color.green(), color.blue())); +} + +void CObjectViewerDialog::topLevelChanged ( bool topLevel ) { + //nldebug("CObjectViewerDialog::topLevelChanged topLevel:%d",topLevel); + nldebug("CObjectViewerDialog::topLevelChanged winId:%d",winId()); + // winId changing when re/docking + //Modules::georges().init(); + Modules::objView().reinit((nlWindow)_nlw->winId(), _nlw->width(), _nlw->height()); +} + +void CObjectViewerDialog::resizeEvent(QResizeEvent *resizeEvent) +{ + QDockWidget::resizeEvent(resizeEvent); + if (Modules::objView().getDriver()) + Modules::objView().setSizeViewport(resizeEvent->size().width(), resizeEvent->size().height()); + + // The OpenGL driver does not resize automatically. + // The Direct3D driver breaks the window mode to include window borders when calling setMode windowed. + + // Resizing the window after switching drivers a few times becomes slow. + // There is probably something inside the drivers not being released properly. +} + +void CObjectViewerDialog::wheelEvent(QWheelEvent *event) +{ + //nldebug("CObjectViewerDialog::wheelEvent"); + // Get relative positions. + float fX = 1.0f - (float)event->pos().x() / this->width(); + float fY = 1.0f - (float)event->pos().y() / this->height(); + + // Set the buttons currently pressed. + NLMISC::TMouseButton buttons = (NLMISC::TMouseButton)getNelButtons(event); + if(event->delta() > 0) + Modules::objView().getDriver()->EventServer.postEvent(new NLMISC::CEventMouseWheel(-fX, fY, buttons, true, this)); + else + Modules::objView().getDriver()->EventServer.postEvent(new NLMISC::CEventMouseWheel(-fX, fY, buttons, false, this)); + +} + +uint32 CObjectViewerDialog::getNelButtons(QMouseEvent *event) { + //nldebug("CObjectViewerDialog::getNelButtons"); + uint32 buttons = NLMISC::noButton; + if(event->buttons() & Qt::LeftButton) buttons |= NLMISC::leftButton; + if(event->buttons() & Qt::RightButton) buttons |= NLMISC::rightButton; + if(event->buttons() & Qt::MidButton) buttons |= NLMISC::middleButton; + if(event->modifiers() & Qt::ControlModifier) buttons |= NLMISC::ctrlButton; + if(event->modifiers() & Qt::ShiftModifier) buttons |= NLMISC::shiftButton; + if(event->modifiers() & Qt::AltModifier) buttons |= NLMISC::altButton; + + return buttons; +} + +uint32 CObjectViewerDialog::getNelButtons(QWheelEvent *event) { + //nldebug("CObjectViewerDialog::getNelButtons"); + uint32 buttons = NLMISC::noButton; + if(event->buttons() & Qt::LeftButton) buttons |= NLMISC::leftButton; + if(event->buttons() & Qt::RightButton) buttons |= NLMISC::rightButton; + if(event->buttons() & Qt::MidButton) buttons |= NLMISC::middleButton; + if(event->modifiers() & Qt::ControlModifier) buttons |= NLMISC::ctrlButton; + if(event->modifiers() & Qt::ShiftModifier) buttons |= NLMISC::shiftButton; + if(event->modifiers() & Qt::AltModifier) buttons |= NLMISC::altButton; + + return buttons; +} + +void CObjectViewerDialog::mousePressEvent(QMouseEvent *event) { + //nldebug("CObjectViewerDialog::mousePressEvent"); + // Get relative positions. + float fX = 1.0f - (float)event->pos().x() / this->width(); + float fY = 1.0f - (float)event->pos().y() / this->height(); + + // Set the buttons currently pressed. + NLMISC::TMouseButton buttons = (NLMISC::TMouseButton)getNelButtons(event); + + if(event->button() == Qt::LeftButton) + Modules::objView().getDriver()->EventServer.postEvent( + new NLMISC::CEventMouseDown( -fX, fY, + (NLMISC::TMouseButton)(NLMISC::leftButton|(buttons&~(NLMISC::leftButton|NLMISC::middleButton|NLMISC::rightButton))), this)); + if(event->button() == Qt::MidButton) + Modules::objView().getDriver()->EventServer.postEvent( + new NLMISC::CEventMouseDown( -fX, fY, + (NLMISC::TMouseButton)(NLMISC::middleButton|(buttons&~(NLMISC::middleButton|NLMISC::leftButton|NLMISC::rightButton))), this)); + if(event->button() == Qt::RightButton) + Modules::objView().getDriver()->EventServer.postEvent( + new NLMISC::CEventMouseDown( -fX, fY, + (NLMISC::TMouseButton)(NLMISC::rightButton|(buttons&~(NLMISC::rightButton|NLMISC::leftButton|NLMISC::middleButton))), this)); +} + +void CObjectViewerDialog::mouseReleaseEvent(QMouseEvent *event) { + //nldebug("CObjectViewerDialog::mouseReleaseEvent"); + // Get relative positions. + float fX = 1.0f - (float)event->pos().x() / this->width(); + float fY = 1.0f - (float)event->pos().y() / this->height(); + + // Set the buttons currently pressed. + NLMISC::TMouseButton buttons = (NLMISC::TMouseButton)getNelButtons(event); + + if(event->button() == Qt::LeftButton) + Modules::objView().getDriver()->EventServer.postEvent( + new NLMISC::CEventMouseUp( -fX, fY, NLMISC::leftButton, this)); + if(event->button() == Qt::MidButton) + Modules::objView().getDriver()->EventServer.postEvent( + new NLMISC::CEventMouseUp( -fX, fY, NLMISC::middleButton, this)); + if(event->button() == Qt::RightButton) + Modules::objView().getDriver()->EventServer.postEvent( + new NLMISC::CEventMouseUp( -fX, fY, NLMISC::rightButton, this)); +} + +void CObjectViewerDialog::mouseMoveEvent(QMouseEvent *event) { + //nldebug("CObjectViewerDialog::mouseMoveEvent"); + // Get relative positions. + float fX = 1.0f - (float)event->pos().x() / this->width(); + float fY = 1.0f - (float)event->pos().y() / this->height(); + + if ((fX == 0.5f) && (fY == 0.5f)) return; + NLMISC::TMouseButton buttons = (NLMISC::TMouseButton)getNelButtons(event); + Modules::objView().getDriver()->EventServer.postEvent(new NLMISC::CEventMouseMove(-fX, fY, buttons, this)); +} + +} /* namespace NLQT */ diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/objectviewer_dialog.h b/code/ryzom/tools/leveldesign/georges_editor_qt/src/objectviewer_dialog.h new file mode 100644 index 000000000..eb80000ab --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/objectviewer_dialog.h @@ -0,0 +1,108 @@ +/* + Georges Editor Qt + Copyright (C) 2010 Adrian Jaekel + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef OBJECTVIEWER_DIALOG_H +#define OBJECTVIEWER_DIALOG_H + +#include +#include + +#include "ui_objectviewer_form.h" + +// Qt includes +#include +#include +#include + +// STL includes + +// NeL includes +#include + +// Project includes + +#ifdef NL_OS_WINDOWS +//typedef QDockWidget QNLWidget; +typedef QWidget QNLWidget; +#else // NL_OS_UNIX +typedef QGLWidget QNLWidget; +#endif // NL_OS_UNIX + +class QAction; + +namespace NLQT { + +class CObjectViewerDialog: public QDockWidget, public NLMISC::IEventEmitter +{ + Q_OBJECT + +public: + CObjectViewerDialog(QWidget *parent = 0); + ~CObjectViewerDialog(); + + virtual void setVisible(bool visible); + // virtual QPaintEngine* paintEngine() const { return NULL; } + + void init(); + void release(); + void reinit(); + + QAction *createSaveScreenshotAction(QObject *parent); + QAction *createSetBackgroundColor(QObject *parent); + +private Q_SLOTS: + void updateRender(); + + void saveScreenshot(); + void setBackgroundColor(); + + void submitEvents(NLMISC::CEventServer &server, bool allWindows) { }; + void emulateMouseRawMode(bool) { }; + + void topLevelChanged(bool topLevel); + +protected: + virtual void resizeEvent(QResizeEvent *resizeEvent); + virtual void mousePressEvent(QMouseEvent *event); + virtual void mouseReleaseEvent(QMouseEvent *event); + virtual void wheelEvent(QWheelEvent *event); + virtual void mouseMoveEvent(QMouseEvent *event); + + uint32 getNelButtons(QMouseEvent *event); + uint32 getNelButtons(QWheelEvent *event); + +private: + CObjectViewerDialog(const CObjectViewerDialog &); + CObjectViewerDialog &operator=(const CObjectViewerDialog &); + + void updateInitialization(bool visible); + + Ui::CObjectViewerDialog _ui; + + // render stuff + QTimer *_mainTimer; + bool _isGraphicsInitialized, _isGraphicsEnabled; + + QNLWidget * _nlw; + + friend class CMainWindow; +}; /* CObjectViewerDialog */ + +} /* namespace NLQT */ + +#endif // OBJECTVIEWER_DIALOG_H diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/objectviewer_form.ui b/code/ryzom/tools/leveldesign/georges_editor_qt/src/objectviewer_form.ui new file mode 100644 index 000000000..fefe3f5b1 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/objectviewer_form.ui @@ -0,0 +1,28 @@ + + + CObjectViewerDialog + + + + 0 + 0 + 352 + 286 + + + + + 80 + 50 + + + + 3D View + + + + + + + + diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/qt_displayer.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/qt_displayer.cpp new file mode 100644 index 000000000..0c49f3447 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/qt_displayer.cpp @@ -0,0 +1,113 @@ +/* +Georges Editor Qt +Copyright (C) 2010 Adrian Jaekel + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +*/ + +// Nel includes + +#include "qt_displayer.h" +#include +#include +#include + +namespace NLQT { + + CQtDisplayer::CQtDisplayer(QPlainTextEdit *dlgDebug, bool eraseLastLog, const char *displayerName, bool raw) + : NLMISC::IDisplayer (displayerName), _NeedHeader(true), _LastLogSizeChecked(0), _Raw(raw) { + setParam(dlgDebug,eraseLastLog); + } + + CQtDisplayer::CQtDisplayer() : IDisplayer (""), _NeedHeader(true), _LastLogSizeChecked(0), _Raw(false) { + ; + } + + CQtDisplayer::~CQtDisplayer() { + ; + } + + void CQtDisplayer::setParam (QPlainTextEdit *dlgDebug, bool eraseLastLog) { + m_DlgDebug=dlgDebug; + //dlgDebug->dlgDbgText->WriteText("test"); + } + + void CQtDisplayer::doDisplay ( const NLMISC::CLog::TDisplayInfo& args, const char *message ) { + bool needSpace = false; + std::string str; + + if(m_DlgDebug==NULL) + return; + + QTextCharFormat format; + + if (args.Date != 0 && !_Raw) { + str += dateToHumanString(args.Date); + needSpace = true; + } + + if (args.LogType != NLMISC::CLog::LOG_NO && !_Raw) { + if (needSpace) { str += " "; needSpace = false; } + str += logTypeToString(args.LogType); + if (args.LogType == NLMISC::CLog::LOG_WARNING) + format.setForeground(QBrush(QColor("red"))); + else + format.setForeground(QBrush(QColor("black"))); + needSpace = true; + } + + // Write thread identifier + /*if ( args.ThreadId != 0 && !_Raw) { + if (needSpace) { str += " "; needSpace = false; } + str += NLMISC::toString(args.ThreadId); + needSpace = true; + }*/ + /*if (!args.ProcessName.empty() && !_Raw) { + if (needSpace) { str += " "; needSpace = false; } + str += args.ProcessName; + needSpace = true; + }*/ + + //if (args.FileName != NULL && !_Raw) { + // if (needSpace) { str += " "; needSpace = false; } + // str += NLMISC::CFile::getFilename(args.FileName); + // needSpace = true; + //} + + /*if (args.Line != -1 && !_Raw) { + if (needSpace) { str += " "; needSpace = false; } + str += NLMISC::toString(args.Line); + needSpace = true; + }*/ + + if (args.FuncName != NULL && !_Raw) { + if (needSpace) { str += " "; needSpace = false; } + str += args.FuncName; + needSpace = true; + } + + if (needSpace) { str += " : "; needSpace = false; } + str += message; + + + + m_DlgDebug->textCursor().insertText(str.c_str(), format); + //m_DlgDebug->setCenterOnScroll(true); + m_DlgDebug->centerCursor(); + //m_DlgDebug->ensureCursorVisible(); + + } + +} \ No newline at end of file diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/qt_displayer.h b/code/ryzom/tools/leveldesign/georges_editor_qt/src/qt_displayer.h new file mode 100644 index 000000000..baa4fd371 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/qt_displayer.h @@ -0,0 +1,53 @@ +/* +Georges Editor Qt +Copyright (C) 2010 Adrian Jaekel + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +*/ + + +#ifndef QTDISPLAYER_H +#define QTDISPLAYER_H + +// NeL includes +#include "modules.h" +#include + +// Qt includes +#include + +namespace NLQT { + + class CQtDisplayer : virtual public NLMISC::IDisplayer + { + public: + CQtDisplayer(QPlainTextEdit *dlgDebug, bool eraseLastLog = false, const char *displayerName = "", bool raw = false); + CQtDisplayer(); + ~CQtDisplayer (); + void setParam (QPlainTextEdit *dlgDebug, bool eraseLastLog = false); + + protected: + virtual void doDisplay ( const NLMISC::CLog::TDisplayInfo& args, const char *message ); + + private: + QPlainTextEdit *m_DlgDebug; + bool _NeedHeader; + uint _LastLogSizeChecked; + bool _Raw; + };/* class CQtDisplayer */ + +} /* namespace NLQT */ + +#endif //QTDISPLAYER_H \ No newline at end of file diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/settings_dialog.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/settings_dialog.cpp new file mode 100644 index 000000000..483c78225 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/settings_dialog.cpp @@ -0,0 +1,200 @@ +/* +Georges Editor Qt +Copyright (C) 2010 Adrian Jaekel + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "settings_dialog.h" + +// Qt includes +#include +#include +#include + +// NeL includes +#include + +// Project includes +#include "modules.h" + +using namespace NLMISC; + +namespace NLQT { + + CSettingsDialog::CSettingsDialog(QWidget *parent) + : QDialog(parent) + { + ui.setupUi(this); + + // setup config file callbacks and initialize values + Modules::config().setAndCallback("GraphicsDrivers", CConfigCallback(this, &CSettingsDialog::cfcbGraphicsDrivers)); + Modules::config().setAndCallback("SearchPaths", CConfigCallback(this, &CSettingsDialog::cfcbSearchPaths)); + Modules::config().setAndCallback("LeveldesignPath", CConfigCallback(this, &CSettingsDialog::cfcbLeveldesignPath)); + + // load settings from the config file + + connect(ui.addToolButton, SIGNAL(clicked()), this, SLOT(addPath())); + connect(ui.removeToolButton, SIGNAL(clicked()), this, SLOT(removePath())); + connect(ui.upToolButton, SIGNAL(clicked()), this, SLOT(upPath())); + connect(ui.downToolButton, SIGNAL(clicked()), this, SLOT(downPath())); + connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(applyPressed())); + + connect(ui.browseLdPath, SIGNAL(clicked()), this, SLOT(browseLeveldesignPath())); + +#ifdef NL_OS_UNIX + ui.driverGraphComboBox->setEnabled(false); +#endif + + } + + CSettingsDialog::~CSettingsDialog() + { + Modules::config().dropCallback("GraphicsDrivers"); + Modules::config().dropCallback("SearchPaths"); + Modules::config().dropCallback("LeveldesignPath"); + } + + void CSettingsDialog::addPath() + { + QListWidgetItem *newItem = new QListWidgetItem; + QFileDialog dialog(this); + dialog.setOption(QFileDialog::ShowDirsOnly, true); + dialog.setFileMode(QFileDialog::Directory); + if (dialog.exec()) { + QString newPath = dialog.selectedFiles().first(); + if (!newPath.isEmpty()) + { + newItem->setText(newPath); + newItem->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable); + ui.pathsListWidget->addItem(newItem); + } + } + } + + void CSettingsDialog::removePath() + { + QListWidgetItem *removeItem = ui.pathsListWidget->takeItem(ui.pathsListWidget->currentRow()); + if (!removeItem) delete removeItem; + } + + void CSettingsDialog::upPath() + { + sint currentRow = ui.pathsListWidget->currentRow(); + if (!(currentRow == 0)) + { + QListWidgetItem *item = ui.pathsListWidget->takeItem(currentRow); + ui.pathsListWidget->insertItem(--currentRow, item); + ui.pathsListWidget->setCurrentRow(currentRow); + } + } + + void CSettingsDialog::downPath() + { + sint currentRow = ui.pathsListWidget->currentRow(); + if (!(currentRow == ui.pathsListWidget->count()-1)) + { + QListWidgetItem *item = ui.pathsListWidget->takeItem(currentRow); + ui.pathsListWidget->insertItem(++currentRow, item); + ui.pathsListWidget->setCurrentRow(currentRow); + } + } + + void CSettingsDialog::applyPressed() + { + + // settings take after restart the program + /*QMessageBox::warning(this, tr("Settings"), + tr("Graphics and sound settings " + "take after restart the program"), + QMessageBox::Ok);*/ + + // save graphics settings to config file + Modules::config().getConfigFile().getVar("GraphicsDriver").setAsString(ui.driverGraphComboBox->currentText().toStdString()); + + // save leveldesign path to config file + std::string ldPath = ui.leveldesignPath->text().toStdString(); + Modules::config().getConfigFile().getVar("LeveldesignPath").forceAsString(ldPath); + Q_EMIT ldPathChanged(ldPath.c_str()); + + // save search paths to config file + std::vector list; + for (sint i = 0; i < ui.pathsListWidget->count(); ++i) + { + std::string str = ui.pathsListWidget->item(i)->text().toStdString(); + if (str != "") + list.push_back(str); + } + + if (list.empty()) { + Modules::config().getConfigFile().getVar("SearchPaths").forceAsString(""); + } else { + Modules::config().getConfigFile().getVar("SearchPaths").forceAsString(""); + Modules::config().getConfigFile().getVar("SearchPaths").setAsString(list); + } + + // save config file + Modules::config().getConfigFile().save(); + + // reload search paths + Modules::config().configSearchPaths(); + Modules::config().configLeveldesignPath(); + } + + void CSettingsDialog::cfcbGraphicsDrivers(NLMISC::CConfigFile::CVar &var) + { + while (ui.driverGraphComboBox->count()) + ui.driverGraphComboBox->removeItem(0); + + // load types graphics driver from the config file + for (uint i = 0; i < var.size(); ++i) + ui.driverGraphComboBox->addItem(var.asString(i).c_str()); + + // set graphics driver from the config file + QString value = Modules::config().getValue("GraphicsDriver",std::string("OpenGL")).c_str(); + QString dn = value.toLower(); + for (sint i = 0; i < ui.driverGraphComboBox->count(); ++i) + { + if (dn == ui.driverGraphComboBox->itemText(i).toLower()) + { + ui.driverGraphComboBox->setCurrentIndex(i); + return; + } + } + } + + void CSettingsDialog::cfcbSearchPaths(NLMISC::CConfigFile::CVar &var) + { + ui.pathsListWidget->clear(); + + // load search paths from the config file + for (uint i = 0; i < var.size(); ++i) + { + ui.pathsListWidget->addItem(var.asString(i).c_str()); + ui.pathsListWidget->item(i)->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable); + } + } + + void CSettingsDialog::cfcbLeveldesignPath(NLMISC::CConfigFile::CVar &var) + { + // load leveldesign path from the config file + ui.leveldesignPath->setText(var.asString().c_str()); + } + + void CSettingsDialog::browseLeveldesignPath() + { + ui.leveldesignPath->setText(QFileDialog::getExistingDirectory(this, tr("Open Directory"), + QDir::currentPath(), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks)); + } +} /* namespace NLQT */ \ No newline at end of file diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/settings_dialog.h b/code/ryzom/tools/leveldesign/georges_editor_qt/src/settings_dialog.h new file mode 100644 index 000000000..f894219b6 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/settings_dialog.h @@ -0,0 +1,65 @@ +/* + Georges Editor Qt + Copyright (C) 2010 Adrian Jaekel + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef SETTINGS_DIALOG_H +#define SETTINGS_DIALOG_H + +#include +#include "ui_settings_form.h" + +// STL includes + +// NeL includes +#include + +// Project includes + +namespace NLQT { + +class CSettingsDialog: public QDialog +{ + Q_OBJECT + +public: + CSettingsDialog(QWidget *parent = 0); + ~CSettingsDialog(); + +Q_SIGNALS: + void ldPathChanged(QString); + +private Q_SLOTS: + void addPath(); + void removePath(); + void upPath(); + void downPath(); + void applyPressed(); + void browseLeveldesignPath(); + +private: + void cfcbGraphicsDrivers(NLMISC::CConfigFile::CVar &var); + void cfcbSoundDrivers(NLMISC::CConfigFile::CVar &var); + void cfcbSearchPaths(NLMISC::CConfigFile::CVar &var); + void cfcbLeveldesignPath(NLMISC::CConfigFile::CVar &var); + + Ui::CSettingsDialog ui; + +}; /* class CSettingsDialog */ + +} /* namespace NLQT */ + +#endif // SETTINGS_DIALOG_H diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/settings_form.ui b/code/ryzom/tools/leveldesign/georges_editor_qt/src/settings_form.ui new file mode 100644 index 000000000..064f8bcfe --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/settings_form.ui @@ -0,0 +1,227 @@ + + + CSettingsDialog + + + Qt::NonModal + + + + 0 + 0 + 496 + 400 + + + + Settings + + + + :/images/preferences.png:/images/preferences.png + + + true + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + Graphics settings + + + + + + Driver + + + + + + + + 0 + 0 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Search paths (shapes, textures etc.) + + + + + + + + + + + + 0 + 0 + + + + ... + + + + :/images/list-add.png:/images/list-add.png + + + + 16 + 16 + + + + + + + + ... + + + + :/images/list-remove.png:/images/list-remove.png + + + + + + + ... + + + + :/images/go-up.png:/images/go-up.png + + + + + + + ... + + + + :/images/go-down.png:/images/go-down.png + + + + + + + + + Qt::Vertical + + + + 20 + 195 + + + + + + + + + + + Leveldesign path + + + + + + ... + + + + + + + + + + + + + pathsListWidget + addToolButton + removeToolButton + upToolButton + downToolButton + buttonBox + + + + + + + buttonBox + accepted() + CSettingsDialog + accept() + + + 222 + 385 + + + 157 + 274 + + + + + buttonBox + rejected() + CSettingsDialog + reject() + + + 290 + 391 + + + 286 + 274 + + + + + diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/spindelegate.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/spindelegate.cpp new file mode 100644 index 000000000..73106745e --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/spindelegate.cpp @@ -0,0 +1,275 @@ +/* + Georges Editor Qt + Copyright (C) 2010 Adrian Jaekel + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "spindelegate.h" + +// NeL includes +#include +#include +#include + +// Qt includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +// Project includes +#include "georgesform_model.h" +#include "formitem.h" + +namespace NLQT { + + SpinBoxDelegate::SpinBoxDelegate(QObject *parent) + : QStyledItemDelegate(parent) + { + } + + QWidget *SpinBoxDelegate::createEditor(QWidget *parent, + const QStyleOptionViewItem & option , + const QModelIndex &index) const + { + CFormItem *item = static_cast(index.internalPointer()); + QString value = item->data(1).toString(); + + if (value.isEmpty()) + return 0; + + const NLGEORGES::UType *type = qobject_cast(index.model())-> + getItem(index)->getFormElm()->getType(); + if(type) { + int numDefinitions = type->getNumDefinition(); + + if (numDefinitions) { + std::string l, v; + QString label,value; + + QComboBox *editor = new QComboBox(parent); + for (int i = 0; i < numDefinitions; i++) { + type->getDefinition(i,l,v); + label = l.c_str(); + value = v.c_str(); + editor->addItem(label); + } + return editor; + } else { + switch (type->getType()) { + case NLGEORGES::UType::UnsignedInt: + case NLGEORGES::UType::SignedInt: + { + QSpinBox *editor = new QSpinBox(parent); + + //QString min = QString(type->getMin().c_str()); + //QString max = QString(type->getMax().c_str()); + //QString inc = QString(type->getIncrement().c_str()); + //nldebug(QString("min %1 max %2 inc %3").arg(min).arg(max).arg(inc).toStdString().c_str()); + + // TODO: use saved min/max values + editor->setMinimum(-99999); + editor->setMaximum(99999); + editor->setSingleStep(1); + return editor; + } + case NLGEORGES::UType::Double: + { + QDoubleSpinBox *editor = new QDoubleSpinBox(parent); + + //QString min = QString(type->getMin().c_str()); + //QString max = QString(type->getMax().c_str()); + //QString inc = QString(type->getIncrement().c_str()); + //nldebug(QString("min %1 max %2 inc %3").arg(min).arg(max).arg(inc).toStdString().c_str()); + + // TODO: use saved min/max values + editor->setMinimum(-99999); + editor->setMaximum(99999); + editor->setSingleStep(0.1); + editor->setDecimals(1); + return editor; + } + case NLGEORGES::UType::Color: + { + return new QColorDialog(); + } + default: // UType::String + { + QLineEdit *editor = new QLineEdit(parent); + return editor; + } + } + } + } + return 0; + } + + void SpinBoxDelegate::setEditorData(QWidget *editor, + const QModelIndex &index) const + { + const NLGEORGES::UType *type = qobject_cast(index.model())-> + getItem(index)->getFormElm()->getType(); + int numDefinitions = type->getNumDefinition(); + QString value = index.model()->data(index, Qt::DisplayRole).toString(); + + if (numDefinitions) { + QComboBox *cb = static_cast(editor); + cb->setCurrentIndex(cb->findText(value)); + //cb->setIconSize() + } else { + switch (type->getType()) { + case NLGEORGES::UType::UnsignedInt: + case NLGEORGES::UType::SignedInt: + { + QSpinBox *spinBox = static_cast(editor); + spinBox->setValue((int)value.toDouble()); + break; + } + case NLGEORGES::UType::Double: + { + QDoubleSpinBox *spinBox = static_cast(editor); + spinBox->setValue(value.toDouble()); + break; + } + case NLGEORGES::UType::Color: + { + break; + } + default: + { + QLineEdit *textEdit = static_cast(editor); + textEdit->setText(value); + break; + } + } + } + } + + void SpinBoxDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, + const QModelIndex &index) const + { + const NLGEORGES::UType *type = qobject_cast(index.model())-> + getItem(index)->getFormElm()->getType(); + int numDefinitions = type->getNumDefinition(); + + if (numDefinitions) { + QComboBox *comboBox = static_cast(editor); + QString value = comboBox->currentText(); + QString oldValue = index.model()->data(index, Qt::DisplayRole).toString(); + if (value == oldValue) { + // nothing's changed + } else { + nldebug(QString("setModelData from %1 to %2") + .arg(oldValue).arg(value).toStdString().c_str()); + model->setData(index, value, Qt::EditRole); + } + } else { + switch (type->getType()) { + case NLGEORGES::UType::UnsignedInt: + case NLGEORGES::UType::SignedInt: + { + QSpinBox *spinBox = static_cast(editor); + int value = spinBox->value(); + QString oldValue = index.model()->data(index, Qt::DisplayRole).toString(); + if (QString("%1").arg(value) == oldValue) { + // nothing's changed + } else { + nldebug(QString("setModelData from %1 to %2") + .arg(oldValue).arg(value).toStdString().c_str()); + model->setData(index, value, Qt::EditRole); + } + break; + } + case NLGEORGES::UType::Double: + { + QDoubleSpinBox *spinBox = static_cast(editor); + double value = spinBox->value(); + QString oldValue = index.model()->data(index, Qt::DisplayRole).toString(); + if (QString("%1").arg(value) == oldValue) { + // nothing's changed + } else { + nldebug(QString("setModelData from %1 to %2") + .arg(oldValue).arg(value).toStdString().c_str()); + model->setData(index, value, Qt::EditRole); + } + break; + } + case NLGEORGES::UType::Color: + { + break; // TODO + } + default: // UType::String + { + QLineEdit *textEdit = static_cast(editor); + QString value = textEdit->text(); + QString oldValue = index.model()->data(index, Qt::DisplayRole).toString(); + if (value == oldValue) { + // nothing's changed + } else { + nldebug(QString("setModelData from %1 to %2") + .arg(oldValue).arg(value).toStdString().c_str()); + model->setData(index, value, Qt::EditRole); + } + break; + } + } + } + } + + void SpinBoxDelegate::updateEditorGeometry(QWidget *editor, + const QStyleOptionViewItem &option, const QModelIndex &index) const + { + QRect r = option.rect; + editor->setGeometry(r); + //option.decorationAlignment = QStyleOptionViewItem::Right; + } + + void SpinBoxDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const +{ + QStyleOptionViewItemV4 optionV4 = option; + optionV4.decorationPosition = QStyleOptionViewItem::Right; + //optionV4.decorationSize = QSize(32,32); + initStyleOption(&optionV4, index); + + QStyledItemDelegate::paint(painter,optionV4,index); + + //QStyle *style = optionV4.widget? optionV4.widget->style() : QApplication::style(); + + //QTextDocument doc; + //doc.setHtml(optionV4.text); + + ///// Painting item without text + //optionV4.text = QString(); + //style->drawControl(QStyle::CE_ItemViewItem, &optionV4, painter); + + //QAbstractTextDocumentLayout::PaintContext ctx; + + //// Highlighting text if item is selected + //if (optionV4.state & QStyle::State_Selected) + // ctx.palette.setColor(QPalette::Text, optionV4.palette.color(QPalette::Active, QPalette::HighlightedText)); + + //QRect textRect = style->subElementRect(QStyle::SE_ItemViewItemText, &optionV4); + //painter->save(); + //painter->translate(textRect.topLeft()); + //painter->setClipRect(textRect.translated(-textRect.topLeft())); + //doc.documentLayout()->draw(painter, ctx); + //painter->restore(); +} + +} diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/spindelegate.h b/code/ryzom/tools/leveldesign/georges_editor_qt/src/spindelegate.h new file mode 100644 index 000000000..907755018 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/spindelegate.h @@ -0,0 +1,44 @@ +/* + Georges Editor Qt + Copyright (C) 2010 Adrian Jaekel + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef DELEGATE_H +#define DELEGATE_H + +#include + +namespace NLQT { + + class SpinBoxDelegate : public QStyledItemDelegate +{ + +public: + SpinBoxDelegate(QObject *parent = 0); + + QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, + const QModelIndex &index) const; + void setEditorData(QWidget *editor, const QModelIndex &index) const; + void setModelData(QWidget *editor, QAbstractItemModel *model, + const QModelIndex &index) const; + void updateEditorGeometry(QWidget *editor, + const QStyleOptionViewItem &option, const QModelIndex &index) const; + void paint ( QPainter * painter, const QStyleOptionViewItem & option, + const QModelIndex & index ) const; +}; + +} +#endif diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/stdpch.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/stdpch.cpp new file mode 100644 index 000000000..f555cbb32 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/stdpch.cpp @@ -0,0 +1,19 @@ +/* + Georges Editor Qt + Copyright (C) 2010 Adrian Jaekel + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "stdpch.h" diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/stdpch.h b/code/ryzom/tools/leveldesign/georges_editor_qt/src/stdpch.h new file mode 100644 index 000000000..0ef614792 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/stdpch.h @@ -0,0 +1,33 @@ +/* + Object Viewer Qt + Copyright (C) 2010 Dzmitry Kamiahin + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +*/ + +#ifndef NL_STDPCH_H +#define NL_STDPCH_H + +#include + +#include +#include +#include +#include +#include + +#include + +#endif