Commit 49c142fe authored by Shawn Waldon's avatar Shawn Waldon

Set default color maps in the server manager rather than from Qt

This ensures consistent defaults across ParaView, pvpython and pvbatch.

This affects all PV-based applications and moves this setting from
something specified in ParaView's Qt UI to an internal default.  See the
MajorAPIChanges.md file for details.

See ParaView issue #16913.
parent 6b6eed48
Pipeline #27842 passed with stage
......@@ -249,6 +249,13 @@ void vtkInitializationHelper::Initialize(int argc, char**argv,
{
vtkInitializationHelper::LoadSettings();
}
vtkSMSettings *settings = vtkSMSettings::GetInstance();
settings->AddCollectionFromString(
"{ \"standard_presets\": { "
"\"vtkBlockColors\": \"KAAMS\", "
"\"AtomicNumbers\": \"BlueObeliskElements\" "
"} }", 0.0);
}
//----------------------------------------------------------------------------
......
......@@ -286,8 +286,6 @@ set (Module_SRCS
pqSpreadSheetViewDecorator.h
pqSpreadSheetVisibilityBehavior.cxx
pqSpreadSheetVisibilityBehavior.h
pqStandardArrayColorMapsBehavior.cxx
pqStandardArrayColorMapsBehavior.h
pqStandardPropertyWidgetInterface.cxx
pqStandardPropertyWidgetInterface.h
pqStandardViewFrameActionsImplementation.cxx
......@@ -456,7 +454,6 @@ set (Module_MOC_HDRS
pqSplinePropertyWidget.h
pqSpreadSheetViewDecorator.h
pqSpreadSheetVisibilityBehavior.h
pqStandardArrayColorMapsBehavior.h
pqStandardPropertyWidgetInterface.h
pqStandardViewFrameActionsImplementation.h
pqStatusBar.h
......
{
"standard_presets" : {
"vtkBlockColors" : "KAAMS",
"AtomicNumbers" : "BlueObeliskElements"
}
}
......@@ -3,7 +3,6 @@
<file>Thumbnails/CanExample.png</file>
<file>Thumbnails/DiskOutRefExample.png</file>
<file>Thumbnails/WaveletExample.png</file>
<file>StandardArrayColorMaps.json</file>
<file>ExampleVisualizations/CanExample.pvsm</file>
<file>ExampleVisualizations/DiskOutRefExample.pvsm</file>
<file>ExampleVisualizations/WaveletExample.pvsm</file>
......
......@@ -52,7 +52,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pqPropertiesPanel.h"
#include "pqQtMessageHandlerBehavior.h"
#include "pqSpreadSheetVisibilityBehavior.h"
#include "pqStandardArrayColorMapsBehavior.h"
#include "pqStandardPropertyWidgetInterface.h"
#include "pqStandardViewFrameActionsImplementation.h"
#include "pqUndoRedoBehavior.h"
......@@ -86,7 +85,6 @@ PQ_BEHAVIOR_DEFINE_FLAG(FixPathsInStateFilesBehavior, true);
PQ_BEHAVIOR_DEFINE_FLAG(CommandLineOptionsBehavior, true);
PQ_BEHAVIOR_DEFINE_FLAG(PersistentMainWindowStateBehavior, true);
PQ_BEHAVIOR_DEFINE_FLAG(CollaborationBehavior, true);
PQ_BEHAVIOR_DEFINE_FLAG(StandardArrayColorMapsBehavior, true);
PQ_BEHAVIOR_DEFINE_FLAG(ViewStreamingBehavior, true);
PQ_BEHAVIOR_DEFINE_FLAG(PluginSettingsBehavior, true);
PQ_BEHAVIOR_DEFINE_FLAG(ApplyBehavior, true);
......@@ -188,10 +186,6 @@ pqParaViewBehaviors::pqParaViewBehaviors(
{
new pqCollaborationBehavior(this);
}
if (PQ_IS_BEHAVIOR_ENABLED(StandardArrayColorMapsBehavior))
{
new pqStandardArrayColorMapsBehavior(this);
}
if (PQ_IS_BEHAVIOR_ENABLED(ViewStreamingBehavior))
{
// some special handling for pqStreamingTestingEventPlayer
......
......@@ -84,7 +84,6 @@ public:
PQ_BEHAVIOR_DEFINE_METHODS(CommandLineOptionsBehavior);
PQ_BEHAVIOR_DEFINE_METHODS(PersistentMainWindowStateBehavior);
PQ_BEHAVIOR_DEFINE_METHODS(CollaborationBehavior);
PQ_BEHAVIOR_DEFINE_METHODS(StandardArrayColorMapsBehavior);
PQ_BEHAVIOR_DEFINE_METHODS(ViewStreamingBehavior);
PQ_BEHAVIOR_DEFINE_METHODS(PluginSettingsBehavior);
PQ_BEHAVIOR_DEFINE_METHODS(ApplyBehavior);
......@@ -116,7 +115,6 @@ private:
PQ_BEHAVIOR_DECLARE_FLAG(CommandLineOptionsBehavior);
PQ_BEHAVIOR_DECLARE_FLAG(PersistentMainWindowStateBehavior);
PQ_BEHAVIOR_DECLARE_FLAG(CollaborationBehavior);
PQ_BEHAVIOR_DECLARE_FLAG(StandardArrayColorMapsBehavior);
PQ_BEHAVIOR_DECLARE_FLAG(ViewStreamingBehavior);
PQ_BEHAVIOR_DECLARE_FLAG(PluginSettingsBehavior);
PQ_BEHAVIOR_DECLARE_FLAG(ApplyBehavior);
......
/*=========================================================================
Program: ParaView
Module: pqStandardArrayColorMapsBehavior.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 "pqStandardArrayColorMapsBehavior.h"
#include "vtkSMSettings.h"
#include <QFile>
//-----------------------------------------------------------------------------
pqStandardArrayColorMapsBehavior::pqStandardArrayColorMapsBehavior(QObject* parentObject)
: Superclass(parentObject)
{
QFile file(":/pqApplicationComponents/StandardArrayColorMaps.json");
if (file.open(QIODevice::ReadOnly))
{
vtkSMSettings* settings = vtkSMSettings::GetInstance();
settings->AddCollectionFromString(file.readAll().data(), 1.0);
}
}
//-----------------------------------------------------------------------------
pqStandardArrayColorMapsBehavior::~pqStandardArrayColorMapsBehavior()
{
}
/*=========================================================================
Program: ParaView
Module: pqStandardArrayColorMapsBehavior.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 pqStandardArrayColorMapsBehavior_h
#define pqStandardArrayColorMapsBehavior_h
#include "pqApplicationComponentsModule.h" // for exports.
#include <QObject>
/// @ingroup Behaviors
/// pqStandardArrayColorMapsBehavior setups color palettes to use for certain
/// standard arrays in ParaView. Following is the list of arrays names and the
/// chosen presets:
/// \li vtkBlockColors : "KAAMS"
class PQAPPLICATIONCOMPONENTS_EXPORT pqStandardArrayColorMapsBehavior : public QObject
{
Q_OBJECT
typedef QObject Superclass;
public:
pqStandardArrayColorMapsBehavior(QObject* parent=0);
virtual ~pqStandardArrayColorMapsBehavior();
private:
Q_DISABLE_COPY(pqStandardArrayColorMapsBehavior)
};
#endif
......@@ -7,6 +7,16 @@ started tracking these (starting after version 4.2).
Changes in 5.2
--------------
###Removed pqStandardArrayColorMapsBehavior###
Setting the default colormaps from a Qt Behavior was causing inconsistent results
between the ParaView UI and pvpython/pvbatch. Adding these default settings was
moved into the server manager. To override these defaults, use
vtkSMSettings::AddCollectionFromX with a priority greater than 0. The settings
affected are the default colormap for arrays with names vtkBlockColors and
AtomicNumbers. With these settings moved, the Qt behavior
pqStandardArrayColorMapsBehavior no longer does anything and so it has been removed.
###Qt dependencies###
Starting with 5.2, ParaView natively supports Qt 4 and Qt 5. To simplify writing
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment