Skip to content

Commit 4a454a9

Browse files
committed
Merge remote-tracking branch 'origin/releaseCandidate_O' into change-background
Conflicts: src/Interface/Modules/Render/ViewSceneControlsDock.cc
2 parents f76ec22 + ab67001 commit 4a454a9

21 files changed

+340
-128
lines changed

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ MESSAGE(STATUS "Git version commit hash: " "${VERSION_HASHVAR}")
9797
string(REGEX REPLACE "^v([0-9]+)\\..*" "\\1" VERSION_MAJOR "${VERSION_TAG}")
9898
string(REGEX REPLACE "^v[0-9]+\\.([0-9]+).*" "\\1" VERSION_MINOR "${VERSION_TAG}")
9999
#TODO: make generic
100-
string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\-(alpha.[A-Z]+)\\-.*" "\\1" VERSION_PATCH "${VERSION_TAG}")
100+
string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\-(alpha.[A-Za-z]+)\\-.*" "\\1" VERSION_PATCH "${VERSION_TAG}")
101101
#TODO: parse SHA
102102
#string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.[0-9]+(.*)" "\\1" VERSION_SHA1 "${VERSION}")
103103
#set(VERSION_SHORT "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")

src/Core/Algorithms/Base/AlgorithmBase.cc

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ AlgorithmBase::~AlgorithmBase() {}
6565

6666
namespace
6767
{
68-
// Note: boost::serialization has trouble with NaN values, in addition to the platform differences.
68+
// Note: boost::serialization has trouble with NaN values, in addition to the platform differences.
6969
// Workaround will be to store a string in place of the actual double nan value.
7070
// TODO: investigate if this is a problem with infinities too. No modules store them at the moment.
7171
const std::string nanString = "NaN";
@@ -131,15 +131,20 @@ boost::filesystem::path AlgorithmParameter::toFilename() const
131131
boost::this_thread::sleep(boost::posix_time::milliseconds(10));
132132
Guard g(AlgorithmParameterHelper::lock_.get());
133133
boost::this_thread::sleep(boost::posix_time::milliseconds(10));
134-
boost::filesystem::path::imbue( std::locale( "" ) );
134+
boost::filesystem::path::imbue( std::locale( "" ) );
135135
boost::filesystem::path dummy("boost bug workaround");
136136
Log::get() << DEBUG_LOG << dummy.string() << std::endl;
137137
#endif
138138
}
139139

140140
auto stringPath = toString();
141141
if (SCIRun::Core::replaceSubstring(stringPath, AlgorithmParameterHelper::dataDirPlaceholder(), ""))
142+
{
143+
// TODO #787
144+
// loop through all paths in path list, checking if file exists each time. return first one that exists.
142145
return AlgorithmParameterHelper::dataDir() / stringPath;
146+
}
147+
143148
boost::filesystem::path p(stringPath);
144149
return p;
145150
}
@@ -252,7 +257,7 @@ void AlgorithmParameterList::addParameter(const AlgorithmParameterName& key, con
252257
parameters_[key] = AlgorithmParameter(key, defaultValue);
253258
}
254259

255-
AlgorithmStatusReporter::AlgorithmStatusReporter()
260+
AlgorithmStatusReporter::AlgorithmStatusReporter()
256261
{
257262
#if DEBUG
258263
setUpdaterFunc(defaultUpdaterFunc_);
@@ -263,7 +268,7 @@ AlgorithmStatusReporter::AlgorithmStatusReporter()
263268

264269
AlgorithmStatusReporter::UpdaterFunc AlgorithmStatusReporter::defaultUpdaterFunc_([](double r) { std::cout << "Algorithm at " << std::setiosflags(std::ios::fixed) << std::setprecision(2) << r*100 << "% complete" << std::endl;});
265270

266-
ScopedAlgorithmStatusReporter::ScopedAlgorithmStatusReporter(const AlgorithmStatusReporter* asr, const std::string& tag) : asr_(asr)
271+
ScopedAlgorithmStatusReporter::ScopedAlgorithmStatusReporter(const AlgorithmStatusReporter* asr, const std::string& tag) : asr_(asr)
267272
{
268273
if (asr_)
269274
asr_->report_start(tag);
@@ -296,7 +301,7 @@ bool AlgorithmParameterList::set_option(const AlgorithmParameterName& key, const
296301

297302
if (paramIt == parameters_.end())
298303
return keyNotFoundPolicy(key);
299-
304+
300305
AlgoOption param = paramIt->second.toOption();
301306

302307
if (param.options_.find(value) == param.options_.end())
@@ -341,7 +346,7 @@ void AlgorithmBase::dumpAlgoState() const
341346
{
342347
std::ostringstream ostr;
343348
ostr << "Algorithm state for " << typeid(*this).name() << " id#" << id() << std::endl;
344-
349+
345350
auto range = std::make_pair(paramsBegin(), paramsEnd());
346351
BOOST_FOREACH(const ParameterMap::value_type& pair, range)
347352
{

src/Core/Application/Preferences/Preferences.cc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
#include <Core/Logging/Log.h>
3131
#include <Core/Algorithms/Base/AlgorithmParameterHelper.h>
3232
#include <boost/filesystem.hpp>
33+
#include <boost/algorithm/string/predicate.hpp>
34+
#include <boost/algorithm/string/split.hpp>
35+
#include <boost/algorithm/string/classification.hpp>
3336

3437
using namespace SCIRun::Core;
3538
using namespace SCIRun::Core::Logging;
@@ -77,6 +80,23 @@ std::string Preferences::dataDirectoryPlaceholder() const
7780
return "%SCIRUNDATADIR%";
7881
}
7982

83+
std::vector<boost::filesystem::path> Preferences::dataPath() const
84+
{
85+
return dataPath_;
86+
}
87+
88+
void Preferences::addToDataPath(const boost::filesystem::path& path)
89+
{
90+
dataPath_.push_back(path);
91+
}
92+
93+
void Preferences::setDataPath(const std::string& dirs)
94+
{
95+
std::vector<std::string> paths;
96+
boost::split(paths, dirs, boost::is_any_of(";"));
97+
std::transform(paths.begin(), paths.end(), std::back_inserter(dataPath_), [](const std::string& p) { return boost::filesystem::path(p); });
98+
}
99+
80100

81101
/// @todo
82102
//void PreferencesManager::initialize()

src/Core/Application/Preferences/Preferences.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,18 @@ namespace SCIRun
8787
boost::filesystem::path dataDirectory() const;
8888
void setDataDirectory(const boost::filesystem::path& path);
8989

90+
std::vector<boost::filesystem::path> dataPath() const;
91+
void addToDataPath(const boost::filesystem::path& path);
92+
void setDataPath(const std::string& dirs); // ;-delimited
93+
//TODO: remove path entry
94+
95+
9096
//void save_state();
9197

9298
private:
9399
//void initialize_states();
94100
boost::filesystem::path dataDir_;
101+
std::vector<boost::filesystem::path> dataPath_;
95102
};
96103

97104
}}

src/ExampleNets/FwdInvToolkit/tikhonov-inverse.srn5

Lines changed: 114 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<networkFile class_id="0" tracking_level="0" version="2">
55
<networkInfo class_id="1" tracking_level="0" version="0">
66
<modules class_id="2" tracking_level="0" version="0">
7-
<count>15</count>
7+
<count>16</count>
88
<item_version>0</item_version>
99
<item class_id="3" tracking_level="0" version="0">
1010
<first>BuildNoiseColumnMatrix:5</first>
@@ -62,6 +62,34 @@
6262
</state>
6363
</second>
6464
</item>
65+
<item>
66+
<first>CreateStandardColorMap:15</first>
67+
<second>
68+
<module>
69+
<package_name_>SCIRun</package_name_>
70+
<category_name_>Visualization</category_name_>
71+
<module_name_>CreateStandardColorMap</module_name_>
72+
</module>
73+
<state>
74+
<stateMap>
75+
<count>1</count>
76+
<item_version>0</item_version>
77+
<item>
78+
<first>
79+
<name>ColorMapName</name>
80+
</first>
81+
<second>
82+
<name>ColorMapName</name>
83+
<value>
84+
<which>2</which>
85+
<value>Rainbow</value>
86+
</value>
87+
</second>
88+
</item>
89+
</stateMap>
90+
</state>
91+
</second>
92+
</item>
6593
<item>
6694
<first>EditMeshBoundingBox:11</first>
6795
<second>
@@ -604,7 +632,7 @@
604632
</module>
605633
<state>
606634
<stateMap>
607-
<count>9</count>
635+
<count>12</count>
608636
<item_version>0</item_version>
609637
<item>
610638
<first>
@@ -630,6 +658,30 @@
630658
</value>
631659
</second>
632660
</item>
661+
<item>
662+
<first>
663+
<name>EdgesAsCylinders</name>
664+
</first>
665+
<second>
666+
<name>EdgesAsCylinders</name>
667+
<value>
668+
<which>3</which>
669+
<value>0</value>
670+
</value>
671+
</second>
672+
</item>
673+
<item>
674+
<first>
675+
<name>EdgesAsLines</name>
676+
</first>
677+
<second>
678+
<name>EdgesAsLines</name>
679+
<value>
680+
<which>3</which>
681+
<value>1</value>
682+
</value>
683+
</second>
684+
</item>
633685
<item>
634686
<first>
635687
<name>FaceTransparency</name>
@@ -642,6 +694,18 @@
642694
</value>
643695
</second>
644696
</item>
697+
<item>
698+
<first>
699+
<name>FaceTransparencyValue</name>
700+
</first>
701+
<second>
702+
<name>FaceTransparencyValue</name>
703+
<value>
704+
<which>1</which>
705+
<value>5.00000000000000000e-001</value>
706+
</value>
707+
</second>
708+
</item>
645709
<item>
646710
<first>
647711
<name>NodeAsPoints</name>
@@ -728,7 +792,7 @@
728792
</module>
729793
<state>
730794
<stateMap>
731-
<count>9</count>
795+
<count>12</count>
732796
<item_version>0</item_version>
733797
<item>
734798
<first>
@@ -754,6 +818,30 @@
754818
</value>
755819
</second>
756820
</item>
821+
<item>
822+
<first>
823+
<name>EdgesAsCylinders</name>
824+
</first>
825+
<second>
826+
<name>EdgesAsCylinders</name>
827+
<value>
828+
<which>3</which>
829+
<value>0</value>
830+
</value>
831+
</second>
832+
</item>
833+
<item>
834+
<first>
835+
<name>EdgesAsLines</name>
836+
</first>
837+
<second>
838+
<name>EdgesAsLines</name>
839+
<value>
840+
<which>3</which>
841+
<value>1</value>
842+
</value>
843+
</second>
844+
</item>
757845
<item>
758846
<first>
759847
<name>FaceTransparency</name>
@@ -766,6 +854,18 @@
766854
</value>
767855
</second>
768856
</item>
857+
<item>
858+
<first>
859+
<name>FaceTransparencyValue</name>
860+
</first>
861+
<second>
862+
<name>FaceTransparencyValue</name>
863+
<value>
864+
<which>1</which>
865+
<value>5.00000000000000000e-001</value>
866+
</value>
867+
</second>
868+
</item>
769869
<item>
770870
<first>
771871
<name>NodeAsPoints</name>
@@ -1061,19 +1161,19 @@
10611161
<name>ColorMapObject</name>
10621162
<id>0</id>
10631163
</port1_>
1064-
<moduleId2_>ShowField:12</moduleId2_>
1164+
<moduleId2_>ShowField:13</moduleId2_>
10651165
<port2_>
10661166
<name>ColorMapObject</name>
10671167
<id>0</id>
10681168
</port2_>
10691169
</item>
10701170
<item>
1071-
<moduleId1_>CreateStandardColorMap:14</moduleId1_>
1171+
<moduleId1_>CreateStandardColorMap:15</moduleId1_>
10721172
<port1_>
10731173
<name>ColorMapObject</name>
10741174
<id>0</id>
10751175
</port1_>
1076-
<moduleId2_>ShowField:13</moduleId2_>
1176+
<moduleId2_>ShowField:12</moduleId2_>
10771177
<port2_>
10781178
<name>ColorMapObject</name>
10791179
<id>0</id>
@@ -1274,7 +1374,7 @@
12741374
</connections>
12751375
</networkInfo>
12761376
<modulePositions class_id="15" tracking_level="0" version="0">
1277-
<count>15</count>
1377+
<count>16</count>
12781378
<item_version>0</item_version>
12791379
<item class_id="16" tracking_level="0" version="0">
12801380
<first>BuildNoiseColumnMatrix:5</first>
@@ -1290,6 +1390,13 @@
12901390
<second>1.52000000000000000e+002</second>
12911391
</second>
12921392
</item>
1393+
<item>
1394+
<first>CreateStandardColorMap:15</first>
1395+
<second>
1396+
<first>0.00000000000000000e+000</first>
1397+
<second>1.52000000000000000e+002</second>
1398+
</second>
1399+
</item>
12931400
<item>
12941401
<first>EditMeshBoundingBox:11</first>
12951402
<second>

0 commit comments

Comments
 (0)