Skip to content

Commit e6d258c

Browse files
author
tpat
committed
added module and ui
1 parent 309f99f commit e6d258c

File tree

4 files changed

+41
-14
lines changed

4 files changed

+41
-14
lines changed

src/Interface/Modules/Visualization/ShowAndEditDipoles.ui

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
</property>
7373
<layout class="QVBoxLayout" name="verticalLayout">
7474
<item>
75-
<widget class="QRadioButton" name="fixedSizeRadioButton">
75+
<widget class="QRadioButton" name="fixedSizeRButton">
7676
<property name="minimumSize">
7777
<size>
7878
<width>0</width>
@@ -85,7 +85,7 @@
8585
</widget>
8686
</item>
8787
<item>
88-
<widget class="QRadioButton" name="normalizeLargestRadioButton">
88+
<widget class="QRadioButton" name="normalizeLargestRButton">
8989
<property name="minimumSize">
9090
<size>
9191
<width>0</width>
@@ -98,7 +98,7 @@
9898
</widget>
9999
</item>
100100
<item>
101-
<widget class="QRadioButton" name="scaleSizeRadioButton">
101+
<widget class="QRadioButton" name="scaleSizeRButton">
102102
<property name="minimumSize">
103103
<size>
104104
<width>0</width>

src/Interface/Modules/Visualization/ShowAndEditDipolesDialog.cc

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

2929
#include <Interface/Modules/Visualization/ShowAndEditDipolesDialog.h>
3030
#include <Modules/Visualization/ShowAndEditDipoles.h>
31+
#include <Dataflow/Network/ModuleStateInterface.h>
3132

3233
using namespace SCIRun::Gui;
3334
using namespace SCIRun::Dataflow::Networks;
35+
using namespace SCIRun::Modules::Visualization;
36+
using namespace SCIRun::Core::Datatypes;
37+
38+
using SAED = SCIRun::Modules::Visualization::ShowAndEditDipoles;
3439

3540
ShowAndEditDipolesDialog::ShowAndEditDipolesDialog(const std::string& name, ModuleStateHandle state,
3641
QWidget* parent /* = 0 */)
@@ -39,4 +44,9 @@ ShowAndEditDipolesDialog::ShowAndEditDipolesDialog(const std::string& name, Modu
3944
setupUi(this);
4045
setWindowTitle(QString::fromStdString(name));
4146
fixSize();
47+
48+
std::cout << "dialog managers\n";
49+
addCheckBoxManager(showLastAsVectorCheckBox, SAED::ShowLastAsVector);
50+
addRadioButtonGroupManager({fixedSizeRButton, normalizeLargestRButton, scaleSizeRButton}, SAED::Sizing);
51+
addCheckBoxManager(showLinesCheckBox, SAED::ShowLines);
4252
}

src/Modules/Visualization/ShowAndEditDipoles.cc

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,26 @@ ShowAndEditDipoles::ShowAndEditDipoles() : GeometryGeneratingModule(staticInfo_)
4848
void ShowAndEditDipoles::execute()
4949
{
5050
auto field = getRequiredInput(InputField);
51-
if(needToExecute())
51+
// if(needToExecute())
52+
// {
53+
std::cout << "executing\n";
54+
FieldInformation finfo(field);
55+
if(!finfo.is_pointcloudmesh())
5256
{
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-
}
57+
error("Input field was not a valid point cloud.");
5958
}
59+
else
60+
{
61+
std::cout << "point cloud found\n";
62+
}
63+
// }
6064
}
6165

6266
void ShowAndEditDipoles::setStateDefaults()
6367
{
6468
auto state = get_state();
6569

70+
std::cout << "state setting\n";
6671
state->setValue(Sizing, 0);
6772
state->setValue(ShowLastAsVector, false);
6873
state->setValue(ShowLines, false);
@@ -71,3 +76,4 @@ void ShowAndEditDipoles::setStateDefaults()
7176
const AlgorithmParameterName ShowAndEditDipoles::Sizing("Sizing");
7277
const AlgorithmParameterName ShowAndEditDipoles::ShowLastAsVector("ShowLastAsVector");
7378
const AlgorithmParameterName ShowAndEditDipoles::ShowLines("ShowLines");
79+

src/Modules/Visualization/ShowAndEditDipoles.h

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ DEALINGS IN THE SOFTWARE.
3333
#include <Modules/Visualization/share.h>
3434

3535
namespace SCIRun {
36+
// namespace Core{
37+
// namespace Algorithms{
38+
// namespace Visualization{
39+
// ALGORITHM_PARAMETER_DECL(Sizing);
40+
// ALGORITHM_PARAMETER_DECL(ShowLastAsVector);
41+
// ALGORITHM_PARAMETER_DECL(ShowLines);
42+
// }
43+
// }
44+
//}
45+
3646
namespace Modules {
3747
namespace Visualization {
3848

@@ -43,17 +53,18 @@ namespace SCIRun {
4353
public:
4454
ShowAndEditDipoles();
4555
virtual void execute() override;
46-
virtual void setStateDefaults();
56+
57+
static const Core::Algorithms::AlgorithmParameterName Sizing;
58+
static const Core::Algorithms::AlgorithmParameterName ShowLastAsVector;
59+
static const Core::Algorithms::AlgorithmParameterName ShowLines;
4760

4861
INPUT_PORT(0, InputField, Field);
4962
OUTPUT_PORT(0, OutputField, Field);
5063
OUTPUT_PORT(1, OutputGeom, GeometryObject);
5164

5265
MODULE_TRAITS_AND_INFO(ModuleHasUI);
5366

54-
static const Core::Algorithms::AlgorithmParameterName Sizing;
55-
static const Core::Algorithms::AlgorithmParameterName ShowLastAsVector;
56-
static const Core::Algorithms::AlgorithmParameterName ShowLines;
67+
virtual void setStateDefaults();
5768
};
5869
}
5970
}

0 commit comments

Comments
 (0)