Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • LidarView/lidarview-core
  • nick.laurenson/lidarview-core
  • aerezarang/lidarview-core
3 results
Show changes
Commits on Source (52)
Showing
with 85 additions and 70 deletions
......@@ -97,9 +97,7 @@ target_link_libraries(lqApplicationComponents PUBLIC
Qt5::Widgets
Qt5::UiTools
Qt5::Gui
Qt5::Help
Qt5::Network
Qt5::Sql
Qt5::Svg
ParaView::pqCore
ParaView::pqWidgets
......
......@@ -158,6 +158,16 @@ void lqLidarCoreManager::runPython(const QString& statements)
}
}
//-----------------------------------------------------------------------------
void lqLidarCoreManager::forceShowShell(){
if(this->pythonShell)
{
this->pythonShell->show();
this->pythonShell->raise();
this->pythonShell->activateWindow();
}
}
//-----------------------------------------------------------------------------
void lqLidarCoreManager::createMainRenderView()
{
......
......@@ -70,6 +70,7 @@ public:
void setPythonShell(pqPythonShell* pythonShell);
pqPythonShell* getPythonShell();
void runPython(const QString& statements);
void forceShowShell();
// Main render view Creation
void createMainRenderView();
......
......@@ -34,6 +34,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <vtkDataObject.h>
#include <vtkNew.h>
#include <vtkDataSetAttributes.h>
#include <vtkSMSourceProxy.h>
#include <vtkSMViewProxy.h>
#include <vtkSMPVRepresentationProxy.h>
......@@ -118,7 +119,7 @@ bool lqLiveSourceScalarColoringBehavior::TrySetScalarColoring(pqPipelineSource*
proxy->GetDataInformation(i)->GetPointDataInformation()->GetAttributeInformation(vtkDataSetAttributes::SCALARS))
{
auto* pdInfo = proxy->GetDataInformation(i)->GetPointDataInformation();
char* arrayName = pdInfo->GetAttributeInformation(vtkDataSetAttributes::SCALARS)->GetName();
const char* arrayName = pdInfo->GetAttributeInformation(vtkDataSetAttributes::SCALARS)->GetName();
// check if ScalarColoring is already properly set
if( !pvrp->GetUsingScalarColoring() )
{
......
......@@ -138,7 +138,7 @@ void lqPlayerControlsController::onPause()
{
return;
}
// Regular VCR controller Pause
Superclass::onPause();
}
......@@ -151,7 +151,7 @@ void lqPlayerControlsController::onPlay()
{
return;
}
// Regular VCR controller Pause
Superclass::onPlay();
}
......@@ -163,7 +163,7 @@ void lqPlayerControlsController::onSpeedChange(double speed)
// Update animation mode depending on speed
this->setSceneSpeed();
// Pause for user safety
this->onPause();
......@@ -211,19 +211,15 @@ void lqPlayerControlsController::setSceneSpeed(){
if(!this->Scene)
return;
if (this->speed != 0)
{
// REALTIME
QPair<double, double> range = this->Scene->getClockTimeRange();
SetProperty(this->Scene, "Duration", (range.second - range.first) / this->speed);
this->setPlayMode(vtkAnimationScene::PLAYMODE_REALTIME);
}
else
{
// SNAP TO TIMESTEPS
this->setPlayMode(vtkAnimationScene::PlayModes(2)); // No enum exists for mode 2 'Snap To Timesteps'.
// Speed null check
if(!this->speed){
this->speed = 1.0;
}
// Set Speed
QPair<double, double> range = this->Scene->getClockTimeRange();
SetProperty(this->Scene, "Duration", (range.second - range.first) / this->speed);
this->setPlayMode(vtkAnimationScene::PLAYMODE_REALTIME);
}
//-----------------------------------------------------------------------------
......
......@@ -119,7 +119,6 @@ lqPlayerControlsToolbar::lqPlayerControlsToolbar(QWidget* parentObject,
// Widget Speed ComboBox
this->insertWidget(this->UI->actionRecord, new QLabel("Speed:", this));
this->UI->speedComboBox = new QComboBox(this);
this->UI->speedComboBox->addItem("All frames",0. );
this->UI->speedComboBox->addItem("x 0.1" ,0.1 );
this->UI->speedComboBox->addItem("x 0.25" ,0.25);
this->UI->speedComboBox->addItem("x 0.5" ,0.5 );
......@@ -139,7 +138,7 @@ lqPlayerControlsToolbar::lqPlayerControlsToolbar(QWidget* parentObject,
// Widget Seek Slider
this->UI->frameSlider = new QSlider(Qt::Horizontal, this);
this->insertWidget(this->UI->actionRecord, this->UI->frameSlider);
this->insertWidget(this->UI->actionRecord, this->UI->frameSlider);
this->connect(this->UI->frameSlider, SIGNAL(valueChanged(int)),
this->Controller, SLOT(onSeekFrame(int)));
QObject::connect(this->UI->frameSlider, &QSlider::valueChanged, // Show Frame Number, sliderMoved
......@@ -148,7 +147,7 @@ lqPlayerControlsToolbar::lqPlayerControlsToolbar(QWidget* parentObject,
});
this->UI->frameSlider->setTracking(true); // Make sure internal Value / Position are sync
this->UI->frameSlider->setTickInterval(1); // Tapping the slider increments by one
// Widget Time
this->insertWidget(this->UI->actionRecord, new QLabel("Time", this));
......@@ -156,7 +155,7 @@ lqPlayerControlsToolbar::lqPlayerControlsToolbar(QWidget* parentObject,
this->insertWidget(this->UI->actionRecord, this->UI->timeSpinBox);
this->connect(this->UI->timeSpinBox, SIGNAL(valueChanged(double)),
this->Controller, SLOT(onSeekTime(double)));
// Widget Frame
this->insertWidget(this->UI->actionRecord, new QLabel("Frame", this));
this->UI->frameQSpinBox = new QSpinBox(this);
......@@ -178,7 +177,7 @@ lqPlayerControlsToolbar::lqPlayerControlsToolbar(QWidget* parentObject,
this->setTimeRanges(0,0);
this->setFrameRanges(0,0);
emit speedChange(1.0);
// Init Controller
QObject::connect(pqPVApplicationCore::instance()->animationManager(),
SIGNAL(activeSceneChanged(pqAnimationScene*)), this->Controller,
......@@ -202,7 +201,7 @@ void lqPlayerControlsToolbar::setTimeRanges(double start, double end)
// Action First / Last Frames
this->UI->actionVCRFirstFrame->setToolTip(QString("First Time (%1)").arg(start, 0, 'g'));
this->UI->actionVCRLastFrame-> setToolTip(QString("Last Time (%1)").arg(end, 0, 'g'));
// Time Spinbox
this->UI->timeSpinBox->setMinimum(start);
this->UI->timeSpinBox->setMaximum(end);
......@@ -218,7 +217,7 @@ void lqPlayerControlsToolbar::setFrameRanges(int min, int max)
this->UI->frameSlider->setMaximum(max);
this->UI->frameSlider->setSliderPosition(min); //wipwip necessarry ?
this->UI->frameSlider->setToolTip(QString("Frames %1/%2/%3").arg(min).arg(min).arg(max)); //wipwip factorize with sliderPosition() ?
// Frame Spinbox
this->UI->frameQSpinBox->setMinimum(min);
this->UI->frameQSpinBox->setMaximum(max);
......@@ -300,10 +299,10 @@ void lqPlayerControlsToolbar::onSetLiveMode(bool liveModeEnabled)
void lqPlayerControlsToolbar::onTimestepChanged()
{
// Force All Widgets to update to current Time / Frame Value
pqTimeKeeper* tk = pqApplicationCore::instance()->getActiveServer()->getTimeKeeper();
pqTimeKeeper* tk = pqApplicationCore::instance()->getActiveServer()->getTimeKeeper();
double time = tk->getTime();
int value = tk->getTimeStepValueIndex(time);
// Slider Position, no better method to sync pos / internal value
this->UI->frameSlider->blockSignals(true);
this->UI->frameSlider->setSliderPosition(value);
......@@ -313,12 +312,12 @@ void lqPlayerControlsToolbar::onTimestepChanged()
this->UI->timeSpinBox->blockSignals(true);
this->UI->timeSpinBox->setValue(time);
this->UI->timeSpinBox->blockSignals(false);
// Frame SpinBox
this->UI->frameQSpinBox->blockSignals(true);
this->UI->frameQSpinBox->setValue(value);
this->UI->frameQSpinBox->blockSignals(false);
// TODO could add more tootips
}
......@@ -53,17 +53,17 @@ protected Q_SLOTS:
// UI Updates
void setTimeRanges(double, double); // VCR Controller default, updates time ranges
void onPlaying(bool); // VCR Controller default
void setFrameRanges(int, int); // updates frames ranges
void onSpeedChanged(double speed); // Update UI on speed change
void onToggled(bool enable); // Toggle Enable/Disable
void onSetLiveMode(bool liveModeEnabled); // Convenience slot for inverted Toggling on livemode signal
// UI Input signals
void onComboSpeedSelected(int index); // Speed ComboBox changed by user
void onTimestepChanged(); // Timestep has changed
Q_SIGNALS:
void speedChange(double); // Requests controller to change speed
......
......@@ -114,7 +114,8 @@ workflow:
- cmake -E make_directory $LV_PROJECT_BSB_PATH
- echo "CI SB OPTIONS= $sb_cmake_option_USE_SYSTEM_qt5 $sb_cmake_option_ENABLE_ceres $sb_cmake_option_ENABLE_nanoflann $sb_cmake_option_ENABLE_pcl $sb_cmake_option_LIDARVIEW_BUILD_SLAM"
- cd $LV_PROJECT_SRC_PATH # First Fetch Master
- git clone -j 8 $CI_PROJECT_URL . # Clone in Place, no submodules, no recursive, smudged
- echo "Using SB_CI_AUTH=$SB_CI_AUTH" # Optional auth for private repositories e.g "gitlab-ci-token:[masked]@"
- git clone -j 8 https://$SB_CI_AUTH$CI_SERVER_HOST/$CI_PROJECT_PATH.git . # Clone in Place, no submodules, no recursive, smudged
- git submodule update --init --recursive # Must Init with master branch first before fetching
- git fetch --all
- git submodule foreach --recursive "git fetch --all"
......@@ -131,6 +132,8 @@ workflow:
- cd $LV_PROJECT_BSB_PATH # Configure & Build
- > # must use | instead of > for multiline string here as some variable may be empty, otherwise gitlab doesn't manage to parse it correclty
cmake -DCMAKE_BUILD_TYPE=Release
$sb_cmake_option_CC
$sb_cmake_option_CXX
$sb_cmake_option_GENERATOR
$sb_cmake_option_USE_SYSTEM_qt5
$sb_cmake_option_QT5_DIR
......@@ -245,10 +248,7 @@ workflow:
.osx_runner_config:
variables:
sb_cmake_option_CMAKE_OSX_ARCHITECTURES: -DCMAKE_OSX_ARCHITECTURES=x86_64
sb_cmake_option_CMAKE_OSX_DEPLOYMENT_TARGET: -DCMAKE_OSX_DEPLOYMENT_TARGET=10.10
sb_cmake_option_CMAKE_OSX_SDK: -DCMAKE_OSX_SDK=macosx10.12
sb_cmake_option_QT5_DIR: -DQt5_DIR=/Users/gitlab-runner/Qt5.12.9/5.12.9/clang_64/lib/cmake/Qt5
sb_cmake_option_QT5_DIR: -DQt5_DIR=/Users/kitware/Qt5.12.9/5.12.9/clang_64/lib/cmake/Qt5
tags: [osx]
resource_group: osx_machine
......
......@@ -14,11 +14,21 @@ file(GLOB lidarview_plugins_xmls
# Generate Configuration file
set(lidarview_conf_content)
# Add PV Plugins
string(APPEND lidarview_conf_content "../${LV_INSTALL_LIBRARY_DIR}/paraview-${paraview_version}/plugins/paraview.plugins.xml\n")
if(APPLE)
# Unable to find a better alternative for now
string(APPEND lidarview_conf_content "../Plugins/paraview.plugins.xml\n")
else()
string(APPEND lidarview_conf_content "../${LV_INSTALL_LIBRARY_DIR}/paraview-${paraview_version}/plugins/paraview.plugins.xml\n")
endif()
# Add LV Plugins
foreach(lidarview_plugins_xml IN LISTS lidarview_plugins_xmls)
get_filename_component(xml_name ${lidarview_plugins_xml} NAME)
string(APPEND lidarview_conf_content "../${LV_PLUGIN_INSTALL_SUBDIRECTORY}/${xml_name}\n") #WIPWIP
if(APPLE)
# Unable to find a better alternative for now
string(APPEND lidarview_conf_content "../Plugins/${xml_name}\n")
else()
string(APPEND lidarview_conf_content "../${LV_PLUGIN_INSTALL_SUBDIRECTORY}/${xml_name}\n")
endif()
endforeach()
# Install Configuration file
......
......@@ -88,7 +88,7 @@ message(STATUS "VTK-${VTK_VERSION}")
if(NOT PARAVIEW_USE_QT)
message(FATAL_ERROR "PARAVIEW_BUILD_QT_GUI is OFF, Paraview must be built with Qt")
endif()
find_package(Qt5 REQUIRED COMPONENTS Core Widgets Gui UiTools Svg PrintSupport)
find_package(Qt5 REQUIRED COMPONENTS Core Widgets Gui UiTools Svg)
if(NOT Qt5_FOUND)
message(FATAL_ERROR "Qt5 not found")
endif()
......@@ -165,9 +165,9 @@ endif()
if (APPLE)
# Set BLANK RPATHS, make sure no @rpath in -rpath remain in libs
#set(CMAKE_INSTALL_NAME_DIR "")
#set(CMAKE_MACOSX_RPATH TRUE)
#set(CMAKE_INSTALL_NAME_DIR "@executable_path/../../Libraries")
#set(CMAKE_INSTALL_NAME_DIR "@loader_path/../../Libraries") #setting this will replace @rpath which is bad ??
set(CMAKE_MACOSX_RPATH TRUE)
set(CMAKE_INSTALL_NAME_DIR "@executable_path/../Libraries")
#set(CMAKE_INSTALL_NAME_DIR "@loader_path/../Libraries") #setting this will replace @rpath which is bad ??
#@rpath does not work, but it says it is "more flexible
elseif(UNIX)
......
......@@ -31,7 +31,7 @@ set(LV_INSTALL_RUNTIME_DIR bin)
if (WIN32)
set(LV_INSTALL_LIBRARY_DIR bin)
elseif(APPLE)
set(LV_INSTALL_LIBRARY_DIR ${SOFTWARE_NAME}.app/Contents/Libraries)
set(LV_INSTALL_LIBRARY_DIR Applications/${SOFTWARE_NAME}.app/Contents/Libraries)
elseif(UNIX)
set(LV_INSTALL_LIBRARY_DIR lib)
else()
......@@ -43,20 +43,13 @@ endif()
set(LV_PLUGIN_BUILD_SUBDIRECTORY "plugins")
# Setup install LV Plugin subdir # Where it should be installed / packaged
if (WIN32)
set(LV_PLUGIN_INSTALL_SUBDIRECTORY "${LV_INSTALL_LIBRARY_DIR}/plugins")
elseif(APPLE)
set(LV_PLUGIN_INSTALL_SUBDIRECTORY "${LV_INSTALL_LIBRARY_DIR}/plugins")
#set(LV_PLUGIN_INSTALL_SUBDIRECTORY "${SOFTWARE_NAME}.app/Contents/Plugins") # wip this is so wrong omg ...
elseif(UNIX)
set(LV_PLUGIN_INSTALL_SUBDIRECTORY "${LV_INSTALL_LIBRARY_DIR}/plugins")
endif()
set(LV_PLUGIN_INSTALL_SUBDIRECTORY "${LV_INSTALL_LIBRARY_DIR}/plugins")
# Setup install PV Plugin subdir
if (WIN32)
set(LV_INSTALL_PV_PLUGIN_SUBDIR "${LV_INSTALL_LIBRARY_DIR}/paraview-${paraview_version}/plugins")
elseif (APPLE)
set(LV_INSTALL_PV_PLUGIN_SUBDIR "Applications/paraview.app/Contents/Plugins") #wip not tested
set(LV_INSTALL_PV_PLUGIN_SUBDIR "lib/paraview-5.9/plugins") # This one is specific
elseif (UNIX)
set(LV_INSTALL_PV_PLUGIN_SUBDIR "${LV_INSTALL_LIBRARY_DIR}/paraview-${paraview_version}/plugins")
endif ()
......@@ -66,7 +59,7 @@ set(LV_INSTALL_INCLUDE_DIR "include") #wipwip ideally with version suffix like p
# Setup install Ressources path
if(APPLE)
set(LV_INSTALL_RESOURCE_DIR "${SOFTWARE_NAME}.app/Contents/Resources")
set(LV_INSTALL_RESOURCE_DIR "Applications/${SOFTWARE_NAME}.app/Contents/Resources")
else()
set(LV_INSTALL_RESOURCE_DIR "share")
endif()
......@@ -16,7 +16,7 @@
# Ship Qt5
foreach (qt5_opengl_lib IN ITEMS opengl32sw libEGL libGLESv2 libEGLd
Qt5Core Qt5Gui Qt5Widgets Qt5Help Qt5Network Qt5Svg Qt5PrintSupport Qt5Sql)
Qt5Core Qt5Gui Qt5Widgets Qt5Network Qt5Svg)
install(FILES "${Qt5_DIR}/../../../bin/${qt5_opengl_lib}.dll"
DESTINATION "bin"
)
......
......@@ -24,7 +24,7 @@ This document mirrors some information from the [LidarView Developer Guide](http
Note that current LidarView-baseline software stack is typically based on the following embedded elements:
- Paraview 5.9.0
- Paraview 5.10.0
- VTK 9.0.2
- Qt 5.12.9
- Python 3.9.5
......
......@@ -61,8 +61,10 @@ endif()
find_library(liblas_LIBRARY ${LASNAME} DOC "liblas library")
find_path(liblas_INCLUDE_DIR liblas/version.hpp DOC "liblas include directory")
list(APPEND LIDARPLUGIN_DEPS_INCLUDE_DIRS ${liblas_INCLUDE_DIR})
list(APPEND LIDARPLUGIN_DEPS ${liblas_LIBRARY})
add_library(liblas INTERFACE)
target_link_libraries (liblas INTERFACE ${liblas_LIBRARY})
target_include_directories(liblas INTERFACE ${liblas_INCLUDE_DIR})
list(APPEND LIDARPLUGIN_DEPS liblas)
#--------------------------------------
# Eigen dependency
#--------------------------------------
......
......@@ -18,7 +18,9 @@
#include "vtkConversions.h"
#include <algorithm>
#include <iostream>
#include <random>
#include <vtkPointData.h>
#include <vtkInformationVector.h>
......@@ -152,7 +154,9 @@ int vtkRansacPlaneModel::RequestData(vtkInformation *vtkNotUsed(request),
{
randomIndex[k] = k;
}
std::random_shuffle(randomIndex.begin(), randomIndex.end());
std::random_device rd;
std::mt19937 g(rd());
std::shuffle(randomIndex.begin(), randomIndex.end(), g);
// information variable about ransac iterations
bool shouldStopRansac = false;
......@@ -177,7 +181,7 @@ int vtkRansacPlaneModel::RequestData(vtkInformation *vtkNotUsed(request),
// to random shuffle again
if ((iterationPointer + 2) >= randomIndex.size())
{
std::random_shuffle(randomIndex.begin(), randomIndex.end());
std::shuffle(randomIndex.begin(), randomIndex.end(),g);
iterationPointer = 0;
}
......
......@@ -6,7 +6,7 @@ endif()
if (WIN32)
get_filename_component(TEST_BINARY_DIR "${CMAKE_INSTALL_PREFIX}/bin" ABSOLUTE) #wip not tested
else()
set(TEST_BINARY_DIR "${CMAKE_BINARY_DIR}/lib/plugins/LidarPlugin")
set(TEST_BINARY_DIR "${CMAKE_BINARY_DIR}/${LV_PLUGIN_INSTALL_SUBDIRECTORY}/LidarPlugin")
endif()
set(data_dir ${CMAKE_CURRENT_SOURCE_DIR}/Data)
......
......@@ -19,6 +19,7 @@
#include "vtkObjectFactory.h"
#include <cassert>
#include <cmath>
#include <vector>
#include <set>
#include <algorithm>
......@@ -315,11 +316,11 @@ void vtkCustomPiecewiseFunction::GetTableDichotomic( double xStart, double xEnd,
// order to make the curve sharper (closer to piecewise constant)
if ( s < .5 )
{
s = 0.5 * pow(s*2,1.0 + 10*sharpness);
s = 0.5 * std::pow(s*2,1.0 + 10*sharpness);
}
else if ( s > .5 )
{
s = 1.0 - 0.5 * pow((1.0-s)*2,1+10*sharpness);
s = 1.0 - 0.5 * std::pow((1.0-s)*2,1+10*sharpness);
}
// Compute some coefficients we will need for the hermite curve
......@@ -1014,11 +1015,11 @@ void vtkCustomPiecewiseFunction::GetTable( double xStart, double xEnd,
// order to make the curve sharper (closer to piecewise constant)
if ( s < .5 )
{
s = 0.5 * pow(s*2,1.0 + 10*sharpness);
s = 0.5 * std::pow(s*2,1.0 + 10*sharpness);
}
else if ( s > .5 )
{
s = 1.0 - 0.5 * pow((1.0-s)*2,1+10*sharpness);
s = 1.0 - 0.5 * std::pow((1.0-s)*2,1+10*sharpness);
}
// Compute some coefficients we will need for the hermite curve
......
Subproject commit dffecb3cdefd2a2f289a93c5850224611142c1ab
Subproject commit eefcc7e90d35ca741224c347f5f7a49accc6f43a
......@@ -61,11 +61,11 @@ def getSceneMetaData(view):
objects = []
scene['background_color'] = list(view.Background)
if view.UseGradientBackground:
if view.BackgroundColorMode == "Gradient":
# switch the ordering, paraview's Background2 means the top gradient color
scene['background_color'] = list(view.Background2)
scene['background_color2'] = list(view.Background)
if view.BackgroundTexture:
if view.BackgroundColorMode == "Texture":
scene['background_image'] = exportTexture(view.BackgroundTexture, baseDir)
scene['camera'] = cameraProperties(view)
......
......@@ -36,8 +36,8 @@ animation_nb_steps = 100 # number of timesteps to sample from start to stop
render_view = smp.GetActiveViewOrCreate('RenderView')
# set black background
render_view.UseGradientBackground = 0
render_view.UseTexturedBackground = 0
render_view.BackgroundColorMode = "Gradient"
render_view.UseColorPaletteForBackground = False
render_view.Background = [0.0, 0.0, 0.0]
# get color transfer function/color map for 'intensity'
......