├── .gitignore ├── .travis.yml ├── CMakeLists.txt ├── CMakeModules ├── .gitignore ├── FindFFmpeg.cmake ├── FindGammaray.cmake ├── FindLog4cplus.cmake ├── FindOSG.cmake ├── FindOsgEarth.cmake ├── FindOsgQt.cmake ├── FindosgAnimation.cmake ├── SGIConfigureShaders.cmake.in ├── SGIFastMacros.cmake ├── SGIFunctions.cmake └── SGIMacros.cmake.in ├── Export.in ├── LICENSE.txt ├── README.md ├── SGIHostSupport.in ├── applications ├── CMakeLists.txt ├── glimageview │ ├── CMakeLists.txt │ ├── MainWindow.cpp │ ├── MainWindow.h │ └── MainWindow.ui ├── helloWorldQt │ ├── CMakeLists.txt │ ├── MainWindow.cpp │ ├── MainWindow.h │ └── MainWindow.ui ├── osgviewer │ ├── CMakeLists.txt │ └── osgviewer.cpp ├── viewer_base │ ├── CMakeLists.txt │ ├── sgi_viewer_base.cpp │ └── sgi_viewer_base.h └── viewerqt │ ├── CMakeLists.txt │ ├── GraphicsWindowQt5.cpp │ ├── GraphicsWindowQt5.hxx │ ├── osgviewerQt.cpp │ └── osgviewerQt.h ├── gammaray ├── CMakeLists.txt ├── common │ ├── CMakeLists.txt │ ├── deferredtreeview.cpp │ ├── deferredtreeview.h │ ├── deferredtreeview_p.h │ ├── searchlinecontroller.cpp │ └── searchlinecontroller.h ├── launcher │ ├── CMakeLists.txt │ └── main.cpp └── log4cplus │ ├── CMakeLists.txt │ ├── gammaray_log4cplus.json │ ├── log4cplus_model.cpp │ ├── log4cplus_model.h │ ├── log4cplus_plugin.cpp │ ├── log4cplus_plugin.h │ ├── log4cplus_widget.cpp │ ├── log4cplus_widget.h │ └── log4cplus_widget.ui ├── img ├── microscope64.c └── microscope64.png ├── include └── sgi │ ├── .gitignore │ ├── AutoLoadOsg │ ├── AutoLoadQt │ ├── ContextMenu │ ├── ContextMenuQt │ ├── GenerateItem │ ├── ImagePreviewDialog │ ├── LibraryInfo │ ├── ObjectInfo │ ├── ObjectLoggerDialog │ ├── ParentWidget │ ├── ReferencedPicker │ ├── SGIItemInternal │ ├── SceneGraphDialog │ ├── Shutdown │ ├── WritePrettyHTML │ ├── details │ ├── Object │ ├── Observer │ ├── Referenced │ ├── UserDataContainer │ ├── call_function_for_object_type │ ├── caster │ ├── functionImplBase │ ├── object_type_info │ ├── observer_ptr │ ├── output │ ├── ref_ptr │ ├── static_type_name │ └── type_list │ ├── helpers │ ├── html │ ├── meta.hpp │ ├── meta_fwd.hpp │ ├── osg │ ├── osg_drawable_helpers │ ├── osg_helper_nodes │ ├── osg_statistics │ ├── preprocessor │ ├── qt │ ├── qt_widgets │ ├── rtti │ ├── singleton │ └── string │ └── plugins │ ├── .gitignore │ ├── ActionHandlerImpl │ ├── ContextMenu │ ├── ContextMenuImpl │ ├── ContextMenuQt │ ├── ConvertToImageImpl │ ├── GenerateItemImpl │ ├── GetObjectInfoImpl │ ├── GuiAdapterImpl │ ├── HostCallback │ ├── ImagePreviewDialog │ ├── Matrix │ ├── ObjectLoggerBase │ ├── ObjectLoggerDialog │ ├── ObjectLoggerImpl │ ├── ObjectTree │ ├── ObjectTreeImpl │ ├── Quat │ ├── SGIDataItemBase.h │ ├── SGIHostItemBase.h │ ├── SGIHostItemFallback.h │ ├── SGIHostItemGenerator │ ├── SGIHostItemInternal.h │ ├── SGIHostItemLog4cplus.h │ ├── SGIHostItemOsg.h │ ├── SGIHostItemOsgEarth.h │ ├── SGIHostItemQt.h │ ├── SGIImage.h │ ├── SGIItemBase.h │ ├── SGIItemInfo │ ├── SGIPluginImpl.h │ ├── SGIPluginInterface.h │ ├── SGIProxyItem.h │ ├── SGISettingsDialogImpl │ ├── SGISettingsWindowImpl │ ├── SGIShaderLoader │ ├── SceneGraphDialog │ ├── SettingsDialog │ ├── SettingsDialogImpl │ ├── Vector │ ├── WritePrettyHTMLImpl │ ├── fallback_support.h │ ├── log4cplus_support.h │ ├── osg_support.h │ ├── osgearth_support.h │ └── qt_support.h ├── plugins ├── CMakeLists.txt ├── log4cplus │ ├── CMakeLists.txt │ ├── ContextMenuLog4cplus.cpp │ ├── ContextMenuLog4cplus.h │ ├── MenuActionLog4cplus.cpp │ ├── MenuActionLog4cplus.h │ ├── ObjectTreeLog4cplus.cpp │ ├── ObjectTreeLog4cplus.h │ ├── SGIItemLog4cplus │ ├── getObjectInfoLog4cplus.cpp │ ├── getObjectInfoLog4cplus.h │ ├── sgi_log4cplus_plugin.cpp │ ├── stdafx.cpp │ ├── stdafx.h │ ├── writeHTMLLog4cplus.cpp │ └── writeHTMLLog4cplus.h ├── osg │ ├── CMakeLists.txt │ ├── CameraSettings.cpp │ ├── CameraSettings.h │ ├── CameraSettings.ui │ ├── ContextMenuOSG.cpp │ ├── ContextMenuOSG.h │ ├── ExtraViewDialog.cpp │ ├── ExtraViewDialog.h │ ├── ExtraViewDialog.ui │ ├── GUIAdapterOSG.cpp │ ├── GUIAdapterOSG.h │ ├── MenuActionOSG.cpp │ ├── MenuActionOSG.h │ ├── NodeHelper.cpp │ ├── NodeHelper.h │ ├── ObjectLoggerOSG.cpp │ ├── ObjectLoggerOSG.h │ ├── ObjectTreeOSG.cpp │ ├── ObjectTreeOSG.h │ ├── SGIItemOsg │ ├── SettingsDialogOSG.cpp │ ├── SettingsDialogOSG.h │ ├── getObjectInfoOSG.cpp │ ├── getObjectInfoOSG.h │ ├── osg_accessor.cpp │ ├── osg_accessor.h │ ├── osganimation_accessor.h │ ├── osgdb_accessor.h │ ├── osgtext_accessor.h │ ├── osgviewer_accessor.h │ ├── sgi_osg_plugin.cpp │ ├── stateset_helpers.cpp │ ├── stateset_helpers.h │ ├── std_ostream_osgtext.cpp │ ├── std_ostream_osgtext.h │ ├── stdafx.cpp │ ├── stdafx.h │ ├── writeHTMLOSG.cpp │ ├── writeHTMLOSG.h │ ├── writeHTMLOSGAnimation.cpp │ ├── writeHTMLOSGCullingInfo.cpp │ ├── writeHTMLOSGDB.cpp │ ├── writeHTMLOSGFX.cpp │ ├── writeHTMLOSGGA.cpp │ ├── writeHTMLOSGTerrain.cpp │ ├── writeHTMLOSGText.cpp │ ├── writeHTMLOSGUtil.cpp │ └── writeHTMLOSGViewer.cpp ├── osgearth │ ├── AutoClipPlaneCullCallbackDialog.cpp │ ├── AutoClipPlaneCullCallbackDialog.h │ ├── AutoClipPlaneCullCallbackDialog.ui │ ├── CMakeLists.txt │ ├── ContextMenuOSGEarth.cpp │ ├── ContextMenuOSGEarth.h │ ├── GUIAdapterOSGEarth.cpp │ ├── GUIAdapterOSGEarth.h │ ├── LODScaleOverrideDialog.cpp │ ├── LODScaleOverrideDialog.h │ ├── LODScaleOverrideDialog.ui │ ├── LightSettings.cpp │ ├── LightSettings.h │ ├── LightSettings.ui │ ├── MenuActionOSGEarth.cpp │ ├── MenuActionOSGEarth.h │ ├── ObjectTreeOSGEarth.cpp │ ├── ObjectTreeOSGEarth.h │ ├── ProxySettingsDialog.cpp │ ├── ProxySettingsDialog.h │ ├── ProxySettingsDialog.ui │ ├── RetrieveElevationDialog.cpp │ ├── RetrieveElevationDialog.h │ ├── RetrieveElevationDialog.ui │ ├── SGIItemOsgEarth │ ├── SettingsDialogOSGEarth.cpp │ ├── SettingsDialogOSGEarth.h │ ├── ShaderEditorDialog.cpp │ ├── ShaderEditorDialog.h │ ├── ShaderEditorDialog.ui │ ├── ShaderFunctionDetails.cpp │ ├── ShaderFunctionDetails.h │ ├── ShaderFunctionDetails.ui │ ├── TileInspectorDialog.cpp │ ├── TileInspectorDialog.h │ ├── TileInspectorDialog.ui │ ├── geo_helpers.cpp │ ├── geo_helpers.h │ ├── getObjectInfoOSGEarth.cpp │ ├── getObjectInfoOSGEarth.h │ ├── osgearth_accessor.cpp │ ├── osgearth_accessor.h │ ├── sgi_osgearth_plugin.cpp │ ├── stdafx.cpp │ ├── stdafx.h │ ├── string_helpers.cpp │ ├── string_helpers.h │ ├── writeHTMLOSGEarth.cpp │ ├── writeHTMLOSGEarth.h │ ├── writeHTMLOSGEarthConfig.cpp │ └── writeHTMLOSGEarthConfig.h ├── qt │ ├── CMakeLists.txt │ ├── ContextMenuQt.cpp │ ├── ContextMenuQt.h │ ├── MenuActionQt.cpp │ ├── MenuActionQt.h │ ├── ObjectTreeQt.cpp │ ├── ObjectTreeQt.h │ ├── SGIItemQt │ ├── SettingsDialogQt.cpp │ ├── SettingsDialogQt.h │ ├── getObjectInfoQt.cpp │ ├── getObjectInfoQt.h │ ├── sgi_qt_plugin.cpp │ ├── stdafx.cpp │ ├── stdafx.h │ ├── writeHTMLQt.cpp │ ├── writeHTMLQt.h │ ├── writeHTMLQtMeta.cpp │ ├── writeHTMLQtPaintDevice.cpp │ └── writeHTMLQtQPA.cpp └── qtquick │ ├── CMakeLists.txt │ ├── ContextMenuQtQuick.cpp │ ├── ContextMenuQtQuick.h │ ├── MenuActionQtQuick.cpp │ ├── MenuActionQtQuick.h │ ├── ObjectTreeQtQuick.cpp │ ├── ObjectTreeQtQuick.h │ ├── SGIItemQtQuick │ ├── SettingsDialogQtQuick.cpp │ ├── SettingsDialogQtQuick.h │ ├── getObjectInfoQtQuick.cpp │ ├── getObjectInfoQtQuick.h │ ├── sgi_qtquick_plugin.cpp │ ├── stdafx.cpp │ ├── stdafx.h │ ├── writeHTMLQtQuick.cpp │ └── writeHTMLQtQuick.h ├── src ├── CMakeLists.txt ├── plugin_impl │ ├── CMakeLists.txt │ ├── ObjectTreeImpl.cpp │ ├── ObjectTreeImplProxy.cpp │ ├── ObjectTreeImplProxy.h │ ├── ObjectTreeImplProxy_p.h │ ├── ReferencePicker.cpp │ ├── SGIDataItemBase.cpp │ ├── SGIImage.cpp │ ├── SGIImageOsg.cpp │ ├── SGIImageQt.cpp │ ├── SGIItemBase.cpp │ ├── SGIShaderLoader.cpp │ ├── SGIShaderLoaderQt.cpp │ ├── functionImplBase.cpp │ ├── osg_drawable_helpers.cpp │ ├── osg_helpers.cpp │ ├── osg_node_helpers.cpp │ ├── osg_statistics.cpp │ ├── osg_viewer.cpp │ ├── qimage_osg.cpp │ ├── qt_dds_reader.cpp │ ├── qt_dds_reader.h │ ├── qt_helpers.cpp │ ├── string_helpers.cpp │ ├── widget_helpers.cpp │ └── widget_helpers.h ├── qt │ ├── CMakeLists.txt │ ├── main.cpp │ ├── main.h │ ├── qt.conf.in │ ├── sgi_loader.json │ └── sgi_logo.qrc ├── ref │ ├── CMakeLists.txt │ ├── Object.cpp │ ├── Observer.cpp │ ├── Referenced.cpp │ ├── UserDataContainer.cpp │ ├── stdafx.cpp │ └── stdafx.h ├── rw │ ├── CMakeLists.txt │ └── ReaderWriteSGI.cpp └── sgi │ ├── AboutDialog.cpp │ ├── AboutDialog.h │ ├── AboutDialog.ui │ ├── CMakeLists.txt │ ├── ContextMenu.cpp │ ├── ContextMenu.h │ ├── DoubleInputDialog.cpp │ ├── DoubleInputDialog.h │ ├── DoubleInputDialog.ui │ ├── ImageGLWidget.cpp │ ├── ImageGLWidget.frag.glsl │ ├── ImageGLWidget.h │ ├── ImageGLWidget.vert.glsl │ ├── ImagePreviewDialog.cpp │ ├── ImagePreviewDialog.h │ ├── ImagePreviewDialog.ui │ ├── ImageQtWidget.cpp │ ├── ImageQtWidget.h │ ├── ImageScrollArea.cpp │ ├── ImageScrollArea.h │ ├── MatrixInputDialog.cpp │ ├── MatrixInputDialog.h │ ├── MatrixInputDialog.ui │ ├── ObjectLoggerDialog.cpp │ ├── ObjectLoggerDialog.h │ ├── ObjectLoggerDialog.ui │ ├── QTextDialog.cpp │ ├── QTextDialog.h │ ├── QTextDialog.ui │ ├── QtProxy.cpp │ ├── QtProxy.h │ ├── QuatInputDialog.cpp │ ├── QuatInputDialog.h │ ├── QuatInputDialog.ui │ ├── SGIPlugin.cpp │ ├── SGIPlugin.h │ ├── SceneGraphDialog.cpp │ ├── SceneGraphDialog.h │ ├── SceneGraphDialogTools.cpp │ ├── Shaders │ ├── Shaders.cpp.in │ ├── colorconversion.cpp │ ├── colorconversion.h │ ├── dds.h │ ├── dxt.cpp │ ├── dxt.h │ ├── dxt_endian.h │ ├── dxt_imath.h │ ├── dxt_tables.h │ ├── entrypoint.cpp │ ├── entrypoint.h │ ├── sgi_internal.cpp │ ├── sgi_internal.h │ ├── stdafx.cpp │ ├── stdafx.h │ ├── swscale.cpp │ └── swscale.h └── tests ├── CMakeLists.txt ├── Reflect.h ├── item_osg_unittest.cpp ├── item_osg_unittest.h ├── item_osgearth_unittest.cpp ├── item_osgearth_unittest.h ├── item_qt_unittest.cpp ├── item_qt_unittest.h ├── item_unittest.cpp ├── item_unittest.h ├── itemtree_unittest.cpp ├── itemtree_unittest.h ├── props_unittest.cpp ├── props_unittest.h ├── variadic_unittest.cpp └── variadic_unittest.h /.gitignore: -------------------------------------------------------------------------------- 1 | /build/ 2 | /.kdev4/ 3 | /*.kdev4 4 | /configure-*.bat 5 | /build-* 6 | /CMakeLists.txt.user 7 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | os: linux 2 | dist: artful 3 | sudo: required 4 | language: cpp 5 | compiler: 6 | - gcc 7 | before_install: 8 | - sudo apt-get update -qq 9 | - sudo apt-get install -y cmake 10 | - sudo apt-get install -y libosgearth-dev 11 | # Debug print out osgversion 12 | - osgversion 13 | - osgearth_version 14 | script: 15 | - if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then cmake -DCMAKE_BUILD_TYPE=Release . && make -j3 && sudo make install && sudo ldconfig; fi 16 | -------------------------------------------------------------------------------- /CMakeModules/.gitignore: -------------------------------------------------------------------------------- 1 | /SGIMacros.cmake 2 | -------------------------------------------------------------------------------- /CMakeModules/FindFFmpeg.cmake: -------------------------------------------------------------------------------- 1 | 2 | FIND_PATH(FFMPEG_INCLUDE_DIR NAMES libavcodec/avcodec.h) 3 | FIND_LIBRARY(FFMPEG_LIBAVFORMAT_LIBRARY NAMES avformat-58 avformat-57 avformat) 4 | FIND_LIBRARY(FFMPEG_LIBAVDEVICE_LIBRARY NAMES avdevice-58 avdevice-57 avdevice) 5 | FIND_LIBRARY(FFMPEG_LIBAVCODEC_LIBRARY NAMES avcodec-58 avcodec-57 avcodec) 6 | FIND_LIBRARY(FFMPEG_LIBAVUTIL_LIBRARY NAMES avutil-56 avutil-55 avutil) 7 | FIND_LIBRARY(FFMPEG_LIBSWSCALE_LIBRARY NAMES swscale-4 swscale) 8 | 9 | include(FindPackageHandleStandardArgs) 10 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(FFmpeg 11 | REQUIRED_VARS 12 | FFMPEG_INCLUDE_DIR 13 | FFMPEG_LIBAVFORMAT_LIBRARY 14 | FFMPEG_LIBAVDEVICE_LIBRARY 15 | FFMPEG_LIBAVCODEC_LIBRARY 16 | FFMPEG_LIBAVUTIL_LIBRARY 17 | FFMPEG_LIBSWSCALE_LIBRARY 18 | ) 19 | -------------------------------------------------------------------------------- /CMakeModules/FindLog4cplus.cmake: -------------------------------------------------------------------------------- 1 | FIND_PATH( LOG4CPLUS_INCLUDE_DIR 2 | NAMES 3 | log4cplus/logger.h 4 | ) 5 | 6 | FIND_LIBRARY(LOG4CPLUS_LIBRARY 7 | NAMES 8 | log4cplus 9 | PATH_SUFFIXES 10 | /lib/ 11 | /lib64/ 12 | /build/lib/ 13 | /build/lib64/ 14 | /Build/lib/ 15 | /Build/lib64/ 16 | ) 17 | 18 | 19 | include(FindPackageHandleStandardArgs) 20 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(Log4cplus 21 | REQUIRED_VARS LOG4CPLUS_INCLUDE_DIR LOG4CPLUS_LIBRARY 22 | ) 23 | -------------------------------------------------------------------------------- /CMakeModules/FindosgAnimation.cmake: -------------------------------------------------------------------------------- 1 | # Distributed under the OSI-approved BSD 3-Clause License. See accompanying 2 | # file Copyright.txt or https://cmake.org/licensing for details. 3 | 4 | #.rst: 5 | # FindosgAnimation 6 | # --------- 7 | # 8 | # 9 | # 10 | # This is part of the Findosg* suite used to find OpenSceneGraph 11 | # components. Each component is separate and you must opt in to each 12 | # module. You must also opt into OpenGL and OpenThreads (and Producer 13 | # if needed) as these modules won't do it for you. This is to allow you 14 | # control over your own system piece by piece in case you need to opt 15 | # out of certain components or change the Find behavior for a particular 16 | # module (perhaps because the default FindOpenGL.cmake module doesn't 17 | # work with your system as an example). If you want to use a more 18 | # convenient module that includes everything, use the 19 | # FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules. 20 | # 21 | # Locate osgQt This module defines 22 | # 23 | # OSGANIMATION_FOUND - Was osgQt found? OSGANIMATION_INCLUDE_DIR - Where to find the 24 | # headers OSGANIMATION_LIBRARIES - The libraries to link for osgQt (use this) 25 | # 26 | # OSGANIMATION_LIBRARY - The osgQt library OSGANIMATION_LIBRARY_DEBUG - The osgQt 27 | # debug library 28 | # 29 | # $OSGDIR is an environment variable that would correspond to the 30 | # ./configure --prefix=$OSGDIR used in building osg. 31 | # 32 | # Created by Eric Wing. Modified to work with osgQt by Robert Osfield, 33 | # January 2012. 34 | 35 | # Header files are presumed to be included like 36 | # #include 37 | # #include 38 | 39 | message("ddd") 40 | 41 | include(Findosg_functions) 42 | OSG_FIND_PATH (OSGANIMATION osgAnimation/AnimationManagerBase) 43 | OSG_FIND_LIBRARY(OSGANIMATION osgAnimation) 44 | 45 | include(FindPackageHandleStandardArgs) 46 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(osgAnimation DEFAULT_MSG 47 | OSGANIMATION_LIBRARY OSGANIMATION_INCLUDE_DIR) 48 | 49 | -------------------------------------------------------------------------------- /CMakeModules/SGIConfigureShaders.cmake.in: -------------------------------------------------------------------------------- 1 | # configureshaders.cmake.in 2 | 3 | set(source_dir "@CMAKE_CURRENT_SOURCE_DIR@") 4 | set(bin_dir "@CMAKE_CURRENT_BINARY_DIR@") 5 | set(glsl_files "@GLSL_FILES@") 6 | set(template_file "@TEMPLATE_FILE@") 7 | set(output_cpp_file "@OUTPUT_CPP_FILE@") 8 | 9 | # modify the contents for inlining; replace input with output (var: file) 10 | # i.e., the file name (in the form @my_file_name@) gets replaced with the 11 | # actual contents of the named file and then processed a bit. 12 | foreach(file ${glsl_files}) 13 | 14 | # read the file into 'contents': 15 | file(READ ${source_dir}/${file} contents) 16 | 17 | # append a newline so we do not break the MULTILINE macro when the last line 18 | # of the file is a comment: 19 | set(contents "${contents}\n") 20 | 21 | # replace hashtags with a marker string to avoid breaking the MULTILINE macro: 22 | # string(REGEX REPLACE "#" "$__HASHTAG__" tempString "${contents}") 23 | 24 | # replace comment symbols to avoid breaking the MULTILINE macro: 25 | # string(REGEX REPLACE "//" "$__BEGINEOLCOMMENT__" tempString2 "${tempString}") 26 | # string(REGEX REPLACE "/\\*" "$__BEGINBLOCKCOMMENT__" tempString "${tempString2}") 27 | # string(REGEX REPLACE "\\*/" "$__ENDBLOCKCOMMENT__" tempString2 "${tempString}") 28 | # string(REGEX REPLACE "'" "$__APOSTROPHE__" tempString "${tempString2}") 29 | # string(REGEX REPLACE "\"" "$__QUOTE__" tempString2 "${tempString}") 30 | 31 | # replace newlines with printable newlines, and overwrite the original 32 | # file name with the processed contents. 33 | # string(REGEX REPLACE "\n" "\\\\n\n" ${file} "${tempString2}") 34 | 35 | string(REGEX REPLACE "\n" "%EOL%" tempString "${contents}" ) 36 | string(REGEX REPLACE "\"" "%QUOTE%" ${file} "${tempString}" ) 37 | 38 | endforeach(file) 39 | 40 | # send the processed glsl_files to the next template to create the 41 | # shader source file. 42 | configure_file( 43 | ${source_dir}/${template_file} 44 | ${output_cpp_file} 45 | @ONLY ) 46 | -------------------------------------------------------------------------------- /CMakeModules/SGIFunctions.cmake: -------------------------------------------------------------------------------- 1 | FUNCTION(TO_LIST_NEWLINES _LIST_NAME OUTPUT_VAR) 2 | set(NEW_LIST_NEWLINES) 3 | foreach(ITEM ${${_LIST_NAME}}) 4 | set(NEW_LIST_NEWLINES "${NEW_LIST_NEWLINES}\n${ITEM}") 5 | endforeach() 6 | set(${OUTPUT_VAR} "${NEW_LIST_NEWLINES}" PARENT_SCOPE) 7 | ENDFUNCTION() 8 | 9 | FUNCTION(TO_LIST_COMMA _LIST_NAME OUTPUT_VAR) 10 | set(NEW_LIST_SPACE) 11 | foreach(ITEM ${${_LIST_NAME}}) 12 | if(NEW_LIST_SPACE) 13 | set(NEW_LIST_SPACE "${NEW_LIST_SPACE}, ${ITEM}") 14 | else() 15 | set(NEW_LIST_SPACE "${ITEM}") 16 | endif() 17 | endforeach() 18 | string(STRIP ${NEW_LIST_SPACE} NEW_LIST_SPACE) 19 | set(${OUTPUT_VAR} "${NEW_LIST_SPACE}" PARENT_SCOPE) 20 | ENDFUNCTION() 21 | 22 | MACRO(SGI_PLUGIN_HOST_SUPPORT name) 23 | string(TOUPPER ${name} _var_name) 24 | IF(SGI_PLUGIN_${_var_name}) 25 | string(TOLOWER ${name} _support_name) 26 | LIST(APPEND SGI_PLUGIN_HOST_SUPPORT_INCLUDES "#include \"${_support_name}_support.h\"") 27 | LIST(APPEND SGI_PLUGIN_HOST_SUPPORT_ITEM_CLASSES ${ARGN}) 28 | ENDIF() 29 | ENDMACRO(SGI_PLUGIN_HOST_SUPPORT) 30 | 31 | FUNCTION(SGI_CREATE_SYMLINK src_file dest_file) 32 | if(UNIX) 33 | execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CURRENT_SOURCE_DIR}/${src_file} ${dest_file}) 34 | else() 35 | # Generate a "wrapper" header file to simulate a symlink for this poor OS (win32). But this does 36 | # not work when the "wrapper" header file is installed as public header file. Therefore we use 37 | # cmake copy to avoid this issue. 38 | #file(WRITE ${dest_file} "#include \"${CMAKE_CURRENT_SOURCE_DIR}/${src_file}\"\n") 39 | execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${src_file} ${dest_file}) 40 | endif() 41 | ENDFUNCTION(SGI_CREATE_SYMLINK) 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SGI - a scene graph inspector 2 | Copyright 2012-2018 FAST Protect GmbH, Andreas Roth 3 | 4 | SGI is primarily designed as tool to investigate and manipulate an OSG scene graph or Qt object structure. It can be used to investigate other 5 | object hierarchies as well. 6 | 7 | The main documentation is available in 8 | -------------------------------------------------------------------------------- /SGIHostSupport.in: -------------------------------------------------------------------------------- 1 | // kate: syntax C++11; 2 | // SGI - Copyright (C) 2012-2015 FAST Protect, Andreas Roth 3 | 4 | #pragma once 5 | 6 | #include "SGIHostItemInternal.h" 7 | 8 | @SGI_PLUGIN_HOST_SUPPORT_INCLUDES@ 9 | 10 | #cmakedefine01 SGI_USE_GAMMARAY 11 | 12 | namespace sgi { 13 | 14 | SGI_HOSTITEM_GENERATOR(@SGI_PLUGIN_HOST_SUPPORT_ITEM_CLASSES@) 15 | 16 | } // namespace sgi 17 | -------------------------------------------------------------------------------- /applications/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_subdirectory(viewer_base) 3 | add_subdirectory(viewerqt) 4 | add_subdirectory(osgviewer) 5 | add_subdirectory(helloWorldQt) 6 | if(SGI_BUILD_GLIMAGEVIEW) 7 | add_subdirectory(glimageview) 8 | endif() 9 | -------------------------------------------------------------------------------- /applications/glimageview/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET( TARGET_SRC 2 | MainWindow.cpp 3 | ) 4 | 5 | SET(TARGET_MOC_H 6 | MainWindow.h 7 | ) 8 | SET( TARGET_UI 9 | MainWindow.ui 10 | ) 11 | 12 | LIST(APPEND TARGET_LIBRARIES_VARS 13 | QT_QTCORE_LIBRARY 14 | QT_QTGUI_LIBRARY 15 | ) 16 | IF ( Qt5Widgets_FOUND ) 17 | # Add the include directories for the Qt 5 Widgets module to 18 | # the compile lines. 19 | include_directories(${Qt5Widgets_INCLUDE_DIRS}) 20 | LIST(APPEND TARGET_LIBRARIES_VARS QT_QTWIDGETS_LIBRARY ) 21 | ENDIF() 22 | 23 | 24 | set(_imagewidget_dir ../../src/sgi) 25 | 26 | include_directories(${_imagewidget_dir}) 27 | 28 | set(SHADERS_CPP "${CMAKE_CURRENT_BINARY_DIR}/${_imagewidget_dir}/AutoGenShaders.cpp") 29 | 30 | list(APPEND TARGET_SRC 31 | ${_imagewidget_dir}/ImageGLWidget.cpp 32 | ${SHADERS_CPP} 33 | ) 34 | 35 | list(APPEND TARGET_MOC_H 36 | ${_imagewidget_dir}/ImageGLWidget.h 37 | ) 38 | 39 | 40 | LIST(APPEND TARGET_LIBRARIES_VARS 41 | OSG_LIBRARY 42 | SGI_PLUGIN_IMPL_LIBRARY 43 | SGI_QT_HELPER_LIBRARY 44 | ) 45 | 46 | VAR_CONFIG(_postfix FAST_POSTFIX) 47 | add_definitions(-DSGI_QT_PLUGIN_DIR="/../plugins${_postfix}") 48 | 49 | FAST_SET_TARGET_AND_PRODUCT_VERSION(SGI) 50 | SET(TARGET_NO_TRANSLATION 1) 51 | 52 | FAST_COMMANDLINE_APPLICATION( glimageview NO_MOC_INCLUDE ) 53 | 54 | -------------------------------------------------------------------------------- /applications/glimageview/MainWindow.cpp: -------------------------------------------------------------------------------- 1 | #include "MainWindow.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | #include 11 | 12 | #include 13 | 14 | Q_LOGGING_CATEGORY(helloWorldQt, "helloWorldQt", QtDebugMsg) 15 | 16 | MainWindow::MainWindow(QImage * image, QWidget * parent) 17 | : QMainWindow(parent) 18 | { 19 | ui = new Ui::MainWindow; 20 | ui->setupUi( this ); 21 | 22 | ui->lineEdit->setObjectName(QApplication::translate("MainWindow", "\327\221\327\231\327\252\327\231 \327\224\327\225\327\220 \327\230\327\231\327\250\327\252\327\231", 0)); 23 | 24 | ui->noSGIButton->setProperty("sgi_skip_object", QVariant::fromValue(true)); 25 | 26 | sgi::ImagePtr sgiimage = new sgi::Image(image); 27 | 28 | ui->image->setImage(sgiimage.get()); 29 | //ui->image->setColorFilter("float gray = dot(color.rgb, vec3(0.299, 0.587, 0.114)); color = vec4(vec3(gray), color.a);"); 30 | 31 | } 32 | 33 | MainWindow::~MainWindow() 34 | { 35 | delete ui; 36 | } 37 | 38 | void MainWindow::fileQuit() 39 | { 40 | QApplication::quit(); 41 | } 42 | 43 | int main(int argc, char **argv) 44 | { 45 | QApplication app (argc, argv); 46 | 47 | QString path = QCoreApplication::applicationDirPath(); 48 | path = QDir::cleanPath(path + SGI_QT_PLUGIN_DIR); 49 | qDebug(helloWorldQt) << "addLibraryPath " << path; 50 | QCoreApplication::addLibraryPath(path); 51 | QImage load_sgi; 52 | QBuffer dummyMem; 53 | if(load_sgi.load(&dummyMem, "sgi_loader")) 54 | qDebug(helloWorldQt) << "sgi loaded."; 55 | else 56 | qDebug(helloWorldQt) << "failed to load sgi."; 57 | 58 | for(const QByteArray & format : QImageReader::supportedImageFormats()) 59 | { 60 | qDebug(helloWorldQt) << "reader " << format; 61 | } 62 | 63 | 64 | MainWindow * window = new MainWindow(&load_sgi); 65 | window->show(); 66 | 67 | int ret = app.exec(); 68 | delete window; 69 | return ret; 70 | } 71 | -------------------------------------------------------------------------------- /applications/glimageview/MainWindow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Ui { 6 | class MainWindow; 7 | } 8 | 9 | class MainWindow : public QMainWindow 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | MainWindow(QImage * image, QWidget * parent=NULL); 15 | virtual ~MainWindow(); 16 | 17 | public slots: 18 | void fileQuit(); 19 | 20 | private: 21 | Ui::MainWindow * ui; 22 | }; 23 | 24 | -------------------------------------------------------------------------------- /applications/helloWorldQt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET( TARGET_SRC 2 | MainWindow.cpp 3 | ) 4 | 5 | SET(TARGET_MOC_H 6 | MainWindow.h 7 | ) 8 | SET( TARGET_UI 9 | MainWindow.ui 10 | ) 11 | 12 | LIST(APPEND TARGET_LIBRARIES_VARS 13 | QT_QTCORE_LIBRARY 14 | QT_QTGUI_LIBRARY 15 | ) 16 | IF ( Qt5Widgets_FOUND ) 17 | # Add the include directories for the Qt 5 Widgets module to 18 | # the compile lines. 19 | include_directories(${Qt5Widgets_INCLUDE_DIRS}) 20 | LIST(APPEND TARGET_LIBRARIES_VARS QT_QTWIDGETS_LIBRARY ) 21 | ENDIF() 22 | 23 | if(FAST_SGI_CMAKE_SYSTEM) 24 | file(RELATIVE_PATH _qt_plugin_dir ${FAST_WORK_BIN_DIR} ${FAST_WORK_PLUGINS_DIR}) 25 | add_definitions(-DSGI_QT_PLUGIN_DIR="/${_qt_plugin_dir}") 26 | else() 27 | VAR_CONFIG(_postfix FAST_POSTFIX) 28 | add_definitions(-DSGI_QT_PLUGIN_DIR="/../plugins${_postfix}") 29 | endif() 30 | 31 | FAST_SET_TARGET_AND_PRODUCT_VERSION(SGI) 32 | SET(TARGET_NO_TRANSLATION 1) 33 | 34 | FAST_COMMANDLINE_APPLICATION( helloWorldQt NO_MOC_INCLUDE ) 35 | 36 | -------------------------------------------------------------------------------- /applications/helloWorldQt/MainWindow.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Ui { 6 | class MainWindow; 7 | } 8 | 9 | class MainWindow : public QMainWindow 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | MainWindow(QImage * image, QWidget * parent=nullptr); 15 | virtual ~MainWindow(); 16 | 17 | public slots: 18 | void fileQuit(); 19 | void sgiVersionInfo(); 20 | 21 | private: 22 | Ui::MainWindow * ui; 23 | }; 24 | 25 | -------------------------------------------------------------------------------- /applications/osgviewer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(../viewer_base) 2 | 3 | SET( TARGET_SRC 4 | osgviewer.cpp 5 | ) 6 | 7 | SET(TARGET_LIBRARIES_VARS 8 | OPENTHREADS_LIBRARY 9 | OSG_LIBRARY 10 | OSGDB_LIBRARY 11 | OSGUTIL_LIBRARY 12 | OSGGA_LIBRARY 13 | OSGVIEWER_LIBRARY 14 | sgi_viewer_base 15 | ) 16 | LIST(APPEND TARGET_LIBRARIES_VARS 17 | QT_QTCORE_LIBRARY 18 | QT_QTGUI_LIBRARY 19 | ) 20 | IF ( Qt5Widgets_FOUND ) 21 | # Add the include directories for the Qt 5 Widgets module to 22 | # the compile lines. 23 | include_directories(${Qt5Widgets_INCLUDE_DIRS}) 24 | LIST(APPEND TARGET_LIBRARIES_VARS QT_QTWIDGETS_LIBRARY ) 25 | ENDIF() 26 | IF(OSGEARTH_FOUND) 27 | include_directories(${OSGEARTH_INCLUDE_DIR}) 28 | LIST(APPEND TARGET_LIBRARIES_VARS 29 | OSGEARTH_LIBRARY 30 | OSGEARTHUTIL_LIBRARY 31 | ) 32 | ENDIF() 33 | 34 | if(OSGQT_FOUND) 35 | include_directories(${OSGQT_INCLUDE_DIR}) 36 | LIST(APPEND TARGET_LIBRARIES_VARS 37 | OSGQT_LIBRARY 38 | ) 39 | endif() 40 | 41 | FAST_SET_TARGET_AND_PRODUCT_VERSION(SGI) 42 | SET(TARGET_NO_TRANSLATION 1) 43 | 44 | FAST_COMMANDLINE_APPLICATION( sgi_osgviewer NO_MOC_INCLUDE) 45 | -------------------------------------------------------------------------------- /applications/viewer_base/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | IF ( Qt5Widgets_FOUND ) 2 | # Add the include directories for the Qt 5 Widgets module to 3 | # the compile lines. 4 | include_directories(${Qt5Widgets_INCLUDE_DIRS}) 5 | ENDIF() 6 | 7 | IF(OSGEARTH_FOUND) 8 | include_directories(${OSGEARTH_INCLUDE_DIR}) 9 | ENDIF() 10 | if(OSGQT_FOUND) 11 | include_directories(${OSGQT_INCLUDE_DIR}) 12 | endif() 13 | 14 | set(TARGET_SRC 15 | sgi_viewer_base.cpp 16 | ../../src/plugin_impl/osg_viewer.cpp 17 | ) 18 | list(APPEND TARGET_DEFINITIONS BUILD_SGI_VIEWER_BASE) 19 | set(TARGET_H sgi_viewer_base.h) 20 | 21 | FAST_SET_TARGET_AND_PRODUCT_VERSION(SGI) 22 | SET(TARGET_NO_TRANSLATION 1) 23 | SET(TARGET_NO_AUTO_VERSION_RESOURCE 1) 24 | SET(TARGET_NO_AUTO_VERSION_HEADER 1) 25 | 26 | if(UNIX) 27 | list(APPEND TARGET_ADDED_LIBRARIES dl) 28 | endif() 29 | 30 | FAST_STATIC_LIBRARY(sgi_viewer_base) 31 | -------------------------------------------------------------------------------- /applications/viewerqt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(../viewer_base) 2 | 3 | SET( TARGET_SRC 4 | osgviewerQt.cpp 5 | ) 6 | 7 | SET(TARGET_MOC_H 8 | osgviewerQt.h 9 | ) 10 | SET(TARGET_H 11 | ) 12 | if(SGI_USE_FLIGHTGEAR_GW) 13 | list(APPEND TARGET_SRC 14 | GraphicsWindowQt5.cpp 15 | ) 16 | list(APPEND TARGET_MOC_H 17 | GraphicsWindowQt5.hxx 18 | ) 19 | add_compile_definitions(-DSGI_USE_FLIGHTGEAR_GW=1) 20 | endif() 21 | 22 | SET(TARGET_LIBRARIES_VARS 23 | OPENTHREADS_LIBRARY 24 | OSG_LIBRARY 25 | OSGDB_LIBRARY 26 | OSGUTIL_LIBRARY 27 | OSGGA_LIBRARY 28 | OSGVIEWER_LIBRARY 29 | sgi_viewer_base 30 | ) 31 | if(OSGQT_FOUND) 32 | include_directories(${OSGQT_INCLUDE_DIR}) 33 | LIST(APPEND TARGET_LIBRARIES_VARS 34 | OSGQT_LIBRARY 35 | ) 36 | endif() 37 | 38 | LIST(APPEND TARGET_LIBRARIES_VARS 39 | QT_QTCORE_LIBRARY 40 | QT_QTGUI_LIBRARY 41 | ) 42 | IF ( Qt5Widgets_FOUND ) 43 | # Add the include directories for the Qt 5 Widgets module to 44 | # the compile lines. 45 | include_directories(${Qt5Widgets_INCLUDE_DIRS}) 46 | LIST(APPEND TARGET_LIBRARIES_VARS QT_QTWIDGETS_LIBRARY ) 47 | ENDIF() 48 | IF ( Qt5OpenGL_FOUND ) 49 | # Add the include directories for the Qt 5 OpenGL module to 50 | # the compile lines. 51 | include_directories(${Qt5OpenGL_INCLUDE_DIRS}) 52 | LIST(APPEND TARGET_LIBRARIES_VARS QT_QTOPENGL_LIBRARY ) 53 | ENDIF() 54 | 55 | IF(OSGEARTH_FOUND) 56 | include_directories(${OSGEARTH_INCLUDE_DIR}) 57 | LIST(APPEND TARGET_LIBRARIES_VARS 58 | OSGEARTH_LIBRARY 59 | OSGEARTHUTIL_LIBRARY 60 | OSGEARTHSYMBOLOGY_LIBRARY 61 | ) 62 | ENDIF() 63 | 64 | if(FAST_SGI_CMAKE_SYSTEM) 65 | file(RELATIVE_PATH _qt_plugin_dir ${FAST_WORK_BIN_DIR} ${FAST_WORK_PLUGINS_DIR}) 66 | add_definitions(-DSGI_QT_PLUGIN_DIR="/${_qt_plugin_dir}") 67 | else() 68 | VAR_CONFIG(_postfix FAST_POSTFIX) 69 | add_definitions(-DSGI_QT_PLUGIN_DIR="/../plugins${_postfix}") 70 | endif() 71 | 72 | FAST_SET_TARGET_AND_PRODUCT_VERSION(SGI) 73 | SET(TARGET_NO_TRANSLATION 1) 74 | 75 | FAST_COMMANDLINE_APPLICATION( sgi_osgviewerQt NO_MOC_INCLUDE ) 76 | 77 | -------------------------------------------------------------------------------- /applications/viewerqt/osgviewerQt.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | class QTimer; 9 | class QShowEvent; 10 | class QPaintEvent; 11 | class QResizeEvent; 12 | class CompositeViewerThread; 13 | class CreateViewHandler; 14 | 15 | class CreateViewHandlerProxy : public QObject 16 | { 17 | Q_OBJECT 18 | public: 19 | CreateViewHandlerProxy(CreateViewHandler * handler, QObject * parent); 20 | 21 | signals: 22 | void triggerClone(osgViewer::View * source, bool shared); 23 | 24 | protected: 25 | void viewCloneImpl(osgViewer::View * source, bool shared); 26 | }; 27 | 28 | class CreateViewHandler : public osgGA::GUIEventHandler 29 | { 30 | public: 31 | CreateViewHandler(QObject * parent); 32 | ~CreateViewHandler(); 33 | 34 | bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa) override; 35 | 36 | private: 37 | CreateViewHandlerProxy * _proxy; 38 | }; 39 | 40 | class ViewerWidget : public QMainWindow 41 | { 42 | Q_OBJECT 43 | public: 44 | 45 | enum GLContextImpl { 46 | GLContextImplDefault = 0, 47 | GLContextImplFlightgear, 48 | GLContextImplQt5, 49 | GLContextImplOSGQOpenGL 50 | }; 51 | 52 | ViewerWidget(osg::ArgumentParser& arguments, QWidget* parent = 0); 53 | ViewerWidget(ViewerWidget * parent, bool shared, GLContextImpl impl); 54 | virtual ~ViewerWidget(); 55 | 56 | osgViewer::View * view(); 57 | bool createCamera(); 58 | void setData(osg::Node * node); 59 | 60 | sgi_MapNodeHelper & helper() { 61 | return _helper; 62 | } 63 | 64 | GLContextImpl glContextImpl() const { 65 | return _impl; 66 | } 67 | 68 | protected: 69 | void showEvent( QShowEvent* event ) override; 70 | void paintEvent( QPaintEvent* event ) override; 71 | void resizeEvent(QResizeEvent * event) override; 72 | 73 | osgViewer::GraphicsWindow* createGraphicsWindow(int x, int y, int w, int h, 74 | osg::GraphicsContext* sharedContext, 75 | GLContextImpl impl); 76 | 77 | private: 78 | void init(); 79 | void onTimer(); 80 | 81 | protected: 82 | CompositeViewerThread * _thread; 83 | QTimer * _timer; 84 | osg::ref_ptr _mainGW; 85 | osg::ref_ptr _view; 86 | osg::ref_ptr _viewer; 87 | QWidget * _viewWidget; 88 | sgi_MapNodeHelper _helper; 89 | GLContextImpl _impl; 90 | }; 91 | -------------------------------------------------------------------------------- /gammaray/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(${GAMMARAY_INCLUDE_DIR} common) 2 | 3 | add_subdirectory(common) 4 | add_subdirectory(launcher) 5 | add_subdirectory(log4cplus) 6 | -------------------------------------------------------------------------------- /gammaray/common/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | set(TARGET_SRC 4 | deferredtreeview.cpp 5 | searchlinecontroller.cpp 6 | ) 7 | set(TARGET_MOC_H 8 | deferredtreeview.h 9 | deferredtreeview_p.h 10 | searchlinecontroller.h 11 | ) 12 | set(TARGET_DEFINITIONS HAVE_PRIVATE_QT_HEADERS) 13 | FAST_STATIC_LIBRARY(sgi_gammaray_ui) 14 | -------------------------------------------------------------------------------- /gammaray/common/deferredtreeview_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of GammaRay, the Qt application inspection and 3 | * manipulation tool. 4 | * 5 | * Copyright (C) 2014-2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com 6 | * Author: Filipe Azevedo 7 | * 8 | * Licensees holding valid commercial KDAB GammaRay licenses may use this file in 9 | * accordance with GammaRay Commercial License Agreement provided with the Software. 10 | * 11 | * Contact info@kdab.com if any conditions of this licensing are not clear to you. 12 | * 13 | * This program is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 2 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see . 25 | * 26 | */ 27 | 28 | #ifndef GAMMARAY_DEFERREDTREEVIEW_P_H 29 | #define GAMMARAY_DEFERREDTREEVIEW_P_H 30 | 31 | #include 32 | 33 | namespace GammaRay { 34 | class HeaderView : public QHeaderView 35 | { 36 | Q_OBJECT 37 | public: 38 | enum State { 39 | NoState, ResizeSection, MoveSection, SelectSections, NoClear 40 | }; // Copied from QHVPrivate 41 | 42 | explicit HeaderView(Qt::Orientation orientation, QWidget *parent = nullptr); 43 | 44 | bool isState(State state) const; 45 | }; 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /gammaray/common/searchlinecontroller.h: -------------------------------------------------------------------------------- 1 | /* 2 | searchlinecontroller.h 3 | 4 | This file is part of GammaRay, the Qt application inspection and 5 | manipulation tool. 6 | 7 | Copyright (C) 2015-2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com 8 | Author: Volker Krause 9 | 10 | Licensees holding valid commercial KDAB GammaRay licenses may use this file in 11 | accordance with GammaRay Commercial License Agreement provided with the Software. 12 | 13 | Contact info@kdab.com if any conditions of this licensing are not clear to you. 14 | 15 | This program is free software; you can redistribute it and/or modify 16 | it under the terms of the GNU General Public License as published by 17 | the Free Software Foundation, either version 2 of the License, or 18 | (at your option) any later version. 19 | 20 | This program is distributed in the hope that it will be useful, 21 | but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | GNU General Public License for more details. 24 | 25 | You should have received a copy of the GNU General Public License 26 | along with this program. If not, see . 27 | */ 28 | 29 | #ifndef GAMMARAY_SEARCHLINECONTROLLER_H 30 | #define GAMMARAY_SEARCHLINECONTROLLER_H 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | QT_BEGIN_NAMESPACE 37 | class QLineEdit; 38 | QT_END_NAMESPACE 39 | 40 | namespace GammaRay { 41 | /** Couples a line edit to a QSortFilterProxyModel api-like model for as-you-type filtering. 42 | * The model don't really need to be a QSortFilterProxyModel, it can be a plain QAbstractItemModel 43 | * implementing QSFPM like properties (ie, filterKeyColumn, filterCaseSensitivity etc...). 44 | * If the given proxy is not a QSFPM api-like model, a check is performed recursively in all 45 | * sourceModel until a compatible QSFPM api-like one is found. 46 | */ 47 | class SearchLineController : public QObject 48 | { 49 | Q_OBJECT 50 | public: 51 | /** Establish a connection between @p lineEdit and @p proxyModel. */ 52 | explicit SearchLineController(QLineEdit *lineEdit, QAbstractItemModel *proxyModel); 53 | ~SearchLineController(); 54 | 55 | private slots: 56 | void activateSearch(); 57 | 58 | private: 59 | QLineEdit *m_lineEdit; 60 | QPointer m_filterModel; 61 | }; 62 | } 63 | 64 | #endif // GAMMARAY_SEARCHLINECONTROLLER_H 65 | -------------------------------------------------------------------------------- /gammaray/launcher/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_definitions(-DGAMMARAY_PLUGIN_VERSION=\"${GAMMARAY_PLUGIN_VERSION}\" 2 | -DGAMMARAY_PLUGIN_INSTALL_DIR=\"${GAMMARAY_PLUGIN_INSTALL_DIR}\" 3 | ) 4 | 5 | set(TARGET_SRC 6 | main.cpp 7 | ) 8 | 9 | 10 | SET(TARGET_VERSION ${SGI_VERSION}) 11 | SET(TARGET_SOVERSION ${SGI_SOVERSION}) 12 | SET(TARGET_MAJOR_VERSION ${SGI_MAJOR_VERSION}) 13 | SET(TARGET_MINOR_VERSION ${SGI_MINOR_VERSION}) 14 | SET(TARGET_PATCH_VERSION ${SGI_PATCH_VERSION}) 15 | SET(TARGET_BUILD_VERSION ${SGI_SOVERSION}) 16 | SET(TARGET_PRODUCT_NAME "SGI") 17 | SET(TARGET_PRODUCT_COPYRIGHT "Copyright (C) 2012-2016") 18 | SET(TARGET_NO_TRANSLATION 1) 19 | 20 | list(APPEND TARGET_LIBRARIES_VARS 21 | QT_QTCORE_LIBRARY 22 | GAMMARAY_LAUNCHER_LIBRARY 23 | ) 24 | list(APPEND TARGET_DEFINITIONS 25 | SGI_LIBRARY 26 | ) 27 | FAST_PLUGIN(sgi_gammaray_launcher PLUGINTYPE gammaray ) 28 | -------------------------------------------------------------------------------- /gammaray/log4cplus/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(CMAKE_COMPILER_IS_GNUCXX) 2 | add_compile_options(-Wno-deprecated-declarations) 3 | endif() 4 | 5 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}) 6 | # probe plugin 7 | set(TARGET_SRC 8 | log4cplus_plugin.cpp 9 | log4cplus_model.cpp 10 | ) 11 | LIST(APPEND TARGET_PRIVATE_LIBRARIES QT_QTCORE QT_QTGUI) 12 | LIST(APPEND TARGET_ADDED_LIBRARIES 13 | GAMMARAY_CORE_LIBRARY 14 | GAMMARAY_KITEMMODELS_LIBRARY 15 | LOG4CPLUS_LIBRARY 16 | ) 17 | gammaray_add_plugin(gammaray_log4cplus JSON gammaray_log4cplus.json) 18 | 19 | # ui plugin 20 | if(GAMMARAY_BUILD_UI) 21 | set(TARGET_SRC 22 | log4cplus_widget.cpp 23 | ) 24 | set(TARGET_UI 25 | log4cplus_widget.ui 26 | ) 27 | LIST(APPEND TARGET_PRIVATE_LIBRARIES QT_QTCORE QT_QTGUI QT_QTWIDGETS) 28 | LIST(APPEND TARGET_ADDED_LIBRARIES GAMMARAY_CORE_LIBRARY GAMMARAY_UI_LIBRARY sgi_gammaray_ui) 29 | gammaray_add_plugin(gammaray_log4cplus_ui JSON gammaray_log4cplus.json) 30 | endif() 31 | -------------------------------------------------------------------------------- /gammaray/log4cplus/gammaray_log4cplus.json: -------------------------------------------------------------------------------- 1 | { 2 | "hidden": false, 3 | "id": "gammaray_log4cplus", 4 | "name": "log4cplus", 5 | "types": [ 6 | "QObject" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /gammaray/log4cplus/log4cplus_model.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "common/modelroles.h" 3 | 4 | #include 5 | #include 6 | 7 | namespace log4cplus { 8 | class Logger; 9 | } 10 | 11 | namespace sgi { 12 | class Log4cplusModel : public QStandardItemModel 13 | { 14 | Q_OBJECT 15 | public: 16 | enum Roles { 17 | IconNameRole = Qt::UserRole + 1, 18 | GenericIconNameRole 19 | }; 20 | 21 | explicit Log4cplusModel(QObject *parent = nullptr); 22 | ~Log4cplusModel(); 23 | 24 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; 25 | Qt::ItemFlags flags(const QModelIndex &index) const override; 26 | int rowCount(const QModelIndex &parent = QModelIndex()) const override; 27 | 28 | private: 29 | void fillModel(); 30 | QVector itemsForLogger(const log4cplus::Logger & logger); 31 | void makeItemsForLogger(const log4cplus::Logger & logger); 32 | static QList makeRowForLogger(const log4cplus::Logger & logger); 33 | 34 | QHash > m_loggerItems; 35 | QMimeDatabase m_db; 36 | bool m_modelFilled; 37 | }; 38 | } 39 | -------------------------------------------------------------------------------- /gammaray/log4cplus/log4cplus_plugin.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "log4cplus_plugin.h" 3 | #include "log4cplus_model.h" 4 | 5 | using namespace sgi; 6 | 7 | Log4cplusPlugin::Log4cplusPlugin(GammaRay::ProbeInterface *probe, QObject *parent) 8 | : QObject(parent) 9 | { 10 | auto model = new Log4cplusModel(this); 11 | probe->registerModel(QStringLiteral("com.kdab.GammaRay.Log4cplusModel"), model); 12 | } 13 | 14 | Log4cplusPlugin::~Log4cplusPlugin() 15 | { 16 | } 17 | -------------------------------------------------------------------------------- /gammaray/log4cplus/log4cplus_plugin.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "core/toolfactory.h" 4 | 5 | QT_BEGIN_NAMESPACE 6 | class QStandardItemModel; 7 | QT_END_NAMESPACE 8 | 9 | namespace sgi { 10 | class Log4cplusPlugin : public QObject 11 | { 12 | Q_OBJECT 13 | public: 14 | explicit Log4cplusPlugin(GammaRay::ProbeInterface *probe, QObject *parent = nullptr); 15 | ~Log4cplusPlugin(); 16 | }; 17 | 18 | class Log4cplusPluginFactory : public QObject, public GammaRay::StandardToolFactory 19 | { 20 | Q_OBJECT 21 | Q_INTERFACES(GammaRay::ToolFactory) 22 | Q_PLUGIN_METADATA(IID "com.kdab.GammaRay.ToolFactory" FILE "gammaray_log4cplus.json") 23 | public: 24 | explicit Log4cplusPluginFactory(QObject *parent = nullptr) 25 | : QObject(parent) 26 | { 27 | } 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /gammaray/log4cplus/log4cplus_widget.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "log4cplus_widget.h" 3 | #include "ui_log4cplus_widget.h" 4 | 5 | #include "searchlinecontroller.h" 6 | 7 | #include 8 | 9 | using namespace sgi; 10 | 11 | Log4cplusWidget::Log4cplusWidget(QWidget *parent) 12 | : QWidget(parent) 13 | , ui(new Ui::Log4cplusWidget) 14 | , m_stateManager(this) 15 | { 16 | ui->setupUi(this); 17 | 18 | auto model = GammaRay::ObjectBroker::model(QStringLiteral("com.kdab.GammaRay.Log4cplusModel")); 19 | ui->mimeTypeView->header()->setObjectName("loggerHeader"); 20 | ui->mimeTypeView->setDeferredResizeMode(0, QHeaderView::ResizeToContents); 21 | ui->mimeTypeView->setDeferredResizeMode(1, QHeaderView::ResizeToContents); 22 | ui->mimeTypeView->setModel(model); 23 | ui->mimeTypeView->sortByColumn(0, Qt::AscendingOrder); 24 | new GammaRay::SearchLineController(ui->searchLine, model); 25 | } 26 | 27 | Log4cplusWidget::~Log4cplusWidget() 28 | { 29 | } 30 | -------------------------------------------------------------------------------- /gammaray/log4cplus/log4cplus_widget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | namespace sgi { 9 | namespace Ui { 10 | class Log4cplusWidget; 11 | } 12 | 13 | class Log4cplusWidget : public QWidget 14 | { 15 | Q_OBJECT 16 | public: 17 | explicit Log4cplusWidget(QWidget *parent = nullptr); 18 | ~Log4cplusWidget(); 19 | 20 | private: 21 | QScopedPointer ui; 22 | GammaRay::UIStateManager m_stateManager; 23 | }; 24 | 25 | class Log4cplusWidgetFactory : public QObject, public GammaRay::StandardToolUiFactory 26 | { 27 | Q_OBJECT 28 | Q_INTERFACES(GammaRay::ToolUiFactory) 29 | Q_PLUGIN_METADATA(IID "com.kdab.GammaRay.ToolUiFactory" FILE "gammaray_log4cplus.json") 30 | }; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /gammaray/log4cplus/log4cplus_widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | sgi::Log4cplusWidget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | 15 | 0 16 | 17 | 18 | 0 19 | 20 | 21 | 0 22 | 23 | 24 | 0 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | GammaRay::DeferredTreeView 37 | QTreeView 38 |
deferredtreeview.h
39 |
40 |
41 | 42 | 43 |
44 | -------------------------------------------------------------------------------- /img/microscope64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aroth-fastprotect/sgi/0b79f5d6bc4af5574cf5431ae727fceb1018c730/img/microscope64.png -------------------------------------------------------------------------------- /include/sgi/.gitignore: -------------------------------------------------------------------------------- 1 | /Export 2 | -------------------------------------------------------------------------------- /include/sgi/ContextMenu: -------------------------------------------------------------------------------- 1 | // kate: syntax C++11; 2 | // SGI - Copyright (C) 2012-2015 FAST Protect, Andreas Roth 3 | 4 | #pragma once 5 | 6 | #if !defined(SGI_NO_HOSTITEM_GENERATOR) 7 | #include "plugins/SGIHostItemGenerator" 8 | #endif 9 | #include "plugins/ContextMenu" 10 | 11 | namespace sgi { 12 | 13 | template 14 | inline IContextMenu * createContextMenuImpl(QWidget *parent, const SGIHostItemBase * object, IHostCallback * callback=nullptr) 15 | { 16 | IContextMenu * ret; 17 | typedef IContextMenu * (*pfn)(QWidget *parent, const SGIHostItemBase * object, IHostCallback * callback); 18 | pfn func = reinterpret_cast(AUTOLOADCLASS::sgiLibraryProcAddress("sgi_createContextMenu")); 19 | if(func) 20 | ret = func(parent, object, callback); 21 | else 22 | ret = nullptr; 23 | return ret; 24 | } 25 | 26 | template 27 | inline IContextMenu * createContextMenuImpl(QWidget *parent, SGIItemBase * item, IHostCallback * callback=nullptr) 28 | { 29 | IContextMenu * ret; 30 | typedef IContextMenu * (*pfn)(QWidget *parent, SGIItemBase * item, IHostCallback * callback); 31 | pfn func = reinterpret_cast(AUTOLOADCLASS::sgiLibraryProcAddress("sgi_createContextMenuItem")); 32 | if(func) 33 | ret = func(parent, item, callback); 34 | else 35 | ret = nullptr; 36 | return ret; 37 | } 38 | 39 | template 40 | inline IContextMenu * createContextMenu(QWidget *parent, const SGIHostItemBase * item, IHostCallback * callback=nullptr) 41 | { 42 | IContextMenu * ret = createContextMenuImpl(parent, item, callback); 43 | return ret; 44 | } 45 | 46 | template 47 | inline IContextMenu * createContextMenu(QWidget *parent, SGIItemBase * item, IHostCallback * callback=nullptr) 48 | { 49 | IContextMenu * ret = createContextMenuImpl(parent, item, callback); 50 | return ret; 51 | } 52 | 53 | #if !defined(SGI_NO_HOSTITEM_GENERATOR) 54 | template 55 | inline IContextMenu * createContextMenu(QWidget *parent, OBJECT_TYPE * object, IHostCallback * callback=nullptr) 56 | { 57 | SGIHostItemBasePtr hostitem = SGIHostItemGenerator::generateHostItem(object); 58 | IContextMenu * ret = createContextMenuImpl(parent, hostitem.get(), callback); 59 | return ret; 60 | } 61 | #endif // !defined(SGI_NO_HOSTITEM_GENERATOR) 62 | 63 | } // namespace sgi 64 | -------------------------------------------------------------------------------- /include/sgi/ContextMenuQt: -------------------------------------------------------------------------------- 1 | // kate: syntax C++11; 2 | // SGI - Copyright (C) 2012-2015 FAST Protect, Andreas Roth 3 | 4 | #pragma once 5 | 6 | #include "AutoLoadQt" 7 | #include "plugins/ContextMenuQt" 8 | 9 | class QWidget; 10 | class QMenu; 11 | 12 | namespace sgi { 13 | 14 | 15 | template 16 | inline IContextMenuQt * createContextMenuQtImpl(QWidget *parent, QObject * item, IHostCallback * callback=nullptr) 17 | { 18 | IContextMenuQt * ret; 19 | typedef IContextMenuQt * (*pfn)(QWidget *parent, QObject * item, IHostCallback * callback); 20 | pfn func = (pfn)AUTOLOADCLASS::sgiLibraryProcAddress("sgi_createContextMenuItemQt"); 21 | if(func) 22 | ret = func(parent, item, callback); 23 | else 24 | ret = nullptr; 25 | return ret; 26 | } 27 | 28 | inline IContextMenuQt * createContextMenuQt(QWidget *parent, QObject * item, IHostCallback * callback=nullptr) 29 | { 30 | IContextMenuQt * ret = createContextMenuQtImpl(parent, item, callback); 31 | return ret; 32 | } 33 | 34 | } // namespace sgi 35 | -------------------------------------------------------------------------------- /include/sgi/GenerateItem: -------------------------------------------------------------------------------- 1 | // kate: syntax C++; 2 | // SGI - Copyright (C) 2012-2018 FAST Protect, Andreas Roth 3 | 4 | #pragma once 5 | 6 | #if !defined(SGI_NO_HOSTITEM_GENERATOR) 7 | #include "plugins/SGIHostItemGenerator" 8 | #else 9 | #include "plugins/SGIItemBase.h" 10 | #endif 11 | 12 | namespace sgi { 13 | 14 | template 15 | inline bool generateItem(SGIItemBasePtr & item, const SGIHostItemBase * object) 16 | { 17 | bool ret; 18 | typedef bool (*pfn)(SGIItemBasePtr & item, const sgi::SGIHostItemBase * object); 19 | pfn func = reinterpret_cast(AUTOLOADCLASS::sgiLibraryProcAddress("sgi_generateItem")); 20 | if(func) 21 | ret = func(item, object); 22 | else 23 | ret = false; 24 | return ret; 25 | } 26 | 27 | #if !defined(SGI_NO_HOSTITEM_GENERATOR) 28 | template 29 | inline bool generateItem(SGIItemBasePtr & item, OBJECT_TYPE * object) 30 | { 31 | SGIHostItemBasePtr hostitem = SGIHostItemGenerator::generateHostItem(object); 32 | return generateItem(item, hostitem.get()); 33 | } 34 | #endif // !defined(SGI_NO_HOSTITEM_GENERATOR) 35 | 36 | } // namespace sgi 37 | -------------------------------------------------------------------------------- /include/sgi/ImagePreviewDialog: -------------------------------------------------------------------------------- 1 | // kate: syntax C++11; 2 | // SGI - Copyright (C) 2012-2015 FAST Protect, Andreas Roth 3 | 4 | #pragma once 5 | 6 | #if !defined(SGI_NO_HOSTITEM_GENERATOR) 7 | #include "plugins/SGIHostItemGenerator" 8 | #endif 9 | #include "plugins/ImagePreviewDialog" 10 | 11 | namespace sgi { 12 | 13 | template 14 | inline IImagePreviewDialog * showImagePreviewDialogImpl(QWidget *parent, const SGIHostItemBase * object, IHostCallback * callback=nullptr) 15 | { 16 | IImagePreviewDialog * ret; 17 | typedef IImagePreviewDialog * (*pfn)(QWidget *parent, const SGIHostItemBase * object, IHostCallback * callback); 18 | pfn func = (pfn)AUTOLOADCLASS::sgiLibraryProcAddress("sgi_showImagePreviewDialog"); 19 | if(func) 20 | ret = func(parent, object, callback); 21 | else 22 | ret = nullptr; 23 | return ret; 24 | } 25 | 26 | template 27 | inline IImagePreviewDialog * showImagePreviewDialogImpl(QWidget *parent, SGIItemBase * item, IHostCallback * callback=nullptr) 28 | { 29 | IImagePreviewDialog * ret; 30 | typedef IImagePreviewDialog * (*pfn)(QWidget *parent, const SGIItemBase * item, IHostCallback * callback); 31 | pfn func = (pfn)AUTOLOADCLASS::sgiLibraryProcAddress("sgi_showImagePreviewDialogItem"); 32 | if(func) 33 | ret = func(parent, item, callback); 34 | else 35 | ret = nullptr; 36 | return ret; 37 | } 38 | 39 | template 40 | inline IImagePreviewDialog * showImagePreviewDialog(QWidget *parent, SGIItemBase * item, IHostCallback * callback=nullptr) 41 | { 42 | IImagePreviewDialog * ret = showImagePreviewDialogImpl(parent, item, callback); 43 | return ret; 44 | } 45 | 46 | template 47 | inline IImagePreviewDialog * showImagePreviewDialog(QWidget *parent, const SGIHostItemBase * item, IHostCallback * callback=nullptr) 48 | { 49 | IImagePreviewDialog * ret = showImagePreviewDialogImpl(parent, item, callback); 50 | return ret; 51 | } 52 | 53 | #if !defined(SGI_NO_HOSTITEM_GENERATOR) 54 | template 55 | inline IImagePreviewDialog * showImagePreviewDialog(QWidget *parent, OBJECT_TYPE * object, IHostCallback * callback=nullptr) 56 | { 57 | SGIHostItemBasePtr hostitem = SGIHostItemGenerator::generateHostItem(object); 58 | IImagePreviewDialog * ret = showImagePreviewDialogImpl(parent, hostitem.get(), callback); 59 | return ret; 60 | } 61 | #endif // !defined(SGI_NO_HOSTITEM_GENERATOR) 62 | 63 | } // namespace sgi 64 | -------------------------------------------------------------------------------- /include/sgi/LibraryInfo: -------------------------------------------------------------------------------- 1 | // kate: syntax C++; 2 | // SGI - Copyright (C) 2012-2018 FAST Protect, Andreas Roth 3 | 4 | #pragma once 5 | 6 | class QObject; 7 | 8 | namespace sgi { 9 | 10 | namespace details { 11 | class Object; 12 | } 13 | 14 | template 15 | inline QObject * libraryInfoQObject() 16 | { 17 | QObject * ret; 18 | typedef QObject * (*pfn)(); 19 | pfn func = (pfn)AUTOLOADCLASS::sgiLibraryProcAddress("sgi_libraryInfoQObject"); 20 | if(func) 21 | ret = func(); 22 | else 23 | ret = nullptr; 24 | return ret; 25 | } 26 | 27 | template 28 | inline details::Object * libraryInfoObject() 29 | { 30 | details::Object * ret; 31 | typedef details::Object * (*pfn)(); 32 | pfn func = (pfn)AUTOLOADCLASS::sgiLibraryProcAddress("sgi_libraryInfoObject"); 33 | if(func) 34 | ret = func(); 35 | else 36 | ret = nullptr; 37 | return ret; 38 | } 39 | 40 | } // namespace sgi 41 | -------------------------------------------------------------------------------- /include/sgi/ObjectLoggerDialog: -------------------------------------------------------------------------------- 1 | // kate: syntax C++11; 2 | // SGI - Copyright (C) 2012-2015 FAST Protect, Andreas Roth 3 | 4 | #pragma once 5 | 6 | #if !defined(SGI_NO_HOSTITEM_GENERATOR) 7 | #include "plugins/SGIHostItemGenerator" 8 | #endif 9 | #include "plugins/ObjectLoggerDialog" 10 | 11 | namespace sgi { 12 | 13 | template 14 | inline IObjectLoggerDialog * showObjectLoggerDialogImpl(QWidget *parent, const SGIHostItemBase * object, IHostCallback * callback=nullptr) 15 | { 16 | IObjectLoggerDialog * ret; 17 | typedef IObjectLoggerDialog * (*pfn)(QWidget *parent, const SGIHostItemBase * object, IHostCallback * callback); 18 | pfn func = (pfn)AUTOLOADCLASS::sgiLibraryProcAddress("sgi_showObjectLoggerDialog"); 19 | if(func) 20 | ret = func(parent, object, callback); 21 | else 22 | ret = nullptr; 23 | return ret; 24 | } 25 | 26 | template 27 | inline IObjectLoggerDialog * showObjectLoggerDialogImpl(QWidget *parent, SGIItemBase * item, IHostCallback * callback=nullptr) 28 | { 29 | IObjectLoggerDialog * ret; 30 | typedef IObjectLoggerDialog * (*pfn)(QWidget *parent, SGIItemBase * item, IHostCallback * callback); 31 | pfn func = (pfn)AUTOLOADCLASS::sgiLibraryProcAddress("sgi_showObjectLoggerDialogItem"); 32 | if(func) 33 | ret = func(parent, item, callback); 34 | else 35 | ret = nullptr; 36 | return ret; 37 | } 38 | 39 | template 40 | inline IObjectLoggerDialog * showObjectLoggerDialog(QWidget *parent, const SGIHostItemBase * item, IHostCallback * callback=nullptr) 41 | { 42 | IObjectLoggerDialog * ret = showObjectLoggerDialogImpl(parent, item, callback); 43 | return ret; 44 | } 45 | 46 | template 47 | inline IObjectLoggerDialog * showObjectLoggerDialog(QWidget *parent, SGIItemBase * item, IHostCallback * callback=nullptr) 48 | { 49 | IObjectLoggerDialog * ret = showObjectLoggerDialogImpl(parent, item, callback); 50 | return ret; 51 | } 52 | 53 | #if !defined(SGI_NO_HOSTITEM_GENERATOR) 54 | template 55 | inline IObjectLoggerDialog * showObjectLoggerDialog(QWidget *parent, OBJECT_TYPE * object, IHostCallback * callback=nullptr) 56 | { 57 | SGIHostItemBasePtr hostitem = SGIHostItemGenerator::generateHostItem(object); 58 | IObjectLoggerDialog * ret = showObjectLoggerDialogImpl(parent, hostitem.get(), callback); 59 | return ret; 60 | } 61 | #endif // !defined(SGI_NO_HOSTITEM_GENERATOR) 62 | 63 | } // namespace sgi 64 | -------------------------------------------------------------------------------- /include/sgi/ParentWidget: -------------------------------------------------------------------------------- 1 | // kate: syntax C++11; 2 | // SGI - Copyright (C) 2012-2015 FAST Protect, Andreas Roth 3 | 4 | #pragma once 5 | 6 | #include "plugins/SGIHostItemGenerator" 7 | 8 | class QWidget; 9 | 10 | namespace sgi { 11 | 12 | class SGIItemBase; 13 | class SGIHostItemBase; 14 | typedef QWidget * QWidgetPtr; 15 | 16 | template 17 | inline QWidget * parentWidgetImpl(const SGIHostItemBase * object) 18 | { 19 | ISceneGraphDialog * ret; 20 | typedef ISceneGraphDialog * (*pfn)(QWidgetPtr & widget, const SGIHostItemBase * object); 21 | pfn func = (pfn)AUTOLOADCLASS::sgiLibraryProcAddress("sgi_parentWidget"); 22 | if(func) 23 | ret = func(widget, object); 24 | else 25 | ret = nullptr; 26 | return ret; 27 | } 28 | 29 | template 30 | inline QWidget * parentWidgetImpl(SGIItemBase * item) 31 | { 32 | QWidget * ret = nullptr; 33 | typedef QWidget * (*pfn)(QWidgetPtr & widget, SGIItemBase * item); 34 | pfn func = (pfn)AUTOLOADCLASS::sgiLibraryProcAddress("sgi_parentWidgetItem"); 35 | if(func) 36 | ret = func(widget, item); 37 | else 38 | ret = nullptr; 39 | return ret; 40 | } 41 | 42 | template 43 | inline QWidget * parentWidget(OBJECT_TYPE * object) 44 | { 45 | SGIHostItemBasePtr hostitem = SGIHostItemGenerator::generateHostItem(object); 46 | ISceneGraphDialog * ret = parentWidgetImpl(parent, hostitem.get(), info); 47 | return ret; 48 | } 49 | 50 | template 51 | inline QWidget * parentWidget(SGIItemBase * item) 52 | { 53 | QWidget * ret = parentWidgetImpl(item); 54 | return ret; 55 | } 56 | 57 | template 58 | inline QWidget * showSceneGraphDialog(const SGIHostItemBase * item) 59 | { 60 | QWidget * ret = parentWidgetImpl(item); 61 | return ret; 62 | } 63 | 64 | } // namespace sgi 65 | -------------------------------------------------------------------------------- /include/sgi/SGIItemInternal: -------------------------------------------------------------------------------- 1 | // kate: syntax C++11; 2 | // SGI - Copyright (C) 2012-2018 FAST Protect, Andreas Roth 3 | 4 | #pragma once 5 | 6 | #include "plugins/SGIItemBase.h" 7 | #include "details/Referenced" 8 | 9 | namespace sgi { 10 | 11 | typedef SGIItemInfoSharedPtr > SGIItemInfoInternal; 12 | typedef SGIHostItemImpl SGIHostItemInternal; 13 | typedef SGIItemHolderT SGIItemHolderInternal; 14 | typedef SGIItemT SGIItemInternal; 15 | 16 | struct InternalItemData 17 | { 18 | SGIItemBasePtr item; 19 | InternalItemData(SGIItemBase * item_) : item(item_) {} 20 | }; 21 | 22 | typedef details::ReferencedDataT ReferencedInternalItemData; 23 | 24 | struct InternalInfoData 25 | { 26 | enum CommandId { 27 | CommandIdInvalid = 0, 28 | CommandIdAbout 29 | }; 30 | CommandId command; 31 | InternalInfoData(CommandId command_) : command(command_) {} 32 | }; 33 | 34 | typedef details::ReferencedDataT ReferencedInternalInfoData; 35 | 36 | } // namespace sgi 37 | -------------------------------------------------------------------------------- /include/sgi/SceneGraphDialog: -------------------------------------------------------------------------------- 1 | // kate: syntax C++; 2 | // SGI - Copyright (C) 2012-2018 FAST Protect, Andreas Roth 3 | 4 | #pragma once 5 | 6 | #if !defined(SGI_NO_HOSTITEM_GENERATOR) 7 | #include "plugins/SGIHostItemGenerator" 8 | #endif 9 | #include "plugins/SceneGraphDialog" 10 | 11 | namespace sgi { 12 | 13 | template 14 | inline ISceneGraphDialog * showSceneGraphDialogImpl(QWidget *parent, const SGIHostItemBase * object, IHostCallback * callback=nullptr) 15 | { 16 | ISceneGraphDialog * ret; 17 | typedef ISceneGraphDialog * (*pfn)(QWidget *parent, const SGIHostItemBase * object, IHostCallback * callback); 18 | pfn func = (pfn)AUTOLOADCLASS::sgiLibraryProcAddress("sgi_showSceneGraphDialog"); 19 | if(func) 20 | ret = func(parent, object, callback); 21 | else 22 | ret = nullptr; 23 | return ret; 24 | } 25 | 26 | template 27 | inline ISceneGraphDialog * showSceneGraphDialogImpl(QWidget *parent, SGIItemBase * item, IHostCallback * callback=nullptr) 28 | { 29 | ISceneGraphDialog * ret; 30 | typedef ISceneGraphDialog * (*pfn)(QWidget *parent, const SGIItemBase * item, IHostCallback * callback); 31 | pfn func = (pfn)AUTOLOADCLASS::sgiLibraryProcAddress("sgi_showSceneGraphDialogItem"); 32 | if(func) 33 | ret = func(parent, item, callback); 34 | else 35 | ret = nullptr; 36 | return ret; 37 | } 38 | 39 | template 40 | inline ISceneGraphDialog * showSceneGraphDialog(QWidget *parent, SGIItemBase * item, IHostCallback * callback=nullptr) 41 | { 42 | ISceneGraphDialog * ret = showSceneGraphDialogImpl(parent, item, callback); 43 | return ret; 44 | } 45 | 46 | template 47 | inline ISceneGraphDialog * showSceneGraphDialog(QWidget *parent, const SGIHostItemBase * item, IHostCallback * callback=nullptr) 48 | { 49 | ISceneGraphDialog * ret = showSceneGraphDialogImpl(parent, item, callback); 50 | return ret; 51 | } 52 | 53 | #if !defined(SGI_NO_HOSTITEM_GENERATOR) 54 | template 55 | inline ISceneGraphDialog * showSceneGraphDialog(QWidget *parent, OBJECT_TYPE * object, IHostCallback * callback=nullptr) 56 | { 57 | SGIHostItemBasePtr hostitem = SGIHostItemGenerator::generateHostItem(object); 58 | ISceneGraphDialog * ret = showSceneGraphDialogImpl(parent, hostitem.get(), callback); 59 | return ret; 60 | } 61 | #endif // !defined(SGI_NO_HOSTITEM_GENERATOR) 62 | 63 | } // namespace sgi 64 | -------------------------------------------------------------------------------- /include/sgi/Shutdown: -------------------------------------------------------------------------------- 1 | // kate: syntax C++11; 2 | // SGI - Copyright (C) 2012-2015 FAST Protect, Andreas Roth 3 | 4 | #pragma once 5 | 6 | namespace sgi { 7 | 8 | template 9 | inline void shutdown() 10 | { 11 | typedef void (*pfn)(); 12 | pfn func = reinterpret_cast(AUTOLOADCLASS::sgiLibraryProcAddressNoLoad("sgi_shutdown")); 13 | if(func) 14 | { 15 | func(); 16 | AUTOLOADCLASS::sgiLibraryUnload(); 17 | } 18 | } 19 | 20 | } // namespace sgi 21 | -------------------------------------------------------------------------------- /include/sgi/WritePrettyHTML: -------------------------------------------------------------------------------- 1 | // kate: syntax C++11; 2 | // SGI - Copyright (C) 2012-2015 FAST Protect, Andreas Roth 3 | 4 | #pragma once 5 | 6 | #if !defined(SGI_NO_HOSTITEM_GENERATOR) 7 | #include "plugins/SGIHostItemGenerator" 8 | #endif 9 | 10 | namespace sgi { 11 | 12 | template 13 | inline void writePrettyHTMLImpl(std::basic_ostream& os, const SGIHostItemBase * object, bool table=true) 14 | { 15 | typedef void (*pfn)(std::basic_ostream& os, const SGIHostItemBase * object, bool table); 16 | pfn func = (pfn)AUTOLOADCLASS::sgiLibraryProcAddress("sgi_writePrettyHTML"); 17 | if(func) 18 | func(os, object, table); 19 | } 20 | 21 | template 22 | inline void writePrettyHTML(std::basic_ostream& os, const SGIItemBase * item, bool table=true) 23 | { 24 | typedef void (*pfn)(std::basic_ostream& os, const SGIItemBase * item, bool table); 25 | pfn func = (pfn)AUTOLOADCLASS::sgiLibraryProcAddress("sgi_writePrettyHTMLItem"); 26 | if(func) 27 | func(os, item, table); 28 | } 29 | 30 | #if !defined(SGI_NO_HOSTITEM_GENERATOR) 31 | template 32 | inline void writePrettyHTML(std::basic_ostream& os, OBJECT_TYPE * object, bool table=true) 33 | { 34 | SGIHostItemBasePtr hostitem = SGIHostItemGenerator::generateHostItem(object); 35 | writePrettyHTMLImpl(os, hostitem.get(), table); 36 | } 37 | #endif // !defined(SGI_NO_HOSTITEM_GENERATOR) 38 | 39 | template 40 | inline void writePrettyHTML(std::basic_ostream& os, const SGIHostItemBase * item, bool table=true) 41 | { 42 | writePrettyHTML(os, item, table); 43 | } 44 | } // namespace sgi 45 | -------------------------------------------------------------------------------- /include/sgi/details/Observer: -------------------------------------------------------------------------------- 1 | // kate: mode C++; 2 | // SGI - Copyright (C) 2012-2018 FAST Protect, Andreas Roth 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include "Referenced" 9 | 10 | namespace sgi { 11 | namespace details { 12 | 13 | /** Observer base class for tracking when objects are unreferenced (their reference count goes to 0) and are being deleted.*/ 14 | class SGI_REF_EXPORT Observer 15 | { 16 | public: 17 | Observer(); 18 | virtual ~Observer(); 19 | 20 | /** objectDeleted is called when the observed object is about to be deleted. The observer will be automatically 21 | * removed from the observed object's observer set so there is no need for the objectDeleted implementation 22 | * to call removeObserver() on the observed object. */ 23 | virtual void objectDeleted(void*) {} 24 | 25 | }; 26 | 27 | /** Class used by osg::Referenced to track the observers associated with it.*/ 28 | class SGI_REF_EXPORT ObserverSet : public Referenced 29 | { 30 | public: 31 | 32 | ObserverSet(const Referenced* observedObject); 33 | 34 | Referenced* getObserverdObject() { return _observedObject; } 35 | const Referenced* getObserverdObject() const { return _observedObject; } 36 | 37 | /** "Lock" a Referenced object i.e., protect it from being deleted 38 | * by incrementing its reference count. 39 | * 40 | * returns null if object doesn't exist anymore. */ 41 | Referenced* addRefLock(); 42 | 43 | inline std::mutex* getObserverSetMutex() const { return &_mutex; } 44 | 45 | void addObserver(Observer* observer); 46 | void removeObserver(Observer* observer); 47 | 48 | void signalObjectDeleted(void* ptr); 49 | 50 | typedef std::set Observers; 51 | Observers& getObservers() { return _observers; } 52 | const Observers& getObservers() const { return _observers; } 53 | 54 | protected: 55 | 56 | ObserverSet(const ObserverSet& rhs): Referenced(rhs) {} 57 | ObserverSet& operator = (const ObserverSet& /*rhs*/) { return *this; } 58 | virtual ~ObserverSet(); 59 | 60 | #ifdef _MSC_VER 61 | #pragma warning(push) 62 | // disable warning C4251: '_mutex': struct 'std::mutex' needs to have dll-interface to be used by clients of class 'ObserverSet' 63 | #pragma warning(disable:4251) 64 | #endif 65 | mutable std::mutex _mutex; 66 | Referenced* _observedObject; 67 | Observers _observers; 68 | #ifdef _MSC_VER 69 | #pragma warning(pop) 70 | #endif 71 | }; 72 | 73 | } // namespace details 74 | } // namespace sgi 75 | 76 | -------------------------------------------------------------------------------- /include/sgi/details/call_function_for_object_type: -------------------------------------------------------------------------------- 1 | // kate: mode C++; 2 | // SGI - Copyright (C) 2012-2015 FAST Protect, Andreas Roth 3 | 4 | #pragma once 5 | #include "object_type_info" 6 | 7 | namespace sgi { 8 | namespace details { 9 | 10 | template 11 | struct call_function_for_object_type_functor; 12 | 13 | 14 | template 15 | void call_function_for_object_type(BaseType * baseObject, OBJECT_TYPE * object, Functor & op) 16 | { 17 | op.accept(object); 18 | typedef typename object_info::object_type_info::derived_types derived_types; 19 | call_function_for_object_type_functor proxy(baseObject, op); 20 | details::for_each_type(proxy); 21 | } 22 | 23 | template 24 | void call_function_for_object_type(BaseType * baseObject, Functor & op) 25 | { 26 | call_function_for_object_type(baseObject, baseObject, op); 27 | } 28 | 29 | template 30 | struct call_function_for_object_type_functor 31 | { 32 | BaseType * _obj; 33 | Functor & _op; 34 | call_function_for_object_type_functor(BaseType * obj, Functor & op) : _obj(obj), _op(op) {} 35 | template 36 | bool operator()() 37 | { 38 | typedef typename object_info::object_type_info::object_caster object_caster; 39 | T * obj = object_caster::template cast(_obj); 40 | if(obj) { 41 | _op.decend(obj); 42 | call_function_for_object_type(_obj, obj, _op); 43 | _op.ascend(obj); 44 | } 45 | // continue with next type until we found one matching type 46 | return (obj == NULL); 47 | } 48 | }; 49 | } // namespace details 50 | } // namespace sgi 51 | -------------------------------------------------------------------------------- /include/sgi/details/caster: -------------------------------------------------------------------------------- 1 | // kate: syntax C++11; 2 | // SGI - Copyright (C) 2012-2015 FAST Protect, Andreas Roth 3 | 4 | #pragma once 5 | 6 | namespace sgi { 7 | 8 | struct StaticCaster 9 | { 10 | template 11 | static To* cast(From* obj) 12 | { 13 | return static_cast(obj); 14 | } 15 | template 16 | static const To* cast(const From* obj) 17 | { 18 | return static_cast(obj); 19 | } 20 | }; 21 | 22 | struct DynamicCaster 23 | { 24 | template 25 | static To* cast(From* obj) 26 | { 27 | return dynamic_cast(obj); 28 | } 29 | template 30 | static const To* cast(const From* obj) 31 | { 32 | return dynamic_cast(obj); 33 | } 34 | }; 35 | 36 | struct ReinterpretCaster 37 | { 38 | template 39 | static To* cast(From* obj) 40 | { 41 | return reinterpret_cast(obj); 42 | } 43 | template 44 | static const To* cast(const From* obj) 45 | { 46 | return reinterpret_cast(obj); 47 | } 48 | }; 49 | 50 | #ifdef QOBJECT_H 51 | struct QObjectCaster 52 | { 53 | template 54 | static To* cast(From* obj) 55 | { 56 | return qobject_cast(obj); 57 | } 58 | template 59 | static const To* cast(const From* obj) 60 | { 61 | return qobject_cast(obj); 62 | } 63 | }; 64 | #endif 65 | 66 | } // namespace sgi 67 | -------------------------------------------------------------------------------- /include/sgi/details/object_type_info: -------------------------------------------------------------------------------- 1 | // kate: syntax C++11; 2 | // SGI - Copyright (C) 2012-2015 FAST Protect, Andreas Roth 3 | 4 | #pragma once 5 | 6 | #include "type_list" 7 | #include "caster" 8 | 9 | namespace sgi { 10 | namespace details { 11 | template, typename OBJECT_CASTER=DynamicCaster > 12 | struct object_type_info_impl { 13 | typedef BASE base_type; 14 | typedef DERIVED derived_types; 15 | typedef OBJECT_CASTER object_caster; 16 | }; 17 | 18 | template > 19 | struct object_type_info_impl_with_caster { 20 | typedef BASE base_type; 21 | typedef DERIVED derived_types; 22 | typedef OBJECT_CASTER object_caster; 23 | }; 24 | 25 | } // namespace details 26 | 27 | namespace object_info { 28 | template 29 | struct object_type_info : public sgi::details::object_type_info_impl { }; 30 | } 31 | 32 | #define SGI_OBJECT_INFO_BEGIN(__type) \ 33 | namespace sgi { namespace object_info { \ 34 | template<> struct object_type_info<__type> : sgi::details::object_type_info_impl_with_caster<__type, sgi::DynamicCaster, \ 35 | sgi::details::type_list< 36 | #define SGI_OBJECT_INFO_BEGIN_EX(__type, __caster) \ 37 | namespace sgi { namespace object_info { \ 38 | template<> struct object_type_info<__type> : sgi::details::object_type_info_impl_with_caster<__type, __caster, \ 39 | sgi::details::type_list< 40 | 41 | #define SGI_OBJECT_INFO_END() \ 42 | > > {}; } } 43 | 44 | } // namespace sgi 45 | -------------------------------------------------------------------------------- /include/sgi/details/output: -------------------------------------------------------------------------------- 1 | // kate: syntax C++11; 2 | // SGI - Copyright (C) 2012-2015 FAST Protect, Andreas Roth 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | namespace sgi { 9 | namespace details { 10 | 11 | /// @class objectTypeTraverseOutput 12 | /// @brief helper class to be used as functor for @a call_function_for_object_type and outputs 13 | /// the progress of @a call_function_for_object_type 14 | class objectTypeTraverseOutput 15 | { 16 | public: 17 | objectTypeTraverseOutput(std::ostream & os) 18 | : _level(0), _os(os) 19 | { 20 | } 21 | template 22 | void ascend(T * object) 23 | { 24 | _level--; 25 | _os << "ascend level=" << _level << " for " << (void*)object << " " << typeid(T).name() << std::endl; 26 | } 27 | template 28 | void decend(T * object) 29 | { 30 | _level++; 31 | _os << "decend level=" << _level << " for " << (void*)object << " " << typeid(T).name() << std::endl; 32 | } 33 | template 34 | void accept(T * object) 35 | { 36 | _os << "accept level=" << _level << " for " << (void*)object << " " << typeid(T).name() << std::endl; 37 | } 38 | template 39 | bool canAccept(T * object) 40 | { 41 | return true; 42 | } 43 | bool wasAccepted() const 44 | { 45 | return false; 46 | } 47 | 48 | private: 49 | unsigned _level; 50 | std::ostream & _os; 51 | }; 52 | 53 | 54 | } // namespace details 55 | } // namespace sgi 56 | -------------------------------------------------------------------------------- /include/sgi/details/static_type_name: -------------------------------------------------------------------------------- 1 | // kate: mode C++; 2 | // SGI - Copyright (C) 2012-2015 FAST Protect, Andreas Roth 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | namespace sgi { 9 | namespace details { 10 | 11 | template 12 | class StaticTypeNameImpl 13 | { 14 | public: 15 | StaticTypeNameImpl() 16 | { 17 | #ifdef _MSC_VER 18 | const char * begin = __FUNCTION__; 19 | const size_t len = strlen(begin); 20 | #else 21 | const char * begin = strstr(__PRETTY_FUNCTION__, "TYPENAME_OF = "); 22 | begin += 14; 23 | const size_t len = strlen(begin) - 1; 24 | #endif 25 | name.assign(begin, len); 26 | } 27 | std::string name; 28 | }; 29 | 30 | template 31 | struct StaticTypeName 32 | { 33 | static const std::string & name() 34 | { 35 | static std::string name_of_this_type(StaticTypeNameImpl().name); 36 | return name_of_this_type; 37 | } 38 | }; 39 | 40 | } // namespace details 41 | } // namespace sgi 42 | -------------------------------------------------------------------------------- /include/sgi/helpers/html: -------------------------------------------------------------------------------- 1 | // kate: syntax C++11; 2 | #pragma once 3 | 4 | #include 5 | 6 | namespace sgi { 7 | namespace helpers { 8 | 9 | SGI_IMPL_EXPORT std::string html_encode(const std::string & str); 10 | 11 | class SGI_IMPL_EXPORT a_href 12 | { 13 | const std::string & _url; 14 | public: 15 | a_href(const std::string & url); 16 | void write(std::basic_ostream& os) const; 17 | }; 18 | 19 | SGI_IMPL_EXPORT std::basic_ostream& operator<<(std::basic_ostream& os, const a_href & link); 20 | 21 | } // namespace helpers 22 | } // namespace sgi 23 | -------------------------------------------------------------------------------- /include/sgi/helpers/meta_fwd.hpp: -------------------------------------------------------------------------------- 1 | /// \file meta_fwd.hpp Forward declarations 2 | // 3 | // Meta library 4 | // 5 | // Copyright Eric Niebler 2014-2015 6 | // 7 | // Use, modification and distribution is subject to the 8 | // Boost Software License, Version 1.0. (See accompanying 9 | // file LICENSE_1_0.txt or copy at 10 | // http://www.boost.org/LICENSE_1_0.txt) 11 | // 12 | // Project home: https://github.com/ericniebler/meta 13 | // 14 | 15 | #ifndef META_FWD_HPP 16 | #define META_FWD_HPP 17 | 18 | #include 19 | 20 | #ifndef META_DISABLE_DEPRECATED_WARNINGS 21 | #ifdef __cpp_attribute_deprecated 22 | #define META_DEPRECATED(MSG) [[deprecated(MSG)]] 23 | #else 24 | #if defined(__clang__) || defined(__GNUC__) 25 | #define META_DEPRECATED(MSG) __attribute__((deprecated(MSG))) 26 | #elif defined(_MSC_VER) 27 | #define META_DEPRECATED(MSG) __declspec(deprecated(MSG)) 28 | #else 29 | #define META_DEPRECATED(MSG) 30 | #endif 31 | #endif 32 | #else 33 | #define META_DEPRECATED(MSG) 34 | #endif 35 | 36 | namespace meta 37 | { 38 | inline namespace v1 39 | { 40 | #ifdef __cpp_lib_integer_sequence 41 | using std::integer_sequence; 42 | #else 43 | template 44 | struct integer_sequence; 45 | #endif 46 | 47 | template 48 | struct list; 49 | 50 | template 51 | struct id; 52 | 53 | template