Skip to content

Commit d0a17d7

Browse files
committed
fleshed out classes
1 parent e497404 commit d0a17d7

File tree

3 files changed

+45
-31
lines changed

3 files changed

+45
-31
lines changed

src/Interface/Modules/Fields/ConvertMatricesToMeshDialog.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ ConvertMatricesToMeshDialog::ConvertMatricesToMeshDialog(const std::string& name
4242
setWindowTitle(QString::fromStdString(name));
4343
fixSize();
4444

45-
addDynamicLabelManager(inputNameLabel_, Parameters::InputFieldName);
46-
addDynamicLabelManager(typeNameLabel_, Parameters::InputType);
47-
addComboBoxManager(outputFieldTypeComboBox_, Parameters::FieldDatatype);
45+
addDynamicLabelManager(nameTextLabel_, Parameters::InputFieldTypeName);
46+
addDynamicLabelManager(typeNameTextLabel_, Parameters::InputFieldTypeTypeName);
47+
addComboBoxManager(meshTypeComboBox_, Parameters::OutputMeshDataType);
48+
addComboBoxManager(fieldTypeComboBox_, Parameters::OutputFieldDatatype);
4849
}

src/Modules/Legacy/Fields/ConvertMatricesToMesh.cc

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -35,28 +35,31 @@
3535
///
3636

3737
#include <Modules/Legacy/Fields/ConvertMatricesToMesh.h>
38-
#include <Core/Datatypes/Field.h>
39-
#include <Core/Datatypes/Mesh.h>
40-
#include <Core/Datatypes/Matrix.h>
41-
#include <Core/Datatypes/FieldInformation.h>
42-
43-
#include <Dataflow/Network/Ports/MatrixPort.h>
44-
#include <Dataflow/Network/Ports/FieldPort.h>
45-
46-
47-
DECLARE_MAKER(ConvertMatricesToMesh)
48-
ConvertMatricesToMesh::ConvertMatricesToMesh(GuiContext* ctx)
49-
: Module("ConvertMatricesToMesh", ctx, Filter, "NewField", "SCIRun"),
50-
gui_fieldname_(get_ctx()->subVar("fieldname"), "Created Field"),
51-
gui_meshname_(get_ctx()->subVar("meshname"), "Created Mesh"),
52-
gui_fieldbasetype_(get_ctx()->subVar("fieldbasetype"), "TetVol"),
53-
gui_datatype_(get_ctx()->subVar("datatype"), "double")
38+
#include <Core/Datatypes/Legacy/Field/Field.h>
39+
#include <Core/Datatypes/Legacy/Field/Mesh.h>
40+
#include <Core/Datatypes/Legacy/Matrix/Matrix.h>
41+
#include <Core/Datatypes/Legacy/Field/FieldInformation.h>
42+
43+
using namespace SCIRun::Modules::Fields;
44+
using namespace SCIRun::Dataflow::Networks;
45+
46+
ALGORITHM_PARAMETER_DEF(Fields, InputFieldTypeName)
47+
ALGORITHM_PARAMETER_DEF(Fields, InputFieldTypeTypeName)
48+
ALGORITHM_PARAMETER_DEF(Fields, OutputMeshDataType)
49+
ALGORITHM_PARAMETER_DEF(Fields, OutputFieldDatatype)
50+
51+
ConvertMatricesToMesh::ConvertMatricesToMesh()
52+
: Module(ModuleLookupInfo("ConvertMatricesToMesh", "ChangeMesh", "SCIRun"), false)
5453
{
54+
INITIALIZE_PORT(MeshElements);
55+
INITIALIZE_PORT(MeshPositions);
56+
INITIALIZE_PORT(MeshNormals);
57+
INITIALIZE_PORT(OutputField);
5558
}
5659

5760

5861
void ConvertMatricesToMesh::execute()
59-
{
62+
{/*
6063
MatrixHandle positionshandle;
6164
MatrixHandle normalshandle;
6265
@@ -111,10 +114,11 @@ void ConvertMatricesToMesh::execute()
111114
result_field->vfield()->resize_values();
112115
send_output_handle("Output Field", result_field);
113116
}
117+
*/
114118
}
115119

116120
void ConvertMatricesToMesh::process_elements(VMesh* mesh, size_type positionRows, bool required)
117-
{
121+
{/*
118122
MatrixHandle elementshandle;
119123
if (get_input_handle("Mesh Elements", elementshandle, required))
120124
{
@@ -146,5 +150,5 @@ void ConvertMatricesToMesh::process_elements(VMesh* mesh, size_type positionRows
146150
{
147151
error("..." + to_string(ecount - 9) + " additional bad indices found.");
148152
}
149-
}
153+
} */
150154
}

src/Modules/Legacy/Fields/ConvertMatricesToMesh.h

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,28 +37,37 @@
3737
#ifndef CORE_ALGORITHMS_FIELDS_FIELDDATA_CONVERTMATRICESTOMESH_H
3838
#define CORE_ALGORITHMS_FIELDS_FIELDDATA_CONVERTMATRICESTOMESH_H 1
3939

40+
#include <Core/Datatypes/MatrixFwd.h>
41+
#include <Core/GeometryPrimitives/GeomFwd.h>
42+
#include <Core/Datatypes/Legacy/Field/FieldFwd.h>
43+
#include <Core/Algorithms/Base/AlgorithmBase.h>
44+
4045
#include <Dataflow/Network/Module.h>
4146
#include <Modules/Legacy/Fields/share.h>
4247

4348
namespace SCIRun {
4449
namespace Modules {
4550
namespace Fields {
46-
class SCISHARE ConvertMatricesToMesh : public Module
51+
class SCISHARE ConvertMatricesToMesh : public Dataflow::Networks::Module,
52+
public Has3InputPorts<MatrixPortTag, MatrixPortTag, MatrixPortTag>,
53+
public Has1OutputPort<FieldPortTag>
4754
{
48-
private:
49-
GuiString gui_fieldname_;
50-
GuiString gui_meshname_;
51-
GuiString gui_fieldbasetype_;
52-
GuiString gui_datatype_;
53-
void process_elements(VMesh* mesh, size_type positionRows, bool required);
54-
5555
public:
56-
ConvertMatricesToMesh(GuiContext* ctx);
56+
ConvertMatricesToMesh();
5757
virtual ~ConvertMatricesToMesh() {}
5858

5959
virtual void execute();
60+
61+
private:
62+
void process_elements(SCIRun::VMesh* mesh, size_type positionRows, bool required);
63+
64+
INPUT_PORT(0, MeshElements, Matrix);
65+
INPUT_PORT(1, MeshPositions, Matrix);
66+
INPUT_PORT(2, MeshNormals, Matrix);
67+
OUTPUT_PORT(0, OutputField, LegacyField);
6068
};
6169
}
6270
}
6371
} // End namespace SCIRun
6472

73+
#endif

0 commit comments

Comments
 (0)