Skip to content

Commit acc1bf5

Browse files
New NetworkNotes module!
1 parent 31175f1 commit acc1bf5

File tree

9 files changed

+252
-0
lines changed

9 files changed

+252
-0
lines changed

src/Interface/Modules/Factory/ModuleDialogFactory.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
#include <Interface/Modules/Math/ConvertMatrixTypeDialog.h>
4646
#include <Interface/Modules/Math/GetMatrixSliceDialog.h>
4747
#include <Interface/Modules/String/CreateStringDialog.h>
48+
#include <Interface/Modules/String/NetworkNotesDialog.h>
4849
#include <Interface/Modules/String/PrintDatatypeDialog.h>
4950
#include <Interface/Modules/Fields/CreateLatVolDialog.h>
5051
#include <Interface/Modules/Fields/GetDomainBoundaryDialog.h>
@@ -107,6 +108,7 @@ void ModuleDialogFactory::addDialogsToMakerMap1()
107108
ADD_MODULE_DIALOG(AppendMatrix, AppendMatrixDialog)
108109
ADD_MODULE_DIALOG(CreateMatrix, CreateMatrixDialog)
109110
ADD_MODULE_DIALOG(CreateString, CreateStringDialog)
111+
ADD_MODULE_DIALOG(NetworkNotes, NetworkNotesDialog)
110112
ADD_MODULE_DIALOG(PrintDatatype, PrintDatatypeDialog)
111113
ADD_MODULE_DIALOG(ReportMatrixInfo, ReportMatrixInfoDialog)
112114
ADD_MODULE_DIALOG(ReportFieldInfo, ReportFieldInfoDialog)

src/Interface/Modules/String/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,20 @@
3030
SET(Interface_Modules_String_FORMS
3131
CreateString.ui
3232
PrintDatatypeDialog.ui
33+
NetworkNotes.ui
3334
)
3435

3536
SET(Interface_Modules_String_HEADERS
3637
share.h
3738
CreateStringDialog.h
3839
PrintDatatypeDialog.h
40+
NetworkNotesDialog.h
3941
)
4042

4143
SET(Interface_Modules_String_SOURCES
4244
CreateStringDialog.cc
4345
PrintDatatypeDialog.cc
46+
NetworkNotesDialog.cc
4447
)
4548

4649
QT4_WRAP_UI(Interface_Modules_String_FORMS_HEADERS ${Interface_Modules_String_FORMS})
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>NetworkNotes</class>
4+
<widget class="QDialog" name="NetworkNotes">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>400</width>
10+
<height>300</height>
11+
</rect>
12+
</property>
13+
<property name="windowTitle">
14+
<string>Dialog</string>
15+
</property>
16+
<layout class="QHBoxLayout" name="horizontalLayout">
17+
<item>
18+
<widget class="QTextEdit" name="networkNotesTextEdit_"/>
19+
</item>
20+
</layout>
21+
</widget>
22+
<resources/>
23+
<connections/>
24+
</ui>
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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/String/NetworkNotesDialog.h>
30+
#include <Modules/String/NetworkNotes.h>
31+
32+
using namespace SCIRun::Gui;
33+
using namespace SCIRun::Dataflow::Networks;
34+
using namespace SCIRun::Modules::StringProcessing;
35+
36+
NetworkNotesDialog::NetworkNotesDialog(const std::string& name, ModuleStateHandle state,
37+
QWidget* parent /* = 0 */)
38+
: ModuleDialogGeneric(state, parent)
39+
{
40+
setupUi(this);
41+
setWindowTitle(QString::fromStdString(name));
42+
fixSize();
43+
44+
addTextEditManager(networkNotesTextEdit_, NetworkNotesModule::InputString);
45+
}
46+
47+
void NetworkNotesDialog::pull()
48+
{
49+
pull_newVersionToReplaceOld();
50+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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_NETWORK_NOTES_H
30+
#define INTERFACE_MODULES_NETWORK_NOTES_H
31+
32+
#include "Interface/Modules/String/ui_NetworkNotes.h"
33+
#include <Interface/Modules/Base/ModuleDialogGeneric.h>
34+
#include <Interface/Modules/String/share.h>
35+
36+
namespace SCIRun {
37+
namespace Gui {
38+
39+
class SCISHARE NetworkNotesDialog : public ModuleDialogGeneric,
40+
public Ui::NetworkNotes
41+
{
42+
Q_OBJECT
43+
44+
public:
45+
NetworkNotesDialog(const std::string& name,
46+
SCIRun::Dataflow::Networks::ModuleStateHandle state,
47+
QWidget* parent = 0);
48+
virtual void pull();
49+
};
50+
51+
}
52+
}
53+
54+
#endif

src/Modules/Factory/ModuleFactoryImpl1.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ DEALINGS IN THE SOFTWARE.
8080
#include <Modules/DataIO/ReadField.h>
8181
#include <Modules/DataIO/WriteField.h>
8282
#include <Modules/String/CreateString.h>
83+
#include <Modules/String/NetworkNotes.h>
8384
#include <Modules/Visualization/ShowString.h>
8485
#include <Modules/Visualization/ShowField.h>
8586
#include <Modules/Visualization/CreateBasicColorMap.h>
@@ -118,6 +119,7 @@ void ModuleDescriptionLookup::addEssentialModules()
118119
addModuleDesc<CreateMatrixModule>("CreateMatrix", "Math", "SCIRun", "Functional, needs GUI work.", "...");
119120
addModuleDesc<SolveLinearSystemModule>("SolveLinearSystem", "Math", "SCIRun", "Four multi-threaded algorithms available.", "...");
120121
addModuleDesc<CreateStringModule>("CreateString", "String", "SCIRun", "Functional, needs GUI work.", "...");
122+
addModuleDesc<NetworkNotesModule>("NetworkNotes", "String", "SCIRUN", "Functional, needs GUI work.", "...");
121123
//addModuleDesc<ShowStringModule>("ShowString", "String", "SCIRun", "...", "...");
122124
addModuleDesc<ShowFieldModule>("Some basic options available, still work in progress.", "...");
123125
addModuleDesc<CreateLatVol>("CreateLatVol", "NewField", "SCIRun", "Official ported v4 module.", "...");

src/Modules/String/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@
2828

2929
SET(Modules_String_SRCS
3030
CreateString.cc
31+
NetworkNotes.cc
3132
)
3233

3334
SET(Modules_String_HEADERS
3435
CreateString.h
36+
NetworkNotes.h
3537
share.h
3638
)
3739

src/Modules/String/NetworkNotes.cc

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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+
/// @todo Documentation Modules/String/CreateString.cc
30+
31+
#include <iostream>
32+
#include <Modules/String/NetworkNotes.h>
33+
#include <Core/Datatypes/String.h>
34+
35+
using namespace SCIRun::Modules::StringProcessing;
36+
using namespace SCIRun::Core::Datatypes;
37+
using namespace SCIRun::Dataflow::Networks;
38+
using namespace SCIRun::Core::Algorithms;
39+
40+
AlgorithmParameterName NetworkNotesModule::InputString("InputString");
41+
42+
NetworkNotesModule::NetworkNotesModule() : Module(ModuleLookupInfo("NetworkNotes", "String", "SCIRun"))
43+
{
44+
INITIALIZE_PORT(NewString);
45+
}
46+
47+
void NetworkNotesModule::setStateDefaults()
48+
{
49+
auto state = get_state();
50+
state->setValue(InputString, std::string());
51+
}
52+
53+
void NetworkNotesModule::execute()
54+
{
55+
stringValue_ = get_state()->getValue(InputString).toString();
56+
57+
sendOutput(NewString, boost::make_shared<String>(stringValue_));
58+
}

src/Modules/String/NetworkNotes.h

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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+
/// @todo Documentation Modules/String/CreatString.h
30+
31+
#ifndef MODULES_STRING_NETWORK_NOTES_H
32+
#define MODULES_STRING_NETWORK_NOTES_H
33+
34+
#include <Dataflow/Network/Module.h>
35+
#include <Modules/String/share.h>
36+
37+
namespace SCIRun {
38+
namespace Modules {
39+
namespace StringProcessing {
40+
41+
class SCISHARE NetworkNotesModule : public SCIRun::Dataflow::Networks::Module,
42+
public Has1OutputPort<StringPortTag>,
43+
public HasNoInputPorts
44+
{
45+
public:
46+
NetworkNotesModule();
47+
virtual void execute();
48+
virtual void setStateDefaults();
49+
OUTPUT_PORT(0, NewString, String);
50+
static Core::Algorithms::AlgorithmParameterName InputString;
51+
private:
52+
std::string stringValue_;
53+
};
54+
55+
}}}
56+
57+
#endif

0 commit comments

Comments
 (0)