Skip to content

Commit b385347

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 6a797d0 + aa2c790 commit b385347

File tree

17 files changed

+215
-226
lines changed

17 files changed

+215
-226
lines changed

README.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,24 @@ For documentation, please see: http://sciinstitute.github.io/SCIRun/
3333

3434
### Platform Notes
3535
#### Build requirements
36-
* OS X (tested on 10.7 and 10.8)
36+
* OS X (tested on 10.7-10.11)
3737
- Apple clang 5.1
3838
- Qt 4.8
3939
+ Download from http://releases.qt-project.org/qt4/source/qt-mac-opensource-4.8.4.dmg.
4040
+ 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)
42-
- Visual Studio 2013
41+
* Windows (tested on Windows 7, 8, 10)
42+
- Visual Studio 2013, 2015
4343
- Qt 4.8
4444
+ 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)
46-
- gcc 4.6, 4.7
45+
* Linux (tested on Ubuntu 12.10, OpenSUSE Leap)
46+
- gcc 4.6, 4.7, 4.8
4747
- Qt 4.8
4848
+ 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.
4949
* All platforms
5050
- CMake 2.8
51-
+ Root cmake file is SCIRun/src/CMakeLists.txt.
51+
+ Root cmake file is SCIRun/Superbuild/CMakeLists.txt.
5252
+ Building in the source directory is not permitted.
5353
+ Make sure BUILD_SHARED_LIBS is on (default setting).
54-
+ BUILD_WITH_PYTHON works on Windows, not yet (easily) on MacOS.
5554

5655
#### CMake Build Generators
5756
* Windows
@@ -63,9 +62,8 @@ For documentation, please see: http://sciinstitute.github.io/SCIRun/
6362
- Unix Makefiles
6463

6564
#### Unix Makefiles notes
66-
* Boost must be built before the SCIRun libraries.
67-
* Parallel make builds can be used as long the Boost target is built first, for example:
68-
- make -j4 Boost_external && make -j4
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.
6967

7068
### Tagging releases
7169
On an OSX system, run script `release.sh` in the `src` directory with the release name in format `alpha.XX` as a parameter.
@@ -78,7 +76,7 @@ For help, email the testing mailing list at [email protected].
7876

7977
The MIT License
8078

81-
Copyright (c) 2015 Scientific Computing and Imaging Institute,
79+
Copyright (c) 2016 Scientific Computing and Imaging Institute,
8280
University of Utah.
8381

8482

TODO.md

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,14 @@ User Requests
99
+ better network parameter editing
1010
+ maybe a network wizard?
1111
+ show what files are being used, network file name
12-
+ better network parameter editing
1312

1413
- more example nets
1514
- more documentation, more sample networks (very useful for demonstrating module functionality)
16-
- must work with clipboard (through Qt support?)
1715
- search modules, networks for keywords
1816

1917
+ see Matlab descriptors at the top of source files as an example
2018
+ when searching for modules, can we have the option of searching within the module text (i.e. search module GUI component names, variable names etc.)
2119

22-
- error reporting should not kill SCIRun
23-
24-
+ For example, if you end up with an empty field in your network, and you have a bounding box displayed for that field, the bounding box calculation asserts that the diagonal is zero and aborts the program, which is bad. Instead, an error should be displayed and the user should be able to change the network to fix the problem.
25-
2620
- port colors: change intensities, not just colors
2721

2822
+ get updated palette from Nathan
@@ -46,11 +40,7 @@ User Requests
4640

4741
* UI
4842

49-
- select (highlight with mouse?) and copy multiple modules - connections between modules will have to be propagated as well
50-
- adjust GUI scale so it doesn't flow over bottom of screen
5143
- collapse network preview window
52-
- zoom or center network in editor
53-
- hover or hot key to expose some module parameters
5444
- side pane to expose some module parameters
5545

5646
+ expose important dataset parameters too (size, dims, data info etc.)
@@ -68,34 +58,28 @@ User Requests
6858
+ line up modules
6959
+ expose-like (OS X)
7060

71-
- Change exponential widget behavior to be more intuitive
7261
- Add GUI element for indicating result of "Clear Output" button of module CollectMatrices
7362
- Add string port to Read / Write Nrrd
7463
- Add support for newer Matlab file format
7564
- Add cylinder to vector glyph types
7665
- ShowMatrix module should detect matrix dimensions
77-
- reinterpret_cast from pointer-to-object to pointer-to-function not portable
7866
- IO plugin for Meshalyzer binary mesh format
7967
- IO plugin for a binary node index matrix
8068

8169
* Networks
8270

8371
- halt network without killing SCIRun
84-
- stop module in network
8572

8673
* Subnets
8774

8875
- subnets must work (currently broken) - should be an easy select and create operation in GUI
89-
- offer common network fragments as subnets (i.e. ShowField, ColorMap etc., ViewScene)
9076
- better views for subnets: dockable widgets, tabs etc.
9177
- duplicate entire subnet
9278
- import network into other network
9379

9480
+ choice to import as subnet or register network
9581
+ choice to save subnet as separate file
9682

97-
- 'Duplicate' should work on multiply-selected modules
98-
9983
Qt Migration
10084
============
10185

@@ -125,23 +109,10 @@ Qt Migration
125109

126110
- All menu options/preferences work
127111
- Can walk through entire SCIRun tutorial!
128-
- At this point, all essential modules should be converted. Can begin converting other individual modules.
129-
130-
* Core
131-
132-
- Discuss memory model for Matrix/Arrays/etc.
133-
- Move namespace SCIRunAlgo into SCIRun::Algo to remove need for using directives in headers.
134-
- Replace Thread library with Boost.
135-
- Boost threading notes.
136112

137113
* IO
138114

139115
- is there a way we can display a brief blurb describing file importer and exporter plugin information (i.e. show a short description of the file types supported, file extensions etc.)?
140-
- change file importer and exporter plugin function pointer table to functors
141-
142-
* Dataflow
143-
144-
- Execute all button in network editor: triggers execution even if network is currently executing. Queue (or block?) request for execution until current execution is done.
145116

146117
* Graphics and Visualization
147118

@@ -156,11 +127,6 @@ Qt Migration
156127
- verify that libpng and zlib are still needed, if so, update
157128
- better XML parsing library (libxml2 is overly complex and buggy)
158129

159-
* Boost
160-
161-
- Boost is an external project in the CMake build
162-
- In case Boost needs to be built outside of SCIRun: Boost build notes
163-
164130
* Build
165131

166132
- merge all generated headers into a single generated header file

src/Core/Application/Application.cc

Lines changed: 13 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -162,27 +162,36 @@ namespace
162162
class HardCodedPythonTestCommand : public ParameterizedCommand
163163
{
164164
public:
165+
HardCodedPythonTestCommand(const std::string& script, bool enabled) : script_(script), enabled_(enabled) {}
165166
virtual bool execute() override
166167
{
167-
auto script = Preferences::Instance().postModuleAddScript_temporarySolution.val();
168-
if (!script.empty())
168+
if (!enabled_)
169+
return false;
170+
171+
if (!script_.empty())
169172
{
170173
PythonInterpreter::Instance().run_string("import SCIRunPythonAPI; from SCIRunPythonAPI import *");
171-
PythonInterpreter::Instance().run_string(script);
174+
PythonInterpreter::Instance().run_string(script_);
172175
}
173176
return true;
174177
}
178+
private:
179+
std::string script_;
180+
bool enabled_;
175181
};
176182

177183
class HardCodedPythonFactory : public NetworkEventCommandFactory
178184
{
179185
public:
180186
virtual CommandHandle create(NetworkEventCommands type) const override
181187
{
188+
const auto& prefs = Preferences::Instance();
182189
switch (type)
183190
{
184191
case NetworkEventCommands::PostModuleAdd:
185-
return boost::make_shared<HardCodedPythonTestCommand>();
192+
return boost::make_shared<HardCodedPythonTestCommand>(prefs.postModuleAddScript_temporarySolution.val(), prefs.postModuleAddScriptEnabled_temporarySolution.val());
193+
case NetworkEventCommands::OnNetworkLoad:
194+
return boost::make_shared<HardCodedPythonTestCommand>(prefs.onNetworkLoadScript_temporarySolution.val(), prefs.onNetworkLoadScriptEnabled_temporarySolution.val());
186195
}
187196
return nullptr;
188197
}
@@ -297,141 +306,3 @@ bool Application::get_user_name( std::string& user_name ) const
297306
{
298307
return applicationHelper.get_user_name(user_name);
299308
}
300-
301-
/*
302-
int Application::GetMajorVersion()
303-
{
304-
return CORE_APPLICATION_MAJOR_VERSION;
305-
}
306-
307-
int Application::GetMinorVersion()
308-
{
309-
return CORE_APPLICATION_MINOR_VERSION;
310-
}
311-
312-
int Application::GetPatchVersion()
313-
{
314-
return CORE_APPLICATION_PATCH_VERSION;
315-
}
316-
317-
bool Application::Is64Bit()
318-
{
319-
return ( sizeof(void *) == 8 );
320-
}
321-
322-
bool Application::Is32Bit()
323-
{
324-
return ( sizeof(void *) == 4 );
325-
}
326-
327-
std::string Application::GetApplicationName()
328-
{
329-
return CORE_APPLICATION_NAME;
330-
}
331-
332-
std::string Application::GetReleaseName()
333-
{
334-
return CORE_APPLICATION_RELEASE;
335-
}
336-
337-
std::string Application::GetApplicationNameAndVersion()
338-
{
339-
return GetApplicationName() + " " + GetReleaseName() + " " + GetVersion();
340-
}
341-
342-
std::string Application::GetAbout()
343-
{
344-
return CORE_APPLICATION_ABOUT;
345-
}
346-
*/
347-
348-
#if 0 //shouldn't need this anymore
349-
// Services start up...
350-
void ApplicationPrivate::start_eai()
351-
{
352-
// Create a database of all available services. The next piece of code
353-
// scans both the SCIRun as well as the Packages directories to find
354-
// services that need to be started. Services allow communication with
355-
// thirdparty software and are Threads that run asychronously with
356-
// with the rest of SCIRun. Since the thirdparty software may be running
357-
// on a different platform it allows for connecting to remote machines
358-
// and running the service on a different machine
359-
ServiceDBHandle servicedb(new ServiceDB);
360-
// load all services and find all makers
361-
servicedb->loadpackages();
362-
// activate all services
363-
servicedb->activateall();
364-
365-
// Services are started and created by the ServiceManager,
366-
// which will be launched here
367-
// Two competing managers will be started,
368-
// one for purely internal usage and one that
369-
// communicates over a socket.
370-
// The latter will only be created if a port is set.
371-
// If the current instance of SCIRun should not provide any services
372-
// to other instances of SCIRun over the internet,
373-
// the second manager will not be launched
374-
375-
IComAddressHandle internaladdress(new IComAddress("internal","servicemanager"));
376-
377-
// Only build log file if needed for debugging
378-
#ifdef DEBUG
379-
const char *chome = sci_getenv("HOME");
380-
std::string scidir("");
381-
if (chome)
382-
scidir = chome+std::string("/SCIRun/");
383-
384-
// A log file is not necessary but handy for debugging purposes
385-
ServiceLogHandle internallogfile(new ServiceLog(scidir+"scirun_internal_servicemanager.log"));
386-
387-
ServiceManagerHandle internal_service_manager(new ServiceManager(servicedb, internaladdress, internallogfile));
388-
#else
389-
ServiceManager internal_service_manager(servicedb, internaladdress);
390-
#endif
391-
392-
boost::thread t_int(internal_service_manager);
393-
t_int.detach();
394-
395-
396-
#ifdef SCIRUN4_CODE_TO_BE_ENABLED_LATER
397-
// Use the following environment setting to switch on IPv6 support
398-
// Most machines should be running a dual-host stack for the internet
399-
// connections, so it should not hurt to run in IPv6 mode. In most case
400-
// ipv4 address will work as well.
401-
// It might be useful
402-
std::string ipstr(sci_getenv_p("SCIRUN_SERVICE_IPV6")?"ipv6":"");
403-
404-
// Start an external service as well
405-
const char *serviceport_str = sci_getenv("SCIRUN_SERVICE_PORT");
406-
// If its not set in the env, we're done
407-
if (!serviceport_str) return;
408-
409-
// The protocol for conencting has been called "scirun"
410-
// In the near future this should be replaced with "sciruns" for
411-
// a secure version which will run over ssl.
412-
413-
// A log file is not necessary but handy for debugging purposes
414-
415-
IComAddress externaladdress("scirun","",serviceport_str,ipstr);
416-
417-
#ifdef DEBUG
418-
ServiceLogHandle externallogfile =
419-
new ServiceLog(scidir+"scirun_external_servicemanager.log");
420-
421-
ServiceManager* external_service_manager =
422-
new ServiceManager(servicedb,externaladdress,externallogfile);
423-
#else
424-
ServiceManager* external_service_manager =
425-
new ServiceManager(servicedb,externaladdress);
426-
427-
#endif
428-
429-
Thread* t_ext =
430-
new Thread(external_service_manager,"external service manager",
431-
0, Thread::NotActivated);
432-
t_ext->setStackSize(1024*20);
433-
t_ext->activate(false);
434-
t_ext->detach();
435-
#endif
436-
}
437-
#endif

src/Core/Application/Preferences/Preferences.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ Preferences::Preferences() :
5151
autoNotes("autoNotes", false),
5252
modulesAreDockable("modulesAreDockable", true),
5353
networkBackgroundColor("backgroundColor", "#808080"),
54-
postModuleAddScript_temporarySolution("postModuleAddScript", "")
54+
postModuleAddScript_temporarySolution("postModuleAddScript_temporarySolution", ""),
55+
postModuleAddScriptEnabled_temporarySolution("postModuleAddScriptEnabled_temporarySolution", false),
56+
onNetworkLoadScript_temporarySolution("onNetworkLoadScript_temporarySolution", ""),
57+
onNetworkLoadScriptEnabled_temporarySolution("onNetworkLoadScriptEnabled_temporarySolution", false)
5558
{
5659
}
5760

src/Core/Application/Preferences/Preferences.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,12 @@ namespace SCIRun
8585
BooleanVariable autoNotes;
8686
TrackedVariable<BooleanVariable> modulesAreDockable;
8787
StringVariable networkBackgroundColor;
88+
89+
//super duper ugly.
8890
StringVariable postModuleAddScript_temporarySolution;
91+
BooleanVariable postModuleAddScriptEnabled_temporarySolution;
92+
StringVariable onNetworkLoadScript_temporarySolution;
93+
BooleanVariable onNetworkLoadScriptEnabled_temporarySolution;
8994

9095
std::string dataDirectoryPlaceholder() const;
9196

src/Core/Command/Command.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ namespace SCIRun
9696

9797
enum class NetworkEventCommands
9898
{
99-
PostModuleAdd
99+
PostModuleAdd,
100+
OnNetworkLoad
100101
//TODO: add more based on user request
101102
};
102103

0 commit comments

Comments
 (0)