Commit 8bec599b authored by Flavien BRIDAULT-LOUCHEZ's avatar Flavien BRIDAULT-LOUCHEZ
Browse files

fix(io): dicomXplorer crashes when display mesh preview

This MR fixes a crash upon selecting mesh in `dicomXplorer`.
The problem was simply that old configurations used in this software were deleted.

**It does not display the mesh in an activity.** It simply fixes the crash and re-enables the preview.

Closes #723
Merge branch '723-io-dicomxplorer-crahes-when-display-mesh-preview' into 'dev'
See merge request sight/sight!580
parents 1e0a6b6c ba444dc0
sight_add_target(activity_viz_3d TYPE MODULE)
add_dependencies(activity_viz_3d
module_activity
module_data
module_ui_base
module_ui_qt
module_memory
module_data
module_service
module_viz_scene3dQt
module_viz_scene3d
module_ui_icons
data
)
\ No newline at end of file
<extension implements="sight::service::extension::AppConfig">
<id>3DSimpleConfig</id>
<parameters>
<param name="WID_PARENT" />
<param name="objectID" />
</parameters>
<config>
<object uid="${objectID}" type="sight::data::ModelSeries" src="ref" />
<service uid="mainview" type="sight::module::ui::base::SView">
<gui>
<layout type="sight::ui::base::CardinalLayoutManager">
<view align="center" />
</layout>
</gui>
<registry>
<parent wid="${WID_PARENT}" />
<view sid="gs" start="true" />
</registry>
</service>
<!-- *************************** Begin generic scene *************************** -->
<service uid="gs" type="sight::viz::scene3d::SRender" >
<scene>
<background topColor="#36393E" bottomColor="#36393E" />
<layer id="default" order="1"/>
<adaptor uid="cameraInteractorAdaptor" />
<adaptor uid="modelAdaptor" />
</scene>
</service>
<service uid="cameraInteractorAdaptor" type="sight::module::viz::scene3d::adaptor::STrackballCamera" >
<config layer="default" priority="0" orientation="${orientation}" />
</service>
<service uid="modelAdaptor" type="sight::module::viz::scene3d::adaptor::SModelSeries" >
<in key="model" uid="${objectID}" autoConnect="true" />
<config layer="default" />
</service>
<!-- *************************** End generic scene *************************** -->
<start uid="mainview" />
<!-- gs adaptors -->
<start uid="cameraInteractorAdaptor" />
<start uid="modelAdaptor" />
</config>
</extension>
<plugin id="activity_viz_3d" >
<requirement id="sight::module::service" />
<requirement id="sight::module::ui::qt" />
<requirement id="sight::module::activity" />
<requirement id="sight::module::viz::scene3d" />
<requirement id="sight::module::viz::scene3dQt" />
<xi:include href="configurations/3DSimpleConfig.xml" xmlns:xi="http://www.w3.org/2003/XInclude" />
</plugin>
add_subdirectory(negato)
add_subdirectory(3d)
\ No newline at end of file
......@@ -31,7 +31,7 @@
<adaptor uid="interactor4Negato" />
<adaptor uid="seriesAdaptor" />
<adaptor uid="nameAdaptor" />
</scene>
</service>
......
......@@ -11,7 +11,7 @@
<xi:include href="configurations/2DNegatoWithTF.xml" xmlns:xi="http://www.w3.org/2003/XInclude" />
<xi:include href="configurations/2DSimpleConfig.xml" xmlns:xi="http://www.w3.org/2003/XInclude" />
<extension implements="::sight::activity::extension::Activity">
<extension implements="sight::activity::extension::Activity">
<id>2DVisualization</id>
<title>2D visualization</title>
<desc>Display a medical image in 2D.</desc>
......
......@@ -19,11 +19,12 @@ add_dependencies(dicomxplorer
activity_io_dicom
activity_io_dicomweb
activity_viz_negato
activity_viz_3d
module_ui_icons
atoms
module_ui_base
)
moduleParam(module_appXml PARAM_LIST config parameters PARAM_VALUES VRRenderBase VRRenderAppBase)
moduleParam(module_appXml PARAM_LIST config parameters PARAM_VALUES dicomXplorerBase dicomXplorerAppBase)
sight_generate_profile(dicomxplorer)
<extension implements="::sight::service::extension::AppConfig">
<id>VRRenderBase</id>
<id>dicomXplorerBase</id>
<parameters>
<param name="appName" />
<param name="appIconPath" />
......@@ -115,12 +115,12 @@
</service>
<service uid="action_about" type="sight::module::ui::qt::SShowAbout">
<filename id="VRRender-${appVersion}/about/about.html" />
<filename id="dicomxplorer/about/about.html" />
</service>
<service uid="dynamicView" type="sight::module::ui::qt::activity::SDynamicView">
<inout key="SERIESDB" uid="seriesDB" />
<mainActivity id="SDBVRRender" closable="false" />
<mainActivity id="SDBdicomXplorer" closable="false" />
<parameters>
<parameter replace="ICON_PATH" by="${appIconPath}" />
<parameter replace="DYNAMICVIEW_CHANNEL" by="dynamicViewChannel" />
......
<extension implements="::sight::service::extension::AppConfig">
<id>SDBVRRender</id>
<id>SDBdicomXplorer</id>
<parameters>
<param name="SERIESDB" />
<param name="WID_PARENT" />
......@@ -72,7 +72,7 @@
<config id="2DSimpleConfig" type="sight::data::ImageSeries">
<extract path="@image" pattern="imageID" />
</config>
<config id="3DSimpleConfig2" type="sight::data::ModelSeries" />
<config id="3DSimpleConfig" type="sight::data::ModelSeries"/>
</configs>
</service>
......@@ -82,14 +82,14 @@
<parameters>
<parameter replace="SERIESDB" by="${SERIESDB}" />
<parameter replace="ICON_PATH" by="${ICON_PATH}" />
<parameter replace="APP_NAME" by="VRRender" />
<parameter replace="APP_NAME" by="dicomXplorer" />
<parameter replace="PROGRESS_CHANNEL" by="${PROGRESS_CHANNEL}" />
</parameters>
<filter>
<mode>exclude</mode>
<id>ImageSeriesExport</id>
<id>ModelSeriesExport</id>
<id>SDBVRRender</id>
<id>SDBdicomXplorer</id>
</filter>
</config>
</service>
......@@ -108,13 +108,27 @@
</config>
</service>
<service uid="action_3DVisualization" type="sight::module::ui::qt::activity::SLauncher" autoConnect="true">
<in key="series" uid="selections" />
<config>
<parameters>
<parameter replace="SERIESDB" by="${SERIESDB}" />
<parameter replace="ICON_PATH" by="${ICON_PATH}" />
</parameters>
<filter>
<mode>include</mode>
<id>3DVisualization</id>
</filter>
</config>
</service>
<service uid="action_dicomPacsReader" type="sight::module::ui::qt::activity::SLauncher" autoConnect="true">
<in key="series" uid="selections" />
<config>
<parameters>
<parameter replace="SERIESDB" by="${SERIESDB}" />
<parameter replace="ICON_PATH" by="${ICON_PATH}" />
<parameter replace="APP_NAME" by="VRRender" />
<parameter replace="APP_NAME" by="dicomXplorer" />
</parameters>
<filter>
<mode>include</mode>
......@@ -128,7 +142,7 @@
<config>
<parameters>
<parameter replace="ICON_PATH" by="${ICON_PATH}" />
<parameter replace="APP_NAME" by="VRRender" />
<parameter replace="APP_NAME" by="dicomXplorer" />
<parameter replace="PROGRESS_CHANNEL" by="${PROGRESS_CHANNEL}" />
</parameters>
<filter>
......@@ -159,7 +173,7 @@
<parameters>
<parameter replace="SERIESDB" by="${SERIESDB}" />
<parameter replace="ICON_PATH" by="${ICON_PATH}" />
<parameter replace="APP_NAME" by="VRRender" />
<parameter replace="APP_NAME" by="dicomXplorer" />
</parameters>
<filter>
<mode>include</mode>
......@@ -173,7 +187,7 @@
<config>
<parameters>
<parameter replace="ICON_PATH" by="${ICON_PATH}" />
<parameter replace="APP_NAME" by="VRRender" />
<parameter replace="APP_NAME" by="dicomXplorer" />
<parameter replace="PROGRESS_CHANNEL" by="${PROGRESS_CHANNEL}" />
</parameters>
<filter>
......
......@@ -5,25 +5,25 @@
<requirement id="sight::module::activity" />
<requirement id="sight::module::ui::base" />
<xi:include href="configurations/VRRenderBase.xml" xmlns:xi="http://www.w3.org/2003/XInclude" />
<xi:include href="configurations/dicomXplorerBase.xml" xmlns:xi="http://www.w3.org/2003/XInclude" />
<xi:include href="configurations/sdb.xml" xmlns:xi="http://www.w3.org/2003/XInclude" />
<extension implements="::sight::service::extension::AppConfigParameters">
<id>VRRenderAppBase</id>
<id>dicomXplorerAppBase</id>
<parameters>
<param name="appName" value="DicomXplorer" />
<param name="appIconPath" value="dicomxplorer/vrrender.ico" />
<param name="appIconPath" value="dicomxplorer/dicomXplorer.ico" />
<param name="appVersion" value="@SIGHT_VERSION@" />
</parameters>
</extension>
<extension implements="::sight::activity::extension::Activity">
<id>SDBVRRender</id>
<id>SDBdicomXplorer</id>
<title>SDB</title>
<desc>Series Selector</desc>
<icon>sight::module::ui::icons/selector.svg</icon>
<requirements />
<appConfig id="SDBVRRender">
<appConfig id="SDBdicomXplorer">
<parameters />
</appConfig>
</extension>
......
......@@ -39,7 +39,7 @@ Example
<out key="object" uid="reconstruction" />
</service>
<service uid="organMaterialEditor" type="sight::module::ui::qt::reconstruction::OrganMaterialEditor" >
<service uid="organMaterialEditor" type="sight::module::ui::qt::reconstruction::SOrganMaterialEditor" >
<inout key="reconstruction" uid="reconstruction" />
</service>
......
......@@ -219,7 +219,7 @@ void ToolBarLayoutManager::createLayout(ui::base::container::fwToolBar::sptr par
menuItem->setQtMenuItem(action);
m_menuItems.push_back(menuItem);
SIGHT_ASSERT("No callback found for menu" << actionInfo.m_name, menuItemIndex < m_callbacks.size());
SIGHT_ASSERT("No callback found for menu: " << actionInfo.m_name, menuItemIndex < m_callbacks.size());
ui::base::IMenuItemCallback::sptr callback = m_callbacks.at(menuItemIndex);
ui::qt::ActionCallback::sptr qtCallback = ui::qt::ActionCallback::dynamicCast(callback);
......
......@@ -72,7 +72,12 @@ void Utils::loadResources()
::Ogre::ConfigFile cf;
::Ogre::String resourceGroupName, typeName, archName;
for(const auto& moduleName : s_moduleWithResourcesNames)
// Ensure we always load the resources of this library first, since other may reuse our programs or shaders
std::list<std::string> moduleWithResourcesNames;
std::copy(s_moduleWithResourcesNames.begin(), s_moduleWithResourcesNames.end(), moduleWithResourcesNames.begin());
moduleWithResourcesNames.push_front("sight::viz::scene3d");
for(const auto& moduleName : moduleWithResourcesNames)
{
try
{
......@@ -137,8 +142,6 @@ void Utils::addResourcesPath(const std::string& moduleName)
{
SIGHT_ASSERT("Empty resource path", !moduleName.empty());
// Pushing front is just because we "assume" that Sight resources path is going to be added last...
// and doing so we ensure it is going to be loaded first.
s_moduleWithResourcesNames.push_front(moduleName);
}
......@@ -236,8 +239,6 @@ void Utils::addResourcesPath(const std::string& moduleName)
root->initialise(false);
viz::scene3d::Utils::addResourcesPath("sight::viz::scene3d");
loadResources();
// Register factory for Text objects
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment