Commit 06ba6bbb authored by Sergio Galindo's avatar Sergio Galindo
Browse files

Merge branch 'insitu' into 'master'

Release preparation. Added In-situ capabilities.

See merge request nsviz/visimpl!57
parents e022e346 9ab21e5a
# -*- mode: cmake -*-
#git_subproject( ZeroEQ https://github.com/HBPVis/ZeroEQ.git 73b209a )
#git_subproject( Lexis https://github.com/HBPVis/Lexis.git c24dc07 )
#git_subproject( gmrvlex git@gitlab.gmrv.es:nsviz/gmrvlex.git c20b194 )
#git_subproject( gmrvlex https://github.com/gmrvvis/gmrvlex.git c20b194 )
#git_subproject( Brion https://github.com/BlueBrain/Brion.git 073f356 )
git_subproject( ReTo git@gitlab.gmrv.es:nsviz/ReTo.git bdfdba7 )
git_subproject( prefr git@gitlab.gmrv.es:nsviz/prefr.git b21325f )
git_subproject( SimIL git@gitlab.gmrv.es:nsviz/SimIL.git 7800501 )
git_subproject( scoop git@gitlab.gmrv.es:gmrv/scoop.git b3326cd )
git_subproject( ReTo https://github.com/gmrvvis/ReTo.git 3c1ba17 )
git_subproject( prefr https://github.com/gmrvvis/prefr.git cddcf27 )
git_subproject( SimIL https://github.com/gmrvvis/SimIL.git 4b66e98 )
git_subproject( scoop https://github.com/gmrvvis/scoop.git b3326cd )
......@@ -9,8 +9,8 @@
cmake_minimum_required( VERSION 3.1 FATAL_ERROR )
# visimpl project and version
project( visimpl VERSION 0.1.4 )
set( visimpl_VERSION_ABI 5 )
project( visimpl VERSION 1.0.0 )
set( visimpl_VERSION_ABI 6 )
SET( VISIMPL_LICENSE "GPL")
......
# ViSimpl
## git master
## 1.0.0
* Added selection, groups and attributes visualization modes.
* Improved playback, visualization and aspect parameters management.
* Added selection manager widget and file exportation.
* Added import of visual groups from external file.
* Incorporated clipping planes selection mechanism.
* Added picking for user-defined highlighting by hand.
* Modified camera controls.
* Added in-situ capabilities through REST for network and activity streaming data.
## 0.1.4
* [!38] Fixed camera's view distance and initial positioning bug. Fixed "play-at" button.
* [!32] Added "Step by step" feature. Fixed performance issues. Improved playback precission.
* [!24] Added focus and autofocus features to show and follow the current playhead on StackViz.
......
# ViSimpl - Multi-view analysis tools
(c) 2015-2016. GMRV / URJC
(c) 2015-2020. GMRV / URJC
www.gmrv.es
gmrv@gmrv.es
## Introduction
ViSimpl consists of a set of analysis tools providing different views for the
ViSimpl consists of a set of analysis tools providing different views for the
deep analysis of the brain simulation datasets. This project contains both
SimPart and StackViz, ready to be used with BlueConfig datasets among other
file formats.
file formats such as specific HDF5 and CSV.
## Dependencies
### Strong dependences:
* OpenGL
* GLEW
* Qt5Core
* Qt5Gui
* Qt5Widgets
* Qt5OpenGL
* Boost
* Eigen3
* HDF5 1.10
* HDF5
* Qt 5.X (Qt5Core, Qt5Gui, Qt5Widgets and Qt5OpenGL)
* GLM (https://glm.g-truc.net)
* ReTo (*)
* SimIL (*)
* PReFr (*)
* scoop (*)
(*) Note: These dependencies will be automatically downloaded and compiled with
the project.
### Weak dependences
* OpenMP: multi-core functioning.
* ZeroEQ: library for collaboration between applications (*)
* Lexis: vocabulary for ZeroEQ
* GMRVLex: additional vocabulary for ZeroEQ
* Lexis: vocabulary for ZeroEQ (*)
* GMRVLex: additional vocabulary for ZeroEQ (*)
(*) Note: In order to connect applications one another, it is necessary to
compile the project with ZeroEQ and its vocabulary libraries.
compile the project with ZeroEQ and its vocabulary libraries (Lexis and GMRVLex).
## Building
ViSimpl has been succesfully built and used on Ubuntu 14.04/16.04, Mac OSX
Yosemite and Windows 7/8 (Visual Studio 2013 Win64). The following steps
should be enough to build it:
Yosemite and Windows 7/8 (Visual Studio 2013 Win64). Please note that Brion
compatibility on Windows is limited, therefore ViSimpl is not guaranteed to
work with Brion in Windows systems. The following steps should be enough to build
it:
```bash
git clone --recursive https://gitlab.gmrv.es/nsviz/visimpl.git ViSimpl
......
......@@ -53,6 +53,8 @@ set(VISIMPL_SOURCES
render/Plane.cpp
ui/DataInspector.cpp
)
set(VISIMPL_HEADERS
......@@ -72,7 +74,9 @@ set(VISIMPL_HEADERS
prefr/SourceMultiPosition.h
prefr/UpdaterStaticPosition.h
render/Plane.cpp
render/Plane.h
ui/DataInspector.h
)
......
/*
* @file DataSource.cpp
* @brief
* @author Sergio E. Galindo <sergio.galindo@urjc.es>
* @date
* @remarks Copyright (c) GMRV/URJC. All rights reserved.
* Do not distribute without further notice.
* Copyright (c) 2015-2020 GMRV/URJC.
*
* Authors: Sergio E. Galindo <sergio.galindo@urjc.es>
*
* This file is part of ViSimpl <https://github.com/gmrvvis/visimpl>
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License version 3.0 as published
* by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include "DomainManager.h"
......@@ -166,16 +179,15 @@ namespace visimpl
return _gidPositions;
}
void DomainManager::positions( const tGidPosMap& positions_ )
/*void DomainManager::positions( const tGidPosMap& positions_ )
{
_gidPositions = positions_;
reloadPositions( );
}
}*/
void DomainManager::reloadPositions( void )
{
// mode( _mode );
_resetBoundingBox( );
for( auto gidPartId : _gidToParticle )
......@@ -403,6 +415,22 @@ namespace visimpl
break;
}
}
void DomainManager::updateData(const TGIDSet& gids,
const tGidPosMap& positions)
{
_gids = gids;
_gidPositions = positions;
_sourceSelected->setPositions( _gidPositions );
clearView();
reloadPositions();
update();
}
void DomainManager::_resetBoundingBox( void )
......
/*
* @file DataSourceManager.h
* @brief
* @author Sergio E. Galindo <sergio.galindo@urjc.es>
* @date
* @remarks Copyright (c) GMRV/URJC. All rights reserved.
* Do not distribute without further notice.
* Copyright (c) 2015-2020 GMRV/URJC.
*
* Authors: Sergio E. Galindo <sergio.galindo@urjc.es>
*
* This file is part of ViSimpl <https://github.com/gmrvvis/visimpl>
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License version 3.0 as published
* by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#ifndef __VISIMPL_VISUALGROUPMANAGER__
#define __VISIMPL_VISUALGROUPMANAGER__
......@@ -69,6 +83,8 @@ namespace visimpl
void update( void );
void updateData(const TGIDSet& gids,const tGidPosMap& positions);
void mode( tVisualMode newMode );
tVisualMode mode( void );
......@@ -91,9 +107,11 @@ namespace visimpl
const std::vector< VisualGroup* >& attributeGroups( void ) const;
const tGidPosMap& positions( void ) const;
void positions( const tGidPosMap& );
//void positions( const tGidPosMap& );
void reloadPositions( void );
const TGIDSet& gids( void ) const;
tBoundingBox boundingBox( void ) const;
......
/*
* @file MainWindow.cpp
* @brief
* @author Sergio E. Galindo <sergio.galindo@urjc.es>
* @date
* @remarks Copyright (c) GMRV/URJC. All rights reserved.
* Do not distribute without further notice.
* Copyright (c) 2015-2020 GMRV/URJC.
*
* Authors: Sergio E. Galindo <sergio.galindo@urjc.es>
*
* This file is part of ViSimpl <https://github.com/gmrvvis/visimpl>
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License version 3.0 as published
* by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#ifdef VISIMPL_USE_GMRVLEX
......@@ -34,6 +47,9 @@
#include <visimpl/version.h>
#include "MainWindow.h"
#include <QDebug>
#include <QFileDialog>
#include <QInputDialog>
......@@ -138,10 +154,21 @@ namespace visimpl
}
void MainWindow::init( const std::string& zeqUri )
void MainWindow::init( const std::string&
#ifdef VISIMPL_USE_ZEROEQ
zeqUri
#endif
)
{
#ifdef VISIMPL_USE_ZEROEQ
_zeqUri = zeqUri;
_openGLWidget = new OpenGLWidget( 0, 0, zeqUri );
#else
_openGLWidget = new OpenGLWidget( 0, 0 );
#endif
this->setCentralWidget( _openGLWidget );
qDebug( ) << _openGLWidget->format( );
......@@ -230,7 +257,8 @@ namespace visimpl
#ifdef VISIMPL_USE_ZEROEQ
_setZeqUri( zeqUri );
if( !zeqUri.empty( ))
_setZeqUri( zeqUri );
#endif
}
......@@ -374,7 +402,23 @@ namespace visimpl
_configurePlayer( );
}
#ifdef SIMIL_WITH_REST_API
void MainWindow::openRestListener( const std::string& url,
simil::TSimulationType simulationType,
const std::string& port,
const std::string& )
{
_openGLWidget->loadRestData( url,
simil::TDataType::TREST,
simulationType,
port );
configureComponents( );
_configurePlayer( );
}
#endif
void MainWindow::openHDF5ThroughDialog( void )
{
......@@ -588,6 +632,9 @@ namespace visimpl
connect( _openGLWidget, SIGNAL( updateSlider( float )),
this, SLOT( UpdateSimulationSlider( float )));
#ifdef SIMIL_WITH_REST_API
_objectInspectorGB->setSimPlayer(_openGLWidget->player( ));
#endif
_startTimeLabel->setText(
QString::number( (double)_openGLWidget->player( )->startTime( )));
......@@ -596,12 +643,15 @@ namespace visimpl
QString::number( (double)_openGLWidget->player( )->endTime( )));
#ifdef SIMIL_USE_ZEROEQ
_openGLWidget->player( )->zeqEvents( )->playbackOpReceived.connect(
boost::bind( &MainWindow::ApplyPlaybackOperation, this, _1 ));
_openGLWidget->player( )->zeqEvents( )->frameReceived.connect(
boost::bind( &MainWindow::requestPlayAt, this, _1 ));
if( !_zeqUri.empty( ))
{
_openGLWidget->player( )->zeqEvents( )->playbackOpReceived.connect(
boost::bind( &MainWindow::ApplyPlaybackOperation, this, _1 ));
_openGLWidget->player( )->zeqEvents( )->frameReceived.connect(
boost::bind( &MainWindow::requestPlayAt, this, _1 ));
}
#endif
changeEditorColorMapping( );
......@@ -952,14 +1002,17 @@ namespace visimpl
layoutContainerSelection->addWidget( selFunctionGB );
layoutContainerSelection->addWidget( gbClippingPlanes );
QGroupBox* objectInspectoGB = new QGroupBox( "Object inspector" );
#ifdef SIMIL_WITH_REST_API
_objectInspectorGB = new DataInspector( "Object inspector" );
/*QGroupBox* objectInspectoGB = new QGroupBox( "Object inspector" );
QGridLayout* oiLayout = new QGridLayout( );
oiLayout->setAlignment( Qt::AlignTop );
oiLayout->addWidget( new QLabel( "GID:" ), 0, 0, 1, 1 );
oiLayout->addWidget( _labelGID, 0, 1, 1, 3 );
oiLayout->addWidget( new QLabel( "Position: " ), 1, 0, 1, 1 );
oiLayout->addWidget( _labelPosition, 1, 1, 1, 3 );
objectInspectoGB->setLayout( oiLayout );
oiLayout->setAlignment( Qt::AlignTop );*/
_objectInspectorGB->addWidget( new QLabel( "GID:" ), 2, 0, 1, 1 );
_objectInspectorGB->addWidget( _labelGID, 2, 1, 1, 3 );
_objectInspectorGB->addWidget( new QLabel( "Position: " ), 3, 0, 1, 1 );
_objectInspectorGB->addWidget( _labelPosition, 3, 1, 1, 3 );
//objectInspectoGB->setLayout( oiLayout );*/
#endif
QGroupBox* groupBoxGroups = new QGroupBox( "Current visualization groups" );
_groupLayout = new QVBoxLayout( );
......@@ -1071,7 +1124,14 @@ namespace visimpl
_toolBoxOptions->addItem( tSpeedGB, tr( "Playback Configuration" ));
_toolBoxOptions->addItem( vcContainer, tr( "Visual Configuration" ));
_toolBoxOptions->addItem( containerSelectionTools, tr( "Selection" ));
_toolBoxOptions->addItem( objectInspectoGB, tr( "Inspector" ));
#ifdef SIMIL_WITH_REST_API
_toolBoxOptions->addItem( _objectInspectorGB, tr( "Inspector" ));
connect( _objectInspectorGB, SIGNAL( simDataChanged( void )),
_openGLWidget, SLOT( updateData( void )));
#endif
verticalLayout->setAlignment( Qt::AlignTop );
verticalLayout->addWidget( _modeSelectionWidget );
......@@ -1083,7 +1143,6 @@ namespace visimpl
this->addDockWidget( Qt::/*DockWidgetAreas::enum_type::*/RightDockWidgetArea,
_simConfigurationDock );
connect( _modeSelectionWidget, SIGNAL( currentChanged( int )),
_openGLWidget, SLOT( setMode( int )));
......@@ -1203,6 +1262,7 @@ namespace visimpl
_startTimeLabel->setText(
QString::number( (double)_openGLWidget->currentTime( )));
//TODO UPDATE ENDTIME
int total = _simSlider->maximum( ) - _simSlider->minimum( );
......@@ -1278,9 +1338,17 @@ namespace visimpl
{
auto scale = _openGLWidget->circuitScaleFactor( );
_circuitScaleX->blockSignals( true );
_circuitScaleY->blockSignals( true );
_circuitScaleZ->blockSignals( true );
_circuitScaleX->setValue( scale.x );
_circuitScaleY->setValue( scale.y );
_circuitScaleZ->setValue( scale.z );
_circuitScaleX->blockSignals( false );
_circuitScaleY->blockSignals( false );
_circuitScaleZ->blockSignals( false );
}
void MainWindow::updateCircuitScaleValue( void )
......@@ -1640,9 +1708,9 @@ namespace visimpl
void MainWindow::_setZeqUri( const std::string& uri_ )
{
_zeqConnection = true;
_uri = uri_.empty( ) ? zeroeq::DEFAULT_SESSION : uri_;
_zeqUri = uri_.empty( ) ? zeroeq::DEFAULT_SESSION : uri_;
_subscriber = new zeroeq::Subscriber( _uri );
_subscriber = new zeroeq::Subscriber( _zeqUri );
_subscriber->subscribe(
lexis::data::SelectedIDs::ZEROBUF_TYPE_IDENTIFIER( ),
......
/*
* @file MainWindow.h
* @brief
* @author Sergio E. Galindo <sergio.galindo@urjc.es>
* @date
* @remarks Copyright (c) GMRV/URJC. All rights reserved.
* Do not distribute without further notice.
* Copyright (c) 2015-2020 GMRV/URJC.
*
* Authors: Sergio E. Galindo <sergio.galindo@urjc.es>
*
* This file is part of ViSimpl <https://github.com/gmrvvis/visimpl>
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License version 3.0 as published
* by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include <QMainWindow>
......@@ -20,6 +33,7 @@
#include "OpenGLWidget.h"
#include "SelectionManagerWidget.h"
#include "SubsetImporter.h"
#include "ui/DataInspector.h"
#include <sumrice/sumrice.h>
......@@ -68,6 +82,12 @@ namespace visimpl
simil::TSimulationType simulationType,
const std::string& activityFile = "",
const std::string& subsetEventFile = "" );
#ifdef SIMIL_WITH_REST_API
void openRestListener( const std::string& url,
simil::TSimulationType simulationType,
const std::string& port = "",
const std::string& subsetEventFile = "" );
#endif
public slots:
......@@ -195,7 +215,7 @@ namespace visimpl
void _setZeqUri( const std::string& );
bool _zeqConnection;
std::string _uri;
std::string _zeqUri;
zeroeq::Subscriber* _subscriber;
std::thread* _thread;
......@@ -230,6 +250,10 @@ namespace visimpl
QTabWidget* _modeSelectionWidget;
QToolBox* _toolBoxOptions;
#ifdef SIMIL_WITH_REST_API
DataInspector * _objectInspectorGB;
#endif
QGroupBox* _groupBoxTransferFunction;
TransferFunctionWidget* _tfWidget;
SelectionManagerWidget* _selectionManager;
......
/*
* @file OpenGLWidget.cpp
* @brief
* @author Sergio E. Galindo <sergio.galindo@urjc.es>
* @date
* @remarks Copyright (c) GMRV/URJC. All rights reserved.
* Do not distribute without further notice.
* Copyright (c) 2015-2020 GMRV/URJC.
*
* Authors: Sergio E. Galindo <sergio.galindo@urjc.es>
*
* This file is part of ViSimpl <https://github.com/gmrvvis/visimpl>
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License version 3.0 as published
* by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include "OpenGLWidget.h"
......@@ -40,6 +53,8 @@ namespace visimpl
std::make_tuple( 0.005f, 20.0f, 0.1f, 500.0f );
static InitialConfig _initialConfigSimCSV =
std::make_tuple( 0.005f, 20.0f, 0.1f, 50000.0f );
static InitialConfig _initialConfigSimREST =
std::make_tuple( 0.005f, 20.0f, 0.1f, 5.0f );
static float invRGBInt = 1.0f / 255;
......@@ -60,6 +75,7 @@ namespace visimpl
, _showCurrentTime( true )
, _wireframe( false )
, _camera( nullptr )
, _cameraOrbital( nullptr )
, _lastCameraPosition( 0, 0, 0)
, _scaleFactor( 1.0f, 1.0f, 1.0f )
, _scaleFactorExternal( false )
......@@ -86,6 +102,9 @@ namespace visimpl
, _pickRenderer( nullptr )
, _simulationType( simil::TSimulationType::TSimNetwork )
, _player( nullptr )
#ifdef SIMIL_WITH_REST_API
, _importer( nullptr )
#endif
, _clippingPlaneLeft( nullptr )
, _clippingPlaneRight( nullptr )
, _planeHeight( 1 )
......@@ -121,6 +140,7 @@ namespace visimpl
, _elapsedTimeSimAcc( 0.0f )
, _alphaBlendingAccumulative( false )
, _showSelection( false )
, _flagNewData (false )
, _flagResetParticles( false )
, _flagUpdateSelection( false )
, _flagUpdateGroups( false )
......@@ -141,13 +161,14 @@ namespace visimpl
, _selectedPickingSingle( 0 )
{
#ifdef VISIMPL_USE_ZEROEQ
if ( zeqUri != "" )
if ( !zeqUri.empty( ) )
_camera = new Camera( zeqUri );
else
#endif
_camera = new Camera( );
_camera->farPlane( 100000.f );
_camera->animDuration( 0.5f );
_cameraOrbital = new reto::OrbitalCameraController( _camera );
// _cameraOrbital->animDuration( 0.5f );
_lastCameraPosition = glm::vec3( 0, 0, 0 );
......@@ -208,7 +229,11 @@ namespace visimpl
OpenGLWidget::~OpenGLWidget( void )
{
delete _camera;
if( _cameraOrbital )
{
delete _cameraOrbital;
delete _camera;
}
if( _shaderParticlesDefault )
delete _shaderParticlesDefault;
......@@ -273,6 +298,10 @@ namespace visimpl
// scale = 5.f;
config = _initialConfigSimCSV;
break;
case simil::TREST:
//
config = _initialConfigSimREST;
break;
default: