Skip to content

Commit 04e4b94

Browse files
committed
Dialog code--stubbed
1 parent 02856e8 commit 04e4b94

File tree

10 files changed

+480
-1
lines changed

10 files changed

+480
-1
lines changed

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

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

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
2+
#
3+
# For more information, please see: http://software.sci.utah.edu
4+
#
5+
# The MIT License
6+
#
7+
# Copyright (c) 2012 Scientific Computing and Imaging Institute,
8+
# University of Utah.
9+
#
10+
#
11+
# Permission is hereby granted, free of charge, to any person obtaining a
12+
# copy of this software and associated documentation files (the "Software"),
13+
# to deal in the Software without restriction, including without limitation
14+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
15+
# and/or sell copies of the Software, and to permit persons to whom the
16+
# Software is furnished to do so, subject to the following conditions:
17+
#
18+
# The above copyright notice and this permission notice shall be included
19+
# in all copies or substantial portions of the Software.
20+
#
21+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22+
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24+
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27+
# DEALINGS IN THE SOFTWARE.
28+
#
29+
30+
SET(Interface_Modules_Matlab_FORMS
31+
ImportDatatypesFromMatlab.ui
32+
)
33+
34+
SET(Interface_Modules_Matlab_HEADERS
35+
ImportDatatypesFromMatlabDialog.h
36+
share.h
37+
)
38+
39+
SET(Interface_Modules_Matlab_SOURCES
40+
ImportDatatypesFromMatlabDialog.cc
41+
)
42+
43+
QT4_WRAP_UI(Interface_Modules_Matlab_FORMS_HEADERS ${Interface_Modules_Matlab_FORMS})
44+
QT4_WRAP_CPP(Interface_Modules_Matlab_HEADERS_MOC ${Interface_Modules_Matlab_HEADERS})
45+
46+
SCIRUN_ADD_LIBRARY(Interface_Modules_Matlab
47+
${Interface_Modules_Matlab_HEADERS}
48+
${Interface_Modules_Matlab_FORMS_HEADERS}
49+
${Interface_Modules_Matlab_HEADERS_MOC}
50+
${Interface_Modules_Matlab_SOURCES}
51+
)
52+
53+
TARGET_LINK_LIBRARIES(Interface_Modules_Matlab
54+
#Algorithms_DataIO
55+
Modules_Legacy_Matlab_DataIO
56+
Interface_Modules_Base
57+
${SCI_BOOST_LIBRARY}
58+
${QT_LIBRARIES})
59+
60+
IF(BUILD_SHARED_LIBS)
61+
ADD_DEFINITIONS(-DBUILD_Interface_Modules_Matlab)
62+
ENDIF(BUILD_SHARED_LIBS)
63+
64+
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>ImportDatatypesFromMatlab</class>
4+
<widget class="QDialog" name="ImportDatatypesFromMatlab">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>418</width>
10+
<height>569</height>
11+
</rect>
12+
</property>
13+
<property name="minimumSize">
14+
<size>
15+
<width>418</width>
16+
<height>500</height>
17+
</size>
18+
</property>
19+
<property name="windowTitle">
20+
<string>ImportDatatypesFromMatlab</string>
21+
</property>
22+
<layout class="QVBoxLayout" name="verticalLayout">
23+
<item>
24+
<widget class="QGroupBox" name="groupBox">
25+
<property name="minimumSize">
26+
<size>
27+
<width>400</width>
28+
<height>80</height>
29+
</size>
30+
</property>
31+
<property name="title">
32+
<string>Choose .MAT file to read</string>
33+
</property>
34+
<widget class="QWidget" name="layoutWidget">
35+
<property name="geometry">
36+
<rect>
37+
<x>20</x>
38+
<y>30</y>
39+
<width>371</width>
40+
<height>41</height>
41+
</rect>
42+
</property>
43+
<layout class="QHBoxLayout" name="horizontalLayout">
44+
<item>
45+
<widget class="QLineEdit" name="fileNameLineEdit_">
46+
<property name="minimumSize">
47+
<size>
48+
<width>0</width>
49+
<height>22</height>
50+
</size>
51+
</property>
52+
<property name="dragEnabled">
53+
<bool>false</bool>
54+
</property>
55+
<property name="readOnly">
56+
<bool>false</bool>
57+
</property>
58+
</widget>
59+
</item>
60+
<item>
61+
<widget class="QPushButton" name="openFileButton_">
62+
<property name="text">
63+
<string>Open...</string>
64+
</property>
65+
<property name="checkable">
66+
<bool>false</bool>
67+
</property>
68+
</widget>
69+
</item>
70+
</layout>
71+
</widget>
72+
</widget>
73+
</item>
74+
<item>
75+
<widget class="QTableWidget" name="tableWidget">
76+
<column>
77+
<property name="text">
78+
<string>Name</string>
79+
</property>
80+
</column>
81+
<column>
82+
<property name="text">
83+
<string>Type</string>
84+
</property>
85+
</column>
86+
<column>
87+
<property name="text">
88+
<string>Port</string>
89+
</property>
90+
</column>
91+
</widget>
92+
</item>
93+
</layout>
94+
</widget>
95+
<resources/>
96+
<connections/>
97+
</ui>
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/*
2+
For more information, please see: http://software.sci.utah.edu
3+
4+
The MIT License
5+
6+
Copyright (c) 2012 Scientific Computing and Imaging Institute,
7+
University of Utah.
8+
9+
License for the specific language governing rights and limitations under
10+
Permission is hereby granted, free of charge, to any person obtaining a
11+
copy of this software and associated documentation files (the "Software"),
12+
to deal in the Software without restriction, including without limitation
13+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
14+
and/or sell copies of the Software, and to permit persons to whom the
15+
Software is furnished to do so, subject to the following conditions:
16+
17+
The above copyright notice and this permission notice shall be included
18+
in all copies or substantial portions of the Software.
19+
20+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26+
DEALINGS IN THE SOFTWARE.
27+
*/
28+
29+
#include <Interface/Modules/Matlab/ImportDatatypesFromMatlabDialog.h>
30+
// #include <Modules/DataIO/ReadField.h>
31+
// #include <Core/Algorithms/Base/AlgorithmVariableNames.h>
32+
// #include <Dataflow/Network/ModuleStateInterface.h> //TODO: extract into intermediate
33+
// #include <Core/ImportExport/GenericIEPlugin.h>
34+
// #include <iostream>
35+
// #include <boost/filesystem.hpp>
36+
// #include <QFileDialog>
37+
38+
using namespace SCIRun::Gui;
39+
using namespace SCIRun::Dataflow::Networks;
40+
using namespace SCIRun::Core::Algorithms;
41+
42+
ImportDatatypesFromMatlabDialog::ImportDatatypesFromMatlabDialog(const std::string& name, ModuleStateHandle state,
43+
QWidget* parent /* = 0 */)
44+
: ModuleDialogGeneric(state, parent)
45+
{
46+
setupUi(this);
47+
setWindowTitle(QString::fromStdString(name));
48+
fixSize();
49+
50+
//connect(openFileButton_, SIGNAL(clicked()), this, SLOT(openFile()));
51+
//connect(fileNameLineEdit_, SIGNAL(editingFinished()), this, SLOT(pushFileNameToState()));
52+
//connect(fileNameLineEdit_, SIGNAL(returnPressed()), this, SLOT(pushFileNameToState()));
53+
//buttonBox->setVisible(false);
54+
}
55+
56+
void ImportDatatypesFromMatlabDialog::pull()
57+
{
58+
//fileNameLineEdit_->setText(QString::fromStdString(state_->getValue(Variables::Filename).toString()));
59+
}
60+
61+
//void ReadFieldDialog::pushFileNameToState()
62+
//{
63+
// auto file = fileNameLineEdit_->text().trimmed().toStdString();
64+
// state_->setValue(Variables::Filename, file);
65+
//}
66+
//
67+
//void ReadFieldDialog::openFile()
68+
//{
69+
// auto types = Modules::DataIO::ReadFieldModule::fileTypeList();
70+
// QString selectedFilter;
71+
// auto file = QFileDialog::getOpenFileName(this, "Open Field File", dialogDirectory(), QString::fromStdString(types), &selectedFilter);
72+
// if (file.length() > 0)
73+
// {
74+
// auto typeName = SCIRun::fileTypeDescriptionFromDialogBoxFilter(selectedFilter.toStdString());
75+
// state_->setValue(Variables::FileTypeName, typeName);
76+
// fileNameLineEdit_->setText(file);
77+
// updateRecentFile(file);
78+
// pushFileNameToState();
79+
// }
80+
//}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
For more information, please see: http://software.sci.utah.edu
3+
4+
The MIT License
5+
6+
Copyright (c) 2012 Scientific Computing and Imaging Institute,
7+
University of Utah.
8+
9+
License for the specific language governing rights and limitations under
10+
Permission is hereby granted, free of charge, to any person obtaining a
11+
copy of this software and associated documentation files (the "Software"),
12+
to deal in the Software without restriction, including without limitation
13+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
14+
and/or sell copies of the Software, and to permit persons to whom the
15+
Software is furnished to do so, subject to the following conditions:
16+
17+
The above copyright notice and this permission notice shall be included
18+
in all copies or substantial portions of the Software.
19+
20+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26+
DEALINGS IN THE SOFTWARE.
27+
*/
28+
29+
#ifndef INTERFACE_MODULES_MATLAB_IMPORTDATATYPESFROMMATLABDIALOG_H
30+
#define INTERFACE_MODULES_MATLAB_IMPORTDATATYPESFROMMATLABDIALOG_H
31+
32+
#include "Interface/Modules/Matlab/ui_ImportDatatypesFromMatlab.h"
33+
#include <Interface/Modules/Base/ModuleDialogGeneric.h>
34+
#include <Interface/Modules/Base/RemembersFileDialogDirectory.h>
35+
#include <Interface/Modules/Matlab/share.h>
36+
37+
namespace SCIRun {
38+
namespace Gui {
39+
40+
class SCISHARE ImportDatatypesFromMatlabDialog : public ModuleDialogGeneric,
41+
public Ui::ImportDatatypesFromMatlab, public RemembersFileDialogDirectory
42+
{
43+
Q_OBJECT
44+
45+
public:
46+
ImportDatatypesFromMatlabDialog(const std::string& name,
47+
SCIRun::Dataflow::Networks::ModuleStateHandle state,
48+
QWidget* parent = 0);
49+
virtual void pull();
50+
51+
//private Q_SLOTS:
52+
// void pushFileNameToState();
53+
// void openFile();
54+
};
55+
56+
}
57+
}
58+
59+
#endif
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
For more information, please see: http://software.sci.utah.edu
3+
4+
The MIT License
5+
6+
Copyright (c) 2012 Scientific Computing and Imaging Institute,
7+
University of Utah.
8+
9+
10+
Permission is hereby granted, free of charge, to any person obtaining a
11+
copy of this software and associated documentation files (the "Software"),
12+
to deal in the Software without restriction, including without limitation
13+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
14+
and/or sell copies of the Software, and to permit persons to whom the
15+
Software is furnished to do so, subject to the following conditions:
16+
17+
The above copyright notice and this permission notice shall be included
18+
in all copies or substantial portions of the Software.
19+
20+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26+
DEALINGS IN THE SOFTWARE.
27+
*/
28+
29+
#undef SCISHARE
30+
31+
#if defined(_WIN32) && !defined(BUILD_SCIRUN_STATIC)
32+
#ifdef BUILD_Interface_Modules_Matlab
33+
#define SCISHARE __declspec(dllexport)
34+
#else
35+
#define SCISHARE __declspec(dllimport)
36+
#endif
37+
#else
38+
#define SCISHARE
39+
#endif

0 commit comments

Comments
 (0)