Skip to content

Commit 7ff6ac2

Browse files
authored
Merge pull request #1919 from SCIInstitute/module-deprecate
Module deprecation and bug fixes
2 parents 8f88b65 + 052dd73 commit 7ff6ac2

File tree

61 files changed

+4073
-385
lines changed

Some content is hidden

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

61 files changed

+4073
-385
lines changed

src/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,18 @@ IF(BUILD_TESTING)
207207
ADD_DEFINITIONS(-DTEST_RESOURCE_ROOT_DIR="${SCIRUN_TEST_RESOURCE_DIR}" -DBUILD_TESTING)
208208
ENDIF()
209209

210+
#########################################################################
211+
# Configure Spdlog
212+
set (cxxfeaturelist ${CMAKE_CXX_COMPILE_FEATURES})
213+
214+
list (FIND cxxfeaturelist "cxx_thread_local" _index)
215+
if (${_index} GREATER -1)
216+
message("Found cxx_thread_local")
217+
else()
218+
message(WARNING "Did NOT find cxx_thread_local--turning off feature of spdlog")
219+
add_definitions(-DDISABLE_SPDLOG_TLS=1)
220+
endif()
221+
210222
#########################################################################
211223
# External projects
212224

src/Core/Algorithms/Math/ResizeMatrixAlgo.cc

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ DEALINGS IN THE SOFTWARE.
2727

2828

2929
#include <Core/Algorithms/Math/ResizeMatrixAlgo.h>
30-
#include<Core/Datatypes/Matrix.h>
3130
#include <Core/Datatypes/DenseMatrix.h>
3231
#include <Core/Datatypes/MatrixTypeConversions.h>
3332
#include <Core/Algorithms/Base/AlgorithmVariableNames.h>
@@ -51,7 +50,6 @@ ResizeMatrixAlgo::ResizeMatrixAlgo()
5150
addParameter(Parameters::NoOfRows, 1);
5251
addParameter(Parameters::NoOfColumns, 1);
5352
addOption(Parameters::Major,"Row","Row|Column");
54-
5553
}
5654

5755
AlgorithmOutput ResizeMatrixAlgo::run(const AlgorithmInput& input) const
@@ -64,7 +62,7 @@ AlgorithmOutput ResizeMatrixAlgo::run(const AlgorithmInput& input) const
6462
std::string major=getOption(Parameters::Major);
6563
DenseMatrixHandle dense=castMatrix::toDense(inputMatrix);
6664
DenseMatrixHandle denseMat(new DenseMatrix(*dense));
67-
65+
6866
if(major=="Column")
6967
{
7068
denseMat->transposeInPlace();
@@ -73,9 +71,9 @@ AlgorithmOutput ResizeMatrixAlgo::run(const AlgorithmInput& input) const
7371

7472
Map<MatrixXd> result(denseMat->data(),columns,rows);
7573
DenseMatrixHandle outputArray(new DenseMatrix(result.matrix()));
76-
74+
7775
outputArray->transposeInPlace();
78-
76+
7977
if(denseMat->rows()*denseMat->cols() != rows*columns)
8078
{
8179
warning("Input size does not match the size of the Output Matrix, Matrix will be padded with zeros or cropped up.");
@@ -86,10 +84,10 @@ AlgorithmOutput ResizeMatrixAlgo::run(const AlgorithmInput& input) const
8684
resultMatrix[i]=0;
8785
}
8886
}
89-
87+
9088
if(major=="Column")
9189
outputArray->transposeInPlace();
92-
90+
9391
AlgorithmOutput output;
9492
output[Variables::OutputMatrix]=outputArray;
9593
return output;

src/Core/Algorithms/Math/ResizeMatrixAlgo.h

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -28,40 +28,27 @@
2828
#ifndef CORE_ALGORITHMS_MATH_ResizeMatrixALGO_H
2929
#define CORE_ALGORITHMS_MATH_ResizeMatrixALGO_H
3030

31-
#include<Core/Datatypes/Matrix.h>
32-
#include<Core/Datatypes/DenseMatrix.h>
33-
#include<Core/Datatypes/DenseColumnMatrix.h>
34-
#include <Dataflow/Network/Module.h>
35-
#include <Eigen/Dense>
36-
37-
#include<string>
38-
#include<sstream>
39-
#include<vector>
40-
#include<algorithm>
41-
42-
#include<Core/Algorithms/Base/AlgorithmVariableNames.h>
4331
#include<Core/Algorithms/Base/AlgorithmBase.h>
4432
#include<Core/Algorithms/Math/share.h>
4533

46-
namespace SCIRun{
47-
namespace Core{
48-
namespace Algorithms{
49-
namespace Math{
50-
51-
ALGORITHM_PARAMETER_DECL(NoOfRows);
52-
ALGORITHM_PARAMETER_DECL(NoOfColumns);
53-
ALGORITHM_PARAMETER_DECL(Major);
54-
55-
56-
class SCISHARE ResizeMatrixAlgo : public AlgorithmBase
57-
{
58-
public:
59-
ResizeMatrixAlgo();
60-
61-
AlgorithmOutput run(const AlgorithmInput& input) const;
62-
63-
64-
};
34+
namespace SCIRun
35+
{
36+
namespace Core
37+
{
38+
namespace Algorithms
39+
{
40+
namespace Math
41+
{
42+
ALGORITHM_PARAMETER_DECL(NoOfRows);
43+
ALGORITHM_PARAMETER_DECL(NoOfColumns);
44+
ALGORITHM_PARAMETER_DECL(Major);
45+
46+
class SCISHARE ResizeMatrixAlgo : public AlgorithmBase
47+
{
48+
public:
49+
ResizeMatrixAlgo();
50+
AlgorithmOutput run(const AlgorithmInput& input) const;
51+
};
6552
}
6653
}
6754
}

src/Core/Datatypes/Color.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,9 @@ std::ostream& SCIRun::Core::Datatypes::operator<<(std::ostream& out, const Color
9191
out << "Color(" << color.r() << "," << color.g() << "," << color.b() << ")";
9292
return out;
9393
}
94+
95+
bool ViewSceneFeedback::matchesWithModuleId(const std::string& modId) const
96+
{
97+
auto toMatch = GeometryObject::delimiter + modId + GeometryObject::delimiter;
98+
return selectionName.find(toMatch) != std::string::npos;
99+
}

src/Core/Datatypes/Color.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ namespace Datatypes {
8484
Geometry::Transform transform;
8585
std::string selectionName;
8686
std::tuple<int,int> windowSize;
87+
88+
bool matchesWithModuleId(const std::string& modId) const;
8789
};
8890

8991
struct SCISHARE MeshComponentSelectionFeedback : ModuleFeedback

src/Core/Datatypes/Legacy/Color/Color.cc

Lines changed: 0 additions & 75 deletions
This file was deleted.

src/Core/Datatypes/Legacy/Color/Color.h

Lines changed: 0 additions & 63 deletions
This file was deleted.

src/Core/Logging/Log.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@
3535
#ifndef Q_MOC_RUN
3636
#include <Core/Utils/Singleton.h>
3737
#include <boost/filesystem/path.hpp>
38+
39+
// older Mac compiler does not support thread-local storage
40+
#if defined(__APPLE__) && defined(DISABLE_SPDLOG_TLS)
41+
#define SPDLOG_NO_TLS
42+
#endif
3843
#include <spdlog/spdlog.h>
44+
3945
#endif
4046
#include <Core/Logging/share.h>
4147

src/Dataflow/Engine/Controller/DynamicPortManager.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void DynamicPortManager::connectionAddedNeedToCloneAPort(const SCIRun::Dataflow:
5353
{
5454
ModuleBuilder builder;
5555
auto newPortId = builder.cloneInputPort(moduleIn, cd.in_.portId_);
56-
portAdded_(moduleIn->get_id(), newPortId);
56+
portAdded_(moduleIn->id(), newPortId);
5757
}
5858
}
5959
}
@@ -70,7 +70,7 @@ void DynamicPortManager::connectionRemovedNeedToRemoveAPort(const SCIRun::Datafl
7070
{
7171
ModuleBuilder builder;
7272
builder.removeInputPort(moduleIn, desc.in_.portId_);
73-
portRemoved_(moduleIn->get_id(), desc.in_.portId_);
73+
portRemoved_(moduleIn->id(), desc.in_.portId_);
7474
}
7575
}
7676
}

src/Dataflow/Engine/Controller/NetworkEditorController.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ namespace
141141
uiVisible = true;
142142
}
143143
auto mod = nec_.addModule(m);
144-
if (mod->has_ui())
144+
if (mod->hasUI())
145145
mod->setUiVisible(uiVisible);
146146
mods_.push_back(mod);
147-
positions.modulePositions[mod->get_id().id_] =
147+
positions.modulePositions[mod->id().id_] =
148148
{ snippetSpacer + numSnips * MODULE_HORIZONTAL_SPACING,
149149
snippetSpacer + MODULE_VERTICAL_SPACING * i++ };
150150
}
@@ -280,9 +280,9 @@ void NetworkEditorController::interruptModule(const ModuleId& id)
280280
ModuleHandle NetworkEditorController::duplicateModule(const ModuleHandle& module)
281281
{
282282
ENSURE_NOT_NULL(module, "Cannot duplicate null module");
283-
auto id(module->get_id());
284-
auto newModule = addModuleImpl(module->get_info());
285-
newModule->set_state(module->get_state()->clone());
283+
auto id(module->id());
284+
auto newModule = addModuleImpl(module->info());
285+
newModule->setState(module->get_state()->clone());
286286
static ModuleCounter dummy;
287287
moduleAdded_(id.name_, newModule, dummy);
288288

@@ -485,7 +485,7 @@ void NetworkEditorController::loadNetwork(const NetworkFileHandle& xml)
485485
for (size_t i = 0; i < theNetwork_->nmodules(); ++i)
486486
{
487487
auto module = theNetwork_->module(i);
488-
moduleAdded_(module->get_module_name(), module, modulesDone);
488+
moduleAdded_(module->name(), module, modulesDone);
489489
networkDoneLoading_(static_cast<int>(i));
490490
}
491491

@@ -562,7 +562,7 @@ void NetworkEditorController::appendToNetwork(const NetworkFileHandle& xml)
562562
for (size_t i = startIndex; i < theNetwork_->nmodules(); ++i)
563563
{
564564
auto module = theNetwork_->module(i);
565-
moduleAdded_(module->get_module_name(), module, modulesDone);
565+
moduleAdded_(module->name(), module, modulesDone);
566566
}
567567

568568
{

0 commit comments

Comments
 (0)