Skip to content
Snippets Groups Projects
Commit 003da931 authored by Jan Müller's avatar Jan Müller
Browse files

make qvtk demo runnable

#2
parent 512a0bd7
No related branches found
No related tags found
2 merge requests!3Feature/#7 remove conan,!2Feature/#2 add brunel simulation demo
Showing
with 316 additions and 114 deletions
...@@ -22,7 +22,14 @@ ...@@ -22,7 +22,14 @@
# add_subdirectory(QVTK-Demo) # add_subdirectory(QVTK-Demo)
option(BUILD_BRUNEL_SIMULATION "Build the brunel simulation" ON) option(BUILD_BRUNEL_SIMULATION "Build the brunel simulation" ON)
option(BUILD_QVTK_DEMO "Build the QVTK visualization demo" OFF)
if (${BUILD_BRUNEL_SIMULATION}) if (${BUILD_BRUNEL_SIMULATION})
add_subdirectory(brunel_simulation) add_subdirectory(brunel_simulation)
endif (${BUILD_BRUNEL_SIMULATION}) endif (${BUILD_BRUNEL_SIMULATION})
if (${BUILD_QVTK_DEMO})
add_subdirectory(QVTK-Demo)
endif (${BUILD_QVTK_DEMO})
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# nest-streaming-module # QVTK-Demo
# #
# Copyright (c) 2018 RWTH Aachen University, Germany, # Copyright (c) 2018 RWTH Aachen University, Germany,
# Virtual Reality & Immersive Visualization Group. # Virtual Reality & Immersive Visualization Group.
...@@ -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 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 "qt_app--cpplint"
# ${QP_APP_SOURCES}
# ${QP_APP_HEADERS}
# ${QP_APP_API_HEADERS}
# ${QP_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>
......
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// 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/main_widget.hpp" #include "qvtk-lib/main_widget.hpp"
#include "vtkGenericOpenGLRenderWindow.h" #include "vtkGenericOpenGLRenderWindow.h"
......
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// 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,9 +23,7 @@ ...@@ -23,9 +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/main_window.hpp" #include "qvtk-lib/main_window.hpp"
#include <algorithm>
namespace vtkexp namespace vtkexp
{ {
...@@ -135,7 +133,16 @@ void MainWindow::Rerender() { mainwidget_->Rerender(); } ...@@ -135,7 +133,16 @@ void MainWindow::Rerender() { mainwidget_->Rerender(); }
void MainWindow::IncrementSlider() void MainWindow::IncrementSlider()
{ {
int newval = std::min(time_slider_->value() + 1, time_slider_->maximum()); int newval;
if (time_slider_->value() + 1 < time_slider_->maximum())
{
newval = time_slider_->value() + 1;
}
else
{
newval = time_slider_->maximum();
}
time_slider_->setValue(newval); time_slider_->setValue(newval);
slider_line_edit_->setText(std::to_string(newval).c_str()); slider_line_edit_->setText(std::to_string(newval).c_str());
} }
......
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// 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.
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#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"
#include "vtkCellArray.h" #include "vtkCellArray.h"
#pragma GCC diagnostic push #pragma GCC diagnostic push
...@@ -89,7 +89,8 @@ void PointData::AttachColorsToPoints(const std::vector<double> &scalars) ...@@ -89,7 +89,8 @@ void PointData::AttachColorsToPoints(const std::vector<double> &scalars)
{ {
for (int i = 0; i < num_points_; ++i) for (int i = 0; i < num_points_; ++i)
{ {
pointcolors_->SetValue(i, scalars.at(static_cast<int>(i))); pointcolors_->SetValue(
i, static_cast<float>(scalars.at(static_cast<int>(i))));
} }
points_polydata_->GetPointData()->SetScalars(pointcolors_); points_polydata_->GetPointData()->SetScalars(pointcolors_);
} }
...@@ -115,7 +116,7 @@ int PointData::GetStartTime() const ...@@ -115,7 +116,7 @@ int PointData::GetStartTime() const
{ {
if (!stream_->GetTimeSteps().empty()) if (!stream_->GetTimeSteps().empty())
{ {
return stream_->GetTimeSteps().front(); return static_cast<int>(stream_->GetTimeSteps().front());
} }
return 0; return 0;
} }
...@@ -124,7 +125,7 @@ int PointData::GetEndTime() const ...@@ -124,7 +125,7 @@ int PointData::GetEndTime() const
{ {
if (!stream_->GetTimeSteps().empty()) if (!stream_->GetTimeSteps().empty())
{ {
return stream_->GetTimeSteps().back(); return static_cast<int>(stream_->GetTimeSteps().back());
} }
return 100; return 100;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment