Skip to content

Commit 0dfbeee

Browse files
committed
Merge pull request #809 from benjaminlarson/benColorMap
Ben color map--GUI and module skeleton for #669
2 parents 23a9083 + d28cd5d commit 0dfbeee

File tree

11 files changed

+831
-7
lines changed

11 files changed

+831
-7
lines changed

src/Interface/Modules/Factory/ModuleDialogFactory.cc

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
#include <Interface/Modules/Visualization/ShowStringDialog.h>
8989
#include <Interface/Modules/Visualization/ShowFieldDialog.h>
9090
#include <Interface/Modules/Visualization/CreateBasicColorMapDialog.h>
91+
#include <Interface/Modules/Visualization/ShowColorMapDialog.h>
9192
#include <Interface/Modules/Matlab/ImportDatatypesFromMatlabDialog.h>
9293
#include <Interface/Modules/Render/ViewScene.h>
9394
#include <Interface/Modules/Bundle/InsertFieldsIntoBundleDialog.h>
@@ -172,15 +173,16 @@ void ModuleDialogFactory::addDialogsToMakerMap1()
172173
ADD_MODULE_DIALOG(SplitFieldByConnectedRegion, SplitFieldByConnectedRegionDialog)
173174
ADD_MODULE_DIALOG(ClipFieldByFunction, ClipFieldByFunctionDialog)
174175
ADD_MODULE_DIALOG(ImportDatatypesFromMatlab, ImportDatatypesFromMatlabDialog)
175-
ADD_MODULE_DIALOG(RefineMesh, RefineMeshDialog)
176+
ADD_MODULE_DIALOG(RefineMesh, RefineMeshDialog)
176177
ADD_MODULE_DIALOG(SetFieldDataToConstantValue, SetFieldDataToConstantValueDialog)
177-
ADD_MODULE_DIALOG(ConvertFieldBasis, ConvertFieldBasisDialog)
178-
ADD_MODULE_DIALOG(BuildNoiseColumnMatrix,BuildNoiseColumnMatrixDialog)
179-
ADD_MODULE_DIALOG(SwapFieldDataWithMatrixEntries, SwapFieldDataWithMatrixEntriesDialog)
180-
ADD_MODULE_DIALOG(BuildMappingMatrix, BuildMappingMatrixDialog)
181-
ADD_MODULE_DIALOG(EditMeshBoundingBox, EditMeshBoundingBoxDialog)
182-
ADD_MODULE_DIALOG(ConvertIndicesToFieldData, ConvertIndicesToFieldDataDialog)
178+
ADD_MODULE_DIALOG(ConvertFieldBasis, ConvertFieldBasisDialog)
179+
ADD_MODULE_DIALOG(BuildNoiseColumnMatrix,BuildNoiseColumnMatrixDialog)
180+
ADD_MODULE_DIALOG(SwapFieldDataWithMatrixEntries, SwapFieldDataWithMatrixEntriesDialog)
181+
ADD_MODULE_DIALOG(BuildMappingMatrix, BuildMappingMatrixDialog)
182+
ADD_MODULE_DIALOG(EditMeshBoundingBox, EditMeshBoundingBoxDialog)
183+
ADD_MODULE_DIALOG(ConvertIndicesToFieldData, ConvertIndicesToFieldDataDialog)
183184
ADD_MODULE_DIALOG(SolveInverseProblemWithTikhonov, SolveInverseProblemWithTikhonovDialog)
185+
ADD_MODULE_DIALOG(ShowColorMap, ShowColorMapDialog)
184186
;
185187
}
186188

src/Interface/Modules/Visualization/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ SET(Interface_Modules_Visualization_FORMS
3232
MatrixAsVectorField.ui
3333
ShowField.ui
3434
ShowString.ui
35+
ShowColorMap.ui
3536
)
3637

3738
SET(Interface_Modules_Visualization_HEADERS
@@ -40,13 +41,15 @@ SET(Interface_Modules_Visualization_HEADERS
4041
share.h
4142
ShowFieldDialog.h
4243
ShowStringDialog.h
44+
ShowColorMapDialog.h
4345
)
4446

4547
SET(Interface_Modules_Visualization_SOURCES
4648
CreateBasicColorMapDialog.cc
4749
MatrixAsVectorFieldDialog.cc
4850
ShowFieldDialog.cc
4951
ShowStringDialog.cc
52+
ShowColorMapDialog.cc
5053
)
5154

5255
QT4_WRAP_UI(Interface_Modules_Visualization_FORMS_HEADERS ${Interface_Modules_Visualization_FORMS})
Lines changed: 272 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,272 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>ShowColorMap</class>
4+
<widget class="QDialog" name="ShowColorMap">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>289</width>
10+
<height>340</height>
11+
</rect>
12+
</property>
13+
<property name="minimumSize">
14+
<size>
15+
<width>289</width>
16+
<height>340</height>
17+
</size>
18+
</property>
19+
<property name="windowTitle">
20+
<string>Dialog</string>
21+
</property>
22+
<layout class="QVBoxLayout" name="verticalLayout_13">
23+
<item>
24+
<layout class="QVBoxLayout" name="verticalLayout_12">
25+
<item>
26+
<widget class="QGroupBox" name="groupBox">
27+
<property name="title">
28+
<string>Display Side:</string>
29+
</property>
30+
<layout class="QVBoxLayout" name="verticalLayout">
31+
<item>
32+
<layout class="QHBoxLayout" name="horizontalLayout">
33+
<item>
34+
<widget class="QRadioButton" name="leftRadioButton_">
35+
<property name="text">
36+
<string>Left</string>
37+
</property>
38+
<property name="checked">
39+
<bool>true</bool>
40+
</property>
41+
</widget>
42+
</item>
43+
<item>
44+
<widget class="QRadioButton" name="bottomRadioButton_">
45+
<property name="text">
46+
<string>Bottom</string>
47+
</property>
48+
</widget>
49+
</item>
50+
</layout>
51+
</item>
52+
</layout>
53+
</widget>
54+
</item>
55+
<item>
56+
<widget class="QGroupBox" name="groupBox_2">
57+
<property name="title">
58+
<string>Display Length</string>
59+
</property>
60+
<layout class="QVBoxLayout" name="verticalLayout_2">
61+
<item>
62+
<layout class="QHBoxLayout" name="horizontalLayout_2">
63+
<item>
64+
<widget class="QRadioButton" name="fullRadioButton_">
65+
<property name="text">
66+
<string>Full</string>
67+
</property>
68+
</widget>
69+
</item>
70+
<item>
71+
<widget class="QRadioButton" name="firstHalfRadioButton_">
72+
<property name="text">
73+
<string>First Half</string>
74+
</property>
75+
<property name="checked">
76+
<bool>false</bool>
77+
</property>
78+
</widget>
79+
</item>
80+
<item>
81+
<widget class="QRadioButton" name="secondHalfRadioButton_">
82+
<property name="text">
83+
<string>Second Half</string>
84+
</property>
85+
<property name="checked">
86+
<bool>true</bool>
87+
</property>
88+
</widget>
89+
</item>
90+
</layout>
91+
</item>
92+
</layout>
93+
</widget>
94+
</item>
95+
<item>
96+
<widget class="QGroupBox" name="groupBox_3">
97+
<property name="title">
98+
<string>Text Size: </string>
99+
</property>
100+
<layout class="QVBoxLayout" name="verticalLayout_3">
101+
<item>
102+
<layout class="QHBoxLayout" name="horizontalLayout_3">
103+
<item>
104+
<widget class="QRadioButton" name="TRadioButton_">
105+
<property name="text">
106+
<string>T</string>
107+
</property>
108+
</widget>
109+
</item>
110+
<item>
111+
<widget class="QRadioButton" name="SRadioButton_">
112+
<property name="text">
113+
<string>S</string>
114+
</property>
115+
</widget>
116+
</item>
117+
<item>
118+
<widget class="QRadioButton" name="MRadioButton_">
119+
<property name="text">
120+
<string>M</string>
121+
</property>
122+
<property name="checked">
123+
<bool>true</bool>
124+
</property>
125+
</widget>
126+
</item>
127+
<item>
128+
<widget class="QRadioButton" name="LRadioButton_">
129+
<property name="text">
130+
<string>L</string>
131+
</property>
132+
</widget>
133+
</item>
134+
<item>
135+
<widget class="QRadioButton" name="XLRadioButton_">
136+
<property name="text">
137+
<string>XL</string>
138+
</property>
139+
</widget>
140+
</item>
141+
</layout>
142+
</item>
143+
<item>
144+
<layout class="QHBoxLayout" name="horizontalLayout_4" stretch="1,1,1">
145+
<item>
146+
<widget class="QPushButton" name="textColorPushButton_">
147+
<property name="text">
148+
<string>Text Color</string>
149+
</property>
150+
</widget>
151+
</item>
152+
<item>
153+
<widget class="QLabel" name="textColorDisplayLabel_">
154+
<property name="text">
155+
<string/>
156+
</property>
157+
</widget>
158+
</item>
159+
<item>
160+
<spacer name="horizontalSpacer">
161+
<property name="orientation">
162+
<enum>Qt::Horizontal</enum>
163+
</property>
164+
<property name="sizeHint" stdset="0">
165+
<size>
166+
<width>40</width>
167+
<height>20</height>
168+
</size>
169+
</property>
170+
</spacer>
171+
</item>
172+
</layout>
173+
</item>
174+
</layout>
175+
</widget>
176+
</item>
177+
<item>
178+
<widget class="QGroupBox" name="groupBox_4">
179+
<property name="title">
180+
<string/>
181+
</property>
182+
<layout class="QVBoxLayout" name="verticalLayout_5">
183+
<item>
184+
<layout class="QVBoxLayout" name="verticalLayout_4">
185+
<item>
186+
<layout class="QHBoxLayout" name="horizontalLayout_5">
187+
<item>
188+
<widget class="QLabel" name="label">
189+
<property name="text">
190+
<string>Labels</string>
191+
</property>
192+
</widget>
193+
</item>
194+
<item>
195+
<widget class="QLineEdit" name="labelsLineEdit_">
196+
<property name="text">
197+
<string>5</string>
198+
</property>
199+
</widget>
200+
</item>
201+
<item>
202+
<widget class="QLabel" name="label_3">
203+
<property name="text">
204+
<string>Scale</string>
205+
</property>
206+
</widget>
207+
</item>
208+
<item>
209+
<widget class="QLineEdit" name="scaleLineEdit_">
210+
<property name="text">
211+
<string>1.0</string>
212+
</property>
213+
</widget>
214+
</item>
215+
</layout>
216+
</item>
217+
<item>
218+
<layout class="QHBoxLayout" name="horizontalLayout_6">
219+
<item>
220+
<widget class="QLabel" name="label_2">
221+
<property name="text">
222+
<string>Units</string>
223+
</property>
224+
</widget>
225+
</item>
226+
<item>
227+
<widget class="QLineEdit" name="unitsLineEdit_"/>
228+
</item>
229+
<item>
230+
<widget class="QLabel" name="label_4">
231+
<property name="text">
232+
<string>Significant Digits</string>
233+
</property>
234+
</widget>
235+
</item>
236+
<item>
237+
<widget class="QLineEdit" name="sigDigitsLineEdit_">
238+
<property name="text">
239+
<string>2</string>
240+
</property>
241+
</widget>
242+
</item>
243+
</layout>
244+
</item>
245+
</layout>
246+
</item>
247+
</layout>
248+
</widget>
249+
</item>
250+
<item>
251+
<widget class="QGroupBox" name="groupBox_5">
252+
<property name="title">
253+
<string/>
254+
</property>
255+
<layout class="QVBoxLayout" name="verticalLayout_6">
256+
<item>
257+
<widget class="QCheckBox" name="addExtraSpaceCheckBox_">
258+
<property name="text">
259+
<string>Add Extra Space</string>
260+
</property>
261+
</widget>
262+
</item>
263+
</layout>
264+
</widget>
265+
</item>
266+
</layout>
267+
</item>
268+
</layout>
269+
</widget>
270+
<resources/>
271+
<connections/>
272+
</ui>
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+
#include <Interface/Modules/Visualization/ShowColorMapDialog.h>
30+
#include <Modules/Visualization/ShowColorMapModule.h>
31+
//#include <Core/Algorithms/Base/AlgorithmVariableNames.h>
32+
#include <Dataflow/Network/ModuleStateInterface.h>
33+
34+
using namespace SCIRun::Gui;
35+
using namespace SCIRun::Dataflow::Networks;
36+
using namespace SCIRun::Core::Datatypes;
37+
using namespace SCIRun::Modules::Visualization;
38+
39+
ShowColorMapDialog::ShowColorMapDialog(const std::string& name, ModuleStateHandle state,
40+
QWidget* parent /* = 0 */)
41+
: ModuleDialogGeneric(state, parent)
42+
{
43+
setupUi(this);
44+
setWindowTitle(QString::fromStdString(name));
45+
fixSize();
46+
addRadioButtonGroupManager({ leftRadioButton_, bottomRadioButton_ }, ShowColorMapModule::DisplaySide);
47+
addRadioButtonGroupManager({ firstHalfRadioButton_, fullRadioButton_, secondHalfRadioButton_ }, ShowColorMapModule::DisplayLength);
48+
addRadioButtonGroupManager({ LRadioButton_, MRadioButton_, SRadioButton_, TRadioButton_, XLRadioButton_ }, ShowColorMapModule::TextSize);
49+
addLineEditManager(labelsLineEdit_, ShowColorMapModule::Labels);
50+
addLineEditManager(scaleLineEdit_, ShowColorMapModule::Scale);
51+
addLineEditManager(unitsLineEdit_, ShowColorMapModule::Units);
52+
addLineEditManager(sigDigitsLineEdit_, ShowColorMapModule::SignificantDigits);
53+
addCheckBoxManager(addExtraSpaceCheckBox_, ShowColorMapModule::AddExtraSpace);
54+
}
55+
56+
void ShowColorMapDialog::pull()
57+
{
58+
pull_newVersionToReplaceOld();
59+
}

0 commit comments

Comments
 (0)