Skip to content
Permalink
Browse files

Merge branch 'master' into streamShot

  • Loading branch information
dcwhite committed Nov 20, 2019
2 parents 35e94a6 + a82d8ec commit 4ceaa62e5ddc7bf629a6655a41a07cf48363691a
@@ -1,9 +1,6 @@
name: CI

on:
pull_request:
branches:
- master
on: [push, pull_request]

jobs:
linux-build:
@@ -57,7 +57,7 @@ ENDIF()

###########################################
# Configure test support
OPTION(BUILD_TESTING "Build with tests." ON)
OPTION(BUILD_TESTING "Build with tests." OFF)

###########################################
# Configure python
@@ -260,6 +260,7 @@ SET(SCIRUN_CACHE_ARGS
"-DBUILD_HEADLESS:BOOL=${BUILD_HEADLESS}"
"-DSCIRUN_TEST_RESOURCE_DIR:PATH=${SCIRUN_TEST_RESOURCE_DIR}"
"-DBUILD_WITH_PYTHON:BOOL=${BUILD_WITH_PYTHON}"
"-DTRAVIS_BUILD:BOOL=${TRAVIS_BUILD}"
"-DUSER_PYTHON_VERSION:STRING=${USER_PYTHON_VERSION}"
"-DUSER_PYTHON_VERSION_MAJOR:STRING=${USER_PYTHON_VERSION_MAJOR}"
"-DUSER_PYTHON_VERSION_MINOR:STRING=${USER_PYTHON_VERSION_MINOR}"
@@ -558,6 +558,10 @@ IF(NOT BUILD_HEADLESS)

ENDIF()

IF(TRAVIS_BUILD)
ADD_DEFINITIONS(-DTRAVIS_BUILD)
ENDIF()

########################################################################
# Find and configure dl library

@@ -832,12 +836,14 @@ SET_PROPERTY(TARGET Graphics_Glyphs PROPERTY FOLDER "Graphics")
SET_PROPERTY(TARGET Graphics_Widgets PROPERTY FOLDER "Graphics")
SET_PROPERTY(TARGET Graphics_Datatypes PROPERTY FOLDER "Graphics")

SET_PROPERTY(TARGET gmock PROPERTY FOLDER "Testing Support")
SET_PROPERTY(TARGET gmock_main PROPERTY FOLDER "Testing Support")
SET_PROPERTY(TARGET gtest PROPERTY FOLDER "Testing Support")
SET_PROPERTY(TARGET gtest_main PROPERTY FOLDER "Testing Support")
SET_PROPERTY(TARGET Testing_Utils PROPERTY FOLDER "Testing Support")
SET_PROPERTY(TARGET Testing_ModuleTestBase PROPERTY FOLDER "Testing Support")
IF(BUILD_TESTING OR TRAVIS_BUILD)
SET_PROPERTY(TARGET gmock PROPERTY FOLDER "Testing Support")
SET_PROPERTY(TARGET gmock_main PROPERTY FOLDER "Testing Support")
SET_PROPERTY(TARGET gtest PROPERTY FOLDER "Testing Support")
SET_PROPERTY(TARGET gtest_main PROPERTY FOLDER "Testing Support")
SET_PROPERTY(TARGET Testing_Utils PROPERTY FOLDER "Testing Support")
SET_PROPERTY(TARGET Testing_ModuleTestBase PROPERTY FOLDER "Testing Support")
ENDIF()

IF(BUILD_TESTING)

@@ -86,5 +86,6 @@ IF(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DBUILD_Algorithms_Factory)
ENDIF(BUILD_SHARED_LIBS)

# Framework test: always build
ADD_SUBDIRECTORY(Tests)
IF(BUILD_TESTING OR TRAVIS_BUILD)
ADD_SUBDIRECTORY(Tests)
ENDIF()
@@ -405,7 +405,7 @@ CalculateDistanceFieldAlgo::runImpl(FieldHandle input, FieldHandle object, Field
}

detail::CalculateDistanceFieldP palgo(imesh,objmesh,ofield,this);
auto task_i = [&palgo,this](int i) { palgo.parallel(i, Parallel::NumCores()); };
auto task_i = [&palgo](int i) { palgo.parallel(i, Parallel::NumCores()); };
Parallel::RunTasks(task_i, Parallel::NumCores());

return (true);
@@ -490,7 +490,7 @@ CalculateDistanceFieldAlgo::runImpl(FieldHandle input, FieldHandle object, Field
}

detail::CalculateDistanceFieldP palgo(imesh,objmesh,objfield,dfield,vfield,this);
auto task_i = [&palgo,this](int i) { palgo.parallel2(i, Parallel::NumCores()); };
auto task_i = [&palgo](int i) { palgo.parallel2(i, Parallel::NumCores()); };
Parallel::RunTasks(task_i, Parallel::NumCores());

return (true);
@@ -721,7 +721,7 @@ CalculateSignedDistanceFieldAlgo::run(FieldHandle input, FieldHandle object, Fie
objmesh->synchronize(Mesh::FIND_CLOSEST_ELEM_E|Mesh::EDGES_E);
CalculateSignedDistanceFieldP palgo(imesh, objmesh, ofield, this);
const int numThreads = Parallel::NumCores();
auto task_i = [&palgo,numThreads,this](int i) { palgo.parallel(i, numThreads); };
auto task_i = [&palgo,numThreads](int i) { palgo.parallel(i, numThreads); };
Parallel::RunTasks(task_i, numThreads);

return (true);
@@ -810,7 +810,7 @@ CalculateSignedDistanceFieldAlgo::run(FieldHandle input, FieldHandle object, Fie

CalculateSignedDistanceFieldP palgo(imesh, objmesh, objfield, dfield, vfield, this);

auto task_i = [&palgo,this](int i) { palgo.parallel2(i, Parallel::NumCores()); };
auto task_i = [&palgo](int i) { palgo.parallel2(i, Parallel::NumCores()); };
Parallel::RunTasks(task_i, Parallel::NumCores());

return (true);
@@ -6,9 +6,9 @@ namespace spire {
//------------------------------------------------------------------------------
ArcBall::ArcBall(const glm::vec3& center, glm::float_t radius, bool inverted, const glm::mat4& screenToTCS) :
mScreenToTCS(screenToTCS),
invertHemisphere(inverted),
mCenter(center),
mRadius(radius)
mRadius(radius),
invertHemisphere(inverted)
{
// glm uses the following format for quaternions: w,x,y,z.
// w, x, y, z
@@ -35,8 +35,8 @@ class SCISHARE ArcBall
/// default is 0.75.
/// \param screenToTCS Transformation from screen coordinates
/// to TCS. \p center and \p radius are given in TCS.
ArcBall(const glm::vec3& center, glm::float_t radius, bool inverted = false,
const glm::mat4& screenToTCS = glm::mat4());
ArcBall(const glm::vec3& center, glm::float_t radius, bool inverted = false,
const glm::mat4& screenToTCS = glm::mat4());

/// Initiate an arc ball drag given the mouse click in screen coordinates.
/// \param mouseScreenCoords Mouse screen coordinates.
@@ -47,9 +47,11 @@ endif()
#message(FATAL_ERROR "The submodules were not downloaded! GIT_SUBMODULE was turned off or failed. Please update submodules and try again.")
#endif()

if(NOT EXISTS "${PROJECT_SOURCE_DIR}/Externals/submodules/googletest/CMakeLists.txt")
IF(BUILD_TESTING OR TRAVIS_BUILD)
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/Externals/submodules/googletest/CMakeLists.txt")
message(FATAL_ERROR "The submodules were not downloaded! GIT_SUBMODULE was turned off or failed. Please update submodules and try again.")
endif()
endif()
ENDIF()

#IF(BUILD_WITH_PYTHON)
# SET(PYTHON_EXECUTABLE ${SCI_PYTHON_EXE})
@@ -61,7 +63,9 @@ endif()
# ADD_SUBDIRECTORY(pybind11)
#ENDIF()

ADD_SUBDIRECTORY(googletest)
IF(BUILD_TESTING OR TRAVIS_BUILD)
ADD_SUBDIRECTORY(googletest)
ENDIF()

IF(WITH_OSPRAY)
set(OSPRAY_TASKING_SYSTEM "TBB")
@@ -132,6 +132,10 @@ QT_WRAP_UI(Interface_Application_FORMS_HEADERS "${Interface_Application_FORMS}")
QT_WRAP_CPP(Interface_Application_HEADERS_MOC "${Interface_Application_HEADERS}")
QT_ADD_RESOURCES(Interface_Application_RESOURCES_RCC "${Interface_Application_RESOURCES}")

IF(BUILD_BUNDLE)
ADD_DEFINITIONS(-DBUILD_BUNDLE)
ENDIF()

SCIRUN_ADD_LIBRARY(Interface_Application
${Interface_Application_SOURCES}
${Interface_Application_HEADERS}
@@ -424,4 +424,12 @@ void PythonConsoleWidget::showBanner()
PythonInterpreter::Instance().print_banner();
}

void PythonConsoleWidget::runWizardCommand(const QString& code)
{
show();
activateWindow();
raise();
private_->console_edit_->replace_command_buffer(code);
}

#endif
@@ -49,6 +49,8 @@ class PythonConsoleWidget : public QDockWidget
explicit PythonConsoleWidget(class NetworkEditor* rootNetworkEditor, QWidget* parent = nullptr);
virtual ~PythonConsoleWidget();

void runWizardCommand(const QString& code);

public Q_SLOTS:
void showBanner();

@@ -334,25 +334,37 @@ void SCIRunMainWindow::setActionIcons()

void SCIRunMainWindow::makeFilterButtonMenu()
{
auto updateFilterStatus = [this]() { filterModuleNamesInTreeView(moduleFilterLineEdit_->text()); };

auto filterMenu = new QMenu(filterButton_);
filterActionGroup_ = new QActionGroup(filterMenu);
auto startsWithAction = new QAction("Starts with", filterButton_);
connect(startsWithAction, &QAction::triggered, updateFilterStatus);
startsWithAction->setCheckable(true);
filterActionGroup_->addAction(startsWithAction);
filterMenu->addAction(startsWithAction);

auto wildcardAction = new QAction("Use wildcards", filterButton_);
connect(wildcardAction, &QAction::triggered, updateFilterStatus);
wildcardAction->setCheckable(true);
filterActionGroup_->addAction(wildcardAction);
filterMenu->addAction(wildcardAction);

auto fuzzySearchAction = new QAction("Use fuzzy search", filterButton_);
connect(fuzzySearchAction, &QAction::triggered, updateFilterStatus);
fuzzySearchAction->setCheckable(true);
filterActionGroup_->addAction(fuzzySearchAction);
fuzzySearchAction->setChecked(true);
filterMenu->addAction(fuzzySearchAction);

filterButton_->setMenu(filterMenu);
auto filterUIAction = new QAction("Filter UI only", filterButton_);
connect(filterUIAction, &QAction::triggered, updateFilterStatus);
filterUIAction->setCheckable(true);
filterActionGroup_->addAction(filterUIAction);
filterUIAction->setChecked(false);
filterMenu->addAction(filterUIAction);

filterButton_->setMenu(filterMenu);
}

void SCIRunMainWindow::setupScriptedEventsWindow()
@@ -167,6 +167,8 @@ void SCIRunMainWindow::filterModuleNamesInTreeView(const QString& start)
searchType = HideItemsNotMatchingString::SearchType::WILDCARDS;
else if(filterActionGroup_->checkedAction()->text().contains("fuzzy search"))
searchType = HideItemsNotMatchingString::SearchType::FUZZY_SEARCH;
else if(filterActionGroup_->checkedAction()->text().contains("Filter UI only"))
searchType = HideItemsNotMatchingString::SearchType::HIDE_NON_UI;

HideItemsNotMatchingString func(searchType, start);

@@ -892,18 +894,19 @@ void SCIRunMainWindow::openToolkitNetwork()

void SCIRunMainWindow::launchNewInstance()
{
#ifdef __APPLE__
//TODO: test with bundle/installer
#ifdef __APPLE__
auto appFilepath = Core::Application::Instance().executablePath();
qDebug() << Core::Application::Instance().applicationName().c_str();
qDebug() << appFilepath.string().c_str();
qDebug() << appFilepath.parent_path().parent_path().string().c_str();
auto command = "open -n " +
(appFilepath.parent_path().parent_path() / "SCIRun/SCIRun_test").string() + " &";
qDebug() << command.c_str();
system( command.c_str() );

#endif
#ifdef BUILD_BUNDLE
auto execName = appFilepath / "SCIRun";
#else
auto execName = appFilepath.parent_path().parent_path() / "SCIRun/SCIRun_test";
#endif

auto command = "open -n " + execName.string() + " &";

system( command.c_str() );
#endif
}

void SCIRunMainWindow::maxCoreValueChanged(int value)
@@ -251,6 +251,7 @@ void SCIRunMainWindow::fillTreeWidget(QTreeWidget* tree, const ModuleDescription
moduleItem->setForeground(1, Qt::lightGray);
moduleItem->setText(2, QString::fromStdString(module.second.moduleInfo_));
moduleItem->setForeground(2, Qt::lightGray);
moduleItem->setData(0, Qt::UserRole, module.second.hasUI_);
categoryItem->addChild(moduleItem);
totalModules++;
}
@@ -40,7 +40,9 @@ void GrabNameAndSetFlags::operator()(QTreeWidgetItem* item)
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
}

HideItemsNotMatchingString::HideItemsNotMatchingString(SearchType searchType, const QString& pattern) : match_("*" + pattern + "*", Qt::CaseInsensitive, QRegExp::Wildcard), start_(pattern), searchType_(searchType) {}
HideItemsNotMatchingString::HideItemsNotMatchingString(SearchType searchType, const QString& pattern) :
match_("*" + pattern + "*", Qt::CaseInsensitive, QRegExp::Wildcard),
start_(pattern), searchType_(searchType) {}

void HideItemsNotMatchingString::operator()(QTreeWidgetItem* item)
{
@@ -81,7 +83,9 @@ void HideItemsNotMatchingString::operator()(QTreeWidgetItem* item)
bool HideItemsNotMatchingString::shouldHide(QTreeWidgetItem* item)
{
auto text = item->text(0);
if (searchType_ == SearchType::STARTS_WITH)
if (searchType_ == SearchType::HIDE_NON_UI)
return !item->data(0, Qt::UserRole).toBool();
else if (searchType_ == SearchType::STARTS_WITH)
return !text.startsWith(start_, Qt::CaseInsensitive);
else if(searchType_ == SearchType::WILDCARDS
|| boost::contains(start_, "*"))
@@ -61,7 +61,8 @@ namespace Gui {
{
STARTS_WITH,
WILDCARDS,
FUZZY_SEARCH
FUZZY_SEARCH,
HIDE_NON_UI
};

explicit HideItemsNotMatchingString(SearchType searchType, const QString& pattern);
@@ -2225,18 +2225,22 @@ void ViewSceneDialog::sendBugReport()
QString desktopInfo = "Desktop: " % QSysInfo::prettyProductName() % "\n";
QString kernelInfo = "Kernel: " % QSysInfo::kernelVersion() % "\n";
QString gpuInfo = "GPU: " % gpuVersion % "\n";

#ifndef TRAVIS_BUILD // disable for older Qt 5 versions
QString qtInfo = "QT Version: " % QLibraryInfo::version().toString() % "\n";
QString glInfo = "GL Version: " % glVersion % "\n";
QString scirunVersionInfo = "SCIRun Version: " % QString::fromStdString(VersionInfo::GIT_VERSION_TAG) % "\n";
QString machineIdInfo = "Machine ID: " % QString(QSysInfo::machineUniqueId()) % "\n";

//TODO: need generic email
static QString recipient = "dwhite@sci.utah.edu";
static QString subject = "View%20Scene%20Bug%20Report";
QDesktopServices::openUrl(QUrl(QString("mailto:" % recipient % "?subject=" % subject % "&body=" %
askForScreenshot % instructions % prereqs % reportGuide %
describe % askForData % reproduction % expectedBehavior %
additional % desktopInfo % kernelInfo % gpuInfo %
qtInfo % glInfo % scirunVersionInfo % machineIdInfo)));
#endif
}

//--------------------------------------------------------------------------------------------------
@@ -100,5 +100,6 @@ IF(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DBUILD_Modules_Factory)
ENDIF(BUILD_SHARED_LIBS)

# Framework test: always build
ADD_SUBDIRECTORY(Tests)
IF(BUILD_TESTING OR TRAVIS_BUILD)
ADD_SUBDIRECTORY(Tests)
ENDIF()
@@ -27,9 +27,10 @@
# DEALINGS IN THE SOFTWARE.
#

ADD_SUBDIRECTORY(Utils)
ADD_SUBDIRECTORY(ModuleTestBase)

IF(BUILD_TESTING OR TRAVIS_BUILD)
ADD_SUBDIRECTORY(Utils)
ADD_SUBDIRECTORY(ModuleTestBase)
ENDIF()

IF(BUILD_TESTING)

0 comments on commit 4ceaa62

Please sign in to comment.
You can’t perform that action at this time.