Commit cdabb6c0 authored by loring's avatar loring

fix a typing bug in patch r21912 dealing with new OpacityType

enumeration values added for version 2.7.0. That patch assumed
opacityType is stored as an integer when in reality it is stored
as a std::string.


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23837 18c085ea-50e0-402c-830e-de6fd14e8384
parent f16fd5f3
......@@ -35,7 +35,7 @@ Postfix:
}
}
Target: xml2atts
Target: xml2atts
Function: ChangesRequireRecalculation
Declaration: bool ChangesRequireRecalculation(const PseudocolorAttributes &) const;
Definition:
......@@ -165,9 +165,15 @@ Definition:
// Creation: Fri Mar 12 09:33:52 PST 2010
//
// Modifications:
// Burlen Loring, Wed Jul 23 12:53:09 PDT 2014
// fix a typing bug in patch r21912 dealing with new OpacityType
// enumeration values added for version 2.7.0. That patch assumed
// opacityType is stored as an integer when in reality it is stored
// as a std::string.
//
// ****************************************************************************
#include <Utility.h>
#include <DebugStream.h>
void
PseudocolorAttributes::ProcessOldVersions(DataNode *parentNode,
const char *configVersion)
......@@ -223,21 +229,39 @@ PseudocolorAttributes::ProcessOldVersions(DataNode *parentNode,
// does not rely on the opacity value.
// Assume Explicit is really Fully Opaque for now
PseudocolorAttributes::OpacityType val =
k->AsInt() ? FullyOpaque : ColorTable;
if( val == FullyOpaque )
PseudocolorAttributes::OpacityType val = FullyOpaque;
std::string strVal = k->AsString();
if (strVal == "Explicit")
{
// If the opacity value is set and valid change to constant
DataNode *op = 0;
if((op = searchNode->GetNode("opacity")) != 0)
{
double opacity = op->AsDouble();
if ((0.0 <= opacity) && (opacity < 1.0))
{
val = Constant;
}
}
else
{
val = FullyOpaque;
}
}
else
if (strVal == "ColorTable")
{
// If the opacity value is set and valid change to constant
DataNode *op = 0;
if((op = searchNode->GetNode("opacity")) != 0)
{
double opacity = op->AsDouble();
if( 0.0 <= opacity && opacity < 1.0 )
val = Constant;
}
val = ColorTable;
}
else
{
debug1 <<
"PseudocolorAttributes::ProcessOldVersions "
"2.0.0 < configVersion < 2.7.0 bad value for "
"opacityType detected " << strVal << endl;
}
// Update the opacityType to the new value.
searchNode->RemoveNode(k, true);
searchNode->AddNode(new DataNode("opacityType",
......@@ -262,3 +286,4 @@ PseudocolorAttributes::ProcessOldVersions(DataNode *parentNode,
}
}
}
<?xml version="1.0"?>
<Plugin name="Pseudocolor" type="plot" label="Pseudocolor" version="1.0" enabled="true" vartype="scalar,species" iconFile="Pseudocolor.xpm">
<Plugin name="Pseudocolor" type="plot" label="Pseudocolor" version="1.0" enabled="true" mdspecificcode="false" engspecificcode="false" onlyengine="false" noengine="false" vartype="scalar,species" iconFile="Pseudocolor.xpm">
<Files components="V">
avtPseudocolorFilter.C
</Files>
<Files components="E">
avtPseudocolorFilter.C
</Files>
<Attribute name="PseudocolorAttributes" purpose="Attributes for the pseudocolor plot" persistent="true" codefile="Pseudocolor.code">
<Attribute name="PseudocolorAttributes" purpose="Attributes for the pseudocolor plot" persistent="true" keyframe="true" exportAPI="" exportInclude="" codefile="Pseudocolor.code">
<Enum name="Scaling">
Linear
Log
......@@ -57,15 +57,12 @@
Absolute
FractionOfBBox
</Enum>
<Field name="scaling" label="Scale" type="enum" subtype="Scaling">
Linear
</Field>
<Field name="skewFactor" label="Skew factor" type="double" enabler="scaling:Skew">
1.000000
</Field>
<Field name="limitsMode" label="Limits Mode" type="enum" subtype="LimitsMode">
OriginalData
</Field>
......@@ -81,11 +78,9 @@
<Field name="max" label="Maximum" type="double" enabler="maxFlag:true">
1.000000
</Field>
<Field name="centering" label="Centering" type="enum" subtype="Centering">
Natural
</Field>
<Field name="colorTableName" label="Color table" type="colortable">
hot
</Field>
......@@ -112,7 +107,6 @@
<Field name="opacityVarMaxFlag" label="opactityVarMaxFlag" type="bool">
false
</Field>
<Field name="pointSize" label="Point size" type="double">
0.050000
</Field>
......@@ -128,7 +122,6 @@
<Field name="pointSizePixels" label="Point size pixels" type="int">
2
</Field>
<Field name="lineType" label="Line Type" type="enum" subtype="LineType">
Line
</Field>
......@@ -138,7 +131,6 @@
<Field name="lineWidth" label="lineWidth" type="linewidth">
0
</Field>
<Field name="tubeDisplayDensity" label="tubeDisplayDensity" type="int">
10
</Field>
......@@ -151,7 +143,6 @@
<Field name="tubeRadiusBBox" label="Radius (BBox Fraction)" type="double" enabler="tubeRadiusSizeType:FractionOfBBox">
0.005000
</Field>
<Field name="varyTubeRadius" label="varyTubeRadius" type="bool">
false
</Field>
......@@ -160,14 +151,12 @@
<Field name="varyTubeRadiusFactor" label="varyTubeRadiusFactor" type="double">
10.000000
</Field>
<Field name="endPointType" label="End point type" type="enum" subtype="EndPointType">
None
</Field>
<Field name="endPointStyle" label="End point style" type="enum" subtype="EndPointStyle">
Spheres
</Field>
<Field name="endPointRadiusSizeType" label="endPointRadiusSizeType" type="enum" subtype="SizeType">
FractionOfBBox
</Field>
......@@ -180,7 +169,6 @@
<Field name="endPointRatio" label="endPointRatio" type="double">
2.000000
</Field>
<Field name="renderSurfaces" label="Render surfaces" type="int">
1
</Field>
......@@ -193,14 +181,12 @@
<Field name="smoothingLevel" label="Smoothing" type="int">
0
</Field>
<Field name="legendFlag" label="Legend" type="bool">
<Field name="legendFlag" label="Legend" type="bool">
true
</Field>
<Field name="lightingFlag" label="Lighting" type="bool">
true
</Field>
<Function name="ChangesRequireRecalculation" user="true" member="true">
</Function>
<Function name="Print" user="true" member="true">
......
......@@ -2665,9 +2665,15 @@ PseudocolorAttributes::Print(ostream &out, bool selected_only) const
// Creation: Fri Mar 12 09:33:52 PST 2010
//
// Modifications:
// Burlen Loring, Wed Jul 23 12:53:09 PDT 2014
// fix a typing bug in patch r21912 dealing with new OpacityType
// enumeration values added for version 2.7.0. That patch assumed
// opacityType is stored as an integer when in reality it is stored
// as a std::string.
//
// ****************************************************************************
#include <Utility.h>
#include <DebugStream.h>
void
PseudocolorAttributes::ProcessOldVersions(DataNode *parentNode,
const char *configVersion)
......@@ -2723,21 +2729,39 @@ PseudocolorAttributes::ProcessOldVersions(DataNode *parentNode,
// does not rely on the opacity value.
// Assume Explicit is really Fully Opaque for now
PseudocolorAttributes::OpacityType val =
k->AsInt() ? FullyOpaque : ColorTable;
if( val == FullyOpaque )
PseudocolorAttributes::OpacityType val = FullyOpaque;
std::string strVal = k->AsString();
if (strVal == "Explicit")
{
// If the opacity value is set and valid change to constant
DataNode *op = 0;
if((op = searchNode->GetNode("opacity")) != 0)
{
double opacity = op->AsDouble();
if( 0.0 <= opacity && opacity < 1.0 )
val = Constant;
}
}
// If the opacity value is set and valid change to constant
DataNode *op = 0;
if((op = searchNode->GetNode("opacity")) != 0)
{
double opacity = op->AsDouble();
if ((0.0 <= opacity) && (opacity < 1.0))
{
val = Constant;
}
}
else
{
val = FullyOpaque;
}
}
else
if (strVal == "ColorTable")
{
val = ColorTable;
}
else
{
debug1 <<
"PseudocolorAttributes::ProcessOldVersions "
"2.0.0 < configVersion < 2.7.0 bad value for "
"opacityType detected " << strVal << endl;
}
// Update the opacityType to the new value.
searchNode->RemoveNode(k, true);
searchNode->AddNode(new DataNode("opacityType",
......
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