diff --git a/.gitsubprojects b/.gitsubprojects index abecd43ede59245191b36983d0fe2428f154d239..de44d3ccdcc8b74760f2ce8a29e6971b17a96b26 100644 --- a/.gitsubprojects +++ b/.gitsubprojects @@ -1,10 +1,10 @@ # -*- 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 ) diff --git a/CMakeLists.txt b/CMakeLists.txt index fcd984a7e0c846fd006107828e717f6598d26735..2c260284cde8af5b965dfe9e37fae1e430adb4d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") diff --git a/Changelog.md b/Changelog.md index abf39c712532d042ae6d33bbe2e92c68a9ee90a7..e462af3306bea7d567210c9034991671687e99a1 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,6 +1,18 @@ # 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. diff --git a/README.md b/README.md index 6da41f59c1427a727a150d24d13402e8751adf47..d979793c4dba73ae104c3593cac7c9fdbac391da 100644 --- a/README.md +++ b/README.md @@ -1,49 +1,51 @@ # 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 diff --git a/visimpl/CMakeLists.txt b/visimpl/CMakeLists.txt index 522a18111399c43b8ac52a89b3a84acee59a618a..c12bc18827e2cad85e515e07e21dab999075fc53 100644 --- a/visimpl/CMakeLists.txt +++ b/visimpl/CMakeLists.txt @@ -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 ) diff --git a/visimpl/DomainManager.cpp b/visimpl/DomainManager.cpp index 92d5fda38b84b3986654d9e7b3a0dc5942671fe2..1b8496aeefee9ad6775f9cb814050743fd8a9292 100644 --- a/visimpl/DomainManager.cpp +++ b/visimpl/DomainManager.cpp @@ -1,10 +1,23 @@ /* - * @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 ) diff --git a/visimpl/DomainManager.h b/visimpl/DomainManager.h index a7d2e9886abb61c4b7f2d291a73fa636d199c63d..2fe89a5e70b94e1837dde254d02f0d391b4e586e 100644 --- a/visimpl/DomainManager.h +++ b/visimpl/DomainManager.h @@ -1,11 +1,25 @@ /* - * @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; diff --git a/visimpl/MainWindow.cpp b/visimpl/MainWindow.cpp index 5f4948d61c9a198455e618675f57df8633ef91ab..9b5a5113ec9c2d9f6e9a9eac361a87bb7a533061 100644 --- a/visimpl/MainWindow.cpp +++ b/visimpl/MainWindow.cpp @@ -1,10 +1,23 @@ /* - * @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( ), diff --git a/visimpl/MainWindow.h b/visimpl/MainWindow.h index e9a2ca3daf3e19a629c8163736093883070c1e9d..a41c0c6e36b4bb77bc60b3014e402f6a1ce37559 100644 --- a/visimpl/MainWindow.h +++ b/visimpl/MainWindow.h @@ -1,10 +1,23 @@ /* - * @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; diff --git a/visimpl/OpenGLWidget.cpp b/visimpl/OpenGLWidget.cpp index 80ab9b625c9698c8afdeca50ede1956490a018b0..2d0e2858f466b730cdbc790cbe353fb606e91b3c 100644 --- a/visimpl/OpenGLWidget.cpp +++ b/visimpl/OpenGLWidget.cpp @@ -1,10 +1,23 @@ /* - * @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: break; } @@ -287,20 +316,82 @@ namespace visimpl << ", " << _scaleFactor.z << std::endl; - tGidPosMap gidPositions; - auto gids = spPlayer->gids( ); - auto positions = spPlayer->positions( ); - auto gidit = gids.begin( ); - for( auto pos : positions ) - { - vec3 position( pos.x( ), pos.y( ), pos.z( )); - gidPositions.insert( std::make_pair( *gidit, position * _scaleFactor )); - ++gidit; - } + createParticleSystem( ); + + simulationDeltaTime( std::get< T_DELTATIME >( config ) ); + simulationStepsPerSecond( std::get< T_STEPS_PER_SEC >( config ) ); + changeSimulationDecayValue( std::get< T_DECAY >( config ) ); + + #ifdef VISIMPL_USE_ZEROEQ + if( !_zeqUri.empty( )) + _player->connectZeq( _zeqUri ); + #endif + this->_paint = true; + update( ); + + } + +#ifdef SIMIL_WITH_REST_API + void OpenGLWidget::loadRestData( const std::string& url, + const simil::TDataType , + simil::TSimulationType simulationType, + const std::string& port) + { + + makeCurrent( ); + + InitialConfig config; + float scale = 1.0f; + + config = _initialConfigSimREST; + + _simulationType = simulationType; + + _deltaTime = std::get< T_DELTATIME >( config ); + + _importer = new simil::LoaderRestData( ); + static_cast<simil::LoaderRestData*>(_importer)->deltaTime(_deltaTime); + + std::cout << "--------------------------------------" << std::endl; + std::cout << "Network" << std::endl; + std::cout << "--------------------------------------" << std::endl; + + simil::SimulationData* simData = _importer->loadSimulationData(url,port); + + simil::Network* netData = _importer->loadNetwork(url,port); + + std::cout << "Loaded GIDS: " << netData->gids( ).size( ) << std::endl; + std::cout << "Loaded positions: " << netData->positions( ).size( ) + << std::endl; + + std::cout << "--------------------------------------" << std::endl; + std::cout << "Spikes" << std::endl; + std::cout << "--------------------------------------" << std::endl; + + + simil::SpikesPlayer* spPlayer = new simil::SpikesPlayer(); + spPlayer->LoadData( netData, simData ); + _player = spPlayer; +// _player->deltaTime( _deltaTime ); + + + + + scale = std::get< T_SCALE >( config ); + + if( !_scaleFactorExternal ) + _scaleFactor = vec3( scale, scale, scale ); + + std::cout << "Using scale factor of " << _scaleFactor.x + << ", " << _scaleFactor.y + << ", " << _scaleFactor.z + << std::endl; + - createParticleSystem( gidPositions ); + + createParticleSystem( ); simulationDeltaTime( std::get< T_DELTATIME >( config ) ); simulationStepsPerSecond( std::get< T_STEPS_PER_SEC >( config ) ); @@ -313,6 +404,7 @@ namespace visimpl update( ); } +#endif void OpenGLWidget::initializeGL( void ) { @@ -499,7 +591,7 @@ namespace visimpl } } - void OpenGLWidget::createParticleSystem( const tGidPosMap& gidPositions ) + void OpenGLWidget::createParticleSystem( ) { makeCurrent( ); prefr::Config::init( ); @@ -535,17 +627,20 @@ namespace visimpl - unsigned int maxParticles = _player->gids( ).size( ); + unsigned int maxParticles = + std::max(( unsigned int ) 100000, ( unsigned int ) _player->gids( ).size( )); + + _updateData( ); - _particleSystem = new prefr::ParticleSystem( maxParticles * 2, _camera ); + _particleSystem = new prefr::ParticleSystem( maxParticles, _camera ); _flagResetParticles = true; - _domainManager = new DomainManager( _particleSystem, _player->gids( ) ); + _domainManager = new DomainManager( _particleSystem, _gids); #ifdef SIMIL_USE_BRION - _domainManager->init( gidPositions, _player->data( )->blueConfig( )); + _domainManager->init( _gidPositions, _player->data( )->blueConfig( )); #else - _domainManager->init( gidPositions ); + _domainManager->init( _gidPositions ); #endif _domainManager->initializeParticleSystem( ); @@ -597,7 +692,7 @@ namespace visimpl uModelViewProjM = glGetUniformLocation( shader, "modelViewProjM" ); glUniformMatrix4fv( uModelViewProjM, 1, GL_FALSE, - _camera->viewProjectionMatrix( )); + _camera->projectionViewMatrix( )); cameraUp = glGetUniformLocation( shader, "cameraUp" ); cameraRight = glGetUniformLocation( shader, "cameraRight" ); @@ -611,9 +706,9 @@ namespace visimpl glUniform1f( particleRadius, _particleRadiusThreshold ); - glm::vec3 cameraPosition ( _camera->position( )[ 0 ], - _camera->position( )[ 1 ], - _camera->position( )[ 2 ] ); + glm::vec3 cameraPosition ( _cameraOrbital->position( )[ 0 ], + _cameraOrbital->position( )[ 1 ], + _cameraOrbital->position( )[ 2 ] ); if( _player->isPlaying( ) || _lastCameraPosition != cameraPosition || _flagUpdateRender ) { @@ -654,6 +749,9 @@ namespace visimpl void OpenGLWidget::_resolveFlagsOperations( void ) { + if(_flagNewData) + _updateNewData( ); + if( _flagChangeShader ) _setShaderParticles( ); @@ -715,7 +813,7 @@ namespace visimpl if ( _paint ) { - _camera->anim( ); + _cameraOrbital->anim( ); if( _particleSystem ) { @@ -978,6 +1076,39 @@ namespace visimpl } } + void OpenGLWidget::updateData() + { + _flagNewData = true; + } + + void OpenGLWidget::_updateData( void ) + { + _gids = _player->gids( ); + _positions = _player->positions( ); + + _gidPositions.clear( ); + + _gidPositions.reserve( _positions.size( )); + auto gidit = _gids.begin( ); + for( auto pos : _positions ) + { + vec3 position( pos.x( ), pos.y( ), pos.z( )); + + _gidPositions.insert( std::make_pair( *gidit, position * _scaleFactor )); + ++gidit; + } + + } + + void OpenGLWidget::_updateNewData( void ) + { + _updateData(); + _domainManager->updateData(_gids, _gidPositions ); + _focusOn( _domainManager->boundingBox( )); + _flagNewData = false; + _flagUpdateRender = true; + } + void OpenGLWidget::setMode( int mode ) { if( mode < 0 || ( mode >= ( int )TMODE_UNDEFINED )) @@ -1000,6 +1131,8 @@ namespace visimpl _flagUpdateSelection = true; } + + void OpenGLWidget::home( void ) { _focusOn( _boundingBoxHome ); @@ -1020,10 +1153,10 @@ namespace visimpl { glm::vec3 center = ( boundingBox.first + boundingBox.second ) * 0.5f; float side = glm::length( boundingBox.second - center ); - float radius = side / std::tan( _camera->fov( )); + float radius = side / std::tan( _camera->fieldOfView( )); - _camera->targetPivotRadius( Eigen::Vector3f( center.x, center.y, center.z ), - radius ); + _cameraOrbital->radius( radius ); + _cameraOrbital->position( Eigen::Vector3f( center.x, center.y, center.z )); } void OpenGLWidget::_pickSingle( void ) @@ -1086,20 +1219,8 @@ namespace visimpl if( update && _player ) { - tGidPosMap gidPositions; - auto gids = _player->gids( ); - auto positions = _player->positions( ); - - auto gidit = gids.begin( ); - for( auto pos : positions ) - { - vec3 position( pos.x( ), pos.y( ), pos.z( )); - - gidPositions.insert( std::make_pair( *gidit, position * _scaleFactor )); - ++gidit; - } - - _domainManager->positions( gidPositions ); + _updateData(); + _domainManager->updateData(_gids, _gidPositions ); _focusOn( _domainManager->boundingBox( )); } @@ -1166,7 +1287,7 @@ namespace visimpl void OpenGLWidget::resizeGL( int w , int h ) { - _camera->ratio((( double ) w ) / h ); + _cameraOrbital->windowSize( w, h ); glViewport( 0, 0, w, h ); if( _pickRenderer ) @@ -1280,8 +1401,10 @@ namespace visimpl _planeNormalLeft = ( center - centerLeft ).normalized( ); _planeNormalRight = ( center - centerRight ).normalized( ); - _clippingPlaneLeft->setEquationByPointAndNormal( centerLeft, _planeNormalLeft ); - _clippingPlaneRight->setEquationByPointAndNormal( centerRight, _planeNormalRight ); + _clippingPlaneLeft->setEquationByPointAndNormal( + centerLeft, _planeNormalLeft ); + _clippingPlaneRight->setEquationByPointAndNormal( + centerRight, _planeNormalRight ); // std::cout << "Planes:" << std::endl // << " Left: " @@ -1522,8 +1645,10 @@ namespace visimpl { if( _rotation ) { - _camera->localRotation( -( _mouseX - event_->x( )) * 0.01, - ( _mouseY - event_->y( )) * 0.01 ); + _cameraOrbital->rotate( + Eigen::Vector3f( -( _mouseX - event_->x( )) * 0.01, + ( _mouseY - event_->y( )) * 0.01, + 0.0f )); _mouseX = event_->x( ); _mouseY = event_->y( ); } @@ -1538,21 +1663,21 @@ namespace visimpl if( _translation ) { - float xDis = ( event_->x() - _mouseX ) * 0.001f * _camera->radius( ); - float yDis = ( event_->y() - _mouseY ) * 0.001f * _camera->radius( ); + float xDis = ( event_->x() - _mouseX ) * 0.001f * _cameraOrbital->radius( ); + float yDis = ( event_->y() - _mouseY ) * 0.001f * _cameraOrbital->radius( ); - _camera->localTranslation( Eigen::Vector3f( -xDis, yDis, 0.0f )); + _cameraOrbital->translate( Eigen::Vector3f( -xDis, yDis, 0.0f )); _mouseX = event_->x( ); _mouseY = event_->y( ); } if( _translationPlanes ) { - float xDis = ( event_->x() - _mouseX ) * 0.001f * _camera->radius( ); - float yDis = ( event_->y() - _mouseY ) * 0.001f * _camera->radius( ); + float xDis = ( event_->x() - _mouseX ) * 0.001f * _cameraOrbital->radius( ); + float yDis = ( event_->y() - _mouseY ) * 0.001f * _cameraOrbital->radius( ); evec3 displacement ( xDis, -yDis, 0 ); - _planesCenter += _camera->rotation( ).transpose( ) * displacement; + _planesCenter += _cameraOrbital->rotation( ).transpose( ) * displacement; _mouseX = event_->x( ); _mouseY = event_->y( ); @@ -1569,9 +1694,9 @@ namespace visimpl int delta = event_->angleDelta( ).y( ); if ( delta > 0 ) - _camera->radius( _camera->radius( ) / 1.3f ); + _cameraOrbital->radius( _cameraOrbital->radius( ) / 1.3f ); else - _camera->radius( _camera->radius( ) * 1.3f ); + _cameraOrbital->radius( _cameraOrbital->radius( ) * 1.3f ); update( ); diff --git a/visimpl/OpenGLWidget.h b/visimpl/OpenGLWidget.h index 4df6247fddd2869d5234f15509d57ed8d913bc53..ad07dc3bbf74fe364081de162a7f94ac23d8aa61 100644 --- a/visimpl/OpenGLWidget.h +++ b/visimpl/OpenGLWidget.h @@ -1,10 +1,23 @@ /* - * @file OpenGLWidget.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__OPENGLWIDGET__ @@ -93,12 +106,19 @@ namespace visimpl const std::string& zeqUri = "" ); ~OpenGLWidget( void ); - void createParticleSystem( const tGidPosMap& gidPositions ); + void createParticleSystem( ); void loadData( const std::string& fileName, const simil::TDataType = simil::TDataType::TBlueConfig, simil::TSimulationType simulationType = simil::TSimSpikes, const std::string& report = std::string( "" )); +#ifdef SIMIL_WITH_REST_API + void loadRestData( const std::string& url, + const simil::TDataType , + simil::TSimulationType simulationType, + const std::string& port); +#endif + void idleUpdate( bool idleUpdate_ = true ); TPlaybackMode playbackMode( void ); @@ -136,6 +156,8 @@ namespace visimpl public slots: + void updateData( void ); + void home( void ); void updateCameraBoundingBox( bool setBoundingBox = false ); @@ -243,6 +265,9 @@ namespace visimpl void _updateGroups( void ); void _updateGroupsVisibility( void ); void _updateAttributes( void ); + void _updateNewData( void ); + + void _updateData( void ); void _createEventLabels( void ); void _updateEventLabelsVisibility( void ); @@ -278,6 +303,7 @@ namespace visimpl bool _wireframe; Camera* _camera; + reto::OrbitalCameraController* _cameraOrbital; glm::vec3 _lastCameraPosition; vec3 _scaleFactor; @@ -320,6 +346,10 @@ namespace visimpl simil::TSimulationType _simulationType; simil::SpikesPlayer* _player; +#ifdef SIMIL_WITH_REST_API + simil::LoaderSimData* _importer; +#endif + reto::ClippingPlane* _clippingPlaneLeft; reto::ClippingPlane* _clippingPlaneRight; evec3 _planesCenter; @@ -381,6 +411,7 @@ namespace visimpl bool _alphaBlendingAccumulative; bool _showSelection; + bool _flagNewData; bool _flagResetParticles; bool _flagUpdateSelection; bool _flagUpdateGroups; @@ -411,6 +442,10 @@ namespace visimpl QPoint _pickingPosition; unsigned int _selectedPickingSingle; + + tGidPosMap _gidPositions; + TGIDSet _gids; + TPosVect _positions; }; } // namespace visimpl diff --git a/visimpl/SelectionManagerWidget.cpp b/visimpl/SelectionManagerWidget.cpp index 8802905336871be55f9a4ccc214fb74984d325af..dc9cef943da7a0b739fbd8f84e7b0097a11c8e84 100644 --- a/visimpl/SelectionManagerWidget.cpp +++ b/visimpl/SelectionManagerWidget.cpp @@ -1,10 +1,23 @@ /* - * @file SelectionManagerWidget.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 "SelectionManagerWidget.h" diff --git a/visimpl/SelectionManagerWidget.h b/visimpl/SelectionManagerWidget.h index d713d0ad7b4f72b444387e6565262f25e373ace9..54769cf238c4790ef2645b1874b6eeec2385b72c 100644 --- a/visimpl/SelectionManagerWidget.h +++ b/visimpl/SelectionManagerWidget.h @@ -1,10 +1,23 @@ /* - * @file SelectionManagerWidget.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 SELECTIONMANAGERWIDGET_H_ diff --git a/visimpl/SubsetImporter.cpp b/visimpl/SubsetImporter.cpp index ba7c38fd5a9fca60e27f4c94518392e274f36291..5aa834fb93b1e67319ba8568dbbaae5ba9e7c0ef 100644 --- a/visimpl/SubsetImporter.cpp +++ b/visimpl/SubsetImporter.cpp @@ -1,10 +1,23 @@ /* - * @file SubsetManager.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 "SubsetImporter.h" diff --git a/visimpl/SubsetImporter.h b/visimpl/SubsetImporter.h index eb61f0ded13a71950dd3c5ab3396116e89454291..8b51bb486e74e61878b5b3e6b33ee2082aa42e8d 100644 --- a/visimpl/SubsetImporter.h +++ b/visimpl/SubsetImporter.h @@ -1,10 +1,23 @@ /* - * @file SubsetManager.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 SUBSETIMPORTER_H_ diff --git a/visimpl/VisualGroup.cpp b/visimpl/VisualGroup.cpp index 0e843fc7aa8332e9fa314e8b6ec559c6d189e67a..dc6f4ac2db3f87dd9bdd5705cb9c89d5708f9583 100644 --- a/visimpl/VisualGroup.cpp +++ b/visimpl/VisualGroup.cpp @@ -1,10 +1,23 @@ /* - * @file VisualGroup.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 "VisualGroup.h" diff --git a/visimpl/VisualGroup.h b/visimpl/VisualGroup.h index 80664d813a90c9c9da680a58044fff44b27c526a..e4f74d3e2b8bbf82d044151c5d953662bb18478d 100644 --- a/visimpl/VisualGroup.h +++ b/visimpl/VisualGroup.h @@ -1,11 +1,25 @@ /* - * @file DataSource.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) 2014-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_VISUALGROUP__ #define __VISIMPL_VISUALGROUP__ diff --git a/visimpl/prefr/ColorOperationModel.cpp b/visimpl/prefr/ColorOperationModel.cpp index 00d0a34b3d0b59ccc9ed50b5865a726fb7255782..2da6da5c502f0025c76a8e55ca20e11938a88724 100644 --- a/visimpl/prefr/ColorOperationModel.cpp +++ b/visimpl/prefr/ColorOperationModel.cpp @@ -1,10 +1,23 @@ /* - * @file ColorOperationModel.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 "ColorOperationModel.h" diff --git a/visimpl/prefr/ColorOperationModel.h b/visimpl/prefr/ColorOperationModel.h index 6763306ff3ed6df0ab26a41016fe7cea5a0b1aa2..5ccf938a04c33e5d04db19f225ef7ebca7375d1d 100644 --- a/visimpl/prefr/ColorOperationModel.h +++ b/visimpl/prefr/ColorOperationModel.h @@ -1,10 +1,23 @@ /* - * @file ColorOperationModel.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__COLOROPERATIONMODEL__ diff --git a/visimpl/prefr/ColorSource.cpp b/visimpl/prefr/ColorSource.cpp index fe51a10743d43ddda1d3400bd904cdcce7bba097..1c4e81449ee310c559fe10d691dbe4aee1f74923 100644 --- a/visimpl/prefr/ColorSource.cpp +++ b/visimpl/prefr/ColorSource.cpp @@ -1,10 +1,23 @@ /* - * @file ColorSource.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 "ColorSource.h" diff --git a/visimpl/prefr/ColorSource.h b/visimpl/prefr/ColorSource.h index f3f1f185673afc8a26e7c8decd5aa0f4cbf0c1d4..98243e66946800c90f736c6b4190cffcbabee76a 100644 --- a/visimpl/prefr/ColorSource.h +++ b/visimpl/prefr/ColorSource.h @@ -1,10 +1,23 @@ /* - * @file ColorSource.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__COLOREMISSIONNODE__ diff --git a/visimpl/prefr/CompositeColorUpdater.cpp b/visimpl/prefr/CompositeColorUpdater.cpp index 74919c1cabd2fd6b5eba4b0a226b32fb326a129a..9c868d64515b9c95a1a941586054ab2d4dc94973 100644 --- a/visimpl/prefr/CompositeColorUpdater.cpp +++ b/visimpl/prefr/CompositeColorUpdater.cpp @@ -1,10 +1,23 @@ /* - * @file CompositeColorUpdater.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 "CompositeColorUpdater.h" diff --git a/visimpl/prefr/CompositeColorUpdater.h b/visimpl/prefr/CompositeColorUpdater.h index 8ffcf91bed4ffdeeec2681b53ab51a8c52065f5e..85930a1af9a7d03d28c0326f1760c8e5afd1bc22 100644 --- a/visimpl/prefr/CompositeColorUpdater.h +++ b/visimpl/prefr/CompositeColorUpdater.h @@ -1,10 +1,23 @@ /* - * @file CompositeColorUpdater.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__COMPOSITECOLORUPDATER__ diff --git a/visimpl/prefr/PrefrShaders.h b/visimpl/prefr/PrefrShaders.h index 7a7b8b97d14c2128bdae1929bca920b4e89ee362..9603ee76013a336fac6ed3effbe6437e1d7e2a26 100644 --- a/visimpl/prefr/PrefrShaders.h +++ b/visimpl/prefr/PrefrShaders.h @@ -1,10 +1,23 @@ /* - * @file PrefrShaders.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 PREFRSHADERS_H_ diff --git a/visimpl/prefr/SourceMultiPosition.cpp b/visimpl/prefr/SourceMultiPosition.cpp index cde8a1f47dff993fcb6e6752bd79444f59bcaedc..969535dd664eab50cd581630ae1441056ba27712 100644 --- a/visimpl/prefr/SourceMultiPosition.cpp +++ b/visimpl/prefr/SourceMultiPosition.cpp @@ -1,11 +1,25 @@ /* - * @file SourceMultiPosition.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 "SourceMultiPosition.h" namespace visimpl diff --git a/visimpl/prefr/SourceMultiPosition.h b/visimpl/prefr/SourceMultiPosition.h index b0ff2af53780fc3d5c692ac511b244e96b25f0ac..a77bf139b7f53d97a3ee5302574e1b5aa500a546 100644 --- a/visimpl/prefr/SourceMultiPosition.h +++ b/visimpl/prefr/SourceMultiPosition.h @@ -1,11 +1,25 @@ /* - * @file SourceMultiPosition.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 SRC_PREFR_SOURCEMULTIPOSITION_H_ #define SRC_PREFR_SOURCEMULTIPOSITION_H_ diff --git a/visimpl/prefr/UpdaterStaticPosition.cpp b/visimpl/prefr/UpdaterStaticPosition.cpp index 09704d2474ec21675a28a8acda8de661ca9ddbca..72d173513bcc8ab7acdd3163bfe75d4f13256b4c 100644 --- a/visimpl/prefr/UpdaterStaticPosition.cpp +++ b/visimpl/prefr/UpdaterStaticPosition.cpp @@ -1,10 +1,23 @@ /* - * @file UpdaterStaticPosition.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 "UpdaterStaticPosition.h" diff --git a/visimpl/prefr/UpdaterStaticPosition.h b/visimpl/prefr/UpdaterStaticPosition.h index f4468fb2a27d163da90c8571ea1ad661bb9b9181..b194bd7baee5a1169b32820edf71bbd91f7cec32 100644 --- a/visimpl/prefr/UpdaterStaticPosition.h +++ b/visimpl/prefr/UpdaterStaticPosition.h @@ -1,11 +1,25 @@ /* - * @file UpdaterStaticPosition.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 SRC_PREFR_UPDATERSTATICPOSITION_H_ #define SRC_PREFR_UPDATERSTATICPOSITION_H_ diff --git a/visimpl/prefr/ValuedSource.cpp b/visimpl/prefr/ValuedSource.cpp index dfa094602e88da51a0847a32205cf5710f8b1894..070722080a15eff7ab31f306236cbd581697113d 100644 --- a/visimpl/prefr/ValuedSource.cpp +++ b/visimpl/prefr/ValuedSource.cpp @@ -1,11 +1,25 @@ /* - * @file ValuedSource.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 "ValuedSource.h" namespace prefr diff --git a/visimpl/prefr/ValuedSource.h b/visimpl/prefr/ValuedSource.h index 950bffbf56c10286f10f165d44e2e7bdec9097e9..d8af305ff1f829cbff0bcdddbb92d2d91026e2bb 100644 --- a/visimpl/prefr/ValuedSource.h +++ b/visimpl/prefr/ValuedSource.h @@ -1,10 +1,23 @@ /* - * @file ValuedSource.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__VALUEDSOURCE__ @@ -49,7 +62,6 @@ namespace prefr bool _still; float _particlesRelLife; - float _particlesLife; }; diff --git a/visimpl/prefr/ValuedUpdater.cpp b/visimpl/prefr/ValuedUpdater.cpp index f07e8de848ca4eccd6cfc9d7d9c1084b2660e0b2..734ac1cd499346a89ebc09c41a58067c73e3ff3f 100644 --- a/visimpl/prefr/ValuedUpdater.cpp +++ b/visimpl/prefr/ValuedUpdater.cpp @@ -1,10 +1,23 @@ /* - * @file ValuedUpdater.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 "ValuedUpdater.h" diff --git a/visimpl/prefr/ValuedUpdater.h b/visimpl/prefr/ValuedUpdater.h index bc608cbf58231be8faf0a6895d80a50cc9b61b75..89616a64faa7ca3db1bf1553803993d8a32b1f88 100644 --- a/visimpl/prefr/ValuedUpdater.h +++ b/visimpl/prefr/ValuedUpdater.h @@ -1,10 +1,23 @@ /* - * @file ValuedUpdater.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 __ValuedUpdater__ diff --git a/visimpl/render/Plane.cpp b/visimpl/render/Plane.cpp index a9d43a217204f31c76d9a6cdc395aaf8c790aef0..69c8e9f6c1d67ebaba5b2020b971313704303bb4 100644 --- a/visimpl/render/Plane.cpp +++ b/visimpl/render/Plane.cpp @@ -1,10 +1,23 @@ /* - * @file Plane.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 "Plane.h" @@ -96,7 +109,7 @@ namespace visimpl glDisable( GL_CULL_FACE ); - program_->sendUniform4m( "viewProj", _camera->viewProjectionMatrix( )); + program_->sendUniform4m( "viewProj", _camera->projectionViewMatrix( )); program_->sendUniform4v( "inColor", _color.data( )); glDrawArrays(GL_LINE_LOOP, 0, 4); diff --git a/visimpl/render/Plane.h b/visimpl/render/Plane.h index a3e2698bebae3d63f4c58dcbc75130e903b9e31d..98b6bdeef6147c239d622f6091583a273d9d2e69 100644 --- a/visimpl/render/Plane.h +++ b/visimpl/render/Plane.h @@ -1,11 +1,25 @@ /* - * @file Plane.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_RENDER_PLANE_H_ #define VISIMPL_RENDER_PLANE_H_ diff --git a/visimpl/types.h b/visimpl/types.h index 230a59cdbbe4d7f59abe79247eaa1d2bf0125bec..27782ec6a0575eeffa993fa0f5b6a81c0258c289 100644 --- a/visimpl/types.h +++ b/visimpl/types.h @@ -1,11 +1,25 @@ /* - * @file types.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_TYPES_H_ #define VISIMPL_TYPES_H_ @@ -148,14 +162,14 @@ namespace visimpl std::min( 255, std::max( 0, int( color_.z( ) * 255 )))); } - static glm::vec3 floatPtrToVec3( float* floatPos ) + static inline glm::vec3 floatPtrToVec3( float* floatPos ) { return glm::vec3( floatPos[ 0 ], floatPos[ 1 ], floatPos[ 2 ]); } - static glm::mat4x4 floatPtrToMat4( float* floatPos ) + static inline glm::mat4x4 floatPtrToMat4( float* floatPos ) { return glm::mat4x4( floatPos[ 0 ], floatPos[ 1 ], floatPos[ 2 ], floatPos[ 3 ], @@ -179,7 +193,10 @@ namespace visimpl glm::vec3 PReFrCameraPosition( void ) { - return floatPtrToVec3( position( )); + auto viewM = viewMatrix( ); + return glm::vec3( viewM[ 3 ], + viewM[ 7 ], + viewM[ 11 ]); } glm::mat4x4 PReFrCameraViewMatrix( void ) @@ -189,7 +206,7 @@ namespace visimpl glm::mat4x4 PReFrCameraViewProjectionMatrix( void ) { - return floatPtrToMat4( viewProjectionMatrix( )); + return floatPtrToMat4( projectionViewMatrix( )); } }; } diff --git a/visimpl/ui/DataInspector.cpp b/visimpl/ui/DataInspector.cpp new file mode 100644 index 0000000000000000000000000000000000000000..623a14087b333d78e8596cb6d4fd871f37548cbf --- /dev/null +++ b/visimpl/ui/DataInspector.cpp @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2015-2020 GMRV/URJC. + * + * Authors: Aaron Sujar <aaron.sujar@urjc.es> + * + * This file is part of SimIL <https://github.com/gmrvvis/SimIL> + * + * 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 "DataInspector.h" + +#include <QGridLayout> + +DataInspector::DataInspector(const QString &title, QWidget *parent) +: QGroupBox(title,parent) +, _gidsize(0) +, _spikesize(0) +, _labelGIDs(nullptr) +, _labelSpikes(nullptr) +, _labelStartTime(nullptr) +, _labelEndTime(nullptr) +, _simPlayer(nullptr) +{ + _labelGIDs = new QLabel(QString::number(_gidsize)); + _labelSpikes = new QLabel(QString::number(_spikesize)); + _labelStartTime = new QLabel("0"); + _labelEndTime = new QLabel("0"); + QGridLayout* oiLayout = new QGridLayout( ); + oiLayout->setAlignment( Qt::AlignTop ); + oiLayout->addWidget( new QLabel( "Network Information:" ), 0, 0, 1, 1 ); + oiLayout->addWidget( _labelGIDs, 0, 1, 1, 3 ); + oiLayout->addWidget( new QLabel( "Simulation Spikes: " ), 1, 0, 1, 1 ); + oiLayout->addWidget( _labelSpikes, 1, 1, 1, 3 ); + oiLayout->addWidget( new QLabel( "Start Time: " ), 4, 0, 1, 1 ); + oiLayout->addWidget( _labelStartTime, 4, 1, 1, 3 ); + oiLayout->addWidget( new QLabel( "End Time: " ), 5, 0, 1, 1 ); + oiLayout->addWidget( _labelEndTime, 5, 1, 1, 3 ); + setLayout( oiLayout ); +} + +void DataInspector::addWidget( QWidget *widget, int row, int column, + int rowSpan, int columnSpan, + Qt::Alignment alignment ) +{ + static_cast< QGridLayout* >( layout( ))->addWidget( widget, + row, column, + rowSpan, columnSpan, + alignment ); +} + +void DataInspector::setSimPlayer(simil::SimulationPlayer * simPlayer_) +{ + _simPlayer =simPlayer_; +} + +void DataInspector::paintEvent(QPaintEvent *event) +{ + if( _simPlayer != nullptr ) + { + bool updated = false; + if (_simPlayer->gidsSize( ) != _gidsize ) + { + updated = true; + _gidsize = _simPlayer->gidsSize( ); + _labelGIDs->setText(QString::number( _gidsize )); + + } + + simil::SpikesPlayer* spkPlay = dynamic_cast< simil::SpikesPlayer* >( _simPlayer ); + + if( spkPlay != nullptr ) + { + if( spkPlay->spikesSize( ) != _spikesize ) + { + updated = true; + _spikesize = spkPlay->spikesSize( ); + _labelSpikes->setText( QString::number( _spikesize )); + _labelStartTime->setText( QString::number( spkPlay->startTime( ))); + _labelEndTime->setText( QString::number( spkPlay->endTime( ))); + } + } + + if (updated) + emit simDataChanged( ); + } + + QGroupBox::paintEvent( event ); +} diff --git a/visimpl/ui/DataInspector.h b/visimpl/ui/DataInspector.h new file mode 100644 index 0000000000000000000000000000000000000000..87e93dbd1ddebb35ca87f5216b0794f8a9ed3e13 --- /dev/null +++ b/visimpl/ui/DataInspector.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2015-2020 GMRV/URJC. + * + * Authors: Aaron Sujar <aaron.sujar@urjc.es> + * + * This file is part of SimIL <https://github.com/gmrvvis/SimIL> + * + * 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 DATAINSPECTOR_H +#define DATAINSPECTOR_H + +#include <QWidget> +#include <QGroupBox> +#include <QLabel> + +#include <simil/simil.h> + +class DataInspector: public QGroupBox +{ + Q_OBJECT + +public: + + DataInspector(const QString &title, QWidget *parent = nullptr); + + void addWidget(QWidget *widget, int row, int column, + int rowSpan, int columnSpan, + Qt::Alignment alignment = Qt::Alignment()); + + void setSimPlayer(simil::SimulationPlayer * simPlayer_); + +signals: + + void simDataChanged( void ); + +protected: + + virtual void paintEvent(QPaintEvent *event); + + unsigned int _gidsize; + unsigned int _spikesize; + QLabel * _labelGIDs; + QLabel *_labelSpikes; + QLabel *_labelStartTime; + QLabel *_labelEndTime; + simil::SimulationPlayer * _simPlayer; +}; + +#endif // DATAINSPECTOR_H diff --git a/visimpl/visimpl.cpp b/visimpl/visimpl.cpp index 8fd10448d2643b53b15ebe4313246edf4afc4a1a..4f7daf2b5cfcc44db8860ecd84983c0128e17158 100644 --- a/visimpl/visimpl.cpp +++ b/visimpl/visimpl.cpp @@ -1,10 +1,23 @@ /* - * @file visimpl.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 <QApplication> @@ -44,7 +57,7 @@ int main( int argc, char** argv ) std::string networkFile; std::string activityFile; - std::string zeqUri; + std::string zeqUri = std::string( "" ); std::string target = std::string( "" ); std::string report = std::string( "" ); std::string subsetEventFile( "" ); @@ -74,7 +87,7 @@ int main( int argc, char** argv ) zeqUri = std::string( argv[ i ]); } #else - std::cerr << "Zeq not supported " << std::endl; + std::cerr << "ZeroEQ not supported." << std::endl; return -1; #endif } @@ -114,6 +127,25 @@ int main( int argc, char** argv ) } } + else if( std::strcmp( argv[ i ], "-rest") == 0 ) + { +#ifdef SIMIL_WITH_REST_API + if( i + 2 < argc ) + { + + + ++i; + networkFile = std::string( argv[ i ]); + ++i; + activityFile = std::string( argv[ i ]); + dataType = simil::TREST; + } +#else + std::cerr << "REST API not supported." << std::endl; + return -1; +#endif + } + if( strcmp( argv[ i ], "-se" ) == 0 ) { if( ++i < argc ) @@ -229,6 +261,13 @@ int main( int argc, char** argv ) case simil::TDataType::TCSV: mainWindow.openCSVFile( networkFile, simType, activityFile, subsetEventFile ); break; + +#ifdef SIMIL_WITH_REST_API + case simil::TDataType::TREST: + mainWindow.openRestListener( networkFile, simType, activityFile, subsetEventFile ); + break; +#endif + default: break; } @@ -245,6 +284,8 @@ void usageMessage( char* progName ) << "\t[ -bc <blue_config_path> [-target <target> ] | " << "-csv <network_path> <activity_path> ] " << std::endl + << "-rest <url> <port> " + << std::endl << "\t[ -se <subset_events_file> ] " << std::endl // << "\t[ -spikes ] "