Skip to content

Commit 2168fff

Browse files
authored
Merge pull request #2285 from SCIInstitute/complete-viewscene-state
Complete viewscene state
2 parents aa5de14 + 0fd5c90 commit 2168fff

File tree

394 files changed

+42892
-9553
lines changed

Some content is hidden

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

394 files changed

+42892
-9553
lines changed

.github/workflows/ccpp.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
matrix:
17-
os: [ubuntu-16.04, ubuntu-18.04, ubuntu-latest]
17+
os: [ubuntu-latest]
1818

1919
steps:
2020
- name: Checkout
@@ -36,7 +36,7 @@ jobs:
3636
runs-on: ${{ matrix.os }}
3737
strategy:
3838
matrix:
39-
os: [ubuntu-16.04, ubuntu-18.04, ubuntu-latest]
39+
os: [ubuntu-latest]
4040

4141
steps:
4242
- name: Checkout
@@ -58,7 +58,7 @@ jobs:
5858
runs-on: ${{ matrix.os }}
5959
strategy:
6060
matrix:
61-
os: [ubuntu-16.04, ubuntu-18.04, ubuntu-latest]
61+
os: [ubuntu-latest]
6262

6363
steps:
6464
- name: Checkout
@@ -80,7 +80,7 @@ jobs:
8080
runs-on: ${{ matrix.os }}
8181
strategy:
8282
matrix:
83-
os: [ubuntu-16.04, ubuntu-18.04, ubuntu-latest]
83+
os: [ubuntu-latest]
8484

8585
steps:
8686
- name: Checkout

Superbuild/Superbuild.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ ENDIF()
174174
ADD_EXTERNAL( ${SUPERBUILD_DIR}/EigenExternal.cmake Eigen_external )
175175
ADD_EXTERNAL( ${SUPERBUILD_DIR}/ZlibExternal.cmake Zlib_external )
176176
ADD_EXTERNAL( ${SUPERBUILD_DIR}/SQLiteExternal.cmake SQLite_external )
177-
ADD_EXTERNAL( ${SUPERBUILD_DIR}/LibPNGExternal.cmake LibPNG_external )
178177
ADD_EXTERNAL( ${SUPERBUILD_DIR}/TeemExternal.cmake Teem_external )
179178
ADD_EXTERNAL( ${SUPERBUILD_DIR}/FreetypeExternal.cmake Freetype_external )
180179
ADD_EXTERNAL( ${SUPERBUILD_DIR}/GLMExternal.cmake GLM_external )
@@ -244,7 +243,6 @@ SET(SCIRUN_CACHE_ARGS
244243
"-DGENERATE_MODULE_FACTORY_CODE:BOOL=${GENERATE_MODULE_FACTORY_CODE}"
245244
"-DEigen_DIR:PATH=${Eigen_DIR}"
246245
"-DZlib_DIR:PATH=${Zlib_DIR}"
247-
"-DLibPNG_DIR:PATH=${LibPNG_DIR}"
248246
"-DSQLite_DIR:PATH=${SQLite_DIR}"
249247
"-DBoost_DIR:PATH=${Boost_DIR}"
250248
"-DTeem_DIR:PATH=${Teem_DIR}"

Superbuild/TeemExternal.cmake

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# For more information, please see: http://software.sci.utah.edu
2-
#
2+
#
33
# The MIT License
4-
#
4+
#
55
# Copyright (c) 2015 Scientific Computing and Imaging Institute,
66
# University of Utah.
7-
#
8-
#
7+
#
8+
#
99
# Permission is hereby granted, free of charge, to any person obtaining a
1010
# copy of this software and associated documentation files (the "Software"),
1111
# to deal in the Software without restriction, including without limitation
1212
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
1313
# and/or sell copies of the Software, and to permit persons to whom the
1414
# Software is furnished to do so, subject to the following conditions:
15-
#
15+
#
1616
# The above copyright notice and this permission notice shall be included
17-
# in all copies or substantial portions of the Software.
18-
#
17+
# in all copies or substantial portions of the Software.
18+
#
1919
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2020
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2121
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
@@ -25,8 +25,8 @@
2525
# DEALINGS IN THE SOFTWARE.
2626

2727
SET_PROPERTY(DIRECTORY PROPERTY "EP_BASE" ${ep_base})
28-
SET(teem_GIT_TAG "origin/master")
29-
SET(teem_DEPENDENCIES "Zlib_external;LibPNG_external")
28+
SET(teem_GIT_TAG "origin/adjust-png")
29+
SET(teem_DEPENDENCIES "Zlib_external")
3030

3131
# If CMake ever allows overriding the checkout command or adding flags,
3232
# git checkout -q will silence message about detached head (harmless).
@@ -42,7 +42,6 @@ ExternalProject_Add(Teem_external
4242
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
4343
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
4444
-DZlib_DIR:PATH=${Zlib_DIR}
45-
-DLibPNG_DIR:PATH=${LibPNG_DIR}
4645
-DTeem_USE_NRRD_INTERNALS:BOOL=ON
4746
)
4847

Superbuild/UseBoost.cmake

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
include_directories(${SCI_BOOST_INCLUDE})
32
link_directories(${SCI_BOOST_LIBRARY_DIR})
43
add_definitions(-DBOOST_ALL_NO_LIB)
@@ -10,6 +9,10 @@ if(UNIX)
109
add_definitions(-DBOOST_NO_CXX11_ALLOCATOR)
1110
endif()
1211

12+
check_c_compiler_flag("-arch x86_64" x86_64Supported)
13+
#message("x86_64Supported=${x86_64Supported}")
14+
check_c_compiler_flag("-arch arm64" arm64Supported)
15+
#message("arm64Supported=${arm64Supported}")
1316

1417
# TODO: if static runtime link is supported, then ABI tag postfix must include s
1518
# see:
@@ -25,6 +28,11 @@ if(WIN32)
2528
else()
2629
set(DEBUG_POSTFIX "-yd")
2730
set(boost_LIB_PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX})
31+
if(${arm64Supported})
32+
set(PLATFORM_SUFFIX "a64")
33+
else()
34+
set(PLATFORM_SUFFIX "x64")
35+
endif()
2836
endif()
2937

3038
foreach(lib ${SCI_BOOST_LIBRARY})
@@ -34,9 +42,9 @@ foreach(lib ${SCI_BOOST_LIBRARY})
3442
set(FULL_LIB_NAME "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}${lib}${DEBUG_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
3543
elseif(APPLE OR UNIX)
3644
if(${lib} MATCHES "boost_python-mt")
37-
set(FULL_LIB_NAME "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}boost_python${USER_PYTHON_VERSION_MAJOR}${USER_PYTHON_VERSION_MINOR}-mt-x64${CMAKE_STATIC_LIBRARY_SUFFIX}")
45+
set(FULL_LIB_NAME "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}boost_python${USER_PYTHON_VERSION_MAJOR}${USER_PYTHON_VERSION_MINOR}-mt-${PLATFORM_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
3846
else()
39-
set(FULL_LIB_NAME "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}${lib}-x64${CMAKE_STATIC_LIBRARY_SUFFIX}")
47+
set(FULL_LIB_NAME "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}${lib}-${PLATFORM_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
4048
endif()
4149
else()
4250
if(${lib} MATCHES "boost_python-mt")

src/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ IF(${CMAKE_SOURCE_DIR} MATCHES ${CMAKE_BINARY_DIR})
4545
MESSAGE( FATAL_ERROR "Goodbye." )
4646
ENDIF()
4747

48+
include(CheckCCompilerFlag)
49+
4850
########################################################################
4951
# Build shared libraries by default
5052

@@ -206,9 +208,6 @@ ENDMACRO()
206208
CONFIG_STANDARD_EXTERNAL( Zlib ZlibConfig.cmake ${Zlib_DIR} )
207209
INCLUDE(${ZLIB_USE_FILE})
208210

209-
CONFIG_STANDARD_EXTERNAL( LibPNG LibPNGConfig.cmake ${LibPNG_DIR} )
210-
INCLUDE(${PNG_USE_FILE})
211-
212211
CONFIG_STANDARD_EXTERNAL( SQLite SQLiteConfig.cmake ${SQLite_DIR} )
213212
INCLUDE(${SQLITE_USE_FILE})
214213

src/Core/Algorithms/Base/AlgorithmBase.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838

3939
#include <Core/Utils/StringUtil.h>
4040
#include <Core/Algorithms/Base/Name.h>
41+
#include <Core/Algorithms/Base/VariableHelper.h>
4142
#include <Core/Algorithms/Base/AlgorithmBase.h>
4243
#include <Core/Algorithms/Base/AlgorithmParameterHelper.h>
4344
#include <Core/Algorithms/Base/AlgorithmInputBuilder.h>
@@ -477,3 +478,8 @@ std::vector<double> Core::Algorithms::toDoubleVector(const Variable::List& list)
477478
{
478479
return toTypedVector<double>(list, [](const Variable& v) { return v.toDouble(); });
479480
}
481+
482+
std::vector<bool> Core::Algorithms::toBoolVector(const Variable::List& list)
483+
{
484+
return toTypedVector<bool>(list, [](const Variable& v) { return v.toBool(); });
485+
}

src/Core/Algorithms/Base/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ SET(Algorithms_Base_HEADERS
4848
Name.h
4949
Option.h
5050
Variable.h
51+
VariableHelper.h
5152
share.h
5253
)
5354

src/Core/Algorithms/Base/Variable.h

Lines changed: 5 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@
3434
#include <iosfwd>
3535
#include <boost/variant.hpp>
3636
#include <boost/filesystem/path.hpp>
37-
#ifndef Q_MOC_RUN
38-
#include <boost/iterator/counting_iterator.hpp>
39-
#endif
4037
#include <Core/Datatypes/DatatypeFwd.h>
4138
#include <Core/Algorithms/Base/AlgorithmFwd.h>
4239
#include <Core/Algorithms/Base/Name.h>
@@ -62,7 +59,7 @@ namespace Algorithms {
6259

6360
Variable() {}
6461
Variable(const Name& name, const Value& value);
65-
enum DatatypeVariableEnum { DATATYPE_VARIABLE };
62+
enum class DatatypeVariableEnum { DATATYPE_VARIABLE };
6663
Variable(const Name& name, const Datatypes::DatatypeHandle& data, DatatypeVariableEnum) : name_(name), data_(data) {}
6764

6865
const Name& name() const { return name_; }
@@ -88,93 +85,13 @@ namespace Algorithms {
8885
Datatypes::DatatypeHandleOption data_;
8986
};
9087

91-
SCISHARE bool operator==(const Variable& lhs, const Variable& rhs);
92-
SCISHARE bool operator!=(const Variable& lhs, const Variable& rhs);
93-
SCISHARE std::ostream& operator<<(std::ostream& out, const Variable& var);
94-
SCISHARE Variable makeVariable(const std::string& name, const Variable::Value& value);
95-
SCISHARE Variable makeVariable(const Name& name, const Variable::Value& value);
96-
97-
template <typename ... Ts>
98-
Variable::List makeAnonymousVariableList(Ts&&... params)
99-
{
100-
std::vector<Variable::Value> values{params...};
101-
Variable::List vars;
102-
std::transform(values.begin(), values.end(), std::back_inserter(vars),
103-
[](const Variable::Value& val) { return makeVariable("listElement", val); });
104-
return vars;
105-
}
106-
107-
template <typename ... Ts, size_t N>
108-
Variable::List makeNamedVariableList(const Name (&namesList)[N], Ts&&... params)
109-
{
110-
std::vector<Variable::Value> values{ params... };
111-
112-
auto namesIter = &namesList[0];
113-
Variable::List vars;
114-
std::transform(values.begin(), values.end(), std::back_inserter(vars),
115-
[&namesIter](const Variable::Value& val) { return Variable(*namesIter++, val); });
116-
return vars;
117-
}
118-
119-
template <typename Func>
120-
Variable::List makeHomogeneousVariableList(Func valueGenerator, size_t num)
121-
{
122-
Variable::List vars;
123-
std::transform(boost::counting_iterator<size_t>(0), boost::counting_iterator<size_t>(num), std::back_inserter(vars), [valueGenerator](size_t i) { return makeVariable("", valueGenerator(i)); });
124-
return vars;
125-
}
126-
127-
template <typename T>
128-
Variable::List makeHomogeneousVariableListFill(const T& value, size_t num)
129-
{
130-
return makeHomogeneousVariableList([value](size_t) { return value; }, num);
131-
}
132-
133-
template <typename T>
134-
std::vector<T> toTypedVector(const Variable::List& list, std::function<T(const Variable&)> convert)
135-
{
136-
std::vector<T> ts;
137-
std::transform(list.begin(), list.end(), std::back_inserter(ts), convert);
138-
return ts;
139-
}
140-
141-
SCISHARE std::vector<std::string> toStringVector(const Variable::List& list);
142-
SCISHARE std::vector<std::string> toNameVector(const Variable::List& list);
143-
SCISHARE std::vector<double> toDoubleVector(const Variable::List& list);
144-
14588
typedef Variable AlgorithmParameter;
14689
typedef Variable::List VariableList;
14790
typedef SharedPointer<Variable> VariableHandle;
14891

149-
}
150-
151-
//type-converting bolt-on class template
152-
template <typename T>
153-
class TypedVariable : public Algorithms::Variable
154-
{
155-
public:
156-
using value_type = T;
157-
TypedVariable(const std::string& name, const value_type& value) : Algorithms::Variable(Algorithms::Name(name), value) {}
158-
159-
operator value_type() const { return {}; }
160-
};
161-
162-
#define TYPED_VARIABLE_CLASS(varType, func) template <> \
163-
class TypedVariable<varType> : public Algorithms::Variable \
164-
{\
165-
public:\
166-
using value_type = varType;\
167-
TypedVariable(const std::string& name, const value_type& value) : Algorithms::Variable(Algorithms::Name(name), value) {}\
168-
operator value_type() const { return val(); }\
169-
value_type val() const { return func(); }\
170-
};
171-
172-
TYPED_VARIABLE_CLASS(bool, toBool)
173-
TYPED_VARIABLE_CLASS(std::string, toString)
174-
175-
using BooleanVariable = TypedVariable<bool>;
176-
using StringVariable = TypedVariable<std::string>;
177-
178-
}}
92+
SCISHARE bool operator==(const Variable& lhs, const Variable& rhs);
93+
SCISHARE bool operator!=(const Variable& lhs, const Variable& rhs);
94+
SCISHARE std::ostream& operator<<(std::ostream& out, const Variable& var);
95+
}}}
17996

18097
#endif

0 commit comments

Comments
 (0)