mirror of
https://github.com/OpenFOAM/ThirdParty-6.git
synced 2025-12-08 06:57:43 +00:00
ParaView-5.0.1: Added the source-tree to ThirdParty-dev and patched as described in the README file
Resolves bug-report http://bugs.openfoam.org/view.php?id=2098
This commit is contained in:
512
ParaView-5.0.1/Qt/ApplicationComponents/CMakeLists.txt
Normal file
512
ParaView-5.0.1/Qt/ApplicationComponents/CMakeLists.txt
Normal file
@ -0,0 +1,512 @@
|
||||
#==========================================================================
|
||||
#
|
||||
# Program: ParaView
|
||||
#
|
||||
# Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# ParaView is a free software; you can redistribute it and/or modify it
|
||||
# under the terms of the ParaView license version 1.2.
|
||||
#
|
||||
# See License_v1.2.txt for the full ParaView license.
|
||||
# A copy of this license can be obtained by contacting
|
||||
# Kitware Inc.
|
||||
# 28 Corporate Drive
|
||||
# Clifton Park, NY 12065
|
||||
# USA
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
#==========================================================================
|
||||
set (Module_SRCS
|
||||
pqAboutDialogReaction.cxx
|
||||
pqAboutDialogReaction.h
|
||||
pqAlwaysConnectedBehavior.cxx
|
||||
pqAlwaysConnectedBehavior.h
|
||||
pqAnimationTimeToolbar.cxx
|
||||
pqAnimationTimeToolbar.h
|
||||
pqAnimationTimeWidget.cxx
|
||||
pqAnimationTimeWidget.h
|
||||
pqApplicationComponentsInit.cxx
|
||||
pqApplicationComponentsInit.h
|
||||
pqApplicationSettingsReaction.cxx
|
||||
pqApplicationSettingsReaction.h
|
||||
pqApplyBehavior.cxx
|
||||
pqApplyBehavior.h
|
||||
pqAutoApplyReaction.cxx
|
||||
pqAutoApplyReaction.h
|
||||
pqAutoLoadPluginXMLBehavior.cxx
|
||||
pqAutoLoadPluginXMLBehavior.h
|
||||
pqAxesToolbar.cxx
|
||||
pqAxesToolbar.h
|
||||
pqBackgroundEditorWidget.cxx
|
||||
pqBackgroundEditorWidget.h
|
||||
pqBoolPropertyWidgetDecorator.cxx
|
||||
pqBoolPropertyWidgetDecorator.h
|
||||
pqCTHArraySelectionDecorator.cxx
|
||||
pqCTHArraySelectionDecorator.h
|
||||
pqCameraLinkReaction.cxx
|
||||
pqCameraLinkReaction.h
|
||||
pqCameraManipulatorWidget.cxx
|
||||
pqCameraManipulatorWidget.h
|
||||
pqCameraReaction.cxx
|
||||
pqCameraReaction.h
|
||||
pqCameraToolbar.cxx
|
||||
pqCameraToolbar.h
|
||||
pqCameraUndoRedoReaction.cxx
|
||||
pqCameraUndoRedoReaction.h
|
||||
pqCatalystConnectReaction.cxx
|
||||
pqCatalystConnectReaction.h
|
||||
pqCatalystContinueReaction.h
|
||||
pqCatalystPauseSimulationReaction.cxx
|
||||
pqCatalystPauseSimulationReaction.h
|
||||
pqCatalystRemoveBreakpointReaction.cxx
|
||||
pqCatalystRemoveBreakpointReaction.h
|
||||
pqCatalystSetBreakpointReaction.cxx
|
||||
pqCatalystSetBreakpointReaction.h
|
||||
pqCategoryToolbarsBehavior.cxx
|
||||
pqCategoryToolbarsBehavior.h
|
||||
pqChangePipelineInputReaction.cxx
|
||||
pqChangePipelineInputReaction.h
|
||||
pqChartSelectionReaction.cxx
|
||||
pqChartSelectionReaction.h
|
||||
pqCollaborationBehavior.cxx
|
||||
pqCollaborationBehavior.h
|
||||
pqColorAnnotationsPropertyWidget.cxx
|
||||
pqColorAnnotationsPropertyWidget.h
|
||||
pqColorEditorPropertyWidget.cxx
|
||||
pqColorEditorPropertyWidget.h
|
||||
pqColorMapEditor.cxx
|
||||
pqColorMapEditor.h
|
||||
pqColorOpacityEditorWidget.cxx
|
||||
pqColorOpacityEditorWidget.h
|
||||
pqColorPaletteSelectorWidget.cxx
|
||||
pqColorPaletteSelectorWidget.h
|
||||
pqColorSelectorPropertyWidget.cxx
|
||||
pqColorSelectorPropertyWidget.h
|
||||
pqColorTableModel.cxx
|
||||
pqColorTableModel.h
|
||||
pqColorToolbar.cxx
|
||||
pqColorToolbar.h
|
||||
pqCommandButtonPropertyWidget.cxx
|
||||
pqCommandButtonPropertyWidget.h
|
||||
pqCommandLineOptionsBehavior.cxx
|
||||
pqCommandLineOptionsBehavior.h
|
||||
pqCopyReaction.cxx
|
||||
pqCopyReaction.h
|
||||
pqCrashRecoveryBehavior.cxx
|
||||
pqCrashRecoveryBehavior.h
|
||||
pqCreateCustomFilterReaction.cxx
|
||||
pqCreateCustomFilterReaction.h
|
||||
pqCubeAxesPropertyWidget.cxx
|
||||
pqCubeAxesPropertyWidget.h
|
||||
pqDataQueryReaction.cxx
|
||||
pqDataQueryReaction.h
|
||||
pqDataTimeStepBehavior.cxx
|
||||
pqDataTimeStepBehavior.h
|
||||
pqDefaultMainWindow.cxx
|
||||
pqDefaultMainWindow.h
|
||||
pqDefaultViewBehavior.cxx
|
||||
pqDefaultViewBehavior.h
|
||||
pqDeleteReaction.cxx
|
||||
pqDeleteReaction.h
|
||||
pqDesktopServicesReaction.cxx
|
||||
pqDesktopServicesReaction.h
|
||||
pqDoubleRangeSliderPropertyWidget.cxx
|
||||
pqDoubleRangeSliderPropertyWidget.h
|
||||
pqEditCameraReaction.cxx
|
||||
pqEditCameraReaction.h
|
||||
pqEditColorMapReaction.cxx
|
||||
pqEditColorMapReaction.h
|
||||
pqEnableWidgetDecorator.cxx
|
||||
pqEnableWidgetDecorator.h
|
||||
pqExportReaction.cxx
|
||||
pqExportReaction.h
|
||||
pqFileNamePropertyWidget.cxx
|
||||
pqFileNamePropertyWidget.h
|
||||
pqFiltersMenuReaction.cxx
|
||||
pqFiltersMenuReaction.h
|
||||
pqFixPathsInStateFilesBehavior.cxx
|
||||
pqFixPathsInStateFilesBehavior.h
|
||||
pqFontPropertyWidget.cxx
|
||||
pqFontPropertyWidget.h
|
||||
pqGenericPropertyWidgetDecorator.cxx
|
||||
pqGenericPropertyWidgetDecorator.h
|
||||
pqGlyphScaleFactorPropertyWidget.cxx
|
||||
pqGlyphScaleFactorPropertyWidget.h
|
||||
pqHelpReaction.cxx
|
||||
pqHelpReaction.h
|
||||
pqIgnoreSourceTimeReaction.cxx
|
||||
pqIgnoreSourceTimeReaction.h
|
||||
pqImageCompressorWidget.cxx
|
||||
pqImageCompressorWidget.h
|
||||
pqInputDataTypeDecorator.cxx
|
||||
pqInputDataTypeDecorator.h
|
||||
pqLightsEditor.cxx
|
||||
pqLightsEditor.h
|
||||
pqLinkSelectionReaction.cxx
|
||||
pqLinkSelectionReaction.h
|
||||
pqListPropertyWidget.cxx
|
||||
pqListPropertyWidget.h
|
||||
pqLoadDataReaction.cxx
|
||||
pqLoadDataReaction.h
|
||||
pqLoadPaletteReaction.cxx
|
||||
pqLoadPaletteReaction.h
|
||||
pqLoadRestoreWindowLayoutReaction.cxx
|
||||
pqLoadRestoreWindowLayoutReaction.h
|
||||
pqLoadStateReaction.cxx
|
||||
pqLoadStateReaction.h
|
||||
pqMainControlsToolbar.cxx
|
||||
pqMainControlsToolbar.h
|
||||
pqManageCustomFiltersReaction.cxx
|
||||
pqManageCustomFiltersReaction.h
|
||||
pqManageLinksReaction.cxx
|
||||
pqManageLinksReaction.h
|
||||
pqManagePluginsReaction.cxx
|
||||
pqManagePluginsReaction.h
|
||||
pqMasterOnlyReaction.cxx
|
||||
pqMasterOnlyReaction.h
|
||||
pqModelTransformSupportBehavior.cxx
|
||||
pqModelTransformSupportBehavior.h
|
||||
pqObjectPickingBehavior.cxx
|
||||
pqObjectPickingBehavior.h
|
||||
pqOpacityTableModel.cxx
|
||||
pqOpacityTableModel.h
|
||||
pqPVAnimationWidget.cxx
|
||||
pqPVAnimationWidget.h
|
||||
pqPVApplicationCore.cxx
|
||||
pqPVApplicationCore.h
|
||||
pqParaViewBehaviors.cxx
|
||||
pqParaViewBehaviors.h
|
||||
pqParaViewMenuBuilders.cxx
|
||||
pqParaViewMenuBuilders.h
|
||||
pqPersistentMainWindowStateBehavior.cxx
|
||||
pqPersistentMainWindowStateBehavior.h
|
||||
pqPipelineContextMenuBehavior.cxx
|
||||
pqPipelineContextMenuBehavior.h
|
||||
pqPluginActionGroupBehavior.cxx
|
||||
pqPluginActionGroupBehavior.h
|
||||
pqPluginDockWidgetsBehavior.cxx
|
||||
pqPluginDockWidgetsBehavior.h
|
||||
pqPluginDocumentationBehavior.cxx
|
||||
pqPluginDocumentationBehavior.h
|
||||
pqPluginSettingsBehavior.cxx
|
||||
pqPluginSettingsBehavior.h
|
||||
pqPropertyGroupButton.cxx
|
||||
pqPropertyGroupButton.h
|
||||
pqProxyGroupMenuManager.cxx
|
||||
pqProxyGroupMenuManager.h
|
||||
pqPythonShellReaction.cxx
|
||||
pqPythonShellReaction.h
|
||||
pqQtMessageHandlerBehavior.cxx
|
||||
pqQtMessageHandlerBehavior.h
|
||||
pqReaction.cxx
|
||||
pqReaction.h
|
||||
pqRenderViewSelectionReaction.cxx
|
||||
pqRenderViewSelectionReaction.h
|
||||
pqRepresentationToolbar.cxx
|
||||
pqRepresentationToolbar.h
|
||||
pqRescaleCustomScalarRangeReaction.cxx
|
||||
pqRescaleCustomScalarRangeReaction.h
|
||||
pqRescaleVisibleScalarRangeReaction.cxx
|
||||
pqRescaleVisibleScalarRangeReaction.h
|
||||
pqResetScalarRangeReaction.cxx
|
||||
pqResetScalarRangeReaction.h
|
||||
pqSaveAnimationGeometryReaction.cxx
|
||||
pqSaveAnimationGeometryReaction.h
|
||||
pqSaveAnimationReaction.cxx
|
||||
pqSaveAnimationReaction.h
|
||||
pqSaveDataReaction.cxx
|
||||
pqSaveDataReaction.h
|
||||
pqSaveScreenshotReaction.cxx
|
||||
pqSaveScreenshotReaction.h
|
||||
pqSaveStateReaction.cxx
|
||||
pqSaveStateReaction.h
|
||||
pqScalarBarVisibilityReaction.cxx
|
||||
pqScalarBarVisibilityReaction.h
|
||||
pqSelectionReaction.cxx
|
||||
pqSelectionReaction.h
|
||||
pqSeriesEditorPropertyWidget.cxx
|
||||
pqSeriesEditorPropertyWidget.h
|
||||
pqServerConnectReaction.cxx
|
||||
pqServerConnectReaction.h
|
||||
pqServerDisconnectReaction.cxx
|
||||
pqServerDisconnectReaction.h
|
||||
pqShowWidgetDecorator.cxx
|
||||
pqShowWidgetDecorator.h
|
||||
pqSourcesMenuReaction.cxx
|
||||
pqSourcesMenuReaction.h
|
||||
pqSpreadSheetVisibilityBehavior.cxx
|
||||
pqSpreadSheetVisibilityBehavior.h
|
||||
pqStandardArrayColorMapsBehavior.cxx
|
||||
pqStandardArrayColorMapsBehavior.h
|
||||
pqStandardPropertyWidgetInterface.cxx
|
||||
pqStandardPropertyWidgetInterface.h
|
||||
pqStandardViewFrameActionsImplementation.cxx
|
||||
pqStandardViewFrameActionsImplementation.h
|
||||
pqStatusBar.cxx
|
||||
pqStatusBar.h
|
||||
pqStreamingTestingEventPlayer.cxx
|
||||
pqStreamingTestingEventPlayer.h
|
||||
pqTestingReaction.cxx
|
||||
pqTestingReaction.h
|
||||
pqTextLocationWidget.cxx
|
||||
pqTextLocationWidget.h
|
||||
pqTimeInspectorWidget.cxx
|
||||
pqTimeInspectorWidget.h
|
||||
pqTimerLogReaction.cxx
|
||||
pqTimerLogReaction.h
|
||||
pqToggleInteractionViewMode.cxx
|
||||
pqToggleInteractionViewMode.h
|
||||
pqTransferFunctionWidgetPropertyWidget.cxx
|
||||
pqTransferFunctionWidgetPropertyWidget.h
|
||||
pqUndoRedoBehavior.cxx
|
||||
pqUndoRedoBehavior.h
|
||||
pqUndoRedoReaction.cxx
|
||||
pqUndoRedoReaction.h
|
||||
pqVCRToolbar.cxx
|
||||
pqVCRToolbar.h
|
||||
pqVerifyRequiredPluginBehavior.cxx
|
||||
pqVerifyRequiredPluginBehavior.h
|
||||
pqViewMenuManager.cxx
|
||||
pqViewMenuManager.h
|
||||
pqViewStreamingBehavior.cxx
|
||||
pqViewStreamingBehavior.h
|
||||
pqViewTypePropertyWidget.cxx
|
||||
pqViewTypePropertyWidget.h
|
||||
)
|
||||
|
||||
set (Module_MOC_HDRS
|
||||
pqAboutDialogReaction.h
|
||||
pqAlwaysConnectedBehavior.h
|
||||
pqAnimationTimeToolbar.h
|
||||
pqAnimationTimeWidget.h
|
||||
pqApplicationSettingsReaction.h
|
||||
pqApplyBehavior.h
|
||||
pqAutoApplyReaction.h
|
||||
pqAutoLoadPluginXMLBehavior.h
|
||||
pqAxesToolbar.h
|
||||
pqBackgroundEditorWidget.h
|
||||
pqBoolPropertyWidgetDecorator.h
|
||||
pqCTHArraySelectionDecorator.h
|
||||
pqCameraLinkReaction.h
|
||||
pqCameraManipulatorWidget.h
|
||||
pqCameraReaction.h
|
||||
pqCameraToolbar.h
|
||||
pqCameraUndoRedoReaction.h
|
||||
pqCatalystConnectReaction.h
|
||||
pqCatalystContinueReaction.h
|
||||
pqCatalystPauseSimulationReaction.h
|
||||
pqCatalystRemoveBreakpointReaction.h
|
||||
pqCatalystSetBreakpointReaction.h
|
||||
pqCategoryToolbarsBehavior.h
|
||||
pqChangePipelineInputReaction.h
|
||||
pqChartSelectionReaction.h
|
||||
pqCollaborationBehavior.h
|
||||
pqColorAnnotationsPropertyWidget.h
|
||||
pqColorEditorPropertyWidget.h
|
||||
pqColorMapEditor.h
|
||||
pqColorOpacityEditorWidget.h
|
||||
pqColorPaletteSelectorWidget.h
|
||||
pqColorSelectorPropertyWidget.h
|
||||
pqColorTableModel.h
|
||||
pqColorToolbar.h
|
||||
pqCommandButtonPropertyWidget.h
|
||||
pqCommandLineOptionsBehavior.h
|
||||
pqCopyReaction.h
|
||||
pqCrashRecoveryBehavior.h
|
||||
pqCreateCustomFilterReaction.h
|
||||
pqCubeAxesPropertyWidget.h
|
||||
pqDataQueryReaction.h
|
||||
pqDataTimeStepBehavior.h
|
||||
pqDefaultMainWindow.h
|
||||
pqDefaultViewBehavior.h
|
||||
pqDeleteReaction.h
|
||||
pqDesktopServicesReaction.h
|
||||
pqDoubleRangeSliderPropertyWidget.h
|
||||
pqEditCameraReaction.h
|
||||
pqEditColorMapReaction.h
|
||||
pqEnableWidgetDecorator.h
|
||||
pqExportReaction.h
|
||||
pqFileNamePropertyWidget.h
|
||||
pqFiltersMenuReaction.h
|
||||
pqFixPathsInStateFilesBehavior.h
|
||||
pqFontPropertyWidget.h
|
||||
pqGenericPropertyWidgetDecorator.h
|
||||
pqGlyphScaleFactorPropertyWidget.h
|
||||
pqHelpReaction.h
|
||||
pqIgnoreSourceTimeReaction.h
|
||||
pqImageCompressorWidget.h
|
||||
pqInputDataTypeDecorator.h
|
||||
pqLightsEditor.h
|
||||
pqLinkSelectionReaction.h
|
||||
pqListPropertyWidget.h
|
||||
pqLoadDataReaction.h
|
||||
pqLoadPaletteReaction.h
|
||||
pqLoadRestoreWindowLayoutReaction.h
|
||||
pqLoadStateReaction.h
|
||||
pqMainControlsToolbar.h
|
||||
pqManageCustomFiltersReaction.h
|
||||
pqManageLinksReaction.h
|
||||
pqManagePluginsReaction.h
|
||||
pqMasterOnlyReaction.h
|
||||
pqModelTransformSupportBehavior.h
|
||||
pqObjectPickingBehavior.h
|
||||
pqOpacityTableModel.h
|
||||
pqPVAnimationWidget.h
|
||||
pqPVApplicationCore.h
|
||||
pqParaViewBehaviors.h
|
||||
pqPersistentMainWindowStateBehavior.h
|
||||
pqPipelineContextMenuBehavior.h
|
||||
pqPluginActionGroupBehavior.h
|
||||
pqPluginDockWidgetsBehavior.h
|
||||
pqPluginDocumentationBehavior.h
|
||||
pqPluginSettingsBehavior.h
|
||||
pqPropertyGroupButton.h
|
||||
pqProxyGroupMenuManager.h
|
||||
pqPythonShellReaction.h
|
||||
pqQtMessageHandlerBehavior.h
|
||||
pqReaction.h
|
||||
pqRenderViewSelectionReaction.h
|
||||
pqRepresentationToolbar.h
|
||||
pqRescaleCustomScalarRangeReaction.h
|
||||
pqRescaleVisibleScalarRangeReaction.h
|
||||
pqResetScalarRangeReaction.h
|
||||
pqSaveAnimationGeometryReaction.h
|
||||
pqSaveAnimationReaction.h
|
||||
pqSaveDataReaction.h
|
||||
pqSaveScreenshotReaction.h
|
||||
pqSaveStateReaction.h
|
||||
pqScalarBarVisibilityReaction.h
|
||||
pqSelectionReaction.h
|
||||
pqSeriesEditorPropertyWidget.h
|
||||
pqServerConnectReaction.h
|
||||
pqServerDisconnectReaction.h
|
||||
pqShowWidgetDecorator.h
|
||||
pqSourcesMenuReaction.h
|
||||
pqSpreadSheetVisibilityBehavior.h
|
||||
pqStandardArrayColorMapsBehavior.h
|
||||
pqStandardPropertyWidgetInterface.h
|
||||
pqStandardViewFrameActionsImplementation.h
|
||||
pqStatusBar.h
|
||||
pqStreamingTestingEventPlayer.h
|
||||
pqTestingReaction.h
|
||||
pqTextLocationWidget.h
|
||||
pqTimeInspectorWidget.h
|
||||
pqTimerLogReaction.h
|
||||
pqToggleInteractionViewMode.h
|
||||
pqTransferFunctionWidgetPropertyWidget.h
|
||||
pqUndoRedoBehavior.h
|
||||
pqUndoRedoReaction.h
|
||||
pqVCRToolbar.h
|
||||
pqVerifyRequiredPluginBehavior.h
|
||||
pqViewMenuManager.h
|
||||
pqViewStreamingBehavior.h
|
||||
pqViewTypePropertyWidget.h
|
||||
)
|
||||
|
||||
if (PARAVIEW_ENABLE_PYTHON)
|
||||
list (APPEND Module_MOC_HDRS
|
||||
pqMacroReaction.h
|
||||
pqTraceReaction.h
|
||||
)
|
||||
|
||||
list (APPEND Module_SRCS
|
||||
pqMacroReaction.cxx
|
||||
pqMacroReaction.h
|
||||
pqTraceReaction.cxx
|
||||
pqTraceReaction.h
|
||||
)
|
||||
endif()
|
||||
|
||||
set (Module_UI_FILES
|
||||
Resources/UI/pqAnimationTimeWidget.ui
|
||||
Resources/UI/pqAxesToolbar.ui
|
||||
Resources/UI/pqBackgroundEditorWidget.ui
|
||||
Resources/UI/pqCameraManipulatorWidget.ui
|
||||
Resources/UI/pqCameraToolbar.ui
|
||||
Resources/UI/pqColorAnnotationsPropertyWidget.ui
|
||||
Resources/UI/pqColorEditorPropertyWidget.ui
|
||||
Resources/UI/pqColorMapEditor.ui
|
||||
Resources/UI/pqColorOpacityEditorWidget.ui
|
||||
Resources/UI/pqColorToolbar.ui
|
||||
Resources/UI/pqDefaultMainWindow.ui
|
||||
Resources/UI/pqDoubleRangeSliderPropertyWidget.ui
|
||||
Resources/UI/pqEditMenuBuilder.ui
|
||||
Resources/UI/pqFileMenuBuilder.ui
|
||||
Resources/UI/pqFontPropertyWidget.ui
|
||||
Resources/UI/pqImageCompressorWidget.ui
|
||||
Resources/UI/pqLightsEditor.ui
|
||||
Resources/UI/pqMainControlsToolbar.ui
|
||||
Resources/UI/pqPipelineBrowserContextMenu.ui
|
||||
Resources/UI/pqSavePresetOptions.ui
|
||||
Resources/UI/pqSeriesEditorPropertyWidget.ui
|
||||
Resources/UI/pqTextLocationWidget.ui
|
||||
Resources/UI/pqTimeInspectorWidget.ui
|
||||
Resources/UI/pqTransferFunctionWidgetPropertyWidgetDialog.ui
|
||||
Resources/UI/pqVCRToolbar.ui
|
||||
)
|
||||
|
||||
set (Module_RESOURCE_FILES
|
||||
Resources/pqApplicationComponents.qrc
|
||||
)
|
||||
|
||||
# not sure this is the best way, but "moc" is complaining about
|
||||
# interfaces defined under Components and this seems like the only way to fix
|
||||
# that issue.
|
||||
if (PARAVIEW_QT_VERSION VERSION_GREATER "4")
|
||||
qt5_wrap_cpp(__Module_MOC_SRCS ${Module_MOC_HDRS}
|
||||
OPTIONS -I ${CMAKE_CURRENT_SOURCE_DIR}/../Components)
|
||||
else ()
|
||||
qt4_wrap_cpp(__Module_MOC_SRCS ${Module_MOC_HDRS}
|
||||
OPTIONS -I ${CMAKE_CURRENT_SOURCE_DIR}/../Components)
|
||||
endif()
|
||||
|
||||
|
||||
if (PARAVIEW_QT_VERSION VERSION_GREATER "4")
|
||||
qt5_wrap_ui(__Module_UI_SRCS ${Module_UI_FILES})
|
||||
qt5_add_resources(__Module_RESOURCE_SRCS ${Module_RESOURCE_FILES})
|
||||
else ()
|
||||
qt4_wrap_ui(__Module_UI_SRCS ${Module_UI_FILES})
|
||||
qt4_add_resources(__Module_RESOURCE_SRCS ${Module_RESOURCE_FILES})
|
||||
endif()
|
||||
|
||||
SOURCE_GROUP("Resources" FILES
|
||||
${Module_UI_FILES}
|
||||
${Module_RESOURCE_FILES}
|
||||
)
|
||||
|
||||
SOURCE_GROUP("Generated" FILES
|
||||
${__Module_RESOURCE_SRCS}
|
||||
${__Module_MOC_SRCS}
|
||||
${__Module_UI_SRCS}
|
||||
)
|
||||
|
||||
set(${vtk-module}_NO_HeaderTest 1)
|
||||
vtk_module_library(pqApplicationComponents
|
||||
${Module_SRCS}
|
||||
${__Module_RESOURCE_SRCS}
|
||||
${__Module_MOC_SRCS}
|
||||
${__Module_UI_SRCS})
|
||||
|
||||
#IF (NOT PV_INSTALL_NO_DEVELOPMENT)
|
||||
# # Headers
|
||||
# GLOB_INSTALL_DEVELOPMENT(
|
||||
# ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
# ${PV_INSTALL_INCLUDE_DIR}
|
||||
# "*.h;*.hxx;*.txx")
|
||||
# INSTALL(
|
||||
# FILES ${dynamicHeaders}
|
||||
# DESTINATION ${PV_INSTALL_INCLUDE_DIR}
|
||||
# COMPONENT Development)
|
||||
#ENDIF ()
|
||||
@ -0,0 +1,5 @@
|
||||
{
|
||||
"standard_presets" : {
|
||||
"vtkBlockColors" : "KAAMS"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>AnimationTimeWidget</class>
|
||||
<widget class="QWidget" name="AnimationTimeWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>346</width>
|
||||
<height>27</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1,0,0,0,0,1">
|
||||
<property name="spacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="timeLabel">
|
||||
<property name="text">
|
||||
<string>Time:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButtonValue">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="pqLineEdit" name="timeValue">
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
<property name="resetCursorPositionOnEditingFinished" stdset="0">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButtonStep">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="pqSpinBox" name="timestepValue">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>10000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="timestepCountLabel">
|
||||
<property name="text">
|
||||
<string>of (TDB)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>pqSpinBox</class>
|
||||
<extends>QSpinBox</extends>
|
||||
<header>pqSpinBox.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>pqLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>pqLineEdit.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>radioButtonStep</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>timestepValue</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>209</x>
|
||||
<y>13</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>257</x>
|
||||
<y>13</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>radioButtonValue</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>timeValue</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>33</x>
|
||||
<y>12</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>133</x>
|
||||
<y>13</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>pqAxesToolbar</class>
|
||||
<widget class="QToolBar" name="axesToolbar" >
|
||||
<property name="enabled" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>Center Axes Controls</string>
|
||||
</property>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<attribute name="toolBarArea" >
|
||||
<enum>TopToolBarArea</enum>
|
||||
</attribute>
|
||||
<attribute name="toolBarBreak" >
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
|
||||
<action name="actionShowOrientationAxes" >
|
||||
<property name="checkable" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="../pqComponents.qrc">:/pqWidgets/Icons/pqShowOrientationAxes24.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Show Orientation Axes</string>
|
||||
</property>
|
||||
<property name="statusTip" >
|
||||
<string>Show/Hide orientation axes</string>
|
||||
</property>
|
||||
</action>
|
||||
|
||||
<action name="actionShowCenterAxes" >
|
||||
<property name="checkable" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="../pqComponents.qrc" >:/pqWidgets/Icons/pqShowCenterAxes24.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Show Center</string>
|
||||
</property>
|
||||
<property name="statusTip" >
|
||||
<string>Show/Hide center of rotation</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionPickCenter" >
|
||||
<property name="checkable" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="../pqComponents.qrc" >:/pqWidgets/Icons/pqPickCenter24.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Pick Center</string>
|
||||
</property>
|
||||
<property name="iconText" >
|
||||
<string>Pick Center</string>
|
||||
</property>
|
||||
<property name="toolTip" >
|
||||
<string>Pick Center</string>
|
||||
</property>
|
||||
<property name="statusTip" >
|
||||
<string>Mouse press to pick center of rotation</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionResetCenter" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="../pqComponents.qrc" >:/pqWidgets/Icons/pqResetCenter24.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Reset Center</string>
|
||||
</property>
|
||||
<property name="statusTip" >
|
||||
<string>Reset center of rotation</string>
|
||||
</property>
|
||||
</action>
|
||||
|
||||
<addaction name="actionShowOrientationAxes" />
|
||||
<addaction name="actionShowCenterAxes" />
|
||||
<addaction name="actionResetCenter" />
|
||||
<addaction name="actionPickCenter" />
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../../Components/Resources/pqComponents.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -0,0 +1,183 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>BackgroundEditorWidget</class>
|
||||
<widget class="QWidget" name="BackgroundEditorWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>231</width>
|
||||
<height>135</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="mainLayout">
|
||||
<item>
|
||||
<widget class="QComboBox" name="BackgroundType">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Single color</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Gradient</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Image</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QStackedWidget" name="stackedWidget">
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="page_1">
|
||||
<layout class="QGridLayout" name="page1Layout" columnstretch="1,0">
|
||||
<item row="0" column="0">
|
||||
<widget class="pqColorChooserButtonWithPalettes" name="Color">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Color</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="RestoreDefaultColor">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Restore Default</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="pqColorChooserButtonWithPalettes" name="Color2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Color 2</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="RestoreDefaultColor2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Restore Default</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page_3">
|
||||
<layout class="QVBoxLayout" name="page3Layout">
|
||||
<item>
|
||||
<widget class="pqTextureComboBox" name="Image">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContents</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>pqColorChooserButtonWithPalettes</class>
|
||||
<extends>QToolButton</extends>
|
||||
<header>pqColorChooserButtonWithPalettes.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>pqTextureComboBox</class>
|
||||
<extends>QComboBox</extends>
|
||||
<header>pqTextureComboBox.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -0,0 +1,107 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CameraManipulatorWidget</class>
|
||||
<widget class="QWidget" name="CameraManipulatorWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>391</width>
|
||||
<height>114</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout" columnstretch="0,1,1,1">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Left Button</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Middle Button</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Right Button</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="comboBox_1"/>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QComboBox" name="comboBox_2"/>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QComboBox" name="comboBox_3"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Shift +</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" rowspan="2">
|
||||
<widget class="QComboBox" name="comboBox_4"/>
|
||||
</item>
|
||||
<item row="2" column="2" rowspan="2">
|
||||
<widget class="QComboBox" name="comboBox_5"/>
|
||||
</item>
|
||||
<item row="2" column="3" rowspan="2">
|
||||
<widget class="QComboBox" name="comboBox_6"/>
|
||||
</item>
|
||||
<item row="3" column="0" rowspan="2">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Ctrl +</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QComboBox" name="comboBox_7"/>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QComboBox" name="comboBox_8"/>
|
||||
</item>
|
||||
<item row="4" column="3">
|
||||
<widget class="QComboBox" name="comboBox_9"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -0,0 +1,204 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>pqCameraToolbar</class>
|
||||
<widget class="QToolBar" name="pqCameraToolbar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>336</width>
|
||||
<height>42</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Camera Controls</string>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<action name="actionResetCamera">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqResetCamera24.png</normaloff>:/pqWidgets/Icons/pqResetCamera24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Reset</string>
|
||||
</property>
|
||||
<property name="iconText">
|
||||
<string>Reset Camera</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Reset Camera</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionPositiveX">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqXPlus24.png</normaloff>:/pqWidgets/Icons/pqXPlus24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>+X</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Set view direction to +X</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Set view direction to +X</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Set view direction to +X</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionNegativeX">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqXMinus24.png</normaloff>:/pqWidgets/Icons/pqXMinus24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>-X</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Set view direction to -X</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Set view direction to -X</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Set view direction to -X</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionPositiveY">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqYPlus24.png</normaloff>:/pqWidgets/Icons/pqYPlus24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>+Y</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Set view direction to +Y</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Set view direction to +Y</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Set view direction to +Y</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionNegativeY">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqYMinus24.png</normaloff>:/pqWidgets/Icons/pqYMinus24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>-Y</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Set view direction to -Y</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Set view direction to -Y</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Set view direction to -Y</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionPositiveZ">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqZPlus24.png</normaloff>:/pqWidgets/Icons/pqZPlus24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>+Z</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Set view direction to +Z</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Set view direction to +Z</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Set view direction to +Z</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionNegativeZ">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqZMinus24.png</normaloff>:/pqWidgets/Icons/pqZMinus24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>-Z</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Set view direction to -Z</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Set view direction to -Z</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Set view direction to -Z</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionZoomToBox">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqZoomToSelection24.png</normaloff>:/pqWidgets/Icons/pqZoomToSelection24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Zoom to Box</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Zoom to Box</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionZoomToData">
|
||||
<property name="text">
|
||||
<string>ZTD</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Zoom To Data</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqZoomToData24.png</normaloff>:/pqWidgets/Icons/pqZoomToData24.png</iconset>
|
||||
</property>
|
||||
</action>
|
||||
<addaction name="actionResetCamera"/>
|
||||
<addaction name="actionZoomToData"/>
|
||||
<addaction name="actionZoomToBox"/>
|
||||
<addaction name="actionPositiveX"/>
|
||||
<addaction name="actionNegativeX"/>
|
||||
<addaction name="actionPositiveY"/>
|
||||
<addaction name="actionNegativeY"/>
|
||||
<addaction name="actionPositiveZ"/>
|
||||
<addaction name="actionNegativeZ"/>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../../Components/Resources/pqComponents.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ColorAnnotationsPropertyWidget</class>
|
||||
<widget class="QWidget" name="ColorAnnotationsPropertyWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>358</width>
|
||||
<height>230</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QToolButton" name="Add">
|
||||
<property name="toolTip">
|
||||
<string>Add new entry</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Widgets/Resources/QtWidgets.qrc">
|
||||
<normaloff>:/QtWidgets/Icons/pqPlus16.png</normaloff>:/QtWidgets/Icons/pqPlus16.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="Remove">
|
||||
<property name="toolTip">
|
||||
<string>Remove current entry</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Widgets/Resources/QtWidgets.qrc">
|
||||
<normaloff>:/QtWidgets/Icons/pqMinus16.png</normaloff>:/QtWidgets/Icons/pqMinus16.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="AddActive">
|
||||
<property name="toolTip">
|
||||
<string>Add active values from selected source</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqFilter16.png</normaloff>:/pqWidgets/Icons/pqFilter16.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="AddActiveFromVisible">
|
||||
<property name="toolTip">
|
||||
<string>Add active values from visible pipeline objects</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqFilterEyeball16.png</normaloff>:/pqWidgets/Icons/pqFilterEyeball16.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="ChoosePreset">
|
||||
<property name="toolTip">
|
||||
<string>Choose preset</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqFavorites16.png</normaloff>:/pqWidgets/Icons/pqFavorites16.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="SaveAsPreset">
|
||||
<property name="toolTip">
|
||||
<string>Save to preset</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqSave16.png</normaloff>:/pqWidgets/Icons/pqSave16.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="DeleteAll">
|
||||
<property name="toolTip">
|
||||
<string>Delete all annotations</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Widgets/Resources/QtWidgets.qrc">
|
||||
<normaloff>:/QtWidgets/Icons/pqDelete16.png</normaloff>:/QtWidgets/Icons/pqDelete16.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="pqExpandableTableView" name="AnnotationsTable">
|
||||
<property name="dragDropMode">
|
||||
<enum>QAbstractItemView::InternalMove</enum>
|
||||
</property>
|
||||
<property name="defaultDropAction">
|
||||
<enum>Qt::MoveAction</enum>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<property name="maximumRowCountBeforeScrolling" stdset="0">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>pqExpandableTableView</class>
|
||||
<extends>QTableView</extends>
|
||||
<header>pqExpandableTableView.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../../../Components/Resources/pqComponents.qrc"/>
|
||||
<include location="../pqApplicationComponents.qrc"/>
|
||||
<include location="../../../Core/Resources/pqCore.qrc"/>
|
||||
<include location="../../../Widgets/Resources/QtWidgets.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -0,0 +1,113 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ColorEditorPropertyWidget</class>
|
||||
<widget class="QWidget" name="ColorEditorPropertyWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>291</width>
|
||||
<height>82</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="EditColorMap">
|
||||
<property name="toolTip">
|
||||
<string>Edit Color Map</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Edit Color Map</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Edit</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqEditColor24.png</normaloff>:/pqWidgets/Icons/pqEditColor24.png</iconset>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="ShowScalarBar">
|
||||
<property name="toolTip">
|
||||
<string>Toggle Color Legend Visibility</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Toggle Color Legend Visibility</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqScalarBar24.png</normaloff>:/pqWidgets/Icons/pqScalarBar24.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="pqDisplayColorWidget" name="DisplayColorWidget" native="true"/>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="Rescale">
|
||||
<property name="toolTip">
|
||||
<string>Rescale to Data Range</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Rescale to Data Range</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Rescale</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqResetRange24.png</normaloff>:/pqWidgets/Icons/pqResetRange24.png</iconset>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>pqDisplayColorWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>pqDisplayColorWidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../../../Components/Resources/pqComponents.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -0,0 +1,302 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ColorMapEditor</class>
|
||||
<widget class="QWidget" name="ColorMapEditor">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>390</width>
|
||||
<height>149</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>390</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="SearchBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="pqSearchBox" name="SearchBox" native="true">
|
||||
<property name="advancedSearchEnabled" stdset="0">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="settingKey" stdset="0">
|
||||
<string notr="true">showAdvancedPropertiesColorMapEditor</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="ShowScalarBar">
|
||||
<property name="toolTip">
|
||||
<string>Show/hide color legend</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqScalarBar16.png</normaloff>:/pqWidgets/Icons/pqScalarBar16.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="EditScalarBar">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Edit color legend properties</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqEditScalarBar16.png</normaloff>:/pqWidgets/Icons/pqEditScalarBar16.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="ArrayLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Array Name:</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::AutoText</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QScrollArea" name="scrollArea">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>372</width>
|
||||
<height>76</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="ScrollAreaLayout" stretch="0,0,1">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QFrame" name="PropertiesFrame">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0,0,0,0">
|
||||
<property name="spacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="RestoreDefaults">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Restore application default setting values for color map</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqSave16.png</normaloff>:/pqWidgets/Icons/pqSave16.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="SaveAsArrayDefaults">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Save current color map settings values as default for arrays of this name</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqSaveArray16.png</normaloff>:/pqWidgets/Icons/pqSaveArray16.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="SaveAsDefaults">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Save current color map settings values as default for all arrays</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqSave16.png</normaloff>:/pqWidgets/Icons/pqSave16.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="Update">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Update views.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Render Views</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqUpdate16.png</normaloff>:/pqWidgets/Icons/pqUpdate16.png</iconset>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="AutoUpdate">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Render view(s) automatically.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqUpdate16.png</normaloff>:/pqWidgets/Icons/pqUpdate16.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>pqSearchBox</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>pqSearchBox.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../../../Components/Resources/pqComponents.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>ShowScalarBar</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>EditScalarBar</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>280</x>
|
||||
<y>22</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>304</x>
|
||||
<y>22</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>AutoUpdate</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>Update</receiver>
|
||||
<slot>setDisabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>296</x>
|
||||
<y>74</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>233</x>
|
||||
<y>74</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@ -0,0 +1,321 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ColorOpacityEditorWidget</class>
|
||||
<widget class="QWidget" name="ColorOpacityEditorWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>395</width>
|
||||
<height>758</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="mainLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="1,0">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="1,0">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMinimumSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="pqTransferFunctionWidget" name="OpacityEditor" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>80</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="pqTransferFunctionWidget" name="ColorEditor" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QToolButton" name="ResetRangeToData">
|
||||
<property name="toolTip">
|
||||
<string>Rescale to data range</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqResetRange24.png</normaloff>:/pqWidgets/Icons/pqResetRange24.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="ResetRangeToCustom">
|
||||
<property name="toolTip">
|
||||
<string>Rescale to custom range</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqResetRangeCustom24.png</normaloff>:/pqWidgets/Icons/pqResetRangeCustom24.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="ResetRangeToDataOverTime">
|
||||
<property name="toolTip">
|
||||
<string>Rescale to data range over all timesteps</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqResetRangeTemporal24.png</normaloff>:/pqWidgets/Icons/pqResetRangeTemporal24.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="ResetRangeToVisibleData">
|
||||
<property name="toolTip">
|
||||
<string>Rescale to visible range</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqResetToVisibleRange32.png</normaloff>:/pqWidgets/Icons/pqResetToVisibleRange32.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="InvertTransferFunctions">
|
||||
<property name="toolTip">
|
||||
<string>Invert the transfer functions</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqInvert24.png</normaloff>:/pqWidgets/Icons/pqInvert24.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="ChoosePreset">
|
||||
<property name="toolTip">
|
||||
<string>Choose preset</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqFavorites16.png</normaloff>:/pqWidgets/Icons/pqFavorites16.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="SaveAsPreset">
|
||||
<property name="toolTip">
|
||||
<string>Save to preset</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqSave16.png</normaloff>:/pqWidgets/Icons/pqSave16.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="AdvancedButton">
|
||||
<property name="toolTip">
|
||||
<string>Manually edit transfer functions</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqAdvanced26.png</normaloff>:/pqWidgets/Icons/pqAdvanced26.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Data:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="pqLineEdit" name="CurrentDataValue">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="UseLogScale">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>When checked, the mapping from data to colors is done using a log-scale. Note that this does not affect the mapping of data to opacity.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Use log scale when mapping data to colors</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="EnableOpacityMapping">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>When checked, the opacity function is used to render translucent surfaces.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enable opacity mapping for surfaces</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="ColorLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Color transfer function values</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="pqExpandableTableView" name="ColorTable">
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::DoubleClicked</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<property name="maximumRowCountBeforeScrolling" stdset="0">
|
||||
<number>10</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="OpacityLabel">
|
||||
<property name="text">
|
||||
<string>Opacity transfer function values</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="pqExpandableTableView" name="OpacityTable">
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::DoubleClicked</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<property name="maximumRowCountBeforeScrolling" stdset="0">
|
||||
<number>10</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>pqExpandableTableView</class>
|
||||
<extends>QTableView</extends>
|
||||
<header>pqExpandableTableView.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>pqTransferFunctionWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>pqTransferFunctionWidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>pqLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>pqLineEdit.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../../../Components/Resources/pqComponents.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>pqColorToolbar</class>
|
||||
<widget class="QToolBar" name="variableToolbar" >
|
||||
<property name="windowTitle" >
|
||||
<string>Active Variable Controls</string>
|
||||
</property>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<attribute name="toolBarArea" >
|
||||
<enum>TopToolBarArea</enum>
|
||||
</attribute>
|
||||
<attribute name="toolBarBreak" >
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<action name="actionScalarBarVisibility" >
|
||||
<property name="checkable" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc" >:/pqWidgets/Icons/pqScalarBar24.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Show Color Legend</string>
|
||||
</property>
|
||||
<property name="toolTip" >
|
||||
<string>Toggle Color Legend Visibility</string>
|
||||
</property>
|
||||
<property name="statusTip" >
|
||||
<string>Toggle Color Legend Visibility</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionEditColorMap" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc" >:/pqWidgets/Icons/pqEditColor24.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Edit Color Map</string>
|
||||
</property>
|
||||
<property name="statusTip" >
|
||||
<string>Edit Color Map</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionResetRange" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc" >:/pqWidgets/Icons/pqResetRange24.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Reset Range</string>
|
||||
</property>
|
||||
<property name="toolTip" >
|
||||
<string>Rescale to Data Range</string>
|
||||
</property>
|
||||
<property name="statusTip" >
|
||||
<string>Rescale to Data Range</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionRescaleCustomRange" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc" >:/pqWidgets/Icons/pqResetRangeCustom24.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Rescale Custom Range</string>
|
||||
</property>
|
||||
<property name="toolTip" >
|
||||
<string>Rescale to Custom Data Range</string>
|
||||
</property>
|
||||
<property name="statusTip" >
|
||||
<string>Rescale to Custom Data Range</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionRescaleVisibleRange" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc" >:/pqWidgets/Icons/pqResetToVisibleRange32.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Rescale Visible Range</string>
|
||||
</property>
|
||||
<property name="toolTip" >
|
||||
<string>Rescale to Visible Data Range</string>
|
||||
</property>
|
||||
<property name="statusTip" >
|
||||
<string>Rescale to Visible Data Range</string>
|
||||
</property>
|
||||
</action>
|
||||
<addaction name="actionScalarBarVisibility" />
|
||||
<addaction name="actionEditColorMap" />
|
||||
<addaction name="actionResetRange" />
|
||||
<addaction name="actionRescaleCustomRange" />
|
||||
<addaction name="actionRescaleVisibleRange" />
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../../Components/Resources/pqComponents.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -0,0 +1,75 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>ParaView - The Beast UNLEASHED !!!</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget"/>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>27</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menu_File">
|
||||
<property name="title">
|
||||
<string>&File</string>
|
||||
</property>
|
||||
<addaction name="actionE_xit"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menu_Help">
|
||||
<property name="title">
|
||||
<string>&Help</string>
|
||||
</property>
|
||||
<addaction name="action_About"/>
|
||||
</widget>
|
||||
<addaction name="menu_File"/>
|
||||
<addaction name="menu_Help"/>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
<action name="actionE_xit">
|
||||
<property name="text">
|
||||
<string>E&xit</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+Q</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_About">
|
||||
<property name="text">
|
||||
<string>&About</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>actionE_xit</sender>
|
||||
<signal>triggered()</signal>
|
||||
<receiver>MainWindow</receiver>
|
||||
<slot>close()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>-1</x>
|
||||
<y>-1</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>399</x>
|
||||
<y>299</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DoubleRangeSliderPropertyWidget</class>
|
||||
<widget class="QWidget" name="DoubleRangeSliderPropertyWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>130</width>
|
||||
<height>38</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Minimum</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="pqDoubleRangeWidget" name="ThresholdBetween_0" native="true"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Maximum</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="pqDoubleRangeWidget" name="ThresholdBetween_1" native="true"/>
|
||||
</item>
|
||||
<item row="0" column="2" rowspan="2">
|
||||
<widget class="pqHighlightablePushButton" name="Reset">
|
||||
<property name="toolTip">
|
||||
<string>Reset using current data values</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>pqDoubleRangeWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>pqDoubleRangeWidget.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>pqHighlightablePushButton</class>
|
||||
<extends>QPushButton</extends>
|
||||
<header>pqHighlightablePushButton.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -0,0 +1,187 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>pqEditMenuBuilder</class>
|
||||
<widget class="QMenu" name="pqEditMenuBuilder">
|
||||
<property name="title">
|
||||
<string>&Edit</string>
|
||||
</property>
|
||||
<action name="actionEditUndo">
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqUndo24.png</normaloff>:/pqWidgets/Icons/pqUndo24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Undo</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+Z</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionEditRedo">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqRedo24.png</normaloff>:/pqWidgets/Icons/pqRedo24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Redo</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+R</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionEditCameraUndo">
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqUndoCamera24.png</normaloff>:/pqWidgets/Icons/pqUndoCamera24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Camera Undo</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+B</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionEditCameraRedo">
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqRedoCamera24.png</normaloff>:/pqWidgets/Icons/pqRedoCamera24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Camera Redo</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+F</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionChangeInput">
|
||||
<property name="text">
|
||||
<string>Change &Input...</string>
|
||||
</property>
|
||||
<property name="iconText">
|
||||
<string>Change Input...</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Change a Filter's Input</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Change a Filter's Input</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionCopy">
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqCopy22.png</normaloff>:/pqWidgets/Icons/pqCopy22.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Copy</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Copy properties</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionPaste">
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqPaste22.png</normaloff>:/pqWidgets/Icons/pqPaste22.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Paste</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Paste copied properties</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionDelete">
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Widgets/Resources/QtWidgets.qrc">
|
||||
<normaloff>:/QtWidgets/Icons/pqDelete24.png</normaloff>:/QtWidgets/Icons/pqDelete24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Delete</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Delete</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionDelete_All">
|
||||
<property name="text">
|
||||
<string>Reset Session</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionIgnoreTime">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Ignore Time</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Disregard this source/filter's time from animations</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Disregard this source/filter's time from animations</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Disregard this source/filter's time from animations</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionEditSettings">
|
||||
<property name="text">
|
||||
<string>Settings...</string>
|
||||
</property>
|
||||
<property name="iconText">
|
||||
<string>Settings</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Settings</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionQuery">
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqFindData32.png</normaloff>:/pqWidgets/Icons/pqFindData32.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Find Data...</string>
|
||||
</property>
|
||||
<property name="iconText">
|
||||
<string>Find Data</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Find data matching various criteria from the current source (v).</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>V</string>
|
||||
</property>
|
||||
</action>
|
||||
<addaction name="actionEditUndo"/>
|
||||
<addaction name="actionEditRedo"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionEditCameraUndo"/>
|
||||
<addaction name="actionEditCameraRedo"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionQuery"/>
|
||||
<addaction name="actionChangeInput"/>
|
||||
<addaction name="actionCopy"/>
|
||||
<addaction name="actionPaste"/>
|
||||
<addaction name="actionIgnoreTime"/>
|
||||
<addaction name="actionDelete"/>
|
||||
<addaction name="actionDelete_All"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionEditSettings"/>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../../Components/Resources/pqComponents.qrc"/>
|
||||
<include location="../../../Widgets/Resources/QtWidgets.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -0,0 +1,175 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>pqFileMenuBuilder</class>
|
||||
<widget class="QMenu" name="pqFileMenuBuilder">
|
||||
<property name="title">
|
||||
<string>&File</string>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuRecentFiles">
|
||||
<property name="title">
|
||||
<string>Recent Files</string>
|
||||
</property>
|
||||
</widget>
|
||||
<action name="actionServerConnect">
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqConnect24.png</normaloff>:/pqWidgets/Icons/pqConnect24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Connect...</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Connect</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionServerDisconnect">
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqDisconnect24.png</normaloff>:/pqWidgets/Icons/pqDisconnect24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Disconnect</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Disconnect</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionFileSaveScreenshot">
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqCaptureScreenshot24.png</normaloff>:/pqWidgets/Icons/pqCaptureScreenshot24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save Screenshot...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionFileSaveAnimation">
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqSaveAnimation24.png</normaloff>:/pqWidgets/Icons/pqSaveAnimation24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save &Animation...</string>
|
||||
</property>
|
||||
<property name="PV_MUST_BE_MASTER_TO_SHOW" stdset="0">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionFileSaveData">
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqSave24.png</normaloff>:/pqWidgets/Icons/pqSave24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save Data...</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+S</string>
|
||||
</property>
|
||||
<property name="PV_MUST_BE_MASTER_TO_SHOW" stdset="0">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionFileLoadServerState">
|
||||
<property name="text">
|
||||
<string>&Load State...</string>
|
||||
</property>
|
||||
<property name="PV_MUST_BE_MASTER_TO_SHOW" stdset="0">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionFileSaveServerState">
|
||||
<property name="text">
|
||||
<string>&Save State...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionFileSaveGeometry">
|
||||
<property name="text">
|
||||
<string>Save &Geometry...</string>
|
||||
</property>
|
||||
<property name="PV_MUST_BE_MASTER_TO_SHOW" stdset="0">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionFileOpen">
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqOpen24.png</normaloff>:/pqWidgets/Icons/pqOpen24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Open...</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Open</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+O</string>
|
||||
</property>
|
||||
<property name="PV_MUST_BE_MASTER_TO_SHOW" stdset="0">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionFileExit">
|
||||
<property name="text">
|
||||
<string>E&xit</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Exit</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+Q</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionExport">
|
||||
<property name="text">
|
||||
<string>Export Scene...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionFileSaveWindowLayout">
|
||||
<property name="text">
|
||||
<string>Save Window Layout...</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Save window layout to a file</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Save window layout to a file</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionFileLoadWindowLayout">
|
||||
<property name="text">
|
||||
<string>Load Window Layout...</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Load window layout from a file</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Load window layout from a file</string>
|
||||
</property>
|
||||
</action>
|
||||
<addaction name="actionFileOpen"/>
|
||||
<addaction name="menuRecentFiles"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionFileLoadServerState"/>
|
||||
<addaction name="actionFileSaveServerState"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionFileSaveData"/>
|
||||
<addaction name="actionFileSaveScreenshot"/>
|
||||
<addaction name="actionExport"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionFileSaveAnimation"/>
|
||||
<addaction name="actionFileSaveGeometry"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionFileLoadWindowLayout"/>
|
||||
<addaction name="actionFileSaveWindowLayout"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionServerConnect"/>
|
||||
<addaction name="actionServerDisconnect"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionFileExit"/>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../../Components/Resources/pqComponents.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -0,0 +1,138 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>FontPropertyWidget</class>
|
||||
<widget class="QWidget" name="FontPropertyWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>317</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="mainLayout" stretch="1,0,0,0,0,0,0,0">
|
||||
<item>
|
||||
<widget class="QComboBox" name="FontFamily">
|
||||
<property name="toolTip">
|
||||
<string>Select font</string>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContents</enum>
|
||||
</property>
|
||||
<property name="minimumContentsLength">
|
||||
<number>2</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="FontSize">
|
||||
<property name="toolTip">
|
||||
<string>Set font size</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="pqColorChooserButtonWithPalettes" name="FontColor">
|
||||
<property name="toolTip">
|
||||
<string>Set font color</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="Opacity">
|
||||
<property name="toolTip">
|
||||
<string>Set font opacity</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="Bold">
|
||||
<property name="toolTip">
|
||||
<string>Bold</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqBold16.png</normaloff>:/pqWidgets/Icons/pqBold16.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="Italics">
|
||||
<property name="toolTip">
|
||||
<string>Italics</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqItalics16.png</normaloff>:/pqWidgets/Icons/pqItalics16.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="Shadow">
|
||||
<property name="toolTip">
|
||||
<string>Shadow</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqShadow16.png</normaloff>:/pqWidgets/Icons/pqShadow16.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="Justification">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="popupMode">
|
||||
<enum>QToolButton::InstantPopup</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>pqColorChooserButtonWithPalettes</class>
|
||||
<extends>QToolButton</extends>
|
||||
<header>pqColorChooserButtonWithPalettes.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../../../Components/Resources/pqComponents.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -0,0 +1,258 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ImageCompressorWidget</class>
|
||||
<widget class="QWidget" name="ImageCompressorWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>551</width>
|
||||
<height>304</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="mainLayout">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Set the compression method used when transferring rendered images from the server to the client.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="compressionType">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>None</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>LZ4</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Squirt (run-length encoding based compression)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Zlib</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="squirtLabel">
|
||||
<property name="text">
|
||||
<string>Set the Squirt/LZ4 compression level. Move to right for better compression ratio at the cost of reduced image quality.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="pqIntRangeWidget" name="squirtColorSpace" native="true">
|
||||
<property name="minimum" stdset="0">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum" stdset="0">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="value" stdset="0">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="strictRange" stdset="0">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="zlibLabel1">
|
||||
<property name="text">
|
||||
<string>Set the Zlib compression level. 1 is the fastest compression possible at the cost of compression ratio, while 9 give the best compression possible, but may be slower.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="pqIntRangeWidget" name="zlibLevel" native="true">
|
||||
<property name="minimum" stdset="0">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum" stdset="0">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="value" stdset="0">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="strictRange" stdset="0">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="zlibLabel2">
|
||||
<property name="text">
|
||||
<string>Set the Zlib the color sampling space width factor. Move to right for better compression ratio at the cost of image quality.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="pqIntRangeWidget" name="zlibColorSpace" native="true">
|
||||
<property name="minimum" stdset="0">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum" stdset="0">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="value" stdset="0">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="strictRange" stdset="0">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="zlibStripAlpha">
|
||||
<property name="text">
|
||||
<string>Set whether to strip alpha channel.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="compressorBWLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="toolTip">
|
||||
<string>Configure the compressor using default settings taylored to a selected connection type.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Apply presets for</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="compressorBWOpt">
|
||||
<property name="toolTip">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Presets. </span>Configure the image compressor based on a network type. These settings will provide reasonable performance and place to start when optimizing the compressor setting for a specific network.</p></body></html></string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Presets. </span>Configure the image compressor based on a network type. These settings will provide reasonable performance and place to start when optimizing the compressor setting for a specific network.</p></body></html></string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>consumer broadband/DSL</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Megabit Ethernet / 802.11* wireless</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Gigabit Ethernet</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>10 Gigabit Ethernet</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>shared memory/localhost</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="toolTip">
|
||||
<string>Configure the compressor using default settings taylored to a selected connection type.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>connection.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>pqIntRangeWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>pqIntRangeWidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -0,0 +1,843 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>LightsEditor</class>
|
||||
<widget class="QWidget" name="LightsEditor">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>439</width>
|
||||
<height>309</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Lights Editor</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="LightKit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>A simple lighting kit</string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Light Kit</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="backLabel">
|
||||
<property name="toolTip">
|
||||
<string>Back Light Parameters</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The two back lights, one on the left of the object as seen from the observer and one on the right, fill on the high-contrast areas behind the object. </string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Back</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="fillWarmthLabel">
|
||||
<property name="toolTip">
|
||||
<string>Fill Light Warmth</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The "Warmth" of the Fill Light. Warmth is a parameter that varies from 0 to 1, where 0 is "cold" (looks icy or lit by a very blue sky), 1 is "warm" (the red of a very red sunset, or the embers of a campfire), and 0.5 is a neutral white. The warmth scale is non-linear. Warmth values close to 0.5 are subtly "warmer" or "cooler," much like a warmer tungsten incandescent bulb, a cooler halogen, or daylight (cooler still). Moving further away from 0.5, colors become more quickly varying towards blues and reds. With regards to aesthetics, extremes of warmth should be used sparingly. </string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Warm</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>FillLightWarmth</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="7">
|
||||
<widget class="QLabel" name="keyAzimuthLabel">
|
||||
<property name="toolTip">
|
||||
<string>Key Light Azimuth</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The Key Light Azimuth. For simplicity, the position of lights in the LightKit can only be specified using angles: the elevation (latitude) and azimuth (longitude) of each light with respect to the camera, expressed in degrees. (Lights always shine on the camera's lookat point.) For example, a light at (elevation=0, azimuth=0) is located at the camera (a headlight). A light at (elevation=90, azimuth=0) is above the lookat point, shining down. Negative azimuth values move the lights clockwise as seen above, positive values counter-clockwise. So, a light at (elevation=45, azimuth=-20) is above and in front of the object and shining slightly from the left side.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Azi</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>KeyLightAzimuth</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="4">
|
||||
<widget class="QDoubleSpinBox" name="HeadLightK_H_Ratio">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Key-to-Head Ratio</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Set the Key-to-Head ratio. Similar to the Key-to-Fill ratio, this ratio controls how bright the headlight light is compared to the key light: larger values correspond to a dimmer headlight light. The headlight is special kind of fill light, lighting only the parts of the object that the camera can see. As such, a headlight tends to reduce the contrast of a scene. It can be used to fill in "shadows" of the object missed by the key and fill lights. The headlight should always be significantly dimmer than the key light: ratios of 2 to 15 are typical.</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.500000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="7">
|
||||
<widget class="QLabel" name="fillAzimuthLabel">
|
||||
<property name="toolTip">
|
||||
<string>Fill Light Azimuth</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The Fill Light Azimuth. For simplicity, the position of lights in the LightKit can only be specified using angles: the elevation (latitude) and azimuth (longitude) of each light with respect to the camera, expressed in degrees. (Lights always shine on the camera's lookat point.) For example, a light at (elevation=0, azimuth=0) is located at the camera (a headlight). A light at (elevation=90, azimuth=0) is above the lookat point, shining down. Negative azimuth values move the lights clockwise as seen above, positive values counter-clockwise. So, a light at (elevation=45, azimuth=-20) is above and in front of the object and shining slightly from the left side.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Azi</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>FillLightAzimuth</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="headWarmthLabel">
|
||||
<property name="toolTip">
|
||||
<string>Headlight Warmth</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The "Warmth" of the Headlight. Warmth is a parameter that varies from 0 to 1, where 0 is "cold" (looks icy or lit by a very blue sky), 1 is "warm" (the red of a very red sunset, or the embers of a campfire), and 0.5 is a neutral white. The warmth scale is non-linear. Warmth values close to 0.5 are subtly "warmer" or "cooler," much like a warmer tungsten incandescent bulb, a cooler halogen, or daylight (cooler still). Moving further away from 0.5, colors become more quickly varying towards blues and reds. With regards to aesthetics, extremes of warmth should be used sparingly. </string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Warm</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>HeadLightWarmth</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="4">
|
||||
<widget class="QDoubleSpinBox" name="BackLightK_B_Ratio">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Key-to-Back Ratio</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Set the Key-to-Back Ratio. This ratio controls how bright the back lights are compared to the key light: larger values correspond to dimmer back lights. The back lights fill in the remaining high-contrast regions behind the object. Values between 2 and 10 are good.</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.500000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QDoubleSpinBox" name="KeyLightWarmth">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Key Light Warmth</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The "Warmth" of the Key Light. Warmth is a parameter that varies from 0 to 1, where 0 is "cold" (looks icy or lit by a very blue sky), 1 is "warm" (the red of a very red sunset, or the embers of a campfire), and 0.5 is a neutral white. The warmth scale is non-linear. Warmth values close to 0.5 are subtly "warmer" or "cooler," much like a warmer tungsten incandescent bulb, a cooler halogen, or daylight (cooler still). Moving further away from 0.5, colors become more quickly varying towards blues and reds. With regards to aesthetics, extremes of warmth should be used sparingly. </string>
|
||||
</property>
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::UpDownArrows</enum>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="6">
|
||||
<widget class="QDoubleSpinBox" name="BackLightElevation">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Back Light Elevation</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The Back Light Elevation. For simplicity, the position of lights in the LightKit can only be specified using angles: the elevation (latitude) and azimuth (longitude) of each light with respect to the camera, expressed in degrees. (Lights always shine on the camera's lookat point.) For example, a light at (elevation=0, azimuth=0) is located at the camera (a headlight). A light at (elevation=90, azimuth=0) is above the lookat point, shining down. Negative azimuth values move the lights clockwise as seen above, positive values counter-clockwise. So, a light at (elevation=45, azimuth=-20) is above and in front of the object and shining slightly from the left side.</string>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-90.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>90.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>10.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QDoubleSpinBox" name="KeyLightIntensity">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Key Light Intensity</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The Intensity of the Key Light. 0 = off and 1 = full intensity.</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="8">
|
||||
<widget class="QDoubleSpinBox" name="FillLightAzimuth">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Fill Light Azimuth</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The Fill Light Azimuth. For simplicity, the position of lights in the LightKit can only be specified using angles: the elevation (latitude) and azimuth (longitude) of each light with respect to the camera, expressed in degrees. (Lights always shine on the camera's lookat point.) For example, a light at (elevation=0, azimuth=0) is located at the camera (a headlight). A light at (elevation=90, azimuth=0) is above the lookat point, shining down. Negative azimuth values move the lights clockwise as seen above, positive values counter-clockwise. So, a light at (elevation=45, azimuth=-20) is above and in front of the object and shining slightly from the left side.</string>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-180.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>180.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>10.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="6">
|
||||
<widget class="QDoubleSpinBox" name="FillLightElevation">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Fill Light Elevation</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The Fill Light Elevation. For simplicity, the position of lights in the LightKit can only be specified using angles: the elevation (latitude) and azimuth (longitude) of each light with respect to the camera, expressed in degrees. (Lights always shine on the camera's lookat point.) For example, a light at (elevation=0, azimuth=0) is located at the camera (a headlight). A light at (elevation=90, azimuth=0) is above the lookat point, shining down. Negative azimuth values move the lights clockwise as seen above, positive values counter-clockwise. So, a light at (elevation=45, azimuth=-20) is above and in front of the object and shining slightly from the left side.</string>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-90.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>90.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>10.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="6">
|
||||
<widget class="QDoubleSpinBox" name="KeyLightElevation">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Key Light Elevation</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The Key Light Elevation. For simplicity, the position of lights in the LightKit can only be specified using angles: the elevation (latitude) and azimuth (longitude) of each light with respect to the camera, expressed in degrees. (Lights always shine on the camera's lookat point.) For example, a light at (elevation=0, azimuth=0) is located at the camera (a headlight). A light at (elevation=90, azimuth=0) is above the lookat point, shining down. Negative azimuth values move the lights clockwise as seen above, positive values counter-clockwise. So, a light at (elevation=45, azimuth=-20) is above and in front of the object and shining slightly from the left side.</string>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-90.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>90.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>10.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="fillLabel">
|
||||
<property name="toolTip">
|
||||
<string>Fill Light Parameters</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The fill light is usually positioned across from or opposite from the key light (though still on the same side of the object as the camera) in order to simulate diffuse reflections from other objects in the scene.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Fill</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="QLabel" name="headRatioLabel">
|
||||
<property name="toolTip">
|
||||
<string>Key-to-Head Ratio</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Set the Key-to-Head ratio. Similar to the Key-to-Fill ratio, this ratio controls how bright the headlight light is compared to the key light: larger values correspond to a dimmer headlight light. The headlight is special kind of fill light, lighting only the parts of the object that the camera can see. As such, a headlight tends to reduce the contrast of a scene. It can be used to fill in "shadows" of the object missed by the key and fill lights. The headlight should always be significantly dimmer than the key light: ratios of 2 to 15 are typical.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>K:H</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>HeadLightK_H_Ratio</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="5">
|
||||
<widget class="QLabel" name="fillElevationLabel">
|
||||
<property name="toolTip">
|
||||
<string>Fill Light Elevation</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The Fill Light Elevation. For simplicity, the position of lights in the LightKit can only be specified using angles: the elevation (latitude) and azimuth (longitude) of each light with respect to the camera, expressed in degrees. (Lights always shine on the camera's lookat point.) For example, a light at (elevation=0, azimuth=0) is located at the camera (a headlight). A light at (elevation=90, azimuth=0) is above the lookat point, shining down. Negative azimuth values move the lights clockwise as seen above, positive values counter-clockwise. So, a light at (elevation=45, azimuth=-20) is above and in front of the object and shining slightly from the left side.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Ele</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>FillLightElevation</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="keyLabel">
|
||||
<property name="toolTip">
|
||||
<string>Key Light Parameters</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The Key Light is the main light. It is usually positioned so that it appears like an overhead light (like the sun or a ceiling light). It is generally positioned to shine down from about a 45 degree angle vertically and at least a little offset side to side. The key light is usually at least about twice as bright as the total of all other lights in the scene to provide good modeling of object features.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Key</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="8">
|
||||
<widget class="QDoubleSpinBox" name="KeyLightAzimuth">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Key Light Azimuth</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The Key Light Azimuth. For simplicity, the position of lights in the LightKit can only be specified using angles: the elevation (latitude) and azimuth (longitude) of each light with respect to the camera, expressed in degrees. (Lights always shine on the camera's lookat point.) For example, a light at (elevation=0, azimuth=0) is located at the camera (a headlight). A light at (elevation=90, azimuth=0) is above the lookat point, shining down. Negative azimuth values move the lights clockwise as seen above, positive values counter-clockwise. So, a light at (elevation=45, azimuth=-20) is above and in front of the object and shining slightly from the left side.</string>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-180.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>180.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>10.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QDoubleSpinBox" name="HeadLightWarmth">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Headlight Warmth</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The "Warmth" of the Headlight. Warmth is a parameter that varies from 0 to 1, where 0 is "cold" (looks icy or lit by a very blue sky), 1 is "warm" (the red of a very red sunset, or the embers of a campfire), and 0.5 is a neutral white. The warmth scale is non-linear. Warmth values close to 0.5 are subtly "warmer" or "cooler," much like a warmer tungsten incandescent bulb, a cooler halogen, or daylight (cooler still). Moving further away from 0.5, colors become more quickly varying towards blues and reds. With regards to aesthetics, extremes of warmth should be used sparingly. </string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="8">
|
||||
<widget class="QDoubleSpinBox" name="BackLightAzimuth">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Back Light Azimuth</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The Back Light Azimuth. For simplicity, the position of lights in the LightKit can only be specified using angles: the elevation (latitude) and azimuth (longitude) of each light with respect to the camera, expressed in degrees. (Lights always shine on the camera's lookat point.) For example, a light at (elevation=0, azimuth=0) is located at the camera (a headlight). A light at (elevation=90, azimuth=0) is above the lookat point, shining down. Negative azimuth values move the lights clockwise as seen above, positive values counter-clockwise. So, a light at (elevation=45, azimuth=-20) is above and in front of the object and shining slightly from the left side.</string>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-180.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>180.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>10.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="keyIntensityLabel">
|
||||
<property name="toolTip">
|
||||
<string>Key Light Intensity</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The Intensity of the Key Light. 0 = off and 1 = full intensity.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Int</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>KeyLightIntensity</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QDoubleSpinBox" name="FillLightWarmth">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Fill Light Warmth</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The "Warmth" of the Fill Light. Warmth is a parameter that varies from 0 to 1, where 0 is "cold" (looks icy or lit by a very blue sky), 1 is "warm" (the red of a very red sunset, or the embers of a campfire), and 0.5 is a neutral white. The warmth scale is non-linear. Warmth values close to 0.5 are subtly "warmer" or "cooler," much like a warmer tungsten incandescent bulb, a cooler halogen, or daylight (cooler still). Moving further away from 0.5, colors become more quickly varying towards blues and reds. With regards to aesthetics, extremes of warmth should be used sparingly. </string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="headLabel">
|
||||
<property name="toolTip">
|
||||
<string>Headlight Parameters</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The headlight, always located at the position of the camera, reduces the contrast between areas lit by the key and fill light. </string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Head</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QLabel" name="fillRatioLabel">
|
||||
<property name="toolTip">
|
||||
<string>Key-to-Fill Ratio</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Set the Key-to-Fill Ratio. This ratio controls how bright the fill light is compared to the key light: larger values correspond to a dimmer fill light. The purpose of the fill light is to light parts of the object not lit by the key light, while still maintaining constrast. This type of lighting may correspond to indirect illumination from the key light, bounced off a wall, floor, or other object. The fill light should never be brighter than the key light: a good range for the key-to-fill ratio is between 2 and 10.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>K:F</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>FillLightK_F_Ratio</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<widget class="QLabel" name="keyElevationLabel">
|
||||
<property name="toolTip">
|
||||
<string>Key Light Elevation</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The Key Light Elevation. For simplicity, the position of lights in the LightKit can only be specified using angles: the elevation (latitude) and azimuth (longitude) of each light with respect to the camera, expressed in degrees. (Lights always shine on the camera's lookat point.) For example, a light at (elevation=0, azimuth=0) is located at the camera (a headlight). A light at (elevation=90, azimuth=0) is above the lookat point, shining down. Negative azimuth values move the lights clockwise as seen above, positive values counter-clockwise. So, a light at (elevation=45, azimuth=-20) is above and in front of the object and shining slightly from the left side.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Ele</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>KeyLightElevation</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="keyWarmthLabel">
|
||||
<property name="toolTip">
|
||||
<string>Key Light Warmth</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The "Warmth" of the Key Light. Warmth is a parameter that varies from 0 to 1, where 0 is "cold" (looks icy or lit by a very blue sky), 1 is "warm" (the red of a very red sunset, or the embers of a campfire), and 0.5 is a neutral white. The warmth scale is non-linear. Warmth values close to 0.5 are subtly "warmer" or "cooler," much like a warmer tungsten incandescent bulb, a cooler halogen, or daylight (cooler still). Moving further away from 0.5, colors become more quickly varying towards blues and reds. With regards to aesthetics, extremes of warmth should be used sparingly. </string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Warm</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>KeyLightWarmth</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QLabel" name="backRatioLabel">
|
||||
<property name="toolTip">
|
||||
<string>Key-to-Back Ratio</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Set the Key-to-Back Ratio. This ratio controls how bright the back lights are compared to the key light: larger values correspond to dimmer back lights. The back lights fill in the remaining high-contrast regions behind the object. Values between 2 and 10 are good.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>K:B</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>BackLightK_B_Ratio</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="5">
|
||||
<widget class="QLabel" name="backElevationLabel">
|
||||
<property name="toolTip">
|
||||
<string>Back Light Elevation</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The Back Light Elevation. For simplicity, the position of lights in the LightKit can only be specified using angles: the elevation (latitude) and azimuth (longitude) of each light with respect to the camera, expressed in degrees. (Lights always shine on the camera's lookat point.) For example, a light at (elevation=0, azimuth=0) is located at the camera (a headlight). A light at (elevation=90, azimuth=0) is above the lookat point, shining down. Negative azimuth values move the lights clockwise as seen above, positive values counter-clockwise. So, a light at (elevation=45, azimuth=-20) is above and in front of the object and shining slightly from the left side.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Ele</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>BackLightElevation</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QDoubleSpinBox" name="BackLightWarmth">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Back Light Warmth</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The "Warmth" of the Back Light. Warmth is a parameter that varies from 0 to 1, where 0 is "cold" (looks icy or lit by a very blue sky), 1 is "warm" (the red of a very red sunset, or the embers of a campfire), and 0.5 is a neutral white. The warmth scale is non-linear. Warmth values close to 0.5 are subtly "warmer" or "cooler," much like a warmer tungsten incandescent bulb, a cooler halogen, or daylight (cooler still). Moving further away from 0.5, colors become more quickly varying towards blues and reds. With regards to aesthetics, extremes of warmth should be used sparingly. </string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QDoubleSpinBox" name="FillLightK_F_Ratio">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Key-to-Fill Ratio</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Set the Key-to-Fill Ratio. This ratio controls how bright the fill light is compared to the key light: larger values correspond to a dimmer fill light. The purpose of the fill light is to light parts of the object not lit by the key light, while still maintaining constrast. This type of lighting may correspond to indirect illumination from the key light, bounced off a wall, floor, or other object. The fill light should never be brighter than the key light: a good range for the key-to-fill ratio is between 2 and 10.</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.500000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="7">
|
||||
<widget class="QLabel" name="backAzimuthLabel">
|
||||
<property name="toolTip">
|
||||
<string>Back Light Azimuth</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The Back Light Azimuth. For simplicity, the position of lights in the LightKit can only be specified using angles: the elevation (latitude) and azimuth (longitude) of each light with respect to the camera, expressed in degrees. (Lights always shine on the camera's lookat point.) For example, a light at (elevation=0, azimuth=0) is located at the camera (a headlight). A light at (elevation=90, azimuth=0) is above the lookat point, shining down. Negative azimuth values move the lights clockwise as seen above, positive values counter-clockwise. So, a light at (elevation=45, azimuth=-20) is above and in front of the object and shining slightly from the left side.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Azi</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>BackLightAzimuth</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="backWarmthLabel">
|
||||
<property name="toolTip">
|
||||
<string>Back Light Warmth</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The "Warmth" of the Back Light. Warmth is a parameter that varies from 0 to 1, where 0 is "cold" (looks icy or lit by a very blue sky), 1 is "warm" (the red of a very red sunset, or the embers of a campfire), and 0.5 is a neutral white. The warmth scale is non-linear. Warmth values close to 0.5 are subtly "warmer" or "cooler," much like a warmer tungsten incandescent bulb, a cooler halogen, or daylight (cooler still). Moving further away from 0.5, colors become more quickly varying towards blues and reds. With regards to aesthetics, extremes of warmth should be used sparingly. </string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Warm</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>BackLightWarmth</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="4">
|
||||
<widget class="QCheckBox" name="MaintainLuminance">
|
||||
<property name="toolTip">
|
||||
<string>Toggle constant perceptual brightness.</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>If Maintain Luminance is set, the LightKit will attempt to maintain the apparent intensity of lights based on their perceptual brightnesses.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Maintain Luminance</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="Light">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>A headlight</string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Additional Headlight</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QHBoxLayout">
|
||||
<item>
|
||||
<widget class="pqColorChooserButton" name="LightColor">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Headlight color</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Color</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Int</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="LightIntensity">
|
||||
<property name="toolTip">
|
||||
<string>Headlight intensity</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QPushButton" name="Reset">
|
||||
<property name="toolTip">
|
||||
<string>Reset lights to their default values</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Reset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="Close">
|
||||
<property name="text">
|
||||
<string>Close</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>pqColorChooserButton</class>
|
||||
<extends>QPushButton</extends>
|
||||
<header>pqColorChooserButton.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>LightColor</tabstop>
|
||||
<tabstop>KeyLightWarmth</tabstop>
|
||||
<tabstop>KeyLightIntensity</tabstop>
|
||||
<tabstop>KeyLightElevation</tabstop>
|
||||
<tabstop>KeyLightAzimuth</tabstop>
|
||||
<tabstop>FillLightWarmth</tabstop>
|
||||
<tabstop>FillLightK_F_Ratio</tabstop>
|
||||
<tabstop>FillLightElevation</tabstop>
|
||||
<tabstop>FillLightAzimuth</tabstop>
|
||||
<tabstop>BackLightWarmth</tabstop>
|
||||
<tabstop>BackLightK_B_Ratio</tabstop>
|
||||
<tabstop>BackLightElevation</tabstop>
|
||||
<tabstop>BackLightAzimuth</tabstop>
|
||||
<tabstop>HeadLightWarmth</tabstop>
|
||||
<tabstop>HeadLightK_H_Ratio</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
<slots>
|
||||
<slot>resetLights()</slot>
|
||||
</slots>
|
||||
</ui>
|
||||
@ -0,0 +1,161 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>pqMainControlsToolbar</class>
|
||||
<widget class="QToolBar" name="pqMainControlsToolbar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>414</width>
|
||||
<height>52</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Main Controls</string>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<action name="actionOpenData">
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqOpen24.png</normaloff>:/pqWidgets/Icons/pqOpen24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Open...</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Open</string>
|
||||
</property>
|
||||
<property name="PV_MUST_BE_MASTER_TO_SHOW" stdset="0">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSaveData">
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqSave24.png</normaloff>:/pqWidgets/Icons/pqSave24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save Data...</string>
|
||||
</property>
|
||||
<property name="PV_MUST_BE_MASTER_TO_SHOW" stdset="0">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionServerConnect">
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqConnect24.png</normaloff>:/pqWidgets/Icons/pqConnect24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Connect...</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Connect</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionServerDisconnect">
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqDisconnect24.png</normaloff>:/pqWidgets/Icons/pqDisconnect24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Disconnect</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Disconnect</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionHelp">
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqHelp24.png</normaloff>:/pqWidgets/Icons/pqHelp24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Help</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionUndo">
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:pqWidgets/Icons/pqUndo24.png</normaloff>:pqWidgets/Icons/pqUndo24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Undo</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionRedo">
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqRedo24.png</normaloff>:/pqWidgets/Icons/pqRedo24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Redo</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionAutoApply">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqAutoApply32.png</normaloff>:/pqWidgets/Icons/pqAutoApply32.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Auto Apply</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Apply changes to parameters automatically</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionQuery">
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqFindData24.png</normaloff>:/pqWidgets/Icons/pqFindData24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Find data...</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Find data matching various criteria from the current source (v)</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionLoadPalette">
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqPalette32.png</normaloff>:/pqWidgets/Icons/pqPalette32.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Load Palette</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Load a color palette</string>
|
||||
</property>
|
||||
</action>
|
||||
<addaction name="actionOpenData"/>
|
||||
<addaction name="actionSaveData"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionServerConnect"/>
|
||||
<addaction name="actionServerDisconnect"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionUndo"/>
|
||||
<addaction name="actionRedo"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionHelp"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionAutoApply"/>
|
||||
<addaction name="actionQuery"/>
|
||||
<addaction name="actionLoadPalette"/>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../../Components/Resources/pqComponents.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -0,0 +1,131 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>pqPipelineBrowserContextMenu</class>
|
||||
<widget class="QWidget" name="pqPipelineBrowserContextMenu">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>100</width>
|
||||
<height>30</height>
|
||||
</rect>
|
||||
</property>
|
||||
<action name="actionPBChangeInput">
|
||||
<property name="text">
|
||||
<string>Change &Input...</string>
|
||||
</property>
|
||||
<property name="iconText">
|
||||
<string>Change Input...</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Change a Filter's Input</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Change a Filter's Input</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionPBDelete">
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Widgets/Resources/QtWidgets.qrc">
|
||||
<normaloff>:/QtWidgets/Icons/pqDelete24.png</normaloff>:/QtWidgets/Icons/pqDelete24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Delete</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Delete</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionPBCopy">
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqCopy22.png</normaloff>:/pqWidgets/Icons/pqCopy22.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Copy</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Copy Properties</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionPBPaste">
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqPaste22.png</normaloff>:/pqWidgets/Icons/pqPaste22.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Paste</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Paste Properties</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionPBIgnoreTime">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Ignore Time</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Disregard this source/filter's time from animations</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Disregard this source/filter's time from animations</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Disregard this source/filter's time from animations</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionPBLinkSelection">
|
||||
<property name="text">
|
||||
<string>Link with selection</string>
|
||||
</property>
|
||||
<property name="iconText">
|
||||
<string>Link with selection</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Link this source and current selected source as a selection link</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Link this source and current selected source as a selection link</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionPBOpen">
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqOpen24.png</normaloff>:/pqWidgets/Icons/pqOpen24.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Open</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Open</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Open</string>
|
||||
</property>
|
||||
<property name="shortcutContext">
|
||||
<enum>Qt::WidgetShortcut</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionPBCreateCustomFilter">
|
||||
<property name="text">
|
||||
<string>&Create Custom Filter...</string>
|
||||
</property>
|
||||
</action>
|
||||
<addaction name="actionPBOpen"/>
|
||||
<addaction name="actionPBCopy"/>
|
||||
<addaction name="actionPBPaste"/>
|
||||
<addaction name="actionPBCreateCustomFilter"/>
|
||||
<addaction name="actionPBChangeInput"/>
|
||||
<addaction name="actionPBLinkSelection"/>
|
||||
<addaction name="actionPBIgnoreTime"/>
|
||||
<addaction name="actionPBDelete"/>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../../Components/Resources/pqComponents.qrc"/>
|
||||
<include location="../../../Widgets/Resources/QtWidgets.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -0,0 +1,107 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SavePresetOptions</class>
|
||||
<widget class="QDialog" name="SavePresetOptions">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>241</width>
|
||||
<height>198</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Save Preset Options</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="saveColors">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Check to save colors to the preset.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save colors</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="saveOpacities">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Check to save opacities to the preset.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save opacities</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="saveAnnotations">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Check to save annotations to the preset.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save annotations</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>SavePresetOptions</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>SavePresetOptions</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@ -0,0 +1,243 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SeriesEditorPropertyWidget</class>
|
||||
<widget class="QWidget" name="SeriesEditorPropertyWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>306</width>
|
||||
<height>342</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="wdgLayout" columnstretch="0,0">
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="Thickness">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Enter the thickness for the line.</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="ThicknessLabel">
|
||||
<property name="text">
|
||||
<string>Line Thickness</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="StyleList">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Select the line style for the series.</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>None</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Solid</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Dash</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Dot</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Dash Dot</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Dash Dot Dot</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="StyleListLabel">
|
||||
<property name="text">
|
||||
<string>Line Style</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="MarkerStyleListLabel">
|
||||
<property name="text">
|
||||
<string>Marker Style</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="MarkerStyleList">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>None</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Cross</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Plus</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Square</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Circle</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Diamond</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="AxisListLabel">
|
||||
<property name="text">
|
||||
<string>Chart Axes</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QComboBox" name="AxisList">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Select the chart axes for the line series.</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Bottom-Left</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Bottom-Right</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Top-Right</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Top-Left</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="pqTreeView" name="SeriesTable">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>This displays the list of line series. You can use the list to edit the series options.</string>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<property name="rootIsDecorated">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="uniformRowHeights">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="itemsExpandable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="animated">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="maximumRowCountBeforeScrolling" stdset="0">
|
||||
<number>30</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>pqTreeView</class>
|
||||
<extends>QTreeView</extends>
|
||||
<header>pqTreeView.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -0,0 +1,301 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>TextLocationWidget</class>
|
||||
<widget class="QWidget" name="TextLocationWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>294</width>
|
||||
<height>214</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBoxLocation">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Use Window Location</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout">
|
||||
<property name="margin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="1">
|
||||
<widget class="QToolButton" name="toolButtonUC">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Top Center</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqTopCenter32.png</normaloff>:/pqWidgets/Icons/pqTopCenter32.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoExclusive">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">buttonGroupLocation</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QToolButton" name="toolButtonUR">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Top Right Corner</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqTopRightCorner32.png</normaloff>:/pqWidgets/Icons/pqTopRightCorner32.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoExclusive">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">buttonGroupLocation</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QToolButton" name="toolButtonUL">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Top Left Corner</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqTopLeftCorner32.png</normaloff>:/pqWidgets/Icons/pqTopLeftCorner32.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoExclusive">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">buttonGroupLocation</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QToolButton" name="toolButtonLR">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Bottom Right Corner</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqBottomRightCorner32.png</normaloff>:/pqWidgets/Icons/pqBottomRightCorner32.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoExclusive">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">buttonGroupLocation</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QToolButton" name="toolButtonLL">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Bottom Left Corner</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqBottomLeftCorner32.png</normaloff>:/pqWidgets/Icons/pqBottomLeftCorner32.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoExclusive">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">buttonGroupLocation</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QToolButton" name="toolButtonLC">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Bottom Center</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc">
|
||||
<normaloff>:/pqWidgets/Icons/pqBottomCenter32.png</normaloff>:/pqWidgets/Icons/pqBottomCenter32.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoExclusive">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">buttonGroupLocation</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QGroupBox" name="groupBoxPosition">
|
||||
<property name="title">
|
||||
<string>Lower Left Corner</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="1">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_Pos1Y">
|
||||
<property name="decimals">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.010000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_Pos1X">
|
||||
<property name="decimals">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.010000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../../Components/Resources/pqComponents.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
<buttongroups>
|
||||
<buttongroup name="buttonGroupLocation"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>TimeInspectorWidget</class>
|
||||
<widget class="QWidget" name="TimeInspectorWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>350</width>
|
||||
<height>466</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>350</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,1">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,1">
|
||||
<item>
|
||||
<widget class="pqVCRToolbar" name="VCR" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="pqAnimationTimeWidget" name="AnimationTimeWidget" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="pqAnimationWidget" name="AnimationWidget" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>pqAnimationWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>pqAnimationWidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>pqAnimationTimeWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>pqAnimationTimeWidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>pqVCRToolbar</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>pqVCRToolbar.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../../../Components/Resources/pqComponents.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -0,0 +1,137 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>TransferFunctionWidgetPropertyWidgetDialog</class>
|
||||
<widget class="QDialog" name="TransferFunctionWidgetPropertyWidgetDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>377</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Edit Transfer Function</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,1,0,0">
|
||||
<item>
|
||||
<widget class="QLabel" name="Label">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p align="center"><span style=" font-weight:600;">%1</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="pqTransferFunctionWidget" name="TransferFunctionEditor" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>80</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Piece wise ranges</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QDoubleSpinBox" name="minX">
|
||||
<property name="minimum">
|
||||
<double>-10000000.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>10000000.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QDoubleSpinBox" name="maxX">
|
||||
<property name="minimum">
|
||||
<double>-10000000.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>10000000.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="ButtonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Close</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>pqTransferFunctionWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>pqTransferFunctionWidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>ButtonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>TransferFunctionWidgetPropertyWidgetDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>ButtonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>TransferFunctionWidgetPropertyWidgetDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>pqVCRToolbar</class>
|
||||
<widget class="QToolBar" name="VCRToolbar" >
|
||||
<property name="windowTitle" >
|
||||
<string>VCR Controls</string>
|
||||
</property>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<attribute name="toolBarArea" >
|
||||
<enum>TopToolBarArea</enum>
|
||||
</attribute>
|
||||
<attribute name="toolBarBreak" >
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<action name="actionVCRPlay" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc" >:/pqWidgets/Icons/pqVcrPlay24.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Play</string>
|
||||
</property>
|
||||
</action>
|
||||
|
||||
<action name="actionVCRPreviousFrame" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc" >:/pqWidgets/Icons/pqVcrBack24.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Pre&vious Frame</string>
|
||||
</property>
|
||||
<property name="PV_MUST_BE_MASTER" stdset="0">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionVCRFirstFrame" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc" >:/pqWidgets/Icons/pqVcrFirst24.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&First Frame</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionVCRNextFrame" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc" >:/pqWidgets/Icons/pqVcrForward24.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Next Frame</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionVCRLastFrame" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc" >:/pqWidgets/Icons/pqVcrLast24.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Last Frame</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionVCRLoop" >
|
||||
<property name="checkable" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="../../../Components/Resources/pqComponents.qrc" >:/pqWidgets/Icons/pqVcrLoop24.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>L&oop</string>
|
||||
</property>
|
||||
<property name="iconText" >
|
||||
<string>Loop</string>
|
||||
</property>
|
||||
<property name="toolTip" >
|
||||
<string>Loop</string>
|
||||
</property>
|
||||
<property name="statusTip" >
|
||||
<string>Loop</string>
|
||||
</property>
|
||||
</action>
|
||||
|
||||
|
||||
<addaction name="actionVCRFirstFrame" />
|
||||
<addaction name="actionVCRPreviousFrame" />
|
||||
<addaction name="actionVCRPlay" />
|
||||
<addaction name="actionVCRNextFrame" />
|
||||
<addaction name="actionVCRLastFrame" />
|
||||
<addaction name="actionVCRLoop" />
|
||||
<property name="PV_MUST_BE_MASTER" stdset="0">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../../Components/Resources/pqComponents.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -0,0 +1,5 @@
|
||||
<RCC>
|
||||
<qresource prefix="/pqApplicationComponents">
|
||||
<file>StandardArrayColorMaps.json</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
@ -0,0 +1,7 @@
|
||||
if(PARAVIEW_ENABLE_PYTHON AND VTK_PYTHON_FULL_THREADSAFE)
|
||||
vtk_module_test_executable(pqApplicationComponentsTestVtkPythonScopeGilEnsurer TestVtkPythonScopeGilEnsurer.cxx ${MOC_SRCS})
|
||||
ExternalData_add_test(ParaViewData
|
||||
NAME pqApplicationComponentsTestVtkPythonScopeGilEnsurer
|
||||
COMMAND pqApplicationComponentsTestVtkPythonScopeGilEnsurer)
|
||||
set_tests_properties(pqApplicationComponentsTestVtkPythonScopeGilEnsurer PROPERTIES LABELS "PARAVIEW")
|
||||
endif()
|
||||
@ -0,0 +1,45 @@
|
||||
#include "vtkPython.h"
|
||||
#include "QApplication"
|
||||
#include "pqPVApplicationCore.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
// set stdout to line buffering (aka C++ std::cout)
|
||||
setvbuf(stdout, (char *)NULL, _IOLBF, BUFSIZ);
|
||||
|
||||
// Initialize Python
|
||||
Py_SetProgramName((char*)("PythonApp"));
|
||||
Py_Initialize(); // Initialize the interpreter
|
||||
PySys_SetArgv(argc, argv);
|
||||
PyRun_SimpleString("import threading\n");
|
||||
PyEval_InitThreads(); // Create (and acquire) the interpreter lock
|
||||
PyThreadState *pts = PyGILState_GetThisThreadState();
|
||||
PyEval_ReleaseThread(pts);
|
||||
|
||||
// The below should always work (illustration of lock protection)
|
||||
{
|
||||
vtkPythonScopeGilEnsurer gilEnsurer;
|
||||
|
||||
// Nothing important, just a bunch of calls to some Py* functions!
|
||||
PyRun_SimpleString("import base64");
|
||||
PyObject * sysmod = PyImport_AddModule("sys");
|
||||
PyObject* sysdict = PyModule_GetDict(sysmod);
|
||||
PyDict_GetItemString(sysdict, "modules");
|
||||
}
|
||||
|
||||
// Now the Qt part:
|
||||
QApplication qtapp(argc, argv);
|
||||
|
||||
// And finally the ParaView part:
|
||||
pqPVApplicationCore* myCoreApp = new pqPVApplicationCore (argc, argv);
|
||||
// Make sure compilation of ParaView was made with Python support:
|
||||
if (!myCoreApp->pythonManager())
|
||||
{
|
||||
std::cerr << "PV init error" << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
delete myCoreApp;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
20
ParaView-5.0.1/Qt/ApplicationComponents/module.cmake
Normal file
20
ParaView-5.0.1/Qt/ApplicationComponents/module.cmake
Normal file
@ -0,0 +1,20 @@
|
||||
vtk_module(pqApplicationComponents
|
||||
GROUPS
|
||||
ParaViewQt
|
||||
DEPENDS
|
||||
pqComponents
|
||||
vtkGUISupportQt
|
||||
PRIVATE_DEPENDS
|
||||
vtkPVAnimation
|
||||
vtkPVServerManagerDefault
|
||||
vtkPVServerManagerRendering
|
||||
vtksys
|
||||
vtkjsoncpp
|
||||
COMPILE_DEPENDS
|
||||
# doesn't really depend on this, but a good way to enable this
|
||||
# tool when ParaView UI is being built.
|
||||
vtkUtilitiesLegacyColorMapXMLToJSON
|
||||
EXCLUDE_FROM_WRAPPING
|
||||
TEST_LABELS
|
||||
PARAVIEW
|
||||
)
|
||||
@ -0,0 +1,50 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqAboutDialogReaction.cxx
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqAboutDialogReaction.h"
|
||||
|
||||
#include "pqAboutDialog.h"
|
||||
#include "pqCoreUtilities.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqAboutDialogReaction::pqAboutDialogReaction(QAction* parentObject)
|
||||
: Superclass(parentObject)
|
||||
{
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqAboutDialogReaction::showAboutDialog()
|
||||
{
|
||||
pqAboutDialog about_dialog(pqCoreUtilities::mainWidget());
|
||||
about_dialog.exec();
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,62 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqAboutDialogReaction.h
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqAboutDialogReaction_h
|
||||
#define pqAboutDialogReaction_h
|
||||
|
||||
#include "pqReaction.h"
|
||||
|
||||
/// @ingroup Reactions
|
||||
/// pqAboutDialogReaction used to show the standard about dialog for the
|
||||
/// application.
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqAboutDialogReaction : public pqReaction
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef pqReaction Superclass;
|
||||
public:
|
||||
pqAboutDialogReaction(QAction* parent);
|
||||
|
||||
/// Shows the about dialog for the application.
|
||||
static void showAboutDialog();
|
||||
|
||||
protected:
|
||||
/// Called when the action is triggered.
|
||||
virtual void onTriggered()
|
||||
{ pqAboutDialogReaction::showAboutDialog(); }
|
||||
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqAboutDialogReaction)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@ -0,0 +1,85 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqAlwaysConnectedBehavior.cxx
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqAlwaysConnectedBehavior.h"
|
||||
|
||||
#include "pqApplicationCore.h"
|
||||
#include "pqObjectBuilder.h"
|
||||
#include "pqServer.h"
|
||||
#include "pqServerManagerModel.h"
|
||||
#include "vtkNetworkAccessManager.h"
|
||||
#include "vtkProcessModule.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqAlwaysConnectedBehavior::pqAlwaysConnectedBehavior(QObject* parentObject)
|
||||
: Superclass(parentObject),
|
||||
DefaultServer("builtin:")
|
||||
{
|
||||
this->Timer.setSingleShot(true);
|
||||
this->Timer.setInterval(0);
|
||||
QObject::connect(&this->Timer, SIGNAL(timeout()),
|
||||
this, SLOT(serverCheck()));
|
||||
|
||||
pqServerManagerModel* smmodel =
|
||||
pqApplicationCore::instance()->getServerManagerModel();
|
||||
QObject::connect(smmodel, SIGNAL(finishedRemovingServer()),
|
||||
this, SLOT(delayedServerCheck()));
|
||||
this->serverCheck();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqAlwaysConnectedBehavior::~pqAlwaysConnectedBehavior()
|
||||
{
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqAlwaysConnectedBehavior::delayedServerCheck()
|
||||
{
|
||||
this->Timer.start();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqAlwaysConnectedBehavior::serverCheck()
|
||||
{
|
||||
pqApplicationCore* core = pqApplicationCore::instance();
|
||||
if (core->getServerManagerModel()->getNumberOfItems<pqServer*>() != 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (core->getObjectBuilder()->waitingForConnection())
|
||||
{
|
||||
// Try again later, we are waiting for server to connect.
|
||||
this->delayedServerCheck();
|
||||
return;
|
||||
}
|
||||
|
||||
core->getObjectBuilder()->createServer(this->DefaultServer);
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqAlwaysConnectedBehavior.h
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqAlwaysConnectedBehavior_h
|
||||
#define pqAlwaysConnectedBehavior_h
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include "pqApplicationComponentsModule.h"
|
||||
#include "pqServerResource.h"
|
||||
#include "pqTimer.h"
|
||||
|
||||
/// @ingroup Behaviors
|
||||
/// pqAlwaysConnectedBehavior ensures that the client always remains connected
|
||||
/// to a server.
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqAlwaysConnectedBehavior : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef QObject Superclass;
|
||||
public:
|
||||
pqAlwaysConnectedBehavior(QObject* parent=0);
|
||||
~pqAlwaysConnectedBehavior();
|
||||
|
||||
/// Get/Set the default server resource to connect to.
|
||||
void setDefaultServer(const pqServerResource& resource)
|
||||
{ this->DefaultServer = resource; }
|
||||
const pqServerResource& defaultServer() const
|
||||
{ return this->DefaultServer; }
|
||||
|
||||
protected slots:
|
||||
void delayedServerCheck();
|
||||
void serverCheck();
|
||||
|
||||
protected:
|
||||
pqServerResource DefaultServer;
|
||||
pqTimer Timer;
|
||||
private:
|
||||
Q_DISABLE_COPY(pqAlwaysConnectedBehavior)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@ -0,0 +1,62 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqAnimationTimeToolbar.cxx
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqAnimationTimeToolbar.h"
|
||||
|
||||
#include "pqAnimationManager.h"
|
||||
#include "pqAnimationScene.h"
|
||||
#include "pqAnimationTimeWidget.h"
|
||||
#include "pqPVApplicationCore.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqAnimationTimeToolbar::constructor()
|
||||
{
|
||||
this->setWindowTitle("Current Time Controls");
|
||||
this->AnimationTimeWidget = new pqAnimationTimeWidget(this);
|
||||
this->AnimationTimeWidget->setPlayModeReadOnly(true);
|
||||
this->addWidget(this->AnimationTimeWidget);
|
||||
this->connect(pqPVApplicationCore::instance()->animationManager(),
|
||||
SIGNAL(activeSceneChanged(pqAnimationScene*)),
|
||||
SLOT(setAnimationScene(pqAnimationScene*)));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqAnimationTimeToolbar::setAnimationScene(pqAnimationScene* scene)
|
||||
{
|
||||
this->AnimationTimeWidget->setAnimationScene(
|
||||
scene? scene->getProxy() : NULL);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqAnimationTimeWidget* pqAnimationTimeToolbar::animationTimeWidget() const
|
||||
{
|
||||
return this->AnimationTimeWidget;
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqAnimationTimeToolbar.h
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqAnimationTimeToolbar_h
|
||||
#define pqAnimationTimeToolbar_h
|
||||
|
||||
#include "pqApplicationComponentsModule.h"
|
||||
#include <QToolBar>
|
||||
#include <QPointer>
|
||||
|
||||
class pqAnimationTimeWidget;
|
||||
class pqAnimationScene;
|
||||
|
||||
|
||||
/// pqAnimationTimeToolbar is a QToolBar containing a pqAnimationTimeWidget.
|
||||
/// pqAnimationTimeToolbar also ensures that the pqAnimationTimeWidget is
|
||||
/// tracking the animation scene on the active session.
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqAnimationTimeToolbar : public QToolBar
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef QToolBar Superclass;
|
||||
public:
|
||||
pqAnimationTimeToolbar(const QString &_title, QWidget *_parent = 0)
|
||||
: Superclass(_title, _parent)
|
||||
{
|
||||
this->constructor();
|
||||
}
|
||||
pqAnimationTimeToolbar(QWidget *_parent = 0)
|
||||
: Superclass(_parent)
|
||||
{
|
||||
this->constructor();
|
||||
}
|
||||
|
||||
/// Provides access to the pqAnimationTimeWidget used.
|
||||
pqAnimationTimeWidget* animationTimeWidget() const;
|
||||
private slots:
|
||||
void setAnimationScene(pqAnimationScene* scene);
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqAnimationTimeToolbar)
|
||||
void constructor();
|
||||
QPointer<pqAnimationTimeWidget> AnimationTimeWidget;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@ -0,0 +1,284 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqAnimationTimeWidget.cxx
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqAnimationTimeWidget.h"
|
||||
#include "ui_pqAnimationTimeWidget.h"
|
||||
|
||||
#include "pqPropertyLinksConnection.h"
|
||||
#include "pqPropertyLinks.h"
|
||||
#include "vtkSMPropertyHelper.h"
|
||||
#include "vtkSMTimeKeeperProxy.h"
|
||||
#include "vtkWeakPointer.h"
|
||||
|
||||
#include <QDoubleValidator>
|
||||
|
||||
class pqAnimationTimeWidget::pqInternals
|
||||
{
|
||||
public:
|
||||
Ui::AnimationTimeWidget Ui;
|
||||
vtkWeakPointer<vtkSMProxy> AnimationScene;
|
||||
void* AnimationSceneVoidPtr;
|
||||
pqPropertyLinks Links;
|
||||
int CachedTimestepCount;
|
||||
|
||||
pqInternals(pqAnimationTimeWidget* self) :
|
||||
AnimationSceneVoidPtr(NULL),
|
||||
CachedTimestepCount(-1)
|
||||
{
|
||||
this->Ui.setupUi(self);
|
||||
this->Ui.timeValue->setValidator(new QDoubleValidator(self));
|
||||
}
|
||||
};
|
||||
|
||||
namespace
|
||||
{
|
||||
/// Used to link the number of elements in a sm-property to the qt widget.
|
||||
class pqAnimationTimeWidgetLinks : public pqPropertyLinksConnection
|
||||
{
|
||||
typedef pqPropertyLinksConnection Superclass;
|
||||
public:
|
||||
pqAnimationTimeWidgetLinks(
|
||||
QObject* qobject, const char* qproperty, const char* qsignal,
|
||||
vtkSMProxy* smproxy, vtkSMProperty* smproperty, int smindex,
|
||||
bool use_unchecked_modified_event,
|
||||
QObject* parentObject=0)
|
||||
: Superclass(qobject, qproperty, qsignal,
|
||||
smproxy, smproperty, smindex,
|
||||
use_unchecked_modified_event, parentObject)
|
||||
{
|
||||
}
|
||||
virtual ~pqAnimationTimeWidgetLinks()
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual QVariant currentServerManagerValue(bool use_unchecked) const
|
||||
{
|
||||
Q_ASSERT(use_unchecked == false);
|
||||
Q_UNUSED(use_unchecked);
|
||||
unsigned int count = vtkSMPropertyHelper(this->propertySM()).GetNumberOfElements();
|
||||
return QVariant(static_cast<int>(count));
|
||||
}
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqAnimationTimeWidgetLinks);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqAnimationTimeWidget::pqAnimationTimeWidget(QWidget* parentObject)
|
||||
: Superclass(parentObject),
|
||||
Internals(new pqAnimationTimeWidget::pqInternals(this))
|
||||
{
|
||||
this->setEnabled(false);
|
||||
|
||||
Ui::AnimationTimeWidget &ui = this->Internals->Ui;
|
||||
this->connect(ui.timeValue, SIGNAL(textChangedAndEditingFinished()), SIGNAL(timeValueChanged()));
|
||||
this->connect(ui.radioButtonValue, SIGNAL(toggled(bool)), SIGNAL(playModeChanged()));
|
||||
this->connect(ui.radioButtonValue, SIGNAL(toggled(bool)), SLOT(updateTimestepCountLabelVisibility()));
|
||||
this->connect(ui.timestepValue, SIGNAL(valueChangedAndEditingFinished()),
|
||||
SLOT(timestepValueChanged()));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqAnimationTimeWidget::~pqAnimationTimeWidget()
|
||||
{
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqAnimationTimeWidget::setAnimationScene(vtkSMProxy* ascene)
|
||||
{
|
||||
pqInternals& internals = *this->Internals;
|
||||
if (internals.AnimationSceneVoidPtr == ascene)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
internals.Links.clear();
|
||||
internals.AnimationScene = ascene;
|
||||
internals.AnimationSceneVoidPtr = ascene;
|
||||
this->setEnabled(ascene != NULL);
|
||||
if (!ascene)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
internals.Links.addPropertyLink(
|
||||
this, "timeValue", SIGNAL(timeValueChanged()),
|
||||
ascene, ascene->GetProperty("AnimationTime"));
|
||||
internals.Links.addPropertyLink(this, "playMode", SIGNAL(playModeChanged()),
|
||||
ascene, ascene->GetProperty("PlayMode"));
|
||||
|
||||
// In a ParaView application, it's safe to assume that the timekeeper an
|
||||
// animation scene is using doesn't change in the life span of the scene.
|
||||
vtkSMProxy* atimekeeper = vtkSMPropertyHelper(ascene, "TimeKeeper").GetAsProxy();
|
||||
Q_ASSERT(atimekeeper != NULL);
|
||||
|
||||
internals.Links.addPropertyLink<pqAnimationTimeWidgetLinks>(
|
||||
this, "timeStepCount", SIGNAL(dummySignal()),
|
||||
atimekeeper, atimekeeper->GetProperty("TimestepValues"));
|
||||
internals.Links.addPropertyLink(
|
||||
this, "timeLabel", SIGNAL(dummySignal()),
|
||||
atimekeeper, atimekeeper->GetProperty("TimeLabel"));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
vtkSMProxy* pqAnimationTimeWidget::animationScene() const
|
||||
{
|
||||
pqInternals& internals = *this->Internals;
|
||||
return internals.AnimationScene;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
vtkSMProxy* pqAnimationTimeWidget::timeKeeper() const
|
||||
{
|
||||
pqInternals& internals = *this->Internals;
|
||||
return internals.AnimationScene?
|
||||
vtkSMPropertyHelper(internals.AnimationScene, "TimeKeeper").GetAsProxy() : NULL;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqAnimationTimeWidget::setTimeValue(double time)
|
||||
{
|
||||
Ui::AnimationTimeWidget &ui = this->Internals->Ui;
|
||||
ui.timeValue->setTextAndResetCursor(QString::number(time, 'g', 17));
|
||||
bool prev = ui.timestepValue->blockSignals(true);
|
||||
int index = vtkSMTimeKeeperProxy::GetLowerBoundTimeStepIndex(this->timeKeeper(), time);
|
||||
ui.timestepValue->setValue(index);
|
||||
ui.timestepValue->blockSignals(prev);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
double pqAnimationTimeWidget::timeValue() const
|
||||
{
|
||||
Ui::AnimationTimeWidget &ui = this->Internals->Ui;
|
||||
return ui.timeValue->text().toDouble();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqAnimationTimeWidget::setTimeStepCount(int value)
|
||||
{
|
||||
pqInternals& internals = *this->Internals;
|
||||
internals.CachedTimestepCount = value;
|
||||
|
||||
Ui::AnimationTimeWidget &ui = this->Internals->Ui;
|
||||
ui.timestepValue->setMaximum(value > 0? value -1 : 0);
|
||||
ui.timestepCountLabel->setText(QString("of %1").arg(value));
|
||||
ui.timestepCountLabel->setVisible(
|
||||
(value > 0) && (this->playMode() == "Snap To TimeSteps"));
|
||||
|
||||
bool prev = ui.timestepValue->blockSignals(true);
|
||||
ui.timestepValue->setValue(
|
||||
vtkSMTimeKeeperProxy::GetLowerBoundTimeStepIndex(this->timeKeeper(), this->timeValue()));
|
||||
ui.timestepValue->blockSignals(prev);
|
||||
|
||||
this->updateTimestepCountLabelVisibility();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
int pqAnimationTimeWidget::timeStepCount() const
|
||||
{
|
||||
pqInternals& internals = *this->Internals;
|
||||
return internals.CachedTimestepCount;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqAnimationTimeWidget::setPlayMode(const QString& value)
|
||||
{
|
||||
Ui::AnimationTimeWidget &ui = this->Internals->Ui;
|
||||
if (value == "Sequence" || value == "Real Time")
|
||||
{
|
||||
ui.radioButtonValue->setChecked(true);
|
||||
}
|
||||
else if (value == "Snap To TimeSteps")
|
||||
{
|
||||
ui.radioButtonStep->setChecked(true);
|
||||
}
|
||||
this->updateTimestepCountLabelVisibility();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
QString pqAnimationTimeWidget::playMode() const
|
||||
{
|
||||
Ui::AnimationTimeWidget &ui = this->Internals->Ui;
|
||||
return ui.radioButtonValue->isChecked()? "Sequence" : "Snap To TimeSteps";
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqAnimationTimeWidget::updateTimestepCountLabelVisibility()
|
||||
{
|
||||
Ui::AnimationTimeWidget &ui = this->Internals->Ui;
|
||||
ui.timestepCountLabel->setVisible(
|
||||
(this->timeStepCount() > 0) && (this->playMode() == "Snap To TimeSteps"));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqAnimationTimeWidget::timestepValueChanged()
|
||||
{
|
||||
Ui::AnimationTimeWidget &ui = this->Internals->Ui;
|
||||
int index = ui.timestepValue->value();
|
||||
vtkSMPropertyHelper helper(this->timeKeeper(), "TimestepValues");
|
||||
if (index >=0 && static_cast<unsigned int>(index) < helper.GetNumberOfElements())
|
||||
{
|
||||
this->setTimeValue(helper.GetAsDouble(index));
|
||||
emit this->timeValueChanged();
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqAnimationTimeWidget::setTimeLabel(const QString& val)
|
||||
{
|
||||
Ui::AnimationTimeWidget &ui = this->Internals->Ui;
|
||||
ui.timeLabel->setText(val + ":");
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
QString pqAnimationTimeWidget::timeLabel() const
|
||||
{
|
||||
Ui::AnimationTimeWidget &ui = this->Internals->Ui;
|
||||
QString txt = ui.timeLabel->text();
|
||||
return txt.left(txt.length()-1);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqAnimationTimeWidget::setPlayModeReadOnly(bool val)
|
||||
{
|
||||
Ui::AnimationTimeWidget &ui = this->Internals->Ui;
|
||||
ui.radioButtonValue->setVisible(!val);
|
||||
ui.radioButtonStep->setVisible(!val);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool pqAnimationTimeWidget::playModeReadOnly() const
|
||||
{
|
||||
Ui::AnimationTimeWidget &ui = this->Internals->Ui;
|
||||
return !ui.radioButtonStep->isVisible();
|
||||
}
|
||||
120
ParaView-5.0.1/Qt/ApplicationComponents/pqAnimationTimeWidget.h
Normal file
120
ParaView-5.0.1/Qt/ApplicationComponents/pqAnimationTimeWidget.h
Normal file
@ -0,0 +1,120 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqAnimationTimeWidget.h
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqAnimationTimeWidget_h
|
||||
#define pqAnimationTimeWidget_h
|
||||
|
||||
#include "pqApplicationComponentsModule.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QScopedPointer>
|
||||
#include <vector>
|
||||
|
||||
class vtkSMProxy;
|
||||
|
||||
/// pqAnimationTimeWidget is a widget that can be used to show/set the current
|
||||
/// animation time.
|
||||
/// The widget allow the user to do the following:
|
||||
/// \li View and/or change the current time value (in seq/realtime modes), or
|
||||
/// current time step value (in snap-to-timesteps mode).
|
||||
/// \li View and/or change the play mode (from seq to snap-to-timesteps). While
|
||||
/// the widget behaves acceptably if the application externally changes the
|
||||
/// animation play mode to realtime, the widget itself doesn't allow the
|
||||
/// user to do that. This mode is optional. You can disabling allowing the
|
||||
/// user to change the play mode by setting playModeReadOnly to true
|
||||
/// (default is false).
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqAnimationTimeWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(double timeValue READ timeValue WRITE setTimeValue NOTIFY timeValueChanged)
|
||||
Q_PROPERTY(int timeStepCount READ timeStepCount WRITE setTimeStepCount)
|
||||
Q_PROPERTY(QString playMode READ playMode WRITE setPlayMode)
|
||||
Q_PROPERTY(bool playModeReadOnly READ playModeReadOnly WRITE setPlayModeReadOnly)
|
||||
Q_PROPERTY(QString timeLabel READ timeLabel WRITE setTimeLabel)
|
||||
|
||||
typedef QWidget Superclass;
|
||||
public:
|
||||
pqAnimationTimeWidget(QWidget* parent=0);
|
||||
virtual ~pqAnimationTimeWidget();
|
||||
|
||||
/// Provides access to the animation scene proxy currently
|
||||
/// controlled/reflected by this widget.
|
||||
vtkSMProxy* animationScene() const;
|
||||
|
||||
/// Get/set the current time value.
|
||||
void setTimeValue(double time);
|
||||
double timeValue() const;
|
||||
|
||||
/// Get/set the number of timesteps.
|
||||
void setTimeStepCount(int count);
|
||||
int timeStepCount() const;
|
||||
|
||||
/// Get/set the playmode.
|
||||
void setPlayMode(const QString& mode);
|
||||
QString playMode() const;
|
||||
|
||||
/// Get/set whether the user should be able to change the animation
|
||||
/// play mode using this widget.
|
||||
void setPlayModeReadOnly(bool val);
|
||||
bool playModeReadOnly() const;
|
||||
|
||||
/// Get/set the label text to use for the "time" parameter.
|
||||
void setTimeLabel(const QString& val);
|
||||
QString timeLabel() const;
|
||||
signals:
|
||||
void timeValueChanged();
|
||||
void playModeChanged();
|
||||
void dummySignal();
|
||||
|
||||
public slots:
|
||||
/// Set the animation scene proxy which is reflected/controlled by this
|
||||
/// widget.
|
||||
void setAnimationScene(vtkSMProxy* animationScene);
|
||||
|
||||
private slots:
|
||||
void updateTimestepCountLabelVisibility();
|
||||
|
||||
/// called when the user changes the timestepValue spinbox manually
|
||||
/// to change the current timestep. We will update the current time and
|
||||
/// result in triggering timeValueChanged() if time indeed changed.
|
||||
void timestepValueChanged();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqAnimationTimeWidget);
|
||||
|
||||
// Returns the current timekeeper.
|
||||
vtkSMProxy* timeKeeper() const;
|
||||
|
||||
class pqInternals;
|
||||
QScopedPointer<pqInternals> Internals;
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,49 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqApplicationComponentsInit.cxx
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqApplicationComponentsInit.h"
|
||||
|
||||
#include "vtkPVConfig.h"
|
||||
#include "pqComponentsInit.h"
|
||||
#include <QObject> // for Q_INIT_RESOURCE
|
||||
#include <QtPlugin>
|
||||
|
||||
void pqApplicationComponentsInit()
|
||||
{
|
||||
#ifndef PARAVIEW_BUILD_SHARED_LIBS
|
||||
// init dependents
|
||||
pqComponentsInit();
|
||||
|
||||
// init resources
|
||||
Q_INIT_RESOURCE(pqApplicationComponents);
|
||||
|
||||
#endif
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqApplicationComponentsInit.h
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqApplicationComponentsInit_h
|
||||
#define pqApplicationComponentsInit_h
|
||||
|
||||
#include "pqApplicationComponentsModule.h"
|
||||
|
||||
/// pqApplicationComponentsInit() is for initializing static data when pqApplicationComponents
|
||||
/// is built as a static library. Otherwise, linkers may drop out entire
|
||||
/// object files such as files generated by rcc or other files in pqApplicationComponents.
|
||||
|
||||
PQAPPLICATIONCOMPONENTS_EXPORT void pqApplicationComponentsInit();
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,65 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqApplicationSettingsReaction.cxx
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqApplicationSettingsReaction.h"
|
||||
|
||||
#include "pqSettingsDialog.h"
|
||||
#include "pqCoreUtilities.h"
|
||||
|
||||
|
||||
QPointer<pqSettingsDialog> pqApplicationSettingsReaction::Dialog;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqApplicationSettingsReaction::pqApplicationSettingsReaction(QAction* parentObject)
|
||||
: Superclass(parentObject)
|
||||
{
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqApplicationSettingsReaction::~pqApplicationSettingsReaction()
|
||||
{
|
||||
delete pqApplicationSettingsReaction::Dialog;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqApplicationSettingsReaction::showApplicationSettingsDialog(const QString& tabName)
|
||||
{
|
||||
if (!pqApplicationSettingsReaction::Dialog)
|
||||
{
|
||||
pqApplicationSettingsReaction::Dialog = new pqSettingsDialog(
|
||||
pqCoreUtilities::mainWidget());
|
||||
pqApplicationSettingsReaction::Dialog->setObjectName("ApplicationSettings");
|
||||
pqApplicationSettingsReaction::Dialog->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
}
|
||||
pqApplicationSettingsReaction::Dialog->show();
|
||||
pqApplicationSettingsReaction::Dialog->raise();
|
||||
pqApplicationSettingsReaction::Dialog->showTab(tabName);
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqApplicationSettingsReaction.h
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqApplicationSettingsReaction_h
|
||||
#define pqApplicationSettingsReaction_h
|
||||
|
||||
#include "pqReaction.h"
|
||||
#include <QPointer>
|
||||
|
||||
class pqSettingsDialog;
|
||||
|
||||
/// @ingroup Reactions
|
||||
/// pqApplicationSettingsReaction is a reaction to popup the application
|
||||
/// settings dialog. It creates pqSettingsDialog when required.
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqApplicationSettingsReaction : public pqReaction
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef pqReaction Superclass;
|
||||
public:
|
||||
/// Constructor. Parent cannot be NULL.
|
||||
pqApplicationSettingsReaction(QAction* parent);
|
||||
virtual ~pqApplicationSettingsReaction();
|
||||
|
||||
/// Show the application settings dialog.
|
||||
static void showApplicationSettingsDialog(const QString& tabName="");
|
||||
|
||||
protected:
|
||||
/// Called when the action is triggered.
|
||||
virtual void onTriggered()
|
||||
{ pqApplicationSettingsReaction::showApplicationSettingsDialog(); }
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqApplicationSettingsReaction)
|
||||
|
||||
static QPointer<pqSettingsDialog> Dialog;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
365
ParaView-5.0.1/Qt/ApplicationComponents/pqApplyBehavior.cxx
Normal file
365
ParaView-5.0.1/Qt/ApplicationComponents/pqApplyBehavior.cxx
Normal file
@ -0,0 +1,365 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqApplyBehavior.cxx
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqApplyBehavior.h"
|
||||
|
||||
#include "pqActiveObjects.h"
|
||||
#include "pqApplicationCore.h"
|
||||
#include "pqDataRepresentation.h"
|
||||
#include "pqLiveInsituManager.h"
|
||||
#include "pqPipelineFilter.h"
|
||||
#include "pqPropertiesPanel.h"
|
||||
#include "pqProxyModifiedStateUndoElement.h"
|
||||
#include "pqRenderView.h"
|
||||
#include "pqServerManagerModel.h"
|
||||
#include "pqUndoStack.h"
|
||||
#include "vtkDataObject.h"
|
||||
#include "vtkNew.h"
|
||||
#include "vtkPVDataInformation.h"
|
||||
#include "vtkPVGeneralSettings.h"
|
||||
#include "vtkSMAnimationSceneProxy.h"
|
||||
#include "vtkSMLiveInsituLinkProxy.h"
|
||||
#include "vtkSMParaViewPipelineControllerWithRendering.h"
|
||||
#include "vtkSMPropertyHelper.h"
|
||||
#include "vtkSMPVRepresentationProxy.h"
|
||||
#include "vtkSMSession.h"
|
||||
#include "vtkSMSourceProxy.h"
|
||||
#include "vtkSMTransferFunctionManager.h"
|
||||
#include "vtkSMViewProxy.h"
|
||||
#include "vtkWeakPointer.h"
|
||||
|
||||
#include <QtDebug>
|
||||
#include <QSet>
|
||||
#include <QList>
|
||||
|
||||
class pqApplyBehavior::pqInternals
|
||||
{
|
||||
public:
|
||||
typedef QPair<vtkWeakPointer<vtkSMRepresentationProxy>, vtkWeakPointer<vtkSMViewProxy> > PairType;
|
||||
QList<PairType> NewlyCreatedRepresentations;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqApplyBehavior::pqApplyBehavior(QObject* parentObject)
|
||||
: Superclass(parentObject),
|
||||
Internals(new pqApplyBehavior::pqInternals())
|
||||
{
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqApplyBehavior::~pqApplyBehavior()
|
||||
{
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqApplyBehavior::registerPanel(pqPropertiesPanel* panel)
|
||||
{
|
||||
Q_ASSERT(panel);
|
||||
|
||||
this->connect(panel, SIGNAL(applied(pqProxy*)), SLOT(onApplied(pqProxy*)));
|
||||
this->connect(panel, SIGNAL(applied()), SLOT(onApplied()));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqApplyBehavior::unregisterPanel(pqPropertiesPanel* panel)
|
||||
{
|
||||
Q_ASSERT(panel);
|
||||
this->disconnect(panel);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqApplyBehavior::onApplied(pqProxy* proxy)
|
||||
{
|
||||
pqPropertiesPanel* panel = qobject_cast<pqPropertiesPanel*>(this->sender());
|
||||
if (panel)
|
||||
{
|
||||
this->applied(panel, proxy);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqApplyBehavior::onApplied()
|
||||
{
|
||||
pqPropertiesPanel* panel = qobject_cast<pqPropertiesPanel*>(this->sender());
|
||||
if (panel)
|
||||
{
|
||||
this->applied(panel);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqApplyBehavior::applied(pqPropertiesPanel*, pqProxy* pqproxy)
|
||||
{
|
||||
pqPipelineSource *pqsource = qobject_cast<pqPipelineSource*>(pqproxy);
|
||||
if (pqsource == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Q_ASSERT(pqsource);
|
||||
|
||||
if (pqsource->modifiedState() == pqProxy::UNINITIALIZED)
|
||||
{
|
||||
// if this is first apply after creation, show the data in the view.
|
||||
this->showData(pqsource, pqActiveObjects::instance().activeView());
|
||||
|
||||
// add undo-element to ensure this state change happens when
|
||||
// undoing/redoing.
|
||||
pqProxyModifiedStateUndoElement* undoElement =
|
||||
pqProxyModifiedStateUndoElement::New();
|
||||
undoElement->SetSession(pqsource->getServer()->session());
|
||||
undoElement->MadeUnmodified(pqsource);
|
||||
ADD_UNDO_ELEM(undoElement);
|
||||
undoElement->Delete();
|
||||
}
|
||||
pqsource->setModifiedState(pqProxy::UNMODIFIED);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqApplyBehavior::applied(pqPropertiesPanel*)
|
||||
{
|
||||
//---------------------------------------------------------------------------
|
||||
// Update animation timesteps.
|
||||
vtkNew<vtkSMParaViewPipelineControllerWithRendering> controller;
|
||||
vtkSMAnimationSceneProxy::UpdateAnimationUsingDataTimeSteps(
|
||||
controller->GetAnimationScene(
|
||||
pqActiveObjects::instance().activeServer()->session()));
|
||||
|
||||
|
||||
pqServerManagerModel* smmodel = pqApplicationCore::instance()->getServerManagerModel();
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// If there is a catalyst session, push its updates to the server
|
||||
foreach (pqServer* server, smmodel->findItems<pqServer*>())
|
||||
{
|
||||
if (pqLiveInsituManager::isInsituServer(server))
|
||||
{
|
||||
pqLiveInsituManager::linkProxy(server)->PushUpdatedStates();
|
||||
}
|
||||
}
|
||||
|
||||
QList<pqView*> dirty_views;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// find views that need updating and update them.
|
||||
foreach (pqView* view, smmodel->findItems<pqView*>())
|
||||
{
|
||||
if (view && view->getViewProxy()->GetNeedsUpdate())
|
||||
{
|
||||
dirty_views.push_back(view);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Update all the views separately. This ensures that all pipelines are
|
||||
// up-to-date before we render as we may need to change some rendering
|
||||
// properties like color transfer functions before the actual render.
|
||||
foreach (pqView* view, dirty_views)
|
||||
{
|
||||
view->getViewProxy()->Update();
|
||||
}
|
||||
|
||||
vtkPVGeneralSettings* gsettings = vtkPVGeneralSettings::GetInstance();
|
||||
foreach (const pqInternals::PairType& pair, this->Internals->NewlyCreatedRepresentations)
|
||||
{
|
||||
vtkSMRepresentationProxy* reprProxy = pair.first;
|
||||
vtkSMViewProxy* viewProxy = pair.second;
|
||||
|
||||
// If not scalar coloring, we make an attempt to color using
|
||||
// 'vtkBlockColors' array, if present.
|
||||
if (vtkSMPVRepresentationProxy::SafeDownCast(reprProxy) &&
|
||||
vtkSMPVRepresentationProxy::GetUsingScalarColoring(reprProxy) == false &&
|
||||
reprProxy->GetRepresentedDataInformation()->GetArrayInformation(
|
||||
"vtkBlockColors", vtkDataObject::FIELD) != NULL)
|
||||
{
|
||||
vtkSMPVRepresentationProxy::SetScalarColoring(reprProxy,
|
||||
"vtkBlockColors", vtkDataObject::FIELD);
|
||||
if (gsettings->GetScalarBarMode() == vtkPVGeneralSettings::AUTOMATICALLY_SHOW_AND_HIDE_SCALAR_BARS)
|
||||
{
|
||||
vtkSMPVRepresentationProxy::SetScalarBarVisibility(reprProxy, viewProxy, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// If user chose it, update all transfer function data range.
|
||||
// FIXME: This should happen for all servers available.
|
||||
vtkNew<vtkSMTransferFunctionManager> tmgr;
|
||||
int mode = gsettings->GetTransferFunctionResetMode();
|
||||
switch (mode)
|
||||
{
|
||||
case vtkPVGeneralSettings::RESET_ON_APPLY:
|
||||
case vtkPVGeneralSettings::RESET_ON_APPLY_AND_TIMESTEP:
|
||||
tmgr->ResetAllTransferFunctionRangesUsingCurrentData(
|
||||
pqActiveObjects::instance().activeServer()->proxyManager(), false);
|
||||
break;
|
||||
|
||||
case vtkPVGeneralSettings::GROW_ON_APPLY:
|
||||
case vtkPVGeneralSettings::GROW_ON_APPLY_AND_TIMESTEP:
|
||||
default:
|
||||
tmgr->ResetAllTransferFunctionRangesUsingCurrentData(
|
||||
pqActiveObjects::instance().activeServer()->proxyManager(),
|
||||
/*extend*/true);
|
||||
break;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Perform the render on visible views.
|
||||
foreach (pqView* view, dirty_views)
|
||||
{
|
||||
if (view->widget()->isVisible())
|
||||
{
|
||||
view->forceRender();
|
||||
}
|
||||
}
|
||||
|
||||
this->Internals->NewlyCreatedRepresentations.clear();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqApplyBehavior::showData(pqPipelineSource* source, pqView* view)
|
||||
{
|
||||
// HACK: Skip catalyst proxies.
|
||||
if (source->getServer()->getResource().scheme() == "catalyst")
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
vtkNew<vtkSMParaViewPipelineControllerWithRendering> controller;
|
||||
pqServerManagerModel* smmodel = pqApplicationCore::instance()->getServerManagerModel();
|
||||
|
||||
vtkSMViewProxy* currentViewProxy = view? view->getViewProxy() : NULL;
|
||||
|
||||
QSet<vtkSMProxy*> updated_views;
|
||||
|
||||
// create representations for all output ports.
|
||||
for (int outputPort = 0; outputPort < source->getNumberOfOutputPorts(); outputPort++)
|
||||
{
|
||||
vtkSMViewProxy* preferredView = controller->ShowInPreferredView(
|
||||
vtkSMSourceProxy::SafeDownCast(source->getProxy()), outputPort, currentViewProxy);
|
||||
if (!preferredView)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
updated_views.insert(preferredView);
|
||||
|
||||
// reset camera if this is the only visible dataset.
|
||||
pqView* pqPreferredView = smmodel->findItem<pqView*>(preferredView);
|
||||
Q_ASSERT(pqPreferredView);
|
||||
if (preferredView != currentViewProxy)
|
||||
{
|
||||
// implying a new view was created, always reset that.
|
||||
pqPreferredView->resetDisplay();
|
||||
}
|
||||
else if (view && view->getNumberOfVisibleDataRepresentations() == 1)
|
||||
{
|
||||
// old view is being used, reset only if this is the only representation.
|
||||
view->resetDisplay();
|
||||
}
|
||||
|
||||
// reset interaction mode for render views. Not a huge fan, but we'll fix
|
||||
// this some other time.
|
||||
if (pqRenderView* rview = qobject_cast<pqRenderView*>(pqPreferredView))
|
||||
{
|
||||
if (rview->getNumberOfVisibleDataRepresentations() == 1)
|
||||
{
|
||||
rview->updateInteractionMode(source->getOutputPort(outputPort));
|
||||
}
|
||||
}
|
||||
|
||||
if (preferredView == currentViewProxy)
|
||||
{
|
||||
// Hide input, since the data wasn't shown in a new view, but an existing
|
||||
// view.
|
||||
if (pqPipelineFilter *filter = qobject_cast<pqPipelineFilter *>(source))
|
||||
{
|
||||
this->hideInputIfRequired(filter, view);
|
||||
}
|
||||
}
|
||||
|
||||
vtkSMRepresentationProxy* reprProxy = preferredView->FindRepresentation(
|
||||
source->getSourceProxy(), outputPort);
|
||||
// show scalar bar, if applicable.
|
||||
vtkPVGeneralSettings* gsettings = vtkPVGeneralSettings::GetInstance();
|
||||
if (gsettings->GetScalarBarMode() ==
|
||||
vtkPVGeneralSettings::AUTOMATICALLY_SHOW_AND_HIDE_SCALAR_BARS)
|
||||
{
|
||||
if (vtkSMPVRepresentationProxy::GetUsingScalarColoring(reprProxy))
|
||||
{
|
||||
vtkSMPVRepresentationProxy::SetScalarBarVisibility(reprProxy, preferredView, true);
|
||||
}
|
||||
}
|
||||
|
||||
// Save the newly created representation for further fine-tuning in
|
||||
// pqApplyBehavior::applied().
|
||||
this->Internals->NewlyCreatedRepresentations.push_back(
|
||||
pqInternals::PairType(reprProxy, preferredView));
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqApplyBehavior::hideInputIfRequired(pqPipelineFilter* filter, pqView* view)
|
||||
{
|
||||
int replace_input = filter->replaceInput();
|
||||
if (replace_input > 0)
|
||||
{
|
||||
vtkNew<vtkSMParaViewPipelineControllerWithRendering> controller;
|
||||
|
||||
// hide input source.
|
||||
QList<pqOutputPort*> inputs = filter->getAllInputs();
|
||||
foreach (pqOutputPort* input, inputs)
|
||||
{
|
||||
pqDataRepresentation* inputRepr = input->getRepresentation(view);
|
||||
if (inputRepr)
|
||||
{
|
||||
if (replace_input == 2)
|
||||
{
|
||||
// Conditionally turn off the input. The input should be turned
|
||||
// off if the representation is surface and the opacity is 1.
|
||||
QString reprType = vtkSMPropertyHelper(
|
||||
inputRepr->getProxy(), "Representation", /*quiet=*/ true).GetAsString();
|
||||
double opacity = vtkSMPropertyHelper(
|
||||
inputRepr->getProxy(), "Opacity", /*quiet=*/ true).GetAsDouble();
|
||||
if ((reprType != "Surface" && reprType != "Surface With Edges") ||
|
||||
(opacity != 0.0 && opacity < 1.0))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// we use the controller API so that the scalar bars are updated as
|
||||
// needed.
|
||||
controller->SetVisibility(input->getSourceProxy(),
|
||||
input->getPortNumber(), view->getViewProxy(), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
83
ParaView-5.0.1/Qt/ApplicationComponents/pqApplyBehavior.h
Normal file
83
ParaView-5.0.1/Qt/ApplicationComponents/pqApplyBehavior.h
Normal file
@ -0,0 +1,83 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqApplyBehavior.h
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqApplyBehavior_h
|
||||
#define pqApplyBehavior_h
|
||||
|
||||
#include <QObject>
|
||||
#include <QScopedPointer>
|
||||
#include "pqApplicationComponentsModule.h"
|
||||
|
||||
class pqPipelineFilter;
|
||||
class pqPipelineSource;
|
||||
class pqPropertiesPanel;
|
||||
class pqProxy;
|
||||
class pqView;
|
||||
|
||||
/// @ingroup Behaviors
|
||||
/// pqApplyBehavior collects the logic that needs to happen after the user hits
|
||||
/// "Apply" on the pqPropertiesPanel. Since "Apply" is an important concept in
|
||||
/// ParaView application, it gets its own behavior so applications can customize
|
||||
/// it, if needed.
|
||||
///
|
||||
/// For pqApplyBehavior to work, one needs to manually register
|
||||
/// pqPropertiesPanel instance(s). pqParaViewBehaviors does that automatically
|
||||
/// for pqPropertiesPanel instances available during the startup.
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqApplyBehavior : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef QObject Superclass;
|
||||
public:
|
||||
pqApplyBehavior(QObject* parent=0);
|
||||
virtual ~pqApplyBehavior();
|
||||
|
||||
/// Register/unregister pqPropertiesPanel instances to monitor.
|
||||
void registerPanel(pqPropertiesPanel* panel);
|
||||
void unregisterPanel(pqPropertiesPanel* panel);
|
||||
protected slots:
|
||||
virtual void applied(pqPropertiesPanel*, pqProxy*);
|
||||
virtual void applied(pqPropertiesPanel*);
|
||||
|
||||
private slots:
|
||||
void onApplied(pqProxy*);
|
||||
void onApplied();
|
||||
|
||||
protected:
|
||||
virtual void showData(pqPipelineSource* source, pqView* view);
|
||||
void hideInputIfRequired(pqPipelineFilter* filter, pqView* view);
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqApplyBehavior);
|
||||
class pqInternals;
|
||||
const QScopedPointer<pqInternals> Internals;
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,75 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqAutoApplyReaction.cxx
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqAutoApplyReaction.h"
|
||||
|
||||
#include "pqCoreUtilities.h"
|
||||
#include "vtkCommand.h"
|
||||
#include "vtkPVGeneralSettings.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqAutoApplyReaction::pqAutoApplyReaction(QAction* parentObject)
|
||||
: Superclass(parentObject)
|
||||
{
|
||||
parentObject->setChecked(this->autoApply());
|
||||
QObject::connect(parentObject, SIGNAL(triggered(bool)),
|
||||
this, SLOT(checkStateChanged(bool)));
|
||||
|
||||
vtkPVGeneralSettings* gs = vtkPVGeneralSettings::GetInstance();
|
||||
pqCoreUtilities::connect(gs, vtkCommand::ModifiedEvent,
|
||||
this, SLOT(updateState()));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqAutoApplyReaction::checkStateChanged(bool autoAccept)
|
||||
{
|
||||
pqAutoApplyReaction::setAutoApply(autoAccept);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool pqAutoApplyReaction::autoApply()
|
||||
{
|
||||
return vtkPVGeneralSettings::GetInstance()->GetAutoApply();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqAutoApplyReaction::setAutoApply(bool autoAccept)
|
||||
{
|
||||
vtkPVGeneralSettings::GetInstance()->SetAutoApply(autoAccept);
|
||||
// FIXME: How should this change be saved in vtkSMSettings?
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqAutoApplyReaction::updateState()
|
||||
{
|
||||
vtkPVGeneralSettings* gs = vtkPVGeneralSettings::GetInstance();
|
||||
this->parentAction()->setChecked(gs->GetAutoApply());
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqAutoApplyReaction.h
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqAutoApplyReaction_h
|
||||
#define pqAutoApplyReaction_h
|
||||
|
||||
#include "pqReaction.h"
|
||||
|
||||
/// @ingroup Reactions
|
||||
/// Reaction for enabling/disabling auto-apply.
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqAutoApplyReaction : public pqReaction
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef pqReaction Superclass;
|
||||
public:
|
||||
pqAutoApplyReaction(QAction* parent=0);
|
||||
|
||||
/// Set the status of auto-apply.
|
||||
static void setAutoApply(bool);
|
||||
|
||||
/// Get the status of auto-apply.
|
||||
static bool autoApply();
|
||||
|
||||
protected slots:
|
||||
void updateState();
|
||||
void checkStateChanged(bool);
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqAutoApplyReaction)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@ -0,0 +1,115 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqAutoLoadPluginXMLBehavior.cxx
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqAutoLoadPluginXMLBehavior.h"
|
||||
|
||||
#include "pqApplicationCore.h"
|
||||
#include "pqPluginManager.h"
|
||||
#include "vtkPVPlugin.h"
|
||||
#include "vtkPVPluginTracker.h"
|
||||
#include "vtkPVServerManagerPluginInterface.h"
|
||||
|
||||
#include <QDir>
|
||||
#include "vtkObject.h"
|
||||
|
||||
void getAllParaViewResourcesDirs(const QString& prefix, QSet<QString>& set)
|
||||
{
|
||||
QDir dir(prefix);
|
||||
if (!dir.exists())
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (prefix.endsWith("/ParaViewResources"))
|
||||
{
|
||||
QStringList contents = dir.entryList(QDir::Files);
|
||||
foreach (QString file, contents)
|
||||
{
|
||||
set.insert(prefix + "/" + file);
|
||||
}
|
||||
return;
|
||||
}
|
||||
QStringList contents = dir.entryList(QDir::AllDirs);
|
||||
foreach (QString sub_dir, contents)
|
||||
{
|
||||
getAllParaViewResourcesDirs(prefix + "/" + sub_dir, set);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqAutoLoadPluginXMLBehavior::pqAutoLoadPluginXMLBehavior(QObject* parentObject)
|
||||
: Superclass(parentObject)
|
||||
{
|
||||
QObject::connect(pqApplicationCore::instance()->getPluginManager(),
|
||||
SIGNAL(pluginsUpdated()),
|
||||
this, SLOT(updateResources()));
|
||||
this->updateResources();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqAutoLoadPluginXMLBehavior::updateResources()
|
||||
{
|
||||
QSet<QString> xml_files;
|
||||
::getAllParaViewResourcesDirs(":", xml_files);
|
||||
|
||||
foreach (QString dir, xml_files)
|
||||
{
|
||||
if (!this->PreviouslyParsedResources.contains(dir))
|
||||
{
|
||||
pqApplicationCore::instance()->loadConfiguration(dir);
|
||||
this->PreviouslyParsedResources.insert(dir);
|
||||
}
|
||||
}
|
||||
|
||||
// Plugins can also embed gui configuration XMLs.
|
||||
vtkPVPluginTracker* tracker = vtkPVPluginTracker::GetInstance();
|
||||
for (unsigned int cc=0; cc < tracker->GetNumberOfPlugins(); cc++)
|
||||
{
|
||||
vtkPVPlugin* plugin = tracker->GetPlugin(cc);
|
||||
if (plugin &&
|
||||
strcmp(plugin->GetPluginName(), "vtkPVInitializerPlugin") != 0 &&
|
||||
!this->PreviouslyParsedPlugins.contains(plugin->GetPluginName()))
|
||||
{
|
||||
this->PreviouslyParsedPlugins.insert(plugin->GetPluginName());
|
||||
vtkPVServerManagerPluginInterface* smplugin =
|
||||
dynamic_cast<vtkPVServerManagerPluginInterface*>(plugin);
|
||||
if (smplugin)
|
||||
{
|
||||
std::vector<std::string> xmls;
|
||||
smplugin->GetXMLs(xmls);
|
||||
for (size_t kk=0; kk < xmls.size(); kk++)
|
||||
{
|
||||
pqApplicationCore::instance()->loadConfigurationXML(
|
||||
xmls[kk].c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqAutoLoadPluginXMLBehavior.h
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqAutoLoadPluginXMLBehavior_h
|
||||
#define pqAutoLoadPluginXMLBehavior_h
|
||||
|
||||
#include <QObject>
|
||||
#include <QSet>
|
||||
#include "pqApplicationComponentsModule.h"
|
||||
|
||||
/// @ingroup Behaviors
|
||||
///
|
||||
/// ParaView plugins can load gui configuration xmls eg. xmls for defining the
|
||||
/// filters menu, readers etc. This behavior ensures that as soon as such
|
||||
/// plugins are loaded if they provide any XMLs in the ":/.*/ParaViewResources/"
|
||||
/// resource location, then such xmls are parsed and an attempt is made to load
|
||||
/// them (by calling pqApplicationCore::loadConfiguration()).
|
||||
///
|
||||
/// Without going into too much detail, if you want your application to
|
||||
/// automatically load GUI configuration XMLs from plugins, instantiate this
|
||||
/// behavior.
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqAutoLoadPluginXMLBehavior : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef QObject Superclass;
|
||||
public:
|
||||
pqAutoLoadPluginXMLBehavior(QObject* parent=0);
|
||||
|
||||
protected slots:
|
||||
void updateResources();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqAutoLoadPluginXMLBehavior)
|
||||
QSet<QString> PreviouslyParsedResources;
|
||||
QSet<QString> PreviouslyParsedPlugins;
|
||||
};
|
||||
|
||||
#endif
|
||||
182
ParaView-5.0.1/Qt/ApplicationComponents/pqAxesToolbar.cxx
Normal file
182
ParaView-5.0.1/Qt/ApplicationComponents/pqAxesToolbar.cxx
Normal file
@ -0,0 +1,182 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqAxesToolbar.cxx
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqAxesToolbar.h"
|
||||
#include "ui_pqAxesToolbar.h"
|
||||
|
||||
#include "pqActiveObjects.h"
|
||||
#include "pqDataRepresentation.h"
|
||||
#include "pqRenderView.h"
|
||||
#include "vtkSMRenderViewProxy.h"
|
||||
#include "pqRenderViewSelectionReaction.h"
|
||||
|
||||
class pqAxesToolbar::pqInternals : public Ui::pqAxesToolbar
|
||||
{
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqAxesToolbar::constructor()
|
||||
{
|
||||
this->Internals = new pqInternals();
|
||||
this->Internals->setupUi(this);
|
||||
|
||||
QObject::connect(&pqActiveObjects::instance(),
|
||||
SIGNAL(viewChanged(pqView*)),
|
||||
this, SLOT(updateEnabledState()),
|
||||
Qt::QueuedConnection);
|
||||
|
||||
QObject::connect(&pqActiveObjects::instance(),
|
||||
SIGNAL(sourceChanged(pqPipelineSource*)),
|
||||
this, SLOT(updateEnabledState()));
|
||||
|
||||
QObject::connect(&pqActiveObjects::instance(),
|
||||
SIGNAL(representationChanged(pqRepresentation*)),
|
||||
this, SLOT(updateEnabledState()));
|
||||
|
||||
QObject::connect(this->Internals->actionShowOrientationAxes,
|
||||
SIGNAL(toggled(bool)), this, SLOT(showOrientationAxes(bool)));
|
||||
|
||||
QObject::connect(this->Internals->actionShowCenterAxes, SIGNAL(toggled(bool)),
|
||||
this, SLOT(showCenterAxes(bool)));
|
||||
|
||||
QObject::connect(this->Internals->actionResetCenter, SIGNAL(triggered()),
|
||||
this, SLOT(resetCenterOfRotationToCenterOfCurrentData()));
|
||||
|
||||
pqRenderViewSelectionReaction* selectionReaction = new
|
||||
pqRenderViewSelectionReaction(
|
||||
this->Internals->actionPickCenter, NULL /* track active view*/,
|
||||
pqRenderViewSelectionReaction::SELECT_CUSTOM_BOX);
|
||||
QObject::connect(
|
||||
selectionReaction, SIGNAL(selectedCustomBox(int, int, int, int)),
|
||||
this, SLOT(pickCenterOfRotation(int, int)));
|
||||
|
||||
this->updateEnabledState();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqAxesToolbar::~pqAxesToolbar()
|
||||
{
|
||||
delete this->Internals;
|
||||
this->Internals = 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqAxesToolbar::updateEnabledState()
|
||||
{
|
||||
pqRenderView* renderView =
|
||||
qobject_cast<pqRenderView*>(pqActiveObjects::instance().activeView());
|
||||
|
||||
this->Internals->actionShowOrientationAxes->setEnabled(renderView != NULL);
|
||||
this->Internals->actionShowOrientationAxes->blockSignals(true);
|
||||
this->Internals->actionShowOrientationAxes->setChecked(
|
||||
renderView? renderView->getOrientationAxesVisibility() : false);
|
||||
this->Internals->actionShowOrientationAxes->blockSignals(false);
|
||||
|
||||
this->Internals->actionShowCenterAxes->setEnabled(renderView != NULL);
|
||||
this->Internals->actionShowCenterAxes->blockSignals(true);
|
||||
this->Internals->actionShowCenterAxes->setChecked(
|
||||
renderView? renderView->getCenterAxesVisibility() : false);
|
||||
this->Internals->actionShowCenterAxes->blockSignals(false);
|
||||
this->Internals->actionResetCenter->setEnabled(
|
||||
pqActiveObjects::instance().activeRepresentation() != NULL);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqAxesToolbar::showOrientationAxes(bool show_axes)
|
||||
{
|
||||
pqRenderView* renderView =
|
||||
qobject_cast<pqRenderView*>(pqActiveObjects::instance().activeView());
|
||||
if (!renderView)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
renderView->setOrientationAxesVisibility(show_axes);
|
||||
renderView->render();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqAxesToolbar::showCenterAxes(bool show_axes)
|
||||
{
|
||||
pqRenderView* renderView =
|
||||
qobject_cast<pqRenderView*>(pqActiveObjects::instance().activeView());
|
||||
if (!renderView)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
renderView->setCenterAxesVisibility(show_axes);
|
||||
renderView->render();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqAxesToolbar::resetCenterOfRotationToCenterOfCurrentData()
|
||||
{
|
||||
pqRenderView* renderView =
|
||||
qobject_cast<pqRenderView*>(pqActiveObjects::instance().activeView());
|
||||
pqDataRepresentation* repr = pqActiveObjects::instance().activeRepresentation();
|
||||
if (!repr || !renderView)
|
||||
{
|
||||
//qDebug() << "Active source not shown in active view. Cannot set center.";
|
||||
return;
|
||||
}
|
||||
|
||||
double bounds[6];
|
||||
if (repr->getDataBounds(bounds))
|
||||
{
|
||||
double center[3];
|
||||
center[0] = (bounds[1]+bounds[0])/2.0;
|
||||
center[1] = (bounds[3]+bounds[2])/2.0;
|
||||
center[2] = (bounds[5]+bounds[4])/2.0;
|
||||
renderView->setCenterOfRotation(center);
|
||||
renderView->render();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqAxesToolbar::pickCenterOfRotation(int posx, int posy)
|
||||
{
|
||||
pqRenderView* rm = qobject_cast<pqRenderView*>(
|
||||
pqActiveObjects::instance().activeView());
|
||||
if (rm)
|
||||
{
|
||||
int posxy[2] = {posx, posy};
|
||||
double center[3];
|
||||
|
||||
vtkSMRenderViewProxy* proxy = rm->getRenderViewProxy();
|
||||
if (proxy->ConvertDisplayToPointOnSurface(posxy, center))
|
||||
{
|
||||
rm->setCenterOfRotation(center);
|
||||
rm->render();
|
||||
}
|
||||
}
|
||||
}
|
||||
72
ParaView-5.0.1/Qt/ApplicationComponents/pqAxesToolbar.h
Normal file
72
ParaView-5.0.1/Qt/ApplicationComponents/pqAxesToolbar.h
Normal file
@ -0,0 +1,72 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqAxesToolbar.h
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqAxesToolbar_h
|
||||
#define pqAxesToolbar_h
|
||||
|
||||
#include <QToolBar>
|
||||
#include "pqApplicationComponentsModule.h"
|
||||
|
||||
/// pqAxesToolbar is the toolbar that has buttons for setting the center
|
||||
/// rotation axes, toggling its visibility etc.
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqAxesToolbar : public QToolBar
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef QToolBar Superclass;
|
||||
public:
|
||||
pqAxesToolbar(const QString& title, QWidget* parentObject=0)
|
||||
: Superclass(title, parentObject)
|
||||
{
|
||||
this->constructor();
|
||||
}
|
||||
pqAxesToolbar(QWidget* parentObject=0)
|
||||
: Superclass(parentObject)
|
||||
{
|
||||
this->constructor();
|
||||
}
|
||||
~pqAxesToolbar();
|
||||
|
||||
protected slots:
|
||||
void updateEnabledState();
|
||||
void showCenterAxes(bool);
|
||||
void showOrientationAxes(bool);
|
||||
void resetCenterOfRotationToCenterOfCurrentData();
|
||||
void pickCenterOfRotation(int, int);
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqAxesToolbar)
|
||||
|
||||
class pqInternals;
|
||||
pqInternals* Internals;
|
||||
void constructor();
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,251 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqBackgroundEditorWidget.cxx
|
||||
|
||||
Copyright (c) 2005-2012 Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=========================================================================*/
|
||||
|
||||
#include "pqBackgroundEditorWidget.h"
|
||||
#include "ui_pqBackgroundEditorWidget.h"
|
||||
|
||||
#include <QGridLayout>
|
||||
#include <QPushButton>
|
||||
|
||||
#include "pqPropertiesPanel.h"
|
||||
#include "pqPropertyManager.h"
|
||||
#include "pqProxy.h"
|
||||
#include "pqRenderView.h"
|
||||
#include "pqUndoStack.h"
|
||||
#include "vtkSMProperty.h"
|
||||
#include "vtkSMPropertyGroup.h"
|
||||
#include "vtkSMProxy.h"
|
||||
|
||||
const char* COLOR_PROPERTY = "Background";
|
||||
const char* COLOR2_PROPERTY = "Background2";
|
||||
const char* GRADIENT_BACKGROUND_PROPERTY = "UseGradientBackground";
|
||||
const char* IMAGE_BACKGROUND_PROPERTY = "UseTexturedBackground";
|
||||
const char* IMAGE_PROPERTY = "BackgroundTexture";
|
||||
|
||||
enum BackgroundType
|
||||
{
|
||||
SINGLE_COLOR_TYPE,
|
||||
GRADIENT_TYPE,
|
||||
IMAGE_TYPE,
|
||||
TYPE_COUNT
|
||||
};
|
||||
|
||||
enum BackgroundTypeEncoding
|
||||
{
|
||||
GRADIENT_TYPE_ENCODING,
|
||||
IMAGE_TYPE_ENCODING,
|
||||
TYPE_ENCODING_COUNT
|
||||
};
|
||||
|
||||
class pqBackgroundEditorWidget::pqInternal : public Ui::BackgroundEditorWidget
|
||||
{
|
||||
public:
|
||||
enum BackgroundType PreviousType;
|
||||
|
||||
pqInternal(pqBackgroundEditorWidget* self) :
|
||||
PreviousType (SINGLE_COLOR_TYPE)
|
||||
{
|
||||
this->setupUi (self);
|
||||
this->mainLayout->setMargin(pqPropertiesPanel::suggestedMargin());
|
||||
this->mainLayout->setSpacing(
|
||||
pqPropertiesPanel::suggestedVerticalSpacing());
|
||||
this->page1Layout->setMargin(pqPropertiesPanel::suggestedMargin());
|
||||
this->page1Layout->setHorizontalSpacing(
|
||||
pqPropertiesPanel::suggestedHorizontalSpacing());
|
||||
this->page1Layout->setVerticalSpacing(
|
||||
pqPropertiesPanel::suggestedVerticalSpacing());
|
||||
this->page3Layout->setMargin(pqPropertiesPanel::suggestedMargin());
|
||||
this->page3Layout->setSpacing(
|
||||
pqPropertiesPanel::suggestedVerticalSpacing());
|
||||
}
|
||||
};
|
||||
|
||||
pqBackgroundEditorWidget::pqBackgroundEditorWidget(
|
||||
vtkSMProxy* smProxy, vtkSMPropertyGroup* smGroup, QWidget* parentObject)
|
||||
: Superclass(smProxy, smGroup, parentObject),
|
||||
Internal (new pqInternal (this))
|
||||
{
|
||||
Ui::BackgroundEditorWidget &ui = *this->Internal;
|
||||
connect (ui.BackgroundType, SIGNAL(currentIndexChanged(int)),
|
||||
this, SLOT(currentIndexChangedBackgroundType(int)));
|
||||
connect (ui.RestoreDefaultColor,
|
||||
SIGNAL(clicked()), this, SLOT(clickedRestoreDefaultColor()));
|
||||
connect (ui.RestoreDefaultColor2,
|
||||
SIGNAL(clicked()), this, SLOT(clickedRestoreDefaultColor2()));
|
||||
|
||||
|
||||
this->addPropertyLink(ui.Color, COLOR_PROPERTY);
|
||||
this->addPropertyLink(ui.Color2, COLOR2_PROPERTY);
|
||||
|
||||
vtkSMProperty* smProperty =
|
||||
smGroup->GetProperty(GRADIENT_BACKGROUND_PROPERTY);
|
||||
if (smProperty)
|
||||
{
|
||||
this->addPropertyLink(
|
||||
this, "gradientBackground", SIGNAL(gradientBackgroundChanged()),
|
||||
smProperty);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.BackgroundType->hide();
|
||||
}
|
||||
|
||||
smProperty = smGroup->GetProperty(IMAGE_BACKGROUND_PROPERTY);
|
||||
if (smProperty)
|
||||
{
|
||||
this->addPropertyLink(
|
||||
this, "imageBackground", SIGNAL(imageBackgroundChanged()),
|
||||
smProperty);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.BackgroundType->hide();
|
||||
}
|
||||
currentIndexChangedBackgroundType(this->Internal->PreviousType);
|
||||
}
|
||||
|
||||
pqBackgroundEditorWidget::~pqBackgroundEditorWidget()
|
||||
{
|
||||
delete this->Internal;
|
||||
this->Internal = 0;
|
||||
}
|
||||
|
||||
void pqBackgroundEditorWidget::currentIndexChangedBackgroundType(int type)
|
||||
{
|
||||
const int ROWS = 3;
|
||||
const int COLS = 2;
|
||||
Ui::BackgroundEditorWidget &ui = *this->Internal;
|
||||
const char* colorButtonName[TYPE_COUNT] = {"Color", "Color 1", "Color"};
|
||||
int currentPage[TYPE_COUNT] = {0, 0, 1};
|
||||
bool visibleControls[TYPE_COUNT][ROWS] =
|
||||
{{true, false, false},
|
||||
{true, true, false},
|
||||
{false, false, true}};
|
||||
QWidget* controls[ROWS][COLS] = {{ui.Color, ui.RestoreDefaultColor},
|
||||
{ui.Color2, ui.RestoreDefaultColor2},
|
||||
{ui.Image, 0}};
|
||||
for (int i = 0; i < ROWS; ++i)
|
||||
{
|
||||
for (int j = 0; j < COLS; ++j)
|
||||
{
|
||||
QWidget* control = controls[i][j];
|
||||
if (control)
|
||||
{
|
||||
control->setVisible(visibleControls[type][i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
ui.stackedWidget->setCurrentIndex(currentPage[type]);
|
||||
ui.Color->setText (colorButtonName[type]);
|
||||
fireGradientAndImageChanged(this->Internal->PreviousType, type);
|
||||
this->Internal->PreviousType = BackgroundType (type);
|
||||
}
|
||||
|
||||
bool pqBackgroundEditorWidget::gradientBackground() const
|
||||
{
|
||||
return this->Internal->BackgroundType->currentIndex () == GRADIENT_TYPE;
|
||||
}
|
||||
|
||||
void pqBackgroundEditorWidget::setGradientBackground(bool gradientValue)
|
||||
{
|
||||
enum BackgroundType typeFunction[TYPE_COUNT][2] =
|
||||
{{SINGLE_COLOR_TYPE, GRADIENT_TYPE},
|
||||
{SINGLE_COLOR_TYPE, GRADIENT_TYPE},
|
||||
{IMAGE_TYPE, GRADIENT_TYPE}}; // gradient has precendece over image
|
||||
int newType = typeFunction[this->Internal->PreviousType][gradientValue];
|
||||
fireGradientAndImageChanged(this->Internal->PreviousType, newType);
|
||||
this->Internal->BackgroundType->setCurrentIndex(newType);
|
||||
}
|
||||
|
||||
bool pqBackgroundEditorWidget::imageBackground() const
|
||||
{
|
||||
return this->Internal->BackgroundType->currentIndex () == IMAGE_TYPE;
|
||||
}
|
||||
|
||||
void pqBackgroundEditorWidget::setImageBackground(bool imageValue)
|
||||
{
|
||||
enum BackgroundType typeFunction[TYPE_COUNT][2] =
|
||||
{{SINGLE_COLOR_TYPE, IMAGE_TYPE},
|
||||
{GRADIENT_TYPE, GRADIENT_TYPE}, // gradient has precendece over image
|
||||
{SINGLE_COLOR_TYPE, IMAGE_TYPE}};
|
||||
enum BackgroundType newType =
|
||||
typeFunction[this->Internal->PreviousType][imageValue];
|
||||
fireGradientAndImageChanged(this->Internal->PreviousType, newType);
|
||||
this->Internal->BackgroundType->setCurrentIndex(newType);
|
||||
}
|
||||
|
||||
void pqBackgroundEditorWidget::fireGradientAndImageChanged(
|
||||
int oldType, int newType)
|
||||
{
|
||||
bool gradientChanged[TYPE_COUNT][TYPE_COUNT] =
|
||||
{{false, true, false},
|
||||
{true, false, true},
|
||||
{false, true, false}};
|
||||
bool imageChanged[TYPE_COUNT][TYPE_COUNT] =
|
||||
{{false, false, true},
|
||||
{false, false, true},
|
||||
{true, true, false}};
|
||||
if (gradientChanged[oldType][newType])
|
||||
{
|
||||
emit gradientBackgroundChanged();
|
||||
}
|
||||
if (imageChanged[oldType][newType])
|
||||
{
|
||||
emit imageBackgroundChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void pqBackgroundEditorWidget::setView (pqView *_view)
|
||||
{
|
||||
this->Internal->Image->setRenderView(qobject_cast<pqRenderView*>(_view));
|
||||
}
|
||||
|
||||
void pqBackgroundEditorWidget::clickedRestoreDefaultColor()
|
||||
{
|
||||
this->changeColor (COLOR_PROPERTY);
|
||||
}
|
||||
|
||||
void pqBackgroundEditorWidget::clickedRestoreDefaultColor2()
|
||||
{
|
||||
this->changeColor (COLOR2_PROPERTY);
|
||||
}
|
||||
|
||||
|
||||
void pqBackgroundEditorWidget::changeColor(const char* propertyName)
|
||||
{
|
||||
vtkSMProperty* _property =
|
||||
this->propertyGroup ()->GetProperty(propertyName);
|
||||
BEGIN_UNDO_SET("Restore Default Color");
|
||||
_property->ResetToDefault();
|
||||
emit this->changeFinished();
|
||||
END_UNDO_SET();
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqBackgroundEditorWidget.h
|
||||
|
||||
Copyright (c) 2005-2012 Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=========================================================================*/
|
||||
|
||||
#ifndef _pqBackgroundEditorWidget_h
|
||||
#define _pqBackgroundEditorWidget_h
|
||||
|
||||
#include "pqApplicationComponentsModule.h"
|
||||
#include "pqPropertyGroupWidget.h"
|
||||
|
||||
class vtkSMProxy;
|
||||
class vtkSMPropertyGroup;
|
||||
|
||||
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqBackgroundEditorWidget :
|
||||
public pqPropertyGroupWidget
|
||||
{
|
||||
public:
|
||||
pqBackgroundEditorWidget(
|
||||
vtkSMProxy* smproxy, vtkSMPropertyGroup* smgroup,
|
||||
QWidget* parentObject = 0);
|
||||
~pqBackgroundEditorWidget();
|
||||
|
||||
bool gradientBackground() const;
|
||||
void setGradientBackground(bool gradientBackground);
|
||||
bool imageBackground() const;
|
||||
void setImageBackground(bool imageBackground);
|
||||
|
||||
|
||||
signals:
|
||||
void gradientBackgroundChanged();
|
||||
void imageBackgroundChanged();
|
||||
|
||||
public slots:
|
||||
void setView (pqView *newView);
|
||||
|
||||
protected slots:
|
||||
void currentIndexChangedBackgroundType(int type);
|
||||
void clickedRestoreDefaultColor();
|
||||
void clickedRestoreDefaultColor2();
|
||||
|
||||
private:
|
||||
typedef pqPropertyGroupWidget Superclass;
|
||||
|
||||
private:
|
||||
void changeColor(const char* propertyName);
|
||||
void fireGradientAndImageChanged(int oldType, int newType);
|
||||
|
||||
private:
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool gradientBackground READ gradientBackground
|
||||
WRITE setGradientBackground)
|
||||
Q_PROPERTY(bool imageBackground READ imageBackground
|
||||
WRITE setImageBackground)
|
||||
|
||||
class pqInternal;
|
||||
pqInternal* Internal;
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,119 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: $RCSfile$
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqBoolPropertyWidgetDecorator.h"
|
||||
|
||||
#include "pqPropertyWidget.h"
|
||||
#include "vtkCommand.h"
|
||||
#include "vtkPVXMLElement.h"
|
||||
#include "vtkSMProperty.h"
|
||||
#include "vtkSMProxy.h"
|
||||
#include "vtkSMUncheckedPropertyHelper.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqBoolPropertyWidgetDecorator::pqBoolPropertyWidgetDecorator(
|
||||
vtkPVXMLElement* config, pqPropertyWidget* parentObject)
|
||||
: Superclass(config, parentObject),
|
||||
Index(0),
|
||||
ObserverId(0),
|
||||
BoolProperty(true)
|
||||
{
|
||||
vtkSMProxy* proxy = this->parentWidget()->proxy();
|
||||
Q_ASSERT(proxy != NULL);
|
||||
|
||||
for (unsigned int cc=0; cc < config->GetNumberOfNestedElements(); cc++)
|
||||
{
|
||||
vtkPVXMLElement* child = config->GetNestedElement(cc);
|
||||
if (child && child->GetName() &&
|
||||
strcmp(child->GetName(), "Property") == 0 &&
|
||||
child->GetAttribute("name"))
|
||||
{
|
||||
const char* name = child->GetAttribute("name");
|
||||
const char* function = child->GetAttributeOrDefault("function",
|
||||
"boolean");
|
||||
int index = atoi(child->GetAttributeOrDefault("index", "0"));
|
||||
if (strcmp(function, "boolean") != 0 &&
|
||||
strcmp(function, "boolean_invert") != 0)
|
||||
{
|
||||
qDebug("pqBoolPropertyWidgetDecorator currently only "
|
||||
"supports 'boolean' and 'boolean_invert'.");
|
||||
}
|
||||
|
||||
this->Property = proxy->GetProperty(name);
|
||||
this->Index = index;
|
||||
this->Function = function;
|
||||
|
||||
this->ObserverId = this->Property->AddObserver(
|
||||
vtkCommand::UncheckedPropertyModifiedEvent,
|
||||
this, &pqBoolPropertyWidgetDecorator::updateBoolPropertyState);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this->updateBoolPropertyState();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqBoolPropertyWidgetDecorator::~pqBoolPropertyWidgetDecorator()
|
||||
{
|
||||
if (this->Property && this->ObserverId)
|
||||
{
|
||||
this->Property->RemoveObserver(this->ObserverId);
|
||||
this->ObserverId = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqBoolPropertyWidgetDecorator::updateBoolPropertyState()
|
||||
{
|
||||
if (this->Property && this->Function == "boolean")
|
||||
{
|
||||
bool enabled = vtkSMUncheckedPropertyHelper(
|
||||
this->Property).GetAsInt(this->Index) != 0;
|
||||
this->setBoolProperty(enabled);
|
||||
}
|
||||
if (this->Property && this->Function == "boolean_invert")
|
||||
{
|
||||
bool enabled = vtkSMUncheckedPropertyHelper(
|
||||
this->Property).GetAsInt(this->Index) != 0;
|
||||
this->setBoolProperty(!enabled);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqBoolPropertyWidgetDecorator::setBoolProperty(bool val)
|
||||
{
|
||||
if (this->BoolProperty != val)
|
||||
{
|
||||
this->BoolProperty = val;
|
||||
emit this->boolPropertyChanged();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,77 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: $RCSfile$
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqBoolPropertyWidgetDecorator_h
|
||||
#define pqBoolPropertyWidgetDecorator_h
|
||||
|
||||
#include "pqApplicationComponentsModule.h"
|
||||
#include "pqPropertyWidgetDecorator.h"
|
||||
#include "vtkWeakPointer.h"
|
||||
|
||||
|
||||
/// pqBoolPropertyWidgetDecorator is a base class for enable/disable
|
||||
/// or show/hide widgets based on the status of another property not
|
||||
/// directly controlled by the widget.
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqBoolPropertyWidgetDecorator :
|
||||
public pqPropertyWidgetDecorator
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef pqPropertyWidgetDecorator Superclass;
|
||||
public:
|
||||
pqBoolPropertyWidgetDecorator(
|
||||
vtkPVXMLElement* config, pqPropertyWidget* parent);
|
||||
virtual ~pqBoolPropertyWidgetDecorator();
|
||||
|
||||
bool isBoolProperty() const
|
||||
{
|
||||
return this->BoolProperty;
|
||||
}
|
||||
|
||||
signals:
|
||||
void boolPropertyChanged();
|
||||
|
||||
protected:
|
||||
vtkWeakPointer<vtkSMProperty> Property;
|
||||
QString Function;
|
||||
int Index;
|
||||
unsigned long ObserverId;
|
||||
bool BoolProperty;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqBoolPropertyWidgetDecorator);
|
||||
|
||||
/// updates the enabled state.
|
||||
void updateBoolPropertyState();
|
||||
/// update this->BoolProperty and fires boolPropertyChanged
|
||||
void setBoolProperty(bool val);
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,85 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: $RCSfile$
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqCTHArraySelectionDecorator.h"
|
||||
|
||||
#include "pqPropertyWidget.h"
|
||||
#include "vtkSMProperty.h"
|
||||
#include "vtkSMProxy.h"
|
||||
#include "vtkSMUncheckedPropertyHelper.h"
|
||||
#include "vtkPVXMLElement.h"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqCTHArraySelectionDecorator::pqCTHArraySelectionDecorator(
|
||||
vtkPVXMLElement* config, pqPropertyWidget* parentObject)
|
||||
: Superclass(config, parentObject)
|
||||
{
|
||||
QObject::connect(parentObject, SIGNAL(changeFinished()),
|
||||
this, SLOT(updateSelection()));
|
||||
|
||||
// Scan the config to determine the names of the other selection properties.
|
||||
for (unsigned int cc=0; cc < config->GetNumberOfNestedElements(); cc++)
|
||||
{
|
||||
vtkPVXMLElement* child = config->GetNestedElement(cc);
|
||||
if (child && child->GetName() &&
|
||||
strcmp(child->GetName(), "Property") == 0 &&
|
||||
child->GetAttribute("name"))
|
||||
{
|
||||
this->PropertyNames << child->GetAttribute("name");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqCTHArraySelectionDecorator::~pqCTHArraySelectionDecorator()
|
||||
{
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCTHArraySelectionDecorator::updateSelection()
|
||||
{
|
||||
vtkSMProperty* curProperty = this->parentWidget()->property();
|
||||
vtkSMProxy* proxy = this->parentWidget()->proxy();
|
||||
if (vtkSMUncheckedPropertyHelper(curProperty).GetNumberOfElements() == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (const QString& pname, this->PropertyNames)
|
||||
{
|
||||
vtkSMProperty* prop = proxy->GetProperty(pname.toLatin1().data());
|
||||
if (prop && prop != curProperty)
|
||||
{
|
||||
vtkSMUncheckedPropertyHelper(prop).SetNumberOfElements(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: $RCSfile$
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqCTHArraySelectionDecorator_h
|
||||
#define pqCTHArraySelectionDecorator_h
|
||||
|
||||
#include "pqApplicationComponentsModule.h"
|
||||
#include "pqPropertyWidgetDecorator.h"
|
||||
|
||||
/// pqCTHArraySelectionDecorator is used by ExtractCTH filter (and similar
|
||||
/// filters) to ensure only 1 of the array-selection properties is set at any
|
||||
/// given time. When the user changes the state of a selection property,
|
||||
/// selections on other properties are cleared.
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqCTHArraySelectionDecorator :
|
||||
public pqPropertyWidgetDecorator
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef pqPropertyWidgetDecorator Superclass;
|
||||
public:
|
||||
pqCTHArraySelectionDecorator(vtkPVXMLElement* config, pqPropertyWidget* parent);
|
||||
virtual ~pqCTHArraySelectionDecorator();
|
||||
|
||||
private slots:
|
||||
void updateSelection();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqCTHArraySelectionDecorator)
|
||||
QStringList PropertyNames;
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,69 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqCameraLinkReaction.cxx
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqCameraLinkReaction.h"
|
||||
|
||||
#include "pqActiveObjects.h"
|
||||
#include "pqRenderView.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqCameraLinkReaction::pqCameraLinkReaction(QAction* parentObject)
|
||||
: Superclass(parentObject)
|
||||
{
|
||||
QObject::connect(&pqActiveObjects::instance(), SIGNAL(viewChanged(pqView*)),
|
||||
this, SLOT(updateEnableState()), Qt::QueuedConnection);
|
||||
this->updateEnableState();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCameraLinkReaction::updateEnableState()
|
||||
{
|
||||
this->parentAction()->setEnabled(
|
||||
qobject_cast<pqRenderView*>(pqActiveObjects::instance().activeView()) !=
|
||||
NULL && this->IsMaster);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCameraLinkReaction::addCameraLink()
|
||||
{
|
||||
pqRenderView* rm = qobject_cast<pqRenderView*>(
|
||||
pqActiveObjects::instance().activeView());
|
||||
if (rm)
|
||||
{
|
||||
rm->linkToOtherView();
|
||||
}
|
||||
else
|
||||
{
|
||||
qCritical() << "No render module is active";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqCameraLinkReaction.h
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqCameraLinkReaction_h
|
||||
#define pqCameraLinkReaction_h
|
||||
|
||||
#include "pqReaction.h"
|
||||
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqCameraLinkReaction : public pqReaction
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef pqReaction Superclass;
|
||||
public:
|
||||
pqCameraLinkReaction(QAction* parent);
|
||||
|
||||
/// Adds camera link with the active view.
|
||||
static void addCameraLink();
|
||||
|
||||
public slots:
|
||||
/// Updates the enabled state. Applications need not explicitly call
|
||||
/// this.
|
||||
void updateEnableState();
|
||||
|
||||
protected:
|
||||
/// Called when the action is triggered.
|
||||
virtual void onTriggered()
|
||||
{ pqCameraLinkReaction::addCameraLink(); }
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqCameraLinkReaction)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@ -0,0 +1,202 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqCameraManipulatorWidget.cxx
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqCameraManipulatorWidget.h"
|
||||
#include "ui_pqCameraManipulatorWidget.h"
|
||||
|
||||
#include "pqPropertiesPanel.h"
|
||||
#include "pqPropertyLinks.h"
|
||||
#include "pqPropertyLinksConnection.h"
|
||||
#include "vtkSMEnumerationDomain.h"
|
||||
#include "vtkSMProperty.h"
|
||||
#include "vtkSMUncheckedPropertyHelper.h"
|
||||
|
||||
|
||||
class pqCameraManipulatorWidget::PropertyLinksConnection : public pqPropertyLinksConnection
|
||||
{
|
||||
typedef pqPropertyLinksConnection Superclass;
|
||||
public:
|
||||
PropertyLinksConnection(
|
||||
QObject* qobject, const char* qproperty, const char* qsignal,
|
||||
vtkSMProxy* smproxy, vtkSMProperty* smproperty, int smindex,
|
||||
bool use_unchecked_modified_event,
|
||||
QObject* parentObject=0)
|
||||
: Superclass(qobject, qproperty, qsignal,
|
||||
smproxy, smproperty, smindex, use_unchecked_modified_event,
|
||||
parentObject)
|
||||
{
|
||||
}
|
||||
virtual ~PropertyLinksConnection()
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
/// Called to update the ServerManager Property due to UI change.
|
||||
virtual void setServerManagerValue(bool use_unchecked, const QVariant& value)
|
||||
{
|
||||
QList<QVariant> list = value.toList();
|
||||
|
||||
Q_ASSERT(list.size() == 9);
|
||||
int values[9];
|
||||
for (int cc=0; cc < 9; cc++)
|
||||
{
|
||||
values[cc] = list[cc].toInt();
|
||||
}
|
||||
if (use_unchecked)
|
||||
{
|
||||
vtkSMUncheckedPropertyHelper(this->propertySM()).Set(values, 9);
|
||||
}
|
||||
else
|
||||
{
|
||||
vtkSMPropertyHelper(this->propertySM()).Set(values, 9);
|
||||
}
|
||||
}
|
||||
|
||||
/// called to get the current value for the ServerManager Property.
|
||||
virtual QVariant currentServerManagerValue(bool use_unchecked) const
|
||||
{
|
||||
int values[9];
|
||||
int max = 0;
|
||||
if (use_unchecked)
|
||||
{
|
||||
max = vtkSMUncheckedPropertyHelper(this->propertySM()).Get(values, 9);
|
||||
}
|
||||
else
|
||||
{
|
||||
max = vtkSMPropertyHelper(this->propertySM()).Get(values, 9);
|
||||
}
|
||||
|
||||
QList<QVariant> val;
|
||||
for (int cc=0; cc < max && cc < 9; cc++)
|
||||
{
|
||||
val << values[cc];
|
||||
}
|
||||
return val;
|
||||
}
|
||||
private:
|
||||
Q_DISABLE_COPY(PropertyLinksConnection);
|
||||
};
|
||||
|
||||
|
||||
class pqCameraManipulatorWidget::pqInternals
|
||||
{
|
||||
public:
|
||||
Ui::CameraManipulatorWidget Ui;
|
||||
QPointer<QComboBox> Boxes[9];
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqCameraManipulatorWidget::pqCameraManipulatorWidget(
|
||||
vtkSMProxy* smproxy, vtkSMProperty* smproperty, QWidget* parentObject)
|
||||
: Superclass(smproxy, parentObject),
|
||||
Internals(new pqInternals())
|
||||
{
|
||||
Ui::CameraManipulatorWidget& ui = this->Internals->Ui;
|
||||
ui.setupUi(this);
|
||||
ui.gridLayout->setVerticalSpacing(pqPropertiesPanel::suggestedVerticalSpacing());
|
||||
ui.gridLayout->setHorizontalSpacing(pqPropertiesPanel::suggestedHorizontalSpacing());
|
||||
ui.gridLayout->setMargin(0);
|
||||
|
||||
QPointer<QComboBox>* boxes = this->Internals->Boxes;
|
||||
boxes[0] = ui.comboBox_1;
|
||||
boxes[1] = ui.comboBox_2;
|
||||
boxes[2] = ui.comboBox_3;
|
||||
boxes[3] = ui.comboBox_4;
|
||||
boxes[4] = ui.comboBox_5;
|
||||
boxes[5] = ui.comboBox_6;
|
||||
boxes[6] = ui.comboBox_7;
|
||||
boxes[7] = ui.comboBox_8;
|
||||
boxes[8] = ui.comboBox_9;
|
||||
|
||||
vtkSMEnumerationDomain* domain = vtkSMEnumerationDomain::SafeDownCast(
|
||||
smproperty->FindDomain("vtkSMEnumerationDomain"));
|
||||
if (!domain)
|
||||
{
|
||||
qCritical("Developer error: pqCameraManipulatorWidget needs vtkSMEnumerationDomain.");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int cc=0; cc < 9; cc++)
|
||||
{
|
||||
for (unsigned int kk=0, max=domain->GetNumberOfEntries(); kk < max; kk++)
|
||||
{
|
||||
boxes[cc]->addItem(domain->GetEntryText(kk), QVariant(domain->GetEntryValue(kk)));
|
||||
}
|
||||
this->connect(boxes[cc], SIGNAL(currentIndexChanged(int)), SIGNAL(manipulatorTypesChanged()));
|
||||
}
|
||||
|
||||
this->links().addPropertyLink<pqCameraManipulatorWidget::PropertyLinksConnection>(
|
||||
this, "manipulatorTypes", SIGNAL(manipulatorTypesChanged()),
|
||||
smproxy, smproperty);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqCameraManipulatorWidget::~pqCameraManipulatorWidget()
|
||||
{
|
||||
delete this->Internals;
|
||||
this->Internals = NULL;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCameraManipulatorWidget::setManipulatorTypes(const QList<QVariant>& value)
|
||||
{
|
||||
QPointer<QComboBox>* boxes = this->Internals->Boxes;
|
||||
for (int cc=0, max=value.size(); cc < 9 && cc < max; cc++)
|
||||
{
|
||||
int index = boxes[cc]->findData(value[cc]);
|
||||
if (index != -1)
|
||||
{
|
||||
boxes[cc]->setCurrentIndex(index);
|
||||
}
|
||||
else
|
||||
{
|
||||
boxes[cc]->setCurrentIndex(1);
|
||||
}
|
||||
}
|
||||
for (int cc=value.size(); cc < 9; cc++)
|
||||
{
|
||||
boxes[cc]->setCurrentIndex(0);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
QList<QVariant> pqCameraManipulatorWidget::manipulatorTypes() const
|
||||
{
|
||||
QList<QVariant> value;
|
||||
|
||||
QPointer<QComboBox>* boxes = this->Internals->Boxes;
|
||||
for (int cc=0; cc < 9; cc++)
|
||||
{
|
||||
value.push_back(
|
||||
boxes[cc]->itemData(boxes[cc]->currentIndex()));
|
||||
}
|
||||
return value;
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqCameraManipulatorWidget.h
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqCameraManipulatorWidget_h
|
||||
#define pqCameraManipulatorWidget_h
|
||||
|
||||
|
||||
#include "pqApplicationComponentsModule.h"
|
||||
#include "pqPropertyWidget.h"
|
||||
|
||||
/// pqCameraManipulatorWidget used on "Camera2DManipulators" and
|
||||
/// "Camera3DManipulators" property on a RenderView proxy.
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqCameraManipulatorWidget :
|
||||
public pqPropertyWidget
|
||||
{
|
||||
Q_OBJECT;
|
||||
typedef pqPropertyWidget Superclass;
|
||||
Q_PROPERTY(QList<QVariant> manipulatorTypes READ manipulatorTypes WRITE setManipulatorTypes);
|
||||
public:
|
||||
pqCameraManipulatorWidget(vtkSMProxy* proxy, vtkSMProperty* smproperty, QWidget* parent=0);
|
||||
virtual ~pqCameraManipulatorWidget();
|
||||
|
||||
/// returns a list for the selected manipulator types. This has exactly 9
|
||||
/// items always.
|
||||
QList<QVariant> manipulatorTypes() const;
|
||||
|
||||
public slots:
|
||||
/// Set the manipulator types selection. This must have exactly 9 items or
|
||||
/// less. Any missing items are treated as "None".
|
||||
void setManipulatorTypes(const QList<QVariant>& value);
|
||||
|
||||
signals:
|
||||
void manipulatorTypesChanged();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqCameraManipulatorWidget);
|
||||
class pqInternals;
|
||||
pqInternals* Internals;
|
||||
class PropertyLinksConnection;
|
||||
};
|
||||
|
||||
#endif
|
||||
197
ParaView-5.0.1/Qt/ApplicationComponents/pqCameraReaction.cxx
Normal file
197
ParaView-5.0.1/Qt/ApplicationComponents/pqCameraReaction.cxx
Normal file
@ -0,0 +1,197 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqCameraReaction.cxx
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqCameraReaction.h"
|
||||
|
||||
#include "pqActiveObjects.h"
|
||||
#include "pqRenderView.h"
|
||||
#include "pqPipelineRepresentation.h"
|
||||
|
||||
#include "vtkPVXMLElement.h"
|
||||
#include "vtkSMRenderViewProxy.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqCameraReaction::pqCameraReaction(QAction* parentObject,
|
||||
pqCameraReaction::Mode mode)
|
||||
: Superclass(parentObject)
|
||||
{
|
||||
this->ReactionMode = mode;
|
||||
QObject::connect(&pqActiveObjects::instance(), SIGNAL(viewChanged(pqView*)),
|
||||
this, SLOT(updateEnableState()), Qt::QueuedConnection);
|
||||
this->updateEnableState();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCameraReaction::updateEnableState()
|
||||
{
|
||||
pqView* view = pqActiveObjects::instance().activeView();
|
||||
pqPipelineSource* source = pqActiveObjects::instance().activeSource();
|
||||
pqRenderView* rview = qobject_cast<pqRenderView*>(view);
|
||||
if (view && this->ReactionMode == RESET_CAMERA)
|
||||
{
|
||||
this->parentAction()->setEnabled(true);
|
||||
}
|
||||
else if (rview)
|
||||
{
|
||||
if(this->ReactionMode == ZOOM_TO_DATA)
|
||||
{
|
||||
this->parentAction()->setEnabled(source != 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check hints to see if actions should be disabled
|
||||
bool cameraResetButtonsEnabled = true;
|
||||
vtkPVXMLElement* hints = rview->getHints();
|
||||
if (hints)
|
||||
{
|
||||
cameraResetButtonsEnabled =
|
||||
hints->FindNestedElementByName("DisableCameraToolbarButtons") == NULL;
|
||||
}
|
||||
|
||||
this->parentAction()->setEnabled(cameraResetButtonsEnabled);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this->parentAction()->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCameraReaction::onTriggered()
|
||||
{
|
||||
switch (this->ReactionMode)
|
||||
{
|
||||
case RESET_CAMERA:
|
||||
this->resetCamera();
|
||||
break;
|
||||
|
||||
case RESET_POSITIVE_X:
|
||||
this->resetPositiveX();
|
||||
break;
|
||||
|
||||
case RESET_POSITIVE_Y:
|
||||
this->resetPositiveY();
|
||||
break;
|
||||
|
||||
case RESET_POSITIVE_Z:
|
||||
this->resetPositiveZ();
|
||||
break;
|
||||
|
||||
case RESET_NEGATIVE_X:
|
||||
this->resetNegativeX();
|
||||
break;
|
||||
|
||||
case RESET_NEGATIVE_Y:
|
||||
this->resetNegativeY();
|
||||
break;
|
||||
case RESET_NEGATIVE_Z:
|
||||
this->resetNegativeZ();
|
||||
break;
|
||||
case ZOOM_TO_DATA:
|
||||
this->zoomToData();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCameraReaction::resetCamera()
|
||||
{
|
||||
pqView* view = pqActiveObjects::instance().activeView();
|
||||
if (view)
|
||||
{
|
||||
view->resetDisplay();
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCameraReaction::resetDirection(
|
||||
double look_x, double look_y, double look_z,
|
||||
double up_x, double up_y, double up_z)
|
||||
{
|
||||
pqRenderView* ren = qobject_cast<pqRenderView*>(
|
||||
pqActiveObjects::instance().activeView());
|
||||
if (ren)
|
||||
{
|
||||
ren->resetViewDirection(look_x, look_y, look_z, up_x, up_y, up_z);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCameraReaction::resetPositiveX()
|
||||
{
|
||||
pqCameraReaction::resetDirection(1, 0, 0, 0, 0, 1);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCameraReaction::resetNegativeX()
|
||||
{
|
||||
pqCameraReaction::resetDirection(-1, 0, 0, 0, 0, 1);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCameraReaction::resetPositiveY()
|
||||
{
|
||||
pqCameraReaction::resetDirection(0, 1, 0, 0, 0, 1);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCameraReaction::resetNegativeY()
|
||||
{
|
||||
pqCameraReaction::resetDirection(0, -1, 0, 0, 0, 1);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCameraReaction::resetPositiveZ()
|
||||
{
|
||||
pqCameraReaction::resetDirection(0, 0, 1, 0, 1, 0);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCameraReaction::resetNegativeZ()
|
||||
{
|
||||
pqCameraReaction::resetDirection(0, 0, -1, 0, 1, 0);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCameraReaction::zoomToData()
|
||||
{
|
||||
pqRenderView* renModule = qobject_cast<pqRenderView*>(
|
||||
pqActiveObjects::instance().activeView());
|
||||
pqPipelineRepresentation *repr = qobject_cast<pqPipelineRepresentation*>(
|
||||
pqActiveObjects::instance().activeRepresentation());
|
||||
if (renModule && repr)
|
||||
{
|
||||
vtkSMRenderViewProxy* rm = renModule->getRenderViewProxy();
|
||||
rm->ZoomTo(repr->getProxy());
|
||||
renModule->render();
|
||||
}
|
||||
}
|
||||
87
ParaView-5.0.1/Qt/ApplicationComponents/pqCameraReaction.h
Normal file
87
ParaView-5.0.1/Qt/ApplicationComponents/pqCameraReaction.h
Normal file
@ -0,0 +1,87 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqCameraReaction.h
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqCameraReaction_h
|
||||
#define pqCameraReaction_h
|
||||
|
||||
#include "pqReaction.h"
|
||||
|
||||
/// @ingroup Reactions
|
||||
/// pqCameraReaction has the logic to handle common operations associated with
|
||||
/// the camera such as reset view along X axis etc.
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqCameraReaction : public pqReaction
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef pqReaction Superclass;
|
||||
public:
|
||||
enum Mode
|
||||
{
|
||||
RESET_CAMERA,
|
||||
RESET_POSITIVE_X,
|
||||
RESET_POSITIVE_Y,
|
||||
RESET_POSITIVE_Z,
|
||||
RESET_NEGATIVE_X,
|
||||
RESET_NEGATIVE_Y,
|
||||
RESET_NEGATIVE_Z,
|
||||
ZOOM_TO_DATA
|
||||
};
|
||||
|
||||
pqCameraReaction(QAction* parent, Mode mode);
|
||||
|
||||
static void resetCamera();
|
||||
static void resetPositiveX();
|
||||
static void resetPositiveY();
|
||||
static void resetPositiveZ();
|
||||
static void resetNegativeX();
|
||||
static void resetNegativeY();
|
||||
static void resetNegativeZ();
|
||||
static void resetDirection(
|
||||
double look_x, double look_y, double look_z,
|
||||
double up_x, double up_y, double up_z);
|
||||
static void zoomToData();
|
||||
|
||||
public slots:
|
||||
/// Updates the enabled state. Applications need not explicitly call
|
||||
/// this.
|
||||
void updateEnableState();
|
||||
|
||||
protected:
|
||||
/// Called when the action is triggered.
|
||||
virtual void onTriggered();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqCameraReaction)
|
||||
Mode ReactionMode;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
71
ParaView-5.0.1/Qt/ApplicationComponents/pqCameraToolbar.cxx
Normal file
71
ParaView-5.0.1/Qt/ApplicationComponents/pqCameraToolbar.cxx
Normal file
@ -0,0 +1,71 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqCameraToolbar.cxx
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqCameraToolbar.h"
|
||||
#include "ui_pqCameraToolbar.h"
|
||||
|
||||
#include "pqActiveObjects.h"
|
||||
#include "pqCameraReaction.h"
|
||||
#include "pqRenderViewSelectionReaction.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCameraToolbar::constructor()
|
||||
{
|
||||
Ui::pqCameraToolbar ui;
|
||||
ui.setupUi(this);
|
||||
new pqCameraReaction(ui.actionResetCamera, pqCameraReaction::RESET_CAMERA);
|
||||
new pqCameraReaction(ui.actionZoomToData, pqCameraReaction::ZOOM_TO_DATA);
|
||||
new pqCameraReaction(ui.actionPositiveX, pqCameraReaction::RESET_POSITIVE_X);
|
||||
new pqCameraReaction(ui.actionNegativeX, pqCameraReaction::RESET_NEGATIVE_X);
|
||||
new pqCameraReaction(ui.actionPositiveY, pqCameraReaction::RESET_POSITIVE_Y);
|
||||
new pqCameraReaction(ui.actionNegativeY, pqCameraReaction::RESET_NEGATIVE_Y);
|
||||
new pqCameraReaction(ui.actionPositiveZ, pqCameraReaction::RESET_POSITIVE_Z);
|
||||
new pqCameraReaction(ui.actionNegativeZ, pqCameraReaction::RESET_NEGATIVE_Z);
|
||||
|
||||
new pqRenderViewSelectionReaction(ui.actionZoomToBox, NULL,
|
||||
pqRenderViewSelectionReaction::ZOOM_TO_BOX);
|
||||
|
||||
this->ZoomToDataAction = ui.actionZoomToData;
|
||||
this->ZoomToDataAction->setEnabled(pqActiveObjects::instance().activeSource() != 0);
|
||||
|
||||
QObject::connect(&pqActiveObjects::instance(), SIGNAL(viewChanged(pqView*)),
|
||||
this, SLOT(updateEnabledState()));
|
||||
QObject::connect(&pqActiveObjects::instance(), SIGNAL(sourceChanged(pqPipelineSource*)),
|
||||
this, SLOT(updateEnabledState()));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCameraToolbar::updateEnabledState()
|
||||
{
|
||||
pqView* view = pqActiveObjects::instance().activeView();
|
||||
pqPipelineSource* source = pqActiveObjects::instance().activeSource();
|
||||
this->ZoomToDataAction->setEnabled(source && view);
|
||||
}
|
||||
65
ParaView-5.0.1/Qt/ApplicationComponents/pqCameraToolbar.h
Normal file
65
ParaView-5.0.1/Qt/ApplicationComponents/pqCameraToolbar.h
Normal file
@ -0,0 +1,65 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqCameraToolbar.h
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqCameraToolbar_h
|
||||
#define pqCameraToolbar_h
|
||||
|
||||
#include <QToolBar>
|
||||
#include "pqApplicationComponentsModule.h"
|
||||
|
||||
/// pqCameraToolbar is the toolbar that has icons for resetting camera
|
||||
/// orientations as well as zoom-to-data and zoom-to-box.
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqCameraToolbar : public QToolBar
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef QToolBar Superclass;
|
||||
public:
|
||||
pqCameraToolbar(const QString& title, QWidget* parentObject=0)
|
||||
: Superclass(title, parentObject)
|
||||
{
|
||||
this->constructor();
|
||||
}
|
||||
pqCameraToolbar(QWidget* parentObject=0)
|
||||
: Superclass(parentObject)
|
||||
{
|
||||
this->constructor();
|
||||
}
|
||||
|
||||
private slots:
|
||||
void updateEnabledState();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqCameraToolbar)
|
||||
void constructor();
|
||||
QAction* ZoomToDataAction;
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,123 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqCameraUndoRedoReaction.cxx
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqCameraUndoRedoReaction.h"
|
||||
|
||||
|
||||
#include "pqActiveObjects.h"
|
||||
#include "pqView.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqCameraUndoRedoReaction::pqCameraUndoRedoReaction(
|
||||
QAction* parentObject, bool undo_mode, pqView* view)
|
||||
: Superclass(parentObject)
|
||||
{
|
||||
this->Undo = undo_mode;
|
||||
|
||||
if (view)
|
||||
{
|
||||
this->setActiveView(view);
|
||||
}
|
||||
else
|
||||
{
|
||||
QObject::connect(&pqActiveObjects::instance(),
|
||||
SIGNAL(viewChanged(pqView*)),
|
||||
this, SLOT(setActiveView(pqView*)));
|
||||
this->setActiveView(pqActiveObjects::instance().activeView());
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCameraUndoRedoReaction::undo(pqView* view)
|
||||
{
|
||||
if (!view)
|
||||
{
|
||||
return;
|
||||
}
|
||||
view->undo();
|
||||
view->render();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCameraUndoRedoReaction::redo(pqView* view)
|
||||
{
|
||||
if (!view)
|
||||
{
|
||||
return;
|
||||
}
|
||||
view->redo();
|
||||
view->render();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCameraUndoRedoReaction::setActiveView(pqView* view)
|
||||
{
|
||||
if (this->LastView)
|
||||
{
|
||||
QObject::disconnect(this->LastView, 0, this, 0);
|
||||
this->LastView = NULL;
|
||||
}
|
||||
|
||||
if (!view || !view->supportsUndo())
|
||||
{
|
||||
this->setEnabled(false);
|
||||
return;
|
||||
}
|
||||
|
||||
this->LastView = view;
|
||||
|
||||
if (this->Undo)
|
||||
{
|
||||
this->setEnabled(view->canUndo());
|
||||
QObject::connect(view, SIGNAL(canUndoChanged(bool)),
|
||||
this, SLOT(setEnabled(bool)));
|
||||
}
|
||||
else
|
||||
{
|
||||
this->setEnabled(view->canRedo());
|
||||
QObject::connect(view, SIGNAL(canRedoChanged(bool)),
|
||||
this, SLOT(setEnabled(bool)));
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCameraUndoRedoReaction::onTriggered()
|
||||
{
|
||||
if (this->Undo)
|
||||
{
|
||||
pqCameraUndoRedoReaction::undo(this->LastView);
|
||||
}
|
||||
else
|
||||
{
|
||||
pqCameraUndoRedoReaction::redo(this->LastView);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,77 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqCameraUndoRedoReaction.h
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqCameraUndoRedoReaction_h
|
||||
#define pqCameraUndoRedoReaction_h
|
||||
|
||||
#include "pqReaction.h"
|
||||
#include <QPointer>
|
||||
|
||||
class pqView;
|
||||
|
||||
/// @ingroup Reactions
|
||||
/// Reaction for camera undo or redo.
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqCameraUndoRedoReaction : public pqReaction
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef pqReaction Superclass;
|
||||
public:
|
||||
/// Constructor parent cannot be NULL. When undo is true, acts as
|
||||
/// undo-reaction, else acts as redo reaction.
|
||||
/// If \c view ==NULL then active view is used.
|
||||
pqCameraUndoRedoReaction(QAction* parent, bool undo, pqView* view=0);
|
||||
|
||||
/// undo.
|
||||
static void undo(pqView* view);
|
||||
|
||||
/// redo.
|
||||
static void redo(pqView* view);
|
||||
|
||||
protected slots:
|
||||
void setEnabled(bool enable)
|
||||
{
|
||||
this->parentAction()->setEnabled(enable);
|
||||
}
|
||||
void setActiveView(pqView*);
|
||||
|
||||
protected:
|
||||
/// Called when the action is triggered.
|
||||
virtual void onTriggered();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqCameraUndoRedoReaction)
|
||||
QPointer<pqView> LastView;
|
||||
bool Undo;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@ -0,0 +1,92 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: $RCSfile$
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqCatalystConnectReaction.h"
|
||||
|
||||
#include "pqActiveObjects.h"
|
||||
#include "pqApplicationCore.h"
|
||||
#include "pqLiveInsituManager.h"
|
||||
#include "pqCoreUtilities.h"
|
||||
#include "pqLiveInsituVisualizationManager.h"
|
||||
#include "pqServer.h"
|
||||
#include "vtkProcessModule.h"
|
||||
#include "vtkSMSession.h"
|
||||
|
||||
#include <QInputDialog>
|
||||
#include <QMessageBox>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqCatalystConnectReaction::pqCatalystConnectReaction(QAction* parentObject)
|
||||
: Superclass(parentObject)
|
||||
{
|
||||
QObject::connect(
|
||||
&pqActiveObjects::instance(), SIGNAL(serverChanged(pqServer*)),
|
||||
this, SLOT(updateEnableState()));
|
||||
this->updateEnableState();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqCatalystConnectReaction::~pqCatalystConnectReaction()
|
||||
{
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool pqCatalystConnectReaction::connect()
|
||||
{
|
||||
pqLiveInsituManager* cs = pqLiveInsituManager::instance();
|
||||
pqServer* server = pqActiveObjects::instance().activeServer();
|
||||
pqLiveInsituVisualizationManager* mgr = cs->connect(server);
|
||||
if (mgr)
|
||||
{
|
||||
this->updateEnableState();
|
||||
QObject::connect(mgr, SIGNAL(insituDisconnected()),
|
||||
this, SLOT(updateEnableState()));
|
||||
}
|
||||
return mgr;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCatalystConnectReaction::updateEnableState()
|
||||
{
|
||||
pqServer* server = pqActiveObjects::instance().activeServer();
|
||||
if (server &&
|
||||
! pqLiveInsituManager::isInsituServer(server) &&
|
||||
! server->session()->IsMultiClients() &&
|
||||
! pqLiveInsituManager::instance()->isDisplayServer(server))
|
||||
{
|
||||
this->parentAction()->setEnabled(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->parentAction()->setEnabled(false);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: $RCSfile$
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqCatalystConnectReaction_h
|
||||
#define pqCatalystConnectReaction_h
|
||||
|
||||
#include "pqReaction.h"
|
||||
#include <QPointer>
|
||||
|
||||
class pqLiveInsituVisualizationManager;
|
||||
|
||||
/// Reaction for connecting to Catalyst CoProcessing Engine for Live-Data
|
||||
/// Visualization.
|
||||
/// @ingroup Reactions
|
||||
/// @ingroup LiveInsitu
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqCatalystConnectReaction : public pqReaction
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef pqReaction Superclass;
|
||||
public:
|
||||
pqCatalystConnectReaction(QAction* parent=0);
|
||||
virtual ~pqCatalystConnectReaction();
|
||||
|
||||
/// Connect to Catalyst
|
||||
bool connect();
|
||||
|
||||
protected:
|
||||
/// Called when the action is triggered.
|
||||
virtual void onTriggered()
|
||||
{ this->connect(); }
|
||||
|
||||
/// reaction disabled when already connected to a catalyst server or in
|
||||
/// collaboration mode.
|
||||
virtual void updateEnableState();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqCatalystConnectReaction)
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,70 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: $RCSfile$
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqCatalystContinueReaction_h
|
||||
#define pqCatalystContinueReaction_h
|
||||
|
||||
#include "pqCatalystPauseSimulationReaction.h"
|
||||
#include <QPointer>
|
||||
|
||||
class pqLiveInsituVisualizationManager;
|
||||
|
||||
|
||||
/// Reaction for setting a breakpoint to Catalyst CoProcessing Engine
|
||||
/// for Live-Data Visualization.
|
||||
/// @ingroup Reactions
|
||||
/// @ingroup LiveInsitu
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqCatalystContinueReaction :
|
||||
public pqCatalystPauseSimulationReaction
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef pqCatalystPauseSimulationReaction Superclass;
|
||||
public:
|
||||
pqCatalystContinueReaction(QAction* parentTemp=0) : Superclass(parentTemp)
|
||||
{
|
||||
}
|
||||
|
||||
public slots:
|
||||
virtual void updateEnableState()
|
||||
{
|
||||
pqCatalystPauseSimulationReaction::updateEnableState(CONTINUE);
|
||||
}
|
||||
|
||||
protected:
|
||||
/// Called when the action is triggered.
|
||||
virtual void onTriggered()
|
||||
{ this->setPauseSimulation(false); }
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqCatalystContinueReaction)
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,86 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: $RCSfile$
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqCatalystPauseSimulationReaction.h"
|
||||
|
||||
#include "pqActiveObjects.h"
|
||||
#include "pqApplicationCore.h"
|
||||
#include "pqLiveInsituManager.h"
|
||||
#include "pqCoreUtilities.h"
|
||||
#include "pqLiveInsituVisualizationManager.h"
|
||||
#include "pqServer.h"
|
||||
#include "pqServerManagerModel.h"
|
||||
#include "vtkProcessModule.h"
|
||||
#include "vtkSMLiveInsituLinkProxy.h"
|
||||
#include "vtkSMPropertyHelper.h"
|
||||
#include "vtkSMSession.h"
|
||||
|
||||
|
||||
#include <QInputDialog>
|
||||
#include <QMessageBox>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqCatalystPauseSimulationReaction::pqCatalystPauseSimulationReaction(
|
||||
QAction* parentObject)
|
||||
: Superclass(parentObject)
|
||||
{
|
||||
QObject::connect(parentObject->parent(), SIGNAL(aboutToShow()),
|
||||
this, SLOT(updateEnableState()));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCatalystPauseSimulationReaction::setPauseSimulation(bool pause)
|
||||
{
|
||||
vtkSMLiveInsituLinkProxy* proxy = pqLiveInsituManager::instance()->linkProxy();
|
||||
if (proxy)
|
||||
{
|
||||
vtkSMPropertyHelper(proxy, "SimulationPaused").Set(pause);
|
||||
proxy->UpdateVTKObjects();
|
||||
if (! pause)
|
||||
{
|
||||
proxy->InvokeCommand("LiveChanged");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCatalystPauseSimulationReaction::updateEnableState(Type type)
|
||||
{
|
||||
bool enabled = false;
|
||||
vtkSMLiveInsituLinkProxy* proxy = pqLiveInsituManager::instance()->linkProxy();
|
||||
if (proxy &&
|
||||
((type == PAUSE) !=
|
||||
(vtkSMPropertyHelper(proxy, "SimulationPaused").GetAs<int>() == 1)))
|
||||
{
|
||||
enabled = true;
|
||||
}
|
||||
this->parentAction()->setEnabled(enabled);
|
||||
}
|
||||
@ -0,0 +1,77 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: $RCSfile$
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqCatalystPauseSimulationReaction_h
|
||||
#define pqCatalystPauseSimulationReaction_h
|
||||
|
||||
#include "pqReaction.h"
|
||||
#include <QPointer>
|
||||
|
||||
class pqLiveInsituVisualizationManager;
|
||||
class vtkSMLiveInsituLinkProxy;
|
||||
|
||||
/// Reaction for setting a breakpoint to Catalyst CoProcessing Engine
|
||||
/// for Live-Data Visualization.
|
||||
/// @ingroup Reactions
|
||||
/// @ingroup LiveInsitu
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqCatalystPauseSimulationReaction :
|
||||
public pqReaction
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef pqReaction Superclass;
|
||||
public:
|
||||
pqCatalystPauseSimulationReaction(QAction* parent=0);
|
||||
|
||||
public slots:
|
||||
virtual void updateEnableState()
|
||||
{
|
||||
updateEnableState(PAUSE);
|
||||
}
|
||||
|
||||
protected:
|
||||
enum Type
|
||||
{
|
||||
CONTINUE,
|
||||
PAUSE
|
||||
};
|
||||
|
||||
/// Called when the action is triggered.
|
||||
virtual void onTriggered()
|
||||
{ this->setPauseSimulation(true); }
|
||||
|
||||
void setPauseSimulation (bool pause);
|
||||
void updateEnableState (Type type);
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqCatalystPauseSimulationReaction)
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,73 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: $RCSfile$
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqCatalystRemoveBreakpointReaction.h"
|
||||
|
||||
#include "pqActiveObjects.h"
|
||||
#include "pqApplicationCore.h"
|
||||
#include "pqLiveInsituManager.h"
|
||||
#include "pqCoreUtilities.h"
|
||||
#include "pqLiveInsituVisualizationManager.h"
|
||||
#include "pqServer.h"
|
||||
#include "pqServerManagerModel.h"
|
||||
#include "vtkProcessModule.h"
|
||||
#include "vtkSMLiveInsituLinkProxy.h"
|
||||
#include "vtkSMPropertyHelper.h"
|
||||
#include "vtkSMSession.h"
|
||||
|
||||
|
||||
#include <QInputDialog>
|
||||
#include <QMessageBox>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqCatalystRemoveBreakpointReaction::pqCatalystRemoveBreakpointReaction(
|
||||
QAction* parentObject)
|
||||
: Superclass(parentObject)
|
||||
{
|
||||
QObject::connect(parentObject->parent(), SIGNAL(aboutToShow()),
|
||||
this, SLOT(updateEnableState()));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCatalystRemoveBreakpointReaction::onTriggered()
|
||||
{
|
||||
pqLiveInsituManager::instance()->removeBreakpoint();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCatalystRemoveBreakpointReaction::updateEnableState()
|
||||
{
|
||||
pqLiveInsituManager* server = pqLiveInsituManager::instance();
|
||||
this->parentAction()->setEnabled(
|
||||
(server->linkProxy() &&
|
||||
server->breakpointTime() != pqLiveInsituManager::INVALID_TIME) ?
|
||||
true : false);
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: $RCSfile$
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqCatalystRemoveBreakpointReaction_h
|
||||
#define pqCatalystRemoveBreakpointReaction_h
|
||||
|
||||
#include "pqReaction.h"
|
||||
#include <QPointer>
|
||||
|
||||
class pqLiveInsituVisualizationManager;
|
||||
class vtkSMLiveInsituLinkProxy;
|
||||
|
||||
/// Reaction for setting a breakpoint to Catalyst CoProcessing Engine
|
||||
/// for Live-Data Visualization.
|
||||
/// @ingroup Reactions
|
||||
/// @LiveInsitu
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqCatalystRemoveBreakpointReaction :
|
||||
public pqReaction
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef pqReaction Superclass;
|
||||
public:
|
||||
pqCatalystRemoveBreakpointReaction(QAction* parent=0);
|
||||
|
||||
public slots:
|
||||
virtual void updateEnableState();
|
||||
|
||||
protected:
|
||||
virtual void onTriggered();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqCatalystRemoveBreakpointReaction)
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,84 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: $RCSfile$
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqCatalystSetBreakpointReaction.h"
|
||||
|
||||
#include "pqActiveObjects.h"
|
||||
#include "pqApplicationCore.h"
|
||||
#include "pqLiveInsituManager.h"
|
||||
#include "pqCoreUtilities.h"
|
||||
#include "pqLiveInsituVisualizationManager.h"
|
||||
#include "pqServer.h"
|
||||
#include "pqServerManagerModel.h"
|
||||
#include "pqSetBreakpointDialog.h"
|
||||
#include "vtkProcessModule.h"
|
||||
#include "vtkSMLiveInsituLinkProxy.h"
|
||||
#include "vtkSMPropertyHelper.h"
|
||||
#include "vtkSMSession.h"
|
||||
|
||||
|
||||
#include <QInputDialog>
|
||||
#include <QMessageBox>
|
||||
|
||||
class pqCatalystSetBreakpointReaction::sbrInternal
|
||||
{
|
||||
public:
|
||||
sbrInternal(QWidget* parent) :
|
||||
Dialog(parent)
|
||||
{
|
||||
}
|
||||
pqSetBreakpointDialog Dialog;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqCatalystSetBreakpointReaction::pqCatalystSetBreakpointReaction(
|
||||
QAction* parentObject)
|
||||
: Superclass(parentObject),
|
||||
Internal(new sbrInternal(pqCoreUtilities::mainWidget()))
|
||||
{
|
||||
QObject::connect(parentObject->parent(), SIGNAL(aboutToShow()),
|
||||
this, SLOT(updateEnableState()));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCatalystSetBreakpointReaction::onTriggered()
|
||||
{
|
||||
// we set the breakpoint time inside the dialog
|
||||
this->Internal->Dialog.exec();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCatalystSetBreakpointReaction::updateEnableState()
|
||||
{
|
||||
this->parentAction()->setEnabled(
|
||||
pqLiveInsituManager::instance()->linkProxy() ? true : false);
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: $RCSfile$
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqCatalystSetBreakpointReaction_h
|
||||
#define pqCatalystSetBreakpointReaction_h
|
||||
|
||||
#include "pqReaction.h"
|
||||
#include <QPointer>
|
||||
|
||||
class pqLiveInsituVisualizationManager;
|
||||
class vtkSMLiveInsituLinkProxy;
|
||||
|
||||
/// Reaction for setting a breakpoint to Catalyst CoProcessing Engine
|
||||
/// for Live-Data Visualization.
|
||||
/// @ingroup Reactions
|
||||
/// @ingroup LiveInsitu
|
||||
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqCatalystSetBreakpointReaction :
|
||||
public pqReaction
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef pqReaction Superclass;
|
||||
public:
|
||||
pqCatalystSetBreakpointReaction(QAction* parent=0);
|
||||
|
||||
public slots:
|
||||
virtual void updateEnableState();
|
||||
|
||||
protected:
|
||||
virtual void onTriggered();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqCatalystSetBreakpointReaction)
|
||||
class sbrInternal;
|
||||
sbrInternal* Internal;
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,123 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqCategoryToolbarsBehavior.cxx
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqCategoryToolbarsBehavior.h"
|
||||
|
||||
#include "pqProxyGroupMenuManager.h"
|
||||
#include "pqApplicationCore.h"
|
||||
#include "pqTestUtility.h"
|
||||
#include "pqEventDispatcher.h"
|
||||
#include "pqEventTranslator.h"
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QToolBar>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqCategoryToolbarsBehavior::pqCategoryToolbarsBehavior(
|
||||
pqProxyGroupMenuManager* menuManager, QMainWindow* mainWindow)
|
||||
: Superclass(menuManager)
|
||||
{
|
||||
Q_ASSERT(menuManager != 0);
|
||||
Q_ASSERT(mainWindow != 0);
|
||||
|
||||
this->MainWindow = mainWindow;
|
||||
this->MenuManager = menuManager;
|
||||
|
||||
// When tests start, hide toolbars that have asked to be off by default.
|
||||
// Do the same when starting to record events for a test.
|
||||
pqTestUtility* testUtil = pqApplicationCore::instance()->testUtility();
|
||||
pqEventDispatcher* testPlayer = testUtil ? testUtil->dispatcher() : NULL;
|
||||
pqEventTranslator* testRecorder = testUtil ? testUtil->eventTranslator() : NULL;
|
||||
if (testPlayer)
|
||||
{
|
||||
QObject::connect(testPlayer, SIGNAL(restarted()),
|
||||
this, SLOT(prepareForTest()));
|
||||
}
|
||||
if (testRecorder)
|
||||
{
|
||||
QObject::connect(testRecorder, SIGNAL(started()),
|
||||
this, SLOT(prepareForTest()));
|
||||
}
|
||||
|
||||
QObject::connect(menuManager, SIGNAL(menuPopulated()),
|
||||
this, SLOT(updateToolbars()));
|
||||
this->updateToolbars();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqCategoryToolbarsBehavior::updateToolbars()
|
||||
{
|
||||
QStringList toolbarCategories = this->MenuManager->getToolbarCategories();
|
||||
foreach (QString category, toolbarCategories)
|
||||
{
|
||||
QToolBar* toolbar = this->MainWindow->findChild<QToolBar*>(category);
|
||||
if (!toolbar)
|
||||
{
|
||||
if ( category == "Common" )
|
||||
{
|
||||
this->MainWindow->addToolBarBreak();
|
||||
}
|
||||
toolbar = new QToolBar(this->MainWindow);
|
||||
toolbar->setObjectName(category);
|
||||
toolbar->setOrientation(Qt::Horizontal);
|
||||
toolbar->setWindowTitle(category); // TODO: Get label from MenuManager.
|
||||
this->MainWindow->addToolBar(toolbar);
|
||||
if (this->MenuManager->hideForTests(category))
|
||||
{
|
||||
this->ToolbarsToHide << toolbar->toggleViewAction();
|
||||
}
|
||||
}
|
||||
QList<QAction*> toolbarActions = this->MenuManager->actions(category);
|
||||
toolbar->clear();
|
||||
for (int cc=0; cc < toolbarActions.size(); cc++)
|
||||
{
|
||||
QVariant omitList = toolbarActions[cc]->property("OmitFromToolbar");
|
||||
if (omitList.isValid() && omitList.toStringList().contains(category))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
toolbar->addAction(toolbarActions[cc]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void pqCategoryToolbarsBehavior::prepareForTest()
|
||||
{
|
||||
foreach(QAction* toolbar, this->ToolbarsToHide)
|
||||
{
|
||||
if (toolbar && toolbar->isChecked())
|
||||
{
|
||||
toolbar->trigger();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,77 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqCategoryToolbarsBehavior.h
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqCategoryToolbarsBehavior_h
|
||||
#define pqCategoryToolbarsBehavior_h
|
||||
|
||||
#include <QObject>
|
||||
#include <QPointer>
|
||||
#include <QList>
|
||||
#include "pqApplicationComponentsModule.h"
|
||||
|
||||
class pqProxyGroupMenuManager;
|
||||
class QMainWindow;
|
||||
class QAction;
|
||||
|
||||
/// @ingroup Behaviors
|
||||
/// pqCategoryToolbarsBehavior is used when the application wants to enable
|
||||
/// categories from a pqProxyGroupMenuManager to show up in a toolbar.
|
||||
/// ex. One may want to have a toolbar listing all the filters in "Common"
|
||||
/// category. This behavior also ensures that as plugins are loaded, if new
|
||||
/// categories request that the be added as a toolbar, new toolbars for those
|
||||
/// are added and also if new items get added to a category already shown as a
|
||||
/// toolbar, then the toolbar is updated.
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqCategoryToolbarsBehavior : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef QObject Superclass;
|
||||
public:
|
||||
pqCategoryToolbarsBehavior(pqProxyGroupMenuManager* menuManager,
|
||||
QMainWindow* mainWindow);
|
||||
|
||||
protected slots:
|
||||
/// Called when menuManager fires the menuPopulated() signal.
|
||||
void updateToolbars();
|
||||
|
||||
/// This slot gets attached to a pqEventDispatcher so that some toolbars
|
||||
/// can be hidden before each test starts (to prevent small test-image differences
|
||||
/// due to layout differences between machines).
|
||||
void prepareForTest();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqCategoryToolbarsBehavior)
|
||||
|
||||
QPointer<QMainWindow> MainWindow;
|
||||
QPointer<pqProxyGroupMenuManager> MenuManager;
|
||||
QList<QAction*> ToolbarsToHide;
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,135 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqChangePipelineInputReaction.cxx
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqChangePipelineInputReaction.h"
|
||||
|
||||
#include "pqActiveObjects.h"
|
||||
#include "pqApplicationCore.h"
|
||||
#include "pqChangeInputDialog.h"
|
||||
#include "pqCoreUtilities.h"
|
||||
#include "pqOutputPort.h"
|
||||
#include "pqPipelineFilter.h"
|
||||
#include "pqPipelineModel.h"
|
||||
#include "pqServerManagerModel.h"
|
||||
#include "pqUndoStack.h"
|
||||
#include "vtkSMInputProperty.h"
|
||||
#include "vtkSMProxy.h"
|
||||
#include "vtkSMTrace.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqChangePipelineInputReaction::pqChangePipelineInputReaction(
|
||||
QAction* parentObject)
|
||||
: Superclass(parentObject)
|
||||
{
|
||||
QObject::connect(
|
||||
&pqActiveObjects::instance(), SIGNAL(sourceChanged(pqPipelineSource*)),
|
||||
this, SLOT(updateEnableState()));
|
||||
|
||||
// nameChanged() is fired even when modified state is changed ;).
|
||||
QObject::connect(pqApplicationCore::instance()->getServerManagerModel(),
|
||||
SIGNAL(modifiedStateChanged(pqServerManagerModelItem*)),
|
||||
this, SLOT(updateEnableState()));
|
||||
this->updateEnableState();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqChangePipelineInputReaction::updateEnableState()
|
||||
{
|
||||
pqPipelineFilter* filter = qobject_cast<pqPipelineFilter*>(
|
||||
pqActiveObjects::instance().activeSource());
|
||||
if (filter == NULL || filter->modifiedState() == pqProxy::UNINITIALIZED)
|
||||
{
|
||||
this->parentAction()->setEnabled(false);
|
||||
return;
|
||||
}
|
||||
|
||||
this->parentAction()->setEnabled(true);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqChangePipelineInputReaction::changeInput()
|
||||
{
|
||||
pqPipelineFilter* filter = qobject_cast<pqPipelineFilter*>(
|
||||
pqActiveObjects::instance().activeSource());
|
||||
|
||||
if (!filter)
|
||||
{
|
||||
qCritical() << "No active filter.";
|
||||
return;
|
||||
}
|
||||
|
||||
pqChangeInputDialog dialog(filter->getProxy(),
|
||||
pqCoreUtilities::mainWidget());
|
||||
dialog.setObjectName("ChangeInputDialog");
|
||||
if (dialog.exec() != QDialog::Accepted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
BEGIN_UNDO_SET(QString("Change Input for %1").arg(
|
||||
filter->getSMName()));
|
||||
SM_SCOPED_TRACE(PropertiesModified)
|
||||
.arg("proxy", filter->getProxy());
|
||||
|
||||
const QMap<QString, QList<pqOutputPort*> > input_map =
|
||||
dialog.selectedInputs();
|
||||
QMap<QString, QList<pqOutputPort*> >::const_iterator iter;
|
||||
|
||||
for (iter = input_map.begin(); iter != input_map.end(); iter++)
|
||||
{
|
||||
QString inputPortName = iter.key();
|
||||
const QList<pqOutputPort*> &inputs = iter.value();
|
||||
|
||||
std::vector<vtkSMProxy*> inputPtrs;
|
||||
std::vector<unsigned int> inputPorts;
|
||||
|
||||
foreach (pqOutputPort* opport, inputs)
|
||||
{
|
||||
inputPtrs.push_back(opport->getSource()->getProxy());
|
||||
inputPorts.push_back(opport->getPortNumber());
|
||||
}
|
||||
|
||||
vtkSMInputProperty* ip =vtkSMInputProperty::SafeDownCast(
|
||||
filter->getProxy()->GetProperty(
|
||||
inputPortName.toLatin1().data()));
|
||||
ip->SetProxies(
|
||||
static_cast<unsigned int>(inputPtrs.size()),
|
||||
&inputPtrs[0], &inputPorts[0]);
|
||||
}
|
||||
filter->getProxy()->UpdateVTKObjects();
|
||||
END_UNDO_SET();
|
||||
|
||||
// render all views
|
||||
pqApplicationCore::instance()->render();
|
||||
}
|
||||
|
||||
@ -0,0 +1,65 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqChangePipelineInputReaction.h
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqChangePipelineInputReaction_h
|
||||
#define pqChangePipelineInputReaction_h
|
||||
|
||||
#include "pqReaction.h"
|
||||
|
||||
/// @ingroup Reactions
|
||||
/// Reaction for change pipeline input for the currently selected element.
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqChangePipelineInputReaction : public pqReaction
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef pqReaction Superclass;
|
||||
public:
|
||||
pqChangePipelineInputReaction(QAction* parent=0);
|
||||
|
||||
/// Changes the input for the active source.
|
||||
static void changeInput();
|
||||
|
||||
public slots:
|
||||
/// Updates the enabled state. Applications need not explicitly call
|
||||
/// this.
|
||||
void updateEnableState();
|
||||
|
||||
protected:
|
||||
/// Called when the action is triggered.
|
||||
virtual void onTriggered()
|
||||
{ pqChangePipelineInputReaction::changeInput(); }
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqChangePipelineInputReaction)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@ -0,0 +1,181 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqChartSelectionReaction.cxx
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqChartSelectionReaction.h"
|
||||
|
||||
#include "pqContextView.h"
|
||||
#include "pqCoreUtilities.h"
|
||||
#include "vtkChart.h"
|
||||
#include "vtkCommand.h"
|
||||
#include "vtkContextMouseEvent.h"
|
||||
#include "vtkContextScene.h"
|
||||
#include "vtkContextView.h"
|
||||
#include "vtkRenderWindowInteractor.h"
|
||||
#include "vtkScatterPlotMatrix.h"
|
||||
#include "vtkSMContextViewProxy.h"
|
||||
|
||||
#include <QActionGroup>
|
||||
#include <QtDebug>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqChartSelectionReaction::pqChartSelectionReaction(
|
||||
QAction *parentObject, pqContextView *view, QActionGroup* modifierGroup)
|
||||
: Superclass(parentObject, modifierGroup),
|
||||
View(view)
|
||||
{
|
||||
parentObject->setEnabled(view != NULL && view->supportsSelection());
|
||||
this->connect(parentObject, SIGNAL(triggered(bool)), SLOT(triggered(bool)));
|
||||
|
||||
vtkRenderWindowInteractor* interactor =
|
||||
(view ? view->getVTKContextView()->GetInteractor() : 0);
|
||||
if (interactor)
|
||||
{
|
||||
pqCoreUtilities::connect(
|
||||
interactor, vtkCommand::LeftButtonReleaseEvent,
|
||||
this, SLOT(stopSelection()));
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
inline void setChartParameters(
|
||||
pqContextView* view,
|
||||
int selectionType, bool update_type,
|
||||
int selectionModifier, bool update_modifier)
|
||||
{
|
||||
if (view == NULL && !view->supportsSelection() && view->getContextViewProxy() == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
vtkAbstractContextItem* contextItem =
|
||||
view->getContextViewProxy()->GetContextItem();
|
||||
vtkChart *chart = vtkChart::SafeDownCast(contextItem);
|
||||
vtkScatterPlotMatrix *chartMatrix =
|
||||
vtkScatterPlotMatrix::SafeDownCast(contextItem);
|
||||
if (chartMatrix)
|
||||
{
|
||||
chart = chartMatrix->GetMainChart();
|
||||
}
|
||||
|
||||
if (update_modifier &&
|
||||
(selectionModifier < vtkContextScene::SELECTION_NONE ||
|
||||
selectionModifier > vtkContextScene::SELECTION_TOGGLE))
|
||||
{
|
||||
qWarning() << "Invalid selection modifier " << selectionModifier
|
||||
<< ", using vtkContextScene::SELECTION_DEFAULT";
|
||||
selectionModifier = vtkContextScene::SELECTION_DEFAULT;
|
||||
}
|
||||
|
||||
if (chart)
|
||||
{
|
||||
if (update_type)
|
||||
{
|
||||
chart->SetActionToButton(selectionType, vtkContextMouseEvent::LEFT_BUTTON);
|
||||
}
|
||||
if (update_modifier)
|
||||
{
|
||||
chart->SetSelectionMode(selectionModifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqChartSelectionReaction::startSelection(
|
||||
pqContextView* view, int selectionType, int selectionModifier)
|
||||
{
|
||||
::setChartParameters(view, selectionType, true, selectionModifier, true);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqChartSelectionReaction::stopSelection()
|
||||
{
|
||||
::setChartParameters(this->View,
|
||||
vtkChart::PAN, true, vtkContextScene::SELECTION_DEFAULT, true);
|
||||
this->parentAction()->setChecked(false);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqChartSelectionReaction::modifiersChanged()
|
||||
{
|
||||
int selectionModifier = this->getSelectionModifier();
|
||||
::setChartParameters(this->View, -1, false, selectionModifier, true);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqChartSelectionReaction::triggered(bool checked)
|
||||
{
|
||||
if (this->View &&
|
||||
this->View->supportsSelection() &&
|
||||
this->View->getContextViewProxy())
|
||||
{
|
||||
QAction* _action = this->parentAction();
|
||||
int selectionType = vtkChart::SELECT_RECTANGLE;
|
||||
if (_action->data().isValid())
|
||||
{
|
||||
selectionType = _action->data().toInt();
|
||||
}
|
||||
|
||||
int selectionModifier = this->getSelectionModifier();
|
||||
if (checked)
|
||||
{
|
||||
pqChartSelectionReaction::startSelection(this->View,
|
||||
selectionType, selectionModifier);
|
||||
}
|
||||
else
|
||||
{
|
||||
pqChartSelectionReaction::stopSelection();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
int pqChartSelectionReaction::getSelectionModifier()
|
||||
{
|
||||
int selectionModifier = this->Superclass::getSelectionModifier();
|
||||
switch(selectionModifier)
|
||||
{
|
||||
case(pqView::PV_SELECTION_DEFAULT):
|
||||
return vtkContextScene::SELECTION_DEFAULT;
|
||||
break;
|
||||
case(pqView::PV_SELECTION_ADDITION):
|
||||
return vtkContextScene::SELECTION_ADDITION;
|
||||
break;
|
||||
case(pqView::PV_SELECTION_SUBTRACTION):
|
||||
return vtkContextScene::SELECTION_SUBTRACTION;
|
||||
break;
|
||||
case(pqView::PV_SELECTION_TOGGLE):
|
||||
return vtkContextScene::SELECTION_TOGGLE;
|
||||
break;
|
||||
default:
|
||||
return vtkContextScene::SELECTION_NONE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,84 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqChartSelectionReaction.h
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqChartSelectionReaction_h
|
||||
#define pqChartSelectionReaction_h
|
||||
|
||||
#include "pqSelectionReaction.h"
|
||||
#include <QPointer> // needed for QPointer.
|
||||
|
||||
class pqContextView;
|
||||
class vtkObject;
|
||||
|
||||
/// @ingroup Reactions
|
||||
/// Reaction for creating selections on chart views.
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqChartSelectionReaction : public pqSelectionReaction
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef pqSelectionReaction Superclass;
|
||||
public:
|
||||
/// Constructor. \c parent is expected to have data() that indicates the
|
||||
/// selection type e.g. vtkChart::SELECT_RECTANGLE or vtkChart::SELECT_POLYGON.
|
||||
/// QActionGroup \c modifierGroup is used to determine selection modifier. If
|
||||
/// there's a non-null checkedAction() in the group, we use that action's
|
||||
/// data() to determine the selection mode e.g.
|
||||
/// vtkContextScene::SELECTION_ADDITION,
|
||||
/// vtkContextScene::SELECTION_SUBTRACTION etc. If no QActionGroup is
|
||||
/// specified or no checked action is present, then the default mode of
|
||||
/// vtkContextScene::SELECTION_DEFAULT is used.
|
||||
pqChartSelectionReaction(QAction* parent,
|
||||
pqContextView* view, QActionGroup* modifierGroup);
|
||||
|
||||
/// start selection on the view where selectionType is one of
|
||||
/// vtkChart::SELECT_POLYGON, vtkChart::SELECT_RECTANGLE, etc., and
|
||||
/// selectionModifier is one of vtkContextScene::SELECTION_DEFAULT,
|
||||
/// vtkContextScene::SELECTION_ADDITION, etc.
|
||||
static void startSelection(pqContextView* view,
|
||||
int selectionType, int selectionModifier);
|
||||
|
||||
protected slots:
|
||||
/// Called when the action is triggered.
|
||||
virtual void triggered(bool);
|
||||
|
||||
/// stops selecting on the view
|
||||
void stopSelection();
|
||||
|
||||
/// called when modifier group is changed.
|
||||
virtual void modifiersChanged();
|
||||
|
||||
// Get the current state of selection modifier, converting it to vtkScene enum
|
||||
int getSelectionModifier();
|
||||
private:
|
||||
Q_DISABLE_COPY(pqChartSelectionReaction)
|
||||
QPointer<pqContextView> View;
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,69 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqCollaborationBehavior.cxx
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqCollaborationBehavior.h"
|
||||
|
||||
#include "pqApplicationCore.h"
|
||||
#include "pqActiveObjects.h"
|
||||
#include "pqServer.h"
|
||||
#include "pqServerManagerModel.h"
|
||||
#include "pqCollaborationManager.h"
|
||||
|
||||
#include "vtkSMSession.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqCollaborationBehavior::pqCollaborationBehavior(QObject* parentObject)
|
||||
: Superclass(parentObject)
|
||||
{
|
||||
this->CollaborationManager = new pqCollaborationManager(this);
|
||||
pqApplicationCore* core = pqApplicationCore::instance();
|
||||
core->registerManager("COLLABORATION_MANAGER", this->CollaborationManager);
|
||||
|
||||
QObject::connect( core->getServerManagerModel(),
|
||||
SIGNAL(preServerAdded(pqServer*)),
|
||||
this->CollaborationManager, SLOT(onServerAdded(pqServer*)));
|
||||
|
||||
QObject::connect( core->getServerManagerModel(),
|
||||
SIGNAL(aboutToRemoveServer(pqServer*)),
|
||||
this->CollaborationManager, SLOT(onServerRemoved(pqServer*)));
|
||||
|
||||
QObject::connect( this->CollaborationManager,
|
||||
SIGNAL(triggeredMasterChanged(bool)),
|
||||
core,
|
||||
SIGNAL(updateMasterEnableState(bool)));
|
||||
|
||||
// We attach mouse listener on active change time otherwise when the view
|
||||
// is just added, the widget is not yet correctly initialized...
|
||||
QObject::connect( &pqActiveObjects::instance(),
|
||||
SIGNAL(viewChanged(pqView*)),
|
||||
this->CollaborationManager, SLOT(attachMouseListenerTo3DViews()),
|
||||
Qt::UniqueConnection);
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqCollaborationBehavior.h
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqCollaborationBehavior_h
|
||||
#define pqCollaborationBehavior_h
|
||||
|
||||
#include <QObject>
|
||||
#include "pqApplicationComponentsModule.h"
|
||||
|
||||
class pqServer;
|
||||
class pqCollaborationManager;
|
||||
|
||||
/// @ingroup Behaviors
|
||||
/// pqCollaborationBehavior ensures that a pqCollaborationManager get set
|
||||
/// when a new pqServer that support collaboration has been created.
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqCollaborationBehavior : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef QObject Superclass;
|
||||
public:
|
||||
pqCollaborationBehavior(QObject* parent=0);
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqCollaborationBehavior)
|
||||
|
||||
pqCollaborationManager* CollaborationManager;
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,958 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: $RCSfile$
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqColorAnnotationsPropertyWidget.h"
|
||||
#include "ui_pqColorAnnotationsPropertyWidget.h"
|
||||
#include "ui_pqSavePresetOptions.h"
|
||||
|
||||
#include "pqActiveObjects.h"
|
||||
#include "pqDataRepresentation.h"
|
||||
#include "pqPresetDialog.h"
|
||||
#include "pqPropertiesPanel.h"
|
||||
#include "pqPropertyWidgetDecorator.h"
|
||||
#include "pqUndoStack.h"
|
||||
#include "vtkAbstractArray.h"
|
||||
#include "vtkCollection.h"
|
||||
#include "vtkCommand.h"
|
||||
#include "vtkEventQtSlotConnect.h"
|
||||
#include "vtkNew.h"
|
||||
#include "vtkPVArrayInformation.h"
|
||||
#include "vtkPVProminentValuesInformation.h"
|
||||
#include "vtkPVXMLElement.h"
|
||||
#include "vtkSmartPointer.h"
|
||||
#include "vtkSMPropertyGroup.h"
|
||||
#include "vtkSMProperty.h"
|
||||
#include "vtkSMPropertyHelper.h"
|
||||
#include "vtkSMProxy.h"
|
||||
#include "vtkSMPVRepresentationProxy.h"
|
||||
#include "vtkSMSessionProxyManager.h"
|
||||
#include "vtkSMStringVectorProperty.h"
|
||||
#include "vtkSMTransferFunctionPresets.h"
|
||||
#include "vtkSMTransferFunctionProxy.h"
|
||||
#include "vtkStringList.h"
|
||||
#include "vtkTuple.h"
|
||||
#include "vtkVariant.h"
|
||||
|
||||
#include <vtk_jsoncpp.h>
|
||||
|
||||
#include <QAbstractTableModel>
|
||||
#include <QColorDialog>
|
||||
#include <QHeaderView>
|
||||
#include <QMessageBox>
|
||||
#include <QPointer>
|
||||
#include <QPainter>
|
||||
#include <QSet>
|
||||
#include <algorithm>
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
// Decorator used to hide the widget when using IndexedLookup.
|
||||
class pqColorAnnotationsPropertyWidgetDecorator : public pqPropertyWidgetDecorator
|
||||
{
|
||||
typedef pqPropertyWidgetDecorator Superclass;
|
||||
bool IsAdvanced;
|
||||
public:
|
||||
pqColorAnnotationsPropertyWidgetDecorator(
|
||||
vtkPVXMLElement* xmlArg, pqPropertyWidget* parentArg)
|
||||
: Superclass(xmlArg, parentArg), IsAdvanced(false)
|
||||
{
|
||||
}
|
||||
virtual ~pqColorAnnotationsPropertyWidgetDecorator()
|
||||
{
|
||||
}
|
||||
|
||||
void setIsAdvanced(bool val)
|
||||
{
|
||||
if (val != this->IsAdvanced) { this->IsAdvanced = val; emit this->visibilityChanged(); }
|
||||
}
|
||||
virtual bool canShowWidget(bool show_advanced) const
|
||||
{
|
||||
return this->IsAdvanced? show_advanced : true;
|
||||
}
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqColorAnnotationsPropertyWidgetDecorator);
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// QAbstractTableModel subclass for keeping track of the annotations.
|
||||
// First column is IndexedColors and the 2nd and 3rd columns are the
|
||||
// annotation value and text.
|
||||
class pqAnnotationsModel : public QAbstractTableModel
|
||||
{
|
||||
typedef QAbstractTableModel Superclass;
|
||||
|
||||
struct ItemType
|
||||
{
|
||||
QColor Color;
|
||||
QPixmap Swatch;
|
||||
QString Value;
|
||||
QString Annotation;
|
||||
bool setData(int index, const QVariant& value)
|
||||
{
|
||||
if (index == 0 && value.canConvert(QVariant::Color))
|
||||
{
|
||||
this->Color = value.value<QColor>();
|
||||
this->Swatch = createSwatch();
|
||||
return true;
|
||||
}
|
||||
else if (index == 1)
|
||||
{
|
||||
this->Value = value.toString();
|
||||
return true;
|
||||
}
|
||||
else if (index == 2)
|
||||
{
|
||||
this->Annotation = value.toString();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
QVariant data(int index) const
|
||||
{
|
||||
if (index == 0 && this->Color.isValid())
|
||||
{
|
||||
return this->Swatch;
|
||||
}
|
||||
else if (index == 1)
|
||||
{
|
||||
return this->Value;
|
||||
}
|
||||
else if (index == 2)
|
||||
{
|
||||
return this->Annotation;
|
||||
}
|
||||
else if (index == 3 && this->Color.isValid())
|
||||
{
|
||||
return this->Color;
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
QPixmap createSwatch()
|
||||
{
|
||||
int radius = 17;
|
||||
|
||||
QPixmap pix(radius, radius);
|
||||
pix.fill(QColor(0,0,0,0));
|
||||
|
||||
QPainter painter(&pix);
|
||||
painter.setRenderHint(QPainter::Antialiasing, true);
|
||||
painter.setBrush(QBrush(this->Color));
|
||||
painter.drawEllipse(1, 1, radius-2, radius-2);
|
||||
painter.end();
|
||||
return pix;
|
||||
}
|
||||
};
|
||||
|
||||
QIcon MissingColorIcon;
|
||||
QVector<ItemType> Items;
|
||||
public:
|
||||
pqAnnotationsModel(QObject* parentObject = 0):
|
||||
Superclass(parentObject),
|
||||
MissingColorIcon(":/pqWidgets/Icons/pqUnknownData16.png")
|
||||
{
|
||||
}
|
||||
virtual ~pqAnnotationsModel()
|
||||
{
|
||||
}
|
||||
|
||||
/// Columns 1,2 are editable. 0 is not (since we show color swatch in 0). We
|
||||
/// hookup double-click event on the view to allow the user to edit the color.
|
||||
virtual Qt::ItemFlags flags(const QModelIndex &idx) const
|
||||
{
|
||||
return idx.column() > 0?
|
||||
this->Superclass::flags(idx) | Qt::ItemIsEditable:
|
||||
this->Superclass::flags(idx);
|
||||
}
|
||||
|
||||
virtual int rowCount(const QModelIndex &prnt=QModelIndex()) const
|
||||
{
|
||||
Q_UNUSED(prnt);
|
||||
return this->Items.size();
|
||||
}
|
||||
|
||||
virtual int columnCount(const QModelIndex &/*parent*/) const
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
virtual bool setData(const QModelIndex &idx, const QVariant &value, int role=Qt::EditRole)
|
||||
{
|
||||
Q_UNUSED(role);
|
||||
Q_ASSERT(idx.row() < this->rowCount());
|
||||
Q_ASSERT(idx.column() >= 0 && idx.column() < 3);
|
||||
if (this->Items[idx.row()].setData(idx.column(), value))
|
||||
{
|
||||
emit this->dataChanged(idx, idx);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual QVariant data(const QModelIndex& idx, int role=Qt::DisplayRole) const
|
||||
{
|
||||
if (role == Qt::DecorationRole || role == Qt::DisplayRole)
|
||||
{
|
||||
return this->Items[idx.row()].data(idx.column());
|
||||
}
|
||||
else if (role == Qt::EditRole)
|
||||
{
|
||||
return idx.column() == 0? this->Items[idx.row()].data(3) : this->Items[idx.row()].data(idx.column());
|
||||
}
|
||||
else if (role == Qt::ToolTipRole || role == Qt::StatusTipRole)
|
||||
{
|
||||
switch (idx.column())
|
||||
{
|
||||
case 0:
|
||||
return "Color";
|
||||
case 1:
|
||||
return "Data Value";
|
||||
case 2:
|
||||
return "Annotation Text";
|
||||
}
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role) const
|
||||
{
|
||||
if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
|
||||
{
|
||||
switch (section)
|
||||
{
|
||||
case 0:
|
||||
return "";
|
||||
case 1:
|
||||
return "Value";
|
||||
case 2:
|
||||
return "Annotation";
|
||||
}
|
||||
}
|
||||
return this->Superclass::headerData(section, orientation, role);
|
||||
}
|
||||
|
||||
// Add a new annotation text-pair after the given index. Returns the inserted
|
||||
// index.
|
||||
QModelIndex addAnnotation(const QModelIndex& after=QModelIndex())
|
||||
{
|
||||
int row = after.isValid()? after.row() : (this->rowCount(QModelIndex())-1);
|
||||
// insert after the current one.
|
||||
row++;
|
||||
|
||||
emit this->beginInsertRows(QModelIndex(), row, row);
|
||||
this->Items.insert(row, ItemType());
|
||||
emit this->endInsertRows();
|
||||
return this->index(row, 0);
|
||||
}
|
||||
|
||||
// Remove the given annotation indexes. Returns item before or after the removed
|
||||
// item, if any.
|
||||
QModelIndex removeAnnotations(const QModelIndexList& toRemove=QModelIndexList())
|
||||
{
|
||||
QSet<int> rowsToRemove;
|
||||
foreach (const QModelIndex& idx, toRemove)
|
||||
{
|
||||
rowsToRemove.insert(idx.row());
|
||||
}
|
||||
QList<int> rowsList = rowsToRemove.toList();
|
||||
for (int cc = (rowsList.size()-1); cc >=0; --cc)
|
||||
{
|
||||
emit this->beginRemoveRows(QModelIndex(), rowsList[cc], rowsList[cc]);
|
||||
this->Items.remove(rowsList[cc]);
|
||||
emit this->endRemoveRows();
|
||||
}
|
||||
if (rowsList.size() > 0 && rowsList.front() > this->Items.size())
|
||||
{
|
||||
return this->index(rowsList.front(), 0);
|
||||
}
|
||||
if (this->Items.size() > 0)
|
||||
{
|
||||
return this->index(this->Items.size()-1, 0);
|
||||
}
|
||||
return QModelIndex();
|
||||
}
|
||||
|
||||
void removeAllAnnotations()
|
||||
{
|
||||
emit this->beginResetModel();
|
||||
this->Items.clear();
|
||||
emit this->endResetModel();
|
||||
}
|
||||
|
||||
void setAnnotations(const QVector<vtkTuple<QString, 2> >& new_annotations)
|
||||
{
|
||||
int old_size = this->Items.size();
|
||||
int new_size = new_annotations.size();
|
||||
if (old_size > new_size)
|
||||
{
|
||||
// rows are removed.
|
||||
emit this->beginRemoveRows(QModelIndex(), new_size, old_size-1);
|
||||
this->Items.resize(new_size);
|
||||
emit this->endRemoveRows();
|
||||
}
|
||||
else if (new_size > old_size)
|
||||
{
|
||||
// rows are added.
|
||||
emit this->beginInsertRows(QModelIndex(), old_size, new_size-1);
|
||||
this->Items.resize(new_size);
|
||||
emit this->endInsertRows();
|
||||
}
|
||||
Q_ASSERT(this->Items.size() == new_annotations.size());
|
||||
|
||||
// now check for data changes.
|
||||
for (int cc=0; cc < this->Items.size(); cc++)
|
||||
{
|
||||
if (this->Items[cc].Value != new_annotations[cc][0])
|
||||
{
|
||||
this->Items[cc].Value = new_annotations[cc][0];
|
||||
emit this->dataChanged(this->index(cc, 1), this->index(cc, 1));
|
||||
}
|
||||
if (this->Items[cc].Annotation != new_annotations[cc][1])
|
||||
{
|
||||
this->Items[cc].Annotation = new_annotations[cc][1];
|
||||
emit this->dataChanged(this->index(cc, 2), this->index(cc, 2));
|
||||
}
|
||||
}
|
||||
}
|
||||
QVector<vtkTuple<QString, 2> > annotations() const
|
||||
{
|
||||
QVector<vtkTuple<QString, 2> > theAnnotations(this->Items.size());
|
||||
int cc=0;
|
||||
foreach (const ItemType& item, this->Items)
|
||||
{
|
||||
theAnnotations[cc].GetData()[0] = item.Value;
|
||||
theAnnotations[cc].GetData()[1] = item.Annotation;
|
||||
cc++;
|
||||
}
|
||||
return theAnnotations;
|
||||
}
|
||||
|
||||
void setIndexedColors(const QVector<QColor>& new_colors)
|
||||
{
|
||||
int old_size = this->Items.size();
|
||||
int new_size = new_colors.size();
|
||||
if (old_size > new_size)
|
||||
{
|
||||
// rows are removed.
|
||||
emit this->beginRemoveRows(QModelIndex(), new_size, old_size-1);
|
||||
this->Items.resize(new_size);
|
||||
emit this->endRemoveRows();
|
||||
}
|
||||
else if (new_size > old_size)
|
||||
{
|
||||
// rows are added.
|
||||
emit this->beginInsertRows(QModelIndex(), old_size, new_size-1);
|
||||
this->Items.resize(new_size);
|
||||
emit this->endInsertRows();
|
||||
}
|
||||
Q_ASSERT(this->Items.size() == new_colors.size());
|
||||
|
||||
// now check for data changes.
|
||||
for (int cc=0; cc < this->Items.size(); cc++)
|
||||
{
|
||||
if (this->Items[cc].Color != new_colors[cc])
|
||||
{
|
||||
this->Items[cc].setData(0, new_colors[cc]);
|
||||
emit this->dataChanged(this->index(cc, 0), this->index(cc, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
QVector<QColor> indexedColors() const
|
||||
{
|
||||
QVector<QColor> icolors (this->Items.size());
|
||||
int cc=0;
|
||||
foreach (const ItemType& item, this->Items)
|
||||
{
|
||||
icolors[cc] = item.Color;
|
||||
cc++;
|
||||
}
|
||||
return icolors;
|
||||
}
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqAnnotationsModel);
|
||||
};
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
class pqColorAnnotationsPropertyWidget::pqInternals
|
||||
{
|
||||
public:
|
||||
Ui::ColorAnnotationsPropertyWidget Ui;
|
||||
pqAnnotationsModel Model;
|
||||
vtkNew<vtkEventQtSlotConnect> VTKConnector;
|
||||
QPointer<pqColorAnnotationsPropertyWidgetDecorator> Decorator;
|
||||
|
||||
pqInternals(pqColorAnnotationsPropertyWidget* self)
|
||||
{
|
||||
this->Ui.setupUi(self);
|
||||
this->Ui.gridLayout->setMargin(pqPropertiesPanel::suggestedMargin());
|
||||
this->Ui.gridLayout->setVerticalSpacing(pqPropertiesPanel::suggestedVerticalSpacing());
|
||||
this->Ui.gridLayout->setHorizontalSpacing(pqPropertiesPanel::suggestedHorizontalSpacing());
|
||||
this->Ui.verticalLayout->setMargin(pqPropertiesPanel::suggestedMargin());
|
||||
this->Ui.verticalLayout->setSpacing(pqPropertiesPanel::suggestedVerticalSpacing());
|
||||
|
||||
this->Ui.AnnotationsTable->setModel(&this->Model);
|
||||
this->Ui.AnnotationsTable->horizontalHeader()->setHighlightSections(false);
|
||||
#if QT_VERSION >= 0x050000
|
||||
this->Ui.AnnotationsTable->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
#else
|
||||
this->Ui.AnnotationsTable->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
|
||||
#endif
|
||||
this->Ui.AnnotationsTable->horizontalHeader()->setStretchLastSection(true);
|
||||
|
||||
this->Decorator = new pqColorAnnotationsPropertyWidgetDecorator(NULL, self);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqColorAnnotationsPropertyWidget::pqColorAnnotationsPropertyWidget(
|
||||
vtkSMProxy* smproxy, vtkSMPropertyGroup* smgroup, QWidget* parentObject)
|
||||
: Superclass(smproxy, parentObject),
|
||||
Internals(new pqInternals(this))
|
||||
{
|
||||
Q_UNUSED(smgroup);
|
||||
|
||||
this->addPropertyLink(
|
||||
this, "annotations", SIGNAL(annotationsChanged()),
|
||||
smproxy->GetProperty("Annotations"));
|
||||
|
||||
this->addPropertyLink(
|
||||
this, "indexedColors", SIGNAL(indexedColorsChanged()),
|
||||
smproxy->GetProperty("IndexedColors"));
|
||||
|
||||
// if proxy has a property named IndexedLookup, "Color" can be controlled only
|
||||
// when IndexedLookup is ON.
|
||||
if (smproxy->GetProperty("IndexedLookup"))
|
||||
{
|
||||
// we are not controlling the IndexedLookup property, we are merely
|
||||
// observing it to ensure the UI is updated correctly. Hence we don't fire
|
||||
// any signal to update the smproperty.
|
||||
this->Internals->VTKConnector->Connect(
|
||||
smproxy->GetProperty("IndexedLookup"), vtkCommand::ModifiedEvent,
|
||||
this, SLOT(updateIndexedLookupState()));
|
||||
this->updateIndexedLookupState();
|
||||
|
||||
// Add decorator so the widget can be marked as advanced when IndexedLookup
|
||||
// is OFF.
|
||||
this->addDecorator(this->Internals->Decorator);
|
||||
}
|
||||
|
||||
// Hookup UI buttons.
|
||||
Ui::ColorAnnotationsPropertyWidget &ui = this->Internals->Ui;
|
||||
QObject::connect(ui.Add, SIGNAL(clicked()), this, SLOT(addAnnotation()));
|
||||
QObject::connect(ui.AddActive, SIGNAL(clicked()), this, SLOT(addActiveAnnotations()));
|
||||
QObject::connect(ui.AddActiveFromVisible, SIGNAL(clicked()),
|
||||
this, SLOT(addActiveAnnotationsFromVisibleSources()));
|
||||
QObject::connect(ui.Remove, SIGNAL(clicked()), this, SLOT(removeAnnotation()));
|
||||
QObject::connect(ui.DeleteAll, SIGNAL(clicked()), this, SLOT(removeAllAnnotations()));
|
||||
QObject::connect(ui.ChoosePreset, SIGNAL(clicked()), this, SLOT(choosePreset()));
|
||||
QObject::connect(ui.SaveAsPreset, SIGNAL(clicked()), this, SLOT(saveAsPreset()));
|
||||
|
||||
QObject::connect(&this->Internals->Model,
|
||||
SIGNAL(dataChanged(const QModelIndex &, const QModelIndex&)),
|
||||
this, SLOT(onDataChanged(const QModelIndex&, const QModelIndex&)));
|
||||
QObject::connect(
|
||||
ui.AnnotationsTable, SIGNAL(doubleClicked(const QModelIndex&)),
|
||||
this, SLOT(onDoubleClicked(const QModelIndex&)));
|
||||
QObject::connect(
|
||||
ui.AnnotationsTable, SIGNAL(editPastLastRow()),
|
||||
this, SLOT(editPastLastRow()));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqColorAnnotationsPropertyWidget::~pqColorAnnotationsPropertyWidget()
|
||||
{
|
||||
delete this->Internals;
|
||||
this->Internals = NULL;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorAnnotationsPropertyWidget::updateIndexedLookupState()
|
||||
{
|
||||
if (this->proxy()->GetProperty("IndexedLookup"))
|
||||
{
|
||||
bool val = vtkSMPropertyHelper(this->proxy(), "IndexedLookup").GetAsInt() != 0;
|
||||
this->Internals->Ui.AnnotationsTable->horizontalHeader()->setSectionHidden(0,
|
||||
!val);
|
||||
this->Internals->Ui.ChoosePreset->setVisible(val);
|
||||
this->Internals->Ui.SaveAsPreset->setVisible(val);
|
||||
this->Internals->Decorator->setIsAdvanced(!val);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorAnnotationsPropertyWidget::onDataChanged(
|
||||
const QModelIndex& topleft, const QModelIndex& btmright)
|
||||
{
|
||||
if (topleft.column() == 0)
|
||||
{
|
||||
emit this->indexedColorsChanged();
|
||||
}
|
||||
if (btmright.column() >= 1)
|
||||
{
|
||||
emit this->annotationsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorAnnotationsPropertyWidget::onDoubleClicked(const QModelIndex& idx)
|
||||
{
|
||||
if (idx.column() == 0)
|
||||
{
|
||||
QColor color = this->Internals->Model.data(idx,
|
||||
Qt::EditRole).value<QColor>();
|
||||
color = QColorDialog::getColor(color, this, "Choose Annotation Color",
|
||||
QColorDialog::DontUseNativeDialog);
|
||||
if (color.isValid())
|
||||
{
|
||||
this->Internals->Model.setData(idx, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
QList<QVariant> pqColorAnnotationsPropertyWidget::annotations() const
|
||||
{
|
||||
const QVector<vtkTuple<QString, 2> > &value =
|
||||
this->Internals->Model.annotations();
|
||||
|
||||
QList<QVariant> reply;
|
||||
for (int cc=0; cc < value.size(); cc++)
|
||||
{
|
||||
reply.push_back(value[cc].GetData()[0]);
|
||||
reply.push_back(value[cc].GetData()[1]);
|
||||
}
|
||||
return reply;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorAnnotationsPropertyWidget::setAnnotations(
|
||||
const QList<QVariant>& value)
|
||||
{
|
||||
QVector<vtkTuple<QString, 2> > annotationsData;
|
||||
annotationsData.resize(value.size()/2);
|
||||
|
||||
for (int cc=0; (cc+1) < value.size(); cc+=2)
|
||||
{
|
||||
annotationsData[cc/2].GetData()[0] = value[cc].toString();
|
||||
annotationsData[cc/2].GetData()[1] = value[cc+1].toString();
|
||||
}
|
||||
|
||||
this->Internals->Model.setAnnotations(annotationsData);
|
||||
|
||||
emit this->annotationsChanged();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
QList<QVariant> pqColorAnnotationsPropertyWidget::indexedColors() const
|
||||
{
|
||||
QList<QVariant> reply;
|
||||
QVector<QColor> colors = this->Internals->Model.indexedColors();
|
||||
foreach (const QColor& color, colors)
|
||||
{
|
||||
reply.push_back(color.redF());
|
||||
reply.push_back(color.greenF());
|
||||
reply.push_back(color.blueF());
|
||||
}
|
||||
return reply;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorAnnotationsPropertyWidget::setIndexedColors(
|
||||
const QList<QVariant>& value)
|
||||
{
|
||||
QVector<QColor> colors;
|
||||
colors.resize(value.size()/3);
|
||||
|
||||
for (int cc=0; (cc+2) < value.size(); cc+=3)
|
||||
{
|
||||
QColor color;
|
||||
color.setRgbF(value[cc].toDouble(),
|
||||
value[cc+1].toDouble(),
|
||||
value[cc+2].toDouble());
|
||||
colors[cc/3] = color;
|
||||
}
|
||||
|
||||
this->Internals->Model.setIndexedColors(colors);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorAnnotationsPropertyWidget::addAnnotation()
|
||||
{
|
||||
QModelIndex idx = this->Internals->Model.addAnnotation(
|
||||
this->Internals->Ui.AnnotationsTable->currentIndex());
|
||||
this->Internals->Ui.AnnotationsTable->setCurrentIndex(idx);
|
||||
emit this->annotationsChanged();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorAnnotationsPropertyWidget::editPastLastRow()
|
||||
{
|
||||
this->Internals->Model.addAnnotation(
|
||||
this->Internals->Ui.AnnotationsTable->currentIndex());
|
||||
emit this->annotationsChanged();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorAnnotationsPropertyWidget::removeAnnotation()
|
||||
{
|
||||
QModelIndexList indexes =
|
||||
this->Internals->Ui.AnnotationsTable->selectionModel()->selectedIndexes();
|
||||
if( indexes.size() == 0 )
|
||||
{
|
||||
// Nothing selected. Nothing to remove
|
||||
return;
|
||||
}
|
||||
QModelIndex idx = this->Internals->Model.removeAnnotations(indexes);
|
||||
this->Internals->Ui.AnnotationsTable->setCurrentIndex(idx);
|
||||
emit this->annotationsChanged();
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Given a list of existing annotations and a list of potentially new
|
||||
// annotations, merge the lists. The candidate annotations are first
|
||||
// selected to fill in empty annotation values in the existing
|
||||
// annotations list, then they are added to the end.
|
||||
//
|
||||
// mergedAnnotations - interleaved annotation array (value/label)
|
||||
// existingAnnotations - interleaved annotation array (value/label)
|
||||
// candidateValues - candidate array of just annotation values, possibly new
|
||||
void MergeAnnotations(QList<QVariant> & mergedAnnotations,
|
||||
const QList<QVariant> & existingAnnotations,
|
||||
const QList<QVariant> & candidateValues)
|
||||
{
|
||||
// Extract values from exisiting interleaved annotation list.
|
||||
QList<QVariant> existingValues;
|
||||
for (int idx = 0; idx < existingAnnotations.size()/2; ++idx)
|
||||
{
|
||||
existingValues.push_back(existingAnnotations[2*idx]);
|
||||
}
|
||||
|
||||
// Subset candidate annotations to only those not in existing annotations
|
||||
// Candidate values
|
||||
QList<QVariant> newCandidateValues;
|
||||
for (int idx = 0; idx < candidateValues.size(); ++idx)
|
||||
{
|
||||
if (!existingValues.contains(candidateValues[idx]))
|
||||
{
|
||||
newCandidateValues.push_back(candidateValues[idx]);
|
||||
}
|
||||
}
|
||||
|
||||
// Iterate over existing annotations, backfilling new candidates
|
||||
// in empty slots where possible.
|
||||
int candidateIdx = 0;
|
||||
for (int idx = 0; idx < existingValues.size(); ++idx)
|
||||
{
|
||||
if (existingValues[idx] == "" &&
|
||||
candidateIdx < newCandidateValues.size())
|
||||
{
|
||||
mergedAnnotations.push_back(newCandidateValues[candidateIdx]); // value
|
||||
mergedAnnotations.push_back(newCandidateValues[candidateIdx]); // annotation
|
||||
++candidateIdx;
|
||||
}
|
||||
else
|
||||
{
|
||||
mergedAnnotations.push_back(existingAnnotations[2*idx + 0]); // value
|
||||
mergedAnnotations.push_back(existingAnnotations[2*idx + 1]); // annotation
|
||||
}
|
||||
}
|
||||
|
||||
// Add any left over candidates
|
||||
for ( ; candidateIdx < newCandidateValues.size(); ++candidateIdx)
|
||||
{
|
||||
mergedAnnotations.push_back(newCandidateValues[candidateIdx]); // value
|
||||
mergedAnnotations.push_back(newCandidateValues[candidateIdx]); // annotation
|
||||
}
|
||||
}
|
||||
|
||||
} // end anonymous namespace
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorAnnotationsPropertyWidget::addActiveAnnotations()
|
||||
{
|
||||
try
|
||||
{
|
||||
// obtain prominent values from the server and add them
|
||||
pqDataRepresentation* repr =
|
||||
pqActiveObjects::instance().activeRepresentation();
|
||||
if (!repr)
|
||||
{
|
||||
throw 0;
|
||||
}
|
||||
|
||||
vtkPVProminentValuesInformation* info =
|
||||
vtkSMPVRepresentationProxy::GetProminentValuesInformationForColorArray(
|
||||
repr->getProxy());
|
||||
if (!info)
|
||||
{
|
||||
throw 0;
|
||||
}
|
||||
|
||||
int component_no = -1;
|
||||
if (QString("Component") ==
|
||||
vtkSMPropertyHelper(this->proxy(), "VectorMode", true).GetAsString())
|
||||
{
|
||||
component_no = vtkSMPropertyHelper(this->proxy(),
|
||||
"VectorComponent").GetAsInt();
|
||||
}
|
||||
if (component_no == -1 && info->GetNumberOfComponents() == 1)
|
||||
{
|
||||
component_no = 0;
|
||||
}
|
||||
|
||||
vtkSmartPointer<vtkAbstractArray> uniqueValues;
|
||||
uniqueValues.TakeReference(
|
||||
info->GetProminentComponentValues(component_no));
|
||||
if (uniqueValues == NULL)
|
||||
{
|
||||
throw 0;
|
||||
}
|
||||
|
||||
QList<QVariant> existingAnnotations = this->annotations();
|
||||
|
||||
QList<QVariant> candidateAnnotationValues;
|
||||
for (vtkIdType idx=0; idx < uniqueValues->GetNumberOfTuples(); idx++)
|
||||
{
|
||||
candidateAnnotationValues.push_back(uniqueValues->GetVariantValue(idx).ToString().c_str());
|
||||
}
|
||||
|
||||
// Combined annotation values (old and new)
|
||||
QList<QVariant> mergedAnnotations;
|
||||
MergeAnnotations(mergedAnnotations, existingAnnotations, candidateAnnotationValues);
|
||||
|
||||
// Set the merged annotations
|
||||
this->setAnnotations(mergedAnnotations);
|
||||
|
||||
}
|
||||
catch (int)
|
||||
{
|
||||
QMessageBox::warning(
|
||||
this, "Couldn't determine discrete values",
|
||||
"Could not determine discrete values using the data produced by the "
|
||||
"current source/filter. Please add annotations manually.",
|
||||
QMessageBox::Ok);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorAnnotationsPropertyWidget::addActiveAnnotationsFromVisibleSources()
|
||||
{
|
||||
try
|
||||
{
|
||||
pqServer* server =
|
||||
pqActiveObjects::instance().activeServer();
|
||||
if (!server)
|
||||
{
|
||||
throw 0;
|
||||
}
|
||||
|
||||
// obtain prominent values from all visible sources colored by the same
|
||||
// array name as the name of color array for the active representation.
|
||||
pqDataRepresentation* repr =
|
||||
pqActiveObjects::instance().activeRepresentation();
|
||||
if (!repr)
|
||||
{
|
||||
throw 0;
|
||||
}
|
||||
|
||||
vtkSMPVRepresentationProxy* activeRepresentationProxy =
|
||||
vtkSMPVRepresentationProxy::SafeDownCast(repr->getProxy());
|
||||
if (!activeRepresentationProxy)
|
||||
{
|
||||
throw 0;
|
||||
}
|
||||
|
||||
vtkPVArrayInformation* activeArrayInfo =
|
||||
vtkSMPVRepresentationProxy::GetArrayInformationForColorArray(activeRepresentationProxy);
|
||||
|
||||
vtkSMSessionProxyManager* pxm = server->proxyManager();
|
||||
|
||||
// Iterate over representations, collecting prominent values from each.
|
||||
QSet<QString> uniqueAnnotations;
|
||||
vtkSmartPointer<vtkCollection> collection = vtkSmartPointer<vtkCollection>::New();
|
||||
pxm->GetProxies("representations", collection);
|
||||
for (int i = 0; i < collection->GetNumberOfItems(); ++i)
|
||||
{
|
||||
vtkSMProxy* representationProxy =
|
||||
vtkSMProxy::SafeDownCast(collection->GetItemAsObject(i));
|
||||
if (!representationProxy || !vtkSMPropertyHelper(representationProxy, "Visibility").GetAsInt())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
vtkPVArrayInformation* currentArrayInfo =
|
||||
vtkSMPVRepresentationProxy::GetArrayInformationForColorArray(representationProxy);
|
||||
if (!activeArrayInfo || !activeArrayInfo->GetName() ||
|
||||
!currentArrayInfo || !currentArrayInfo->GetName() ||
|
||||
strcmp(activeArrayInfo->GetName(), currentArrayInfo->GetName()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
vtkPVProminentValuesInformation* info =
|
||||
vtkSMPVRepresentationProxy::GetProminentValuesInformationForColorArray(
|
||||
representationProxy);
|
||||
if (!info)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int component_no = -1;
|
||||
if (QString("Component") ==
|
||||
vtkSMPropertyHelper(this->proxy(), "VectorMode", true).GetAsString())
|
||||
{
|
||||
component_no = vtkSMPropertyHelper(this->proxy(),
|
||||
"VectorComponent").GetAsInt();
|
||||
}
|
||||
if (component_no == -1 && info->GetNumberOfComponents() == 1)
|
||||
{
|
||||
component_no = 0;
|
||||
}
|
||||
|
||||
vtkSmartPointer<vtkAbstractArray> uniqueValues;
|
||||
uniqueValues.TakeReference(
|
||||
info->GetProminentComponentValues(component_no));
|
||||
if (uniqueValues == NULL)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
for (vtkIdType idx=0; idx < uniqueValues->GetNumberOfTuples(); idx++)
|
||||
{
|
||||
QString value(uniqueValues->GetVariantValue(idx).ToString().c_str());
|
||||
uniqueAnnotations.insert(value);
|
||||
}
|
||||
}
|
||||
|
||||
QList<QString> uniqueList = uniqueAnnotations.values();
|
||||
qSort(uniqueList);
|
||||
|
||||
QList<QVariant> existingAnnotations = this->annotations();
|
||||
|
||||
QList<QVariant> candidateAnnotationValues;
|
||||
for (int idx=0; idx < uniqueList.size(); idx++)
|
||||
{
|
||||
candidateAnnotationValues.push_back(uniqueList[idx]);
|
||||
}
|
||||
|
||||
// Combined annotation values (old and new)
|
||||
QList<QVariant> mergedAnnotations;
|
||||
MergeAnnotations(mergedAnnotations, existingAnnotations, candidateAnnotationValues);
|
||||
|
||||
this->setAnnotations(mergedAnnotations);
|
||||
}
|
||||
catch (int)
|
||||
{
|
||||
QMessageBox::warning(
|
||||
this, "Couldn't determine discrete values",
|
||||
"Could not determine discrete values using the data produced by the "
|
||||
"current source/filter. Please add annotations manually.",
|
||||
QMessageBox::Ok);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorAnnotationsPropertyWidget::removeAllAnnotations()
|
||||
{
|
||||
this->Internals->Model.removeAllAnnotations();
|
||||
emit this->annotationsChanged();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorAnnotationsPropertyWidget::choosePreset(const char* presetName)
|
||||
{
|
||||
pqPresetDialog dialog(this, pqPresetDialog::SHOW_INDEXED_COLORS_ONLY);
|
||||
dialog.setCurrentPreset(presetName);
|
||||
dialog.setCustomizableLoadColors(false);
|
||||
dialog.setCustomizableLoadOpacities(false);
|
||||
dialog.setCustomizableUsePresetRange(false);
|
||||
dialog.setCustomizableLoadAnnotations(true);
|
||||
this->connect(&dialog, SIGNAL(applyPreset(const Json::Value&)), SLOT(applyCurrentPreset()));
|
||||
dialog.exec();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorAnnotationsPropertyWidget::applyCurrentPreset()
|
||||
{
|
||||
pqPresetDialog* dialog = qobject_cast<pqPresetDialog*>(this->sender());
|
||||
Q_ASSERT(dialog);
|
||||
|
||||
BEGIN_UNDO_SET("Apply color preset");
|
||||
vtkSMTransferFunctionProxy::ApplyPreset(this->proxy(),
|
||||
dialog->currentPreset(), !dialog->loadAnnotations());
|
||||
END_UNDO_SET();
|
||||
emit this->changeFinished();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorAnnotationsPropertyWidget::saveAsPreset()
|
||||
{
|
||||
QDialog dialog(this);
|
||||
Ui::SavePresetOptions ui;
|
||||
ui.setupUi(&dialog);
|
||||
ui.saveOpacities->setVisible(false);
|
||||
ui.saveAnnotations->setEnabled(
|
||||
vtkSMPropertyHelper(this->proxy(), "Annotations", true).GetNumberOfElements() > 0);
|
||||
|
||||
// For now, let's not provide an option to not save colors. We'll need to fix
|
||||
// the pqPresetToPixmap to support rendering only opacities.
|
||||
ui.saveColors->setChecked(true);
|
||||
ui.saveColors->setEnabled(false);
|
||||
ui.saveColors->hide();
|
||||
|
||||
if (dialog.exec() != QDialog::Accepted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Json::Value cpreset = vtkSMTransferFunctionProxy::GetStateAsPreset(this->proxy());
|
||||
if (!ui.saveAnnotations->isChecked())
|
||||
{
|
||||
cpreset.removeMember("Annotations");
|
||||
}
|
||||
vtkStdString presetName;
|
||||
if (!cpreset.isNull())
|
||||
{
|
||||
// This scoping is necessary to ensure that the vtkSMTransferFunctionPresets
|
||||
// saves the new preset to the "settings" before the choosePreset dialog is
|
||||
// shown.
|
||||
vtkNew<vtkSMTransferFunctionPresets> presets;
|
||||
presetName = presets->AddUniquePreset(cpreset);
|
||||
}
|
||||
this->choosePreset(presetName);
|
||||
}
|
||||
@ -0,0 +1,115 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: $RCSfile$
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqColorAnnotationsPropertyWidget_h
|
||||
#define pqColorAnnotationsPropertyWidget_h
|
||||
|
||||
#include "pqApplicationComponentsModule.h"
|
||||
#include "pqPropertyWidget.h"
|
||||
|
||||
class QModelIndex;
|
||||
class vtkSMPropertyGroup;
|
||||
|
||||
/// pqColorAnnotationsPropertyWidget is used to edit the Annotations property on the
|
||||
/// "PVLookupTable" proxy. The property group can comprise of two properties,
|
||||
/// \c Annotations and \c IndexedColors.
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqColorAnnotationsPropertyWidget :
|
||||
public pqPropertyWidget
|
||||
{
|
||||
Q_OBJECT;
|
||||
Q_PROPERTY(QList<QVariant> annotations READ annotations WRITE setAnnotations);
|
||||
Q_PROPERTY(QList<QVariant> indexedColors READ indexedColors WRITE setIndexedColors);
|
||||
|
||||
typedef pqPropertyWidget Superclass;
|
||||
public:
|
||||
pqColorAnnotationsPropertyWidget(
|
||||
vtkSMProxy* proxy, vtkSMPropertyGroup* smgroup, QWidget* parent=0);
|
||||
virtual ~pqColorAnnotationsPropertyWidget();
|
||||
|
||||
/// Get/Set the annotations. Annotations are returns as a QList<QVariant>.
|
||||
/// This is a list generated by flattening 2-tuples where 1st value is the
|
||||
/// annotated value and second is the annotation text.
|
||||
QList<QVariant> annotations() const;
|
||||
void setAnnotations(const QList<QVariant>&);
|
||||
|
||||
/// Get/Set the indexed colors. This is a list generated by flattening
|
||||
/// 3-tuples (r,g,b).
|
||||
QList<QVariant> indexedColors() const;
|
||||
void setIndexedColors(const QList<QVariant>&);
|
||||
|
||||
signals:
|
||||
/// Fired when the annotations are changed.
|
||||
void annotationsChanged();
|
||||
|
||||
/// Fired when the indexed colors are changed.
|
||||
void indexedColorsChanged();
|
||||
|
||||
private slots:
|
||||
/// slots called when user presses corresponding buttons to add/remove
|
||||
/// annotations.
|
||||
void addAnnotation();
|
||||
void removeAnnotation();
|
||||
void addActiveAnnotations();
|
||||
void addActiveAnnotationsFromVisibleSources();
|
||||
void removeAllAnnotations();
|
||||
|
||||
/// called whenever the internal model's data changes. We fire
|
||||
/// annotationsChanged() or indexedColorsChanged() signals appropriately.
|
||||
void onDataChanged(const QModelIndex& topleft, const QModelIndex& btmright);
|
||||
|
||||
/// called when user double-clicks on an item. If the double click is on the
|
||||
/// 0-th column, we show the color editor to allow editing of the indexed
|
||||
/// color.
|
||||
void onDoubleClicked(const QModelIndex& idx);
|
||||
|
||||
/// pick a preset.
|
||||
void choosePreset(const char* presetName=NULL);
|
||||
|
||||
/// save current transfer function as preset.
|
||||
void saveAsPreset();
|
||||
|
||||
/// apply a present.
|
||||
void applyCurrentPreset();
|
||||
|
||||
/// Ensures that the color-swatches for indexedColors are shown only when this
|
||||
/// is set to true.
|
||||
void updateIndexedLookupState();
|
||||
|
||||
/// called when the user edits past the last row.
|
||||
void editPastLastRow();
|
||||
private:
|
||||
Q_DISABLE_COPY(pqColorAnnotationsPropertyWidget);
|
||||
|
||||
class pqInternals;
|
||||
pqInternals* Internals;
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,106 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqColorEditorPropertyWidget.h
|
||||
|
||||
Copyright (c) 2005-2012 Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=========================================================================*/
|
||||
#include "pqColorEditorPropertyWidget.h"
|
||||
#include "ui_pqColorEditorPropertyWidget.h"
|
||||
|
||||
#include "pqApplicationCore.h"
|
||||
#include "pqDataRepresentation.h"
|
||||
#include "pqEditColorMapReaction.h"
|
||||
#include "pqPropertiesPanel.h"
|
||||
#include "pqResetScalarRangeReaction.h"
|
||||
#include "pqScalarBarVisibilityReaction.h"
|
||||
#include "pqServerManagerModel.h"
|
||||
|
||||
class pqColorEditorPropertyWidget::pqInternals
|
||||
{
|
||||
public:
|
||||
Ui::ColorEditorPropertyWidget Ui;
|
||||
QPointer<QAction> ScalarBarVisibilityAction;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqColorEditorPropertyWidget::pqColorEditorPropertyWidget(vtkSMProxy *smProxy,
|
||||
QWidget *parentObject) :
|
||||
Superclass(smProxy, parentObject),
|
||||
Internals(new pqColorEditorPropertyWidget::pqInternals())
|
||||
{
|
||||
this->setShowLabel(true);
|
||||
|
||||
Ui::ColorEditorPropertyWidget &Ui = this->Internals->Ui;
|
||||
Ui.setupUi(this);
|
||||
Ui.gridLayout->setMargin(pqPropertiesPanel::suggestedMargin());
|
||||
Ui.gridLayout->setHorizontalSpacing(pqPropertiesPanel::suggestedHorizontalSpacing());
|
||||
Ui.gridLayout->setVerticalSpacing(pqPropertiesPanel::suggestedVerticalSpacing());
|
||||
|
||||
// Setup various widget properties.
|
||||
pqServerManagerModel *smm = pqApplicationCore::instance()->getServerManagerModel();
|
||||
pqProxy *pqproxy = smm->findItem<pqProxy *>(smProxy);
|
||||
pqDataRepresentation *representation = qobject_cast<pqDataRepresentation*>(pqproxy);
|
||||
Ui.DisplayColorWidget->setRepresentation(representation);
|
||||
|
||||
// show scalar bar button
|
||||
QAction *scalarBarAction = new QAction(this);
|
||||
this->Internals->ScalarBarVisibilityAction = scalarBarAction;
|
||||
QObject::connect(Ui.ShowScalarBar, SIGNAL(clicked(bool)), scalarBarAction, SLOT(trigger()));
|
||||
QObject::connect(scalarBarAction, SIGNAL(changed()),
|
||||
this, SLOT(updateEnableState()));
|
||||
QObject::connect(scalarBarAction, SIGNAL(toggled(bool)),
|
||||
Ui.ShowScalarBar, SLOT(setChecked(bool)));
|
||||
new pqScalarBarVisibilityReaction(scalarBarAction);
|
||||
|
||||
|
||||
// edit color map button
|
||||
QAction *editColorMapAction = new QAction(this);
|
||||
QObject::connect(Ui.EditColorMap, SIGNAL(clicked()), editColorMapAction, SLOT(trigger()));
|
||||
new pqEditColorMapReaction(editColorMapAction);
|
||||
|
||||
// reset range button
|
||||
QAction *resetRangeAction = new QAction(this);
|
||||
QObject::connect(Ui.Rescale, SIGNAL(clicked()), resetRangeAction, SLOT(trigger()));
|
||||
new pqResetScalarRangeReaction(resetRangeAction);
|
||||
|
||||
this->updateEnableState();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqColorEditorPropertyWidget::~pqColorEditorPropertyWidget()
|
||||
{
|
||||
delete this->Internals;
|
||||
this->Internals = NULL;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorEditorPropertyWidget::updateEnableState()
|
||||
{
|
||||
this->Internals->Ui.ShowScalarBar->setEnabled(
|
||||
this->Internals->ScalarBarVisibilityAction->isEnabled());
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqColorEditorPropertyWidget.h
|
||||
|
||||
Copyright (c) 2005-2012 Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=========================================================================*/
|
||||
#ifndef _pqColorEditorPropertyWidget_h
|
||||
#define _pqColorEditorPropertyWidget_h
|
||||
|
||||
#include "pqApplicationComponentsModule.h"
|
||||
#include "pqPropertyWidget.h"
|
||||
|
||||
/// This is a pqPropertyWidget subclass that presents a widget to edit the color
|
||||
/// of a representation and other related functionality. It's used as the
|
||||
/// "widget" for \c ColorEditor property group.
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqColorEditorPropertyWidget : public pqPropertyWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
typedef pqPropertyWidget Superclass;
|
||||
|
||||
pqColorEditorPropertyWidget(vtkSMProxy *proxy, QWidget *parent = 0);
|
||||
~pqColorEditorPropertyWidget();
|
||||
|
||||
private slots:
|
||||
void updateEnableState();
|
||||
|
||||
private:
|
||||
class pqInternals;
|
||||
pqInternals* Internals;
|
||||
|
||||
Q_DISABLE_COPY(pqColorEditorPropertyWidget)
|
||||
};
|
||||
|
||||
#endif // _pqColorEditorPropertyWidget_h
|
||||
415
ParaView-5.0.1/Qt/ApplicationComponents/pqColorMapEditor.cxx
Normal file
415
ParaView-5.0.1/Qt/ApplicationComponents/pqColorMapEditor.cxx
Normal file
@ -0,0 +1,415 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: $RCSfile$
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqColorMapEditor.h"
|
||||
#include "ui_pqColorMapEditor.h"
|
||||
|
||||
#include "pqActiveObjects.h"
|
||||
#include "pqApplicationCore.h"
|
||||
#include "pqDataRepresentation.h"
|
||||
#include "pqProxyWidgetDialog.h"
|
||||
#include "pqProxyWidget.h"
|
||||
#include "pqScalarBarVisibilityReaction.h"
|
||||
#include "pqSearchBox.h"
|
||||
#include "pqSettings.h"
|
||||
#include "pqSMAdaptor.h"
|
||||
#include "pqUndoStack.h"
|
||||
|
||||
#include "vtkCommand.h"
|
||||
#include "vtkPVArrayInformation.h"
|
||||
#include "vtkSMCoreUtilities.h"
|
||||
#include "vtkSMProperty.h"
|
||||
#include "vtkSMPropertyHelper.h"
|
||||
#include "vtkSMPVRepresentationProxy.h"
|
||||
#include "vtkSMSettings.h"
|
||||
#include "vtkSMTransferFunctionProxy.h"
|
||||
#include "vtkWeakPointer.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QKeyEvent>
|
||||
#include <QPointer>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
class pqColorMapEditor::pqInternals
|
||||
{
|
||||
public:
|
||||
Ui::ColorMapEditor Ui;
|
||||
QPointer<pqProxyWidget> ProxyWidget;
|
||||
QPointer<pqDataRepresentation> ActiveRepresentation;
|
||||
QPointer<QAction> ScalarBarVisibilityAction;
|
||||
unsigned long ObserverId;
|
||||
|
||||
pqInternals(pqColorMapEditor* self) : ObserverId(0)
|
||||
{
|
||||
this->Ui.setupUi(self);
|
||||
this->Ui.RestoreDefaults->setIcon(
|
||||
self->style()->standardIcon(QStyle::SP_BrowserReload));
|
||||
|
||||
QVBoxLayout* vbox = new QVBoxLayout(this->Ui.PropertiesFrame);
|
||||
vbox->setMargin(0);
|
||||
vbox->setSpacing(0);
|
||||
}
|
||||
|
||||
~pqInternals()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqColorMapEditor::pqColorMapEditor(QWidget* parentObject)
|
||||
: Superclass(parentObject),
|
||||
Internals(new pqColorMapEditor::pqInternals(this))
|
||||
{
|
||||
QObject::connect(this->Internals->Ui.SearchBox,
|
||||
SIGNAL(advancedSearchActivated(bool)),
|
||||
this, SLOT(updatePanel()));
|
||||
QObject::connect(this->Internals->Ui.SearchBox, SIGNAL(textChanged(QString)),
|
||||
this, SLOT(updatePanel()));
|
||||
QObject::connect(this->Internals->Ui.EditScalarBar, SIGNAL(clicked()),
|
||||
this, SLOT(editScalarBar()));
|
||||
QObject::connect(this->Internals->Ui.RestoreDefaults, SIGNAL(clicked()),
|
||||
this, SLOT(restoreDefaults()));
|
||||
QObject::connect(this->Internals->Ui.SaveAsDefaults, SIGNAL(clicked()),
|
||||
this, SLOT(saveAsDefault()));
|
||||
QObject::connect(this->Internals->Ui.SaveAsArrayDefaults, SIGNAL(clicked()),
|
||||
this, SLOT(saveAsArrayDefault()));
|
||||
QObject::connect(this->Internals->Ui.AutoUpdate, SIGNAL(clicked(bool)),
|
||||
this, SLOT(setAutoUpdate(bool)));
|
||||
QObject::connect(this->Internals->Ui.Update, SIGNAL(clicked()),
|
||||
this, SLOT(renderViews()));
|
||||
|
||||
// Let pqScalarBarVisibilityReaction do the heavy lifting for managing the
|
||||
// show-scalar bar button.
|
||||
QAction* showSBAction = new QAction(this);
|
||||
this->Internals->ScalarBarVisibilityAction = showSBAction;
|
||||
this->Internals->Ui.ShowScalarBar->connect(
|
||||
showSBAction, SIGNAL(toggled(bool)), SLOT(setChecked(bool)));
|
||||
showSBAction->connect(
|
||||
this->Internals->Ui.ShowScalarBar, SIGNAL(clicked(bool)), SLOT(trigger()));
|
||||
this->connect(showSBAction, SIGNAL(changed()), SLOT(updateScalarBarButtons()));
|
||||
new pqScalarBarVisibilityReaction(showSBAction);
|
||||
|
||||
pqActiveObjects *activeObjects = &pqActiveObjects::instance();
|
||||
this->connect(activeObjects, SIGNAL(representationChanged(pqDataRepresentation*)),
|
||||
this, SLOT(updateActive()));
|
||||
|
||||
pqSettings *settings = pqApplicationCore::instance()->settings();
|
||||
if (settings)
|
||||
{
|
||||
this->Internals->Ui.AutoUpdate->setChecked(
|
||||
settings->value("autoUpdateColorMapEditor2", true).toBool());
|
||||
}
|
||||
this->updateActive();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqColorMapEditor::~pqColorMapEditor()
|
||||
{
|
||||
pqSettings *settings = pqApplicationCore::instance()->settings();
|
||||
if (settings)
|
||||
{
|
||||
// save the state of advanced button in the user config.
|
||||
settings->setValue("autoUpdateColorMapEditor2",
|
||||
this->Internals->Ui.AutoUpdate->isChecked());
|
||||
}
|
||||
|
||||
delete this->Internals;
|
||||
this->Internals = NULL;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorMapEditor::updatePanel()
|
||||
{
|
||||
if (this->Internals->ProxyWidget)
|
||||
{
|
||||
this->Internals->ProxyWidget->filterWidgets(
|
||||
this->Internals->Ui.SearchBox->isAdvancedSearchActive(),
|
||||
this->Internals->Ui.SearchBox->text());
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorMapEditor::updateActive()
|
||||
{
|
||||
pqDataRepresentation* repr =
|
||||
pqActiveObjects::instance().activeRepresentation();
|
||||
|
||||
this->setDataRepresentation(repr);
|
||||
|
||||
QString arrayNameLabel("Array Name: ");
|
||||
|
||||
// Set the current LUT proxy to edit.
|
||||
if (repr && vtkSMPVRepresentationProxy::GetUsingScalarColoring(repr->getProxy()))
|
||||
{
|
||||
this->setColorTransferFunction(
|
||||
vtkSMPropertyHelper(repr->getProxy(), "LookupTable", true).GetAsProxy());
|
||||
|
||||
vtkPVArrayInformation* arrayInfo =
|
||||
vtkSMPVRepresentationProxy::GetArrayInformationForColorArray(repr->getProxy());
|
||||
if (arrayInfo)
|
||||
{
|
||||
arrayNameLabel.append(arrayInfo->GetName());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this->setColorTransferFunction(NULL);
|
||||
arrayNameLabel.append("<none>");
|
||||
}
|
||||
|
||||
this->Internals->Ui.ArrayLabel->setText(arrayNameLabel);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorMapEditor::setDataRepresentation(pqDataRepresentation* repr)
|
||||
{
|
||||
// this method sets up hooks to ensure that when the repr's properties are
|
||||
// modified, the editor shows the correct LUT.
|
||||
if (this->Internals->ActiveRepresentation == repr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->Internals->ActiveRepresentation)
|
||||
{
|
||||
// disconnect signals.
|
||||
if (this->Internals->ObserverId)
|
||||
{
|
||||
this->Internals->ActiveRepresentation->getProxy()->RemoveObserver(
|
||||
this->Internals->ObserverId);
|
||||
}
|
||||
}
|
||||
|
||||
this->Internals->ObserverId = 0;
|
||||
this->Internals->ActiveRepresentation = repr;
|
||||
if (repr && repr->getProxy())
|
||||
{
|
||||
this->Internals->ObserverId = repr->getProxy()->AddObserver(
|
||||
vtkCommand::PropertyModifiedEvent, this, &pqColorMapEditor::updateActive);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorMapEditor::setColorTransferFunction(vtkSMProxy* ctf)
|
||||
{
|
||||
Ui::ColorMapEditor& ui = this->Internals->Ui;
|
||||
|
||||
if (this->Internals->ProxyWidget == NULL && ctf == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (this->Internals->ProxyWidget && ctf &&
|
||||
this->Internals->ProxyWidget->proxy() == ctf)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( (ctf==NULL && this->Internals->ProxyWidget) ||
|
||||
(this->Internals->ProxyWidget && ctf && this->Internals->ProxyWidget->proxy() != ctf))
|
||||
{
|
||||
ui.PropertiesFrame->layout()->removeWidget(this->Internals->ProxyWidget);
|
||||
delete this->Internals->ProxyWidget;
|
||||
}
|
||||
|
||||
ui.RestoreDefaults->setEnabled(ctf != NULL);
|
||||
ui.SaveAsDefaults->setEnabled(ctf != NULL);
|
||||
ui.SaveAsArrayDefaults->setEnabled(ctf != NULL);
|
||||
if (!ctf)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
pqProxyWidget* widget = new pqProxyWidget(ctf, this);
|
||||
widget->setObjectName("Properties");
|
||||
widget->setApplyChangesImmediately(true);
|
||||
widget->filterWidgets();
|
||||
|
||||
ui.PropertiesFrame->layout()->addWidget(widget);
|
||||
|
||||
this->Internals->ProxyWidget = widget;
|
||||
this->updatePanel();
|
||||
|
||||
QObject::connect(widget, SIGNAL(changeFinished()), this, SLOT(updateIfNeeded()));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorMapEditor::updateScalarBarButtons()
|
||||
{
|
||||
Ui::ColorMapEditor& ui = this->Internals->Ui;
|
||||
bool can_show_sb = this->Internals->ScalarBarVisibilityAction->isEnabled();
|
||||
ui.ShowScalarBar->setEnabled(can_show_sb);
|
||||
ui.EditScalarBar->setEnabled(can_show_sb &&
|
||||
this->Internals->ScalarBarVisibilityAction->isChecked());
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorMapEditor::editScalarBar()
|
||||
{
|
||||
Q_ASSERT(this->Internals->ProxyWidget && this->Internals->ActiveRepresentation);
|
||||
|
||||
vtkSMProxy* lutProxy = this->Internals->ProxyWidget->proxy();
|
||||
vtkSMProxy* viewProxy = this->Internals->ActiveRepresentation->getView()->getProxy();
|
||||
vtkSMProxy* sbProxy = vtkSMTransferFunctionProxy::FindScalarBarRepresentation(lutProxy, viewProxy);
|
||||
if (sbProxy)
|
||||
{
|
||||
pqProxyWidgetDialog dialog(sbProxy);
|
||||
QObject::connect(&dialog, SIGNAL(accepted()),
|
||||
this, SLOT(renderViews()));
|
||||
dialog.setWindowTitle("Edit Color Legend Parameters");
|
||||
dialog.setObjectName("ColorLegendEditor");
|
||||
dialog.exec();
|
||||
}
|
||||
else
|
||||
{
|
||||
qCritical("Failed to locate scalar bar proxy. Ignoring.");
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorMapEditor::renderViews()
|
||||
{
|
||||
if (this->Internals->ActiveRepresentation)
|
||||
{
|
||||
this->Internals->ActiveRepresentation->renderViewEventually();
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorMapEditor::saveAsDefault()
|
||||
{
|
||||
vtkSMSettings* settings = vtkSMSettings::GetInstance();
|
||||
|
||||
vtkSMProxy* proxy = this->Internals->ActiveRepresentation->getProxy();
|
||||
if (!proxy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
vtkSMProxy* lutProxy =
|
||||
pqSMAdaptor::getProxyProperty(proxy->GetProperty("LookupTable"));
|
||||
if (lutProxy)
|
||||
{
|
||||
settings->SetProxySettings(lutProxy);
|
||||
}
|
||||
else
|
||||
{
|
||||
qCritical() << "No LookupTable property found.";
|
||||
}
|
||||
|
||||
vtkSMProxy* scalarOpacityFunctionProxy = lutProxy?
|
||||
pqSMAdaptor::getProxyProperty(lutProxy->GetProperty("ScalarOpacityFunction")) : NULL;
|
||||
if (scalarOpacityFunctionProxy)
|
||||
{
|
||||
settings->SetProxySettings(scalarOpacityFunctionProxy);
|
||||
}
|
||||
else
|
||||
{
|
||||
qCritical("No ScalarOpacityFunction property found");
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorMapEditor::saveAsArrayDefault()
|
||||
{
|
||||
vtkSMSettings* settings = vtkSMSettings::GetInstance();
|
||||
|
||||
vtkSMProxy* proxy = this->Internals->ActiveRepresentation->getProxy();
|
||||
if (!proxy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
vtkSMPropertyHelper colorArrayHelper(proxy, "ColorArrayName");
|
||||
|
||||
vtkSMProxy* lutProxy =
|
||||
pqSMAdaptor::getProxyProperty(proxy->GetProperty("LookupTable"));
|
||||
if (lutProxy)
|
||||
{
|
||||
// Remove special characters from the array name
|
||||
std::string sanitizedArrayName =
|
||||
vtkSMCoreUtilities::SanitizeName(colorArrayHelper.GetInputArrayNameToProcess());
|
||||
|
||||
std::ostringstream prefix;
|
||||
prefix << ".array_" << lutProxy->GetXMLGroup() << "." << sanitizedArrayName;
|
||||
|
||||
settings->SetProxySettings(prefix.str().c_str(), lutProxy);
|
||||
}
|
||||
else
|
||||
{
|
||||
qCritical() << "No LookupTable property found.";
|
||||
}
|
||||
|
||||
vtkSMProxy* scalarOpacityFunctionProxy = lutProxy?
|
||||
pqSMAdaptor::getProxyProperty(lutProxy->GetProperty("ScalarOpacityFunction")) : NULL;
|
||||
if (scalarOpacityFunctionProxy)
|
||||
{
|
||||
settings->SetProxySettings(scalarOpacityFunctionProxy);
|
||||
}
|
||||
else
|
||||
{
|
||||
qCritical("No ScalarOpacityFunction property found");
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorMapEditor::restoreDefaults()
|
||||
{
|
||||
vtkSMProxy* proxy = this->Internals->ActiveRepresentation->getProxy();
|
||||
BEGIN_UNDO_SET("Reset color map to defaults");
|
||||
if (vtkSMProxy* lutProxy = vtkSMPropertyHelper(proxy, "LookupTable").GetAsProxy())
|
||||
{
|
||||
vtkSMTransferFunctionProxy::ResetPropertiesToXMLDefaults(lutProxy, true);
|
||||
if (vtkSMProxy* sofProxy = vtkSMPropertyHelper(lutProxy, "ScalarOpacityFunction").GetAsProxy())
|
||||
{
|
||||
vtkSMTransferFunctionProxy::ResetPropertiesToXMLDefaults(sofProxy, true);
|
||||
}
|
||||
}
|
||||
END_UNDO_SET();
|
||||
this->renderViews();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorMapEditor::setAutoUpdate(bool val)
|
||||
{
|
||||
this->Internals->Ui.AutoUpdate->setChecked(val);
|
||||
this->updateIfNeeded();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorMapEditor::updateIfNeeded()
|
||||
{
|
||||
if (this->Internals->Ui.AutoUpdate->isChecked())
|
||||
{
|
||||
this->renderViews();
|
||||
}
|
||||
}
|
||||
96
ParaView-5.0.1/Qt/ApplicationComponents/pqColorMapEditor.h
Normal file
96
ParaView-5.0.1/Qt/ApplicationComponents/pqColorMapEditor.h
Normal file
@ -0,0 +1,96 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: $RCSfile$
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqColorMapEditor_h
|
||||
#define pqColorMapEditor_h
|
||||
|
||||
#include "pqApplicationComponentsModule.h"
|
||||
#include <QWidget>
|
||||
|
||||
class vtkSMProxy;
|
||||
class pqDataRepresentation;
|
||||
|
||||
/// pqColorMapEditor is a widget that can be used to edit the active color-map,
|
||||
/// if any. The panel is implemented as an auto-generated panel (similar to the
|
||||
/// Properties panel) that shows the properties on the lookup-table proxy.
|
||||
/// Custom widgets such as pqColorOpacityEditorWidget,
|
||||
/// pqColorAnnotationsPropertyWidget, and others are used to
|
||||
/// control certain properties on the proxy.
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqColorMapEditor : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef QWidget Superclass;
|
||||
public:
|
||||
pqColorMapEditor(QWidget* parent=0);
|
||||
virtual ~pqColorMapEditor();
|
||||
|
||||
protected slots:
|
||||
/// slot called to update the currently showing proxies.
|
||||
void updateActive();
|
||||
|
||||
/// slot called to update the visible widgets.
|
||||
void updatePanel();
|
||||
|
||||
/// render's view when transfer function is modified.
|
||||
void renderViews();
|
||||
|
||||
/// Pops up the scalar bar edit widget.
|
||||
void editScalarBar();
|
||||
|
||||
/// Save the current transfer function(s) as default.
|
||||
void saveAsDefault();
|
||||
|
||||
/// Save the current transfer function(s) as default for arrays with
|
||||
/// the same name as the selected array.
|
||||
void saveAsArrayDefault();
|
||||
|
||||
/// Restore the defaults (undoes effects of saveAsDefault()).
|
||||
void restoreDefaults();
|
||||
|
||||
/// called when AutoUpdate button is toggled.
|
||||
void setAutoUpdate(bool);
|
||||
|
||||
void updateIfNeeded();
|
||||
protected:
|
||||
void setDataRepresentation(pqDataRepresentation* repr);
|
||||
void setColorTransferFunction(vtkSMProxy* ctf);
|
||||
protected slots:
|
||||
/// update the enabled state for show/edit scalar bar buttons.
|
||||
void updateScalarBarButtons();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqColorMapEditor)
|
||||
class pqInternals;
|
||||
pqInternals* Internals;
|
||||
friend class pqInternals;
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,854 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: $RCSfile$
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqColorOpacityEditorWidget.h"
|
||||
#include "ui_pqColorOpacityEditorWidget.h"
|
||||
#include "ui_pqSavePresetOptions.h"
|
||||
|
||||
#include "pqActiveObjects.h"
|
||||
#include "pqColorTableModel.h"
|
||||
#include "pqDataRepresentation.h"
|
||||
#include "pqOpacityTableModel.h"
|
||||
#include "pqPipelineRepresentation.h"
|
||||
#include "pqPresetDialog.h"
|
||||
#include "pqPropertiesPanel.h"
|
||||
#include "pqPropertyWidgetDecorator.h"
|
||||
#include "pqRescaleRange.h"
|
||||
#include "pqSettings.h"
|
||||
#include "pqTransferFunctionWidget.h"
|
||||
#include "pqUndoStack.h"
|
||||
#include "vtkCommand.h"
|
||||
#include "vtkDiscretizableColorTransferFunction.h"
|
||||
#include "vtkEventQtSlotConnect.h"
|
||||
#include "vtkNew.h"
|
||||
#include "vtkPiecewiseFunction.h"
|
||||
#include "vtkPVXMLElement.h"
|
||||
#include "vtkSMPropertyGroup.h"
|
||||
#include "vtkSMProperty.h"
|
||||
#include "vtkSMPropertyHelper.h"
|
||||
#include "vtkSMPVRepresentationProxy.h"
|
||||
#include "vtkSMRenderViewProxy.h"
|
||||
#include "vtkSMSessionProxyManager.h"
|
||||
#include "vtkSMTransferFunctionPresets.h"
|
||||
#include "vtkSMTransferFunctionProxy.h"
|
||||
#include "vtkVector.h"
|
||||
#include "vtkWeakPointer.h"
|
||||
#include "vtk_jsoncpp.h"
|
||||
|
||||
#include <QDoubleValidator>
|
||||
#include <QMessageBox>
|
||||
#include <QPointer>
|
||||
#include <QtDebug>
|
||||
#include <QTimer>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
namespace
|
||||
{
|
||||
//-----------------------------------------------------------------------------
|
||||
// Decorator used to hide the widget when using IndexedLookup.
|
||||
class pqColorOpacityEditorWidgetDecorator : public pqPropertyWidgetDecorator
|
||||
{
|
||||
typedef pqPropertyWidgetDecorator Superclass;
|
||||
bool Hidden;
|
||||
public:
|
||||
pqColorOpacityEditorWidgetDecorator(vtkPVXMLElement* xmlArg, pqPropertyWidget* parentArg)
|
||||
: Superclass(xmlArg, parentArg), Hidden(false)
|
||||
{
|
||||
}
|
||||
virtual ~pqColorOpacityEditorWidgetDecorator()
|
||||
{
|
||||
}
|
||||
|
||||
void setHidden(bool val)
|
||||
{
|
||||
if (val != this->Hidden) { this->Hidden = val; emit this->visibilityChanged(); }
|
||||
}
|
||||
virtual bool canShowWidget(bool show_advanced) const
|
||||
{
|
||||
Q_UNUSED(show_advanced);
|
||||
return !this->Hidden;
|
||||
}
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqColorOpacityEditorWidgetDecorator);
|
||||
};
|
||||
|
||||
} // end anonymous namespace
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
class pqColorOpacityEditorWidget::pqInternals
|
||||
{
|
||||
public:
|
||||
Ui::ColorOpacityEditorWidget Ui;
|
||||
pqColorTableModel ColorTableModel;
|
||||
pqOpacityTableModel OpacityTableModel;
|
||||
QPointer<pqColorOpacityEditorWidgetDecorator> Decorator;
|
||||
vtkWeakPointer<vtkSMPropertyGroup> PropertyGroup;
|
||||
vtkWeakPointer<vtkSMProxy> ScalarOpacityFunctionProxy;
|
||||
|
||||
// We use this pqPropertyLinks instance to simply monitor smproperty changes.
|
||||
pqPropertyLinks LinksForMonitoringChanges;
|
||||
vtkNew<vtkEventQtSlotConnect> VTKConnector;
|
||||
|
||||
pqInternals(pqColorOpacityEditorWidget* self, vtkSMPropertyGroup* group)
|
||||
: ColorTableModel(self), OpacityTableModel(self), PropertyGroup(group)
|
||||
{
|
||||
this->Ui.setupUi(self);
|
||||
this->Ui.CurrentDataValue->setValidator(new QDoubleValidator(self));
|
||||
this->Ui.mainLayout->setMargin(pqPropertiesPanel::suggestedMargin());
|
||||
//this->Ui.mainLayout->setSpacing(
|
||||
// pqPropertiesPanel::suggestedVerticalSpacing());
|
||||
|
||||
this->Decorator = new pqColorOpacityEditorWidgetDecorator(NULL, self);
|
||||
|
||||
this->Ui.ColorTable->setModel(&this->ColorTableModel);
|
||||
this->Ui.ColorTable->horizontalHeader()->setHighlightSections(false);
|
||||
#if QT_VERSION >= 0x050000
|
||||
this->Ui.ColorTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
#else
|
||||
this->Ui.ColorTable->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
|
||||
#endif
|
||||
this->Ui.ColorTable->horizontalHeader()->setStretchLastSection(true);
|
||||
|
||||
this->Ui.OpacityTable->setModel(&this->OpacityTableModel);
|
||||
this->Ui.OpacityTable->horizontalHeader()->setHighlightSections(false);
|
||||
#if QT_VERSION >= 0x050000
|
||||
this->Ui.OpacityTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
#else
|
||||
this->Ui.OpacityTable->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
|
||||
#endif
|
||||
this->Ui.OpacityTable->horizontalHeader()->setStretchLastSection(true);
|
||||
}
|
||||
|
||||
void render()
|
||||
{
|
||||
pqDataRepresentation* repr =
|
||||
pqActiveObjects::instance().activeRepresentation();
|
||||
if (repr)
|
||||
{
|
||||
repr->renderViewEventually();
|
||||
return;
|
||||
}
|
||||
pqView* activeView = pqActiveObjects::instance().activeView();
|
||||
if (activeView)
|
||||
{
|
||||
activeView->render();
|
||||
return;
|
||||
}
|
||||
pqApplicationCore::instance()->render();
|
||||
}
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqColorOpacityEditorWidget::pqColorOpacityEditorWidget(
|
||||
vtkSMProxy* smproxy, vtkSMPropertyGroup* smgroup, QWidget* parentObject)
|
||||
: Superclass(smproxy, parentObject),
|
||||
Internals(new pqInternals(this, smgroup))
|
||||
{
|
||||
Ui::ColorOpacityEditorWidget &ui = this->Internals->Ui;
|
||||
vtkDiscretizableColorTransferFunction* stc =
|
||||
vtkDiscretizableColorTransferFunction::SafeDownCast(
|
||||
this->proxy()->GetClientSideObject());
|
||||
if (stc)
|
||||
{
|
||||
ui.ColorEditor->initialize(stc, true, NULL, false);
|
||||
QObject::connect(
|
||||
&this->Internals->ColorTableModel,
|
||||
SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)),
|
||||
this, SIGNAL(xrgbPointsChanged()));
|
||||
}
|
||||
QObject::connect(&pqActiveObjects::instance(),
|
||||
SIGNAL(representationChanged(pqRepresentation*)),
|
||||
this, SLOT(updateButtonEnableState()));
|
||||
QObject::connect(&pqActiveObjects::instance(),
|
||||
SIGNAL(viewChanged(pqView*)),
|
||||
this, SLOT(updateButtonEnableState()));
|
||||
|
||||
QObject::connect(
|
||||
ui.OpacityEditor, SIGNAL(currentPointChanged(vtkIdType)),
|
||||
this, SLOT(opacityCurrentChanged(vtkIdType)));
|
||||
QObject::connect(
|
||||
ui.ColorEditor, SIGNAL(currentPointChanged(vtkIdType)),
|
||||
this, SLOT(colorCurrentChanged(vtkIdType)));
|
||||
|
||||
QObject::connect(
|
||||
ui.ColorEditor, SIGNAL(controlPointsModified()),
|
||||
this, SIGNAL(xrgbPointsChanged()));
|
||||
QObject::connect(
|
||||
ui.OpacityEditor, SIGNAL(controlPointsModified()),
|
||||
this, SIGNAL(xvmsPointsChanged()));
|
||||
|
||||
QObject::connect(
|
||||
ui.ColorEditor, SIGNAL(controlPointsModified()),
|
||||
this, SLOT(updateCurrentData()));
|
||||
QObject::connect(
|
||||
ui.OpacityEditor, SIGNAL(controlPointsModified()),
|
||||
this, SLOT(updateCurrentData()));
|
||||
|
||||
QObject::connect(
|
||||
ui.ResetRangeToData, SIGNAL(clicked()),
|
||||
this, SLOT(resetRangeToData()));
|
||||
|
||||
QObject::connect(
|
||||
ui.ResetRangeToCustom, SIGNAL(clicked()),
|
||||
this, SLOT(resetRangeToCustom()));
|
||||
|
||||
QObject::connect(
|
||||
ui.ResetRangeToDataOverTime, SIGNAL(clicked()),
|
||||
this, SLOT(resetRangeToDataOverTime()));
|
||||
|
||||
QObject::connect(
|
||||
ui.ResetRangeToVisibleData, SIGNAL(clicked()),
|
||||
this, SLOT(resetRangeToVisibleData()));
|
||||
|
||||
QObject::connect(
|
||||
ui.InvertTransferFunctions, SIGNAL(clicked()),
|
||||
this, SLOT(invertTransferFunctions()));
|
||||
|
||||
QObject::connect(ui.ChoosePreset, SIGNAL(clicked()),
|
||||
this, SLOT(choosePreset()));
|
||||
QObject::connect(ui.SaveAsPreset, SIGNAL(clicked()),
|
||||
this, SLOT(saveAsPreset()));
|
||||
QObject::connect(ui.AdvancedButton, SIGNAL(clicked()),
|
||||
this, SLOT(updatePanel()));
|
||||
|
||||
// if the user edits the "DataValue", we need to update the transfer function.
|
||||
QObject::connect(ui.CurrentDataValue, SIGNAL(textChangedAndEditingFinished()),
|
||||
this, SLOT(currentDataEdited()));
|
||||
|
||||
vtkSMProperty* smproperty = smgroup->GetProperty("XRGBPoints");
|
||||
if (smproperty)
|
||||
{
|
||||
this->addPropertyLink(
|
||||
this, "xrgbPoints", SIGNAL(xrgbPointsChanged()), smproperty);
|
||||
}
|
||||
else
|
||||
{
|
||||
qCritical("Missing 'XRGBPoints' property. Widget may not function correctly.");
|
||||
}
|
||||
|
||||
smproperty = smproxy->GetProperty("LockScalarRange");
|
||||
if (smproperty)
|
||||
{
|
||||
this->addPropertyLink(
|
||||
this, "lockScalarRange", SIGNAL(lockScalarRangeChanged()), smproperty);
|
||||
}
|
||||
|
||||
ui.OpacityEditor->hide();
|
||||
smproperty = smgroup->GetProperty("ScalarOpacityFunction");
|
||||
if (smproperty)
|
||||
{
|
||||
this->addPropertyLink(
|
||||
this, "scalarOpacityFunctionProxy", SIGNAL(scalarOpacityFunctionProxyChanged()),
|
||||
smproperty);
|
||||
}
|
||||
|
||||
smproperty = smgroup->GetProperty("EnableOpacityMapping");
|
||||
if (smproperty)
|
||||
{
|
||||
this->addPropertyLink(
|
||||
ui.EnableOpacityMapping, "checked", SIGNAL(toggled(bool)), smproperty);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.EnableOpacityMapping->hide();
|
||||
}
|
||||
|
||||
smproperty = smgroup->GetProperty("UseLogScale");
|
||||
if (smproperty)
|
||||
{
|
||||
this->addPropertyLink(
|
||||
this, "useLogScale", SIGNAL(useLogScaleChanged()), smproperty);
|
||||
QObject::connect(ui.UseLogScale, SIGNAL(clicked(bool)),
|
||||
this, SLOT(useLogScaleClicked(bool)));
|
||||
// QObject::connect(ui.UseLogScale, SIGNAL(toggled(bool)),
|
||||
// this, SIGNAL(useLogScaleChanged()));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.UseLogScale->hide();
|
||||
}
|
||||
|
||||
// if proxy has a property named IndexedLookup, we hide this entire widget
|
||||
// when IndexedLookup is ON.
|
||||
if (smproxy->GetProperty("IndexedLookup"))
|
||||
{
|
||||
// we are not controlling the IndexedLookup property, we are merely
|
||||
// observing it to ensure the UI is updated correctly. Hence we don't fire
|
||||
// any signal to update the smproperty.
|
||||
this->Internals->VTKConnector->Connect(
|
||||
smproxy->GetProperty("IndexedLookup"), vtkCommand::ModifiedEvent,
|
||||
this, SLOT(updateIndexedLookupState()));
|
||||
this->updateIndexedLookupState();
|
||||
|
||||
// Add decorator so the widget can be hidden when IndexedLookup is ON.
|
||||
this->addDecorator(this->Internals->Decorator);
|
||||
}
|
||||
|
||||
pqSettings *settings = pqApplicationCore::instance()->settings();
|
||||
if (settings)
|
||||
{
|
||||
this->Internals->Ui.AdvancedButton->setChecked(
|
||||
settings->value("showAdvancedPropertiesColorOpacityEditorWidget", false).toBool());
|
||||
}
|
||||
|
||||
this->updateCurrentData();
|
||||
this->updatePanel();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqColorOpacityEditorWidget::~pqColorOpacityEditorWidget()
|
||||
{
|
||||
pqSettings *settings = pqApplicationCore::instance()->settings();
|
||||
if (settings)
|
||||
{
|
||||
// save the state of the advanced button in the widget
|
||||
settings->setValue("showAdvancedPropertiesColorOpacityEditorWidget",
|
||||
this->Internals->Ui.AdvancedButton->isChecked());
|
||||
}
|
||||
|
||||
delete this->Internals;
|
||||
this->Internals = NULL;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorOpacityEditorWidget::setScalarOpacityFunctionProxy(pqSMProxy sofProxy)
|
||||
{
|
||||
pqInternals& internals = (*this->Internals);
|
||||
Ui::ColorOpacityEditorWidget& ui = internals.Ui;
|
||||
|
||||
vtkSMProxy* newSofProxy = NULL;
|
||||
vtkPiecewiseFunction* pwf = sofProxy?
|
||||
vtkPiecewiseFunction::SafeDownCast(sofProxy->GetClientSideObject()) : NULL;
|
||||
if (sofProxy && sofProxy->GetProperty("Points") && pwf)
|
||||
{
|
||||
newSofProxy = sofProxy.GetPointer();
|
||||
}
|
||||
if (internals.ScalarOpacityFunctionProxy == newSofProxy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (internals.ScalarOpacityFunctionProxy)
|
||||
{
|
||||
// cleanup old property links.
|
||||
this->links().removePropertyLink(
|
||||
this, "xvmsPoints", SIGNAL(xvmsPointsChanged()),
|
||||
internals.ScalarOpacityFunctionProxy,
|
||||
internals.ScalarOpacityFunctionProxy->GetProperty("Points"));
|
||||
}
|
||||
internals.ScalarOpacityFunctionProxy = newSofProxy;
|
||||
if (internals.ScalarOpacityFunctionProxy)
|
||||
{
|
||||
// FIXME: need to verify that repeated initializations are okay.
|
||||
ui.OpacityEditor->initialize(
|
||||
vtkScalarsToColors::SafeDownCast(this->proxy()->GetClientSideObject()), false, pwf, true);
|
||||
// add new property links.
|
||||
this->links().addPropertyLink(
|
||||
this, "xvmsPoints", SIGNAL(xvmsPointsChanged()),
|
||||
internals.ScalarOpacityFunctionProxy,
|
||||
internals.ScalarOpacityFunctionProxy->GetProperty("Points"));
|
||||
}
|
||||
ui.OpacityEditor->setVisible(newSofProxy != NULL);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqSMProxy pqColorOpacityEditorWidget::scalarOpacityFunctionProxy() const
|
||||
{
|
||||
return this->Internals->ScalarOpacityFunctionProxy.GetPointer();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorOpacityEditorWidget::updateIndexedLookupState()
|
||||
{
|
||||
if (this->proxy()->GetProperty("IndexedLookup"))
|
||||
{
|
||||
bool val = vtkSMPropertyHelper(this->proxy(), "IndexedLookup").GetAsInt() != 0;
|
||||
this->Internals->Decorator->setHidden(val);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorOpacityEditorWidget::opacityCurrentChanged(vtkIdType index)
|
||||
{
|
||||
if (index != -1)
|
||||
{
|
||||
Ui::ColorOpacityEditorWidget &ui = this->Internals->Ui;
|
||||
ui.ColorEditor->setCurrentPoint(-1);
|
||||
}
|
||||
this->updateCurrentData();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorOpacityEditorWidget::colorCurrentChanged(vtkIdType index)
|
||||
{
|
||||
if (index != -1)
|
||||
{
|
||||
Ui::ColorOpacityEditorWidget &ui = this->Internals->Ui;
|
||||
ui.OpacityEditor->setCurrentPoint(-1);
|
||||
}
|
||||
this->updateCurrentData();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorOpacityEditorWidget::updatePanel()
|
||||
{
|
||||
if (this->Internals)
|
||||
{
|
||||
bool advancedVisible = this->Internals->Ui.AdvancedButton->isChecked();
|
||||
this->Internals->Ui.ColorLabel->setVisible(advancedVisible);
|
||||
this->Internals->Ui.ColorTable->setVisible(advancedVisible);
|
||||
this->Internals->Ui.OpacityLabel->setVisible(advancedVisible);
|
||||
this->Internals->Ui.OpacityTable->setVisible(advancedVisible);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorOpacityEditorWidget::updateCurrentData()
|
||||
{
|
||||
vtkDiscretizableColorTransferFunction* stc =
|
||||
vtkDiscretizableColorTransferFunction::SafeDownCast(
|
||||
this->proxy()->GetClientSideObject());
|
||||
vtkSMProxy* pwfProxy = this->scalarOpacityFunctionProxy();
|
||||
vtkPiecewiseFunction* pwf = pwfProxy?
|
||||
vtkPiecewiseFunction::SafeDownCast(pwfProxy->GetClientSideObject()) : NULL;
|
||||
|
||||
Ui::ColorOpacityEditorWidget &ui = this->Internals->Ui;
|
||||
if (ui.ColorEditor->currentPoint() >= 0 && stc)
|
||||
{
|
||||
double xrgbms[6];
|
||||
stc->GetNodeValue(ui.ColorEditor->currentPoint(), xrgbms);
|
||||
ui.CurrentDataValue->setText(QString::number(xrgbms[0]));
|
||||
|
||||
// Don't enable widget for first/last control point. For those, users must
|
||||
// rescale the transfer function manually
|
||||
ui.CurrentDataValue->setEnabled(
|
||||
ui.ColorEditor->currentPoint() != 0 &&
|
||||
ui.ColorEditor->currentPoint() !=
|
||||
(ui.ColorEditor->numberOfControlPoints()-1));
|
||||
}
|
||||
else if (ui.OpacityEditor->currentPoint() >= 0 && pwf)
|
||||
{
|
||||
double xvms[4];
|
||||
pwf->GetNodeValue(ui.OpacityEditor->currentPoint(), xvms);
|
||||
ui.CurrentDataValue->setText(QString::number(xvms[0]));
|
||||
|
||||
// Don't enable widget for first/last control point. For those, users must
|
||||
// rescale the transfer function manually
|
||||
ui.CurrentDataValue->setEnabled(
|
||||
ui.OpacityEditor->currentPoint() != 0 &&
|
||||
ui.OpacityEditor->currentPoint() !=
|
||||
(ui.OpacityEditor->numberOfControlPoints()-1));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.CurrentDataValue->setEnabled(false);
|
||||
}
|
||||
|
||||
this->Internals->ColorTableModel.refresh();
|
||||
this->Internals->OpacityTableModel.refresh();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
QList<QVariant> pqColorOpacityEditorWidget::xrgbPoints() const
|
||||
{
|
||||
vtkDiscretizableColorTransferFunction* stc =
|
||||
vtkDiscretizableColorTransferFunction::SafeDownCast(
|
||||
this->proxy()->GetClientSideObject());
|
||||
QList<QVariant> values;
|
||||
for (int cc=0; stc != NULL && cc < stc->GetSize(); cc++)
|
||||
{
|
||||
double xrgbms[6];
|
||||
stc->GetNodeValue(cc, xrgbms);
|
||||
vtkVector<double, 4> value;
|
||||
values.push_back(xrgbms[0]);
|
||||
values.push_back(xrgbms[1]);
|
||||
values.push_back(xrgbms[2]);
|
||||
values.push_back(xrgbms[3]);
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
QList<QVariant> pqColorOpacityEditorWidget::xvmsPoints() const
|
||||
{
|
||||
vtkSMProxy* pwfProxy = this->scalarOpacityFunctionProxy();
|
||||
vtkPiecewiseFunction* pwf = pwfProxy?
|
||||
vtkPiecewiseFunction::SafeDownCast(pwfProxy->GetClientSideObject()) : NULL;
|
||||
|
||||
QList<QVariant> values;
|
||||
for (int cc=0; pwf != NULL && cc < pwf->GetSize(); cc++)
|
||||
{
|
||||
double xvms[4];
|
||||
pwf->GetNodeValue(cc, xvms);
|
||||
values.push_back(xvms[0]);
|
||||
values.push_back(xvms[1]);
|
||||
values.push_back(xvms[2]);
|
||||
values.push_back(xvms[3]);
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool pqColorOpacityEditorWidget::useLogScale() const
|
||||
{
|
||||
return this->Internals->Ui.UseLogScale->isChecked();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorOpacityEditorWidget::setUseLogScale(bool val)
|
||||
{
|
||||
Ui::ColorOpacityEditorWidget &ui = this->Internals->Ui;
|
||||
ui.UseLogScale->setChecked(val);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorOpacityEditorWidget::useLogScaleClicked(bool log_space)
|
||||
{
|
||||
if (log_space)
|
||||
{
|
||||
vtkSMTransferFunctionProxy::MapControlPointsToLogSpace(this->proxy());
|
||||
}
|
||||
else
|
||||
{
|
||||
vtkSMTransferFunctionProxy::MapControlPointsToLinearSpace(this->proxy());
|
||||
}
|
||||
|
||||
// FIXME: ensure scalar range is valid.
|
||||
|
||||
emit this->useLogScaleChanged();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool pqColorOpacityEditorWidget::lockScalarRange() const
|
||||
{
|
||||
return vtkSMPropertyHelper(this->proxy(), "LockScalarRange").GetAsInt() ? true : false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorOpacityEditorWidget::setLockScalarRange(bool val)
|
||||
{
|
||||
vtkSMPropertyHelper(this->proxy(), "LockScalarRange").Set(val ? 1 : 0);
|
||||
this->proxy()->UpdateVTKObjects();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorOpacityEditorWidget::setXvmsPoints(const QList<QVariant>& values)
|
||||
{
|
||||
Q_UNUSED(values);
|
||||
// Since the vtkPiecewiseFunction connected to the widget is directly obtained
|
||||
// from the proxy, we don't need to do anything here. The widget will be
|
||||
// updated when the proxy updates.
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorOpacityEditorWidget::setXrgbPoints(const QList<QVariant>& values)
|
||||
{
|
||||
Q_UNUSED(values);
|
||||
// Since the vtkColorTransferFunction connected to the widget is directly obtained
|
||||
// from the proxy, we don't need to do anything here. The widget will be
|
||||
// updated when the proxy updates.
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorOpacityEditorWidget::currentDataEdited()
|
||||
{
|
||||
vtkDiscretizableColorTransferFunction* stc =
|
||||
vtkDiscretizableColorTransferFunction::SafeDownCast(
|
||||
this->proxy()->GetClientSideObject());
|
||||
vtkSMProxy* pwfProxy = this->scalarOpacityFunctionProxy();
|
||||
vtkPiecewiseFunction* pwf = pwfProxy?
|
||||
vtkPiecewiseFunction::SafeDownCast(pwfProxy->GetClientSideObject()) : NULL;
|
||||
|
||||
Ui::ColorOpacityEditorWidget &ui = this->Internals->Ui;
|
||||
if (ui.ColorEditor->currentPoint() >= 0 && stc)
|
||||
{
|
||||
ui.ColorEditor->setCurrentPointPosition(
|
||||
ui.CurrentDataValue->text().toDouble());
|
||||
}
|
||||
else if (ui.OpacityEditor->currentPoint() >= 0 && pwf)
|
||||
{
|
||||
ui.OpacityEditor->setCurrentPointPosition(
|
||||
ui.CurrentDataValue->text().toDouble());
|
||||
}
|
||||
|
||||
this->updateCurrentData();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorOpacityEditorWidget::updateButtonEnableState()
|
||||
{
|
||||
pqDataRepresentation* repr =
|
||||
pqActiveObjects::instance().activeRepresentation();
|
||||
bool hasRepresentation = repr != NULL;
|
||||
pqView* activeView = pqActiveObjects::instance().activeView();
|
||||
bool hasView = activeView != NULL;
|
||||
|
||||
Ui::ColorOpacityEditorWidget &ui = this->Internals->Ui;
|
||||
ui.ResetRangeToData->setEnabled(hasRepresentation);
|
||||
ui.ResetRangeToDataOverTime->setEnabled(hasRepresentation);
|
||||
ui.ResetRangeToVisibleData->setEnabled(hasRepresentation && hasView);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorOpacityEditorWidget::resetRangeToData()
|
||||
{
|
||||
pqDataRepresentation* repr =
|
||||
pqActiveObjects::instance().activeRepresentation();
|
||||
if (!repr)
|
||||
{
|
||||
qDebug("No active representation.");
|
||||
return;
|
||||
}
|
||||
BEGIN_UNDO_SET("Reset transfer function ranges using data range");
|
||||
vtkSMPVRepresentationProxy::RescaleTransferFunctionToDataRange(repr->getProxy());
|
||||
this->Internals->render();
|
||||
emit this->changeFinished();
|
||||
END_UNDO_SET();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorOpacityEditorWidget::resetRangeToDataOverTime()
|
||||
{
|
||||
pqDataRepresentation* repr =
|
||||
pqActiveObjects::instance().activeRepresentation();
|
||||
if (!repr)
|
||||
{
|
||||
qDebug("No active representation.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (QMessageBox::warning(this,
|
||||
"Potentially slow operation",
|
||||
"This can potentially take a long time to complete. \n"
|
||||
"Are you sure you want to continue?",
|
||||
QMessageBox::Yes |QMessageBox::No, QMessageBox::No) == QMessageBox::Yes)
|
||||
{
|
||||
BEGIN_UNDO_SET("Reset transfer function ranges using temporal data range");
|
||||
vtkSMPVRepresentationProxy::RescaleTransferFunctionToDataRangeOverTime(repr->getProxy());
|
||||
|
||||
// disable auto-rescale of transfer function since the user has set on
|
||||
// explicitly (BUG #14371).
|
||||
this->setLockScalarRange(true);
|
||||
this->Internals->render();
|
||||
emit this->changeFinished();
|
||||
END_UNDO_SET();
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorOpacityEditorWidget::resetRangeToVisibleData()
|
||||
{
|
||||
pqPipelineRepresentation* repr = qobject_cast<pqPipelineRepresentation*>(
|
||||
pqActiveObjects::instance().activeRepresentation());
|
||||
if (!repr)
|
||||
{
|
||||
qCritical() << "No active representation.";
|
||||
return;
|
||||
}
|
||||
|
||||
vtkSMPVRepresentationProxy* repProxy =
|
||||
vtkSMPVRepresentationProxy::SafeDownCast(repr->getProxy());
|
||||
if (!repProxy)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
pqView* activeView = pqActiveObjects::instance().activeView();
|
||||
if (!activeView)
|
||||
{
|
||||
qCritical() << "No active view.";
|
||||
return;
|
||||
}
|
||||
|
||||
vtkSMRenderViewProxy* rvproxy = vtkSMRenderViewProxy::SafeDownCast(activeView->getViewProxy());
|
||||
if (!rvproxy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
BEGIN_UNDO_SET("Reset transfer function ranges using visible data");
|
||||
vtkSMPVRepresentationProxy::RescaleTransferFunctionToVisibleRange(repProxy, rvproxy);
|
||||
this->Internals->render();
|
||||
END_UNDO_SET();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorOpacityEditorWidget::resetRangeToCustom()
|
||||
{
|
||||
vtkDiscretizableColorTransferFunction* stc =
|
||||
vtkDiscretizableColorTransferFunction::SafeDownCast(
|
||||
this->proxy()->GetClientSideObject());
|
||||
double range[2];
|
||||
stc->GetRange(range);
|
||||
|
||||
pqRescaleRange dialog(this);
|
||||
dialog.setRange(range[0], range[1]);
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
this->resetRangeToCustom(dialog.getMinimum(), dialog.getMaximum());
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorOpacityEditorWidget::resetRangeToCustom(double min, double max)
|
||||
{
|
||||
BEGIN_UNDO_SET("Reset transfer function ranges");
|
||||
vtkSMTransferFunctionProxy::RescaleTransferFunction(this->proxy(), min, max);
|
||||
if (vtkSMProxy* sofProxy = this->scalarOpacityFunctionProxy())
|
||||
{
|
||||
vtkSMTransferFunctionProxy::RescaleTransferFunction(sofProxy, min, max);
|
||||
}
|
||||
// disable auto-rescale of transfer function since the user has set on
|
||||
// explicitly (BUG #14371).
|
||||
this->setLockScalarRange(true);
|
||||
this->Internals->render();
|
||||
emit this->changeFinished();
|
||||
END_UNDO_SET();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorOpacityEditorWidget::invertTransferFunctions()
|
||||
{
|
||||
BEGIN_UNDO_SET("Invert transfer function");
|
||||
vtkSMTransferFunctionProxy::InvertTransferFunction(this->proxy());
|
||||
|
||||
emit this->changeFinished();
|
||||
// We don't invert the opacity function, for now.
|
||||
END_UNDO_SET();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorOpacityEditorWidget::choosePreset(const char* presetName)
|
||||
{
|
||||
pqPresetDialog dialog(this, pqPresetDialog::SHOW_NON_INDEXED_COLORS_ONLY);
|
||||
dialog.setCurrentPreset(presetName);
|
||||
dialog.setCustomizableLoadAnnotations(false);
|
||||
this->connect(&dialog, SIGNAL(applyPreset(const Json::Value&)), SLOT(applyCurrentPreset()));
|
||||
dialog.exec();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorOpacityEditorWidget::applyCurrentPreset()
|
||||
{
|
||||
pqPresetDialog* dialog = qobject_cast<pqPresetDialog*>(this->sender());
|
||||
Q_ASSERT(dialog);
|
||||
|
||||
vtkSMProxy* sofProxy = this->scalarOpacityFunctionProxy();
|
||||
|
||||
BEGIN_UNDO_SET("Apply preset");
|
||||
if (dialog->loadColors())
|
||||
{
|
||||
vtkSMTransferFunctionProxy::ApplyPreset(
|
||||
this->proxy(), dialog->currentPreset(), !dialog->usePresetRange());
|
||||
}
|
||||
if (dialog->loadOpacities())
|
||||
{
|
||||
if (sofProxy)
|
||||
{
|
||||
vtkSMTransferFunctionProxy::ApplyPreset(
|
||||
sofProxy, dialog->currentPreset(), !dialog->usePresetRange());
|
||||
}
|
||||
else
|
||||
{
|
||||
qWarning("Cannot load opacities since ScalarOpacityFunctionProxy is not present.");
|
||||
}
|
||||
}
|
||||
// We need to take extra care to avoid the color and opacity function ranges
|
||||
// from straying away from each other. This can happen if only one of them is
|
||||
// getting a preset and we're using the preset range.
|
||||
if (dialog->usePresetRange() && (dialog->loadColors() ^ dialog->loadOpacities()) && sofProxy)
|
||||
{
|
||||
double range[2];
|
||||
if (dialog->loadColors() &&
|
||||
vtkSMTransferFunctionProxy::GetRange(this->proxy(), range))
|
||||
{
|
||||
vtkSMTransferFunctionProxy::RescaleTransferFunction(sofProxy, range);
|
||||
}
|
||||
else if (dialog->loadOpacities() &&
|
||||
vtkSMTransferFunctionProxy::GetRange(sofProxy, range))
|
||||
{
|
||||
vtkSMTransferFunctionProxy::RescaleTransferFunction(this->proxy(), range);
|
||||
}
|
||||
}
|
||||
END_UNDO_SET();
|
||||
|
||||
emit this->changeFinished();
|
||||
|
||||
// Assume the color map and opacity have changed and refresh
|
||||
this->Internals->ColorTableModel.refresh();
|
||||
this->Internals->OpacityTableModel.refresh();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorOpacityEditorWidget::saveAsPreset()
|
||||
{
|
||||
QDialog dialog(this);
|
||||
Ui::SavePresetOptions ui;
|
||||
ui.setupUi(&dialog);
|
||||
ui.saveOpacities->setEnabled(this->scalarOpacityFunctionProxy() != NULL);
|
||||
ui.saveOpacities->setChecked(ui.saveOpacities->isEnabled());
|
||||
ui.saveAnnotations->setVisible(false);
|
||||
|
||||
// For now, let's not provide an option to not save colors. We'll need to fix
|
||||
// the pqPresetToPixmap to support rendering only opacities.
|
||||
ui.saveColors->setChecked(true);
|
||||
ui.saveColors->setEnabled(false);
|
||||
ui.saveColors->hide();
|
||||
|
||||
if (dialog.exec() != QDialog::Accepted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Q_ASSERT(ui.saveColors->isChecked());
|
||||
Json::Value preset = vtkSMTransferFunctionProxy::GetStateAsPreset(this->proxy());
|
||||
|
||||
if (ui.saveOpacities->isChecked())
|
||||
{
|
||||
Json::Value opacities = vtkSMTransferFunctionProxy::GetStateAsPreset(
|
||||
this->scalarOpacityFunctionProxy());
|
||||
if (opacities.isMember("Points"))
|
||||
{
|
||||
preset["Points"] = opacities["Points"];
|
||||
}
|
||||
}
|
||||
|
||||
vtkStdString presetName;
|
||||
{
|
||||
// This scoping is necessary to ensure that the vtkSMTransferFunctionPresets
|
||||
// saves the new preset to the "settings" before the choosePreset dialog is
|
||||
// shown.
|
||||
vtkNew<vtkSMTransferFunctionPresets> presets;
|
||||
presetName = presets->AddUniquePreset(preset);
|
||||
}
|
||||
this->choosePreset(presetName);
|
||||
}
|
||||
@ -0,0 +1,197 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: $RCSfile$
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqColorOpacityEditorWidget_h
|
||||
#define pqColorOpacityEditorWidget_h
|
||||
|
||||
#include "pqApplicationComponentsModule.h"
|
||||
#include "pqPropertyWidget.h"
|
||||
#include "pqSMProxy.h"
|
||||
#include <QList>
|
||||
#include <QVariant>
|
||||
|
||||
class vtkSMPropertyGroup;
|
||||
class pqColorMapModel;
|
||||
|
||||
/// pqColorOpacityEditorWidget provides an in-line editor widget for editing the
|
||||
/// color and opacity transfer functions. The property group is expected to have
|
||||
/// properties with the following functions. If any of the optional properties
|
||||
/// are missing, then the corresponding widgets are hidden.
|
||||
/// \li "XRGBPoints" :- property with (x,r,g,b) tuples that is
|
||||
/// controlled by a color-transfer function editor
|
||||
/// (pqTransferFunctionWidget).
|
||||
/// \li "ScalarOpacityFunction" :- (optional) proxy-property referring to a proxy with
|
||||
/// "Points" property with (x,a,m,s) tuples that
|
||||
/// is controlled by an opacity-transfer function
|
||||
/// editor (pqTransferFunctionWidget).
|
||||
/// \li "EnableOpacityMapping" :- (optional) property used to enable
|
||||
/// opacity mapping for surfaces. Controlled by a
|
||||
/// checkbox in the Widget.
|
||||
/// \li "UseLogScale" :- (optional) property used to enable/disable log mapping
|
||||
/// for colors.
|
||||
/// \li "LockScalarRange" :- (optional) property used to control if the application
|
||||
/// resets transfer function as and when needed.
|
||||
/// UseLogScale.
|
||||
/// Caveats:
|
||||
/// \li Opacity editor:- pqColorOpacityEditorWidget shows an opacity editor widget.
|
||||
/// Typically, opacity function is optional and used only when
|
||||
/// "EnableOpacityMapping" is property is ON. However, in cases of Volume
|
||||
/// rendering, the EnableOpacityMapping has no effect.
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqColorOpacityEditorWidget :
|
||||
public pqPropertyWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QList<QVariant> xrgbPoints READ xrgbPoints WRITE setXrgbPoints)
|
||||
Q_PROPERTY(QList<QVariant> xvmsPoints READ xvmsPoints WRITE setXvmsPoints)
|
||||
Q_PROPERTY(bool useLogScale READ useLogScale WRITE setUseLogScale)
|
||||
Q_PROPERTY(bool lockScalarRange READ lockScalarRange WRITE setLockScalarRange)
|
||||
Q_PROPERTY(pqSMProxy scalarOpacityFunctionProxy READ scalarOpacityFunctionProxy
|
||||
WRITE setScalarOpacityFunctionProxy)
|
||||
typedef pqPropertyWidget Superclass;
|
||||
public:
|
||||
pqColorOpacityEditorWidget(vtkSMProxy* proxy, vtkSMPropertyGroup* smgroup, QWidget* parent=0);
|
||||
virtual ~pqColorOpacityEditorWidget();
|
||||
|
||||
/// Returns the current list of control points for the color transfer
|
||||
/// function. This a list of 4-tuples.
|
||||
QList<QVariant> xrgbPoints() const;
|
||||
|
||||
/// Returns the current list of control points for the opacity
|
||||
/// function. This a list of 4-tuples.
|
||||
QList<QVariant> xvmsPoints() const;
|
||||
|
||||
/// Returns the value for use-log-scale.
|
||||
bool useLogScale() const;
|
||||
|
||||
/// Returns true if the color map range is locked.
|
||||
bool lockScalarRange() const;
|
||||
|
||||
/// Returns the scalar opacity function (i.e. PiecewiseFunction) proxy
|
||||
/// used, if any.
|
||||
pqSMProxy scalarOpacityFunctionProxy() const;
|
||||
|
||||
public slots:
|
||||
/// Sets the xvmsPoints that control the opacity transfer function.
|
||||
void setXvmsPoints(const QList<QVariant>&);
|
||||
|
||||
/// Sets the xrgbPoints that control the color transfer function.
|
||||
void setXrgbPoints(const QList<QVariant>&);
|
||||
|
||||
/// Set whether to use-log scale.
|
||||
void setUseLogScale(bool value);
|
||||
|
||||
/// Set whether the color map range should be locked.
|
||||
void setLockScalarRange(bool val);
|
||||
|
||||
/// Set the scalar opacity function (or PiecewiseFunction) proxy to use.
|
||||
void setScalarOpacityFunctionProxy(pqSMProxy sofProxy);
|
||||
|
||||
/// Reset the transfer function ranges to active data source.
|
||||
void resetRangeToData();
|
||||
|
||||
/// Reset the transfer function ranges to custom values.
|
||||
void resetRangeToCustom();
|
||||
void resetRangeToCustom(double min, double max);
|
||||
|
||||
/// Reset the transfer function ranges to temporal range for active data
|
||||
/// source.
|
||||
void resetRangeToDataOverTime();
|
||||
|
||||
/// Reset the transfer function ranges to visible range for active data
|
||||
/// source.
|
||||
void resetRangeToVisibleData();
|
||||
|
||||
/// Inverts the transfer functions.
|
||||
void invertTransferFunctions();
|
||||
|
||||
/// pick a preset.
|
||||
void choosePreset(const char* presetName=NULL);
|
||||
|
||||
/// save current transfer function as preset.
|
||||
void saveAsPreset();
|
||||
|
||||
signals:
|
||||
/// Signal fired when the xrgbPoints change.
|
||||
void xrgbPointsChanged();
|
||||
|
||||
/// Signal fired when the xvmsPoints change.
|
||||
void xvmsPointsChanged();
|
||||
|
||||
/// Signal fired when useLogScale changes.
|
||||
void useLogScaleChanged();
|
||||
|
||||
/// Signal fired when lockScalarRange changes.
|
||||
void lockScalarRangeChanged();
|
||||
|
||||
/// This signal is never really fired since this
|
||||
/// widget doesn't have any UI to allow users to changes the
|
||||
/// ScalarOpacityFunction proxy used.
|
||||
void scalarOpacityFunctionProxyChanged();
|
||||
|
||||
protected slots:
|
||||
/// slots called when the current point changes on the two internal
|
||||
/// pqTransferFunctionWidget widgets.
|
||||
void opacityCurrentChanged(vtkIdType);
|
||||
void colorCurrentChanged(vtkIdType);
|
||||
|
||||
/// updates the panel to show/hide advanced settings
|
||||
void updatePanel();
|
||||
|
||||
/// updates the text shown in the "current data" input.
|
||||
void updateCurrentData();
|
||||
|
||||
/// update the transfer function with the text in CurrentDataValue text field.
|
||||
void currentDataEdited();
|
||||
|
||||
/// apply a present.
|
||||
void applyCurrentPreset();
|
||||
|
||||
/// Ensures that the color-swatches for indexedColors are shown only when this
|
||||
/// is set to true.
|
||||
void updateIndexedLookupState();
|
||||
|
||||
/// called when the use-log-scale checkbox is clicked by the user. We then add
|
||||
/// extra logic to valid ranges convert the color map to log/linear space.
|
||||
void useLogScaleClicked(bool);
|
||||
|
||||
/// called when the active representation or view changes. We then change the
|
||||
/// enabled/disabled state of the buttons. Some actions require a valid
|
||||
/// representation or view, so disable them if there isn't one.
|
||||
void updateButtonEnableState();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqColorOpacityEditorWidget);
|
||||
|
||||
class pqInternals;
|
||||
pqInternals* Internals;
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,113 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqColorPaletteSelectorWidget.cxx
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqColorPaletteSelectorWidget.h"
|
||||
|
||||
#include "pqPropertyWidget.h"
|
||||
#include "vtkPVProxyDefinitionIterator.h"
|
||||
#include "vtkSmartPointer.h"
|
||||
#include "vtkSMProxyDefinitionManager.h"
|
||||
#include "vtkSMProxy.h"
|
||||
#include "vtkSMSessionProxyManager.h"
|
||||
|
||||
#include <QVBoxLayout>
|
||||
#include <QComboBox>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqColorPaletteSelectorWidget::pqColorPaletteSelectorWidget(
|
||||
vtkSMProxy *smproxy, vtkSMProperty *vtkNotUsed(smproperty), QWidget *parentObject)
|
||||
: Superclass(smproxy, parentObject)
|
||||
{
|
||||
PV_DEBUG_PANELS() << "pqColorPaletteSelectorWidget for a property with "
|
||||
"the panel_widget=\"color_palette_selector\" attribute.";
|
||||
//this->setShowLabel(false);
|
||||
|
||||
QVBoxLayout* vbox = new QVBoxLayout(this);
|
||||
vbox->setSpacing(0);
|
||||
vbox->setMargin(0);
|
||||
|
||||
vtkSMSessionProxyManager* pxm = smproxy->GetSessionProxyManager();
|
||||
vtkSMProxyDefinitionManager *pdmgr = pxm->GetProxyDefinitionManager();
|
||||
|
||||
Q_ASSERT(pdmgr);
|
||||
vtkSmartPointer<vtkPVProxyDefinitionIterator> iter;
|
||||
iter.TakeReference(pdmgr->NewSingleGroupIterator("palettes"));
|
||||
|
||||
QComboBox* cbbox = new QComboBox(this);
|
||||
cbbox->setObjectName("ComboBox");
|
||||
for (iter->InitTraversal(); !iter->IsDoneWithTraversal(); iter->GoToNextItem())
|
||||
{
|
||||
vtkSMProxy* prototype = pxm->GetPrototypeProxy("palettes", iter->GetProxyName());
|
||||
cbbox->addItem(prototype->GetXMLLabel(), prototype->GetXMLName());
|
||||
}
|
||||
|
||||
if (cbbox->count() > 0)
|
||||
{
|
||||
cbbox->insertItem(0, "Select palette to load ...", -1);
|
||||
}
|
||||
else
|
||||
{
|
||||
cbbox->insertItem(0, "No palettes available.");
|
||||
cbbox->setEnabled(false);
|
||||
}
|
||||
cbbox->setCurrentIndex(0);
|
||||
vbox->addWidget(cbbox);
|
||||
|
||||
this->connect(cbbox, SIGNAL(currentIndexChanged(int)), SLOT(setCurrentIndex(int)));
|
||||
this->ComboBox = cbbox;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqColorPaletteSelectorWidget::~pqColorPaletteSelectorWidget()
|
||||
{
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorPaletteSelectorWidget::setCurrentIndex(int index)
|
||||
{
|
||||
vtkSMProxy* smproxy = this->proxy();
|
||||
Q_ASSERT(this->ComboBox);
|
||||
Q_ASSERT(smproxy);
|
||||
|
||||
if (index <= 0) { return; }
|
||||
QString name = this->ComboBox->itemData(index).toString();
|
||||
|
||||
vtkSMSessionProxyManager* pxm = smproxy->GetSessionProxyManager();
|
||||
vtkSMProxy* paletteProxy = pxm->GetPrototypeProxy("palettes", name.toLatin1().data());
|
||||
Q_ASSERT(paletteProxy);
|
||||
|
||||
smproxy->Copy(paletteProxy);
|
||||
|
||||
// return the combobox back to the "select .." text.
|
||||
this->ComboBox->setCurrentIndex(0);
|
||||
|
||||
emit this->changeAvailable();
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqColorPaletteSelectorWidget.h
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqColorPaletteSelectorWidget_h
|
||||
#define pqColorPaletteSelectorWidget_h
|
||||
|
||||
#include "pqApplicationComponentsModule.h"
|
||||
#include "pqPropertyWidget.h"
|
||||
#include <QPointer>
|
||||
|
||||
class QComboBox;
|
||||
|
||||
/// pqColorPaletteSelectorWidget is used on a ColorPalette proxy to load a
|
||||
/// specific color palette.
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqColorPaletteSelectorWidget : public pqPropertyWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef pqPropertyWidget Superclass;
|
||||
public:
|
||||
pqColorPaletteSelectorWidget(vtkSMProxy* smproxy, vtkSMProperty* smproperty, QWidget* parent=0);
|
||||
virtual ~pqColorPaletteSelectorWidget();
|
||||
|
||||
private slots:
|
||||
void setCurrentIndex(int);
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqColorPaletteSelectorWidget);
|
||||
QPointer<QComboBox> ComboBox;
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,114 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqColorSelectorPropertyWidget.h
|
||||
|
||||
Copyright (c) 2005-2012 Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=========================================================================*/
|
||||
#include "pqColorSelectorPropertyWidget.h"
|
||||
|
||||
#include "pqColorChooserButtonWithPalettes.h"
|
||||
#include "pqProxyWidget.h"
|
||||
#include "vtkSMPropertyHelper.h"
|
||||
#include "vtkSMProxy.h"
|
||||
|
||||
#include <QVBoxLayout>
|
||||
#include <QLabel>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqColorSelectorPropertyWidget::pqColorSelectorPropertyWidget(
|
||||
vtkSMProxy *smProxy, vtkSMProperty *smProperty, bool withPalette, QWidget *pWidget)
|
||||
: pqPropertyWidget(smProxy, pWidget)
|
||||
{
|
||||
PV_DEBUG_PANELS() << "pqColorSelectorPropertyWidget for a property with "
|
||||
<< "the panel_widget=\"color_chooser\" attribute";
|
||||
|
||||
this->setShowLabel(false);
|
||||
|
||||
bool useDocumentationForLabels = pqProxyWidget::useDocumentationForLabels(smProxy);
|
||||
|
||||
QVBoxLayout *vbox = new QVBoxLayout(this);
|
||||
vbox->setSpacing(0);
|
||||
vbox->setMargin(0);
|
||||
|
||||
if (useDocumentationForLabels)
|
||||
{
|
||||
QLabel* label = new QLabel(
|
||||
QString("<p>%1</p>").arg(pqProxyWidget::documentationText(smProperty)));
|
||||
label->setWordWrap(true);
|
||||
label->setAlignment(Qt::AlignLeft | Qt::AlignTop);
|
||||
vbox->addWidget(label, /*stretch=*/1);
|
||||
}
|
||||
|
||||
pqColorChooserButton* button = NULL;
|
||||
pqColorChooserButtonWithPalettes* paletteButton = NULL;
|
||||
if (withPalette)
|
||||
{
|
||||
paletteButton = new pqColorChooserButtonWithPalettes(this);
|
||||
button = paletteButton;
|
||||
}
|
||||
else
|
||||
{
|
||||
button = new pqColorChooserButton(this);
|
||||
}
|
||||
button->setObjectName("ColorButton");
|
||||
button->setText(smProperty->GetXMLLabel());
|
||||
button->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
|
||||
|
||||
if (vtkSMPropertyHelper(smProperty).GetNumberOfElements() == 3)
|
||||
{
|
||||
button->setShowAlphaChannel(false);
|
||||
this->addPropertyLink(
|
||||
button, "chosenColorRgbF", SIGNAL(chosenColorChanged(const QColor&)),
|
||||
smProperty);
|
||||
}
|
||||
else if (vtkSMPropertyHelper(smProperty).GetNumberOfElements() == 4)
|
||||
{
|
||||
button->setShowAlphaChannel(true);
|
||||
this->addPropertyLink(
|
||||
button, "chosenColorRgbaF", SIGNAL(chosenColorChanged(const QColor&)),
|
||||
smProperty);
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug("Currently, only SMProperty with 3 or 4 elements is supported.");
|
||||
}
|
||||
|
||||
if (withPalette)
|
||||
{
|
||||
// pqColorPaletteLinkHelper makes it possible to set this color to one of
|
||||
// the colors in the application palette..
|
||||
new pqColorPaletteLinkHelper(
|
||||
paletteButton, smProxy, smProxy->GetPropertyName(smProperty));
|
||||
}
|
||||
vbox->addWidget(button, 1);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqColorSelectorPropertyWidget::~pqColorSelectorPropertyWidget()
|
||||
{
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqColorSelectorPropertyWidget.h
|
||||
|
||||
Copyright (c) 2005-2012 Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
=========================================================================*/
|
||||
|
||||
#ifndef _pqColorSelectorPropertyWidget_h
|
||||
#define _pqColorSelectorPropertyWidget_h
|
||||
|
||||
#include "pqApplicationComponentsModule.h"
|
||||
|
||||
#include "pqPropertyWidget.h"
|
||||
|
||||
/// A property widget with a tool button for selecting a single color.
|
||||
///
|
||||
/// To use this widget for a property add the 'panel_widget="color_selector"' attribute
|
||||
/// to the property's XML. To use this widget for a property whose color might possibly
|
||||
/// come from the global color palette, add the 'panel_widget="color_selector_with_palette"'
|
||||
/// attribute to the property's XML.
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqColorSelectorPropertyWidget : public pqPropertyWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
pqColorSelectorPropertyWidget(vtkSMProxy *proxy,
|
||||
vtkSMProperty *property,
|
||||
bool withPalette,
|
||||
QWidget *parent = 0);
|
||||
~pqColorSelectorPropertyWidget();
|
||||
};
|
||||
|
||||
#endif // _pqColorSelectorPropertyWidget_h
|
||||
213
ParaView-5.0.1/Qt/ApplicationComponents/pqColorTableModel.cxx
Normal file
213
ParaView-5.0.1/Qt/ApplicationComponents/pqColorTableModel.cxx
Normal file
@ -0,0 +1,213 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: $RCSfile$
|
||||
|
||||
Copyright (c) 2013 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqColorTableModel.h"
|
||||
|
||||
#include "pqColorOpacityEditorWidget.h"
|
||||
#include "vtkDiscretizableColorTransferFunction.h"
|
||||
#include "vtkSMProxy.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
pqColorTableModel::pqColorTableModel(pqColorOpacityEditorWidget * widget,
|
||||
QObject* parentObject) :
|
||||
Superclass(parentObject), Widget(widget)
|
||||
{
|
||||
this->NumberOfRowsCache = this->rowCount();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
Qt::ItemFlags pqColorTableModel::flags(const QModelIndex &idx) const
|
||||
{
|
||||
Qt::ItemFlags parentFlags = this->Superclass::flags(idx);
|
||||
if (idx.column() == 0 && (idx.row() == 0 || idx.row() == this->rowCount()-1))
|
||||
{
|
||||
return parentFlags;
|
||||
}
|
||||
return parentFlags | Qt::ItemIsEditable;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool pqColorTableModel::setData(const QModelIndex &idx, const QVariant &value, int role)
|
||||
{
|
||||
Q_UNUSED(role);
|
||||
|
||||
// Do not edit first and last control point scalar values
|
||||
if (idx.column() == 0 && (idx.row() == 0 || idx.row() == this->rowCount()-1))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this->Widget && this->Widget->proxy())
|
||||
{
|
||||
vtkDiscretizableColorTransferFunction* stc =
|
||||
vtkDiscretizableColorTransferFunction::SafeDownCast(
|
||||
this->Widget->proxy()->GetClientSideObject());
|
||||
if (stc)
|
||||
{
|
||||
double range[2];
|
||||
stc->GetRange(range);
|
||||
double newValue = value.toDouble();
|
||||
if (idx.column() == 0 && (newValue < range[0] || newValue > range[1]))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (idx.column() > 0 && (newValue < 0.0 || newValue > 1.0))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
double xrgbms[6];
|
||||
stc->GetNodeValue(idx.row(), xrgbms);
|
||||
xrgbms[idx.column()] = newValue;
|
||||
stc->SetNodeValue(idx.row(), xrgbms);
|
||||
|
||||
emit this->dataChanged(idx, idx);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
int pqColorTableModel::rowCount(const QModelIndex & parentIndex) const
|
||||
{
|
||||
Q_UNUSED(parentIndex);
|
||||
|
||||
int size = 0;
|
||||
if (this->Widget && this->Widget->proxy())
|
||||
{
|
||||
vtkDiscretizableColorTransferFunction* stc =
|
||||
vtkDiscretizableColorTransferFunction::SafeDownCast(
|
||||
this->Widget->proxy()->GetClientSideObject());
|
||||
if (stc)
|
||||
{
|
||||
size = stc->GetSize();
|
||||
}
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
int pqColorTableModel::columnCount(const QModelIndex & parentIndex) const
|
||||
{
|
||||
Q_UNUSED(parentIndex);
|
||||
return 4;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
QVariant pqColorTableModel::data(const QModelIndex& idx, int role) const
|
||||
{
|
||||
if (role == Qt::DisplayRole || role == Qt::EditRole)
|
||||
{
|
||||
vtkDiscretizableColorTransferFunction* stc = NULL;
|
||||
if (this->Widget && this->Widget->proxy())
|
||||
{
|
||||
stc = vtkDiscretizableColorTransferFunction::SafeDownCast(
|
||||
this->Widget->proxy()->GetClientSideObject());
|
||||
}
|
||||
if (!stc)
|
||||
{
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
// Get the XRGB value
|
||||
double xrgbms[6];
|
||||
stc->GetNodeValue(idx.row(), xrgbms);
|
||||
|
||||
if (idx.column() >= 0 && idx.column() < 4)
|
||||
{
|
||||
return QString::number(xrgbms[idx.column()]);
|
||||
}
|
||||
}
|
||||
else if (role == Qt::ToolTipRole || role == Qt::StatusTipRole)
|
||||
{
|
||||
switch (idx.column())
|
||||
{
|
||||
case 0:
|
||||
return "Data Value";
|
||||
case 1:
|
||||
return "Red Component";
|
||||
case 2:
|
||||
return "Green Component";
|
||||
case 3:
|
||||
return "Blue Component";
|
||||
}
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
QVariant pqColorTableModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||
{
|
||||
if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
|
||||
{
|
||||
switch (section)
|
||||
{
|
||||
case 0:
|
||||
return "Value";
|
||||
case 1:
|
||||
return "R";
|
||||
case 2:
|
||||
return "G";
|
||||
case 3:
|
||||
return "B";
|
||||
}
|
||||
}
|
||||
return this->Superclass::headerData(section, orientation, role);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorTableModel::refresh()
|
||||
{
|
||||
// Tell the model that the number of rows may have changed because it does not
|
||||
// get this information from the rowCount() method. There must be a more elegant
|
||||
// way to do this.
|
||||
int currentNumberOfRows = this->rowCount();
|
||||
if (this->NumberOfRowsCache < currentNumberOfRows)
|
||||
{
|
||||
this->beginInsertRows(QModelIndex(), this->NumberOfRowsCache, currentNumberOfRows-1);
|
||||
this->endInsertRows();
|
||||
}
|
||||
else if (this->NumberOfRowsCache > currentNumberOfRows)
|
||||
{
|
||||
this->beginRemoveRows(QModelIndex(), currentNumberOfRows, this->NumberOfRowsCache-1);
|
||||
this->endRemoveRows();
|
||||
}
|
||||
this->NumberOfRowsCache = currentNumberOfRows;
|
||||
|
||||
QModelIndex topLeft = this->createIndex(0, 0);
|
||||
QModelIndex bottomRight = this->createIndex(this->rowCount()-1, this->columnCount()-1);
|
||||
|
||||
emit dataChanged(topLeft, bottomRight);
|
||||
}
|
||||
78
ParaView-5.0.1/Qt/ApplicationComponents/pqColorTableModel.h
Normal file
78
ParaView-5.0.1/Qt/ApplicationComponents/pqColorTableModel.h
Normal file
@ -0,0 +1,78 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqColorTableModel.h
|
||||
|
||||
Copyright (c) 2013 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqColorTableModel_h
|
||||
#define pqColorTableModel_h
|
||||
|
||||
#include <QAbstractTableModel>
|
||||
#include "pqApplicationComponentsModule.h"
|
||||
|
||||
class pqColorOpacityEditorWidget;
|
||||
|
||||
// QAbstractTableModel subclass for viewing and manipulating color transfer
|
||||
// function control points through a table interface.
|
||||
// First column is control point scalar value and the second through fourth
|
||||
// columns are r,g,b colors, respectively.
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqColorTableModel : public QAbstractTableModel
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef QAbstractTableModel Superclass;
|
||||
|
||||
public:
|
||||
pqColorTableModel(pqColorOpacityEditorWidget * widget, QObject* parentObject = 0);
|
||||
|
||||
virtual ~pqColorTableModel() {}
|
||||
|
||||
/// All columns are editable. The first and last value in the first column
|
||||
/// are not editable as they are set by the range.
|
||||
virtual Qt::ItemFlags flags(const QModelIndex &idx) const;
|
||||
|
||||
virtual bool setData(const QModelIndex &idx, const QVariant &value, int role=Qt::EditRole);
|
||||
|
||||
virtual int rowCount(const QModelIndex & parent=QModelIndex()) const;
|
||||
|
||||
virtual int columnCount(const QModelIndex & parent=QModelIndex()) const;
|
||||
|
||||
virtual QVariant data(const QModelIndex& idx, int role=Qt::DisplayRole) const;
|
||||
|
||||
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;
|
||||
|
||||
virtual void refresh();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqColorTableModel);
|
||||
|
||||
pqColorOpacityEditorWidget * Widget;
|
||||
|
||||
int NumberOfRowsCache;
|
||||
};
|
||||
|
||||
#endif
|
||||
66
ParaView-5.0.1/Qt/ApplicationComponents/pqColorToolbar.cxx
Normal file
66
ParaView-5.0.1/Qt/ApplicationComponents/pqColorToolbar.cxx
Normal file
@ -0,0 +1,66 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqColorToolbar.cxx
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#include "pqColorToolbar.h"
|
||||
#include "ui_pqColorToolbar.h"
|
||||
|
||||
#include "pqActiveObjects.h"
|
||||
#include "pqDisplayColorWidget.h"
|
||||
#include "pqEditColorMapReaction.h"
|
||||
#include "pqRescaleCustomScalarRangeReaction.h"
|
||||
#include "pqRescaleVisibleScalarRangeReaction.h"
|
||||
#include "pqResetScalarRangeReaction.h"
|
||||
#include "pqScalarBarVisibilityReaction.h"
|
||||
#include "pqSetName.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void pqColorToolbar::constructor()
|
||||
{
|
||||
Ui::pqColorToolbar ui;
|
||||
ui.setupUi(this);
|
||||
|
||||
new pqScalarBarVisibilityReaction(ui.actionScalarBarVisibility);
|
||||
new pqEditColorMapReaction(ui.actionEditColorMap);
|
||||
new pqResetScalarRangeReaction(ui.actionResetRange);
|
||||
new pqRescaleCustomScalarRangeReaction(ui.actionRescaleCustomRange);
|
||||
new pqRescaleVisibleScalarRangeReaction(ui.actionRescaleVisibleRange);
|
||||
|
||||
pqDisplayColorWidget* display_color = new pqDisplayColorWidget(this)
|
||||
<< pqSetName("displayColor");
|
||||
this->addWidget(display_color);
|
||||
|
||||
QObject::connect(&pqActiveObjects::instance(),
|
||||
SIGNAL(representationChanged(pqDataRepresentation*)),
|
||||
display_color,
|
||||
SLOT(setRepresentation(pqDataRepresentation*)));
|
||||
}
|
||||
|
||||
|
||||
64
ParaView-5.0.1/Qt/ApplicationComponents/pqColorToolbar.h
Normal file
64
ParaView-5.0.1/Qt/ApplicationComponents/pqColorToolbar.h
Normal file
@ -0,0 +1,64 @@
|
||||
/*=========================================================================
|
||||
|
||||
Program: ParaView
|
||||
Module: pqColorToolbar.h
|
||||
|
||||
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
|
||||
All rights reserved.
|
||||
|
||||
ParaView is a free software; you can redistribute it and/or modify it
|
||||
under the terms of the ParaView license version 1.2.
|
||||
|
||||
See License_v1.2.txt for the full ParaView license.
|
||||
A copy of this license can be obtained by contacting
|
||||
Kitware Inc.
|
||||
28 Corporate Drive
|
||||
Clifton Park, NY 12065
|
||||
USA
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
========================================================================*/
|
||||
#ifndef pqColorToolbar_h
|
||||
#define pqColorToolbar_h
|
||||
|
||||
#include <QToolBar>
|
||||
#include "pqApplicationComponentsModule.h"
|
||||
|
||||
/// pqColorToolbar is the toolbar that allows the user to choose the scalar
|
||||
/// color or solid color for the active representation.
|
||||
class PQAPPLICATIONCOMPONENTS_EXPORT pqColorToolbar : public QToolBar
|
||||
{
|
||||
Q_OBJECT
|
||||
typedef QToolBar Superclass;
|
||||
public:
|
||||
pqColorToolbar(const QString& title, QWidget* parentObject=0)
|
||||
: Superclass(title, parentObject)
|
||||
{
|
||||
this->constructor();
|
||||
}
|
||||
pqColorToolbar(QWidget* parentObject=0)
|
||||
: Superclass(parentObject)
|
||||
{
|
||||
this->constructor();
|
||||
}
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(pqColorToolbar)
|
||||
|
||||
void constructor();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user