diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index 04d565c76..9a319c058 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -74,7 +74,7 @@ MACRO(NL_ADD_RUNTIME_FLAGS name) # LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}") ENDIF(WIN32) IF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(${name} ${STLPORT_LIBRARIES}) + TARGET_LINK_LIBRARIES(${name} ${STLPORT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) ENDIF(WITH_STLPORT) ENDMACRO(NL_ADD_RUNTIME_FLAGS) @@ -182,7 +182,7 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS) ELSE(WIN32 AND MFC_FOUND) OPTION(WITH_MFC "With MFC Support" OFF) ENDIF(WIN32 AND MFC_FOUND) - + ### # Optional support ### @@ -191,7 +191,7 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS) ELSE(WIN32) OPTION(WITH_STLPORT "With STLport support." OFF) ENDIF(WIN32) - + OPTION(BUILD_DASHBOARD "Build to the CDash dashboard" OFF) OPTION(WITH_NEL "Build NeL (nearly always required)." ON ) @@ -345,7 +345,7 @@ MACRO(NL_SETUP_BUILD_FLAGS) SET(CMAKE_C_FLAGS ${PLATFORM_CFLAGS} CACHE STRING "" FORCE) SET(CMAKE_CXX_FLAGS ${PLATFORM_CXXFLAGS} CACHE STRING "" FORCE) - + ## Debug SET(CMAKE_C_FLAGS_DEBUG ${NL_DEBUG_CFLAGS} CACHE STRING "" FORCE) SET(CMAKE_CXX_FLAGS_DEBUG ${NL_DEBUG_CFLAGS} CACHE STRING "" FORCE) @@ -415,7 +415,7 @@ MACRO(NL_SETUP_PREFIX_PATHS) SET(NL_DRIVER_PREFIX "${CMAKE_INSTALL_PREFIX}/lib/nel" CACHE PATH "Installation path for drivers.") ENDIF(WIN32) ENDIF(NOT NL_DRIVER_PREFIX) - + ENDMACRO(NL_SETUP_PREFIX_PATHS) MACRO(RYZOM_SETUP_PREFIX_PATHS) diff --git a/code/nel/samples/misc/command/CMakeLists.txt b/code/nel/samples/misc/command/CMakeLists.txt index fd730ffec..c60b4e63b 100644 --- a/code/nel/samples/misc/command/CMakeLists.txt +++ b/code/nel/samples/misc/command/CMakeLists.txt @@ -2,10 +2,6 @@ FILE(GLOB SRC *.cpp) ADD_EXECUTABLE(nl_sample_command ${SRC}) -IF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(nl_sample_command ${CMAKE_THREAD_LIBS_INIT}) -ENDIF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(nl_sample_command nelmisc) NL_DEFAULT_PROPS(nl_sample_command "NeL, Samples, Misc: Commands") NL_ADD_RUNTIME_FLAGS(nl_sample_command) diff --git a/code/nel/src/3d/CMakeLists.txt b/code/nel/src/3d/CMakeLists.txt index c42eaef69..3888be211 100644 --- a/code/nel/src/3d/CMakeLists.txt +++ b/code/nel/src/3d/CMakeLists.txt @@ -691,10 +691,6 @@ NL_TARGET_LIB(nel3d ${HEADERS} ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${FREETYPE_INCLUDE_DIRS}) -IF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(nel3d ${CMAKE_THREAD_LIBS_INIT}) -ENDIF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(nel3d nelmisc ${FREETYPE_LIBRARY}) SET_TARGET_PROPERTIES(nel3d PROPERTIES LINK_INTERFACE_LIBRARIES "") NL_DEFAULT_PROPS(nel3d "NeL, Library: NeL 3D") diff --git a/code/nel/src/3d/driver/opengl/CMakeLists.txt b/code/nel/src/3d/driver/opengl/CMakeLists.txt index eb2471b24..25216998c 100644 --- a/code/nel/src/3d/driver/opengl/CMakeLists.txt +++ b/code/nel/src/3d/driver/opengl/CMakeLists.txt @@ -16,10 +16,6 @@ NL_TARGET_DRIVER(${NLDRV_OGL_LIB} ${SRC}) INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) -IF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${CMAKE_THREAD_LIBS_INIT}) -ENDIF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} nel3d nelmisc ${OPENGL_gl_LIBRARY}) NL_DEFAULT_PROPS(${NLDRV_OGL_LIB} "NeL, Driver, Video: OpenGL") NL_ADD_LIB_SUFFIX(${NLDRV_OGL_LIB}) diff --git a/code/nel/src/georges/CMakeLists.txt b/code/nel/src/georges/CMakeLists.txt index 28ef2ac61..d3c0199d7 100644 --- a/code/nel/src/georges/CMakeLists.txt +++ b/code/nel/src/georges/CMakeLists.txt @@ -7,10 +7,6 @@ NL_TARGET_LIB(nelgeorges ${HEADERS} ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -IF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(nelgeorges ${CMAKE_THREAD_LIBS_INIT}) -ENDIF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(nelgeorges ${LIBXML2_LIBRARIES} nelmisc) SET_TARGET_PROPERTIES(nelgeorges PROPERTIES LINK_INTERFACE_LIBRARIES "") NL_DEFAULT_PROPS(nelgeorges "NeL, Library: NeL Georges") diff --git a/code/nel/src/ligo/CMakeLists.txt b/code/nel/src/ligo/CMakeLists.txt index 8f517601e..f600637b7 100644 --- a/code/nel/src/ligo/CMakeLists.txt +++ b/code/nel/src/ligo/CMakeLists.txt @@ -5,10 +5,6 @@ NL_TARGET_LIB(nelligo ${HEADERS} ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -IF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(nelligo ${CMAKE_THREAD_LIBS_INIT}) -ENDIF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(nelligo ${LIBXML2_LIBRARIES} nelmisc) SET_TARGET_PROPERTIES(nelligo PROPERTIES LINK_INTERFACE_LIBRARIES "") NL_DEFAULT_PROPS(nelligo "NeL, Library: NeL Ligo") diff --git a/code/nel/src/logic/CMakeLists.txt b/code/nel/src/logic/CMakeLists.txt index 76e9aadbf..107c57850 100644 --- a/code/nel/src/logic/CMakeLists.txt +++ b/code/nel/src/logic/CMakeLists.txt @@ -5,10 +5,6 @@ NL_TARGET_LIB(nellogic ${HEADERS} ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -IF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(nellogic ${CMAKE_THREAD_LIBS_INIT}) -ENDIF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(nellogic ${LIBXML2_LIBRARIES} nelmisc nelnet) SET_TARGET_PROPERTIES(nellogic PROPERTIES LINK_INTERFACE_LIBRARIES "") NL_DEFAULT_PROPS(nellogic "NeL, Library: NeL Logic") diff --git a/code/nel/src/net/CMakeLists.txt b/code/nel/src/net/CMakeLists.txt index cc3c7c102..ea68efe32 100644 --- a/code/nel/src/net/CMakeLists.txt +++ b/code/nel/src/net/CMakeLists.txt @@ -12,10 +12,6 @@ IF(WITH_GTK) ENDIF(GTK2_FOUND) ENDIF(WITH_GTK) -IF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(nelnet ${CMAKE_THREAD_LIBS_INIT}) -ENDIF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(nelnet nelmisc) SET_TARGET_PROPERTIES(nelnet PROPERTIES LINK_INTERFACE_LIBRARIES "") NL_DEFAULT_PROPS(nelnet "NeL, Library: NeL Net") diff --git a/code/nel/src/pacs/CMakeLists.txt b/code/nel/src/pacs/CMakeLists.txt index de531b8bb..0fa059d68 100644 --- a/code/nel/src/pacs/CMakeLists.txt +++ b/code/nel/src/pacs/CMakeLists.txt @@ -5,10 +5,6 @@ NL_TARGET_LIB(nelpacs ${HEADERS} ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -IF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(nelpacs ${CMAKE_THREAD_LIBS_INIT}) -ENDIF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(nelpacs nelmisc) SET_TARGET_PROPERTIES(nelpacs PROPERTIES LINK_INTERFACE_LIBRARIES "") NL_DEFAULT_PROPS(nelpacs "NeL, Library: NeL PACS") diff --git a/code/nel/src/sound/CMakeLists.txt b/code/nel/src/sound/CMakeLists.txt index 1c531a6d5..9497357ee 100644 --- a/code/nel/src/sound/CMakeLists.txt +++ b/code/nel/src/sound/CMakeLists.txt @@ -5,10 +5,6 @@ NL_TARGET_LIB(nelsound ${HEADERS} ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -IF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(nelsound ${CMAKE_THREAD_LIBS_INIT}) -ENDIF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(nelsound ${LIBXML2_LIBRARIES} nelmisc nelligo nelgeorges nel3d nelsnd_lowlevel) SET_TARGET_PROPERTIES(nelsound PROPERTIES LINK_INTERFACE_LIBRARIES "") NL_DEFAULT_PROPS(nelsound "NeL, Library: NeL Sound") diff --git a/code/nel/src/sound/driver/CMakeLists.txt b/code/nel/src/sound/driver/CMakeLists.txt index 9f19bf5c6..c2ae80606 100644 --- a/code/nel/src/sound/driver/CMakeLists.txt +++ b/code/nel/src/sound/driver/CMakeLists.txt @@ -12,10 +12,6 @@ IF(WITH_STATIC) TARGET_LINK_LIBRARIES(nelsnd_lowlevel ${OGG_LIBRARY}) ENDIF(WITH_STATIC) -IF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(nelsnd_lowlevel ${CMAKE_THREAD_LIBS_INIT}) -ENDIF(WITH_STLPORT) - SET_TARGET_PROPERTIES(nelsnd_lowlevel PROPERTIES LINK_INTERFACE_LIBRARIES "") NL_DEFAULT_PROPS(nelsnd_lowlevel "NeL, Library: Sound Lowlevel") NL_ADD_RUNTIME_FLAGS(nelsnd_lowlevel) diff --git a/code/nel/src/sound/driver/openal/CMakeLists.txt b/code/nel/src/sound/driver/openal/CMakeLists.txt index cfdad7910..53b0c8c2a 100644 --- a/code/nel/src/sound/driver/openal/CMakeLists.txt +++ b/code/nel/src/sound/driver/openal/CMakeLists.txt @@ -28,10 +28,6 @@ NL_TARGET_DRIVER(${NLDRV_AL_LIB} ${SRC}) INCLUDE_DIRECTORIES(${OPENAL_INCLUDE_DIR}) -IF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(${NLDRV_AL_LIB} ${CMAKE_THREAD_LIBS_INIT}) -ENDIF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(${NLDRV_AL_LIB} ${OPENAL_LIBRARY} nelmisc nelsnd_lowlevel) NL_DEFAULT_PROPS(${NLDRV_AL_LIB} "NeL, Driver, Sound: OpenAL") NL_ADD_RUNTIME_FLAGS(${NLDRV_AL_LIB}) diff --git a/code/nel/tools/3d/object_viewer_qt/src/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/CMakeLists.txt index 5a690018f..6bfa4eb96 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/CMakeLists.txt @@ -22,7 +22,7 @@ SET(OBJECT_VIEWER_HDR main_window.h graphics_viewport.h animation_dialog.h vegetable_dialog.h global_wind_dialog.h day_night_dialog.h sun_color_dialog.h vegetable_noise_value_widget.h vegetable_density_page.h vegetable_landscape_page.h vegetable_scale_page.h vegetable_appearance_page.h vegetable_rotate_page.h - tune_mrm_dialog.h tune_timer_dialog.h + tune_mrm_dialog.h tune_timer_dialog.h camera_control.h extension_system/iplugin_manager.h extension_system/plugin_manager.h) SET(OBJECT_VIEWER_UIS animation_form.ui animation_set_form.ui settings_form.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/attrib_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/attrib_widget.cpp index 63ade787d..648921f4f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/attrib_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/attrib_widget.cpp @@ -45,12 +45,12 @@ namespace NLQT CAttribWidget::CAttribWidget(QWidget *parent) : QGroupBox(parent), - _SrcInputEnabled(true), - _EnableConstantValue(true), - _DisableMemoryScheme(false), - _NbCycleEnabled(true), - _Node(NULL), - _SchemeWidget(NULL) + _SrcInputEnabled(true), + _EnableConstantValue(true), + _DisableMemoryScheme(false), + _NbCycleEnabled(true), + _Node(NULL), + _SchemeWidget(NULL) { _ui.setupUi(this); _ui.constRangeUIntWidget->hide(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/auto_lod_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/auto_lod_dialog.cpp index f02c21317..4a1dca707 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/auto_lod_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/auto_lod_dialog.cpp @@ -32,9 +32,9 @@ namespace NLQT { CAutoLODDialog::CAutoLODDialog(CWorkspaceNode *ownerNode, NL3D::CParticleSystem *ps, QWidget *parent) - : QDialog(parent), - _Node(ownerNode), - _PS(ps) + : QDialog(parent), + _Node(ownerNode), + _PS(ps) { _ui.setupUi(this); diff --git a/code/nel/tools/3d/object_viewer_qt/src/auto_lod_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/auto_lod_dialog.h index a6c0d2fe1..4a5ab2df2 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/auto_lod_dialog.h +++ b/code/nel/tools/3d/object_viewer_qt/src/auto_lod_dialog.h @@ -46,7 +46,6 @@ public: private Q_SLOTS: void setDegradationExponent(int value); void setSkipParticles(bool state); - void setDistRatio(float value); void setMaxDistLODBias(float value); diff --git a/code/nel/tools/3d/object_viewer_qt/src/basic_edit_widget.h b/code/nel/tools/3d/object_viewer_qt/src/basic_edit_widget.h index 0269ce3c8..76da9bf97 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/basic_edit_widget.h +++ b/code/nel/tools/3d/object_viewer_qt/src/basic_edit_widget.h @@ -48,7 +48,7 @@ public: private Q_SLOTS: void updateGraphics(); -private: +private: bool eventFilter(QObject *object, QEvent *event); // wrapper to the datas diff --git a/code/nel/tools/3d/object_viewer_qt/src/bin_op_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/bin_op_dialog.h index 2bcd4677f..061edafd4 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/bin_op_dialog.h +++ b/code/nel/tools/3d/object_viewer_qt/src/bin_op_dialog.h @@ -47,7 +47,7 @@ class CBinOpDialog : public QDialog public: CBinOpDialog(QWidget *widget1, QWidget *widget2, QWidget *parent = 0); - ~CBinOpDialog(); + virtual ~CBinOpDialog(); virtual void init() = 0; @@ -86,7 +86,6 @@ public: _SchemeWrapper[k].Index = k ; } } - void init() { uint k ; diff --git a/code/nel/tools/3d/object_viewer_qt/src/camera_control.cpp b/code/nel/tools/3d/object_viewer_qt/src/camera_control.cpp new file mode 100644 index 000000000..916158cc6 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/camera_control.cpp @@ -0,0 +1,285 @@ +/* + 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 . + +*/ + +#include "stdpch.h" +#include "camera_control.h" + +// STL includes + +// Qt includes + +// NeL includes +#include "nel/misc/debug.h" +#include "nel/3d/u_driver.h" +#include "nel/3d/u_scene.h" +#include +#include + +// Project includes +#include "modules.h" + +static int camId = 0; + +namespace NLQT +{ + +CCameraItem::CCameraItem(const QString &name): + _cameraFocal(75), + _speed(5.0), + _active(false), + _name(name) +{ + _camera = Modules::objView().getScene()->createCamera(); + _camera.setTransformMode (NL3D::UTransformable::DirectMatrix); + reset(); +} + +CCameraItem::~CCameraItem() +{ + Modules::objView().getScene()->deleteCamera(_camera); +} + +void CCameraItem::setActive(bool active) +{ + if (active) + { + sint w = Modules::objView().getDriver()->getWindowWidth(); + sint h = Modules::objView().getDriver()->getWindowHeight(); + _camera.setPerspective(_cameraFocal * float(NLMISC::Pi) / 180.f, float(w) / h, 0.1f, 1000); + Modules::objView().getScene()->setCam(_camera); + setupListener(); + } + else + { + _hotSpot = Modules::objView().get3dMouseListener()->getHotSpot(); + } + _active = active; +} + +void CCameraItem::setSpeed(float value) +{ + _speed = value; + Modules::objView().get3dMouseListener()->setSpeed(_speed); +} + +void CCameraItem::reset() +{ + _hotSpot = NLMISC::CVector(0, 0, 0); + float radius=10.f; + + // Setup camera + _camera.lookAt(_hotSpot + NLMISC::CVector(0.57735f, 0.57735f, 0.57735f) * radius, _hotSpot); + + if (_active) + setupListener(); +} + +void CCameraItem::setupListener() +{ + NL3D::U3dMouseListener *_mouseListener = Modules::objView().get3dMouseListener(); + _mouseListener->setMatrix (_camera.getMatrix()); + _mouseListener->setFrustrum (_camera.getFrustum()); + _mouseListener->setViewport (NL3D::CViewport()); + _mouseListener->setHotSpot (_hotSpot); + Modules::objView().get3dMouseListener()->setSpeed(_speed); +} + +CCameraControl::CCameraControl(QWidget *parent) + : QObject(parent), + _currentCamera(0) +{ + _camToolBar = new QToolBar(tr("CameraControl"), parent); + + _fpsAction = _camToolBar->addAction(tr("Fly")); + _fpsAction->setStatusTip(tr("Set firstPerson camera mode")); + _fpsAction->setCheckable(true); + + _edit3dAction = _camToolBar->addAction(tr("Edit")); + _edit3dAction->setStatusTip(tr("Set edit3d camera mode")); + _edit3dAction->setCheckable(true); + + QActionGroup *cameraModeGroup = new QActionGroup(this); + cameraModeGroup->addAction(_fpsAction); + cameraModeGroup->addAction(_edit3dAction); + _edit3dAction->setChecked(true); + + connect(_fpsAction, SIGNAL(triggered()), this, SLOT(setFirstPersonMode())); + connect(_edit3dAction, SIGNAL(triggered()), this, SLOT(setEditMode())); + + _renderModeMenu = new QMenu(tr("Render Mode"), _camToolBar); + _renderModeMenu->setIcon(QIcon(":/images/polymode.png")); + _camToolBar->addAction(_renderModeMenu->menuAction()); + connect(_renderModeMenu->menuAction(), SIGNAL(triggered()), this, SLOT(setRenderMode())); + + QSignalMapper *modeMapper = new QSignalMapper(this); + + _pointRenderModeAction = _renderModeMenu->addAction(tr("Point mode")); + _pointRenderModeAction->setIcon(QIcon(":/images/rmpoints.png")); + _pointRenderModeAction->setStatusTip(tr("Set point render mode")); + connect(_pointRenderModeAction, SIGNAL(triggered()), modeMapper, SLOT(map())); + modeMapper->setMapping(_pointRenderModeAction, 0); + + _lineRenderModeAction = _renderModeMenu->addAction(tr("Line mode")); + _lineRenderModeAction->setStatusTip(tr("Set line render mode")); + _lineRenderModeAction->setIcon(QIcon(":/images/rmline.png")); + connect(_lineRenderModeAction, SIGNAL(triggered()), modeMapper, SLOT(map())); + modeMapper->setMapping(_lineRenderModeAction, 1); + + _fillRenderModeAction = _renderModeMenu->addAction(tr("Fill mode")); + _fillRenderModeAction->setIcon(QIcon(":/images/rmfill.png")); + _fillRenderModeAction->setStatusTip(tr("Set fill render mode")); + connect(_fillRenderModeAction, SIGNAL(triggered()), modeMapper, SLOT(map())); + modeMapper->setMapping(_fillRenderModeAction, 2); + + connect(modeMapper, SIGNAL(mapped(int)), this, SLOT(setRenderMode(int))); + + _camToolBar->addSeparator(); + _speedLabel = new QLabel(tr("Speed:"), _camToolBar); + _camToolBar->addWidget(_speedLabel); + _speedSpinBox = new QSpinBox(_camToolBar); + _speedSpinBox->setMinimum(1); + _speedSpinBox->setMaximum(1000); + _camToolBar->addWidget(_speedSpinBox); + connect(_speedSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setSpeed(int))); + + _camToolBar->addSeparator(); + _addCamAction = _camToolBar->addAction(tr("Create camera")); + _addCamAction->setIcon(QIcon(":/images/cam_add.png")); + _addCamAction->setStatusTip(tr("Create new camera")); + connect(_addCamAction, SIGNAL(triggered()), this, SLOT(addCamera())); + + _delCamAction = _camToolBar->addAction(tr("Delete camera")); + _delCamAction->setIcon(QIcon(":/images/cam_del.png")); + _delCamAction->setStatusTip(tr("Delete current camera")); + connect(_delCamAction, SIGNAL(triggered()), this, SLOT(delCamera())); + + _listCamComboBox = new QComboBox(_camToolBar); + connect(_listCamComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(changeCamera(int))); + _listCamComboBox->setCurrentIndex(createCamera(tr("defaultCamera"))); + _camToolBar->addWidget(_listCamComboBox); + + _camToolBar->addSeparator(); + _resetCamAction = _camToolBar->addAction(tr("Reset camera")); + _resetCamAction->setStatusTip(tr("Reset current camera")); + //_resetCamAction->setShortcut(tr("Ctrl+R")); + connect(_resetCamAction, SIGNAL(triggered()), this, SLOT(resetCamera())); +} + +CCameraControl::~CCameraControl() +{ + for(size_t i = 0; i < _cameraList.size(); ++i) + delete _cameraList[i]; + _cameraList.clear(); +} + +void CCameraControl::setEditMode() +{ + Modules::objView().get3dMouseListener()->setMouseMode(NL3D::U3dMouseListener::edit3d); +} + +void CCameraControl::setFirstPersonMode() +{ + Modules::objView().get3dMouseListener()->setMouseMode(NL3D::U3dMouseListener::firstPerson); +} + +void CCameraControl::addCamera() +{ + _listCamComboBox->setCurrentIndex(createCamera(tr("%1_Camera").arg(++camId))); +} + +void CCameraControl::delCamera() +{ + int index = _listCamComboBox->currentIndex(); + _listCamComboBox->setCurrentIndex(index - 1); + + _listCamComboBox->removeItem(index); + delete _cameraList[index]; + _cameraList.erase(_cameraList.begin() + index); +} + +void CCameraControl::setSpeed(int value) +{ + nlassert(_currentCamera); + _currentCamera->setSpeed(value); +} + +void CCameraControl::changeCamera(int index) +{ + if (_currentCamera) + _currentCamera->setActive(false); + + if (index == 0) + _delCamAction->setEnabled(false); + else + _delCamAction->setEnabled(true); + + _currentCamera = _cameraList[index]; + + nlassert(_currentCamera); + _currentCamera->setActive(true); + _speedSpinBox->setValue(int(_currentCamera->getSpeed())); +} + +void CCameraControl::setRenderMode(int value) +{ + switch (value) + { + case 0: + Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Point); + break; + case 1: + Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Line); + break; + case 2: + Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Filled); + break; + } +} + +void CCameraControl::setRenderMode() +{ + switch (Modules::objView().getDriver()->getPolygonMode()) + { + case NL3D::UDriver::Filled: + Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Line); + break; + case NL3D::UDriver::Line: + Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Point); + break; + case NL3D::UDriver::Point: + Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Filled); + break; + } +} + +void CCameraControl::resetCamera() +{ + nlassert(_currentCamera); + _currentCamera->reset(); +} + +int CCameraControl::createCamera(const QString &name) +{ + CCameraItem *newCamera = new CCameraItem(name); + _cameraList.push_back(newCamera); + _listCamComboBox->addItem(newCamera->getName()); + return _cameraList.size() - 1; +} + +} /* namespace NLQT */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/camera_control.h b/code/nel/tools/3d/object_viewer_qt/src/camera_control.h new file mode 100644 index 000000000..50d10a230 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/camera_control.h @@ -0,0 +1,125 @@ +/* + 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 CAMERA_CONTROL_H +#define CAMERA_CONTROL_H + +// STL includes + +// Qt includes +#include +#include +#include +#include +#include +#include +#include + +// NeL includes +#include +#include "nel/misc/vector.h" + +// Project includes + +namespace NLQT +{ + +class CCameraItem +{ +public: + CCameraItem(const QString &name); + ~CCameraItem(); + + void setSpeed(float value); + float getSpeed() + { + return _speed; + } + void setActive(bool active); + void setName(const QString &name) + { + _name = name; + } + QString getName() const + { + return _name; + } + void reset(); + +private: + void setupListener(); + + NL3D::UCamera _camera; + NLMISC::CVector _hotSpot; + + float _cameraFocal; + float _speed; + bool _active; + QString _name; +}; + +class CCameraControl: public QObject +{ + Q_OBJECT + +public: + CCameraControl(QWidget *parent = 0); + ~CCameraControl(); + + QToolBar *getToolBar() const + { + return _camToolBar; + } + +public Q_SLOTS: + void setEditMode(); + void setFirstPersonMode(); + void addCamera(); + void delCamera(); + void setSpeed(int value); + void changeCamera(int index); + void setRenderMode(int value); + void setRenderMode(); + void resetCamera(); + +private: + int createCamera(const QString &name); + + QAction *_fpsAction; + QAction *_edit3dAction; + QAction *_pointRenderModeAction; + QAction *_lineRenderModeAction; + QAction *_fillRenderModeAction; + QAction *_addCamAction; + QAction *_delCamAction; + QAction *_resetCamAction; + QSpinBox *_speedSpinBox; + QComboBox *_listCamComboBox; + QMenu *_renderModeMenu; + QLabel *_speedLabel; + QToolBar *_camToolBar; + + CCameraItem *_currentCamera; + std::vector _cameraList; + +}; /* class CCameraControl */ + +} /* namespace NLQT */ + +#endif // CAMERA_CONTROL_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/configuration.cpp b/code/nel/tools/3d/object_viewer_qt/src/configuration.cpp index 93b94fcd0..8fd118252 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/configuration.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/configuration.cpp @@ -201,7 +201,7 @@ CRGBA CConfiguration::getValue(const CConfigFile::CVar &var, const CRGBA &defaul { if (var.size() >= 3) { - if (var.size() > 4) + 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); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/curve_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/curve_dialog.cpp index b74c270a7..22f33ebc4 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/curve_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/curve_dialog.cpp @@ -27,11 +27,11 @@ namespace NLQT { CurveEditDialog::CurveEditDialog(NL3D::CPSFloatCurveFunctor *curve, CWorkspaceNode *ownerNode, QWidget *parent) - : QDialog(parent), - _scale(1.0), - _pos(0.0), - _Node(ownerNode), - _Curve(curve) + : QDialog(parent), + _scale(1.0), + _pos(0.0), + _Node(ownerNode), + _Curve(curve) { _ui.setupUi(this); diff --git a/code/nel/tools/3d/object_viewer_qt/src/curve_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/curve_dialog.h index 4d79cfd22..29a1baec5 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/curve_dialog.h +++ b/code/nel/tools/3d/object_viewer_qt/src/curve_dialog.h @@ -70,7 +70,7 @@ protected: float _pos; CWorkspaceNode *_Node; - + /// the scheme being edited NL3D::CPSFloatCurveFunctor *_Curve; diff --git a/code/nel/tools/3d/object_viewer_qt/src/edit_range_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/edit_range_widget.cpp index a7d1cb8c5..8944dc432 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/edit_range_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/edit_range_widget.cpp @@ -34,9 +34,9 @@ namespace NLQT const int max_range = 9999; CEditRangeUIntWidget::CEditRangeUIntWidget(QWidget *parent) - : QWidget(parent), - _Wrapper(NULL), - _emit(true) + : QWidget(parent), + _Wrapper(NULL), + _emit(true) { _ui.setupUi(this); diff --git a/code/nel/tools/3d/object_viewer_qt/src/entity.cpp b/code/nel/tools/3d/object_viewer_qt/src/entity.cpp index 4145af622..0f8a05b92 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/entity.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/entity.cpp @@ -44,18 +44,18 @@ namespace NLQT { CSlotInfo::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) + : Animation("empty"), + Skeleton("empty"), + Offset(0), + StartTime(0), + EndTime(0), + StartBlend(1), + EndBlend (1), + Smoothness(1), + SpeedFactor(1), + ClampMode(0), + SkeletonInverted(false), + Enable(true) { } @@ -80,15 +80,15 @@ CSlotInfo &CSlotInfo::operator=(const CSlotInfo &slotInfo) } CEntity::CEntity(void) - : _Name(""), - _FileNameShape(""), - _FileNameSkeleton(""), - _inPlace(false), - _incPos(false), - _Instance(NULL), - _Skeleton(NULL), - _PlayList(NULL), - _AnimationSet(NULL) + : _Name(""), + _FileNameShape(""), + _FileNameSkeleton(""), + _inPlace(false), + _incPos(false), + _Instance(NULL), + _Skeleton(NULL), + _PlayList(NULL), + _AnimationSet(NULL) { _CharacterScalePos = 1; } diff --git a/code/nel/tools/3d/object_viewer_qt/src/entity.h b/code/nel/tools/3d/object_viewer_qt/src/entity.h index f051de174..88338f214 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/entity.h +++ b/code/nel/tools/3d/object_viewer_qt/src/entity.h @@ -100,8 +100,8 @@ public: SAnimationStatus() : LoopAnim(false), PlayAnim(false), - CurrentTimeAnim(0), StartAnim(0), - EndAnim(0), SpeedAnim(1), Mode(Mode::PlayList) {} + CurrentTimeAnim(0), StartAnim(0), + EndAnim(0), SpeedAnim(1), Mode(Mode::PlayList) {} }; /// Destructor @@ -227,7 +227,7 @@ public: { return _SWTList; } - + /// Get game interface for manipulating Skeleton. NL3D::UInstance getInstance() const { diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin.h b/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin.h index 3d7e24028..1f878cc32 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin.h +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin.h @@ -25,20 +25,20 @@ #include "iplugin_manager.h" -namespace NLMISC +namespace NLMISC { - class INelContext; +class INelContext; } namespace ExtensionSystem { /** -@interface IPlugin -@brief Base class for all plugins. -@details The IPlugin class is an abstract class that must be implemented -once for each plugin. The IPlugin implementation must be exported and -made known to Qt's plugin system via the Q_EXPORT_PLUGIN macro, +@interface IPlugin +@brief Base class for all plugins. +@details The IPlugin class is an abstract class that must be implemented +once for each plugin. The IPlugin implementation must be exported and +made known to Qt's plugin system via the Q_EXPORT_PLUGIN macro, see the Qt documentation for details on that. */ class IPlugin @@ -50,7 +50,7 @@ public: virtual void extensionsInitialized() = 0; virtual void shutdown() { } - virtual void setNelContext(NLMISC::INelContext *nelContext) = 0; + virtual void setNelContext(NLMISC::INelContext *nelContext) = 0; virtual QString name() const = 0; virtual QString version() const = 0; diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h b/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h index 18605f133..0cde19d0a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h @@ -23,16 +23,17 @@ #include #include #include +#include namespace ExtensionSystem { class IPluginSpec; /** -@interface IPluginManager -@brief Interface for plugin system that manages the plugins, their life cycle and their registered objects. -@details The plugin manager is used for the following tasks: -- Manage plugins and their state +@interface IPluginManager +@brief Interface for plugin system that manages the plugins, their life cycle and their registered objects. +@details The plugin manager is used for the following tasks: +- Manage plugins and their state - Manipulate a 'common object pool' */ class IPluginManager: public QObject @@ -54,6 +55,10 @@ public: virtual void setPluginPaths(const QStringList &paths) = 0; virtual QList plugins() const = 0; + // Settings + virtual void setSettings(QSettings *settings) = 0; + virtual QSettings *settings() const = 0; + Q_SIGNALS: void objectAdded(QObject *obj); void aboutToRemoveObject(QObject *obj); diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_spec.h b/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_spec.h index a27b76cd0..020183cc1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_spec.h +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_spec.h @@ -26,10 +26,10 @@ namespace ExtensionSystem { class IPlugin; class IPluginManager; - -/** -@struct State -@details The plugin goes through several steps while being loaded. + +/** +@struct State +@details The plugin goes through several steps while being loaded. The state gives a hint on what went wrong in case of an error. */ struct State @@ -47,11 +47,11 @@ struct State }; /** -@interface IPluginSpec -@brief Interface for plugin spec contains the information of the plugins and -information about the plugin's current state. -@details The plugin spec is also filled with more information as the plugin -goes through its loading process (see State). +@interface IPluginSpec +@brief Interface for plugin spec contains the information of the plugins and +information about the plugin's current state. +@details The plugin spec is also filled with more information as the plugin +goes through its loading process (see State). If an error occurs, the plugin spec is the place to look for the error details. */ class IPluginSpec diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp index d400cc6aa..921f14fbe 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp @@ -28,14 +28,16 @@ namespace ExtensionSystem { -CPluginManager::CPluginManager(QObject *parent): - IPluginManager(parent) +CPluginManager::CPluginManager(QObject *parent) + :IPluginManager(parent), + _settings(0) { } CPluginManager::~CPluginManager() { stopAll(); + deleteAll(); qDeleteAll(_pluginSpecs); } @@ -92,8 +94,10 @@ void CPluginManager::loadPlugins() Q_FOREACH (CPluginSpec *spec, _pluginSpecs) setPluginState(spec, State::Initialized); - Q_FOREACH (CPluginSpec *spec, _pluginSpecs) - setPluginState(spec, State::Running); + QListIterator it(_pluginSpecs); + it.toBack(); + while (it.hasPrevious()) + setPluginState(it.previous(), State::Running); Q_EMIT pluginsChanged(); } @@ -114,6 +118,24 @@ QList CPluginManager::plugins() const return _ipluginSpecs; } +void CPluginManager::setSettings(QSettings *settings) +{ + _settings = settings; +} + +QSettings *CPluginManager::settings() const +{ + return _settings; +} + +void CPluginManager::readSettings() +{ +} + +void CPluginManager::writeSettings() +{ +} + void CPluginManager::readPluginPaths() { qDeleteAll(_pluginSpecs); @@ -176,9 +198,16 @@ void CPluginManager::stopAll() { Q_FOREACH (CPluginSpec *spec, _pluginSpecs) setPluginState(spec, State::Stopped); +} - Q_FOREACH (CPluginSpec *spec, _pluginSpecs) - setPluginState(spec, State::Deleted); +void CPluginManager::deleteAll() +{ + QListIterator it(_pluginSpecs); + it.toBack(); + while (it.hasPrevious()) + { + setPluginState(it.previous(), State::Deleted); + } } }; // namespace NLQT \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h index 39e1044c0..97698b14e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h @@ -51,13 +51,21 @@ public: virtual void setPluginPaths(const QStringList &paths); virtual QList plugins() const; + // Settings + virtual void setSettings(QSettings *settings); + virtual QSettings *settings() const; + void readSettings(); + void writeSettings(); + private: void setPluginState(CPluginSpec *spec, int destState); void readPluginPaths(); void stopAll(); + void deleteAll(); mutable QReadWriteLock _lock; + QSettings *_settings; QList _pluginSpecs; QList _ipluginSpecs; QStringList _pluginPaths; diff --git a/code/nel/tools/3d/object_viewer_qt/src/follow_path_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/follow_path_dialog.cpp index 32c3bce98..029b0d10b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/follow_path_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/follow_path_dialog.cpp @@ -30,9 +30,9 @@ namespace NLQT { CFollowPathDialog::CFollowPathDialog(NL3D::CPSPlaneBasisFollowSpeed *pbfs, CWorkspaceNode *ownerNode, QWidget *parent) - : QDialog(parent), - _FollowPath(pbfs), - _Node(ownerNode) + : QDialog(parent), + _FollowPath(pbfs), + _Node(ownerNode) { resize(270, 90); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); diff --git a/code/nel/tools/3d/object_viewer_qt/src/images/cam_add.png b/code/nel/tools/3d/object_viewer_qt/src/images/cam_add.png new file mode 100644 index 000000000..dbc579d43 Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/images/cam_add.png differ diff --git a/code/nel/tools/3d/object_viewer_qt/src/images/cam_del.png b/code/nel/tools/3d/object_viewer_qt/src/images/cam_del.png new file mode 100644 index 000000000..1f6bee21f Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/images/cam_del.png differ diff --git a/code/nel/tools/3d/object_viewer_qt/src/images/rmfill.png b/code/nel/tools/3d/object_viewer_qt/src/images/rmfill.png new file mode 100644 index 000000000..fa187ea27 Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/images/rmfill.png differ diff --git a/code/nel/tools/3d/object_viewer_qt/src/images/rmline.png b/code/nel/tools/3d/object_viewer_qt/src/images/rmline.png new file mode 100644 index 000000000..82d9783e1 Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/images/rmline.png differ diff --git a/code/nel/tools/3d/object_viewer_qt/src/images/rmpoints.png b/code/nel/tools/3d/object_viewer_qt/src/images/rmpoints.png new file mode 100644 index 000000000..b7a4b2f28 Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/images/rmpoints.png differ diff --git a/code/nel/tools/3d/object_viewer_qt/src/main.cpp b/code/nel/tools/3d/object_viewer_qt/src/main.cpp index e0671f478..3eb2049d3 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/main.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/main.cpp @@ -21,6 +21,7 @@ // Qt includes #include +#include #include #include #include @@ -112,11 +113,14 @@ sint main(int argc, char **argv) #if defined(NL_OS_MAC) QDir::setCurrent(qApp->applicationDirPath() + QString("/../Resources")); - CLibrary::addLibPath( - (qApp->applicationDirPath() + QString("/../PlugIns/nel")).toStdString()); + CLibrary::addLibPath((qApp->applicationDirPath() + QString("/../PlugIns/nel")).toStdString()); #endif Modules::init(); + QSettings *settings = new QSettings(QSettings::IniFormat, QSettings::UserScope, + QLatin1String("Ryzom Core"), QLatin1String("ObjectViewerQt")); + + Modules::plugMan().setSettings(settings); // load and set remap extensions from config Modules::config().configRemapExtensions(); @@ -129,21 +133,20 @@ sint main(int argc, char **argv) #if !defined(NL_OS_MAC) Modules::plugMan().setPluginPaths(QStringList() << QString("./plugins")); #else - Modules::plugMan().setPluginPaths(QStringList() << - qApp->applicationDirPath() + QString("/../PlugIns/ovqt")); + Modules::plugMan().setPluginPaths(QStringList() << + qApp->applicationDirPath() + QString("/../PlugIns/ovqt")); #endif Modules::plugMan().loadPlugins(); - + QStringList errors; Q_FOREACH (ExtensionSystem::IPluginSpec *spec, Modules::plugMan().plugins()) - if (spec->hasError()) - errors.append(spec->fileName() + " : " + spec->errorString()); - + if (spec->hasError()) + errors.append(spec->fileName() + " : " + spec->errorString()); + if (!errors.isEmpty()) - QMessageBox::warning(0, - QCoreApplication::translate("Application", "Object Viewer Qt - Plugin loader messages"), - errors.join(QString::fromLatin1("\n\n"))); + QMessageBox::warning(0, QCoreApplication::translate("Application", "Object Viewer Qt - Plugin loader messages"), + errors.join(QString::fromLatin1("\n\n"))); splash->finish(&Modules::mainWin()); int result = app.exec(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/main_window.cpp index ece609dac..2176a6f93 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/main_window.cpp @@ -49,6 +49,7 @@ #include "sun_color_dialog.h" #include "tune_mrm_dialog.h" #include "tune_timer_dialog.h" +#include "camera_control.h" using namespace std; using namespace NLMISC; @@ -58,13 +59,13 @@ namespace NLQT CMainWindow::CMainWindow(QWidget *parent) : QMainWindow(parent), - _isGraphicsInitialized(false), - _isGraphicsEnabled(false), - _isSoundInitialized(false), - _isSoundEnabled(false), - _GraphicsViewport(NULL), - _lastDir("."), - _mouseMode(NL3D::U3dMouseListener::edit3d) + _isGraphicsInitialized(false), + _isGraphicsEnabled(false), + _isSoundInitialized(false), + _isSoundEnabled(false), + _GraphicsViewport(NULL), + _lastDir("."), + _mouseMode(NL3D::U3dMouseListener::edit3d) { nldebug("CMainWindow::CMainWindow:"); setObjectName("CMainWindow"); @@ -83,7 +84,7 @@ CMainWindow::CMainWindow(QWidget *parent) _GraphicsViewport->init(); _isGraphicsInitialized = true; - + if (_isSoundEnabled) { Modules::sound().init(); @@ -144,7 +145,8 @@ CMainWindow::~CMainWindow() delete _TuneTimerDialog; delete _ParticleControlDialog; delete _ParticleWorkspaceDialog; - + delete _cameraControl; + if (_isSoundInitialized) Modules::sound().releaseGraphics(); @@ -162,7 +164,7 @@ void CMainWindow::setVisible(bool visible) { QMainWindow::setVisible(true); if (_isSoundInitialized) - Modules::sound().initGraphics(); + Modules::sound().initGraphics(); _mainTimer->start(); _statusBarTimer->start(1000); } @@ -202,7 +204,7 @@ void CMainWindow::open() tr("NeL skeleton file (*.skel)")); Q_FOREACH(QString fileName, list) - loadFile(fileName, skelFileName); + loadFile(fileName, skelFileName); _AnimationSetDialog->updateListObject(); _AnimationSetDialog->updateListAnim(); @@ -220,43 +222,6 @@ void CMainWindow::resetScene() _SkeletonTreeModel->resetTreeModel(); } -void CMainWindow::changeRenderMode() -{ - // Change render mode - switch (Modules::objView().getDriver()->getPolygonMode()) - { - case NL3D::UDriver::Filled: - Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Line); - break; - case NL3D::UDriver::Line: - Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Point); - break; - case NL3D::UDriver::Point: - Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Filled); - break; - } -} - -void CMainWindow::resetCamera() -{ - Modules::objView().resetCamera(); -} - -void CMainWindow::changeCameraMode() -{ - switch (_mouseMode) - { - case NL3D::U3dMouseListener::edit3d: - Modules::objView().get3dMouseListener()->setMouseMode(NL3D::U3dMouseListener::firstPerson); - _mouseMode = NL3D::U3dMouseListener::firstPerson; - break; - case NL3D::U3dMouseListener::firstPerson: - _mouseMode = NL3D::U3dMouseListener::edit3d; - Modules::objView().get3dMouseListener()->setMouseMode(NL3D::U3dMouseListener::edit3d); - break; - } -} - void CMainWindow::reloadTextures() { Modules::objView().reloadTextures(); @@ -286,10 +251,10 @@ void CMainWindow::updateStatusBar() if (_isGraphicsInitialized) { _statusInfo->setText(QString("%1, Nb tri: %2 , Texture used (Mb): %3 , fps: %4 ").arg( - Modules::objView().getDriver()->getVideocardInformation()).arg( - _numTri).arg( - _texMem, 0,'f',4).arg( - _fps, 0,'f',2)); + Modules::objView().getDriver()->getVideocardInformation()).arg( + _numTri).arg( + _texMem, 0,'f',4).arg( + _fps, 0,'f',2)); } } @@ -314,18 +279,11 @@ void CMainWindow::createActions() _resetCameraAction = new QAction(tr("Reset camera"), this); _resetCameraAction->setShortcut(tr("Ctrl+R")); _resetCameraAction->setStatusTip(tr("Reset current camera")); - connect(_resetCameraAction, SIGNAL(triggered()), this, SLOT(resetCamera())); _renderModeAction = new QAction("Change render mode", this); _renderModeAction->setIcon(QIcon(":/images/polymode.png")); _renderModeAction->setShortcut(tr("Ctrl+M")); _renderModeAction->setStatusTip(tr("Change render mode (Line, Point, Filled)")); - connect(_renderModeAction, SIGNAL(triggered()), this, SLOT(changeRenderMode())); - - _cameraModeAction = new QAction("Change camera mode", this); - _cameraModeAction->setShortcut(tr("Ctrl+W")); - _cameraModeAction->setStatusTip(tr("Change camera mode (edit3d, firstPerson)")); - connect(_cameraModeAction, SIGNAL(triggered()), this, SLOT(changeCameraMode())); _resetSceneAction = new QAction(tr("&Reset scene"), this); _resetSceneAction->setStatusTip(tr("Reset current scene")); @@ -366,7 +324,6 @@ void CMainWindow::createMenus() _viewMenu->addAction(_setBackColorAction); _viewMenu->addAction(_resetCameraAction); _viewMenu->addAction(_renderModeAction); - _viewMenu->addAction(_cameraModeAction); _viewMenu->addAction(_SetupFog->toggleViewAction()); _sceneMenu = menuBar()->addMenu(tr("&Scene")); @@ -457,6 +414,12 @@ void CMainWindow::createToolBars() _toolsBar->addAction(_TuneTimerDialog->toggleViewAction()); _toolsBar->addAction(_SkeletonScaleDialog->toggleViewAction()); _toolsBar->addAction(_TuneMRMDialog->toggleViewAction()); + + _cameraControl = new CCameraControl(this); + this->addToolBar(_cameraControl->getToolBar()); + + connect(_resetCameraAction, SIGNAL(triggered()), _cameraControl, SLOT(resetCamera())); + connect(_renderModeAction, SIGNAL(triggered()), _cameraControl, SLOT(setRenderMode())); } void CMainWindow::createStatusBar() @@ -555,7 +518,7 @@ bool CMainWindow::loadFile(const QString &fileName, const QString &skelName) bool loaded; if (fileInfo.suffix() == "ig") loaded = Modules::objView().loadInstanceGroup(fileName.toStdString()); - else + else loaded = Modules::objView().loadMesh(fileName.toStdString(), skelName.toStdString()); if (!loaded) @@ -646,17 +609,17 @@ void CMainWindow::updateRender() // 14. Update Debug (stuff for dev) // ... - - // 15. Calc FPS - static sint64 lastTime = NLMISC::CTime::getPerformanceTime (); - sint64 newTime = NLMISC::CTime::getPerformanceTime (); - _fps = float(1.0 / NLMISC::CTime::ticksToSecond (newTime-lastTime)); + + // 15. Calc FPS + static sint64 lastTime = NLMISC::CTime::getPerformanceTime (); + sint64 newTime = NLMISC::CTime::getPerformanceTime (); + _fps = float(1.0 / NLMISC::CTime::ticksToSecond (newTime-lastTime)); lastTime = newTime; if (_isGraphicsInitialized && !Modules::objView().getDriver()->isLost()) { // 01. Render Driver (background color) - //Modules::objView().getDriver()->activate(); + //Modules::objView().getDriver()->activate(); Modules::objView().renderDriver(); // clear all buffers // 02. Render Sky (sky scene) @@ -681,7 +644,7 @@ void CMainWindow::updateRender() Modules::objView().renderDebug2D(); // 10. Get profile information - NL3D::CPrimitiveProfile in, out; + NL3D::CPrimitiveProfile in, out; Modules::objView().getDriver()->profileRenderedPrimitives (in, out); _numTri = in.NLines+in.NPoints+in.NQuads*2+in.NTriangles+in.NTriangleStrips; diff --git a/code/nel/tools/3d/object_viewer_qt/src/main_window.h b/code/nel/tools/3d/object_viewer_qt/src/main_window.h index 9cc146aee..8864b1c6b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/main_window.h +++ b/code/nel/tools/3d/object_viewer_qt/src/main_window.h @@ -56,6 +56,8 @@ class CSunColorDialog; class CTuneMRMDialog; class CTuneTimerDialog; +class CCameraControl; + class CMainWindow : public QMainWindow { Q_OBJECT @@ -79,9 +81,6 @@ public: private Q_SLOTS: void open(); void resetScene(); - void changeRenderMode(); - void resetCamera(); - void changeCameraMode(); void reloadTextures(); void settings(); void about(); @@ -122,6 +121,8 @@ private: CSkeletonTreeModel *_SkeletonTreeModel; CTuneTimerDialog *_TuneTimerDialog; + CCameraControl *_cameraControl; + QPalette _originalPalette; QString _lastDir; @@ -143,7 +144,6 @@ private: QAction *_frameDelayAction; QAction *_lightGroupAction; QAction *_reloadTexturesAction; - QAction *_cameraModeAction; QAction *_resetCameraAction; QAction *_resetSceneAction; QAction *_saveScreenshotAction; diff --git a/code/nel/tools/3d/object_viewer_qt/src/modules.cpp b/code/nel/tools/3d/object_viewer_qt/src/modules.cpp index f2f4850c1..f48a311d8 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/modules.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/modules.cpp @@ -26,7 +26,7 @@ NLQT::CMainWindow *Modules::_mainWindow = NULL; NLQT::CParticleEditor *Modules::_particleEditor = NULL; NLQT::CSoundSystem *Modules::_soundSystem = NULL; NLQT::CVegetableEditor *Modules::_vegetableEditor = NULL; -ExtensionSystem::CPluginManager *Modules::_pluginManager = NULL; +ExtensionSystem::CPluginManager *Modules::_pluginManager = NULL; void Modules::init() { diff --git a/code/nel/tools/3d/object_viewer_qt/src/modules.h b/code/nel/tools/3d/object_viewer_qt/src/modules.h index 441baf22e..1e26e1f91 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/modules.h +++ b/code/nel/tools/3d/object_viewer_qt/src/modules.h @@ -62,9 +62,9 @@ public: { return *_vegetableEditor; } - static ExtensionSystem::CPluginManager &plugMan() - { - return *_pluginManager; + static ExtensionSystem::CPluginManager &plugMan() + { + return *_pluginManager; } private: @@ -74,7 +74,7 @@ private: static NLQT::CParticleEditor *_particleEditor; static NLQT::CSoundSystem *_soundSystem; static NLQT::CVegetableEditor *_vegetableEditor; - static ExtensionSystem::CPluginManager *_pluginManager; + static ExtensionSystem::CPluginManager *_pluginManager; }; #endif // MODULES_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/morph_mesh_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/morph_mesh_dialog.cpp index 392c97213..d125277e4 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/morph_mesh_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/morph_mesh_dialog.cpp @@ -34,9 +34,9 @@ namespace NLQT { CMorphMeshDialog::CMorphMeshDialog(CWorkspaceNode *ownerNode, NL3D::CPSConstraintMesh *cm, QWidget *parent) - : QDialog(parent), - _Node(ownerNode), - _CM(cm) + : QDialog(parent), + _Node(ownerNode), + _CM(cm) { _ui.setupUi(this); diff --git a/code/nel/tools/3d/object_viewer_qt/src/multi_tex_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/multi_tex_dialog.cpp index 968aa9a20..683d90726 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/multi_tex_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/multi_tex_dialog.cpp @@ -31,9 +31,9 @@ namespace NLQT { CMultiTexDialog::CMultiTexDialog(CWorkspaceNode *ownerNode, NL3D::CPSMultiTexturedParticle *mtp, QWidget *parent) - : QDialog(parent), - _Node(ownerNode), - _MTP(mtp) + : QDialog(parent), + _Node(ownerNode), + _MTP(mtp) { _ui.setupUi(this); diff --git a/code/nel/tools/3d/object_viewer_qt/src/object_viewer.cpp b/code/nel/tools/3d/object_viewer_qt/src/object_viewer.cpp index ac34152fa..07882f14a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/object_viewer.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/object_viewer.cpp @@ -23,7 +23,6 @@ // STL includes // NeL includes -#include #include #include #include @@ -59,13 +58,13 @@ namespace NLQT CObjectViewer::CObjectViewer() : _IDriver(0), - _CScene(0), - _Driver(0), - _Scene(0), - _TextContext(0), - _CameraFocal(75), - _CurrentInstance(""), - _BloomEffect(false) + _CScene(0), + _Driver(0), + _Scene(0), + _TextContext(0), + _CameraFocal(75), + _CurrentInstance(""), + _BloomEffect(false) { } @@ -115,19 +114,11 @@ void CObjectViewer::init(nlWindow wnd, uint16 w, uint16 h) _Scene->enableLightingSystem(true); - // create the camera - UCamera camera = _Scene->getCam(); - camera.setTransformMode (UTransformable::DirectMatrix); - - setSizeViewport(w, h); - NLMISC::CVector hotSpot=NLMISC::CVector(0,0,0); _MouseListener = _Driver->create3dMouseListener(); _MouseListener->setMouseMode(U3dMouseListener::edit3d); - resetCamera(); - // set the cache size for the font manager(in bytes) _Driver->setFontManagerMaxMemory(2097152); @@ -184,7 +175,7 @@ void CObjectViewer::release() void CObjectViewer::updateInput() { _Driver->EventServer.pump(); - + // New matrix from camera _Scene->getCam().setTransformMode(NL3D::UTransformable::DirectMatrix); _Scene->getCam().setMatrix (_MouseListener->getViewMatrix()); @@ -218,53 +209,38 @@ void CObjectViewer::renderDebug2D() void CObjectViewer::reloadTextures() { - // For each instances - std::vector listObjects; - getListObjects(listObjects); - - for (size_t i = 0; i < listObjects.size(); ++i) - { - // Get the shape - NL3D::UInstance instance = getEntity(listObjects[i]).getInstance(); - - // For each material - if (!instance.empty()) - { - uint numMaterial = instance.getNumMaterials(); - uint mat; - for (mat = 0; mat < numMaterial; mat++) - { - // Get the material - NL3D::CMaterial *material = instance.getMaterial(mat).getObjectPtr(); - - // For each texture - int tex; - for (tex = 0; tex < NL3D::IDRV_MAT_MAXTEXTURES; tex++) - { - ITexture *texture = material->getTexture(tex); - - // Touch it! - if (texture) - getIDriver()->invalidateShareTexture(*texture); - } - } - } - } -} + // For each instances + std::vector listObjects; + getListObjects(listObjects); -void CObjectViewer::resetCamera() -{ - CVector hotSpot = CVector (0,0,0); - float radius=10.f; - - // Setup camera - _Scene->getCam().lookAt(hotSpot + CVector(0.57735f, 0.57735f, 0.57735f) * radius, hotSpot); - - // Setup mouse listener - _MouseListener->setMatrix (_Scene->getCam().getMatrix()); - _MouseListener->setFrustrum (_Scene->getCam().getFrustum()); - _MouseListener->setViewport (CViewport()); - _MouseListener->setHotSpot (hotSpot); + for (size_t i = 0; i < listObjects.size(); ++i) + { + // Get the shape + NL3D::UInstance instance = getEntity(listObjects[i]).getInstance(); + + // For each material + if (!instance.empty()) + { + uint numMaterial = instance.getNumMaterials(); + uint mat; + for (mat = 0; mat < numMaterial; mat++) + { + // Get the material + NL3D::CMaterial *material = instance.getMaterial(mat).getObjectPtr(); + + // For each texture + int tex; + for (tex = 0; tex < NL3D::IDRV_MAT_MAXTEXTURES; tex++) + { + ITexture *texture = material->getTexture(tex); + + // Touch it! + if (texture) + getIDriver()->invalidateShareTexture(*texture); + } + } + } + } } void CObjectViewer::saveScreenshot(const std::string &nameFile, bool jpg, bool png, bool tga) @@ -316,11 +292,11 @@ bool CObjectViewer::loadMesh(const std::string &meshFileName, const std::string // if we can't create entity, skip it if (Entity.empty()) return false; - - CAABBox bbox; - Entity.getShapeAABBox(bbox); - setCamera(bbox , Entity, true); - + + CAABBox bbox; + Entity.getShapeAABBox(bbox); + setCamera(bbox , Entity, true); + _MouseListener->setMatrix(_Scene->getCam().getMatrix()); USkeleton Skeleton = _Scene->createSkeleton(skelFileName); @@ -348,57 +324,57 @@ bool CObjectViewer::loadInstanceGroup(const std::string &igName) { CPath::addSearchPath (CFile::getPath(igName)); UInstanceGroup *ig = UInstanceGroup::createInstanceGroup(igName); - if (ig == 0) + if (ig == 0) return false; ig->addToScene(*_Scene, _Driver); ig->unfreezeHRC(); _ListIG.push_back(ig); return true; } - -void CObjectViewer::setCamera(NLMISC::CAABBox &bbox, NL3D::UTransform &entity, bool high_z) -{ - CVector pos(0.f, 0.f, 0.f); - CQuat quat(0.f, 0.f, 0.f, 0.f); - NL3D::UInstance inst; - inst.cast(entity); - if (!inst.empty()) - { - inst.getDefaultPos(pos); - inst.getDefaultRotQuat(quat); - } - - // fix scale (some shapes have a different value) - entity.setScale(1.f, 1.f, 1.f); - UCamera Camera = _Scene->getCam(); - CVector max_radius = bbox.getHalfSize(); - CVector center = bbox.getCenter(); - entity.setPivot(center); - center += pos; - float fov = float(_CameraFocal * (float)Pi/180.0); - float radius = max(max(max_radius.x, max_radius.y), max_radius.z); - if (radius == 0.f) radius = 1.f; - float left, right, bottom, top, znear, zfar; - Camera.getFrustum(left, right, bottom, top, znear, zfar); - float dist = radius / (tan(fov/2)); - CVector eye(center); - - CVector ax(quat.getAxis()); - - if (ax.isNull() || ax == CVector::I) - { - ax = CVector::J; - } - else if (ax == -CVector::K) - { - ax = -CVector::J; - } - - eye -= ax * (dist+radius); - if (high_z) - eye.z += max_radius.z/1.0f; - get3dMouseListener()->setHotSpot(center); - Camera.lookAt(eye, center); + +void CObjectViewer::setCamera(NLMISC::CAABBox &bbox, NL3D::UTransform &entity, bool high_z) +{ + CVector pos(0.f, 0.f, 0.f); + CQuat quat(0.f, 0.f, 0.f, 0.f); + NL3D::UInstance inst; + inst.cast(entity); + if (!inst.empty()) + { + inst.getDefaultPos(pos); + inst.getDefaultRotQuat(quat); + } + + // fix scale (some shapes have a different value) + entity.setScale(1.f, 1.f, 1.f); + UCamera Camera = _Scene->getCam(); + CVector max_radius = bbox.getHalfSize(); + CVector center = bbox.getCenter(); + entity.setPivot(center); + center += pos; + float fov = float(_CameraFocal * (float)Pi/180.0); + float radius = max(max(max_radius.x, max_radius.y), max_radius.z); + if (radius == 0.f) radius = 1.f; + float left, right, bottom, top, znear, zfar; + Camera.getFrustum(left, right, bottom, top, znear, zfar); + float dist = radius / (tan(fov/2)); + CVector eye(center); + + CVector ax(quat.getAxis()); + + if (ax.isNull() || ax == CVector::I) + { + ax = CVector::J; + } + else if (ax == -CVector::K) + { + ax = -CVector::J; + } + + eye -= ax * (dist+radius); + if (high_z) + eye.z += max_radius.z/1.0f; + get3dMouseListener()->setHotSpot(center); + Camera.lookAt(eye, center); } void CObjectViewer::resetScene() diff --git a/code/nel/tools/3d/object_viewer_qt/src/object_viewer.h b/code/nel/tools/3d/object_viewer_qt/src/object_viewer.h index 2cdefe426..b74544a3c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/object_viewer.h +++ b/code/nel/tools/3d/object_viewer_qt/src/object_viewer.h @@ -100,8 +100,6 @@ public: void reloadTextures(); - void resetCamera(); - /// Make a screenshot of the current scene and save. void saveScreenshot(const std::string &nameFile, bool jpg, bool png, bool tga); @@ -188,19 +186,19 @@ public: { return _Driver; } - + NL3D::IDriver *getIDriver() const { return _IDriver; } - + /// Get a game interface for scene. /// @return pointer to the scene. inline NL3D::UScene *getScene() const { return _Scene; } - + NL3D::CScene *getCScene() const { return _CScene; diff --git a/code/nel/tools/3d/object_viewer_qt/src/object_viewer_qt.qrc b/code/nel/tools/3d/object_viewer_qt/src/object_viewer_qt.qrc index 5b14b74f6..1957bf1ea 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/object_viewer_qt.qrc +++ b/code/nel/tools/3d/object_viewer_qt/src/object_viewer_qt.qrc @@ -36,8 +36,13 @@ images/save-as.png images/save.png images/insert-horizontal.png - images/polymode.png - + images/polymode.png + images/rmfill.png + images/rmline.png + images/rmpoints.png + images/cam_del.png + images/cam_add.png + images/Emitter.bmp images/Force.bmp diff --git a/code/nel/tools/3d/object_viewer_qt/src/particle_editor.cpp b/code/nel/tools/3d/object_viewer_qt/src/particle_editor.cpp index 1a7edfeaa..0ce56cc2a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/particle_editor.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/particle_editor.cpp @@ -35,18 +35,18 @@ namespace NLQT CParticleEditor::CParticleEditor(void) : _ActiveNode(NULL), - _State(State::Stopped), - _Speed(1.0f), - _AutoRepeat(false), - _DisplayBBox(false), - _DisplayHelpers(false), - _AutoUpdateBBox(false), - _EmptyBBox(true), - _PW(NULL), - _Driver(NULL), - _Scene(NULL), - _FontManager(NULL), - _FontGen(NULL) + _State(State::Stopped), + _Speed(1.0f), + _AutoRepeat(false), + _DisplayBBox(false), + _DisplayHelpers(false), + _AutoUpdateBBox(false), + _EmptyBBox(true), + _PW(NULL), + _Driver(NULL), + _Scene(NULL), + _FontManager(NULL), + _FontGen(NULL) { } diff --git a/code/nel/tools/3d/object_viewer_qt/src/particle_node.cpp b/code/nel/tools/3d/object_viewer_qt/src/particle_node.cpp index b9b8268c2..3dfc1ce2c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/particle_node.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/particle_node.cpp @@ -64,7 +64,7 @@ void CWorkspaceNode::memorizeState() void CWorkspaceNode::restoreState() { nlassert(_WS); - if (!_PS) + if (!_PS) return; _InitialPos.restoreSystem(); } @@ -80,7 +80,7 @@ void CWorkspaceNode::stickPSToSkeleton(NL3D::CSkeletonModel *skel, const std::string &parentBoneName) { nlassert(_WS); - if (!_PSM) + if (!_PSM) return; unstickPSFromSkeleton(); _ParentSkelName = parentSkelName; @@ -293,7 +293,7 @@ bool CWorkspaceNode::loadPS() throw(NLMISC::EStream) if (oldSB) { Modules::psEdit().getScene()->setShapeBank(oldSB); - } + } setup(*psm); unload(); // commit new values diff --git a/code/nel/tools/3d/object_viewer_qt/src/particle_tree_model.cpp b/code/nel/tools/3d/object_viewer_qt/src/particle_tree_model.cpp index 9e30dc8a7..7d909d776 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/particle_tree_model.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/particle_tree_model.cpp @@ -126,7 +126,7 @@ bool CParticleTreeItem::replace(const QList &data) bool CParticleTreeItem::deleteChild(int row) { - _childItems.removeAt(row); + delete _childItems.takeAt(row); return true; } diff --git a/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_dialog.cpp index 7b5a05535..e420af8ff 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_dialog.cpp @@ -124,7 +124,7 @@ static std::map _PSElementIdentifiers; CParticleWorkspaceDialog::CParticleWorkspaceDialog(QWidget *parent) : QDockWidget(parent), - _currentItem(NULL) + _currentItem(NULL) { _ui.setupUi(this); diff --git a/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_page.h b/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_page.h index c533e8325..b29945b9a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/particle_workspace_page.h @@ -36,7 +36,7 @@ namespace NLQT /** @class CWorkspacePage -@brief Page for QStackWidget, to particles workspace operation (new/load/save workspace, +@brief Page for QStackWidget, to particles workspace operation (new/load/save workspace, create/insert/remove all particles system to workspace) */ class CWorkspacePage: public QWidget diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt index 19632cee8..2ff8e894d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt @@ -12,7 +12,6 @@ SET(OVQT_CORE_PLUGIN_HDR core_plugin.h main_window.h settings_dialog.h - qnel_widget.h search_paths_settings_page.h plugin_view_dialog.h) @@ -37,11 +36,7 @@ SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) ADD_LIBRARY(ovqt_plugin_core MODULE ${SRC} ${OVQT_CORE_PLUGIN_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_CORE_PLUGIN_RC_SRCS} ${OVQT_CORE_PLUGIN_UI_HDRS}) -TARGET_LINK_LIBRARIES(ovqt_plugin_core nelmisc nel3d ${QT_LIBRARIES}) - -IF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(ovqt_plugin_core ${CMAKE_THREAD_LIBS_INIT}) -ENDIF(WITH_STLPORT) +TARGET_LINK_LIBRARIES(ovqt_plugin_core nelmisc ${QT_LIBRARIES}) NL_DEFAULT_PROPS(ovqt_plugin_core "NeL, Tools, 3D: Object Viewer Qt Plugin: Core") NL_ADD_RUNTIME_FLAGS(ovqt_plugin_core) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp index 164badf83..a1c3dced0 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp @@ -15,8 +15,18 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . +// Project includes #include "core_plugin.h" +#include "settings_dialog.h" +#include "core_constants.h" +#include "search_paths_settings_page.h" +#include "../../extension_system/iplugin_spec.h" +#include "qtwin.h" +// NeL includes +#include "nel/misc/debug.h" + +// Qt includes #include #include #include @@ -24,55 +34,70 @@ #include #include -#include "../../extension_system/iplugin_spec.h" - -#include "settings_dialog.h" -#include "core_constants.h" -#include "search_paths_settings_page.h" -#include "nel/misc/debug.h" - using namespace Core; bool CorePlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) { Q_UNUSED(errorString); _plugMan = pluginManager; - // for old ovqt - QMainWindow *wnd = qobject_cast(objectByName("CMainWindow")); - if (!wnd) - { - *errorString = tr("Not found QMainWindow Object Viewer Qt."); - return false; - } + oldOVQT = false; - //_mainWindow = new CMainWindow(_plugMan); - //_mainWindow->show(); - _plugMan->addObject(new CSearchPathsSettingsPage(wnd)); + _plugMan->addObject(new CSearchPathsSettingsPage(this)); return true; } void CorePlugin::extensionsInitialized() { - // for old ovqt _pluginView = new ExtensionSystem::CPluginView(_plugMan); - QMenu *toolsMenu = qobject_cast(objectByName("ovqt.Menu.Tools")); - QMenu *helpMenu = qobject_cast(objectByName("ovqt.Menu.Help")); - nlassert(toolsMenu); - nlassert(helpMenu); + // for old ovqt + QMainWindow *wnd = qobject_cast(objectByName("CMainWindow")); + if (wnd) + { + _pluginView = new ExtensionSystem::CPluginView(_plugMan); + QMenu *toolsMenu = qobject_cast(objectByName("ovqt.Menu.Tools")); + QMenu *helpMenu = qobject_cast(objectByName("ovqt.Menu.Help")); + nlassert(toolsMenu); + nlassert(helpMenu); - QAction *newAction = toolsMenu->addAction(tr("New settings")); - QAction *newAction2 = helpMenu->addAction(tr("About plugins")); - newAction->setIcon(QIcon(Constants::ICON_SETTINGS)); + QAction *newAction = toolsMenu->addAction(tr("New settings")); + QAction *newAction2 = helpMenu->addAction(tr("About plugins")); + newAction->setIcon(QIcon(Constants::ICON_SETTINGS)); - connect(newAction, SIGNAL(triggered()), this, SLOT(execSettings())); - connect(newAction2, SIGNAL(triggered()), _pluginView, SLOT(show())); + connect(newAction, SIGNAL(triggered()), this, SLOT(execSettings())); + connect(newAction2, SIGNAL(triggered()), _pluginView, SLOT(show())); + oldOVQT = true; + } + else + { + _mainWindow = new CMainWindow(this); +#ifdef Q_WS_X11 + _mainWindow->setAttribute(Qt::WA_TranslucentBackground); + _mainWindow->setAttribute(Qt::WA_NoSystemBackground, false); + QPalette pal = _mainWindow->palette(); + QColor bg = pal.window().color(); + bg.setAlpha(180); + pal.setColor(QPalette::Window, bg); + _mainWindow->setPalette(pal); + _mainWindow->ensurePolished(); // workaround Oxygen filling the background + _mainWindow->setAttribute(Qt::WA_StyledBackground, false); +#endif + if (QtWin::isCompositionEnabled()) + { + QtWin::extendFrameIntoClientArea(_mainWindow); + _mainWindow->setContentsMargins(0, 0, 0, 0); + } + _mainWindow->show(); + } } void CorePlugin::shutdown() { - //delete _mainWindow; - delete _pluginView; + if (!oldOVQT) + { + delete _mainWindow; + delete _pluginView; + } } void CorePlugin::execSettings() diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.h index 1092bacaf..0695a0acf 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.h @@ -58,6 +58,24 @@ public: QObject *objectByName(const QString &name) const; ExtensionSystem::IPluginSpec *pluginByName(const QString &name) const; + ExtensionSystem::IPluginManager *pluginManager() const + { + return _plugMan; + } + + template + QList getObjects() const + { + QList all = _plugMan->allObjects(); + QList objects; + Q_FOREACH(QObject *obj, all) + { + Type *typeObj = qobject_cast(obj); + if (typeObj) + objects.append(typeObj); + } + return objects; + } protected: NLMISC::CLibraryContext *_LibContext; @@ -69,6 +87,8 @@ private: ExtensionSystem::IPluginManager *_plugMan; ExtensionSystem::CPluginView *_pluginView; CMainWindow *_mainWindow; + + bool oldOVQT; }; } // namespace Core diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/iapp_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/iapp_page.h new file mode 100644 index 000000000..49e9ea265 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/iapp_page.h @@ -0,0 +1,55 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero 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 Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef IAPP_PAGE_H +#define IAPP_PAGE_H + +#include + +class QWidget; + +namespace Core +{ +/** +@interface IAppPage +@brief The IAppPage is an interface for providing app pages in main window. +@details You need to subclass this interface and put an instance of your subclass + into the plugin manager object pool. +*/ +class IAppPage +{ +public: + virtual ~IAppPage() {} + + /// id() is a unique identifier for referencing this page + virtual QString id() const = 0; + + /// trName() is the (translated) name for display. + virtual QString trName() const = 0; + + /// icon() is the icon for display + virtual QIcon icon() const = 0; + + /// The widget will be destroyed by the widget hierarchy when the main window closes + virtual QWidget *widget() = 0; +}; + +} // namespace Core + +Q_DECLARE_INTERFACE(Core::IAppPage, "dev.ryzom.com.IAppPage/0.1") + +#endif // IAPP_PAGE_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icore_listener.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icore_listener.h new file mode 100644 index 000000000..c37ba3366 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/icore_listener.h @@ -0,0 +1,56 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero 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 Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef ICORE_LISTENER_H +#define ICORE_LISTENER_H + +#include + +class QWidget; + +namespace Core +{ +/** +@interface ICoreListener +@brief The ICoreListener is an interface for providing a hook for plugins to veto on close event emitted from +the core plugin. +@details You implement this interface if you want to prevent the closing of the whole application. +If the application window requests a close, then first ICoreListener::closeMainWindow() is called +(in arbitrary order) on all registered objects implementing this interface. +If one if these calls returns false, the process is aborted and the event is ignored. If all calls return +true, the corresponding signal is emitted and the event is accepted/performed. + +You need to add your implementing object to the plugin managers objects: +PluginManager->addObject(yourImplementingObject); +Don't forget to remove the object again at deconstruction (e.g. in the destructor of +your plugin) +*/ +class ICoreListener +{ +public: + virtual ~ICoreListener() {} + + /// Return false from the implemented method if you want to prevent the event. + virtual bool closeMainWindow() const = 0; +}; + +} // namespace Core + +Q_DECLARE_INTERFACE(Core::ICoreListener, "dev.ryzom.com.ICoreListener/0.1") + +#endif // ICORE_LISTENER_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/ioptions_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/ioptions_page.h index 912adc1de..2d780bc2d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/ioptions_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/ioptions_page.h @@ -31,7 +31,7 @@ namespace Core @details You need to subclass this interface and put an instance of your subclass into the plugin manager object pool. */ -class IOptionsPage +class IOptionsPage { public: virtual ~IOptionsPage() {} @@ -63,4 +63,4 @@ public: Q_DECLARE_INTERFACE(Core::IOptionsPage, "dev.ryzom.com.IOptionsPage/1.0") -#endif // IOPTIONSPAGE_H +#endif // IOPTIONS_PAGE_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp index 7b15cde19..601159f8b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp @@ -17,43 +17,40 @@ // Project includes #include "main_window.h" +#include "core_plugin.h" +#include "iapp_page.h" +#include "icore_listener.h" #include "core_constants.h" #include "settings_dialog.h" +// NeL includes +#include // Qt includes #include namespace Core { -CMainWindow::CMainWindow(ExtensionSystem::IPluginManager *pluginManager, QWidget *parent) +CMainWindow::CMainWindow(CorePlugin *corePlugin, QWidget *parent) : QMainWindow(parent), _lastDir(".") { - _pluginManager = pluginManager; + _corePlugin = corePlugin; + _pluginManager = _corePlugin->pluginManager(); + _settings = _pluginManager->settings(); setObjectName(Constants::MAIN_WINDOW); _tabWidget = new QTabWidget(this); + _tabWidget->setTabPosition(QTabWidget::South); setCentralWidget(_tabWidget); - QWidget *qwidg1 = new QWidget(_tabWidget); - QWidget *qwidg2 = new QWidget(_tabWidget); + QList listAppPages = _corePlugin->getObjects(); - _tabWidget->addTab(qwidg1, "tab1"); - _tabWidget->addTab(qwidg2, "tab2"); - - - QGridLayout *gridLayout = new QGridLayout(qwidg1); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); - NLQT::QNLWidget *_nelWidget = new NLQT::QNLWidget(qwidg1); - _nelWidget->setObjectName(QString::fromUtf8("NELWIdget1")); - gridLayout->addWidget(_nelWidget, 0, 0, 1, 1); - - QGridLayout *gridLayout2 = new QGridLayout(qwidg2); - NLQT::QNLWidget *_nelWidget2 = new NLQT::QNLWidget(qwidg2); - _nelWidget2->setObjectName(QString::fromUtf8("NELWIdget2")); - gridLayout2->addWidget(_nelWidget2, 0, 0, 1, 1); + Q_FOREACH(IAppPage *appPage, listAppPages) + { + addAppPage(appPage); + } setDockNestingEnabled(true); @@ -64,8 +61,12 @@ CMainWindow::CMainWindow(ExtensionSystem::IPluginManager *pluginManager, QWidget createMenus(); createStatusBar(); + readSettings(); + setWindowIcon(QIcon(Constants::ICON_NEL)); setWindowTitle(tr("Object Viewer Qt")); + + connect(_pluginManager, SIGNAL(objectAdded(QObject *)), this, SLOT(checkObject(QObject *))); } CMainWindow::~CMainWindow() @@ -73,6 +74,13 @@ CMainWindow::~CMainWindow() delete _pluginView; } +void CMainWindow::checkObject(QObject *obj) +{ + IAppPage *appPage = qobject_cast(obj); + if (appPage) + addAppPage(appPage); +} + bool CMainWindow::showOptionsDialog(const QString &group, const QString &page, QWidget *parent) @@ -91,6 +99,33 @@ void CMainWindow::about() "

Author: dnk-88

Compiled on %1 %2").arg(__DATE__).arg(__TIME__)); } +void CMainWindow::closeEvent(QCloseEvent *event) +{ + QList listeners = _corePlugin->getObjects(); + Q_FOREACH(ICoreListener *listener, listeners) + { + if (!listener->closeMainWindow()) + { + event->ignore(); + return; + } + } + + writeSettings(); + + QMainWindow::closeEvent(event); +} + +void CMainWindow::addAppPage(IAppPage *appPage) +{ + QWidget *tabWidget = new QWidget(_tabWidget); + _tabWidget->addTab(tabWidget, appPage->icon(), appPage->trName()); + QGridLayout *gridLayout = new QGridLayout(tabWidget); + gridLayout->setObjectName(QString::fromUtf8("gridLayout_") + appPage->id()); + gridLayout->setContentsMargins(0, 0, 0, 0); + gridLayout->addWidget(appPage->widget(), 0, 0, 1, 1); +} + void CMainWindow::createActions() { _openAction = new QAction(tr("&Open..."), this); @@ -150,12 +185,6 @@ void CMainWindow::createMenus() _helpMenu->addAction(_aboutAction); _helpMenu->addAction(_aboutQtAction); _helpMenu->addAction(_pluginViewAction); - - _pluginManager->addObject(_fileMenu); - _pluginManager->addObject(_editMenu); - _pluginManager->addObject(_viewMenu); - _pluginManager->addObject(_toolsMenu); - _pluginManager->addObject(_helpMenu); } void CMainWindow::createStatusBar() @@ -168,6 +197,22 @@ void CMainWindow::createDialogs() _pluginView = new ExtensionSystem::CPluginView(_pluginManager, this); } +void CMainWindow::readSettings() +{ + _settings->beginGroup("MainWindowSettings"); + restoreState(_settings->value("QtWindowState").toByteArray()); + restoreGeometry(_settings->value("QtWindowGeometry").toByteArray()); + _settings->endGroup(); +} + +void CMainWindow::writeSettings() +{ + _settings->beginGroup("MainWindowSettings"); + _settings->setValue("QtWindowState", saveState()); + _settings->setValue("QtWindowGeometry", saveGeometry()); + _settings->endGroup(); +} + } /* namespace Core */ /* end of file */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h index e26cb4aab..4b807dd04 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h @@ -18,48 +18,53 @@ #ifndef MAIN_WINDOW_H #define MAIN_WINDOW_H +// Project includes +#include "../../extension_system/iplugin.h" +#include "plugin_view_dialog.h" + // STL includes // Qt includes #include #include -// Project includes -#include "qnel_widget.h" -#include "../../extension_system/iplugin.h" -#include "plugin_view_dialog.h" - namespace Core { class CSettingsDialog; +class CorePlugin; +class IAppPage; class CMainWindow : public QMainWindow { Q_OBJECT public: - CMainWindow(ExtensionSystem::IPluginManager *pluginManager, QWidget *parent = 0); + CMainWindow(CorePlugin *corePlugin, QWidget *parent = 0); ~CMainWindow(); - inline QSettings *settings() const - { - return _settings; - } - private Q_SLOTS: + void checkObject(QObject *obj); bool showOptionsDialog(const QString &group = QString(), - const QString &page = QString(), - QWidget *parent = 0); + const QString &page = QString(), + QWidget *parent = 0); void about(); +protected: + virtual void closeEvent(QCloseEvent *event); private: + void addAppPage(IAppPage *appPage); + void createActions(); void createMenus(); void createStatusBar(); void createDialogs(); + void readSettings(); + void writeSettings(); + ExtensionSystem::IPluginManager *_pluginManager; ExtensionSystem::CPluginView *_pluginView; + CorePlugin *_corePlugin; QPalette _originalPalette; QString _lastDir; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/qtwin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/qtwin.cpp new file mode 100644 index 000000000..dc0fb6cf0 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/qtwin.cpp @@ -0,0 +1,241 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Use, modification and distribution is allowed without limitation, +** warranty, liability or support of any kind. +** +****************************************************************************/ + +#include "qtwin.h" +#include +#include +#include +#include +#include + +#ifdef Q_WS_WIN + +#include + +// Blur behind data structures +#define DWM_BB_ENABLE 0x00000001 // fEnable has been specified +#define DWM_BB_BLURREGION 0x00000002 // hRgnBlur has been specified +#define DWM_BB_TRANSITIONONMAXIMIZED 0x00000004 // fTransitionOnMaximized has been specified +#define WM_DWMCOMPOSITIONCHANGED 0x031E // Composition changed window message + +typedef struct _DWM_BLURBEHIND +{ + DWORD dwFlags; + BOOL fEnable; + HRGN hRgnBlur; + BOOL fTransitionOnMaximized; +} DWM_BLURBEHIND, *PDWM_BLURBEHIND; + +typedef struct _MARGINS +{ + int cxLeftWidth; + int cxRightWidth; + int cyTopHeight; + int cyBottomHeight; +} MARGINS, *PMARGINS; + +typedef HRESULT (WINAPI *PtrDwmIsCompositionEnabled)(BOOL* pfEnabled); +typedef HRESULT (WINAPI *PtrDwmExtendFrameIntoClientArea)(HWND hWnd, const MARGINS* pMarInset); +typedef HRESULT (WINAPI *PtrDwmEnableBlurBehindWindow)(HWND hWnd, const DWM_BLURBEHIND* pBlurBehind); +typedef HRESULT (WINAPI *PtrDwmGetColorizationColor)(DWORD *pcrColorization, BOOL *pfOpaqueBlend); + +static PtrDwmIsCompositionEnabled pDwmIsCompositionEnabled= 0; +static PtrDwmEnableBlurBehindWindow pDwmEnableBlurBehindWindow = 0; +static PtrDwmExtendFrameIntoClientArea pDwmExtendFrameIntoClientArea = 0; +static PtrDwmGetColorizationColor pDwmGetColorizationColor = 0; + + +/* + * Internal helper class that notifies windows if the + * DWM compositing state changes and updates the widget + * flags correspondingly. + */ +class WindowNotifier : public QWidget +{ +public: + WindowNotifier() + { + winId(); + } + void addWidget(QWidget *widget) + { + widgets.append(widget); + } + void removeWidget(QWidget *widget) + { + widgets.removeAll(widget); + } + bool winEvent(MSG *message, long *result); + +private: + QWidgetList widgets; +}; + +static bool resolveLibs() +{ + if (!pDwmIsCompositionEnabled) + { + QLibrary dwmLib(QString::fromAscii("dwmapi")); + pDwmIsCompositionEnabled =(PtrDwmIsCompositionEnabled)dwmLib.resolve("DwmIsCompositionEnabled"); + pDwmExtendFrameIntoClientArea = (PtrDwmExtendFrameIntoClientArea)dwmLib.resolve("DwmExtendFrameIntoClientArea"); + pDwmEnableBlurBehindWindow = (PtrDwmEnableBlurBehindWindow)dwmLib.resolve("DwmEnableBlurBehindWindow"); + pDwmGetColorizationColor = (PtrDwmGetColorizationColor)dwmLib.resolve("DwmGetColorizationColor"); + } + return pDwmIsCompositionEnabled != 0; +} + +#endif + +/*! + * Chekcs and returns true if Windows DWM composition + * is currently enabled on the system. + * + * To get live notification on the availability of + * this feature, you will currently have to + * reimplement winEvent() on your widget and listen + * for the WM_DWMCOMPOSITIONCHANGED event to occur. + * + */ +bool QtWin::isCompositionEnabled() +{ +#ifdef Q_WS_WIN + if (resolveLibs()) + { + HRESULT hr = S_OK; + BOOL isEnabled = false; + hr = pDwmIsCompositionEnabled(&isEnabled); + if (SUCCEEDED(hr)) + return isEnabled; + } +#endif + return false; +} + +/*! + * Enables Blur behind on a Widget. + * + * \a enable tells if the blur should be enabled or not + */ +bool QtWin::enableBlurBehindWindow(QWidget *widget, bool enable) +{ + Q_ASSERT(widget); + bool result = false; +#ifdef Q_WS_WIN + if (resolveLibs()) + { + DWM_BLURBEHIND bb = {0}; + HRESULT hr = S_OK; + bb.fEnable = enable; + bb.dwFlags = DWM_BB_ENABLE; + bb.hRgnBlur = NULL; + widget->setAttribute(Qt::WA_TranslucentBackground, enable); + widget->setAttribute(Qt::WA_NoSystemBackground, enable); + hr = pDwmEnableBlurBehindWindow(widget->winId(), &bb); + if (SUCCEEDED(hr)) + { + result = true; + windowNotifier()->addWidget(widget); + } + } +#endif + return result; +} + +/*! + * ExtendFrameIntoClientArea. + * + * This controls the rendering of the frame inside the window. + * Note that passing margins of -1 (the default value) will completely + * remove the frame from the window. + * + * \note you should not call enableBlurBehindWindow before calling + * this functions + * + * \a enable tells if the blur should be enabled or not + */ +bool QtWin::extendFrameIntoClientArea(QWidget *widget, int left, int top, int right, int bottom) +{ + + Q_ASSERT(widget); + Q_UNUSED(left); + Q_UNUSED(top); + Q_UNUSED(right); + Q_UNUSED(bottom); + + bool result = false; +#ifdef Q_WS_WIN + if (resolveLibs()) + { + QLibrary dwmLib(QString::fromAscii("dwmapi")); + HRESULT hr = S_OK; + MARGINS m = {left, top, right, bottom}; + hr = pDwmExtendFrameIntoClientArea(widget->winId(), &m); + if (SUCCEEDED(hr)) + { + result = true; + windowNotifier()->addWidget(widget); + } + widget->setAttribute(Qt::WA_TranslucentBackground, result); + } +#endif + return result; +} + +/*! + * Returns the current colorizationColor for the window. + * + * \a enable tells if the blur should be enabled or not + */ +QColor QtWin::colorizatinColor() +{ + QColor resultColor = QApplication::palette().window().color(); + +#ifdef Q_WS_WIN + if (resolveLibs()) + { + DWORD color = 0; + BOOL opaque = FALSE; + QLibrary dwmLib(QString::fromAscii("dwmapi")); + HRESULT hr = S_OK; + hr = pDwmGetColorizationColor(&color, &opaque); + if (SUCCEEDED(hr)) + resultColor = QColor(color); + } +#endif + return resultColor; +} + +#ifdef Q_WS_WIN +WindowNotifier *QtWin::windowNotifier() +{ + static WindowNotifier *windowNotifierInstance = 0; + if (!windowNotifierInstance) + windowNotifierInstance = new WindowNotifier; + return windowNotifierInstance; +} + + +/* Notify all enabled windows that the DWM state changed */ +bool WindowNotifier::winEvent(MSG *message, long *result) +{ + if (message && message->message == WM_DWMCOMPOSITIONCHANGED) + { + bool compositionEnabled = QtWin::isCompositionEnabled(); + Q_FOREACH(QWidget * widget, widgets) + { + if (widget) + { + widget->setAttribute(Qt::WA_NoSystemBackground, compositionEnabled); + } + widget->update(); + } + } + return QWidget::winEvent(message, result); +} +#endif diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/qtwin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/qtwin.h new file mode 100644 index 000000000..039fa3f8d --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/qtwin.h @@ -0,0 +1,37 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Use, modification and distribution is allowed without limitation, +** warranty, liability or support of any kind. +** +****************************************************************************/ + +#ifndef QTWIN_H +#define QTWIN_H + +#include +#include +/** + * This is a helper class for using the Desktop Window Manager + * functionality on Windows 7 and Windows Vista. On other platforms + * these functions will simply not do anything. + */ + +class WindowNotifier; + +class QtWin +{ +public: + static bool enableBlurBehindWindow(QWidget *widget, bool enable = true); + static bool extendFrameIntoClientArea(QWidget *widget, + int left = -1, int top = -1, + int right = -1, int bottom = -1); + static bool isCompositionEnabled(); + static QColor colorizatinColor(); + +private: + static WindowNotifier *windowNotifier(); +}; + +#endif // QTWIN_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.h index 72d2a2e40..bafad8f40 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.h @@ -32,7 +32,7 @@ namespace Core /** @class CSearchPathsSettingsPage */ - class CSearchPathsSettingsPage : public QObject, public Core::IOptionsPage +class CSearchPathsSettingsPage : public QObject, public Core::IOptionsPage { Q_OBJECT Q_INTERFACES(Core::IOptionsPage) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.ui index 469846d02..f0d08e40b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.ui @@ -15,7 +15,7 @@ - 9 + 0 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/CMakeLists.txt index 50c5317a3..d14b42806 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/CMakeLists.txt @@ -10,7 +10,11 @@ SET(OVQT_EXT_SYS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin. ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_spec.h) SET(OVQT_PLUG_EXAMPLE_HDR plugin1.h + qnel_widget.h + simple_viewer.h example_settings_page.h + ${CMAKE_CURRENT_SOURCE_DIR}/../core/iapp_page.h + ${CMAKE_CURRENT_SOURCE_DIR}/../core/icore_listener.h ${CMAKE_CURRENT_SOURCE_DIR}/../core/ioptions_page.h) SET(OVQT_PLUG_EXAMPLE_UIS example_settings_page.ui) @@ -29,11 +33,7 @@ SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) ADD_LIBRARY(ovqt_plugin_example MODULE ${SRC} ${OVQT_PLUG_EXAMPLE_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_EXAMPLE_UI_HDRS}) -TARGET_LINK_LIBRARIES(ovqt_plugin_example nelmisc ${QT_LIBRARIES}) - -IF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(ovqt_plugin_example ${CMAKE_THREAD_LIBS_INIT}) -ENDIF(WITH_STLPORT) +TARGET_LINK_LIBRARIES(ovqt_plugin_example nelmisc nel3d ${QT_LIBRARIES}) NL_DEFAULT_PROPS(ovqt_plugin_example "NeL, Tools, 3D: Object Viewer Qt Plugin: Example") NL_ADD_RUNTIME_FLAGS(ovqt_plugin_example) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.ui index 224a783fa..b839d98ce 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/example_settings_page.ui @@ -14,6 +14,9 @@ Form + + 0 + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp index 18896b19d..07185c5fa 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp @@ -1,59 +1,37 @@ -#include "plugin1.h" - -#include -#include -#include -#include -#include -#include - - -#include "../../extension_system/iplugin_spec.h" -#include "example_settings_page.h" -#include "nel/misc/debug.h" - -using namespace Plugin; +// Project includes +#include "plugin1.h" +#include "example_settings_page.h" +#include "simple_viewer.h" +#include "../core/iapp_page.h" +#include "../../extension_system/iplugin_spec.h" + +// NeL includes +#include "nel/misc/debug.h" + +// Qt includes +#include +#include +#include +#include +#include +#include + +namespace Plugin +{ bool MyPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) { Q_UNUSED(errorString); _plugMan = pluginManager; - QMainWindow *wnd = qobject_cast(objectByName("CMainWindow")); - _plugMan->addObject(new CExampleSettingsPage(wnd)); - if (!wnd) - { - *errorString = tr("Not found QMainWindow Object Viewer Qt."); - return false; - } - QMenu *helpMenu = qobject_cast(objectByName("ovqt.Menu.Tools")); - if (!helpMenu) - { - *errorString = tr("Not found QMenu Help."); - return false; - } + _plugMan->addObject(new CExampleSettingsPage(this)); + _plugMan->addObject(new CExampleAppPage(this)); + _plugMan->addObject(new CCoreListener(this)); return true; } void MyPlugin::extensionsInitialized() { - QMenu *helpMenu = qobject_cast(objectByName("ovqt.Menu.Help")); - nlassert(helpMenu); - - helpMenu->addSeparator(); - QAction *newAction = helpMenu->addAction("MyPlugin"); - - connect(newAction, SIGNAL(triggered()), this, SLOT(execMessageBox())); -} - -void MyPlugin::execMessageBox() -{ - QMainWindow *wnd = qobject_cast(objectByName("CMainWindow")); - nlassert(wnd); - - QMessageBox msgBox; - msgBox.setText(wnd->objectName() + QString(": width=%1,height=%2").arg(wnd->width()).arg(wnd->height())); - msgBox.exec(); } void MyPlugin::setNelContext(NLMISC::INelContext *nelContext) @@ -81,30 +59,32 @@ QString MyPlugin::vendor() const return "dnk-88"; } -QString MyPlugin::description() const +QString MyPlugin::description() const { return "Example ovqt plugin."; } - -QList MyPlugin::dependencies() const -{ - return QList(); -} - -QObject* MyPlugin::objectByName(const QString &name) const -{ + +QList MyPlugin::dependencies() const +{ + return QList(); +} + +QObject* MyPlugin::objectByName(const QString &name) const +{ Q_FOREACH (QObject *qobj, _plugMan->allObjects()) - if (qobj->objectName() == name) - return qobj; - return 0; -} - -ExtensionSystem::IPluginSpec *MyPlugin::pluginByName(const QString &name) const -{ + if (qobj->objectName() == name) + return qobj; + return 0; +} + +ExtensionSystem::IPluginSpec *MyPlugin::pluginByName(const QString &name) const +{ Q_FOREACH (ExtensionSystem::IPluginSpec *spec, _plugMan->plugins()) - if (spec->name() == name) - return spec; - return 0; -} - -Q_EXPORT_PLUGIN(MyPlugin) + if (spec->name() == name) + return spec; + return 0; +} + +} + +Q_EXPORT_PLUGIN(Plugin::MyPlugin) \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.h index cba55f5e0..8c582f96a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.h @@ -1,11 +1,17 @@ #ifndef PLUGIN1_H #define PLUGIN1_H +// Project includes #include "../../extension_system/iplugin.h" +#include "simple_viewer.h" +#include "../core/iapp_page.h" +// NeL includes #include "nel/misc/app_context.h" +// Qt includes #include +#include namespace NLMISC { @@ -17,7 +23,7 @@ namespace ExtensionSystem class IPluginSpec; } -namespace Plugin +namespace Plugin { class MyPlugin : public QObject, public ExtensionSystem::IPlugin @@ -31,26 +37,49 @@ public: void setNelContext(NLMISC::INelContext *nelContext); - QString name() const; - QString version() const; - QString vendor() const; + QString name() const; + QString version() const; + QString vendor() const; QString description() const; - QList dependencies() const; - - QObject *objectByName(const QString &name) const; + QList dependencies() const; + + QObject *objectByName(const QString &name) const; ExtensionSystem::IPluginSpec *pluginByName(const QString &name) const; -private Q_SLOTS: - void execMessageBox(); - -protected: - NLMISC::CLibraryContext *_LibContext; +protected: + NLMISC::CLibraryContext *_LibContext; private: ExtensionSystem::IPluginManager *_plugMan; }; +class CExampleAppPage: public QObject, public Core::IAppPage +{ + Q_OBJECT + Q_INTERFACES(Core::IAppPage) +public: + CExampleAppPage(QObject *parent = 0): QObject(parent) {} + virtual ~CExampleAppPage() {} + + virtual QString id() const + { + return QLatin1String("ExampleAppPage"); + } + virtual QString trName() const + { + return tr("SimpleViewer"); + } + virtual QIcon icon() const + { + return QIcon(); + } + virtual QWidget *widget() + { + return new CSimpleViewer(); + } +}; + } // namespace Plugin #endif // PLUGIN1_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/qnel_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.cpp similarity index 70% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/qnel_widget.cpp rename to code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.cpp index 36013b35f..d2db23883 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/qnel_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.cpp @@ -38,6 +38,9 @@ QNLWidget::QNLWidget(QWidget *parent) _initialized(false), _interval(25) { + setMouseTracking(true); + setFocusPolicy(Qt::StrongFocus); + init(); _mainTimer = new QTimer(this); connect(_mainTimer, SIGNAL(timeout()), this, SLOT(updateRender())); @@ -55,8 +58,7 @@ void QNLWidget::init() nlassert(_driver); // initialize the nel 3d viewport - _driver->setDisplay((nlWindow)winId(), - NL3D::UDriver::CMode(width(), height(), 32)); + _driver->setDisplay((nlWindow)winId(), NL3D::UDriver::CMode(width(), height(), 32)); // set the cache size for the font manager(in bytes) _driver->setFontManagerMaxMemory(2097152); @@ -111,39 +113,6 @@ void QNLWidget::showEvent(QShowEvent *showEvent) _mainTimer->stop(); } -#if defined(NL_OS_WINDOWS) || defined(NL_OS_MAC) -// Qt does not provide wheel events through winEvent() and macEvent() (but it -// does through x11Event(), which is inconsistent...) -// Workaround is to handle wheel events like implemented below. -// -// TODO: this is not a clean solution, because all but wheel events are -// handled using winEvent(), x11Event(), macEvent(). But this seems to be a -// limitation of current (4.7.1) Qt versions. (see e.g. qapplication_mac.mm) -void QNLWidget::wheelEvent(QWheelEvent *event) -{ - // Get relative positions. - float fX = 1.0f - (float)event->pos().x() / this->width(); - float fY = 1.0f - (float)event->pos().y() / this->height(); - - // Get the buttons currently pressed. - 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; - - if(event->delta() > 0) - _driver->EventServer.postEvent( - new NLMISC::CEventMouseWheel(-fX, fY, (NLMISC::TMouseButton)buttons, true, NULL)); - else - _driver->EventServer.postEvent( - new NLMISC::CEventMouseWheel(-fX, fY, (NLMISC::TMouseButton)buttons, false, NULL)); -} -#endif // defined(NL_OS_WINDOWS) || defined(NL_OS_MAC) - - #if defined(NL_OS_WINDOWS) typedef bool (*winProc)(NL3D::IDriver *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/qnel_widget.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.h similarity index 95% rename from code/nel/tools/3d/object_viewer_qt/src/plugins/core/qnel_widget.h rename to code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.h index a8238fa39..0473f819d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/qnel_widget.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/qnel_widget.h @@ -65,10 +65,6 @@ private Q_SLOTS: protected: virtual void showEvent(QShowEvent *showEvent); -#if defined(NL_OS_WINDOWS) || defined(NL_OS_MAC) - virtual void wheelEvent(QWheelEvent *event); -#endif - #if defined(NL_OS_WINDOWS) virtual bool winEvent(MSG *message, long *result); #elif defined(NL_OS_MAC) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.cpp new file mode 100644 index 000000000..e128710c4 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.cpp @@ -0,0 +1,54 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero 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 Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "simple_viewer.h" + +// Qt includes +#include +#include +#include + +// NeL includes + +// Project includes + +namespace Plugin +{ + +CSimpleViewer::CSimpleViewer(QWidget *parent) + : QWidget(parent) +{ + QGridLayout *gridLayout = new QGridLayout(this); + gridLayout->setObjectName(QString::fromUtf8("gridLayoutSimpleViewer")); + gridLayout->setContentsMargins(0, 0, 0, 0); + NLQT::QNLWidget *_nelWidget = new NLQT::QNLWidget(this); + gridLayout->addWidget(_nelWidget, 0, 0, 1, 1); +} + +bool CCoreListener::closeMainWindow() const +{ + int ret = QMessageBox::question(0, tr("Example close event hook"), + tr("Do you want to close window?"), + QMessageBox::Yes | QMessageBox::No); + + if (ret == QMessageBox::Yes) + return true; + else + return false; +} + +} /* namespace Plugin */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.h new file mode 100644 index 000000000..cb3c1cf87 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/simple_viewer.h @@ -0,0 +1,55 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero 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 Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + +#ifndef SIMPLE_VIEWER_H +#define SIMPLE_VIEWER_H + +// Project includes +#include "qnel_widget.h" +#include "../core/icore_listener.h" + +// Qt includes +#include + +class QWidget; + +namespace Plugin +{ + +class CSimpleViewer : public QWidget +{ + Q_OBJECT +public: + CSimpleViewer(QWidget *parent = 0); + virtual ~CSimpleViewer() {} +}; + +class CCoreListener : public QObject, public Core::ICoreListener +{ + Q_OBJECT + Q_INTERFACES(Core::ICoreListener) +public: + CCoreListener(QObject *parent = 0): QObject(parent) {} + virtual ~CCoreListener() {} + + virtual bool closeMainWindow() const; +}; + +} // namespace Plugin + +#endif // SIMPLE_VIEWER_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/CMakeLists.txt index e30b2258f..f58775bd5 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/CMakeLists.txt @@ -27,10 +27,6 @@ ADD_LIBRARY(ovqt_plugin_log MODULE ${SRC} ${OVQT_PLUG_LOG_MOC_SRC} ${OVQT_EXT_SY TARGET_LINK_LIBRARIES(ovqt_plugin_log nelmisc ${QT_LIBRARIES}) -IF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(ovqt_plugin_log ${CMAKE_THREAD_LIBS_INIT}) -ENDIF(WITH_STLPORT) - NL_DEFAULT_PROPS(ovqt_plugin_log "NeL, Tools, 3D: Object Viewer Qt Plugin: Log") NL_ADD_RUNTIME_FLAGS(ovqt_plugin_log) NL_ADD_LIB_SUFFIX(ovqt_plugin_log) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/CMakeLists.txt index 4f22eee30..aa16f4303 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/CMakeLists.txt @@ -23,10 +23,6 @@ ADD_LIBRARY(ovqt_plugin_sheet_builder MODULE ${SRC} ${OVQT_PLUG_SHEET_BUILDER_MO TARGET_LINK_LIBRARIES(ovqt_plugin_sheet_builder nelmisc ${QT_LIBRARIES}) -IF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(ovqt_plugin_sheet_builder ${CMAKE_THREAD_LIBS_INIT}) -ENDIF(WITH_STLPORT) - NL_DEFAULT_PROPS(ovqt_plugin_sheet_builder "NeL, Tools, 3D: Object Viewer Qt Plugin: Sheet builder") NL_ADD_RUNTIME_FLAGS(ovqt_plugin_sheet_builder) NL_ADD_LIB_SUFFIX(ovqt_plugin_sheet_builder) diff --git a/code/nel/tools/3d/object_viewer_qt/src/settings_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/settings_dialog.cpp index 3e35bf855..c41d59a68 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/settings_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/settings_dialog.cpp @@ -59,7 +59,7 @@ CSettingsDialog::CSettingsDialog(QWidget *parent) 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.tileBankToolButton, SIGNAL(clicked()), this, SLOT(setTileBank())); connect(ui.tileFarBankToolButton, SIGNAL(clicked()), this, SLOT(setTileFarBank())); connect(ui.vegetTexToolButton, SIGNAL(clicked()), this, SLOT(setTextureVegetable())); @@ -341,9 +341,9 @@ void CSettingsDialog::saveGraphicsSettings() QApplication::setStyle(QStyleFactory::create(ui.styleComboBox->currentText())); - if (ui.paletteCheckBox->isChecked()) - QApplication::setPalette(QApplication::style()->standardPalette()); - else + if (ui.paletteCheckBox->isChecked()) + QApplication::setPalette(QApplication::style()->standardPalette()); + else QApplication::setPalette(Modules::mainWin().getOriginalPalette()); } @@ -384,7 +384,7 @@ void CSettingsDialog::saveVegetableSettings() std::string str = ui.zonesListWidget->item(i)->text().toStdString(); list.push_back(str); } - + Modules::config().getConfigFile().getVar("VegetLandscapeZones").Type = NLMISC::CConfigFile::CVar::T_STRING; Modules::config().getConfigFile().getVar("VegetLandscapeZones").setAsString(list); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/slot_manager_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/slot_manager_dialog.cpp index ac0aaf80c..d5fc6f42b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/slot_manager_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/slot_manager_dialog.cpp @@ -33,9 +33,9 @@ namespace NLQT CSlotGroupBox::CSlotGroupBox(QWidget *parent) : QGroupBox(parent), - _animName("empty"), - _skelName("empty"), - _numSlot(0) + _animName("empty"), + _skelName("empty"), + _numSlot(0) { _ui.setupUi(this); diff --git a/code/nel/tools/3d/object_viewer_qt/src/sound_system.cpp b/code/nel/tools/3d/object_viewer_qt/src/sound_system.cpp index 1289fa342..45d07673e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/sound_system.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/sound_system.cpp @@ -34,8 +34,8 @@ namespace NLQT CSoundSystem::CSoundSystem() :_AudioMixer(NULL), - _AnimManager(NULL), - _Zero(NLMISC::CVector::Null) + _AnimManager(NULL), + _Zero(NLMISC::CVector::Null) { } diff --git a/code/nel/tools/3d/object_viewer_qt/src/spinner_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/spinner_dialog.cpp index dedfc7239..d72cd3d3e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/spinner_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/spinner_dialog.cpp @@ -25,8 +25,8 @@ namespace NLQT CSpinnerDialog::CSpinnerDialog(NL3D::CPSBasisSpinner *sf, CWorkspaceNode *ownerNode, QWidget *parent) : QDialog(parent), - _Node(ownerNode), - _BasicSpinner(sf) + _Node(ownerNode), + _BasicSpinner(sf) { nlassert(_BasicSpinner); diff --git a/code/nel/tools/3d/object_viewer_qt/src/tail_particle_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/tail_particle_widget.cpp index d08b991be..39ef9164c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/tail_particle_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/tail_particle_widget.cpp @@ -126,15 +126,15 @@ void CTailParticleWidget::setRibbonOrientation(int index) } bool CTailParticleWidget::eventFilter(QObject *object, QEvent *event) -{ - if( event->type() == QEvent::Paint ) - { +{ + if( event->type() == QEvent::Paint ) + { QPainter painter(_ui.graphicsWidget); painter.setRenderHint(QPainter::Antialiasing, true); painter.setBrush(QBrush(Qt::white)); painter.setPen(QPen(Qt::black, 2, Qt::SolidLine)); - painter.drawRoundedRect(QRect(3, 3, _ui.graphicsWidget->width() - 6, _ui.graphicsWidget->height() - 6), 3.0, 3.0); - + painter.drawRoundedRect(QRect(3, 3, _ui.graphicsWidget->width() - 6, _ui.graphicsWidget->height() - 6), 3.0, 3.0); + painter.setPen(QPen(Qt::red, 2, Qt::SolidLine)); painter.scale(0.86, 0.86); painter.translate(6, 6); @@ -167,9 +167,9 @@ bool CTailParticleWidget::eventFilter(QObject *object, QEvent *event) int((_ui.graphicsWidget->height() / 2.0) * (1 - verts[0].y)), int((_ui.graphicsWidget->width() / 2.0) * (1 + verts[verts.size() - 1].x)), int((_ui.graphicsWidget->height() / 2.0) * (1 - verts[verts.size() - 1].y))); - } - } - } + } + } + } return QWidget::eventFilter(object, event); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/tune_mrm_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/tune_mrm_dialog.cpp index 33088a064..ac58736bb 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/tune_mrm_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/tune_mrm_dialog.cpp @@ -24,7 +24,7 @@ #include // Project includes -#include "modules.h" +#include "modules.h" const int sliderStepSize = 5000; @@ -47,8 +47,8 @@ CTuneMRMDialog::~CTuneMRMDialog() } void CTuneMRMDialog::setMaxValue(int value) -{ - int actualMaxValue = value * sliderStepSize; +{ + int actualMaxValue = value * sliderStepSize; int actualValue = float(actualMaxValue) * _ui.currentValueSlider->value() / _ui.currentValueSlider->maximum(); _ui.currentValueSlider->setMaximum(actualMaxValue); diff --git a/code/nel/tools/3d/object_viewer_qt/src/tune_timer_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/tune_timer_dialog.h index e0a31db61..6f7900898 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/tune_timer_dialog.h +++ b/code/nel/tools/3d/object_viewer_qt/src/tune_timer_dialog.h @@ -38,7 +38,7 @@ class CTuneTimerDialog: public QDockWidget public: CTuneTimerDialog(QWidget *parent = 0); ~CTuneTimerDialog(); - + void setInterval(int value); Q_SIGNALS: diff --git a/code/nel/tools/3d/object_viewer_qt/src/tune_timer_form.ui b/code/nel/tools/3d/object_viewer_qt/src/tune_timer_form.ui index 852c7f58e..f2f883263 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/tune_timer_form.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/tune_timer_form.ui @@ -27,7 +27,7 @@ - 1000 + 500 Qt::Horizontal @@ -36,7 +36,7 @@ QSlider::TicksAbove - 100 + 50 diff --git a/code/nel/tools/3d/object_viewer_qt/src/value_blender_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/value_blender_dialog.h index 5afc13e59..764160916 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/value_blender_dialog.h +++ b/code/nel/tools/3d/object_viewer_qt/src/value_blender_dialog.h @@ -96,6 +96,8 @@ template class CValueBlenderDialogClientT : public IValueBlenderDialogClient { public: + virtual ~CValueBlenderDialogClientT() {} + // the scheme being used. Must be set by the user NL3D::CPSValueBlendFuncBase *SchemeFunc; @@ -143,6 +145,8 @@ protected: class CFloatBlenderDialogClient : public CValueBlenderDialogClientT { public: + ~CFloatBlenderDialogClient() {} + QWidget *newDialog(IPSWrapper *wrapper, QWidget *parent) { CEditRangeFloatWidget *erf = new CEditRangeFloatWidget(parent); @@ -158,6 +162,8 @@ public: class CUIntBlenderDialogClient : public CValueBlenderDialogClientT { public: + ~CUIntBlenderDialogClient() {} + QWidget *newDialog(IPSWrapper *wrapper, QWidget *parent) { CEditRangeUIntWidget *erf = new CEditRangeUIntWidget(parent); @@ -173,6 +179,8 @@ public: class CIntBlenderDialogClient : public CValueBlenderDialogClientT { public: + ~CIntBlenderDialogClient() {} + QWidget *newDialog(IPSWrapper *wrapper, QWidget *parent) { CEditRangeIntWidget *erf = new CEditRangeIntWidget(parent); @@ -188,6 +196,8 @@ public: class CRGBABlenderDialogClient : public CValueBlenderDialogClientT { public: + ~CRGBABlenderDialogClient() {} + QWidget *newDialog(IPSWrapper *wrapper, QWidget *parent) { CColorEditWidget *ce = new CColorEditWidget(parent); diff --git a/code/nel/tools/3d/object_viewer_qt/src/value_gradient_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/value_gradient_dialog.h index 4970d8da2..bb28ac634 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/value_gradient_dialog.h +++ b/code/nel/tools/3d/object_viewer_qt/src/value_gradient_dialog.h @@ -59,6 +59,7 @@ class IValueGradientClient: public QObject Q_OBJECT public: IValueGradientClient(QObject *parent = 0): QObject(parent) {} + virtual ~IValueGradientClient() {} virtual QWidget *createDialog(QWidget *parent) = 0; @@ -168,6 +169,7 @@ class CValueGradientClientT : public IValueGradientClient, public IPSWrapper { public: CValueGradientClientT(QObject *parent = 0): IValueGradientClient(parent) {} + virtual ~CValueGradientClientT() {} /// the gradient being edited, must be filled by the instancier NL3D::CPSValueGradientFunc *Scheme; @@ -268,6 +270,7 @@ class CFloatGradientWrapper : public CValueGradientClientT Q_OBJECT public: CFloatGradientWrapper(QObject *parent = 0): CValueGradientClientT(parent) {} + ~CFloatGradientWrapper() {} virtual QWidget *newDialog(IPSWrapperFloat *wrapper, QWidget *parent) { @@ -304,6 +307,7 @@ class CUIntGradientWrapper : public CValueGradientClientT Q_OBJECT public: CUIntGradientWrapper(QObject *parent = 0): CValueGradientClientT(parent) {} + ~CUIntGradientWrapper() {} virtual QWidget *newDialog(IPSWrapperUInt *wrapper, QWidget *parent) { @@ -340,6 +344,7 @@ class CIntGradientWrapper : public CValueGradientClientT Q_OBJECT public: CIntGradientWrapper(QObject *parent = 0): CValueGradientClientT(parent) {} + ~CIntGradientWrapper() {} virtual QWidget *newDialog(IPSWrapper *wrapper, QWidget *parent) { @@ -376,6 +381,7 @@ class CColorGradientWrapper : public CValueGradientClientT Q_OBJECT public: CColorGradientWrapper(QObject *parent = 0): CValueGradientClientT(parent) {} + ~CColorGradientWrapper() {} virtual QWidget *newDialog(IPSWrapper *wrapper, QWidget *parent) { @@ -418,6 +424,7 @@ class CPlaneBasisGradientWrapper : public CValueGradientClientT(parent) {} + ~CPlaneBasisGradientWrapper() {} virtual QWidget *newDialog(IPSWrapper *wrapper, QWidget *parent) { @@ -455,6 +462,8 @@ public: CTextureGradientInterface(NL3D::CPSTexturedParticle *tp, CWorkspaceNode *ownerNode): Node(ownerNode), TP(tp) {} + ~CTextureGradientInterface() {} + CWorkspaceNode *Node; NL3D::CPSTexturedParticle *TP; diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_editor.cpp b/code/nel/tools/3d/object_viewer_qt/src/vegetable_editor.cpp index 6cddfd90d..492bc101b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_editor.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_editor.cpp @@ -315,30 +315,30 @@ void CVegetableEditor::setVegetableWindPower(float w) { _VegetableWindPower= w; if(_VegetableLandscape) - _VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir, - _VegetableWindFreq, - _VegetableWindPower, - _VegetableWindBendMin); + _VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir, + _VegetableWindFreq, + _VegetableWindPower, + _VegetableWindBendMin); } void CVegetableEditor::setVegetableWindBendStart(float w) { _VegetableWindBendMin= w; if(_VegetableLandscape) - _VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir, - _VegetableWindFreq, - _VegetableWindPower, - _VegetableWindBendMin); + _VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir, + _VegetableWindFreq, + _VegetableWindPower, + _VegetableWindBendMin); } void CVegetableEditor::setVegetableWindFrequency(float w) { _VegetableWindFreq= w; if(_VegetableLandscape) - _VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir, - _VegetableWindFreq, - _VegetableWindPower, - _VegetableWindBendMin); + _VegetableLandscape->Landscape.setVegetableWind(_VegetableWindDir, + _VegetableWindFreq, + _VegetableWindPower, + _VegetableWindBendMin); } void CVegetableEditor::snapToGroundVegetableLandscape(bool enable) diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.cpp index 20bad2067..3a605a5bb 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.cpp @@ -29,8 +29,8 @@ namespace NLQT { CVegetNoiseValueWidget::CVegetNoiseValueWidget(QWidget *parent) - : QGroupBox(parent), - _emit(true) + : QGroupBox(parent), + _emit(true) { _ui.setupUi(this); diff --git a/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.h b/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.h index 87467e775..752c9afb9 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.h +++ b/code/nel/tools/3d/object_viewer_qt/src/vegetable_noise_value_widget.h @@ -43,7 +43,7 @@ public: void setDefaultRangeAbs(float defRangeMin, float defRangeMax); void setDefaultRangeRand(float defRangeMin, float defRangeMax); void setDefaultRangeFreq(float defRangeMin, float defRangeMax); - + Q_SIGNALS: void noiseValueChanged(const NLMISC::CNoiseValue &value); diff --git a/code/nel/tools/3d/object_viewer_widget/src/CMakeLists.txt b/code/nel/tools/3d/object_viewer_widget/src/CMakeLists.txt index 645c2f4cb..160aca337 100644 --- a/code/nel/tools/3d/object_viewer_widget/src/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_widget/src/CMakeLists.txt @@ -27,10 +27,6 @@ TARGET_LINK_LIBRARIES(object_viewer_widget_qt ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY}) -IF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(object_viewer_widget_qt ${CMAKE_THREAD_LIBS_INIT}) -ENDIF(WITH_STLPORT) - ADD_DEFINITIONS(-DQT_NO_KEYWORDS ${LIBXML2_DEFINITIONS} ${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_SHARED) diff --git a/code/ryzom/common/src/game_share/CMakeLists.txt b/code/ryzom/common/src/game_share/CMakeLists.txt index f901a2a7a..7883ce03d 100644 --- a/code/ryzom/common/src/game_share/CMakeLists.txt +++ b/code/ryzom/common/src/game_share/CMakeLists.txt @@ -11,10 +11,6 @@ NL_TARGET_LIB(ryzom_gameshare ${PRIV_H} ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${NEL_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) -IF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(ryzom_gameshare ${CMAKE_THREAD_LIBS_INIT}) -ENDIF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(ryzom_gameshare nelmisc nelnet nelligo nelgeorges ${LIBXML2_LIBRARIES} ${ZLIB_LIBRARIES}) NL_DEFAULT_PROPS(ryzom_gameshare "Ryzom, Library: Game Share") NL_ADD_RUNTIME_FLAGS(ryzom_gameshare) diff --git a/code/ryzom/server/src/admin_modules/CMakeLists.txt b/code/ryzom/server/src/admin_modules/CMakeLists.txt index 12a777c87..7eb6af309 100644 --- a/code/ryzom/server/src/admin_modules/CMakeLists.txt +++ b/code/ryzom/server/src/admin_modules/CMakeLists.txt @@ -4,10 +4,6 @@ NL_TARGET_LIB(ryzom_adminmodules ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) -IF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(ryzom_adminmodules ${CMAKE_THREAD_LIBS_INIT}) -ENDIF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(ryzom_adminmodules nelmisc nelnet) NL_DEFAULT_PROPS(ryzom_adminmodules "Ryzom, Library: Service Admin Modules") NL_ADD_RUNTIME_FLAGS(ryzom_adminmodules) diff --git a/code/ryzom/server/src/gameplay_module_lib/CMakeLists.txt b/code/ryzom/server/src/gameplay_module_lib/CMakeLists.txt index 62aa184ef..48b9ed299 100644 --- a/code/ryzom/server/src/gameplay_module_lib/CMakeLists.txt +++ b/code/ryzom/server/src/gameplay_module_lib/CMakeLists.txt @@ -4,10 +4,6 @@ NL_TARGET_LIB(ryzom_gameplaymodule ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -IF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(ryzom_gameplaymodule ${CMAKE_THREAD_LIBS_INIT}) -ENDIF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(ryzom_gameplaymodule nelmisc) NL_DEFAULT_PROPS(ryzom_gameplaymodule "Ryzom, Library: Gameplay Module") NL_ADD_RUNTIME_FLAGS(ryzom_gameplaymodule) diff --git a/code/ryzom/tools/leveldesign/export/CMakeLists.txt b/code/ryzom/tools/leveldesign/export/CMakeLists.txt index ee2126b3a..d8125d882 100644 --- a/code/ryzom/tools/leveldesign/export/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/export/CMakeLists.txt @@ -5,10 +5,6 @@ NL_TARGET_LIB(ryzom_export ${PRIV_H} ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -IF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(ryzom_export ${CMAKE_THREAD_LIBS_INIT}) -ENDIF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(ryzom_export nelmisc nelligo nelgeorges nel3d nelpacs ${LIBXML2_LIBRARIES} ${ZLIB_LIBRARIES}) NL_DEFAULT_PROPS(ryzom_export "Ryzom, Library, World: Export Tools") NL_ADD_RUNTIME_FLAGS(ryzom_export) diff --git a/code/ryzom/tools/leveldesign/world_editor/land_export_lib/CMakeLists.txt b/code/ryzom/tools/leveldesign/world_editor/land_export_lib/CMakeLists.txt index e5ab7c6f0..ab6386118 100644 --- a/code/ryzom/tools/leveldesign/world_editor/land_export_lib/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/world_editor/land_export_lib/CMakeLists.txt @@ -5,10 +5,6 @@ NL_TARGET_LIB(ryzom_landexport ${PRIV_H} ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -IF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(ryzom_landexport ${CMAKE_THREAD_LIBS_INIT}) -ENDIF(WITH_STLPORT) - TARGET_LINK_LIBRARIES(ryzom_landexport ryzom_export nelmisc nelligo nelgeorges nel3d nelpacs ${LIBXML2_LIBRARIES} ${ZLIB_LIBRARIES}) NL_DEFAULT_PROPS(ryzom_landexport "Ryzom, Library, World: Land Export") NL_ADD_RUNTIME_FLAGS(ryzom_landexport)