Skip to content
Snippets Groups Projects
Commit e95e8bc9 authored by Simon Oehrl's avatar Simon Oehrl
Browse files

Merge branch 'feature/#2_Add_Brunel_simulation_Demo' into 'master'

Feature/#2 add brunel simulation demo

See merge request VR-Group/nest-streaming-module!2
parents 10e8f45b a2bac9ee
Branches
No related tags found
2 merge requests!3Feature/#7 remove conan,!2Feature/#2 add brunel simulation demo
Showing
with 365 additions and 130 deletions
...@@ -179,6 +179,30 @@ execute_process( ...@@ -179,6 +179,30 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
) )
#--------------------------------------------------------------------
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(ConanHelpers)
include(CTest)
include(GenerateExportHeader)
include(rwthvr)
enable_testing()
conan_or_find_package(catch REQUIRED)
conan_or_find_package(contra REQUIRED)
conan_or_find_package(nesci REQUIRED)
conan_or_find_package(cpplint REQUIRED)
include(cpplint)
conan_or_find_package(cppcheck REQUIRED)
include(cppcheck)
find_package(PythonInterp REQUIRED)
add_subdirectory(demos)
#--------------------------------------------------------------------
# on OS X # on OS X
set( CMAKE_MACOSX_RPATH ON ) set( CMAKE_MACOSX_RPATH ON )
...@@ -231,9 +255,6 @@ add_custom_target( dist ...@@ -231,9 +255,6 @@ add_custom_target( dist
COMMENT "Creating a source distribution from ${MODULE_NAME}..." COMMENT "Creating a source distribution from ${MODULE_NAME}..."
) )
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup( TARGETS )
if ( BUILD_SHARED_LIBS ) if ( BUILD_SHARED_LIBS )
# When building shared libraries, also create a module for loading at runtime # When building shared libraries, also create a module for loading at runtime
# with the `Install` command. # with the `Install` command.
...@@ -296,27 +317,6 @@ if ( NOT CMAKE_CROSSCOMPILING ) ...@@ -296,27 +317,6 @@ if ( NOT CMAKE_CROSSCOMPILING )
) )
endif () endif ()
#--------------------------------------------------------------------
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(ConanHelpers)
include(CTest)
include(GenerateExportHeader)
include(rwthvr)
enable_testing()
conan_or_find_package(catch REQUIRED)
conan_or_find_package(contra REQUIRED)
conan_or_find_package(nesci REQUIRED)
conan_or_find_package(cpplint REQUIRED)
include(cpplint)
conan_or_find_package(cppcheck REQUIRED)
include(cppcheck)
add_subdirectory(demos)
#--------------------------------------------------------------------
message( "" ) message( "" )
message( "-------------------------------------------------------" ) message( "-------------------------------------------------------" )
message( "${MODULE_NAME} Configuration Summary" ) message( "${MODULE_NAME} Configuration Summary" )
......
...@@ -26,9 +26,8 @@ class nest(ConanFile): ...@@ -26,9 +26,8 @@ class nest(ConanFile):
description = """NEST is a simulator for spiking neural network models that focuses on the dynamics, size and structure of neural systems rather than on the exact morphology of individual neurons.""" description = """NEST is a simulator for spiking neural network models that focuses on the dynamics, size and structure of neural systems rather than on the exact morphology of individual neurons."""
settings = "os", "compiler", "build_type", "arch" settings = "os", "compiler", "build_type", "arch"
requires = (("contra/18.05@RWTH-VR/develop"), requires = (("contra/18.07@RWTH-VR/develop"),
("nesci/18.05@RWTH-VR/develop"), ("nesci/18.07@RWTH-VR/develop"),
("Qt/5.11.1@bincrafters/stable"),
("conduit/0.3.1@RWTH-VR/thirdparty")) ("conduit/0.3.1@RWTH-VR/thirdparty"))
generators = "cmake" generators = "cmake"
......
...@@ -19,4 +19,17 @@ ...@@ -19,4 +19,17 @@
# limitations under the License. # limitations under the License.
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# add_subdirectory(QVTK-Demo)
option(BUILD_BRUNEL_SIMULATION "Build the brunel simulation" ON)
option(BUILD_QVTK_DEMO "Build the QVTK visualization demo" OFF)
if (${BUILD_BRUNEL_SIMULATION})
add_subdirectory(brunel_simulation)
endif (${BUILD_BRUNEL_SIMULATION})
if (${BUILD_QVTK_DEMO})
add_subdirectory(QVTK-Demo) add_subdirectory(QVTK-Demo)
endif (${BUILD_QVTK_DEMO})
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# nest-streaming-module # QVTK-Demo
# #
# Copyright (c) 2018 RWTH Aachen University, Germany, # Copyright (c) 2017-2018 RWTH Aachen University, Germany,
# Virtual Reality & Immersive Visualization Group. # Virtual Reality & Immersive Visualization Group.
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
...@@ -19,6 +19,6 @@ ...@@ -19,6 +19,6 @@
# limitations under the License. # limitations under the License.
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
#add_subdirectory(qvtk-app) add_subdirectory(qvtk-app)
add_subdirectory(qvtk-lib) add_subdirectory(qvtk-lib)
#-------------------------------------------------------------------------------
# QVTK-Demo
#
# Copyright (c) 2017-2018 RWTH Aachen University, Germany,
# Virtual Reality & Immersive Visualization Group.
#-------------------------------------------------------------------------------
# License
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#-------------------------------------------------------------------------------
This is a brief summary on how to get the QVTK-Demo running.
Prerequisites:
-QT (Version 5.9 or higher is advised! -older versions might work aswell but havent been tested).
-Get this first and build it.
-The Visualization Toolkit(VTK) (The demo was originally build with version 8.0.1. Newer versions should work too but havent been tested).
-Ŵhen building VTK with CMake make sure you enable VTK_BUILD_QT_DESIGNER_PLUGIN, VTK_Group_Qt and set VTK_QT_VERSION to 5.
Installing:
When running CMake enable BUILD_QVTK_DEMO and BUILD_BRUNEL_SIMULATION.
Running the Demo:
To run the Demo start both, the QVTK-Demo(qvtk-app) and the Brunel Simulation(run_sim.sh) from your build folder.
#-------------------------------------------------------------------------------
# QVTK-Demo
#
# Copyright (c) 2017-2018 RWTH Aachen University, Germany,
# Virtual Reality & Immersive Visualisation Group.
#-------------------------------------------------------------------------------
# License
#
# This framework is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# In the future, we may decide to add a commercial license
# at our own discretion without further notice.
#
# This program 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 Lesse r General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
set(CMAKE_AUTOMOC ON)
set(QVTK_APP_API_HEADER_DIR include/qvtk_app)
file(GLOB QVTK_APP_SOURCES src/*.cpp)
file(GLOB QVTK_APP_HEADERS include/qvtk_app/*.hpp)
file(GLOB QVTK_APP_API_HEADERS ${QVTK_APP_API_HEADER_DIR}/*.hpp)
file(GLOB QVTK_APP_SUPPRESS_WARNING_HEADERS include/qvtk_app/suppress_warnings/Qt *.hpp)
add_executable(qvtk_app
${QVTK_APP_SOURCES}
${QVTK_APP_HEADERS}
${QVTK_APP_API_HEADERS}
${QVTK_APP_SUPPRESS_WARNING_HEADERS}
)
target_include_directories(
qvtk_app PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_BINARY_DIR}
)
#add_test_cpplint(NAME "qvtk_app--cpplint"
# ${QVTK_APP_SOURCES}
# ${QVTK_APP_HEADERS}
# ${QVTK_APP_API_HEADERS}
# ${QVTK_APP_SUPPRESS_WARNING_HEADERS}
#)
set_warning_levels_RWTH(qvtk_app
SUPPRESS_WARNINGS_HEADER ${CMAKE_CURRENT_BINARY_DIR}/include/qt_app/suppress_warnings.hpp
)
include_directories(include)
# --- dependencies ---
# VTK
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
target_include_directories(qvtk_app PUBLIC ${VTK_INCLUDE_DIR})
#vtkexperiment
target_include_directories(qvtk_app PUBLIC ${QVTK_LIB_INCLUDE_DIRS})
target_link_libraries(qvtk_app PUBLIC qvtk-lib debug ${VTK_LIBRARIES} optimized ${VTK_LIBRARIES})
//------------------------------------------------------------------------------
// QVTK-Demo
//
// Copyright (c) 2017-2018 RWTH Aachen University, Germany,
// Virtual Reality & Immersive Visualisation Group.
//------------------------------------------------------------------------------
// License
//
// This framework is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// In the future, we may decide to add a commercial license
// at our own discretion without further notice.
//
// This program 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 program. If not, see <http://www.gnu.org/licenses/>.
//------------------------------------------------------------------------------
#ifndef QVTK_APP_INCLUDE_QVTK_APP_APPLICATION_HPP_
#define QVTK_APP_INCLUDE_QVTK_APP_APPLICATION_HPP_
#include "QApplication"
#include "qvtk-lib/main_window.hpp"
#include "qvtk-lib/point_data.hpp"
class Application
{
public:
Application(int *argc, char **argv);
~Application() {}
int Run();
private:
QApplication qt_app_;
vtkexp::PointData points_;
vtkexp::MainWindow window_;
};
#endif // QVTK_APP_INCLUDE_QVTK_APP_APPLICATION_HPP_
//------------------------------------------------------------------------------
// QVTK-Demo
//
// Copyright (c) 2017-2018 RWTH Aachen University, Germany,
// Virtual Reality & Immersive Visualisation Group.
//------------------------------------------------------------------------------
// License
//
// This framework is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// In the future, we may decide to add a commercial license
// at our own discretion without further notice.
//
// This program 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 program. If not, see <http://www.gnu.org/licenses/>.
//------------------------------------------------------------------------------
#include "qvtk_app/application.hpp"
Application::Application(int *argc, char **argv)
: qt_app_{*argc, argv}, points_(6, 6, 1), window_{&points_} {}
int Application::Run()
{
window_.show();
return qt_app_.exec();
}
//------------------------------------------------------------------------------
// QVTK-Demo
//
// Copyright (c) 2017-2018 RWTH Aachen University, Germany,
// Virtual Reality & Immersive Visualisation Group.
//------------------------------------------------------------------------------
// License
//
// This framework is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// In the future, we may decide to add a commercial license
// at our own discretion without further notice.
//
// This program 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 program. If not, see <http://www.gnu.org/licenses/>.
//------------------------------------------------------------------------------
#include "qvtk_app/application.hpp"
int main(int argc, char **argv)
{
Application app(&argc, argv);
return app.Run();
}
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# QVTK-Demo # QVTK-Demo
# #
# Copyright (c) 2018 RWTH Aachen University, Germany, # Copyright (c) 2017-2018 RWTH Aachen University, Germany,
# Virtual Reality & Immersive Visualization Group. # Virtual Reality & Immersive Visualisation Group.
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # This framework is free software: you can redistribute it and/or modify
# you may not use this file except in compliance with the License. # it under the terms of the GNU Lesser General Public License as published
# You may obtain a copy of the License at # by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# #
# http://www.apache.org/licenses/LICENSE-2.0 # In the future, we may decide to add a commercial license
# at our own discretion without further notice.
# #
# Unless required by applicable law or agreed to in writing, software # This program is distributed in the hope that it will be useful,
# distributed under the License is distributed on an "AS IS" BASIS, # but WITHOUT ANY WARRANTY; without even the implied warranty of
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# See the License for the specific language governing permissions and # GNU Lesser General Public License for more details.
# limitations under the License. #
# You should have received a copy of the GNU Lesse r General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
set(QVTK_DEMO_API_HEADER_DIR include/qvtk-lib) set(QVTK_LIB_API_HEADER_DIR include/qvtk-lib)
file(GLOB QVTK_DEMO_SOURCES src/*.cpp) file(GLOB QVTK_LIB_SOURCES src/*.cpp)
file(GLOB QVTK_DEMO_HEADERS include/qvtk-lib/*.hpp) file(GLOB QVTK_LIB_HEADERS include/qvtk-lib/*.hpp)
file(GLOB QVTK_DEMO_API_HEADERS ${QVTK_DEMO_API_HEADER_DIR}/*.hpp) file(GLOB QVTK_LIB_API_HEADERS ${QVTK_LIB_API_HEADER_DIR}/*.hpp)
set(QVTK_DEMO_INCLUDE_DIRS set(QVTK_LIB_INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}qvtk-lib/include ${PROJECT_SOURCE_DIR}qvtk-lib/include
${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}
CACHE PATH "Path to public headers in vtk's source tree." CACHE PATH "Path to public headers in vtk's source tree."
) )
rwthvr_add_library(NAME qvtk-lib add_library(qvtk-lib
SOURCES ${QVTK_DEMO_SOURCES} ${QVTK_LIB_SOURCES}
HEADERS ${QVTK_DEMO_HEADERS} ${QVTK_LIB_HEADERS}
SUPPRESS_WARNINGS_HEADER "${CMAKE_CURRENT_BINARY_DIR}/include/contra/qvtk-lib/suppress_warnings.hpp"
) )
target_include_directories(qvtk-lib target_include_directories(qvtk-lib
...@@ -48,33 +51,33 @@ generate_export_header(qvtk-lib ...@@ -48,33 +51,33 @@ generate_export_header(qvtk-lib
EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/include/qvtk-lib/export.hpp EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/include/qvtk-lib/export.hpp
) )
add_test_cpplint(NAME "qvtk-lib--cpplint" set_warning_levels_RWTH(qvtk-lib
${QVTK_DEMO_SOURCES} SUPPRESS_WARNINGS_HEADER ${CMAKE_CURRENT_BINARY_DIR}/include/qvtk-lib/suppress_warnings.hpp
${QVTK_DEMO_HEADERS}
) )
#generate_configure_files(qvtk-lib) #add_test_cpplint(NAME "vtkexperiment--cpplint"
# ${VTKEXPERIMENT_SOURCES}
# ${VTKEXPERIMENT_HEADERS}
#)
include_directories(include) include_directories(include)
# --- dependencies --- # --- dependencies ---
# VTK # VTK
find_package(VTK REQUIRED) find_package(VTK REQUIRED)
include(${VTK_USE_FILE}) include(${VTK_USE_FILE})
target_include_directories(qvtk-lib PUBLIC ${VTK_INCLUDE_DIR}) target_include_directories(qvtk-lib PUBLIC ${VTK_INCLUDE_DIR})
target_link_libraries(qvtk-lib debug ${VTK_LIBRARIES} optimized ${VTK_LIBRARIES})
target_include_directories(qvtk-lib PUBLIC target_include_directories(qvtk-lib PUBLIC
${CONAN_INCLUDE_DIRS} ${CONAN_INCLUDE_DIRS}
) )
target_link_libraries(qvtk-lib target_link_libraries(qvtk-lib
PUBLIC ${CONAN_OR_CMAKE_contra}
PUBLIC ${CONAN_OR_CMAKE_nesci}
PUBLIC ${CONAN_OR_CMAKE_conduit} PUBLIC ${CONAN_OR_CMAKE_conduit}
PUBLIC ${CONAN_OR_CMAKE_Qt} PUBLIC ${CONAN_OR_CMAKE_Qt}
PUBLIC ${CONAN_OR_CMAKE_nesci} PUBLIC ${CONAN_OR_CMAKE_VTK}
PUBLIC ${CONAN_OR_CMAKE_contra} debug ${VTK_LIBRARIES}
optimized ${VTK_LIBRARIES}
) )
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// vtkexperiment // QVTK-Demo
// //
// Copyright (c) 2017-2018 RWTH Aachen University, Germany, // Copyright (c) 2017-2018 RWTH Aachen University, Germany,
// Virtual Reality & Immersive Visualisation Group. // Virtual Reality & Immersive Visualisation Group.
...@@ -23,15 +23,15 @@ ...@@ -23,15 +23,15 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#ifndef VTKEXPERIMENT_INCLUDE_VTKEXPERIMENT_ANIMATE_HPP_ #ifndef QVTK_LIB_INCLUDE_QVTK_LIB_ANIMATE_HPP_
#define VTKEXPERIMENT_INCLUDE_VTKEXPERIMENT_ANIMATE_HPP_ #define QVTK_LIB_INCLUDE_QVTK_LIB_ANIMATE_HPP_
#include "QObject" #include "QObject"
#include "QTimer" #include "QTimer"
#include "include/qvtk-lib/suppress_warnings.hpp" #include "include/qvtk-lib/suppress_warnings.hpp"
SUPPRESS_WARNINGS_BEGIN SUPPRESS_WARNINGS_BEGIN
#include "include/qvtk-lib/point_data.hpp" #include "qvtk-lib/point_data.hpp"
SUPPRESS_WARNINGS_END SUPPRESS_WARNINGS_END
namespace vtkexp namespace vtkexp
...@@ -73,4 +73,4 @@ private: ...@@ -73,4 +73,4 @@ private:
} // namespace vtkexp } // namespace vtkexp
#endif // VTKEXPERIMENT_INCLUDE_VTKEXPERIMENT_ANIMATE_HPP_ #endif // QVTK_LIB_INCLUDE_QVTK_LIB_ANIMATE_HPP_
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// vtkexperiment // QVTK-Demo
// //
// Copyright (c) 2017-2018 RWTH Aachen University, Germany, // Copyright (c) 2017-2018 RWTH Aachen University, Germany,
// Virtual Reality & Immersive Visualisation Group. // Virtual Reality & Immersive Visualisation Group.
...@@ -23,19 +23,23 @@ ...@@ -23,19 +23,23 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#ifndef VTKEXPERIMENT_INCLUDE_VTKEXPERIMENT_DATA_STREAM_HPP_ #ifndef QVTK_LIB_INCLUDE_QVTK_LIB_DATA_STREAM_HPP_
#define VTKEXPERIMENT_INCLUDE_VTKEXPERIMENT_DATA_STREAM_HPP_ #define QVTK_LIB_INCLUDE_QVTK_LIB_DATA_STREAM_HPP_
#include <vector> #include <vector>
#include "conduit/conduit_node.hpp" #include "conduit/conduit_node.hpp"
//#include "contra/boost-shmem/shared_memory_transport.hpp"
#include "contra/relay.hpp" #include "contra/relay.hpp"
#include "contra/shared_memory_transport.hpp" #include "contra/zmq/zeromq_transport.hpp"
#include "nesci/consumer/nest_multimeter.hpp" #include "nesci/consumer/nest_multimeter.hpp"
namespace vtkexp { namespace vtkexp
{
class DataStream { class DataStream
{
public: public:
DataStream(); DataStream();
~DataStream() {} ~DataStream() {}
...@@ -49,13 +53,12 @@ class DataStream { ...@@ -49,13 +53,12 @@ class DataStream {
std::vector<double> mult_values_; std::vector<double> mult_values_;
contra::Relay<contra::SharedMemoryTransport>* relay_; contra::Relay<contra::ZMQTransport> *relay_;
nesci::consumer::NestMultimeter *multimeter_; nesci::consumer::NestMultimeter *multimeter_;
conduit::Node node_; conduit::Node node_;
std::vector<conduit::Node> node_vec_;
}; };
} // namespace vtkexp } // namespace vtkexp
#endif // VTKEXPERIMENT_INCLUDE_VTKEXPERIMENT_DATA_STREAM_HPP_ #endif // QVTK_LIB_INCLUDE_QVTK_LIB_DATA_STREAM_HPP_
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// vtkexperiment // QVTK-Demo
// //
// Copyright (c) 2017-2018 RWTH Aachen University, Germany, // Copyright (c) 2017-2018 RWTH Aachen University, Germany,
// Virtual Reality & Immersive Visualisation Group. // Virtual Reality & Immersive Visualisation Group.
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#ifndef VTKEXPERIMENT_INCLUDE_VTKEXPERIMENT_INTERACTION_HPP_ #ifndef QVTK_LIB_INCLUDE_QVTK_LIB_INTERACTION_HPP_
#define VTKEXPERIMENT_INCLUDE_VTKEXPERIMENT_INTERACTION_HPP_ #define QVTK_LIB_INCLUDE_QVTK_LIB_INTERACTION_HPP_
#include <string> #include <string>
...@@ -84,4 +84,4 @@ class Interaction : public vtkInteractorStyleTrackballCamera ...@@ -84,4 +84,4 @@ class Interaction : public vtkInteractorStyleTrackballCamera
} // namespace vtkexp } // namespace vtkexp
#endif // VTKEXPERIMENT_INCLUDE_VTKEXPERIMENT_INTERACTION_HPP_ #endif // QVTK_LIB_INCLUDE_QVTK_LIB_INTERACTION_HPP_
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// vtkexperiment // QVTK-Demo
// //
// Copyright (c) 2017-2018 RWTH Aachen University, Germany, // Copyright (c) 2017-2018 RWTH Aachen University, Germany,
// Virtual Reality & Immersive Visualisation Group. // Virtual Reality & Immersive Visualisation Group.
...@@ -23,12 +23,12 @@ ...@@ -23,12 +23,12 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#ifndef VTKEXPERIMENT_INCLUDE_VTKEXPERIMENT_MAIN_WIDGET_HPP_ #ifndef QVTK_LIB_INCLUDE_QVTK_LIB_MAIN_WIDGET_HPP_
#define VTKEXPERIMENT_INCLUDE_VTKEXPERIMENT_MAIN_WIDGET_HPP_ #define QVTK_LIB_INCLUDE_QVTK_LIB_MAIN_WIDGET_HPP_
#include "include/qvtk-lib/visualize.hpp" #include "qvtk-lib/visualize.hpp"
#include "include/qvtk-lib/interaction.hpp" #include "qvtk-lib/interaction.hpp"
#include "QObject" #include "QObject"
...@@ -68,4 +68,4 @@ private: ...@@ -68,4 +68,4 @@ private:
} // namespace vtkexp } // namespace vtkexp
#endif // VTKEXPERIMENT_INCLUDE_VTKEXPERIMENT_MAIN_WIDGET_HPP_ #endif // QVTK_LIB_INCLUDE_QVTK_LIB_MAIN_WIDGET_HPP_
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// vtkexperiment // QVTK-Demo
// //
// Copyright (c) 2017-2018 RWTH Aachen University, Germany, // Copyright (c) 2017-2018 RWTH Aachen University, Germany,
// Virtual Reality & Immersive Visualisation Group. // Virtual Reality & Immersive Visualisation Group.
...@@ -23,15 +23,15 @@ ...@@ -23,15 +23,15 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#ifndef VTKEXPERIMENT_INCLUDE_VTKEXPERIMENT_MAIN_WINDOW_HPP_ #ifndef QVTK_LIB_INCLUDE_QVTK_LIB_MAIN_WINDOW_HPP_
#define VTKEXPERIMENT_INCLUDE_VTKEXPERIMENT_MAIN_WINDOW_HPP_ #define QVTK_LIB_INCLUDE_QVTK_LIB_MAIN_WINDOW_HPP_
#include "include/qvtk-lib/suppress_warnings.hpp" #include "include/qvtk-lib/suppress_warnings.hpp"
#include "include/qvtk-lib/animate.hpp" #include "qvtk-lib/animate.hpp"
#include "include/qvtk-lib/main_widget.hpp" #include "qvtk-lib/main_widget.hpp"
SUPPRESS_WARNINGS_BEGIN SUPPRESS_WARNINGS_BEGIN
#include "include/qvtk-lib/point_data.hpp" #include "qvtk-lib/point_data.hpp"
SUPPRESS_WARNINGS_END SUPPRESS_WARNINGS_END
#include "QComboBox" #include "QComboBox"
...@@ -96,4 +96,4 @@ private: ...@@ -96,4 +96,4 @@ private:
} // namespace vtkexp } // namespace vtkexp
#endif // VTKEXPERIMENT_INCLUDE_VTKEXPERIMENT_MAIN_WINDOW_HPP_ #endif // QVTK_LIB_INCLUDE_QVTK_LIB_MAIN_WINDOW_HPP_
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// vtkexperiment // QVTK-Demo
// //
// Copyright (c) 2017-2018 RWTH Aachen University, Germany, // Copyright (c) 2017-2018 RWTH Aachen University, Germany,
// Virtual Reality & Immersive Visualisation Group. // Virtual Reality & Immersive Visualisation Group.
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#ifndef VTKEXPERIMENT_INCLUDE_VTKEXPERIMENT_POINT_DATA_HPP_ #ifndef QVTK_LIB_INCLUDE_QVTK_LIB_POINT_DATA_HPP_
#define VTKEXPERIMENT_INCLUDE_VTKEXPERIMENT_POINT_DATA_HPP_ #define QVTK_LIB_INCLUDE_QVTK_LIB_POINT_DATA_HPP_
#include <vector> #include <vector>
...@@ -70,4 +70,4 @@ private: ...@@ -70,4 +70,4 @@ private:
} // namespace vtkexp } // namespace vtkexp
#endif // VTKEXPERIMENT_INCLUDE_VTKEXPERIMENT_POINT_DATA_HPP_ #endif // QVTK_LIB_INCLUDE_QVTK_LIB_POINT_DATA_HPP_
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// vtkexperiment // QVTK-Demo
// //
// Copyright (c) 2017-2018 RWTH Aachen University, Germany, // Copyright (c) 2017-2018 RWTH Aachen University, Germany,
// Virtual Reality & Immersive Visualisation Group. // Virtual Reality & Immersive Visualisation Group.
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#ifndef VTKEXPERIMENT_INCLUDE_VTKEXPERIMENT_VISUALIZE_HPP_ #ifndef QVTK_LIB_INCLUDE_QVTK_LIB_VISUALIZE_HPP_
#define VTKEXPERIMENT_INCLUDE_VTKEXPERIMENT_VISUALIZE_HPP_ #define QVTK_LIB_INCLUDE_QVTK_LIB_VISUALIZE_HPP_
#include <string> #include <string>
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
SUPPRESS_WARNINGS_BEGIN SUPPRESS_WARNINGS_BEGIN
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic" #pragma GCC diagnostic ignored "-Wpedantic"
#include "include/qvtk-lib/interaction.hpp" #include "qvtk-lib/interaction.hpp"
#include "include/qvtk-lib/point_data.hpp" #include "qvtk-lib/point_data.hpp"
#include "vtkActor.h" #include "vtkActor.h"
#include "vtkAxesActor.h" #include "vtkAxesActor.h"
...@@ -95,4 +95,4 @@ private: ...@@ -95,4 +95,4 @@ private:
} // namespace vtkexp } // namespace vtkexp
#endif // VTKEXPERIMENT_INCLUDE_VTKEXPERIMENT_VISUALIZE_HPP_ #endif // QVTK_LIB_INCLUDE_QVTK_LIB_VISUALIZE_HPP_
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// vtkexperiment // QVTK-Demo
// //
// Copyright (c) 2017-2018 RWTH Aachen University, Germany, // Copyright (c) 2017-2018 RWTH Aachen University, Germany,
// Virtual Reality & Immersive Visualisation Group. // Virtual Reality & Immersive Visualisation Group.
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#include "include/qvtk-lib/animate.hpp" #include "qvtk-lib/animate.hpp"
namespace vtkexp namespace vtkexp
{ {
......
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// vtkexperiment // QVTK-Demo
// //
// Copyright (c) 2017-2018 RWTH Aachen University, Germany, // Copyright (c) 2017-2018 RWTH Aachen University, Germany,
// Virtual Reality & Immersive Visualisation Group. // Virtual Reality & Immersive Visualisation Group.
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#include "include/qvtk-lib/data_stream.hpp" #include "qvtk-lib/data_stream.hpp"
#include <vector> #include <vector>
...@@ -34,8 +34,8 @@ DataStream::DataStream() { SetUpStream(); } ...@@ -34,8 +34,8 @@ DataStream::DataStream() { SetUpStream(); }
void DataStream::SetUpStream() void DataStream::SetUpStream()
{ {
relay_ = new contra::Relay<contra::SharedMemoryTransport>(); relay_ = new contra::Relay<contra::ZMQTransport>(
relay_->SetNode(&node_); contra::ZMQTransport::Type::CLIENT, "tcp://localhost:5555");
multimeter_ = new nesci::consumer::NestMultimeter("recordingNode51"); multimeter_ = new nesci::consumer::NestMultimeter("recordingNode51");
multimeter_->SetNode(&node_); multimeter_->SetNode(&node_);
...@@ -43,24 +43,20 @@ void DataStream::SetUpStream() ...@@ -43,24 +43,20 @@ void DataStream::SetUpStream()
void DataStream::Update(int time_step) void DataStream::Update(int time_step)
{ {
time_step = time_step + 1; auto time_step_string = std::to_string(static_cast<double>(time_step));
auto time_step_string = std::to_string(time_step);
const auto received_nodes = relay_->Receive(); const auto received_nodes = relay_->Receive();
for (auto node : received_nodes) for (auto node : received_nodes)
{ {
node_vec_.push_back(node); node_.update(node);
} }
if (!node_vec_.empty())
{
node_ = node_vec_.back();
if (time_step == -1 && !multimeter_->GetTimesteps().empty()) if (time_step == -1 && !multimeter_->GetTimesteps().empty())
{ {
time_step_string = multimeter_->GetTimesteps().back(); time_step_string = multimeter_->GetTimesteps().back();
} }
mult_values_ = multimeter_->GetTimestepData(0, "V_m");
} mult_values_ = multimeter_->GetTimestepData(time_step_string, "V_m");
} }
std::vector<double> DataStream::GetMultValuesAt(int time_step) std::vector<double> DataStream::GetMultValuesAt(int time_step)
...@@ -72,12 +68,10 @@ std::vector<double> DataStream::GetMultValuesAt(int time_step) ...@@ -72,12 +68,10 @@ std::vector<double> DataStream::GetMultValuesAt(int time_step)
std::vector<double> DataStream::GetTimeSteps() std::vector<double> DataStream::GetTimeSteps()
{ {
std::vector<double> ret; std::vector<double> ret;
for (auto value : multimeter_->GetTimesteps()) for (auto value : multimeter_->GetTimesteps())
{ {
ret.push_back(std::stod(value)); ret.push_back(std::stod(value));
} }
return ret; return ret;
} }
......
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// vtkexperiment // QVTK-Demo
// //
// Copyright (c) 2017-2018 RWTH Aachen University, Germany, // Copyright (c) 2017-2018 RWTH Aachen University, Germany,
// Virtual Reality & Immersive Visualisation Group. // Virtual Reality & Immersive Visualisation Group.
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#include "include/qvtk-lib/interaction.hpp" #include "qvtk-lib/interaction.hpp"
#include <string> #include <string>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment