Skip to content

Commit e51dbd7

Browse files
Merge branch 'master' of https://github.com/SCIInstitute/SCIRun into origin/CleaverFix
2 parents f6f51cd + 9fabc3b commit e51dbd7

29 files changed

+1930
-16
lines changed

src/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ IF(UNIX)
188188

189189
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_LANGUAGE_STANDARD_FLAG} -Wall")
190190
IF(NOT APPLE)
191-
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lrt")
191+
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-as-needed -ldl -lrt")
192192
ENDIF()
193193
ENDIF()
194194

@@ -609,6 +609,7 @@ SET_PROPERTY(TARGET Interface_Modules_Testing PROPERTY FOLDER "Interface/Modul
609609
SET_PROPERTY(TARGET Interface_Modules_String PROPERTY FOLDER "Interface/Modules")
610610
SET_PROPERTY(TARGET Interface_Modules_Fields PROPERTY FOLDER "Interface/Modules")
611611
SET_PROPERTY(TARGET Interface_Modules_Bundle PROPERTY FOLDER "Interface/Modules")
612+
SET_PROPERTY(TARGET Interface_Modules_Matlab PROPERTY FOLDER "Interface/Modules")
612613
SET_PROPERTY(TARGET Interface_Modules_Factory PROPERTY FOLDER "Interface/Modules")
613614
SET_PROPERTY(TARGET Interface_Application PROPERTY FOLDER "Interface/Application")
614615

@@ -625,6 +626,7 @@ SET_PROPERTY(TARGET Modules_Visualization PROPERTY FOLDER "Modules/Visualizati
625626
SET_PROPERTY(TARGET Modules_BrainStimulator PROPERTY FOLDER "Modules/Brain")
626627
SET_PROPERTY(TARGET Modules_Legacy_FiniteElements PROPERTY FOLDER "Modules/FiniteElements")
627628
SET_PROPERTY(TARGET Modules_Legacy_Fields PROPERTY FOLDER "Modules/Fields")
629+
SET_PROPERTY(TARGET Modules_Legacy_Matlab_DataIO PROPERTY FOLDER "Modules/DataIO")
628630
SET_PROPERTY(TARGET Modules_Factory PROPERTY FOLDER "Modules")
629631

630632
IF(BUILD_TESTING)
@@ -678,6 +680,7 @@ IF(BUILD_TESTING)
678680
SET_PROPERTY(TARGET Modules_Render_Tests PROPERTY FOLDER "Modules/Render")
679681
SET_PROPERTY(TARGET Modules_String_Tests PROPERTY FOLDER "Modules/String")
680682
SET_PROPERTY(TARGET Modules_Visualization_Tests PROPERTY FOLDER "Modules/Visualization")
683+
SET_PROPERTY(TARGET Modules_Legacy_Matlab_DataIO_Tests PROPERTY FOLDER "Modules/DataIO")
681684
ENDIF()
682685

683686
SET_PROPERTY(TARGET Boost_external PROPERTY FOLDER "Externals")

src/ExampleNets/regression/readNrrdField.srn5

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
<name>Filename</name>
143143
<value>
144144
<which>2</which>
145-
<value>%SCIRUNDATADIR%/Fields/fieldOut.nhdr</value>
145+
<value>%SCIRUNDATADIR%/Fields/nrrd/fieldOut.nhdr</value>
146146
</value>
147147
</second>
148148
</item>
@@ -324,8 +324,8 @@
324324
<item>
325325
<first>ReadField:5</first>
326326
<second>
327-
<first>-1976</first>
328-
<second>-760</second>
327+
<first>-1977</first>
328+
<second>-761</second>
329329
</second>
330330
</item>
331331
<item>

src/Interface/Application/MainWindowCollaborators.cc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
using namespace SCIRun::Gui;
3535
using namespace SCIRun::Core::Logging;
3636

37-
void TextEditAppender::log(const QString& message) const
37+
void TextEditAppender::log(const QString& message) const
3838
{
3939
text_->append(message);
4040
}
@@ -90,7 +90,11 @@ namespace
9090
template <typename T>
9191
void operator()( T* widget ) const
9292
{
93-
widget->setDisabled(flag_);
93+
//TODO: investigate this Mac Qt bug in more detail. A better workaround probably exists. (Or just wait until Qt 5)
94+
#ifndef MACOS
95+
if (widget)
96+
widget->setDisabled(flag_);
97+
#endif
9498
}
9599
bool flag_;
96100
};
@@ -101,7 +105,7 @@ namespace
101105
}
102106
}
103107

104-
void WidgetDisablingService::addNetworkEditor(NetworkEditor* ne)
108+
void WidgetDisablingService::addNetworkEditor(NetworkEditor* ne)
105109
{
106110
ne_ = ne;
107111
}
@@ -121,4 +125,4 @@ void WidgetDisablingService::enableInputWidgets()
121125
{
122126
ne_->enableInputWidgets();
123127
setWidgetsDisableFlag(inputWidgets_, false);
124-
}
128+
}

src/Interface/Application/ModuleWidget.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,11 +635,13 @@ void ModuleWidget::updateBackgroundColor(const QString& color)
635635
void ModuleWidget::setColorSelected()
636636
{
637637
updateBackgroundColor(moduleRGBA(0,255,255));
638+
Q_EMIT moduleSelected(true);
638639
}
639640

640641
void ModuleWidget::setColorUnselected()
641642
{
642643
updateBackgroundColor(defaultBackgroundColor_);
644+
Q_EMIT moduleSelected(false);
643645
}
644646

645647
boost::shared_ptr<ModuleDialogFactory> ModuleWidget::dialogFactory_;
@@ -658,9 +660,11 @@ void ModuleWidget::makeOptionsDialog()
658660
addWidgetToExecutionDisableList(dialog_->getExecuteAction());
659661
connect(dialog_, SIGNAL(executeActionTriggered()), this, SLOT(executeButtonPushed()));
660662
connect(this, SIGNAL(moduleExecuted()), dialog_, SLOT(moduleExecuted()));
663+
connect(this, SIGNAL(moduleSelected(bool)), dialog_, SLOT(moduleSelected(bool)));
661664
dockable_ = new QDockWidget(QString::fromStdString(moduleId_), 0);
662665
dockable_->setObjectName(dialog_->windowTitle());
663666
dockable_->setWidget(dialog_);
667+
dialog_->setDockable(dockable_);
664668
dockable_->setMinimumSize(dialog_->minimumSize());
665669
dockable_->setAllowedAreas(Qt::RightDockWidgetArea);
666670
dockable_->setAutoFillBackground(true);

src/Interface/Application/ModuleWidget.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ class OutputPortWidget;
5555
class PositionProvider;
5656
class NetworkEditor;
5757
class PortWidgetManager;
58-
class DialogErrorControl;
58+
class DialogErrorControl;
5959

60-
class ModuleWidget : public QFrame,
60+
class ModuleWidget : public QFrame,
6161
public SCIRun::Dataflow::Networks::ExecutableObject, public Ui::Module, public HasNotes
6262
{
6363
Q_OBJECT
64-
64+
6565
public:
6666
ModuleWidget(NetworkEditor* ed, const QString& name, SCIRun::Dataflow::Networks::ModuleHandle theModule, boost::shared_ptr<DialogErrorControl> dialogErrorControl,
6767
QWidget* parent = 0);
@@ -82,7 +82,7 @@ class ModuleWidget : public QFrame,
8282
//TODO: initialize in a new class
8383
static boost::shared_ptr<class ConnectionFactory> connectionFactory_;
8484
static boost::shared_ptr<class ClosestPortFinder> closestPortFinder_;
85-
85+
8686
void setColorSelected();
8787
void setColorUnselected();
8888

@@ -131,6 +131,7 @@ public Q_SLOTS:
131131
void dynamicPortChanged();
132132
void noteChanged();
133133
void moduleStateUpdated(int state);
134+
void moduleSelected(bool selected);
134135
private Q_SLOTS:
135136
void updateBackgroundColorForModuleState(int moduleState);
136137
void updateBackgroundColor(const QString& color);
@@ -157,7 +158,7 @@ private Q_SLOTS:
157158
boost::scoped_ptr<class ModuleActionsMenu> actionsMenu_;
158159

159160
static boost::shared_ptr<class ModuleDialogFactory> dialogFactory_;
160-
boost::shared_ptr<DialogErrorControl> dialogErrorControl_;
161+
boost::shared_ptr<DialogErrorControl> dialogErrorControl_;
161162

162163
void addPortLayouts();
163164
void addInputPortsToLayout();

src/Interface/Modules/Base/ModuleDialogGeneric.cc

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ using namespace SCIRun::Core::Algorithms;
3838
ModuleDialogGeneric::ModuleDialogGeneric(SCIRun::Dataflow::Networks::ModuleStateHandle state, QWidget* parent) : QDialog(parent),
3939
state_(state),
4040
pulling_(false),
41-
executeAction_(0)
41+
executeAction_(0),
42+
dock_(0)
4243
{
4344
setModal(false);
4445

@@ -56,6 +57,13 @@ ModuleDialogGeneric::~ModuleDialogGeneric()
5657
{
5758
}
5859

60+
void ModuleDialogGeneric::updateWindowTitle(const QString& title)
61+
{
62+
setWindowTitle(title);
63+
if (dock_)
64+
dock_->setWindowTitle(title);
65+
}
66+
5967
void ModuleDialogGeneric::fixSize()
6068
{
6169
if (minimumWidth() > 0 && minimumHeight() > 0)
@@ -74,7 +82,7 @@ void ModuleDialogGeneric::createExecuteAction()
7482
connect(executeAction_, SIGNAL(triggered()), this, SIGNAL(executeActionTriggered()));
7583
}
7684

77-
void ModuleDialogGeneric::contextMenuEvent(QContextMenuEvent* e)
85+
void ModuleDialogGeneric::contextMenuEvent(QContextMenuEvent* e)
7886
{
7987
QMenu menu(this);
8088
menu.addAction(executeAction_);
@@ -95,6 +103,21 @@ void ModuleDialogGeneric::pull_newVersionToReplaceOld()
95103
wsm->pull();
96104
}
97105

106+
void ModuleDialogGeneric::moduleSelected(bool selected)
107+
{
108+
if (selected)
109+
{
110+
windowTitle_ = windowTitle();
111+
updateWindowTitle("* " + windowTitle_ + " *");
112+
//setWindowOpacity(0.5);
113+
}
114+
else
115+
{
116+
updateWindowTitle(windowTitle_);
117+
//setWindowOpacity(1);
118+
}
119+
}
120+
98121
class ComboBoxSlotManager : public WidgetSlotManager
99122
{
100123
public:

src/Interface/Modules/Base/ModuleDialogGeneric.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ namespace Gui {
5050
virtual ~ModuleDialogGeneric();
5151
bool isPulling() const { return pulling_; } //yuck
5252
QAction* getExecuteAction() { return executeAction_; }
53+
void setDockable(QDockWidget* dock) { dock_ = dock; } // to enable title changes
54+
void updateWindowTitle(const QString& title);
5355

5456
//TODO: input state hookup?
5557
//yeah: eventually replace int with generic dialog state object, but needs to be two-way (set/get)
@@ -60,6 +62,7 @@ namespace Gui {
6062
//need a better name: read/updateUI
6163
virtual void pull() = 0;
6264
void pull_newVersionToReplaceOld();
65+
void moduleSelected(bool selected);
6366
Q_SIGNALS:
6467
void pullSignal();
6568
void executionTimeChanged(int time);
@@ -95,6 +98,8 @@ namespace Gui {
9598
std::vector<WidgetSlotManagerPtr> slotManagers_;
9699
boost::signals2::connection stateConnection_;
97100
QAction* executeAction_;
101+
QString windowTitle_;
102+
QDockWidget* dock_;
98103
};
99104

100105
}

src/Interface/Modules/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,5 @@ ADD_SUBDIRECTORY(String)
3838
ADD_SUBDIRECTORY(Testing)
3939
ADD_SUBDIRECTORY(Visualization)
4040
ADD_SUBDIRECTORY(BrainStimulator)
41-
ADD_SUBDIRECTORY(Bundle)
41+
ADD_SUBDIRECTORY(Bundle)
42+
ADD_SUBDIRECTORY(Matlab)

src/Interface/Modules/Factory/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ TARGET_LINK_LIBRARIES(Interface_Modules_Factory
5757
Interface_Modules_BrainStimulator
5858
Interface_Modules_Render
5959
Interface_Modules_String
60+
Interface_Modules_Matlab
6061
Interface_Modules_Testing
6162
Interface_Modules_Visualization
6263
${SCI_BOOST_LIBRARY}

src/Interface/Modules/Factory/ModuleDialogFactory.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
#include <Interface/Modules/Visualization/ShowStringDialog.h>
7272
#include <Interface/Modules/Visualization/ShowFieldDialog.h>
7373
#include <Interface/Modules/Visualization/CreateBasicColorMapDialog.h>
74+
#include <Interface/Modules/Matlab/ImportDatatypesFromMatlabDialog.h>
7475
#include <Interface/Modules/Render/ViewScene.h>
7576
#include <Interface/Modules/Bundle/InsertFieldsIntoBundleDialog.h>
7677
#include <Interface/Modules/Bundle/GetFieldsFromBundleDialog.h>
@@ -141,6 +142,7 @@ void ModuleDialogFactory::addDialogsToMakerMap1()
141142
ADD_MODULE_DIALOG(MapFieldDataFromSourceToDestination, MapFieldDataFromSourceToDestinationDialog)
142143
ADD_MODULE_DIALOG(SplitFieldByConnectedRegion, SplitFieldByConnectedRegionDialog)
143144
ADD_MODULE_DIALOG(ClipFieldByFunction, ClipFieldByFunctionDialog)
145+
ADD_MODULE_DIALOG(ImportDatatypesFromMatlab, ImportDatatypesFromMatlabDialog)
144146
;
145147
}
146148

0 commit comments

Comments
 (0)