Commit 491400b0 authored by hrchilds's avatar hrchilds
Browse files

Update from July 15, 2003

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@34 18c085ea-50e0-402c-830e-de6fd14e8384
parent 5f4804b8
......@@ -12,18 +12,22 @@ static const char *Ticks_strings[] = {
std::string
AnnotationAttributes::Ticks_ToString(AnnotationAttributes::Ticks t)
{
return Ticks_strings[(int)t];
int index = int(t);
if(index < 0 || index >= 5) index = 0;
return Ticks_strings[index];
}
std::string
AnnotationAttributes::Ticks_ToString(int t)
{
return Ticks_strings[t];
int index = (t < 0 || t >= 5) ? 0 : t;
return Ticks_strings[index];
}
bool
AnnotationAttributes::Ticks_FromString(const std::string &s, AnnotationAttributes::Ticks &val)
{
val = AnnotationAttributes::Off;
for(int i = 0; i < 5; ++i)
{
if(s == Ticks_strings[i])
......@@ -46,18 +50,22 @@ static const char *Location_strings[] = {
std::string
AnnotationAttributes::Location_ToString(AnnotationAttributes::Location t)
{
return Location_strings[(int)t];
int index = int(t);
if(index < 0 || index >= 3) index = 0;
return Location_strings[index];
}
std::string
AnnotationAttributes::Location_ToString(int t)
{
return Location_strings[t];
int index = (t < 0 || t >= 3) ? 0 : t;
return Location_strings[index];
}
bool
AnnotationAttributes::Location_FromString(const std::string &s, AnnotationAttributes::Location &val)
{
val = AnnotationAttributes::Inside;
for(int i = 0; i < 3; ++i)
{
if(s == Location_strings[i])
......@@ -80,18 +88,22 @@ static const char *Axes_strings[] = {
std::string
AnnotationAttributes::Axes_ToString(AnnotationAttributes::Axes t)
{
return Axes_strings[(int)t];
int index = int(t);
if(index < 0 || index >= 5) index = 0;
return Axes_strings[index];
}
std::string
AnnotationAttributes::Axes_ToString(int t)
{
return Axes_strings[t];
int index = (t < 0 || t >= 5) ? 0 : t;
return Axes_strings[index];
}
bool
AnnotationAttributes::Axes_FromString(const std::string &s, AnnotationAttributes::Axes &val)
{
val = AnnotationAttributes::ClosestTriad;
for(int i = 0; i < 5; ++i)
{
if(s == Axes_strings[i])
......@@ -114,18 +126,22 @@ static const char *GradientStyle_strings[] = {
std::string
AnnotationAttributes::GradientStyle_ToString(AnnotationAttributes::GradientStyle t)
{
return GradientStyle_strings[(int)t];
int index = int(t);
if(index < 0 || index >= 5) index = 0;
return GradientStyle_strings[index];
}
std::string
AnnotationAttributes::GradientStyle_ToString(int t)
{
return GradientStyle_strings[t];
int index = (t < 0 || t >= 5) ? 0 : t;
return GradientStyle_strings[index];
}
bool
AnnotationAttributes::GradientStyle_FromString(const std::string &s, AnnotationAttributes::GradientStyle &val)
{
val = AnnotationAttributes::TopToBottom;
for(int i = 0; i < 5; ++i)
{
if(s == GradientStyle_strings[i])
......@@ -147,18 +163,22 @@ static const char *BackgroundMode_strings[] = {
std::string
AnnotationAttributes::BackgroundMode_ToString(AnnotationAttributes::BackgroundMode t)
{
return BackgroundMode_strings[(int)t];
int index = int(t);
if(index < 0 || index >= 2) index = 0;
return BackgroundMode_strings[index];
}
std::string
AnnotationAttributes::BackgroundMode_ToString(int t)
{
return BackgroundMode_strings[t];
int index = (t < 0 || t >= 2) ? 0 : t;
return BackgroundMode_strings[index];
}
bool
AnnotationAttributes::BackgroundMode_FromString(const std::string &s, AnnotationAttributes::BackgroundMode &val)
{
val = AnnotationAttributes::Solid;
for(int i = 0; i < 2; ++i)
{
if(s == BackgroundMode_strings[i])
......@@ -179,7 +199,7 @@ AnnotationAttributes::BackgroundMode_FromString(const std::string &s, Annotation
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 24 13:14:21 PST 2003
// Creation: Tue Jul 15 13:47:28 PST 2003
//
// Modifications:
//
......@@ -264,7 +284,7 @@ AnnotationAttributes::AnnotationAttributes() : AttributeSubject("bbbbbbbbddddddd
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 24 13:14:21 PST 2003
// Creation: Tue Jul 15 13:47:28 PST 2003
//
// Modifications:
//
......@@ -353,7 +373,7 @@ AnnotationAttributes::AnnotationAttributes(const AnnotationAttributes &obj) : At
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 24 13:14:21 PST 2003
// Creation: Tue Jul 15 13:47:28 PST 2003
//
// Modifications:
//
......@@ -373,7 +393,7 @@ AnnotationAttributes::~AnnotationAttributes()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 24 13:14:21 PST 2003
// Creation: Tue Jul 15 13:47:28 PST 2003
//
// Modifications:
//
......@@ -463,7 +483,7 @@ AnnotationAttributes::operator = (const AnnotationAttributes &obj)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 24 13:14:21 PST 2003
// Creation: Tue Jul 15 13:47:28 PST 2003
//
// Modifications:
//
......@@ -552,7 +572,7 @@ AnnotationAttributes::operator == (const AnnotationAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 24 13:14:21 PST 2003
// Creation: Tue Jul 15 13:47:28 PST 2003
//
// Modifications:
//
......@@ -573,7 +593,7 @@ AnnotationAttributes::operator != (const AnnotationAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 24 13:14:21 PST 2003
// Creation: Tue Jul 15 13:47:28 PST 2003
//
// Modifications:
//
......@@ -594,7 +614,7 @@ AnnotationAttributes::TypeName() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 24 13:14:21 PST 2003
// Creation: Tue Jul 15 13:47:28 PST 2003
//
// Modifications:
//
......@@ -622,7 +642,7 @@ AnnotationAttributes::CopyAttributes(const AttributeGroup *atts)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 24 13:14:21 PST 2003
// Creation: Tue Jul 15 13:47:28 PST 2003
//
// Modifications:
//
......@@ -648,7 +668,7 @@ AnnotationAttributes::CreateCompatible(const std::string &tname) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 24 13:14:21 PST 2003
// Creation: Tue Jul 15 13:47:28 PST 2003
//
// Modifications:
//
......@@ -740,7 +760,7 @@ AnnotationAttributes::SelectAll()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 24 13:14:21 PST 2003
// Creation: Tue Jul 15 13:47:28 PST 2003
//
// Modifications:
//
......@@ -1208,7 +1228,7 @@ AnnotationAttributes::CreateNode(DataNode *parentNode, bool forceAdd)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 24 13:14:21 PST 2003
// Creation: Tue Jul 15 13:47:28 PST 2003
//
// Modifications:
//
......@@ -1271,7 +1291,11 @@ AnnotationAttributes::SetFromNode(DataNode *parentNode)
{
// Allow enums to be int or string in the config file
if(node->GetNodeType() == INT_NODE)
SetAxesTickLocation2D(Location(node->AsInt()));
{
int ival = node->AsInt();
if(ival >= 0 && ival < 3)
SetAxesTickLocation2D(Location(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
Location value;
......@@ -1283,7 +1307,11 @@ AnnotationAttributes::SetFromNode(DataNode *parentNode)
{
// Allow enums to be int or string in the config file
if(node->GetNodeType() == INT_NODE)
SetAxesTicks2D(Ticks(node->AsInt()));
{
int ival = node->AsInt();
if(ival >= 0 && ival < 5)
SetAxesTicks2D(Ticks(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
Ticks value;
......@@ -1359,7 +1387,11 @@ AnnotationAttributes::SetFromNode(DataNode *parentNode)
{
// Allow enums to be int or string in the config file
if(node->GetNodeType() == INT_NODE)
SetAxesTickLocation(Location(node->AsInt()));
{
int ival = node->AsInt();
if(ival >= 0 && ival < 3)
SetAxesTickLocation(Location(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
Location value;
......@@ -1371,7 +1403,11 @@ AnnotationAttributes::SetFromNode(DataNode *parentNode)
{
// Allow enums to be int or string in the config file
if(node->GetNodeType() == INT_NODE)
SetAxesType(Axes(node->AsInt()));
{
int ival = node->AsInt();
if(ival >= 0 && ival < 5)
SetAxesType(Axes(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
Axes value;
......@@ -1391,7 +1427,11 @@ AnnotationAttributes::SetFromNode(DataNode *parentNode)
{
// Allow enums to be int or string in the config file
if(node->GetNodeType() == INT_NODE)
SetGradientBackgroundStyle(GradientStyle(node->AsInt()));
{
int ival = node->AsInt();
if(ival >= 0 && ival < 5)
SetGradientBackgroundStyle(GradientStyle(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
GradientStyle value;
......@@ -1407,7 +1447,11 @@ AnnotationAttributes::SetFromNode(DataNode *parentNode)
{
// Allow enums to be int or string in the config file
if(node->GetNodeType() == INT_NODE)
SetBackgroundMode(BackgroundMode(node->AsInt()));
{
int ival = node->AsInt();
if(ival >= 0 && ival < 2)
SetBackgroundMode(BackgroundMode(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
BackgroundMode value;
......@@ -2380,7 +2424,7 @@ AnnotationAttributes::SelectGradientColor2()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 24 13:14:21 PST 2003
// Creation: Tue Jul 15 13:47:28 PST 2003
//
// Modifications:
//
......@@ -2472,7 +2516,7 @@ AnnotationAttributes::GetFieldName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 24 13:14:21 PST 2003
// Creation: Tue Jul 15 13:47:28 PST 2003
//
// Modifications:
//
......@@ -2564,7 +2608,7 @@ AnnotationAttributes::GetFieldType(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 24 13:14:21 PST 2003
// Creation: Tue Jul 15 13:47:28 PST 2003
//
// Modifications:
//
......@@ -2656,7 +2700,7 @@ AnnotationAttributes::GetFieldTypeName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 24 13:14:21 PST 2003
// Creation: Tue Jul 15 13:47:28 PST 2003
//
// Modifications:
//
......
......@@ -14,7 +14,7 @@
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 24 13:14:21 PST 2003
// Creation: Tue Jul 15 13:47:28 PST 2003
//
// Modifications:
//
......
......@@ -12,18 +12,22 @@ static const char *ContourMethod_strings[] = {
std::string
ContourOpAttributes::ContourMethod_ToString(ContourOpAttributes::ContourMethod t)
{
return ContourMethod_strings[(int)t];
int index = int(t);
if(index < 0 || index >= 3) index = 0;
return ContourMethod_strings[index];
}
std::string
ContourOpAttributes::ContourMethod_ToString(int t)
{
return ContourMethod_strings[t];
int index = (t < 0 || t >= 3) ? 0 : t;
return ContourMethod_strings[index];
}
bool
ContourOpAttributes::ContourMethod_FromString(const std::string &s, ContourOpAttributes::ContourMethod &val)
{
val = ContourOpAttributes::Level;
for(int i = 0; i < 3; ++i)
{
if(s == ContourMethod_strings[i])
......@@ -45,18 +49,22 @@ static const char *ContourScaling_strings[] = {
std::string
ContourOpAttributes::ContourScaling_ToString(ContourOpAttributes::ContourScaling t)
{
return ContourScaling_strings[(int)t];
int index = int(t);
if(index < 0 || index >= 2) index = 0;
return ContourScaling_strings[index];
}
std::string
ContourOpAttributes::ContourScaling_ToString(int t)
{
return ContourScaling_strings[t];
int index = (t < 0 || t >= 2) ? 0 : t;
return ContourScaling_strings[index];
}
bool
ContourOpAttributes::ContourScaling_FromString(const std::string &s, ContourOpAttributes::ContourScaling &val)
{
val = ContourOpAttributes::Linear;
for(int i = 0; i < 2; ++i)
{
if(s == ContourScaling_strings[i])
......@@ -77,7 +85,7 @@ ContourOpAttributes::ContourScaling_FromString(const std::string &s, ContourOpAt
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 13:39:47 PST 2003
// Creation: Tue Jul 15 13:47:30 PST 2003
//
// Modifications:
//
......@@ -102,7 +110,7 @@ ContourOpAttributes::ContourOpAttributes() : AttributeSubject("id*d*ibbddis")
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 13:39:47 PST 2003
// Creation: Tue Jul 15 13:47:30 PST 2003
//
// Modifications:
//
......@@ -133,7 +141,7 @@ ContourOpAttributes::ContourOpAttributes(const ContourOpAttributes &obj) : Attri
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 13:39:47 PST 2003
// Creation: Tue Jul 15 13:47:30 PST 2003
//
// Modifications:
//
......@@ -153,7 +161,7 @@ ContourOpAttributes::~ContourOpAttributes()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 13:39:47 PST 2003
// Creation: Tue Jul 15 13:47:30 PST 2003
//
// Modifications:
//
......@@ -185,7 +193,7 @@ ContourOpAttributes::operator = (const ContourOpAttributes &obj)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 13:39:47 PST 2003
// Creation: Tue Jul 15 13:47:30 PST 2003
//
// Modifications:
//
......@@ -216,7 +224,7 @@ ContourOpAttributes::operator == (const ContourOpAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 13:39:47 PST 2003
// Creation: Tue Jul 15 13:47:30 PST 2003
//
// Modifications:
//
......@@ -237,7 +245,7 @@ ContourOpAttributes::operator != (const ContourOpAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 13:39:47 PST 2003
// Creation: Tue Jul 15 13:47:30 PST 2003
//
// Modifications:
//
......@@ -258,7 +266,7 @@ ContourOpAttributes::TypeName() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 13:39:47 PST 2003
// Creation: Tue Jul 15 13:47:30 PST 2003
//
// Modifications:
//
......@@ -286,7 +294,7 @@ ContourOpAttributes::CopyAttributes(const AttributeGroup *atts)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 13:39:47 PST 2003
// Creation: Tue Jul 15 13:47:30 PST 2003
//
// Modifications:
//
......@@ -312,7 +320,7 @@ ContourOpAttributes::CreateCompatible(const std::string &tname) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 13:39:47 PST 2003
// Creation: Tue Jul 15 13:47:30 PST 2003
//
// Modifications:
//
......@@ -346,7 +354,7 @@ ContourOpAttributes::SelectAll()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 13:39:47 PST 2003
// Creation: Tue Jul 15 13:47:30 PST 2003
//
// Modifications:
//
......@@ -442,7 +450,7 @@ ContourOpAttributes::CreateNode(DataNode *parentNode, bool forceAdd)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 13:39:47 PST 2003
// Creation: Tue Jul 15 13:47:30 PST 2003
//
// Modifications:
//
......@@ -469,7 +477,11 @@ ContourOpAttributes::SetFromNode(DataNode *parentNode)
{
// Allow enums to be int or string in the config file
if(node->GetNodeType() == INT_NODE)
SetContourMethod(ContourMethod(node->AsInt()));
{
int ival = node->AsInt();
if(ival >= 0 && ival < 3)
SetContourMethod(ContourMethod(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
ContourMethod value;
......@@ -489,7 +501,11 @@ ContourOpAttributes::SetFromNode(DataNode *parentNode)
{
// Allow enums to be int or string in the config file
if(node->GetNodeType() == INT_NODE)
SetScaling(ContourScaling(node->AsInt()));
{
int ival = node->AsInt();
if(ival >= 0 && ival < 2)
SetScaling(ContourScaling(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
ContourScaling value;
......@@ -692,7 +708,7 @@ ContourOpAttributes::SelectVariable()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 13:39:47 PST 2003
// Creation: Tue Jul 15 13:47:30 PST 2003
//
// Modifications:
//
......@@ -726,7 +742,7 @@ ContourOpAttributes::GetFieldName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 13:39:47 PST 2003
// Creation: Tue Jul 15 13:47:30 PST 2003
//
// Modifications:
//
......@@ -760,7 +776,7 @@ ContourOpAttributes::GetFieldType(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 13:39:47 PST 2003
// Creation: Tue Jul 15 13:47:30 PST 2003
//
// Modifications:
//
......@@ -794,7 +810,7 @@ ContourOpAttributes::GetFieldTypeName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 13:39:47 PST 2003
// Creation: Tue Jul 15 13:47:30 PST 2003
//
// Modifications:
//
......
......@@ -13,7 +13,7 @@
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 13:39:47 PST 2003
// Creation: Tue Jul 15 13:47:30 PST 2003
//
// Modifications:
//
......
......@@ -13,18 +13,22 @@ static const char *ExprType_strings[] = {
std::string
Expression::ExprType_ToString(Expression::ExprType t)
{
return ExprType_strings[(int)t];
int index = int(t);
if(index < 0 || index >= 6) index = 0;
return ExprType_strings[index];
}
std::string
Expression::ExprType_ToString(int t)
{
return ExprType_strings[t];
int index = (t < 0 || t >= 6) ? 0 : t;
return ExprType_strings[index];
}
bool
Expression::ExprType_FromString(const std::string &s, Expression::ExprType &val)
{
val = Expression::Unknown;
for(int i = 0; i < 6; ++i)
{
if(s == ExprType_strings[i])
......@@ -45,7 +49,7 @@ Expression::ExprType_FromString(const std::string &s, Expression::ExprType &val)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 13:39:49 PST 2003
// Creation: Tue Jul 15 13:47:32 PST 2003
//
// Modifications:
//
......@@ -68,7 +72,7 @@ Expression::Expression() : AttributeSubject("ssbi")
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 13:39:49 PST 2003
// Creation: Tue Jul 15 13:47:32 PST 2003
//
// Modifications:
//
......@@ -93,7 +97,7 @@ Expression::Expression(const Expression &obj) : AttributeSubject("ssbi")
// Note: Autogenerated by xml2atts.