Commit 68e975da authored by jcfr's avatar jcfr
Browse files

ENH: QtSlicer - Add directory structure (and corresponding CMake file)...

ENH: QtSlicer - Add directory structure (and corresponding CMake file) containing loadable Qt Modules.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@10807 3bd1e089-480b-0410-8dfb-8563597acbee
parent fc6325e2
......@@ -108,6 +108,9 @@ set(CMAKE_MODULE_PATH "${VTK_CMAKE_DIR}" ${CMAKE_MODULE_PATH} "${Slicer3_CMAKE_D
include("${Slicer3_CMAKE_DIR}/Slicer3PersistenceMacros.cmake")
# See http://www.cmake.org/Wiki/CMakeMacroParseArguments
include("${Slicer3_CMAKE_DIR}/Slicer3ParseArgumentsMacro.cmake")
## QT
INCLUDE(${Slicer3_CMAKE_DIR}/Slicer3FindQT.cmake)
......@@ -133,10 +136,12 @@ SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
slicer3_set_persistent_property(Slicer3_Libs_LIBRARIES "")
slicer3_set_persistent_property(Slicer3_Base_LIBRARIES "")
slicer3_set_persistent_property(Slicer3_Modules_LIBRARIES "")
slicer3_set_persistent_property(Slicer3_QTModules_LIBRARIES "")
slicer3_set_persistent_property(Slicer3_Libs_INCLUDE_DIRS "")
slicer3_set_persistent_property(Slicer3_Base_INCLUDE_DIRS "")
slicer3_set_persistent_property(Slicer3_Modules_INCLUDE_DIRS "")
slicer3_set_persistent_property(Slicer3_QTModules_INCLUDE_DIRS "")
#-----------------------------------------------------------------------------
# Add the testing directories
......@@ -191,29 +196,6 @@ include(${KWWidgets_USE_FILE})
#
SLICER3_SETUP_QT()
#SET(DESIRED_QT_VERSION 4)
# OPTION(Slicer3_USE_QT
# "Use Qt as an extra GUI library"
# OFF)
# IF(Slicer3_USE_QT)
# ## QT
# IF(VTK_USE_QVTK)
# #This find package should NOT be needed.
# FIND_PACKAGE(Qt4)
# IF(QT4_FOUND)
# SET(QT_USE_QTNETWORK ON)
# INCLUDE(${QT_USE_FILE})
# SET(Slicer3_USE_QT ON)
# ADD_DEFINITIONS(-DSlicer3_USE_QT)
# ELSE(QT4_FOUND)
# MESSAGE("Qt4 was not found on your system. You probably need to set the QT_QMAKE_EXECUTABLE variable")
# ENDIF(QT4_FOUND)
# ELSE(VTK_USE_QVTK)
# MESSAGE("VTK was not configured to use QT, no QT-based code will be compiled in Slicer")
# SET(Slicer3_USE_QT OFF)
# ENDIF(VTK_USE_QVTK)
# ENDIF(Slicer3_USE_QT)
## Teem
find_package(Teem REQUIRED)
if(NOT Teem_FOUND)
......@@ -371,6 +353,16 @@ else(Slicer3_BUILD_MODULES)
endif(Slicer3_BUILD_CLI)
endif(Slicer3_BUILD_MODULES)
#-----------------------------------------------------------------------------
# Qt Modules
#
IF(Slicer3_USE_QT)
OPTION(Slicer3_BUILD_QTMODULES "Build Slicer3 QT Modules" ON)
IF(Slicer3_BUILD_QTMODULES)
add_subdirectory(QTModules)
ENDIF(Slicer3_BUILD_QTMODULES)
ENDIF(Slicer3_USE_QT)
#-----------------------------------------------------------------------------
# Applications need to be built after Modules to capture the TractTracing in
# the correct ordering.
......
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
IF(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0003 NEW)
CMAKE_POLICY(SET CMP0012 NEW)
ENDIF(COMMAND CMAKE_POLICY)
PROJECT(QTModules)
IF(NOT Slicer3_SOURCE_DIR)
FIND_PACKAGE(Slicer3 REQUIRED)
INCLUDE(${Slicer3_USE_FILE})
slicer3_set_default_install_prefix_for_external_projects()
ENDIF(NOT Slicer3_SOURCE_DIR)
INCLUDE(${Slicer3_CMAKE_DIR}/Slicer3QTModuleMacros.cmake)
SUBDIRS(
#SlicerWelcome
Volumes
Measurements
)
# Module name (usually identique to the directory name)
SET(qSlicerModule_name "Measurements")
# Additional directories to include
SET(qSlicerModule_include_directories
#${CommandLineModule_SOURCE_DIR}
#${CommandLineModule_BINARY_DIR}
#${SlicerTractographyFiducialSeeding_SOURCE_DIR}
#${SlicerTractographyFiducialSeeding_BINARY_DIR}
#${SlicerTractographyDisplay_SOURCE_DIR}
#${SlicerTractographyDisplay_BINARY_DIR}
)
# Source files
SET(qSlicerModule_SRCS
qSlicerMeasurementsModule.h
qSlicerMeasurementsModule.cxx
)
# Headers that should run through moc
SET(qSlicerModule_MOC_SRCS
qSlicerMeasurementsModule.h
)
# UI files
SET(qSlicerModule_UI_SRCS
Resources/UI/qSlicerMeasurementsModule.ui
)
# Target libraries
SET(qSlicerModule_target_libraries ""
#${KWWidgets_LIBRARIES}
#${ITK_LIBRARIES}
#CommandLineModule
#SlicerTractographyDisplay
#SlicerTractographyFiducialSeeding
)
Slicer3_build_qtmodule(
NAME ${qSlicerModule_name}
INCLUDE_DIRECTORIES ${qSlicerModule_include_directories}
SRCS ${qSlicerModule_SRCS}
MOC_SRCS ${qSlicerModule_MOC_SRCS}
UI_SRCS ${qSlicerModule_UI_SRCS}
TARGET_LIBRARIES ${qSlicerModule_target_libraries}
NO_RESOURCES
)
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>qSlicerMeasurementsModule</class>
<widget class="QWidget" name="qSlicerMeasurementsModule">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>507</width>
<height>825</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="qCTKCollapsibleGroupBox" name="CTKCollapsibleGroupBox">
<property name="title">
<string>Ruler Widget</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>2</number>
</property>
<property name="margin">
<number>2</number>
</property>
<item>
<widget class="qCTKCollapsibleGroupBox" name="CTKCollapsibleGroupBox_4">
<property name="title">
<string>Modify All Ruler Nodes</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QComboBox" name="comboBox">
<item>
<property name="text">
<string>All Rulers Visible</string>
</property>
<property name="icon">
<iconset>
<normaloff>:/Icons/VisibleNoFrame.png</normaloff>:/Icons/VisibleNoFrame.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>All Rulers Invisible</string>
</property>
<property name="icon">
<iconset>
<normaloff>:/Icons/InvisibleNoFrame.png</normaloff>:/Icons/InvisibleNoFrame.png</iconset>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="qCTKCollapsibleGroupBox" name="CTKCollapsibleGroupBox_5">
<property name="title">
<string>Modify Selected Ruler Nodes</string>
</property>
<layout class="QFormLayout" name="formLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Ruler Node Select:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="qMRMLNodeSelector" name="MRMLNodeSelector">
<property name="NodeType">
<string>vtkMRMLRulerNode</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Ruler Visibility:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="checkBox">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Position 1:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="qCTKCoordinatesWidget" name="CTKCoordinatesWidget">
<property name="Dimension">
<number>3</number>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Position 2:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="qCTKCoordinatesWidget" name="CTKCoordinatesWidget_2"/>
</item>
<item row="4" column="0" colspan="2">
<widget class="qCTKCollapsibleGroupBox" name="CTKCollapsibleGroupBox_6">
<property name="title">
<string>Constrain Ruler To Models</string>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Select Ruler Model 1:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="qMRMLNodeSelector" name="MRMLNodeSelector_2">
<property name="NodeType">
<string>vtkMRMLModel</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Select Ruler Model 2:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="qMRMLNodeSelector" name="MRMLNodeSelector_3">
<property name="NodeType">
<string>vtkMRMLModel</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="qCTKCollapsibleGroupBox" name="CTKCollapsibleGroupBox_7">
<property name="title">
<string>Display Options</string>
</property>
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>End Point Color:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="pushButton">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Line Color:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="pushButton_2">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Distance Annotation Visibility:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="checkBox_2">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Distance Annotation Format:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="lineEdit"/>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Distance Annotation Scale:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="lineEdit_2"/>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="qCTKCollapsibleGroupBox" name="CTKCollapsibleGroupBox_2">
<property name="title">
<string>Angle Widget</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>223</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="checkBox_3">
<property name="text">
<string>Angle Widget Visibility</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="qCTKCollapsibleGroupBox" name="CTKCollapsibleGroupBox_3">
<property name="title">
<string>Transform Widget</string>
</property>
<layout class="QFormLayout" name="formLayout_4">
<item row="0" column="0">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>198</width>
<height>21</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="checkBox_4">
<property name="text">
<string>Transform Widget Visibility</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Select Data to Transform:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="qMRMLNodeSelector" name="MRMLNodeSelector_4"/>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>qCTKCollapsibleGroupBox</class>
<extends>QGroupBox</extends>
<header>qCTKCollapsibleGroupBox.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>qCTKCoordinatesWidget</class>
<extends>QWidget</extends>
<header>qCTKCoordinatesWidget.h</header>
</customwidget>
<customwidget>
<class>qMRMLNodeSelector</class>
<extends>QWidget</extends>
<header>qMRMLNodeSelector.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../qSlicerMeasurementsModule.qrc"/>
</resources>
<connections/>
</ui>
#include "qSlicerMeasurementsModule.h"
#include "ui_qSlicerMeasurementsModule.h"
#include <QDebug>
//-----------------------------------------------------------------------------
qSlicerGetModuleTitleDefinitionMacro(qSlicerMeasurementsModule, "Measurements");
//-----------------------------------------------------------------------------
class qSlicerMeasurementsModule::qInternal : public Ui::qSlicerMeasurementsModule
{
public:
qInternal()
{
}
};
//-----------------------------------------------------------------------------
qSlicerMeasurementsModule::qSlicerMeasurementsModule(QWidget *parent) : Superclass(parent)
{
this->Internal = new qInternal;
this->Internal->setupUi(this);
}
//-----------------------------------------------------------------------------
qSlicerMeasurementsModule::~qSlicerMeasurementsModule()
{
delete this->Internal;
}
//-----------------------------------------------------------------------------
void qSlicerMeasurementsModule::dumpObjectInfo()
{
this->Superclass::dumpObjectInfo();
}
#ifndef __qSlicerMeasurementsModule_h
#define __qSlicerMeasurementsModule_h
#include "qSlicerAbstractLoadableModule.h"
#include "qSlicerBaseGUIQTWin32Header.h"
class Q_SLICER_BASE_GUIQT_EXPORT qSlicerMeasurementsModule : public qSlicerAbstractLoadableModule
{
Q_OBJECT
public:
typedef qSlicerAbstractLoadableModule Superclass;
qSlicerMeasurementsModule(QWidget *parent=0);
virtual ~qSlicerMeasurementsModule();
virtual void dumpObjectInfo();
qSlicerGetModuleTitleDeclarationMacro();
private:
class qInternal;
qInternal* Internal;
};
#endif
# Module name (usually identique to the directory name)
SET(qSlicerModule_name "Volumes")
# Additional directories to include
SET(qSlicerModule_include_directories
#${CommandLineModule_SOURCE_DIR}
#${CommandLineModule_BINARY_DIR}
#${SlicerTractographyFiducialSeeding_SOURCE_DIR}
#${SlicerTractographyFiducialSeeding_BINARY_DIR}
#${SlicerTractographyDisplay_SOURCE_DIR}
#${SlicerTractographyDisplay_BINARY_DIR}
)
# Source files
SET(qSlicerModule_SRCS
qSlicerVolumesModule.h
qSlicerVolumesModule.cxx
)
# Headers that should run through moc
SET(qSlicerModule_MOC_SRCS
qSlicerVolumesModule.h
)
# UI files
SET(qSlicerModule_UI_SRCS
Resources/UI/qSlicerVolumesModule.ui
)
# Target libraries
SET(qSlicerModule_target_libraries
#${KWWidgets_LIBRARIES}
#${ITK_LIBRARIES}
#CommandLineModule
#SlicerTractographyDisplay
#SlicerTractographyFiducialSeeding
)
Slicer3_build_qtmodule(
NAME ${qSlicerModule_name}
INCLUDE_DIRECTORIES ${qSlicerModule_include_directories}
SRCS ${qSlicerModule_SRCS}
MOC_SRCS ${qSlicerModule_MOC_SRCS}
UI_SRCS ${qSlicerModule_UI_SRCS}
TARGET_LIBRARIES ${qSlicerModule_target_libraries}
NO_RESOURCES
)
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>qSlicerVolumesModule</class>
<widget class="QWidget" name="qSlicerVolumesModule">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>507</width>
<height>822</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>2</number>
</property>
<property name="margin">
<number>2</number>
</property>
<item>
<widget class="QGroupBox" name="groupBox">