Commit 1a3eb3dc authored by bonnell's avatar bonnell

Add 'use foreground color' and 'line style' options to Line2D annotation...

Add 'use foreground color' and 'line style' options to Line2D annotation object.  Added Line3D annotation object.  Resolves #129, 1360 and 2327

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@26759 18c085ea-50e0-402c-830e-de6fd14e8384
parent f151552f
......@@ -43,6 +43,9 @@
# Brad Whitlock, Fri May 17 11:12:55 PDT 2013
# Link with Objective C library on Mac.
#
# Kathleen Biagas, Mon Jul 13 20:09:58 PDT 2015
# Add Colleagues/avtText3DColleague.C
#
#****************************************************************************/
SET(COLLEAGUES_SOURCES
......@@ -71,6 +74,7 @@ Colleagues/avtAnnotationColleague.C
Colleagues/avtImageColleague.C
Colleagues/avtLegendAttributesColleague.C
Colleagues/avtLine2DColleague.C
Colleagues/avtLine3DColleague.C
Colleagues/avtText2DColleague.C
Colleagues/avtText3DColleague.C
Colleagues/avtTimeSliderColleague.C
......
......@@ -47,6 +47,7 @@
#include <avtImageColleague.h>
#include <avtLegendAttributesColleague.h>
#include <avtLine2DColleague.h>
#include <avtLine3DColleague.h>
#include <avtText2DColleague.h>
#include <avtText3DColleague.h>
#include <avtTimeSliderColleague.h>
......@@ -380,6 +381,9 @@ VisWinAnnotations::SetFrameAndState(int nFrames,
// Brad Whitlock, Mon Mar 2 15:33:25 PST 2009
// I added code to set the new annotation's time scale and offset.
//
// Kathleen Biagas, Mon Jul 13 20:09:09 PDT 2015
// Added Line3D.
//
// ****************************************************************************
bool
......@@ -422,10 +426,13 @@ VisWinAnnotations::AddAnnotationObject(int annotType, const std::string &annotNa
case 3: // Line 2D
annot = new avtLine2DColleague(mediator);
break;
case 7: // Image
case 4: // Line 3D
annot = new avtLine3DColleague(mediator);
break;
case 8: // Image
annot = new avtImageColleague(mediator);
break;
case 8: // LegendAttributes
case 9: // LegendAttributes
annot = new avtLegendAttributesColleague(mediator);
break;
default:
......
......@@ -56,6 +56,7 @@
#include <vtkRenderer.h>
#include <AnnotationObject.h>
#include <LineAttributes.h>
#include <VisWindow.h>
#include <VisWindowColleagueProxy.h>
......@@ -80,6 +81,9 @@
// Brad Whitlock, Tue Jun 28 15:32:03 PST 2005
// Removed the cone sources.
//
// Kathleen Biagas, Mon Jul 13 09:41:56 PDT 2015
// Add useForegroundForLineColor.
//
// ****************************************************************************
avtLine2DColleague::avtLine2DColleague(VisWindowColleagueProxy &m):
avtAnnotationColleague(m),
......@@ -95,6 +99,7 @@ avtLine2DColleague::avtLine2DColleague(VisWindowColleagueProxy &m):
endArrowStyle(0)
{
addedToRenderer = false;
useForegroundForLineColor = true;
// Create a float array which represents the points.
vtkFloatArray* pcoords = vtkFloatArray::New();
......@@ -160,7 +165,7 @@ avtLine2DColleague::avtLine2DColleague(VisWindowColleagueProxy &m):
// Set a default color.
double fgColor[3];
mediator.GetForegroundColor(fgColor);
actor->GetProperty()->SetColor(fgColor[0], fgColor[1], fgColor[2]);
SetForegroundColor(fgColor[0], fgColor[1], fgColor[2]);
// Set default opacity.
actor->GetProperty()->SetOpacity(1.);
......@@ -490,13 +495,45 @@ avtLine2DColleague::SetOptions(const AnnotationObject &annot)
lineData->GetPoints()->SetPoint(0, p0[0], p0[1], 0.);
lineData->GetPoints()->SetPoint(1, p1[0], p1[1], 0.);
actor->GetProperty()->SetLineWidth(annot.GetColor2().Red());
actor->GetProperty()->SetLineWidth(annot.GetIntAttribute1()+1);
actor->GetProperty()->SetLineStipplePattern(LineStyle2StipplePattern(Int2LineStyle(annot.GetIntAttribute2())));
ColorAttribute ca = annot.GetColor1();
actor->GetProperty()->SetColor(double(ca.Red()) / 255.,
double(ca.Green()) / 255.,
double(ca.Blue()) / 255.);
actor->GetProperty()->SetOpacity(double(ca.Alpha()) / 255.);
//
// The line color has changed or the useForegroundForTextColor flag
// has changed.
//
if(annot.GetUseForegroundForTextColor() != useForegroundForLineColor ||
annot.GetColor1() != lineColor)
{
// Record the line color that should be used when we're not using
// the foreground text color.
lineColor = annot.GetColor1();
useForegroundForLineColor = annot.GetUseForegroundForTextColor();
// Compute the line opacity.
double lc[4];
lc[3] = double(lineColor.Alpha()) / 255.;
// Set the line color using the foreground color or the line color.
if(useForegroundForLineColor)
{
// Get the foreground color.
double fgColor[3];
mediator.GetForegroundColor(fgColor);
actor->GetProperty()->SetColor(fgColor[0], fgColor[1], fgColor[2]);
}
else
{
// Compute the line color as double.
lc[0] = double(lineColor.Red()) / 255.;
lc[1] = double(lineColor.Green()) / 255.;
lc[2] = double(lineColor.Blue()) / 255.;
actor->GetProperty()->SetColor(lc[0], lc[1], lc[2]);
}
actor->GetProperty()->SetOpacity(double(lc[3]));
}
beginArrowStyle = annot.GetColor2().Green();
endArrowStyle = annot.GetColor2().Blue();
......@@ -581,15 +618,12 @@ avtLine2DColleague::GetOptions(AnnotationObject &annot)
annot.SetPosition(lineData->GetPoints()->GetPoint(0));
annot.SetPosition2(lineData->GetPoints()->GetPoint(1));
double *currColor = actor->GetProperty()->GetColor();
annot.SetColor1(lineColor);
annot.SetUseForegroundForTextColor(useForegroundForLineColor);
annot.SetIntAttribute1(actor->GetProperty()->GetLineWidth()-1);
annot.SetIntAttribute2(LineStyle2Int(StipplePattern2LineStyle(actor->GetProperty()->GetLineStipplePattern())));
ColorAttribute ca;
ca.SetRgba(int((float)currColor[0] * 255),
int((float)currColor[1] * 255),
int((float)currColor[2] * 255),
int((float)actor->GetProperty()->GetOpacity() * 255));
annot.SetColor1(ca);
ca.SetRgb((int) actor->GetProperty()->GetLineWidth(),
ca.SetRgb(0,
beginArrowStyle,
endArrowStyle);
annot.SetColor2(ca);
......@@ -632,3 +666,29 @@ avtLine2DColleague::NoPlots(void)
{
RemoveFromRenderer();
}
// ****************************************************************************
// Method: avtLine2DColleague::SetForegroundColor
//
// Purpose:
// This method is called when the vis window's foreground color changes.
//
// Arguments:
// r,g,b : The new foreground color.
//
// Programmer: Kathleen Biagas
// Creation: July 13, 2015
//
// Modifications:
//
// ****************************************************************************
void
avtLine2DColleague::SetForegroundColor(double r, double g, double b)
{
if(useForegroundForLineColor)
actor->GetProperty()->SetColor(r, g, b);
}
......@@ -64,6 +64,9 @@ class vtkPolyDataMapper2D;
// Brad Whitlock, Tue Jun 28 15:39:27 PST 2005
// Changed so it does not use a cone source.
//
// Kathleen Biagas, Mon Jul 13 09:39:46 PDT 2015
// Add SetForegroundColor.
//
// ****************************************************************************
class VISWINDOW_API avtLine2DColleague : public avtAnnotationColleague
......@@ -83,6 +86,7 @@ public:
virtual void GetOptions(AnnotationObject &annot);
// Methods that are called in response to vis window events.
virtual void SetForegroundColor(double r, double g, double b);
virtual void HasPlots(void);
virtual void NoPlots(void);
......@@ -100,6 +104,8 @@ protected:
int endArrowStyle;
bool addedToRenderer;
bool useForegroundForLineColor;
ColorAttribute lineColor;
bool ShouldBeAddedToRenderer() const;
......
This diff is collapsed.
/*****************************************************************************
*
* Copyright (c) 2000 - 2015, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-442911
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the LLNS/LLNL nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* 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 LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, THE U.S. DEPARTMENT OF ENERGY 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 AVT_LINE3D_COLLEAGUE_H
#define AVT_LINE3D_COLLEAGUE_H
#include <ColorAttribute.h>
#include <avtAnnotationColleague.h>
#include <viswindow_exports.h>
class vtkActor;
class vtkLineSource;
class vtkPolyDataMapper;
// ****************************************************************************
// Class: avtLine3DColleague
//
// Purpose:
// This colleague is a 3D line that can be shown in the vis window.
//
// Notes:
//
// Programmer: Kathleen Biagas
// Creation: July 13, 2015
//
// Modifications:
//
// ****************************************************************************
class VISWINDOW_API avtLine3DColleague : public avtAnnotationColleague
{
public:
avtLine3DColleague(VisWindowColleagueProxy &);
virtual ~avtLine3DColleague();
virtual void AddToRenderer();
virtual void RemoveFromRenderer();
virtual void Hide();
virtual std::string TypeName() const { return "Line3D"; }
// Methods to set and get the annotation's properties.
virtual void SetOptions(const AnnotationObject &annot);
virtual void GetOptions(AnnotationObject &annot);
// Methods that are called in response to vis window events.
virtual void SetForegroundColor(double r, double g, double b);
virtual void HasPlots(void);
virtual void NoPlots(void);
protected:
vtkActor *lineActor;
vtkPolyDataMapper *lineMapper;
vtkLineSource *lineSource;
bool addedToRenderer;
bool useForegroundForLineColor;
ColorAttribute lineColor;
bool ShouldBeAddedToRenderer() const;
};
#endif
......@@ -45,22 +45,22 @@
static const char *AnnotationType_strings[] = {
"Text2D", "Text3D", "TimeSlider",
"Line2D", "Arrow2D", "Arrow3D",
"Box", "Image", "LegendAttributes",
"MaxAnnotationType"};
"Line2D", "Line3D", "Arrow2D",
"Arrow3D", "Box", "Image",
"LegendAttributes", "MaxAnnotationType"};
std::string
AnnotationObject::AnnotationType_ToString(AnnotationObject::AnnotationType t)
{
int index = int(t);
if(index < 0 || index >= 10) index = 0;
if(index < 0 || index >= 11) index = 0;
return AnnotationType_strings[index];
}
std::string
AnnotationObject::AnnotationType_ToString(int t)
{
int index = (t < 0 || t >= 10) ? 0 : t;
int index = (t < 0 || t >= 11) ? 0 : t;
return AnnotationType_strings[index];
}
......@@ -68,7 +68,7 @@ bool
AnnotationObject::AnnotationType_FromString(const std::string &s, AnnotationObject::AnnotationType &val)
{
val = AnnotationObject::Text2D;
for(int i = 0; i < 10; ++i)
for(int i = 0; i < 11; ++i)
{
if(s == AnnotationType_strings[i])
{
......
......@@ -191,3 +191,4 @@ AnnotationObject::ProcessOldVersions(DataNode *parentNode,
node->SetInt(0); // default "Variable" type
searchNode->AddNode(node);
}
......@@ -68,6 +68,7 @@ public:
Text3D,
TimeSlider,
Line2D,
Line3D,
Arrow2D,
Arrow3D,
Box,
......
<?xml version="1.0"?>
<Attribute name="AnnotationObject" purpose="This class defines a general set of attributes that are used to set the attributes for all annotation objects." persistent="true" exportAPI="STATE_API" exportInclude="state_exports.h" codefile="AnnotationObject.code">
<Attribute name="AnnotationObject" purpose="This class defines a general set of attributes that are used to set the attributes for all annotation objects." persistent="true" keyframe="true" exportAPI="STATE_API" exportInclude="state_exports.h" codefile="AnnotationObject.code">
<Enum name="AnnotationType">
Text2D
Text3D
TimeSlider
Line2D
Line3D
Arrow2D
Arrow3D
Box
......@@ -38,14 +39,14 @@
0.000000
0.000000
</Field>
<Field name="textColor" label="Text color" type="color">
<Field name="textColor" label="Text color" type="color" length="4">
</Field>
<Field name="useForegroundForTextColor" label="Use foreground for text color" type="bool">
true
</Field>
<Field name="color1" label="Color 1" type="color">
<Field name="color1" label="Color 1" type="color" length="4">
</Field>
<Field name="color2" label="Color 2" type="color">
<Field name="color2" label="Color 2" type="color" length="4">
</Field>
<Field name="text" label="Text" type="stringVector">
</Field>
......
......@@ -142,6 +142,7 @@ QvisLegendAttributesInterface.C
QvisLightingWidget.C
QvisLightingWindow.C
QvisLine2DInterface.C
QvisLine3DInterface.C
QvisLineoutQueryWidget.C
QvisLineStyleWidget.C
QvisLineWidthWidget.C
......@@ -342,6 +343,7 @@ QvisTimeQueryOptionsWidget.h
QvisTimeSliderInterface.h
QvisLegendAttributesInterface.h
QvisLine2DInterface.h
QvisLine3DInterface.h
QvisText3DInterface.h
QvisText2DInterface.h
QvisTimeSliderControlWidget.h
......
......@@ -41,6 +41,7 @@
#include <QvisImageAnnotationInterface.h>
#include <QvisLegendAttributesInterface.h>
#include <QvisLine2DInterface.h>
#include <QvisLine3DInterface.h>
#include <QvisText2DInterface.h>
#include <QvisText3DInterface.h>
#include <QvisTimeSliderInterface.h>
......@@ -154,6 +155,9 @@ QvisAnnotationObjectInterfaceFactory::CreateInterface(
case AnnotationObject::Line2D:
retval = new QvisLine2DInterface(parent);
break;
case AnnotationObject::Line3D:
retval = new QvisLine3DInterface(parent);
break;
case AnnotationObject::Arrow2D:
// Nothing yet
break;
......
This diff is collapsed.
......@@ -43,9 +43,11 @@
class QCheckBox;
class QComboBox;
class QSpinBox;
class QLabel;
class QvisColorButton;
class QvisOpacitySlider;
class QvisLineWidthWidget;
class QvisLineStyleWidget;
class QvisScreenPositionEdit;
// ****************************************************************************
......@@ -60,7 +62,9 @@ class QvisScreenPositionEdit;
// Creation: Fri Oct 31 12:47:34 PDT 2003
//
// Modifications:
//
// Kathleen Biagas, Mon Jul 13 13:01:18 PDT 2015
// Add useForegroundColor, colorLabel.
//
// ****************************************************************************
class GUI_API QvisLine2DInterface : public QvisAnnotationObjectInterface
......@@ -85,19 +89,24 @@ private slots:
void beginArrowChanged(int);
void endArrowChanged(int);
void widthChanged(int);
void styleChanged(int);
void colorChanged(const QColor &);
void opacityChanged(int);
void visibilityToggled(bool);
void useForegroundColorToggled(bool);
private:
QvisScreenPositionEdit *positionStartEdit;
QvisScreenPositionEdit *positionEndEdit;
QComboBox *beginArrowComboBox;
QComboBox *endArrowComboBox;
QSpinBox *widthSpinBox;
QvisLineWidthWidget *widthWidget;
QvisLineStyleWidget *styleWidget;
QLabel *colorLabel;
QvisColorButton *colorButton;
QvisOpacitySlider *opacitySlider;
QCheckBox *visibleCheckBox;
QCheckBox *useForegroundColorCheckBox;
};
#endif
This diff is collapsed.
/*****************************************************************************
*
* Copyright (c) 2000 - 2015, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-442911
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the LLNS/LLNL nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* 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 LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, THE U.S. DEPARTMENT OF ENERGY 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 QVIS_LINE3D_INTERFACE_H
#define QVIS_LINE3D_INTERFACE_H
#include <QvisAnnotationObjectInterface.h>
class QCheckBox;
class QComboBox;
class QLabel;
class QLineEdit;
class QSpinBox;
class QvisColorButton;
class QvisOpacitySlider;
class QvisLineWidthWidget;
class QvisLineStyleWidget;
// ****************************************************************************
// Class: QvisLine3DInterface
//
// Purpose:
// This class lets you set attributes for a line annotation.
//
// Notes:
//
// Programmer: Kathleen Biagas
// Creation: July 13, 2015
//
// Modifications:
//
// ****************************************************************************
class GUI_API QvisLine3DInterface : public QvisAnnotationObjectInterface
{
Q_OBJECT
public:
QvisLine3DInterface(QWidget *parent);
virtual ~QvisLine3DInterface();
virtual QString GetName() const { return "3D Line"; }
virtual QString GetMenuText(const AnnotationObject &) const;
virtual void GetCurrentValues(int which);
protected:
virtual void UpdateControls();
private slots:
void point1Changed();
void point2Changed();
void widthChanged(int);
void styleChanged(int);
void colorChanged(const QColor &);
void opacityChanged(int);
void visibilityToggled(bool);
void useForegroundColorToggled(bool);
private:
QLineEdit *point1Edit;
QLineEdit *point2Edit;
QvisLineWidthWidget *widthWidget;
QvisLineStyleWidget *styleWidget;
QCheckBox *useForegroundColorCheckBox;
QLabel *colorLabel;
QvisColorButton *colorButton;
QvisOpacitySlider *opacitySlider;
QCheckBox *visibleCheckBox;
};
#endif
......@@ -74,6 +74,10 @@
// Brad Whitlock, Fri Sep 16 16:13:15 PDT 2011
// Remove width.
//
// Kathleen Biagas, Mon Jul 13 13:11:00 PDT 2015
// Place 'useForeground' checkbox before text color button, added
// textColorLabel so it can be disabled when the button is disabled.
//
// ****************************************************************************
QvisText2DInterface::QvisText2DInterface(QWidget *parent) :
......@@ -111,23 +115,26 @@ QvisText2DInterface::QvisText2DInterface(QWidget *parent) :
cLayout->addWidget(textLineEdit, 2, 1, 1, 3);
cLayout->addWidget(new QLabel(tr("Text"), this), 2, 0);
// Added a use foreground toggle
useForegroundColorCheckBox = new QCheckBox(tr("Use foreground color"), this);
connect(useForegroundColorCheckBox, SIGNAL(toggled(bool)),
this, SLOT(useForegroundColorToggled(bool)));
cLayout->addWidget(useForegroundColorCheckBox, 3, 0, 1, 4);
// Add controls for the text color.
textColorLabel = new QLabel(tr("Text color"), this);
cLayout->addWidget(textColorLabel, 4, 0, Qt::AlignLeft);
textColorButton = new QvisColorButton(this);
connect(textColorButton, SIGNAL(selectedColor(const QColor &)),
this, SLOT(textColorChanged(const QColor &)));
cLayout->addWidget(new QLabel(tr("Text color"), this),
3, 0, Qt::AlignLeft);
cLayout->addWidget(textColorButton, 3, 1);
cLayout->addWidget(textColorButton, 4, 1);
textColorOpacity = new QvisOpacitySlider(0, 255, 10, 0, this);
connect(textColorOpacity, SIGNAL(valueChanged(int)),
this, SLOT(textOpacityChanged(int)));
cLayout->addWidget(textColorOpacity, 3, 2, 1, 2);
cLayout->addWidget(textColorOpacity, 4, 2, 1, 2);
// Added a use foreground toggle
useForegroundColorCheckBox = new QCheckBox(tr("Use foreground color"), this);
connect(useForegroundColorCheckBox, SIGNAL(toggled(bool)),
this, SLOT(useForegroundColorToggled(bool)));
cLayout->addWidget(useForegroundColorCheckBox, 4, 0, 1, 4);
// Add controls to set the font family.
fontFamilyComboBox = new QComboBox(this);
......@@ -230,6 +237,9 @@ QvisText2DInterface::GetMenuText(const AnnotationObject &annot) const
// Brad Whitlock, Fri Sep 16 16:14:38 PDT 2011
// Use height.
//
// Kathleen Biagas, Mon Jul 13 13:19:45 PDT 2015
// Enable/disable textColorLabel along with textColorButton.
//
// ****************************************************************************
void
......@@ -256,6 +266,7 @@ QvisText2DInterface::UpdateControls()
{
QColor tmp(255,255,255);
textColorButton->setButtonColor(tmp);
textColorLabel->setEnabled(false);
textColorButton->setEnabled(false);
textColorOpacity->setGradientColor(tmp);
}
......@@ -265,6 +276,7 @@ QvisText2DInterface::UpdateControls()
annot->GetTextColor().Green(),
annot->GetTextColor().Blue());
textColorButton->setButtonColor(tc);
textColorLabel->setEnabled(true);
textColorButton->setEnabled(true);
textColorOpacity->setGradientColor(tc);
}
......
......@@ -43,6 +43,7 @@
// Forward declarations
class QComboBox;
class QCheckBox;
class QLabel;
class QLineEdit;
class QSpinBox;
class QvisColorButton;
......@@ -64,6 +65,9 @@ class QvisScreenPositionEdit;
// Brad Whitlock, Fri Sep 16 16:12:59 PDT 2011
// Remove width and use height.
//
// Kathleen Biagas, Mon Jul 13 13:01:18 PDT 2015
// Add textColorLabel.
//
// ****************************************************************************
class GUI_API QvisText2DInterface : public QvisAnnotationObjectInterface
......@@ -95,6 +99,7 @@ private:
QvisScreenPositionEdit *positionEdit;
QSpinBox *heightSpinBox;
QLineEdit *textLineEdit;
QLabel *textColorLabel;
QvisColorButton *textColorButton;
QvisOpacitySlider *textColorOpacity;
QComboBox *fontFamilyComboBox;
......
......@@ -86,6 +86,10 @@
// Brad Whitlock, Mon Jul 21 11:33:44 PDT 2008
// Qt 4.
//
// Kathleen Biagas, Mon Jul 13 13:11:00 PDT 2015
// Place 'useForeground' checkbox before text color button, added
// textColorLabel so it can be disabled when the button is disabled.
//
// ****************************************************************************
QvisText3DInterface::QvisText3DInterface(QWidget *parent) :
......@@ -197,11 +201,20 @@ QvisText3DInterface::QvisText3DInterface(QWidget *parent) :
cLayout->addWidget(splitter2, row, 0, 1, 4);
++row;
// Added a use foreground toggle
useForegroundColorCheckBox = new QCheckBox(tr("Use foreground color"), this);
connect(useForegroundColorCheckBox, SIGNAL(toggled(bool)),
this, SLOT(useForegroundColorToggled(bool)));
cLayout->addWidget(useForegroundColorCheckBox, row, 0, 1, 3);
++row;
// Add controls for the text color.
textColorLabel = new QLabel(tr("Text color"), this);
cLayout->addWidget(textColorLabel, row, 0, Qt::AlignLeft);
textColorButton = new QvisColorButton(this);
connect(textColorButton, SIGNAL(selectedColor(const QColor &)),
this, SLOT(textColorChanged(const QColor &)));
cLayout->addWidget(new QLabel(tr("Text color")), row, 0, Qt::AlignLeft);
cLayout->addWidget(textColorButton, row, 1);
textColorOpacity = new QvisOpacitySlider(0, 255, 10, 0, this);
connect(textColorOpacity, SIGNAL(valueChanged(int)),
......@@ -209,12 +222,6 @@ QvisText3DInterface::QvisText3DInterface(QWidget *parent) :
cLayout->addWidget(textColorOpacity, row, 2, 1, 2);
++row;