Commit 9a8f17c7 authored by David Thompson's avatar David Thompson
Browse files

Add annotations to the PV color editor dialog.

Change-Id: Icd12e2f09f915119fe2e046c5db36d9ab33021de
parent bdaa9ffa
......@@ -6,14 +6,52 @@
<rect>
<x>0</x>
<y>0</y>
<width>633</width>
<height>595</height>
<width>635</width>
<height>655</height>
</rect>
</property>
<property name="windowTitle">
<string>Color Scale Editor</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="ValueTypePanel">
<item>
<widget class="QLabel" name="ValueInterpretationLabel">
<property name="text">
<string>Interpret values as:</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="IntervalValues">
<property name="text">
<string>Intervals or ratios</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="CategoricalValues">
<property name="text">
<string>Categories</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>
</layout>
</item>
<item>
<widget class="QTabWidget" name="ColorTabs">
<property name="currentIndex">
......@@ -440,6 +478,89 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="AnnotationsPage">
<attribute name="title">
<string>Annotations</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QTableWidget" name="AnnotationTable">
<property name="dragDropOverwriteMode">
<bool>true</bool>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::InternalMove</enum>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<column>
<property name="text">
<string>Value</string>
</property>
</column>
<column>
<property name="text">
<string>Annotation</string>
</property>
</column>
<column>
<property name="text">
<string>Color</string>
</property>
</column>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="AnnotationButtonLayout">
<item>
<widget class="QPushButton" name="RemoveAnnotation">
<property name="text">
<string>Delete</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ResetAnnotations">
<property name="text">
<string>Delete all</string>
</property>
</widget>
</item>
<item>
<spacer name="AnnotationSpacer">
<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="AddActiveValues">
<property name="text">
<string>Add # Active Values</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="NewAnnotation">
<property name="text">
<string>New Entry</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="LegendPage">
<attribute name="title">
<string>Color Legend</string>
......@@ -1057,7 +1178,7 @@
</spacer>
</item>
<item>
<layout class="QHBoxLayout">
<layout class="QHBoxLayout" name="ModelessButtonPanel">
<item>
<widget class="QCheckBox" name="SwitchToAdvanced">
<property name="text">
......@@ -1119,29 +1240,56 @@
</customwidget>
</customwidgets>
<tabstops>
<tabstop>IntervalValues</tabstop>
<tabstop>CategoricalValues</tabstop>
<tabstop>ColorTabs</tabstop>
<tabstop>checkBoxImmediateRender</tabstop>
<tabstop>SaveButton</tabstop>
<tabstop>PresetButton</tabstop>
<tabstop>pushButtonScalarColor</tabstop>
<tabstop>ScalarValue</tabstop>
<tabstop>ScalarColor</tabstop>
<tabstop>NanColor</tabstop>
<tabstop>ColorSpace</tabstop>
<tabstop>EnableOpacityFunction</tabstop>
<tabstop>opacityScalar</tabstop>
<tabstop>Opacity</tabstop>
<tabstop>ScalarOpacityUnitDistance</tabstop>
<tabstop>UseLogScale</tabstop>
<tabstop>UseAutoRescale</tabstop>
<tabstop>RescaleButton</tabstop>
<tabstop>RescaleToDataButton</tabstop>
<tabstop>RescaleToDataOverTimeButton</tabstop>
<tabstop>UseDiscreteColors</tabstop>
<tabstop>TableSize</tabstop>
<tabstop>TableSizeText</tabstop>
<tabstop>UseLogScaleSimple</tabstop>
<tabstop>UseAutoRescaleSimple</tabstop>
<tabstop>SimpleMin</tabstop>
<tabstop>SimpleMax</tabstop>
<tabstop>PresetButtonSimple</tabstop>
<tabstop>SwitchToAdvanced</tabstop>
<tabstop>pushButtonApply</tabstop>
<tabstop>MakeDefaultButton</tabstop>
<tabstop>CloseButton</tabstop>
<tabstop>ColorTabs</tabstop>
<tabstop>SaveButton</tabstop>
<tabstop>AnnotationTable</tabstop>
<tabstop>RemoveAnnotation</tabstop>
<tabstop>ResetAnnotations</tabstop>
<tabstop>AddActiveValues</tabstop>
<tabstop>NewAnnotation</tabstop>
<tabstop>ShowColorLegend</tabstop>
<tabstop>TitleName</tabstop>
<tabstop>TitleComponent</tabstop>
<tabstop>TitleFont</tabstop>
<tabstop>TitleBold</tabstop>
<tabstop>TitleItalic</tabstop>
<tabstop>TitleBold</tabstop>
<tabstop>TitleShadow</tabstop>
<tabstop>TitleFontSize</tabstop>
<tabstop>TitleOpacity</tabstop>
<tabstop>TitleColorButton</tabstop>
<tabstop>LabelFont</tabstop>
<tabstop>LabelBold</tabstop>
<tabstop>LabelItalic</tabstop>
<tabstop>LabelBold</tabstop>
<tabstop>LabelShadow</tabstop>
<tabstop>LabelFontSize</tabstop>
<tabstop>LabelOpacity</tabstop>
......
This diff is collapsed.
......@@ -7,7 +7,7 @@
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.
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
......@@ -49,11 +49,36 @@ class QHideEvent;
class QShowEvent;
class QString;
class pqTransferFunctionChartViewWidget;
class vtkAbstractArray;
class vtkPlot;
class vtkObject;
class vtkColorTransferFunction;
class vtkPiecewiseFunction;
/**\brief A dialog for editing color and/or opacity maps.
*
* This function ties the user interface elements of the color/transfer-function editor to server proxies
* that map from point/cell-scalars to color and/or opacity values.
*
* The \a ColorMapViewer, \a OpacityFunctionViewer, and entries of the internal \a Form member
* are GUI elements with proxies in \a ColorMap, \a OpacityFunction, and \a Legend.
* \a Display is a proxy used to obtain information on the scalar range (for interval data) or
* unique values (for categorical data) of the currently-active representation.
* If a small set of unique values exist for the currently-selected field component,
* it is cached in \a UniqueValues and added to the Annotations table in the UI when the user
* clicks on "Add ## Values" button in the "Annotations" tab of the dialog.
*
* This class does not strictly follow the Principle of Minimum Astonishment;
* while its "Apply" and "Close" buttons are distinct, the original state is not
* restored if "Close" is pressed after edits without clicking "Apply".
* Instead, changes are always applied when closing the dialog.
* Be aware that this means there is no model separate from the state stored in the GUI.
*
* The purpose behind this inconsistency is to reduce the number of renders while editing the
* colormap or transfer function.
* At a minimum, the "Apply" button should probably be placed next to the "Render immediately"
* checkbox and disabled when "Render immediately" is checked.
*/
class PQCOMPONENTS_EXPORT pqColorScaleEditor : public QDialog
{
Q_OBJECT
......@@ -69,13 +94,22 @@ protected:
// virtual void showEvent(QShowEvent *e);
// virtual void hideEvent(QHideEvent *e);
/// Set/get a list of unique values associated with the current array that the user may draw from.
vtkAbstractArray* getActiveUniqueValues() { return this->ActiveUniqueValues; }
virtual void setActiveUniqueValues( vtkAbstractArray* );
private slots:
void updateColors();
void updateOpacity();
void handleOpacityPointsChanged();
/// \name Callbacks invoked upon property changes on proxy objects
//@{
void handleEnableOpacityMappingChanged();
void handleOpacityPointsChanged();
void handleColorPointsChanged();
void handleInterpretationChanged();
void handleAnnotationsChanged();
//@}
void setScalarFromText();
void setOpacityFromText();
......@@ -83,6 +117,7 @@ private slots:
void setOpacityScalarFromText();
void setOpacityControlsVisibility(bool visible);
void setEnableOpacityMapping(int enable);
void setInterpretation( int buttonId );
void updateDisplay();
void setColorSpace(int index);
......@@ -96,6 +131,8 @@ private slots:
void savePreset();
void loadPreset();
/// \name Range and scale (linear/log) methods
//@{
void setLogScale(bool on);
void setAutoRescale(bool on);
......@@ -104,12 +141,24 @@ private slots:
void rescaleToDataRangeOverTime();
void rescaleToSimpleRange();
void setScalarRange(double min, double max);
//@}
/// \name Interval/ratio colormap discretization options
//@{
void setUseDiscreteColors(bool on);
void setSizeFromText();
void setSizeFromSlider(int tableSize);
void setTableSize(int tableSize);
//@}
void setScalarRange(double min, double max);
/// \name Annotation methods
//@{
void resetAnnotations();
void removeAnnotation();
void addActiveValues();
void addAnnotationEntry();
void annotationsChanged();
//@}
/// \name Color Legend Methods
......@@ -129,7 +178,7 @@ private slots:
void cleanupDisplay();
void cleanupLegend();
//@}
/// MakeDefaultButton callback.
void makeDefault();
......@@ -145,9 +194,12 @@ private slots:
void restoreOptionalUserSettings();
// Advanced/Simple management
void enableAvancedPanel(bool);
void enableAdvancedPanel(bool);
private:
void loadBuiltinColorPresets();
void loadAnnotations();
void loadColorPoints();
void loadOpacityPoints();
void initColorScale();
......@@ -170,6 +222,7 @@ private:
void unsetCurrentPoints();
void pushColors();
void pushOpacity();
void pushAnnotations();
private:
pqColorScaleEditorForm *Form;
......@@ -180,6 +233,7 @@ private:
pqScalarOpacityFunction *OpacityFunction;
pqScalarBarRepresentation *Legend;
bool UseEnableOpacityCheckBox;
vtkAbstractArray* ActiveUniqueValues;
};
#endif
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