Skip to content

Commit 309f99f

Browse files
author
tpat
committed
Created base for Show and Edit Dipoles module
1 parent 9c9eb9f commit 309f99f

File tree

8 files changed

+404
-0
lines changed

8 files changed

+404
-0
lines changed

src/Interface/Modules/Visualization/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ SET(Interface_Modules_Visualization_FORMS
4040
ShowColorMap.ui
4141
RescaleColorMap.ui
4242
ShowFieldWithOspray.ui
43+
ShowAndEditDipoles.ui
4344
)
4445

4546
SET(Interface_Modules_Visualization_HEADERS
@@ -55,6 +56,7 @@ SET(Interface_Modules_Visualization_HEADERS
5556
ShowColorMapDialog.h
5657
RescaleColorMapDialog.h
5758
ShowFieldWithOsprayDialog.h
59+
ShowAndEditDipolesDialog.h
5860
)
5961

6062
SET(Interface_Modules_Visualization_SOURCES
@@ -69,6 +71,7 @@ SET(Interface_Modules_Visualization_SOURCES
6971
ShowColorMapDialog.cc
7072
RescaleColorMapDialog.cc
7173
ShowFieldWithOsprayDialog.cc
74+
ShowAndEditDipolesDialog.cc
7275
)
7376

7477
QT_WRAP_UI(Interface_Modules_Visualization_FORMS_HEADERS "${Interface_Modules_Visualization_FORMS}")
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>ShowAndEditDipoles</class>
4+
<widget class="QDialog" name="ShowAndEditDipoles">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>350</width>
10+
<height>210</height>
11+
</rect>
12+
</property>
13+
<property name="sizePolicy">
14+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
15+
<horstretch>0</horstretch>
16+
<verstretch>0</verstretch>
17+
</sizepolicy>
18+
</property>
19+
<property name="minimumSize">
20+
<size>
21+
<width>350</width>
22+
<height>210</height>
23+
</size>
24+
</property>
25+
<property name="maximumSize">
26+
<size>
27+
<width>16777215</width>
28+
<height>99999</height>
29+
</size>
30+
</property>
31+
<property name="windowTitle">
32+
<string/>
33+
</property>
34+
<layout class="QGridLayout" name="gridLayout">
35+
<item row="0" column="0">
36+
<layout class="QHBoxLayout" name="horizontalLayout">
37+
<item>
38+
<widget class="QLabel" name="label">
39+
<property name="text">
40+
<string>Widget Size:</string>
41+
</property>
42+
</widget>
43+
</item>
44+
<item>
45+
<widget class="QDoubleSpinBox" name="widgetSizeSpinBox">
46+
<property name="decimals">
47+
<number>6</number>
48+
</property>
49+
<property name="minimum">
50+
<double>-999999999.000000000000000</double>
51+
</property>
52+
<property name="maximum">
53+
<double>999999999.000000000000000</double>
54+
</property>
55+
</widget>
56+
</item>
57+
</layout>
58+
</item>
59+
<item row="2" column="0">
60+
<widget class="QGroupBox" name="autoGroupBox_">
61+
<property name="minimumSize">
62+
<size>
63+
<width>190</width>
64+
<height>75</height>
65+
</size>
66+
</property>
67+
<property name="title">
68+
<string/>
69+
</property>
70+
<property name="checkable">
71+
<bool>false</bool>
72+
</property>
73+
<layout class="QVBoxLayout" name="verticalLayout">
74+
<item>
75+
<widget class="QRadioButton" name="fixedSizeRadioButton">
76+
<property name="minimumSize">
77+
<size>
78+
<width>0</width>
79+
<height>15</height>
80+
</size>
81+
</property>
82+
<property name="text">
83+
<string>Fixed Size</string>
84+
</property>
85+
</widget>
86+
</item>
87+
<item>
88+
<widget class="QRadioButton" name="normalizeLargestRadioButton">
89+
<property name="minimumSize">
90+
<size>
91+
<width>0</width>
92+
<height>15</height>
93+
</size>
94+
</property>
95+
<property name="text">
96+
<string>Normalize Largest</string>
97+
</property>
98+
</widget>
99+
</item>
100+
<item>
101+
<widget class="QRadioButton" name="scaleSizeRadioButton">
102+
<property name="minimumSize">
103+
<size>
104+
<width>0</width>
105+
<height>15</height>
106+
</size>
107+
</property>
108+
<property name="text">
109+
<string>Scale Size</string>
110+
</property>
111+
</widget>
112+
</item>
113+
</layout>
114+
</widget>
115+
</item>
116+
<item row="3" column="0">
117+
<widget class="QGroupBox" name="groupBox">
118+
<property name="minimumSize">
119+
<size>
120+
<width>0</width>
121+
<height>60</height>
122+
</size>
123+
</property>
124+
<property name="title">
125+
<string/>
126+
</property>
127+
<layout class="QVBoxLayout" name="verticalLayout_3">
128+
<item>
129+
<widget class="QCheckBox" name="showLastAsVectorCheckBox">
130+
<property name="text">
131+
<string>Show Last As Vector</string>
132+
</property>
133+
</widget>
134+
</item>
135+
<item>
136+
<widget class="QCheckBox" name="showLinesCheckBox">
137+
<property name="text">
138+
<string>Show Lines</string>
139+
</property>
140+
</widget>
141+
</item>
142+
</layout>
143+
</widget>
144+
</item>
145+
</layout>
146+
</widget>
147+
<resources/>
148+
<connections/>
149+
</ui>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
For more information, please see: http://software.sci.utah.edu
3+
4+
The MIT License
5+
6+
Copyright (c) 2015 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/Visualization/ShowAndEditDipolesDialog.h>
30+
#include <Modules/Visualization/ShowAndEditDipoles.h>
31+
32+
using namespace SCIRun::Gui;
33+
using namespace SCIRun::Dataflow::Networks;
34+
35+
ShowAndEditDipolesDialog::ShowAndEditDipolesDialog(const std::string& name, ModuleStateHandle state,
36+
QWidget* parent /* = 0 */)
37+
: ModuleDialogGeneric(state, parent)
38+
{
39+
setupUi(this);
40+
setWindowTitle(QString::fromStdString(name));
41+
fixSize();
42+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
For more information, please see: http://software.sci.utah.edu
3+
4+
The MIT License
5+
6+
Copyright (c) 2015 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_SHOW_AND_EDIT_DIPOLES_H
30+
#define INTERFACE_MODULES_SHOW_AND_EDIT_DIPOLES_H
31+
32+
#include "Interface/Modules/Visualization/ui_ShowAndEditDipoles.h"
33+
#include <boost/shared_ptr.hpp>
34+
#include <Interface/Modules/Base/ModuleDialogGeneric.h>
35+
#include <Interface/Modules/Visualization/share.h>
36+
37+
namespace SCIRun {
38+
namespace Gui {
39+
40+
class SCISHARE ShowAndEditDipolesDialog : public ModuleDialogGeneric,
41+
public Ui::ShowAndEditDipoles
42+
{
43+
Q_OBJECT
44+
45+
public:
46+
ShowAndEditDipolesDialog(const std::string& name,
47+
SCIRun::Dataflow::Networks::ModuleStateHandle state,
48+
QWidget* parent = 0);
49+
};
50+
51+
}
52+
}
53+
54+
#endif // INTERFACE_MODULES_SHOW_AND_EDIT_DIPOLES_H
55+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"module": {
3+
"name": "ShowAndEditDipoles",
4+
"namespace": "Visualization",
5+
"status": "...",
6+
"description": "...",
7+
"header": "Modules/Visualization/ShowAndEditDipoles.h"
8+
},
9+
"algorithm": {
10+
"name": "N/A",
11+
"namespace": "N/A",
12+
"header": "N/A"
13+
},
14+
"UI": {
15+
"name": "ShowAndEditDipolesDialog",
16+
"header": "Interface/Modules/Visualization/ShowAndEditDipolesDialog.h"
17+
}
18+
}

src/Modules/Visualization/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ SET(Modules_Visualization_SRCS
3535
RescaleColorMap.cc
3636
TextBuilder.cc
3737
ShowFieldWithOspray.cc
38+
ShowAndEditDipoles.cc
3839
)
3940

4041
SET(Modules_Visualization_HEADERS
@@ -46,6 +47,7 @@ SET(Modules_Visualization_HEADERS
4647
RescaleColorMap.h
4748
TextBuilder.h
4849
ShowFieldWithOspray.h
50+
ShowAndEditDipoles.h
4951
share.h
5052
)
5153

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/*
2+
For more information, please see: http://software.sci.utah.edu
3+
4+
The MIT License
5+
6+
Copyright (c) 2015 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 <Core/Datatypes/Legacy/Field/Field.h>
30+
#include <Modules/Visualization/ShowAndEditDipoles.h>
31+
#include <Core/Datatypes/Legacy/Field/FieldInformation.h>
32+
33+
using namespace SCIRun;
34+
using namespace Modules::Visualization;
35+
using namespace Core;
36+
using namespace Core::Datatypes;
37+
using namespace Algorithms;
38+
39+
MODULE_INFO_DEF(ShowAndEditDipoles, Visualization, SCIRun)
40+
41+
ShowAndEditDipoles::ShowAndEditDipoles() : GeometryGeneratingModule(staticInfo_)
42+
{
43+
INITIALIZE_PORT(InputField);
44+
INITIALIZE_PORT(OutputField);
45+
INITIALIZE_PORT(OutputGeom);
46+
}
47+
48+
void ShowAndEditDipoles::execute()
49+
{
50+
auto field = getRequiredInput(InputField);
51+
if(needToExecute())
52+
{
53+
std::cout << "executing\n";
54+
FieldInformation finfo(field);
55+
if(!finfo.is_pointcloudmesh())
56+
{
57+
error("Input field was not a valid point cloud.");
58+
}
59+
}
60+
}
61+
62+
void ShowAndEditDipoles::setStateDefaults()
63+
{
64+
auto state = get_state();
65+
66+
state->setValue(Sizing, 0);
67+
state->setValue(ShowLastAsVector, false);
68+
state->setValue(ShowLines, false);
69+
}
70+
71+
const AlgorithmParameterName ShowAndEditDipoles::Sizing("Sizing");
72+
const AlgorithmParameterName ShowAndEditDipoles::ShowLastAsVector("ShowLastAsVector");
73+
const AlgorithmParameterName ShowAndEditDipoles::ShowLines("ShowLines");

0 commit comments

Comments
 (0)