Skip to content

Commit a2d5cae

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 35de434 + 5ad0542 commit a2d5cae

File tree

88 files changed

+6911
-391
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+6911
-391
lines changed

README.md

Lines changed: 10 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@ https://github.com/SCIInstitute/SCIRun
1212
- [Summary](#user-content-summary)
1313
- [Goals](#user-content-goals)
1414
- [Documentation](#user-content-documentation)
15-
- [Platform Notes](#user-content-platform-notes)
16-
- [Build requirements](#user-content-build-requirements)
17-
- [CMake Build Generators](#user-content-cmake-build-generators)
18-
- [Unix Makefiles notes](#user-content-unix-makefiles-notes)
15+
- [Build](#user-content-build)
16+
- [Python API](#user-content-python-api)
1917
- [Questions and Answers](#user-content-questions-and-answers)
2018
- [License and Credits](#user-content-license-and-credits)
2119

@@ -24,49 +22,18 @@ https://github.com/SCIInstitute/SCIRun
2422
| Warning! | SCIRun 5 is alpha software, you may use for real science but beware of instability. |
2523
|:--------:|:-------------------------------------------------------------------------------------:|
2624

27-
###Goals
25+
### Goals
2826
SCIRun 5 is a complete rewrite of the GUI front end and graphical components of SCIRun 4, including a more stable and
2927
efficient middle layer, with support for Python scripting.
3028

3129
### Documentation
32-
For documentation, please see: http://sciinstitute.github.io/SCIRun/
33-
34-
### Platform Notes
35-
#### Build requirements
36-
* OS X (tested on 10.7-10.11)
37-
- Apple clang 5.1
38-
- Qt 4.8
39-
+ Download from http://releases.qt-project.org/qt4/source/qt-mac-opensource-4.8.4.dmg.
40-
+ The above dmg will not work if using OS X 10.11. In this case Qt 4.8 can be acquired through macports using the command 'sudo port install qt4-mac' - more on macports here: https://www.macports.org/install.php
41-
* Windows (tested on Windows 7, 8, 10)
42-
- Visual Studio 2013, 2015
43-
- Qt 4.8
44-
+ Build from source (see http://scirundocwiki.sci.utah.edu/SCIRunDocs/index.php/CIBC:Seg3D2:Building_Releases#Installing_Qt_on_your_system_and_building_from_scratch for instructions), but be sure to download http://releases.qt-project.org/qt4/source/qt-everywhere-opensource-src-4.8.4.tar.gz.
45-
* Linux (tested on Ubuntu 12.10, OpenSUSE Leap)
46-
- gcc 4.6, 4.7, 4.8
47-
- Qt 4.8
48-
+ Build from source (http://releases.qt-project.org/qt4/source/qt-everywhere-opensource-src-4.8.4.tar.gz), or use system libraries if available.
49-
* All platforms
50-
- CMake 2.8
51-
+ Root cmake file is SCIRun/Superbuild/CMakeLists.txt.
52-
+ Building in the source directory is not permitted.
53-
+ Make sure BUILD_SHARED_LIBS is on (default setting).
54-
55-
#### CMake Build Generators
56-
* Windows
57-
- Visual Studio 2013
58-
* OS X (tested on 10.7 and 10.8 and 10.10)
59-
- Unix Makefiles
60-
- Xcode
61-
* Linux (tested on Ubuntu 12.10)
62-
- Unix Makefiles
63-
64-
#### Unix Makefiles notes
65-
* Build Superbuild first (src/Superbuild), then subsequently, SCIRun can be built by itself (src/).
66-
* Included `build.sh` takes care of all this for you.
67-
68-
### Tagging releases
69-
On an OSX system, run script `release.sh` in the `src` directory with the release name in format `alpha.XX` as a parameter.
30+
For documentation, please see: http://sciinstitute.github.io/scirun.pages
31+
32+
#### Build
33+
Please see http://sciinstitute.github.io/scirun.pages/build.html
34+
35+
#### Python API
36+
Please see http://sciinstitute.github.io/scirun.pages/python.html
7037

7138
### Questions and Answers
7239
For help, email the testing mailing list at [email protected].

src/Core/Algorithms/Legacy/Fields/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ SET(Core_Algorithms_Legacy_Fields_HEADERS
3030
ClipMesh/ClipMeshBySelection.h
3131
ClipMesh/ClipMeshByIsovalue.h
3232
ConvertMeshType/ConvertMeshToPointCloudMeshAlgo.h
33+
ConvertMeshType/ConvertMeshToUnstructuredMesh.h
3334
DistanceField/CalculateSignedDistanceField.h
3435
DistanceField/CalculateDistanceField.h
3536
Mapping/ApplyMappingMatrix.h
@@ -98,6 +99,7 @@ SET(Core_Algorithms_Legacy_Fields_HEADERS
9899
RegisterWithCorrespondences.h
99100
SampleField/GeneratePointSamplesFromField.h
100101
DistanceField/CalculateIsInsideField.h
102+
MeshData/GetMeshQualityFieldAlgo.h
101103
)
102104

103105
SET(Core_Algorithms_Legacy_Fields_SRCS
@@ -112,7 +114,7 @@ SET(Core_Algorithms_Legacy_Fields_SRCS
112114
ConvertMeshType/ConvertMeshToPointCloudMeshAlgo.cc
113115
ConvertMeshType/ConvertMeshToTetVolMesh.cc
114116
ConvertMeshType/ConvertMeshToTriSurfMeshAlgo.cc
115-
#ConvertMeshType/ConvertMeshToUnstructuredMesh.cc
117+
ConvertMeshType/ConvertMeshToUnstructuredMesh.cc
116118
ConvertMeshType/ConvertMeshToIrregularMesh.cc
117119
#ConvertMeshType/ConvertLatVolDataFromElemToNode.cc
118120
#ConvertMeshType/ConvertLatVolDataFromNodeToElem.cc
@@ -179,7 +181,7 @@ SET(Core_Algorithms_Legacy_Fields_SRCS
179181
Mapping/ApplyMappingMatrix.cc
180182
#MeshData/GetSurfaceNodeNormals.cc
181183
#MeshData/GetSurfaceElemNormals.cc
182-
#MeshData/GetMeshQualityField.cc
184+
MeshData/GetMeshQualityFieldAlgo.cc
183185
#MeshDerivatives/CalculateMeshConnector.cc
184186
#MeshDerivatives/CalculateMeshCenter.cc
185187
#MeshDerivatives/GetCentroids.cc

src/Core/Algorithms/Legacy/Fields/ConvertMeshType/ConvertMeshToIrregularMesh.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ using namespace SCIRun::Core::Algorithms;
4242
using namespace SCIRun::Core::Datatypes;
4343

4444
bool
45-
ConvertMeshToIrregularMeshAlgo::run(FieldHandle input, FieldHandle& output) const
45+
ConvertMeshToIrregularMeshAlgo::runImpl(FieldHandle input, FieldHandle& output) const
4646
{
4747
// Mark that we are starting the algorithm, but do not report progress
4848
ScopedAlgorithmStatusReporter asr(this, "ConvertMeshToIrregularMesh");
@@ -188,17 +188,15 @@ ConvertMeshToIrregularMeshAlgo::run(FieldHandle input, FieldHandle& output) cons
188188
return (true);
189189
}
190190

191-
AlgorithmOutputName ConvertMeshToIrregularMeshAlgo::OutputField("OutputField");
192-
193191
AlgorithmOutput ConvertMeshToIrregularMeshAlgo::run(const AlgorithmInput& input) const
194192
{
195193
auto ifield = input.get<Field>(Variables::InputField);
196194

197195
FieldHandle ofield;
198-
if (!run(ifield, ofield))
196+
if (!runImpl(ifield, ofield))
199197
THROW_ALGORITHM_PROCESSING_ERROR("False returned on legacy run call.");
200198

201199
AlgorithmOutput output;
202-
output[OutputField] = ofield;
200+
output[Variables::OutputField] = ofield;
203201
return output;
204202
}

src/Core/Algorithms/Legacy/Fields/ConvertMeshType/ConvertMeshToIrregularMesh.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
#define CORE_ALGORITHMS_FIELDS_CONVERTMESHTYPE_CONVERTTOIRREGULARMESH_H 1
3232

3333
#include <Core/Algorithms/Base/AlgorithmBase.h>
34-
35-
// for Windows support
3634
#include <Core/Algorithms/Legacy/Fields/share.h>
3735

3836
namespace SCIRun {
@@ -47,11 +45,9 @@ class SCISHARE ConvertMeshToIrregularMeshAlgo : public AlgorithmBase
4745
{
4846
}
4947

50-
bool run(FieldHandle input, FieldHandle& output) const;
51-
52-
static AlgorithmOutputName OutputField;
48+
bool runImpl(FieldHandle input, FieldHandle& output) const;
5349

54-
virtual AlgorithmOutput run(const AlgorithmInput& input) const;
50+
virtual AlgorithmOutput run(const AlgorithmInput& input) const override;
5551
};
5652

5753
}}}}

src/Core/Algorithms/Legacy/Fields/ConvertMeshType/ConvertMeshToPointCloudMeshAlgo.h

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Copyright (c) 2015 Scientific Computing and Imaging Institute,
77
University of Utah.
88
9-
9+
1010
Permission is hereby granted, free of charge, to any person obtaining a
1111
copy of this software and associated documentation files (the "Software"),
1212
to deal in the Software without restriction, including without limitation
@@ -24,7 +24,7 @@
2424
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2525
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2626
DEALINGS IN THE SOFTWARE.
27-
*/
27+
*/
2828

2929

3030
#ifndef CORE_ALGORITHMS_FIELDS_CONVERTMESHTYPE_CONVERTTOPOINTCLOUDMESH_H
@@ -39,18 +39,21 @@ namespace SCIRun {
3939
namespace Algorithms {
4040
namespace Fields {
4141

42-
class SCISHARE ConvertMeshToPointCloudMeshAlgo : public AlgorithmBase
43-
{
44-
public:
45-
ConvertMeshToPointCloudMeshAlgo();
42+
class SCISHARE ConvertMeshToPointCloudMeshAlgo : public AlgorithmBase
43+
{
44+
public:
45+
ConvertMeshToPointCloudMeshAlgo();
4646

47-
bool runImpl(FieldHandle input, FieldHandle& output) const;
48-
virtual AlgorithmOutput run(const AlgorithmInput& input) const override;
47+
bool runImpl(FieldHandle input, FieldHandle& output) const;
48+
virtual AlgorithmOutput run(const AlgorithmInput& input) const override;
4949

50-
static AlgorithmParameterName Location;
51-
};
50+
static AlgorithmParameterName Location;
51+
};
5252

53-
}}}}
53+
}
54+
}
55+
}
56+
}
5457

5558
#endif
5659

src/Core/Algorithms/Legacy/Fields/ConvertMeshType/ConvertMeshToUnstructuredMesh.cc

Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -27,39 +27,30 @@
2727
*/
2828

2929
// Get all the class definitions.
30-
#include <Core/Algorithms/Fields/ConvertMeshType/ConvertMeshToUnstructuredMesh.h>
31-
#include <Core/Datatypes/FieldInformation.h>
32-
33-
// As we already included DynamicAlgorithm.h in the header we do not need to
34-
// include it again here.
35-
36-
namespace SCIRunAlgo {
30+
#include <Core/Algorithms/Legacy/Fields/ConvertMeshType/ConvertMeshToUnstructuredMesh.h>
31+
#include <Core/Datatypes/Legacy/Field/FieldInformation.h>
32+
#include <Core/Datatypes/Legacy/Field/VMesh.h>
33+
#include <Core/Datatypes/Legacy/Field/VField.h>
34+
#include <Core/Datatypes/PropertyManagerExtensions.h>
35+
#include <Core/Algorithms/Base/AlgorithmPreconditions.h>
36+
#include <Core/Algorithms/Base/AlgorithmVariableNames.h>
3737

3838
using namespace SCIRun;
39+
using namespace SCIRun::Core::Algorithms::Fields;
40+
using namespace SCIRun::Core::Geometry;
41+
using namespace SCIRun::Core::Utility;
42+
using namespace SCIRun::Core::Algorithms;
43+
using namespace SCIRun::Core::Datatypes;
3944

40-
// Implementation of the actual access point to the algorithm
41-
42-
bool
43-
ConvertMeshToUnstructuredMeshAlgo::
44-
run(FieldHandle input, FieldHandle& output)
45+
bool ConvertMeshToUnstructuredMeshAlgo::runImpl(FieldHandle input, FieldHandle& output) const
4546
{
46-
// Mark that we are starting the algorithm, but do not report progress
47-
algo_start("ConvertMeshToUnstructuredMesh");
48-
49-
// Step 0:
50-
// Safety test:
51-
// Test whether we received actually a field. A handle can point to no object.
52-
// Using a null handle will cause the program to crash. Hence it is a good
53-
// policy to check all incoming handles and to see whether they point to actual
54-
// objects.
55-
56-
// Handle: the function get_rep() returns the pointer contained in the handle
57-
if (input.get_rep() == 0)
47+
ScopedAlgorithmStatusReporter asr(this, "ConvertMeshToUnstructuredMesh");
48+
49+
// Null check
50+
if (!input)
5851
{
59-
// If we encounter a null pointer we return an error message and return to
60-
// the program to deal with this error.
6152
error("No input field");
62-
algo_end(); return (false);
53+
return (false);
6354
}
6455

6556
// Step 1: determine the type of the input fields and determine what type the
@@ -91,7 +82,7 @@ run(FieldHandle input, FieldHandle& output)
9182
if (fi.is_nonlinear())
9283
{
9384
error("This function has not yet been defined for non-linear elements");
94-
algo_end(); return (false);
85+
return (false);
9586
}
9687

9788
// If the mesh is already unstructured, we only need to copy the input to the
@@ -102,7 +93,7 @@ run(FieldHandle input, FieldHandle& output)
10293
remark("Mesh already is unstructured; copying input to output");
10394
// Copy input to output (output is a reference to the input)
10495
output = input;
105-
algo_end(); return (true);
96+
return (true);
10697
}
10798

10899
// Define the output type of the data
@@ -121,19 +112,19 @@ run(FieldHandle input, FieldHandle& output)
121112
else
122113
{
123114
error("No unstructure method available for mesh: " + fi.get_mesh_type());
124-
algo_end(); return (false);
115+
return (false);
125116
}
126117

127118
// Create a new output field
128119
output = CreateField(fo);
129120

130-
if (output.get_rep() == 0)
121+
if (!output)
131122
{
132123
// Error reporting:
133124
// we forward the specific message to the ProgressReporter and return a
134125
// false to indicate that an error has occured.
135126
error("Could not obtain input field");
136-
algo_end(); return (false);
127+
return (false);
137128
}
138129

139130
// Get the virtual interface of the objects
@@ -169,16 +160,23 @@ run(FieldHandle input, FieldHandle& output)
169160
omesh->add_elem(nodes);
170161
}
171162

172-
// Resize the data
173-
// and copy the data
174163
ofield->resize_values();
175164
ofield->copy_values(ifield);
176165

177-
/// Copy properties of the property manager
178-
output->copy_properties(input.get_rep());
166+
CopyProperties(*input, *output);
179167

180-
// Success:
181-
algo_end(); return (true);
168+
return (true);
182169
}
183170

184-
} // End namespace SCIRunAlgo
171+
AlgorithmOutput ConvertMeshToUnstructuredMeshAlgo::run(const AlgorithmInput& input) const
172+
{
173+
auto ifield = input.get<Field>(Variables::InputField);
174+
175+
FieldHandle ofield;
176+
if (!runImpl(ifield, ofield))
177+
THROW_ALGORITHM_PROCESSING_ERROR("False returned on legacy run call.");
178+
179+
AlgorithmOutput output;
180+
output[Variables::OutputField] = ofield;
181+
return output;
182+
}

src/Core/Algorithms/Legacy/Fields/ConvertMeshType/ConvertMeshToUnstructuredMesh.h

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,32 +30,29 @@
3030
#ifndef CORE_ALGORITHMS_FIELDS_CONVERTMESHTYPE_CONVERTMESHTOUNSTRUCTUREDMESH_H
3131
#define CORE_ALGORITHMS_FIELDS_CONVERTMESHTYPE_CONVERTMESHTOUNSTRUCTUREDMESH_H 1
3232

33-
// Datatypes that the algorithm uses
34-
#include <Core/Datatypes/Mesh.h>
35-
#include <Core/Datatypes/Field.h>
33+
#include <Core/Algorithms/Base/AlgorithmBase.h>
34+
#include <Core/Algorithms/Legacy/Fields/share.h>
3635

37-
// Base class for algorithm
38-
#include <Core/Algorithms/Util/AlgoBase.h>
36+
namespace SCIRun {
37+
namespace Core {
38+
namespace Algorithms {
39+
namespace Fields {
3940

40-
// for Windows support
41-
#include <Core/Algorithms/Fields/share.h>
41+
class SCISHARE ConvertMeshToUnstructuredMeshAlgo : public AlgorithmBase
42+
{
43+
public:
44+
ConvertMeshToUnstructuredMeshAlgo()
45+
{
46+
}
4247

43-
namespace SCIRunAlgo {
48+
bool runImpl(FieldHandle input, FieldHandle& output) const;
4449

45-
using namespace SCIRun;
50+
virtual AlgorithmOutput run(const AlgorithmInput& input) const override;
51+
};
4652

47-
class SCISHARE ConvertMeshToUnstructuredMeshAlgo : public AlgoBase
48-
{
49-
public:
50-
/// Set defaults
51-
ConvertMeshToUnstructuredMeshAlgo()
52-
{
53+
}
5354
}
55+
}
56+
}
5457

55-
/// run the algorithm
56-
bool run(FieldHandle input, FieldHandle& output);};
57-
58-
} // end namespace SCIRunAlgo
59-
60-
#endif
61-
58+
#endif

0 commit comments

Comments
 (0)