thank you Sascha,
so, summarizing what I have done so far:
Objective: add my own display interactor from a plugin (not in a module)
1) I have added the following files in my plugin folder:
Plugins\org.mitk.gui.qt.multilabelsegmentation\resources\Interactions\SegmentationInteraction.xml
Plugins\org.mitk.gui.qt.multilabelsegmentation\resources\Interactions\ConfigSegmentation.xml
2) I have added the following CMake code in files.cmake:
set(CPP_FILES)
usFunctionEmbedResources(CPP_FILES
LIBRARY_NAME "org_mitk_gui_qt_multilabelsegmentation"
ROOT_DIR resources
FILES Interactions/SegmentationInteraction.xml
Interactions/ConfigSegmentation.xml
)
3) The following code in my plugin's mitkPluginActivator:
#include <usModuleInitialization.h>
Q_EXPORT_PLUGIN2(org_mitk_gui_qt_multilabelsegmentation,
mitk::PluginActivator)
US_INITIALIZE_MODULE("Segmentation",
"org_mitk_gui_qt_multilabelsegmentation")
4) a method in my view:
void QmitkMultiLabelSegmentationView::InitializeListeners()
{
if (m_Interactor.IsNull())
{
us::ModuleContext* moduleContext = us::GetModuleContext();
m_Interactor = mitk::SegmentationInteractor::New();
m_Interactor->LoadStateMachine( "SegmentationInteraction.xml");
/// crashes here
m_Interactor->SetEventConfig ( "SegmentationConfig.xml");
us::GetModuleContext()->RegisterService<mitk::InteractionEventObserver>(
m_Interactor.GetPointer(), us::ServiceProperties() );
}
}
5) I will build in debug mode and see why it crashes there ...
more soon,
sebastian
On 04/12/2013 11:40 a.m., Sascha Zelzer wrote:
> On 12/04/2013 03:28 PM, Sebastian Ordas wrote:
>> Dear List,
>>
>> the following line of code :
>>
>> m_ServiceRegistration =
>> us::GetModuleContext()->RegisterService<mitk::InteractionEventObserver>(m_CurrentObserver.GetPointer(),
>>
>>
>> props);
>>
>> is giving me a link error as below:
>>
>> Error 1 error LNK2019: símbolo externo "class us::ModuleContext *
>> __cdecl us::GetModuleContext(void)"
>> (?GetModuleContext@us@@YAPEAVModuleContext@1@XZ) sin resolver al que se
>> hace referencia en la función "protected: void __cdecl
>> QmitkMultiLabelSegmentationView::InitializeListeners(void)"
>> (?InitializeListeners@QmitkMultiLabelSegmentationView@@IEAAXXZ)
>> D:\binX64\mitk\MITK-build\Plugins\org.mitk.gui.qt.multilabelsegmentation\QmitkMultiLabelSegmentationView.obj
>>
>>
>>
>> It looks like I'm missing some link dependency to CppMicroServices from
>> my plugin, right?
>>
>> Any hint is greatly welcome!
>>
>> regards
>> sebastian
>>
>
> Hi Sebastian,
>
> please read the "Add a new state machine" thread from the mailing list.
>
> Best,
> Sascha
------------------------------------------------------------------------------
Sponsored by Intel(R) XDK
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users