diff --git a/Application/Client/LidarViewMainWindow.cxx b/Application/Client/LidarViewMainWindow.cxx index 2fc53aa0303a011cebaa4b4f9f66e25804d7cbb4..9aa9aa0012c2d5ecd43a773691620dd81764da46 100644 --- a/Application/Client/LidarViewMainWindow.cxx +++ b/Application/Client/LidarViewMainWindow.cxx @@ -20,6 +20,7 @@ #include "lqEnableAdvancedArraysReaction.h" #include "lqLiveSourceScalarColoringBehavior.h" #include "lqLoadLidarStateReaction.h" +#include "lqMenuSaveAsReaction.h" #include "lqOpenPcapReaction.h" #include "lqOpenRecentFilesReaction.h" #include "lqOpenSensorReaction.h" @@ -163,7 +164,7 @@ LidarViewMainWindow::LidarViewMainWindow() LidarViewMainWindow::~LidarViewMainWindow() { delete this->Internals; - this->Internals = NULL; + this->Internals = nullptr; } //----------------------------------------------------------------------------- @@ -202,8 +203,6 @@ void LidarViewMainWindow::setupPVGUI() // Hide Various Other Docks this->Internals->colorMapEditorDock->hide(); - this->Internals->pipelineBrowserDock->hide(); - this->Internals->propertiesDock->hide(); this->Internals->viewPropertiesDock->hide(); this->Internals->displayPropertiesDock->hide(); this->Internals->informationDock->hide(); @@ -217,7 +216,7 @@ void LidarViewMainWindow::setupPVGUI() // TODO Enable help from the properties panel. - /// hook delete to pqDeleteReaction. + /// Hook delete to pqDeleteReaction in pipeline browser. QAction* tempDeleteAction = new QAction(this); pqDeleteReaction* handler = new pqDeleteReaction(tempDeleteAction); handler->connect(this->Internals->propertiesPanel, @@ -417,7 +416,15 @@ void LidarViewMainWindow::setupGUICustom() new lqOpenSensorReaction(this->Internals->actionOpen_Sensor_Stream); new lqOpenPcapReaction(this->Internals->actionOpenPcap); + new lqMenuSaveAsReaction(this->Internals->menuSaveAs); new pqLoadDataReaction(this->Internals->actionOpenFile); + // Doesn't currently works a refact of LidarViewMaindow and how the main render view is handled + // needed. + // new pqDeleteReaction(this->Internals->actionResetSession, pqDeleteReaction::DeleteModes::ALL); + connect(this->Internals->actionResetSession, + SIGNAL(triggered()), + lqLidarCoreManager::instance(), + SLOT(onCloseAllData())); new lqUpdateCalibrationReaction( this->Internals->actionChoose_Calibration_File); // Requires lqSensorListWidget init diff --git a/Application/Client/LidarViewMainWindow.ui b/Application/Client/LidarViewMainWindow.ui index 86a8404521ec5bdaa1c26efece25eae6ad111dd0..3a26609540ea2bb91370e33874dc06ca2af9e075 100644 --- a/Application/Client/LidarViewMainWindow.ui +++ b/Application/Client/LidarViewMainWindow.ui @@ -71,7 +71,7 @@ - + @@ -81,7 +81,6 @@ - @@ -105,7 +104,6 @@ - @@ -193,21 +191,8 @@ - - - - Geolocation Controls - - - TopToolBarArea - - - false - - - Color Map Editor @@ -476,12 +461,12 @@ F8 - + - &Close Data + Reset Session - Close Data + Reset Session Ctrl+W @@ -515,11 +500,6 @@ Save &CSV... - - - Grid Properties - - @@ -648,18 +628,6 @@ Advanced Selection and Measurement options - - - - :/lvResources/Icons/planefit.png:/lvResources/Icons/planefit.png - - - Plane Fit - - - Plane Fit to selection - - true @@ -725,32 +693,6 @@ Enable the interpreter's advanced arrays. - - - true - - - true - - - Advance Feature - - - - - true - - - - :/lvResources/Icons/map.png:/lvResources/Icons/map.png - - - actionShowPosition - - - Show the GPS Track - - diff --git a/Application/Client/Resources/lqGridAdjustmentDialog.ui b/Application/Client/Resources/lqGridAdjustmentDialog.ui deleted file mode 100644 index b82ce817572f049762b704eefcb6bc2c9dde63e3..0000000000000000000000000000000000000000 --- a/Application/Client/Resources/lqGridAdjustmentDialog.ui +++ /dev/null @@ -1,326 +0,0 @@ - - - Dialog - - - - 0 - 0 - 395 - 252 - - - - Grid Properties - - - - - - - - Sensor origin: - - - - - - - -999.000000000000000 - - - 999.000000000000000 - - - - - - - -999.000000000000000 - - - 999.000000000000000 - - - - - - - -999.000000000000000 - - - 999.000000000000000 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - 88 - 0 - - - - Sensor up: - - - - - - - -99.000000000000000 - - - - - - - -99.000000000000000 - - - - - - - -99.000000000000000 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - Grid resolution (meters): - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - Grid radius (meters): - - - - - - - 999.990000000000009 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - Grid line width - - - - - - - 1 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - Grid color - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - Persisting properties - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Vertical - - - - 20 - 27 - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - Dialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - Dialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/Application/Client/Resources/lvResources.qrc b/Application/Client/Resources/lvResources.qrc index 831cef2244fddb04f59bc8809dbe60b911c9ac8f..ee51aa781022c9dcf472f9a7cece21cc88a84afa 100644 --- a/Application/Client/Resources/lvResources.qrc +++ b/Application/Client/Resources/lvResources.qrc @@ -29,6 +29,5 @@ Icons/WiresharkDoc-128.png Images/About.png Images/bottom_logo.png - lqGridAdjustmentDialog.ui diff --git a/Application/Qt/ApplicationComponents/CMakeLists.txt b/Application/Qt/ApplicationComponents/CMakeLists.txt index 2f3bc962e6d61d25e9332bc88c841da0f827c4ea..b2edc078624619ec0be9a351ef0ff3f8870f1070 100644 --- a/Application/Qt/ApplicationComponents/CMakeLists.txt +++ b/Application/Qt/ApplicationComponents/CMakeLists.txt @@ -1,6 +1,7 @@ set(classes lqAboutDialogReaction lqLidarViewManager + lqMenuSaveAsReaction lqOpenPcapReaction lqOpenRecentFilesReaction lqOpenSensorReaction diff --git a/Application/Qt/ApplicationComponents/lqMenuSaveAsReaction.cxx b/Application/Qt/ApplicationComponents/lqMenuSaveAsReaction.cxx new file mode 100644 index 0000000000000000000000000000000000000000..139acb491993e466c08263e34481ce506b775bf8 --- /dev/null +++ b/Application/Qt/ApplicationComponents/lqMenuSaveAsReaction.cxx @@ -0,0 +1,42 @@ +/*========================================================================= + + Program: LidarView + Module: lqMenuSaveAsReaction.cxx + + Copyright (c) Kitware Inc. + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ + +#include "lqMenuSaveAsReaction.h" + +#include + +#include "lqHelper.h" + +//----------------------------------------------------------------------------- +lqMenuSaveAsReaction::lqMenuSaveAsReaction(QMenu* parentObject) + : Superclass(parentObject) +{ + auto* core = pqApplicationCore::instance(); + + pqServerManagerModel* smmodel = core->getServerManagerModel(); + this->connect( + smmodel, SIGNAL(sourceAdded(pqPipelineSource*)), SLOT(onUpdateUI(pqPipelineSource*))); + this->connect( + smmodel, SIGNAL(sourceRemoved(pqPipelineSource*)), SLOT(onUpdateUI(pqPipelineSource*))); + + this->onUpdateUI(nullptr); +} + +//----------------------------------------------------------------------------- +void lqMenuSaveAsReaction::onUpdateUI(pqPipelineSource*) +{ + bool hasLidarReader = HasProxy(); + this->parentMenu()->setEnabled(hasLidarReader); +} diff --git a/Application/Qt/ApplicationComponents/lqMenuSaveAsReaction.h b/Application/Qt/ApplicationComponents/lqMenuSaveAsReaction.h new file mode 100644 index 0000000000000000000000000000000000000000..713e0969c2c17c7aaf9ca64c88143d316b01072f --- /dev/null +++ b/Application/Qt/ApplicationComponents/lqMenuSaveAsReaction.h @@ -0,0 +1,56 @@ +/*========================================================================= + + Program: LidarView + Module: lqMenuSaveAsReaction.h + + Copyright (c) Kitware Inc. + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ + +#ifndef lqMenuSaveAsReaction_h +#define lqMenuSaveAsReaction_h + +#include "lvApplicationComponentsModule.h" + +#include +#include + +class pqPipelineSource; + +/** + * @ingroup Reactions + * Reaction to save data files. + */ +class LVAPPLICATIONCOMPONENTS_EXPORT lqMenuSaveAsReaction : public QObject +{ + Q_OBJECT + typedef QObject Superclass; + +public: + /** + * Constructor. Parent cannot be nullptr. + */ + lqMenuSaveAsReaction(QMenu* parent); + + /** + * Provides access to the parent menu. + */ + QMenu* parentMenu() const { return qobject_cast(this->parent()); } + +public Q_SLOTS: + /** + * Updates the enabled state. Applications need not explicitly call this. + */ + void onUpdateUI(pqPipelineSource*); + +private: + Q_DISABLE_COPY(lqMenuSaveAsReaction) +}; + +#endif diff --git a/Application/Qt/ApplicationComponents/lqOpenPcapReaction.cxx b/Application/Qt/ApplicationComponents/lqOpenPcapReaction.cxx index db9d34e5fc3dbcb139b83cd2fc49152f95ba226d..354f808e18eab49ee67faa8a55db19f0b818aaa8 100644 --- a/Application/Qt/ApplicationComponents/lqOpenPcapReaction.cxx +++ b/Application/Qt/ApplicationComponents/lqOpenPcapReaction.cxx @@ -18,6 +18,7 @@ #include #include #include +#include #include "lqCalibrationDialog.h" #include "lqHelper.h" @@ -185,9 +186,8 @@ void lqOpenPcapReaction::createSourceFromFile(QString fileName, const lqCalibrat controller->Show(posOrSource->getSourceProxy(), 0, view->getViewProxy()); } - // Update applogic to be able to use function only define in applogic. - lqLidarViewManager::instance()->runPython( - QString("lv.UpdateApplogicReader('%1', '%2')\n").arg(lidarName, posOrName)); + vtkSMAnimationSceneProxy::UpdateAnimationUsingDataTimeSteps( + controller->GetAnimationScene(server->session())); // Show the Lidar source controller->Show(lidarSource->getSourceProxy(), 0, view->getViewProxy()); diff --git a/Application/Qt/ApplicationComponents/lqOpenSensorReaction.cxx b/Application/Qt/ApplicationComponents/lqOpenSensorReaction.cxx index 7f93e4df5174bc3da9745827589693a76114af03..ff41fb1eed11ccda05b53a08a6d8322c3a14cde4 100644 --- a/Application/Qt/ApplicationComponents/lqOpenSensorReaction.cxx +++ b/Application/Qt/ApplicationComponents/lqOpenSensorReaction.cxx @@ -15,11 +15,11 @@ #include #include +#include "lqCalibrationDialog.h" #include "lqHelper.h" #include "lqLidarViewManager.h" #include "lqSensorListWidget.h" #include "lqUpdateCalibrationReaction.h" -#include "lqCalibrationDialog.h" #include #include @@ -96,8 +96,4 @@ void lqOpenSensorReaction::createSensorStream(const lqCalibrationDialog& dialog) // "Start" of the lidar Source have to be called lidarSource->getProxy()->InvokeCommand("Start"); - - // Update applogic to be able to use function only define in applogic. - lqLidarViewManager::instance()->runPython( - QString("lv.UpdateApplogicLidar('%1', '%2')\n").arg(lidarName, posOrName)); } diff --git a/Application/Wrapping/Python/CMakeLists.txt b/Application/Wrapping/Python/CMakeLists.txt index 58fd12d1270528ec3eb638fc2760db9f4ff6a0ce..a8bcdef2018ab89922560f87073e6443eca9b6ea 100644 --- a/Application/Wrapping/Python/CMakeLists.txt +++ b/Application/Wrapping/Python/CMakeLists.txt @@ -5,7 +5,6 @@ python_module_install( FILES __init__.py applogic.py - gridAdjustmentDialog.py planefit.py simple.py OUTPUT_DIRECTORY lidarview diff --git a/Application/Wrapping/Python/applogic.py b/Application/Wrapping/Python/applogic.py index 4613b5f6fbc69d077cc9487e110d689bc01870ee..5219e26cc4aec29cc8c8c18ae18d8824a0e96ece 100644 --- a/Application/Wrapping/Python/applogic.py +++ b/Application/Wrapping/Python/applogic.py @@ -21,8 +21,6 @@ from paraview import vtk import PythonQt from PythonQt import QtCore, QtGui -import lidarview.gridAdjustmentDialog -import lidarview.planefit as planefit import lidarview.simple as lvsmp # import the vtk wrapping of the Lidar Plugin @@ -39,150 +37,6 @@ class AppLogic(object): def __init__(self): pass -# Array Helper -def hasArrayName(sourceProxy, arrayName): - ''' - Returns True if the data has non-zero points and has a point data - attribute with the given arrayName. - ''' - if not sourceProxy: - return False - - info = sourceProxy.GetDataInformation().DataInformation - if info.GetNumberOfPoints() == 0: - return False - - # ~ info = info.GetAttributeInformation(0) - # ~ for i in range(info.GetNumberOfArrays()): - # ~ if info.GetArrayInformation(i).GetName() == arrayName: - # ~ return True - # ~ return False - array = sourceProxy.PointData.GetArray(arrayName) - if array: - return True - -# Action Related Logic -def planeFit(): - planefit.fitPlane(app.actions['actionSpreadsheet']) - -# Main API -def UpdateApplogicCommon(lidar): - # WIP ACTUALLY THINK ABOUT always enabled ok, just apply settings on current lidar actually needed - # Overall on what buttons are on-off when there is data or not - - # Reset Scene Time # WIP TIME CONTROLLER API ? - smp.GetActiveView().ViewTime = 0.0 - -# Used by lqLidarViewManager -def UpdateApplogicLidar(lidarProxyName, gpsProxyName): - - sensor = smp.FindSource(lidarProxyName) #WIP use getSensor() and getPosOr() - if not sensor: - return - - UpdateApplogicCommon(sensor) - - sensor.UpdatePipelineInformation() - sensor.UpdatePipeline() - - enableSaveActions() # WIP UNSURE - - smp.Show(sensor) - showSourceInSpreadSheet(sensor) - smp.Render() - -# Used by lqLidarViewManager -def UpdateApplogicReader(lidarName, posOrName): # WIP could explicit send Proxy using _getPyProxy(vtkSMProxy) - - reader = getReader() - if not reader : - return - - UpdateApplogicCommon(reader) - - reader.UpdatePipelineInformation() - reader.UpdatePipeline() - - enableSaveActions() - - getAnimationScene().UpdateAnimationUsingDataTimeSteps() - - smp.SetActiveView(smp.GetActiveView()) - -def onClose(): - # Pause - smp.GetAnimationScene().Stop() - # Remove Lidar Related - unloadData() - getAnimationScene().AnimationTime = 0 - # Remove widgets - smp.HideUnusedScalarBars() - - # Reset Camera - lvsmp.ResetCameraToForwardView() - - # Disable Actions - disableSaveActions() - -# Generic Helpers -def _setSaveActionsEnabled(enabled): - app.actions['actionClose'].setEnabled(enabled) - getMainWindow().findChild('QMenu', 'menuSaveAs').enabled = enabled - - -def enableSaveActions(): - _setSaveActionsEnabled(True) - - -def disableSaveActions(): - _setSaveActionsEnabled(False) - - -def unloadData(): - for k, src in smp.GetSources().items(): - if src != app.grid: - smp.Delete(src) - - clearSpreadSheetView() - -def getReaderSource(): - return PythonQt.paraview.lqSensorListWidget.getActiveLidarSource() - -def getReader(index = -1): - return paraview.servermanager._getPyProxy(PythonQt.paraview.lqSensorListWidget.getReader(index)) - -#def getLidarNew(): -# return paraview.servermanager._getPyProxy(PythonQt.paraview.lqSensorListWidget.getLidar()) - -def getSensor(index = -1): - return paraview.servermanager._getPyProxy(PythonQt.paraview.lqSensorListWidget.getSensor(index)) - -def getPosOrSource(index = -1): - return paraview.servermanager._getPyProxy(PythonQt.paraview.lqSensorListWidget.getPosOrSource(index)) - -def getLidar(index = -1): # WIP TODO - return getReader(index) or getSensor(index) - -def getSpreadSheetViewProxy(): #WIP this is probably unreliable - return smp.servermanager.ProxyManager().GetProxy("views", "main spreadsheet view") - -def clearSpreadSheetView(): - view = getSpreadSheetViewProxy() - if view is not None: - view.Representations = [] - - -def showSourceInSpreadSheet(source): - if not source: - return - spreadSheetView = getSpreadSheetViewProxy() - smp.Show(source, spreadSheetView) - - # Work around a bug where the 'Showing' combobox doesn't update. - # Calling hide and show again will trigger the refresh. - smp.Hide(source, spreadSheetView) - smp.Show(source, spreadSheetView) - def createGrid(): app.grid = smp.GridSource(guiName='Measurement Grid') @@ -233,13 +87,6 @@ def createGrid(): smp.Show(app.grid) return app.grid -def getAnimationScene(): - '''This function is a workaround because paraview.simple.GetAnimationScene() - has an issue where the returned proxy might not have its Cues property initialized''' - for proxy in paraview.servermanager.ProxyManager().GetProxiesInGroup("animation").values(): - if proxy.GetXMLName() == 'AnimationScene' and len(proxy.Cues): - return proxy - # Main function, Used by lqLidarViewManager def start(): @@ -251,168 +98,13 @@ def start(): lvsmp.ResetCameraToForwardView() - setupActions() - disableSaveActions() - hideColorByComponent() - # Create Grid #WIP not perfect requires loaded plugin createGrid() -def findQObjectByName(widgets, name): - for w in widgets: - if w.objectName == name: - return w - - -def getMainWindow(): - return findQObjectByName(QtGui.QApplication.topLevelWidgets(), 'LidarViewMainWindow') - - def getPVApplicationCore(): return PythonQt.paraview.pqPVApplicationCore.instance() def getPVSettings(): return getPVApplicationCore().settings() - -def onGridProperties(): - if not app.grid: - createGrid() - if lidarview.gridAdjustmentDialog.showDialog(getMainWindow(), app): - rep = smp.Show(app.grid) - rep.LineWidth = app.grid.LineWidth - rep.DiffuseColor = app.grid.Color - - if(getPVSettings().value('LidarPlugin/grid/gridPropertiesPersist') == "true") : - getPVSettings().setValue('LidarPlugin/grid/gridColor', app.grid.Color) - getPVSettings().setValue('LidarPlugin/grid/LineWidth', app.grid.LineWidth) - getPVSettings().setValue('LidarPlugin/grid/GridNbTicks', app.grid.GridNbTicks) - getPVSettings().setValue('LidarPlugin/grid/Normal', app.grid.Normal) - getPVSettings().setValue('LidarPlugin/grid/Origin', app.grid.Origin) - getPVSettings().setValue('LidarPlugin/grid/Scale', app.grid.Scale) - - smp.Render() - -def hideColorByComponent(): - getMainWindow().findChild('lqColorToolbar').findChild('pqDisplayColorWidget').findChildren('QComboBox')[1].hide() - -def adjustScalarBarRangeLabelFormat(): - if not app.actions['actionScalarBarVisibility'].isChecked(): - return - - arrayName = getMainWindow().findChild('lqColorToolbar').findChild('pqDisplayColorWidget').findChild('QComboBox').currentText - if arrayName != '' and hasArrayName(getReader(), arrayName): - sb = smp.GetScalarBar(smp.GetLookupTableForArray(arrayName, [])) - sb.RangeLabelFormat = '%g' - smp.Render() - -def transformMode(): - reader = getReader() - if not reader: - return None - if hasattr(reader.Interpreter, 'ApplyTransform') and reader.Interpreter.ApplyTransform: - return 1 # absolute - else: - return 0 # raw - -def setTransformMode(mode): - # 0 - raw - # 1 - absolute - # 2 - relative # WIP what ? - reader = getReader() - - if reader: - reader.Interpreter.ApplyTransform = (mode > 0) - -def geolocationChanged(setting): - setTransformMode(setting) - smp.Render(view=smp.GetActiveView()) - -def onToogleAdvancedGUI(updateSettings = True): - """ Switch the GUI between advanced and classic mode""" - # hide/show Sources menu - menuSources = getMainWindow().findChild("QMenu", "menuSources").menuAction() - menuSources.visible = not menuSources.visible - # hide/show Filters menu - menuFilters = getMainWindow().findChild("QMenu", "menuFilters").menuAction() - menuFilters.visible = not menuFilters.visible - # hide/show Advance menu - menuAdvance = getMainWindow().findChild("QMenu", "menuAdvance").menuAction() - menuAdvance.visible = not menuAdvance.visible - # hide/show view decorator - getMainWindow().centralWidget().toggleWidgetDecoration() - # update the UserSettings - if updateSettings: - # booleans must be store as int - newValue = int(not int(getPVSettings().value("LidarPlugin/AdvanceFeature/Enable", 0))) - getPVSettings().setValue("LidarPlugin/AdvanceFeature/Enable", newValue) - -def switchVisibility(Proxy): - """ Invert the Proxy visibility int the current view """ - ProxyRep = smp.GetRepresentation(Proxy) - ProxyRep.Visibility = not ProxyRep.Visibility - -def ShowPosition(): - position = getPosOrSource() - if position: - switchVisibility(position) - smp.Render() - -# Setup Actions -def setupActions(): - - mW = getMainWindow() - actions = mW.findChildren('QAction') - - app.actions = {} - - for a in actions: - app.actions[a.objectName] = a - - app.actions['actionAdvanceFeature'].connect('triggered()', onToogleAdvancedGUI) - app.actions['actionPlaneFit'].connect('triggered()', planeFit) - app.actions['actionClose'].connect('triggered()', onClose) - app.actions['actionGrid_Properties'].connect('triggered()', onGridProperties) - app.actions['actionShowPosition'].connect('triggered()', ShowPosition) - - # Restore action states from settings - settings = getPVSettings() - - advanceMode = int(settings.value("LidarPlugin/AdvanceFeature/Enable", 0)) - if not advanceMode: - app.actions['actionAdvanceFeature'].checked = False - onToogleAdvancedGUI(updateSettings=False) - - # Setup and add the geolocation toolbar - geolocationToolBar = mW.findChild('QToolBar', 'geolocationToolbar') - - # Creating and adding the geolocation label to the geolocation toolbar - geolocationLabel = QtGui.QLabel('Frame Mapping: ') - geolocationToolBar.addWidget(geolocationLabel) - - # Creating the geolocation combobox - geolocationComboBox = QtGui.QComboBox() - - # Add the different entries - # Currently, as Absolute and Relative Geolocation options are broken, disable them. - geolocationComboBox.addItem('None (RAW Data)') - geolocationComboBox.setItemData(0, "No mapping: Each frame is at the origin", 3) - - geolocationComboBox.addItem('Absolute Geolocation') - geolocationComboBox.setItemData(1, "Use GPS geolocation to get each frame absolute location, the first frame is shown at origin", 3) - geolocationComboBox.model().item(1).setEnabled(False) - - geolocationComboBox.addItem('Relative Geolocation') - geolocationComboBox.setItemData(2, "Use GPS geolocation to get each frame absolute location, the current frame is shown at origin", 3) - geolocationComboBox.model().item(2).setEnabled(False) - - geolocationComboBox.connect('currentIndexChanged(int)', geolocationChanged) - geolocationToolBar.addWidget(geolocationComboBox) - - # Set default toolbar visibility - geolocationToolBar.visible = False - - displayWidget = getMainWindow().findChild('lqColorToolbar').findChild('pqDisplayColorWidget') - displayWidget.connect('arraySelectionChanged ()',adjustScalarBarRangeLabelFormat) - app.actions['actionScalarBarVisibility'].connect('triggered()',adjustScalarBarRangeLabelFormat) diff --git a/Application/Wrapping/Python/gridAdjustmentDialog.py b/Application/Wrapping/Python/gridAdjustmentDialog.py deleted file mode 100644 index d4ce4517ae40925bf7b07a8cf6147d5651176012..0000000000000000000000000000000000000000 --- a/Application/Wrapping/Python/gridAdjustmentDialog.py +++ /dev/null @@ -1,91 +0,0 @@ -# Copyright 2013 Velodyne Acoustics, Inc. -# -# 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. -from __future__ import print_function -from PythonQt import QtCore, QtGui, QtUiTools, paraview -import math - -def showDialog(mainWindow, app): - - loader = QtUiTools.QUiLoader() - uifile = QtCore.QFile(':/lvResources/lqGridAdjustmentDialog.ui') - if not uifile.open(uifile.ReadOnly): - print("error opening file") - return - - dialog = loader.load(uifile, mainWindow) - uifile.close() - - # Delete "?" Button that appears on windows os - # Rewrite the flags without QtCore.Qt.WindowContextHelpButtonHint - flags = QtCore.Qt.Dialog | QtCore.Qt.WindowStaysOnTopHint | QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint - dialog.setWindowFlags(flags) - - - def w(name): - for widget in dialog.children(): - if widget.objectName == name: - return widget - - w('SensorUpX').setValue(app.grid.Normal[0]) - w('SensorUpY').setValue(app.grid.Normal[1]) - w('SensorUpZ').setValue(app.grid.Normal[2]) - - w('SensorOriginX').setValue(-app.grid.Origin[0]) - w('SensorOriginY').setValue(-app.grid.Origin[1]) - w('SensorOriginZ').setValue(-app.grid.Origin[2]) - - w('GridResolution').setValue(app.grid.Scale) - w('GridWidth').setValue(app.grid.Scale*app.grid.GridNbTicks) - w('GridLineWidth').setValue(app.grid.LineWidth) - - r = app.grid.Color[0] * 255 - g = app.grid.Color[1] * 255 - b = app.grid.Color[2] * 255 - w('GridColorPicker').setStyleSheet("background-color: rgb(" + str(r) + "," + str(g) + "," + str(b) +");") - - pvsettings = paraview.pqPVApplicationCore.instance().settings() - w('ShouldPropertiesPersist').setChecked(pvsettings.value('LidarPlugin/grid/gridPropertiesPersist') == "true") - - def pickColor(): - colorPicker = QtGui.QColorDialog() - colorPicker.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) - - if(colorPicker.exec()): - qColor = colorPicker.selectedColor() - - if not qColor.isValid(): - return False - - r = qColor.red() - g = qColor.green() - b = qColor.blue() - w('GridColorPicker').setStyleSheet("background-color: rgb(" + str(r) + "," + str(g) + "," + str(b) +");") - - w('GridColorPicker').connect('clicked()', pickColor) - - accepted = dialog.exec_() - if not accepted: - return False - - app.grid.Normal = [w('SensorUpX').value, w('SensorUpY').value, w('SensorUpZ').value] - app.grid.Origin = [-w('SensorOriginX').value, -w('SensorOriginY').value, -w('SensorOriginZ').value] - app.grid.Scale = w('GridResolution').value - app.grid.GridNbTicks = int(math.ceil(w('GridWidth').value / w('GridResolution').value)) - app.grid.LineWidth = w('GridLineWidth').value - color = w('GridColorPicker').palette.color(QtGui.QPalette.Background) - app.grid.Color = [color.redF(), color.greenF(), color.blueF()] - - pvsettings.setValue('LidarPlugin/grid/gridPropertiesPersist', "true" if w('ShouldPropertiesPersist').checked else "false" ) - - return True diff --git a/LVCore b/LVCore index 237fcb3c3c0268d19c13877b5f24cddb8d7a351d..d065d75c6a43d80f3023e8b393e8a69c0e5f8301 160000 --- a/LVCore +++ b/LVCore @@ -1 +1 @@ -Subproject commit 237fcb3c3c0268d19c13877b5f24cddb8d7a351d +Subproject commit d065d75c6a43d80f3023e8b393e8a69c0e5f8301