Commit e0537316 authored by tgl's avatar tgl
Browse files

ENH results of merge with 6049:6469 from branches/tgl_loadable_modules. Adds...

ENH results of merge with 6049:6469 from branches/tgl_loadable_modules.  Adds GenerateLM to create entry points for loadable module support via a text file and CMake macro. WFEngine, NeuroNav, Qdec and GAD are setup, other modules have text files, but the macro in the CMakeLists file is commented out.  Updated Slicer3_main,  the modules above will only be loaded if the DLL is found at run-time.  Lastly made a change to vtkSlicerViewerWidget, check for a NULL ModelHierarchyLogic pointer before continuing, which might not be the right thing to do.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@6570 3bd1e089-480b-0410-8dfb-8563597acbee
parent 2a6ae5fe
......@@ -81,7 +81,6 @@ extern "C" {
//#define CLIMODULES_DEBUG
//#define TCLMODULES_DEBUG
//#define SLICES_DEBUG
//#define GAD_DEBUG
//#define MODELS_DEBUG
//#define VOLUMES_DEBUG
//#define QUERYATLAS_DEBUG
......@@ -91,19 +90,12 @@ extern "C" {
//#define EMSEG_DEBUG
#define REALTIMEIMAGING_DEBUG
#define MRABLATION_DEBUG
//#define NEURONAV_DEBUG
//#define TRACTOGRAPHY_DEBUG
//#define QDEC_DEBUG
//#define COMMANDLINE_DEBUG
//#define DEAMON_DEBUG
//#define REMOTEIO_DEBUG
// comment out next line to enable Loadable Modules support
#define LOADABLEMODULES_DEBUG
#if !defined(LOADABLEMODULES_DEBUG)
#include <LoadableModuleFactory.h>
#endif
#if !defined(TRACTOGRAPHY_DEBUG) && defined(BUILD_MODULES)
#include "vtkSlicerFiberBundleLogic.h"
......@@ -117,11 +109,6 @@ extern "C" {
#include "vtkEMSegmentMRMLManager.h"
#endif
#if !defined(GAD_DEBUG) && defined(BUILD_MODULES)
#include "vtkGradientAnisotropicDiffusionFilterLogic.h"
#include "vtkGradientAnisotropicDiffusionFilterGUI.h"
#endif
#if !defined(REALTIMEIMAGING_DEBUG) && defined(BUILD_MODULES)
#include "vtkRealTimeImagingLogic.h"
#include "vtkRealTimeImagingGUI.h"
......@@ -132,21 +119,6 @@ extern "C" {
#include "vtkMRAblationGUI.h"
#endif
#if !defined(NEURONAV_DEBUG) && defined(BUILD_MODULES)
#include "vtkNeuroNavLogic.h"
#include "vtkNeuroNavGUI.h"
#endif
#if !defined(WFENGINE_DEBUG) && defined(BUILD_MODULES)
#include "vtkWFEngineModuleLogic.h"
#include "vtkWFEngineModuleGUI.h"
#endif
#if !defined(QDEC_DEBUG) && defined(BUILD_MODULES)
#include "vtkQdecModuleLogic.h"
#include "vtkQdecModuleGUI.h"
#endif
#if !defined(TCLMODULES_DEBUG) && defined(BUILD_MODULES)
#include "vtkScriptedModuleLogic.h"
#include "vtkScriptedModuleGUI.h"
......@@ -219,21 +191,9 @@ extern "C" int Vtkteem_Init(Tcl_Interp *interp);
#if !defined(EMSEG_DEBUG) && defined(BUILD_MODULES)
extern "C" int Emsegment_Init(Tcl_Interp *interp);
#endif
#if !defined(NEURONAV_DEBUG) && defined(BUILD_MODULES)
extern "C" int Neuronav_Init(Tcl_Interp *interp);
#endif
#if !defined(REALTIMEIMAGING_DEBUG) && defined(BUILD_MODULES)
extern "C" int Realtimeimaging_Init(Tcl_Interp *interp);
#endif
#if !defined(WFENGINE_DEBUG) && defined(BUILD_MODULES)
extern "C" int Wfenginemodule_Init(Tcl_Interp *interp);
#endif
#if !defined(QDEC_DEBUG) && defined(BUILD_MODULES)
extern "C" int Qdecmodule_Init(Tcl_Interp *interp);
#endif
#if !defined(GAD_DEBUG) && defined(BUILD_MODULES)
extern "C" int Gradientanisotropicdiffusionfilter_Init(Tcl_Interp *interp);
#endif
#if !defined(TRACTOGRAPHY_DEBUG) && defined(BUILD_MODULES)
extern "C" int Slicertractographydisplay_Init(Tcl_Interp *interp);
extern "C" int Slicertractographyfiducialseeding_Init(Tcl_Interp *interp);
......@@ -720,32 +680,13 @@ int Slicer3_main(int argc, char *argv[])
Igt_Init(interp);
Vtkteem_Init(interp);
// if defined, then call explicitly, otherwise, loadable module support
// will handle these LM-compatible modules
#ifdef LOADABLEMODULES_DEBUG
#if !defined(GAD_DEBUG) && defined(BUILD_MODULES)
Gradientanisotropicdiffusionfilter_Init(interp);
#endif
#endif // LOADABLEMODULES_DEBUG
#if !defined(EMSEG_DEBUG) && defined(BUILD_MODULES)
Emsegment_Init(interp);
#endif
#if !defined(NEURONAV_DEBUG) && defined(BUILD_MODULES)
Neuronav_Init(interp);
#endif
#if !defined(REALTIMEIMAGING_DEBUG) && defined(BUILD_MODULES)
Realtimeimaging_Init(interp);
#endif
#if !defined(WFENGINE_DEBUG) && defined(BUILD_MODULES)
Wfenginemodule_Init(interp);
#endif
#if !defined(QDEC_DEBUG) && defined(BUILD_MODULES)
Qdecmodule_Init(interp);
#endif
#if !defined(VOLUMERENDERINGMODULE_DEBUG) && defined(BUILD_MODULES)
#if !defined(VOLUMERENDERINGMODULE_DEBUG) && defined(BUILD_MODULES)
Volumerenderingmodule_Init(interp);
//Also the replacements
Volumerenderingreplacements_Init(interp),
......@@ -1079,7 +1020,8 @@ int Slicer3_main(int argc, char *argv[])
// ------------------------------
// CREATE MODULE LOGICS & GUIS; add to GUI collection
// (presumably these will be auto-detected, not listed out as below...)
// (those modules not made using the LM library must
// must be listed individually, as below...)
// ---
// Note on vtkSlicerApplication's ModuleGUICollection:
// right now the vtkSlicerApplication's ModuleGUICollection
......@@ -1092,7 +1034,9 @@ int Slicer3_main(int argc, char *argv[])
// If we need to collect them at some point, we should define
// other collections in the vtkSlicerApplication class.
#if !defined(LOADABLEMODULES_DEBUG)
// LOADABLE MODULES
std::string slicerModulePath = slicerBinDir;
if (hasIntDir)
......@@ -1126,30 +1070,23 @@ int Slicer3_main(int argc, char *argv[])
slicerApp->SplashMessage(desc.GetMessage().c_str());
vtkSlicerModuleGUI* gui = desc.GetGUIPtr();
vtkSlicerModuleLogic* logic = desc.GetLogicPtr();
logic->SetAndObserveMRMLScene( scene );
logic->SetApplicationLogic( appLogic );
logic->SetMRMLScene( scene );
vtkSlicerModuleGUI* gui = desc.GetGUIPtr();
gui->SetModuleLogic ( logic );
gui->SetApplication( slicerApp );
gui->SetApplicationLogic( appLogic );
gui->SetApplicationGUI( appGUI );
gui->SetAndObserveApplicationLogic( appLogic );
gui->SetAndObserveMRMLScene( scene );
gui->SetModuleLogic ( logic );
gui->SetGUIName( desc.GetGUIName().c_str() );
gui->GetUIPanel()->SetName( gui->GetGUIName ( ) );
gui->GetUIPanel()->SetUserInterfaceManager( appGUI->GetMainSlicerWindow()->GetMainUserInterfaceManager ( ) );
gui->GetUIPanel()->Create( );
slicerApp->AddModuleGUI( gui );
gui->BuildGUI ( );
gui->AddGUIObservers ( );
// add the pointer to the viewer widget, for observing pick events
// gui->SetViewerWidget(appGUI->GetViewerWidget());
// gui->SetInteractorStyle(vtkSlicerViewerInteractorStyle::SafeDownCast(appGUI->GetViewerWidget()->GetMainViewer()->GetRenderWindowInteractor()->GetInteractorStyle()));
gui->Init();
// Initialize TCL
......@@ -1162,30 +1099,8 @@ int Slicer3_main(int argc, char *argv[])
lmit++;
}
#else
#if !defined(GAD_DEBUG) && defined(BUILD_MODULES)
// --- Gradient anisotropic diffusion filter module
slicerApp->SplashMessage("Initializing Gradient Anisotropic Module...");
vtkGradientAnisotropicDiffusionFilterGUI *gradientAnisotropicDiffusionFilterGUI = vtkGradientAnisotropicDiffusionFilterGUI::New ( );
vtkGradientAnisotropicDiffusionFilterLogic *gradientAnisotropicDiffusionFilterLogic = vtkGradientAnisotropicDiffusionFilterLogic::New ( );
gradientAnisotropicDiffusionFilterLogic->SetAndObserveMRMLScene ( scene );
gradientAnisotropicDiffusionFilterLogic->SetApplicationLogic ( appLogic );
// gradientAnisotropicDiffusionFilterLogic->SetMRMLScene(scene);
gradientAnisotropicDiffusionFilterGUI->SetLogic ( gradientAnisotropicDiffusionFilterLogic );
gradientAnisotropicDiffusionFilterGUI->SetApplication ( slicerApp );
gradientAnisotropicDiffusionFilterGUI->SetApplicationLogic ( appLogic );
gradientAnisotropicDiffusionFilterGUI->SetApplicationGUI ( appGUI );
gradientAnisotropicDiffusionFilterGUI->SetGUIName( "GradientAnisotropicDiffusionFilter" );
gradientAnisotropicDiffusionFilterGUI->GetUIPanel()->SetName ( gradientAnisotropicDiffusionFilterGUI->GetGUIName ( ) );
gradientAnisotropicDiffusionFilterGUI->GetUIPanel()->SetUserInterfaceManager (appGUI->GetMainSlicerWindow()->GetMainUserInterfaceManager ( ) );
gradientAnisotropicDiffusionFilterGUI->GetUIPanel()->Create ( );
slicerApp->AddModuleGUI ( gradientAnisotropicDiffusionFilterGUI );
gradientAnisotropicDiffusionFilterGUI->BuildGUI ( );
gradientAnisotropicDiffusionFilterGUI->AddGUIObservers ( );
#endif
#endif // LOADABLEMODULES_DEBUG
// ADD INDIVIDUAL MODULES
// (these require appGUI to be built):
......@@ -1209,6 +1124,7 @@ int Slicer3_main(int argc, char *argv[])
slicerApp->AddModuleGUI ( volumesGUI );
#endif
#ifndef MODELS_DEBUG
slicerApp->SplashMessage("Initializing Models Module...");
......@@ -1336,28 +1252,6 @@ int Slicer3_main(int argc, char *argv[])
ablationGUI->AddGUIObservers ( );
#endif
#if !defined(NEURONAV_DEBUG) && defined(BUILD_MODULES)
// -- NeuroNav module
vtkNeuroNavLogic *neuronavLogic = vtkNeuroNavLogic::New();
neuronavLogic->SetAndObserveMRMLScene ( scene );
vtkNeuroNavGUI *neuronavGUI = vtkNeuroNavGUI::New();
neuronavGUI->SetApplication ( slicerApp );
neuronavGUI->SetApplicationGUI ( appGUI );
neuronavGUI->SetAndObserveApplicationLogic ( appLogic );
neuronavGUI->SetAndObserveMRMLScene ( scene );
neuronavGUI->SetModuleLogic ( neuronavLogic );
neuronavGUI->SetGUIName( "NeuroNav" );
neuronavGUI->GetUIPanel()->SetName ( neuronavGUI->GetGUIName ( ) );
neuronavGUI->GetUIPanel()->SetUserInterfaceManager (appGUI->GetMainSlicerWindow()->GetMainUserInterfaceManager ( ) );
neuronavGUI->GetUIPanel()->Create ( );
slicerApp->AddModuleGUI ( neuronavGUI );
neuronavGUI->BuildGUI ( );
neuronavGUI->AddGUIObservers ( );
neuronavGUI->Init();
#endif
// --- Transforms module
slicerApp->SplashMessage("Initializing Transforms Module...");
......@@ -1589,51 +1483,6 @@ int Slicer3_main(int argc, char *argv[])
#endif
#if !defined(WFENGINE_DEBUG) && defined(BUILD_MODULES)
slicerApp->SplashMessage("Initializing WFEngine Module...");
//--- WFEngine Module
vtkWFEngineModuleGUI *wfEngineModuleGUI = vtkWFEngineModuleGUI::New ( );
vtkWFEngineModuleLogic *wfEngineModuleLogic = vtkWFEngineModuleLogic::New ( );
wfEngineModuleLogic->SetAndObserveMRMLScene ( scene );
wfEngineModuleLogic->SetApplicationLogic ( appLogic );
wfEngineModuleLogic->SetMRMLScene(scene);
wfEngineModuleGUI->SetAndObserveModuleLogic(wfEngineModuleLogic);
wfEngineModuleGUI->SetApplication ( slicerApp );
wfEngineModuleGUI->SetApplicationLogic ( appLogic );
wfEngineModuleGUI->SetApplicationGUI ( appGUI );
wfEngineModuleGUI->SetGUIName( "WFEngineModule" );
wfEngineModuleGUI->GetUIPanel()->SetName ( wfEngineModuleGUI->GetGUIName ( ) );
wfEngineModuleGUI->GetUIPanel()->SetUserInterfaceManager (appGUI->GetMainSlicerWindow()->GetMainUserInterfaceManager ( ) );
wfEngineModuleGUI->GetUIPanel()->Create ( );
slicerApp->AddModuleGUI ( wfEngineModuleGUI );
wfEngineModuleGUI->BuildGUI ( );
wfEngineModuleGUI->AddGUIObservers ( );
#endif
#if !defined(QDEC_DEBUG) && defined(BUILD_MODULES)
slicerApp->SplashMessage("Initializing Qdec Module...");
//--- QDEC Module
vtkQdecModuleGUI *qdecModuleGUI = vtkQdecModuleGUI::New ( );
vtkQdecModuleLogic *qdecModuleLogic = vtkQdecModuleLogic::New ( );
qdecModuleLogic->SetAndObserveMRMLScene ( scene );
qdecModuleLogic->SetApplicationLogic ( appLogic );
qdecModuleLogic->SetMRMLScene(scene);
qdecModuleGUI->SetAndObserveModuleLogic(qdecModuleLogic);
qdecModuleGUI->SetApplication ( slicerApp );
qdecModuleGUI->SetApplicationLogic ( appLogic );
qdecModuleGUI->SetApplicationGUI ( appGUI );
qdecModuleGUI->SetGUIName( "QdecModule" );
qdecModuleGUI->GetUIPanel()->SetName ( qdecModuleGUI->GetGUIName ( ) );
qdecModuleGUI->GetUIPanel()->SetUserInterfaceManager (appGUI->GetMainSlicerWindow()->GetMainUserInterfaceManager ( ) );
qdecModuleGUI->GetUIPanel()->Create ( );
slicerApp->AddModuleGUI ( qdecModuleGUI );
qdecModuleGUI->BuildGUI ( );
qdecModuleGUI->AddGUIObservers ( );
// add the pointer to the viewer widget, for observing pick events
qdecModuleGUI->SetViewerWidget(appGUI->GetViewerWidget());
qdecModuleGUI->SetInteractorStyle(vtkSlicerViewerInteractorStyle::SafeDownCast(appGUI->GetViewerWidget()->GetMainViewer()->GetRenderWindowInteractor()->GetInteractorStyle()));
#endif
#if !defined(VOLUMERENDERINGMODULE_DEBUG) && defined(BUILD_MODULES)
slicerApp->SplashMessage("Initializing Volume Rendering Module...");
......@@ -1815,6 +1664,7 @@ int Slicer3_main(int argc, char *argv[])
}
#endif // CLIMODULES_DEBUG
//
// get the Tcl name so the vtk class will be registered in the interpreter
// as a byproduct
......@@ -1828,7 +1678,6 @@ int Slicer3_main(int argc, char *argv[])
name = appGUI->GetTclName();
slicerApp->Script ("namespace eval slicer3 set ApplicationGUI %s", name);
#ifndef LOADABLEMODULES_DEBUG
lmit = loadableModuleNames.begin();
while (lmit != loadableModuleNames.end())
......@@ -1846,7 +1695,6 @@ int Slicer3_main(int argc, char *argv[])
lmit++;
}
#endif
#ifndef REMOTEIO_DEBUG
name = remoteIOGUI->GetTclName();
......@@ -1888,11 +1736,6 @@ int Slicer3_main(int argc, char *argv[])
slicerApp->Script ("namespace eval slicer3 set MRAblationGUI %s", name);
#endif
#if !defined(NEURONAV_DEBUG) && defined(BUILD_MODULES)
name = neuronavGUI->GetTclName();
slicerApp->Script ("namespace eval slicer3 set NeuroNavGUI %s", name);
#endif
name = transformsGUI->GetTclName();
slicerApp->Script ("namespace eval slicer3 set TransformsGUI %s", name);
#if !defined(QUERYATLAS_DEBUG) && defined(BUILD_MODULES)
......@@ -1902,16 +1745,6 @@ int Slicer3_main(int argc, char *argv[])
#endif
#if !defined(WFENGINE_DEBUG) && defined(BUILD_MODULES)
name = wfEngineModuleGUI->GetTclName();
slicerApp->Script ("namespace eval slicer3 set WFEngineModuleGUI %s", name);
#endif
#if !defined(QDEC_DEBUG) && defined(BUILD_MODULES)
name = qdecModuleGUI->GetTclName();
slicerApp->Script ("namespace eval slicer3 set QdecModuleGUI %s", name);
#endif
#if !defined (VOLUMERENDERINGMODULE_DEBUG) && defined (BUILD_MODULES)
name = vrModuleGUI->GetTclName();
slicerApp->Script ("namespace eval slicer3 set VRModuleGUI %s", name);
......@@ -1931,22 +1764,6 @@ int Slicer3_main(int argc, char *argv[])
// and then delete it at the end.
slicerApp->Script ("namespace eval slicer3 set Broker [vtkEventBroker New]");
#if !defined(QDEC_DEBUG) && defined(BUILD_MODULES)
if ( appGUI->GetViewerWidget() &&
appGUI->GetViewerWidget()->GetMainViewer() &&
appGUI->GetViewerWidget()->GetMainViewer()->GetRenderWindowInteractor() &&
appGUI->GetViewerWidget()->GetMainViewer()->GetRenderWindowInteractor()->GetInteractorStyle() )
{
// set up the qdec module with a pointer to the interactor style so it can get pick events
qdecModuleGUI->SetViewerWidget(appGUI->GetViewerWidget());
qdecModuleGUI->SetInteractorStyle(vtkSlicerViewerInteractorStyle::SafeDownCast(appGUI->GetViewerWidget()->GetMainViewer()->GetRenderWindowInteractor()->GetInteractorStyle()));
}
else
{
std::cerr << "Unable to set up the QDEC Module GUI with a pointer to the interactor style." << std::endl;
}
#endif
#if !defined(CLIMODULES_DEBUG) && defined(BUILD_MODULES)
mit = moduleNames.begin();
while ( mit != moduleNames.end() )
......@@ -2205,7 +2022,6 @@ int Slicer3_main(int argc, char *argv[])
// ------------------------------
// REMOVE OBSERVERS and references to MRML and Logic
#ifndef LOADABLEMODULES_DEBUG
lmit = loadableModuleNames.begin();
while (lmit != loadableModuleNames.end()) {
LoadableModuleDescription desc = loadableModuleFactory.GetModuleDescription(*lmit);
......@@ -2215,13 +2031,6 @@ int Slicer3_main(int argc, char *argv[])
lmit++;
}
#else
#if !defined(GAD_DEBUG) && defined(BUILD_MODULES)
gradientAnisotropicDiffusionFilterGUI->RemoveGUIObservers ( );
#endif
#endif// LOADABLEMODULES_DEBUG
#if !defined(TRACTOGRAPHY_DEBUG) && defined(BUILD_MODULES)
slicerTractographyDisplayGUI->RemoveGUIObservers ( );
......@@ -2260,22 +2069,10 @@ int Slicer3_main(int argc, char *argv[])
#if !defined(MRABLATION_DEBUG) && defined(BUILD_MODULES)
ablationGUI->TearDownGUI ( );
#endif
#if !defined(NEURONAV_DEBUG) && defined(BUILD_MODULES)
neuronavGUI->TearDownGUI ( );
#endif
#if !defined(WFENGINE_DEBUG) && defined(BUILD_MODULES)
wfEngineModuleGUI->TearDownGUI ( );
#endif
#if !defined(LABELSTATISTICS_DEBUG) && defined(BUILD_MODULES)
labelStatsGUI->RemoveGUIObservers ( );
labelStatsGUI->TearDownGUI ( );
#endif
#if !defined(QDEC_DEBUG) && defined(BUILD_MODULES)
qdecModuleGUI->TearDownGUI ( );
#endif
#if !defined(VOLUMERENDERINGMODULE_DEBUG) && defined(BUILD_MODULES)
vrModuleGUI->TearDownGUI ( );
#endif
......@@ -2381,7 +2178,6 @@ int Slicer3_main(int argc, char *argv[])
//--- delete gui first, removing Refs to Logic and MRML
#ifndef LOADABLEMODULES_DEBUG
lmit = loadableModuleNames.begin();
while (lmit != loadableModuleNames.end()) {
LoadableModuleDescription desc = loadableModuleFactory.GetModuleDescription(*lmit);
......@@ -2390,13 +2186,6 @@ int Slicer3_main(int argc, char *argv[])
lmit++;
}
#else
#if !defined(GAD_DEBUG) && defined(BUILD_MODULES)
gradientAnisotropicDiffusionFilterGUI->Delete ();
#endif
#endif// LOADABLEMODULES_DEBUG
#if !defined(TRACTOGRAPHY_DEBUG) && defined(BUILD_MODULES)
slicerTractographyDisplayGUI->Delete ();
......@@ -2433,22 +2222,9 @@ int Slicer3_main(int argc, char *argv[])
#if !defined(MRABLATION_DEBUG) && defined(BUILD_MODULES)
ablationGUI->Delete();
#endif
#if !defined(NEURONAV_DEBUG) && defined(BUILD_MODULES)
neuronavGUI->Delete();
#endif
#if !defined(WFENGINE_DEBUG) && defined(BUILD_MODULES)
wfEngineModuleGUI->Delete ( );
#endif
#if !defined(LABELSTATISTICS_DEBUG) && defined(BUILD_MODULES)
labelStatsGUI->Delete ( );
#endif
#if !defined(QDEC_DEBUG) && defined(BUILD_MODULES)
qdecModuleGUI->Delete ( );
#endif
#if !defined(VOLUMERENDERINGMODULE_DEBUG) && defined(BUILD_MODULES)
vrModuleGUI->Delete ( );
#endif
......@@ -2503,7 +2279,6 @@ int Slicer3_main(int argc, char *argv[])
//--- delete logic next, removing Refs to MRML
appLogic->ClearCollections ( );
#ifndef LOADABLEMODULES_DEBUG
lmit = loadableModuleNames.begin();
while (lmit != loadableModuleNames.end()) {
LoadableModuleDescription desc = loadableModuleFactory.GetModuleDescription(*lmit);
......@@ -2515,14 +2290,6 @@ int Slicer3_main(int argc, char *argv[])
lmit++;
}
#else
#if !defined(GAD_DEBUG) && defined(BUILD_MODULES)
gradientAnisotropicDiffusionFilterLogic->SetAndObserveMRMLScene ( NULL );
gradientAnisotropicDiffusionFilterLogic->Delete ();
#endif
#endif// LOADABLEMODULES_DEBUG
#if !defined(TRACTOGRAPHY_DEBUG) && defined(BUILD_MODULES)
slicerFiberBundleLogic->SetAndObserveMRMLScene ( NULL );
......@@ -2573,37 +2340,23 @@ int Slicer3_main(int argc, char *argv[])
ablationLogic->SetAndObserveMRMLScene ( NULL );
ablationLogic->Delete();
#endif
#if !defined(NEURONAV_DEBUG) && defined(BUILD_MODULES)
neuronavLogic->SetAndObserveMRMLScene ( NULL );
neuronavLogic->Delete();
#endif
#if !defined(WFENGINE_DEBUG) && defined(BUILD_MODULES)
wfEngineModuleLogic->SetAndObserveMRMLScene ( NULL );
wfEngineModuleLogic->Delete ( );
#endif
#if !defined(LABELSTATISTICS_DEBUG) && defined(BUILD_MODULES)
labelStatsLogic->SetAndObserveMRMLScene ( NULL );
labelStatsLogic->Delete ( );
#endif
#if !defined(QDEC_DEBUG) && defined(BUILD_MODULES)
qdecModuleLogic->SetAndObserveMRMLScene ( NULL );
qdecModuleLogic->Delete ( );
#endif
#if !defined(VOLUMERENDERINGMODULE_DEBUG) && defined(BUILD_MODULES)
#if !defined(VOLUMERENDERINGMODULE_DEBUG) && defined(BUILD_MODULES)
vrModuleLogic->SetAndObserveMRMLScene ( NULL );
vrModuleLogic->Delete ( );
#endif
#ifndef SLICES_DEBUG
sliceLogic2->SetAndObserveMRMLScene ( NULL );
sliceLogic2->Delete ();
sliceLogic1->SetAndObserveMRMLScene ( NULL );
sliceLogic1->Delete ();
sliceLogic0->SetAndObserveMRMLScene ( NULL );
sliceLogic0->Delete ();
#ifndef SLICES_DEBUG
#endif
appLogic->SetAndObserveMRMLScene ( NULL );
appLogic->TerminateProcessingThread();
......
......@@ -75,6 +75,10 @@ class VTK_SLICER_BASE_GUI_EXPORT vtkSlicerModuleGUI : public vtkSlicerComponentG
// Set the module logic
virtual void SetModuleLogic( vtkSlicerLogic *logic ) { };
//Description:
// Implemented module initialization if needed
virtual void Init() { };
// Description:
// Configures a module's help frame, with acknowledgment
// in a consistent manner
......
......@@ -1251,10 +1251,9 @@ void vtkSlicerViewerWidget::UpdateModelHierarchyVisibility(vtkMRMLModelHierarchy
//----------------------------
void vtkSlicerViewerWidget::UpdateModelHierarchyDisplay(vtkMRMLDisplayableNode *model)
{
if (model)
if (model && this->ModelHierarchyLogic)
{
vtkMRMLModelHierarchyNode* mhnode = this->ModelHierarchyLogic->GetModelHierarchyNode(model->GetID());
mhnode = this->ModelHierarchyLogic->GetModelHierarchyNode(model->GetID());
if (mhnode)
{
......
......@@ -226,10 +226,12 @@ endif(VTKsource_revision LESS 1.2196)
#
# These packages exist within the Slicer3 source tree
#
set(GenerateCLP_DIR ${Slicer3_BINARY_DIR}/Libs/GenerateCLP)
set(ModuleDescriptionParser_DIR ${Slicer3_BINARY_DIR}/Libs/ModuleDescriptionParser)
set(vtkITK_DIR ${Slicer3_BINARY_DIR}/Libs/vtkITK)
set(TCLAP_DIR ${Slicer3_BINARY_DIR}/Libs/tclap)
SET(GenerateCLP_DIR ${Slicer3_BINARY_DIR}/Libs/GenerateCLP)
SET(GenerateLM_DIR ${Slicer3_BINARY_DIR}/Libs/GenerateLM)
SET(ModuleDescriptionParser_DIR ${Slicer3_BINARY_DIR}/Libs/ModuleDescriptionParser)
SET(LoadableModule_DIR ${Slicer3_BINARY_DIR}/Libs/LoadableModule)
SET(vtkITK_DIR ${Slicer3_BINARY_DIR}/Libs/vtkITK)
SET(TCLAP_DIR ${Slicer3_BINARY_DIR}/Libs/tclap)
#
# Subdirectories
......
......@@ -20,6 +20,7 @@ SUBDIRS(
FreeSurfer
Qdec
MRML
GenerateLM
SlicerIO
ITKCommandIO
MRMLIDImageIO
......
PROJECT(GenerateLM)
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
FIND_PACKAGE(LoadableModule REQUIRED)
IF(LoadableModule_FOUND)
INCLUDE(${LoadableModule_USE_FILE})
ENDIF(LoadableModule_FOUND)
FIND_PACKAGE(TCLAP REQUIRED)
IF(TCLAP_FOUND)
INCLUDE(${TCLAP_USE_FILE})
ENDIF(TCLAP_FOUND)
FIND_PACKAGE(ITK REQUIRED)
IF(ITK_FOUND)
INCLUDE(${ITK_USE_FILE})
ENDIF(ITK_FOUND)
INCLUDE(UseGenerateLM.cmake)
INCLUDE(GenerateGenerateLMConfig.cmake)
# If we followed the standard pattern, UseGenerateLM.cmake would be
# a configured file
#
#CONFIGURE_FILE(${GenerateLM_SOURCE_DIR}/UseGenerateLM.cmake.in
# ${GenerateLM_BINARY_DIR}/UseGenerateLM.cmake
# COPYONLY IMMEDIATE)
SET (GENERATELM_SOURCE GenerateLM.cxx)
ADD_EXECUTABLE ( GenerateLM ${GENERATELM_SOURCE})
TARGET_LINK_LIBRARIES ( GenerateLM
LoadableModule
itksys
ITKEXPAT)
GENERATECLP(GENERATELM_SOURCE GenerateLM.xml)
INSTALL(TARGETS GenerateLM RUNTIME DESTINATION bin COMPONENT Development)
INSTALL(FILES ${GenerateLM_SOURCE_DIR}/UseGenerateLM.cmake
${GenerateLM_BINARY_DIR}/install/GenerateLMConfig.cmake
DESTINATION lib/GenerateLM
COMPONENT Development)
if (argc >= 2 && (strcmp(argv[1],"--xml") == 0))
{
std::cout << "<?xml version=\"1.0\" encoding=\"utf-8\"?>" << std::endl;
std::cout << "<executable>" << std::endl;
std::cout << " <category>utility</category>" << std::endl;
std::cout << " <title>NAMIC Command Line Processing Code Generator</title>" << std::endl;
std::cout << " <description>Generates C++ code that will parse command lines</description>" << std::endl;
std::cout << " <version>1.0</version>" << std::endl;
std::cout << " <documentation-url></documentation-url>" << std::endl;
std::cout << " <license></license>" << std::endl;
std::cout << " <contributor>Bill Lorensen</contributor>" << std::endl;
std::cout << "" << std::endl;
std::cout << " <parameters>" << std::endl;
std::cout << " <label>Parameters</label>" << std::endl;