Skip to content

Commit c830825

Browse files
committed
merging with master. Had a couple of conflicts in SolveInverseProblemWithTikhonov module and the functional tests
2 parents d1c35ad + 0276d45 commit c830825

File tree

404 files changed

+14137
-3814
lines changed

Some content is hidden

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

404 files changed

+14137
-3814
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ matrix:
1616
before_install:
1717
- date -u
1818
- uname -a
19-
- sudo apt-get install mesa-common-dev libgl1-mesa-dev mesa-utils-extra libglapi-mesa ninja-build
19+
- sudo apt-get install mesa-common-dev libgl1-mesa-dev mesa-utils-extra libglapi-mesa ninja-build libqt4-dev qt4-qmake libqt4-opengl-dev
2020

2121
script:
2222
- cd bin
2323
- cmake -GNinja -DTRAVIS_BUILD:BOOL=ON ../Superbuild
24-
- travis_wait 40 ninja
24+
- travis_wait 80 ninja
2525
- cd SCIRun
2626
- ./Algorithm_Layer_Test
2727
- ./Modules_Factory_Tests --gtest_filter=*HardCodedModuleFactoryTests*
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# For more information, please see: http://software.sci.utah.edu
2+
#
3+
# The MIT License
4+
#
5+
# Copyright (c) 2015 Scientific Computing and Imaging Institute,
6+
# University of Utah.
7+
#
8+
#
9+
# Permission is hereby granted, free of charge, to any person obtaining a
10+
# copy of this software and associated documentation files (the "Software"),
11+
# to deal in the Software without restriction, including without limitation
12+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
13+
# and/or sell copies of the Software, and to permit persons to whom the
14+
# Software is furnished to do so, subject to the following conditions:
15+
#
16+
# The above copyright notice and this permission notice shall be included
17+
# in all copies or substantial portions of the Software.
18+
#
19+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20+
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22+
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25+
# DEALINGS IN THE SOFTWARE.
26+
27+
SET_PROPERTY(DIRECTORY PROPERTY "EP_BASE" ${ep_base})
28+
29+
SET(data_SVN_URL "https://gforge.sci.utah.edu/svn/CIBCData")
30+
SET(sci_data_DIR "${CMAKE_BINARY_DIR}/SCIRunData")
31+
32+
ExternalProject_Add(SCI_data_external
33+
SVN_REPOSITORY "${data_SVN_URL}"
34+
SVN_TRUST_CERT 1
35+
SVN_USERNAME "anonymous"
36+
SVN_PASSWORD ""
37+
DOWNLOAD_DIR "${sci_data_DIR}"
38+
PATCH_COMMAND ""
39+
INSTALL_DIR ""
40+
INSTALL_COMMAND ""
41+
CONFIGURE_COMMAND ""
42+
CMAKE_COMMAND ""
43+
BUILD_COMMAND ""
44+
)
45+
46+
ExternalProject_Get_Property(SCI_data_external BINARY_DIR)
47+
SET(SCI_DATA_DIR ${sci_data_DIR} CACHE PATH "")

Superbuild/Superbuild.cmake

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ OPTION(BUILD_WITH_PYTHON "Build with python support." ON)
7474
# Configure tetgen
7575
OPTION(WITH_TETGEN "Build Tetgen." OFF)
7676

77+
###########################################
78+
# Configure data
79+
OPTION(BUILD_WITH_SCIRUN_DATA "Svn checkout data" OFF)
80+
7781
###########################################
7882
# Configure Windows executable to run with
7983
# or without the console
@@ -93,10 +97,16 @@ OPTION(TRAVIS_BUILD "Slim build for Travis CI" OFF)
9397
MARK_AS_ADVANCED(TRAVIS_BUILD)
9498

9599
IF(TRAVIS_BUILD)
96-
SET(BUILD_TESTING OFF)
97-
SET(DOWNLOAD_TOOLKITS OFF)
98-
SET(BUILD_HEADLESS ON)
99-
SET(BUILD_WITH_PYTHON OFF)
100+
IF(CMAKE_C_COMPILER_ID MATCHES "GNU")
101+
SET(BUILD_TESTING OFF)
102+
SET(DOWNLOAD_TOOLKITS OFF)
103+
SET(BUILD_HEADLESS ON)
104+
SET(BUILD_WITH_PYTHON OFF)
105+
SET(BUILD_WITH_SCIRUN_DATA OFF)
106+
ELSE()
107+
SET(BUILD_WITH_SCIRUN_DATA OFF)
108+
# try building everything with clang!
109+
ENDIF()
100110
ADD_DEFINITIONS(-DTRAVIS_BUILD)
101111
ENDIF()
102112

@@ -164,6 +174,14 @@ IF(BUILD_WITH_PYTHON)
164174
ADD_EXTERNAL( ${SUPERBUILD_DIR}/PythonExternal.cmake Python_external )
165175
ENDIF()
166176

177+
FIND_PACKAGE(Subversion)
178+
IF(NOT Subversion_FOUND)
179+
SET(BUILD_WITH_SCIRUN_DATA OFF)
180+
ENDIF()
181+
IF(BUILD_WITH_SCIRUN_DATA)
182+
ADD_EXTERNAL( ${SUPERBUILD_DIR}/SCIRunDataExternal.cmake SCI_data_external)
183+
ENDIF()
184+
167185
IF(WITH_TETGEN)
168186
MESSAGE(STATUS "Configuring Tetgen library under GPL. The SCIRun InterfaceWithTetGen module can be disabled by setting the CMake build variable WITH_TETGEN to OFF.")
169187
ADD_EXTERNAL( ${SUPERBUILD_DIR}/TetgenExternal.cmake Tetgen_external )
@@ -201,6 +219,7 @@ SET(SCIRUN_CACHE_ARGS
201219
"-DTeem_DIR:PATH=${Teem_DIR}"
202220
"-DTetgen_DIR:PATH=${Tetgen_DIR}"
203221
"-DFreetype_DIR:PATH=${Freetype_DIR}"
222+
"-DSCI_DATA_DIR:PATH=${SCI_DATA_DIR}"
204223
)
205224

206225
IF(BUILD_WITH_PYTHON)

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,7 @@ SET_PROPERTY(TARGET Core_Containers PROPERTY FOLDER "Core")
770770
SET_PROPERTY(TARGET Core_Thread_Legacy PROPERTY FOLDER "Core")
771771
SET_PROPERTY(TARGET Core_Serialization_Network PROPERTY FOLDER "Dataflow/Serialization")
772772
SET_PROPERTY(TARGET Core_Serialization_Network_Importer PROPERTY FOLDER "Dataflow/Serialization")
773+
SET_PROPERTY(TARGET bundle_toolkit PROPERTY FOLDER "Dataflow/Serialization")
773774
SET_PROPERTY(TARGET Engine_Network PROPERTY FOLDER "Dataflow/Engine")
774775
SET_PROPERTY(TARGET Engine_Scheduler PROPERTY FOLDER "Dataflow/Engine")
775776
SET_PROPERTY(TARGET Dataflow_State PROPERTY FOLDER "Dataflow")

src/Core/Algorithms/Base/AlgorithmBase.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ Name::Name(const std::string& name) : name_(name)
6060
}
6161
}
6262

63-
AlgorithmBase::~AlgorithmBase() {}
64-
6563
namespace
6664
{
6765
// Note: boost::serialization has trouble with NaN values, in addition to the platform differences.
@@ -381,10 +379,10 @@ bool AlgorithmParameterList::checkOption(const AlgorithmParameterName& key, cons
381379
return boost::iequals(value, currentValue);
382380
}
383381

384-
void AlgorithmBase::dumpAlgoState() const
382+
void AlgorithmParameterList::dumpAlgoState() const
385383
{
386384
std::ostringstream ostr;
387-
ostr << "Algorithm state for " << typeid(*this).name() << " id#" << id() << std::endl;
385+
ostr << "Algorithm state for " << typeid(*this).name() << std::endl;
388386

389387
auto range = std::make_pair(paramsBegin(), paramsEnd());
390388
BOOST_FOREACH(const ParameterMap::value_type& pair, range)
@@ -466,4 +464,4 @@ std::vector<std::string> Core::Algorithms::toNameVector(const Variable::List& li
466464
std::vector<double> Core::Algorithms::toDoubleVector(const Variable::List& list)
467465
{
468466
return toTypedVector<double>(list, [](const Variable& v) { return v.toDouble(); });
469-
}
467+
}

src/Core/Algorithms/Base/AlgorithmBase.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@
3939
namespace SCIRun {
4040
namespace Core {
4141
namespace Algorithms {
42-
43-
class SCISHARE AlgorithmBase : public AlgorithmInterface, public AlgorithmParameterList, public AlgorithmLogger, public AlgorithmStatusReporter
42+
43+
class SCISHARE AlgorithmBase :
44+
public AlgorithmInterface,
45+
public AlgorithmParameterList,
46+
public AlgorithmLogger,
47+
public AlgorithmStatusReporter
4448
{
45-
public:
46-
virtual ~AlgorithmBase();
47-
protected:
48-
void dumpAlgoState() const;
4949
};
50-
50+
5151
}}}
5252

5353
#endif

src/Core/Algorithms/Base/AlgorithmData.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ namespace Algorithms {
5555
{
5656
auto it = data_.find(name);
5757
/// @todo: log incorrect type if present but wrong type
58-
return it == data_.end() ? boost::shared_ptr<T>() : boost::dynamic_pointer_cast<T>(it->second[0]);
58+
return it == data_.end() ? nullptr : boost::dynamic_pointer_cast<T>(it->second[0]);
5959
}
6060

6161
template <typename T>
@@ -81,11 +81,11 @@ namespace Algorithms {
8181
boost::any transient_;
8282
};
8383

84-
class SCISHARE AlgorithmInput : public AlgorithmData
84+
class SCISHARE AlgorithmInput : public AlgorithmData
8585
{
8686
public:
8787
AlgorithmInput() {}
88-
AlgorithmInput(const Map& m) : AlgorithmData(m) {}
88+
explicit AlgorithmInput(const Map& m) : AlgorithmData(m) {}
8989
};
9090

9191
class SCISHARE AlgorithmOutput : public AlgorithmData
@@ -97,9 +97,9 @@ namespace Algorithms {
9797
VariableHandle additionalAlgoOutput_;
9898
};
9999

100-
typedef Datatypes::SharedPointer<AlgorithmInput> AlgorithmInputHandle;
101-
typedef Datatypes::SharedPointer<AlgorithmOutput> AlgorithmOutputHandle;
102-
100+
typedef SharedPointer<AlgorithmInput> AlgorithmInputHandle;
101+
typedef SharedPointer<AlgorithmOutput> AlgorithmOutputHandle;
102+
103103
}}}
104104

105105
#endif

src/Core/Algorithms/Base/AlgorithmFwd.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,19 @@
3030
#define ALGORITHMS_BASE_ALGORITHMFWD_H
3131

3232
#include <Core/Datatypes/DatatypeFwd.h>
33+
#include <Core/Utils/SmartPointers.h>
3334
#include <Core/Algorithms/Base/share.h>
3435

3536
namespace SCIRun {
3637
namespace Core {
3738
namespace Algorithms {
3839

3940
class AlgorithmBase;
40-
typedef Datatypes::SharedPointer<AlgorithmBase> AlgorithmHandle;
41+
typedef SharedPointer<AlgorithmBase> AlgorithmHandle;
4142

4243
class AlgorithmFactory;
43-
typedef Datatypes::SharedPointer<AlgorithmFactory> AlgorithmFactoryHandle;
44+
typedef SharedPointer<AlgorithmFactory> AlgorithmFactoryHandle;
4445

4546
}}}
4647

47-
#endif
48+
#endif

src/Core/Algorithms/Base/AlgorithmInterfaces.h

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,11 @@
3636
namespace SCIRun {
3737
namespace Core {
3838
namespace Algorithms {
39-
39+
4040
class SCISHARE AlgorithmInterface : public HasIntegerId
4141
{
4242
public:
4343
virtual ~AlgorithmInterface() {}
44-
45-
/*
46-
@todo idea: make it mockable
47-
48-
virtual OutputDatatypeHandleOptions run(InputDatatypeHandleOptions, ModuleParameterState) = 0;
49-
50-
ModuleParameterState: essentially a map of GuiVars. but need hooks for undo/redo and serialization
51-
Input: tuple/heterogeneous vector of Datatypes
52-
Output: tuple of Datatypes, possibly delay-executed
53-
*/
54-
5544
virtual AlgorithmOutput run(const AlgorithmInput& input) const = 0;
5645
};
5746

src/Core/Algorithms/Base/AlgorithmParameterList.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,11 @@ namespace Algorithms {
7373
typedef std::map<AlgorithmParameterName, AlgorithmParameter> ParameterMap;
7474
ParameterMap::const_iterator paramsBegin() const { return parameters_.begin(); }
7575
ParameterMap::const_iterator paramsEnd() const { return parameters_.end(); }
76+
void dumpAlgoState() const;
7677
private:
7778
ParameterMap parameters_;
7879
};
79-
80+
8081
}}}
8182

8283
#endif

0 commit comments

Comments
 (0)