/*****************************************************************************
*
* Copyright (c) 2000 - 2018, 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.
*
*****************************************************************************/

#include <IsosurfaceAttributes.h>
#include <DataNode.h>

//
// Enum conversion methods for IsosurfaceAttributes::Select_by
//

static const char *Select_by_strings[] = {
"Level", "Value", "Percent"
};

std::string
IsosurfaceAttributes::Select_by_ToString(IsosurfaceAttributes::Select_by t)
{
    int index = int(t);
    if(index < 0 || index >= 3) index = 0;
    return Select_by_strings[index];
}

std::string
IsosurfaceAttributes::Select_by_ToString(int t)
{
    int index = (t < 0 || t >= 3) ? 0 : t;
    return Select_by_strings[index];
}

bool
IsosurfaceAttributes::Select_by_FromString(const std::string &s, IsosurfaceAttributes::Select_by &val)
{
    val = IsosurfaceAttributes::Level;
    for(int i = 0; i < 3; ++i)
    {
        if(s == Select_by_strings[i])
        {
            val = (Select_by)i;
            return true;
        }
    }
    return false;
}

//
// Enum conversion methods for IsosurfaceAttributes::Scaling
//

static const char *Scaling_strings[] = {
"Linear", "Log"};

std::string
IsosurfaceAttributes::Scaling_ToString(IsosurfaceAttributes::Scaling t)
{
    int index = int(t);
    if(index < 0 || index >= 2) index = 0;
    return Scaling_strings[index];
}

std::string
IsosurfaceAttributes::Scaling_ToString(int t)
{
    int index = (t < 0 || t >= 2) ? 0 : t;
    return Scaling_strings[index];
}

bool
IsosurfaceAttributes::Scaling_FromString(const std::string &s, IsosurfaceAttributes::Scaling &val)
{
    val = IsosurfaceAttributes::Linear;
    for(int i = 0; i < 2; ++i)
    {
        if(s == Scaling_strings[i])
        {
            val = (Scaling)i;
            return true;
        }
    }
    return false;
}

// ****************************************************************************
// Method: IsosurfaceAttributes::IsosurfaceAttributes
//
// Purpose: 
//   Init utility for the IsosurfaceAttributes class.
//
// Note:       Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:   omitted
//
// Modifications:
//   
// ****************************************************************************

void IsosurfaceAttributes::Init()
{
    contourNLevels = 10;
    contourMethod = Level;
    minFlag = false;
    min = 0;
    maxFlag = false;
    max = 1;
    scaling = Linear;

    IsosurfaceAttributes::SelectAll();
}

// ****************************************************************************
// Method: IsosurfaceAttributes::IsosurfaceAttributes
//
// Purpose: 
//   Copy utility for the IsosurfaceAttributes class.
//
// Note:       Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:   omitted
//
// Modifications:
//   
// ****************************************************************************

void IsosurfaceAttributes::Copy(const IsosurfaceAttributes &obj)
{
    contourNLevels = obj.contourNLevels;
    contourValue = obj.contourValue;
    contourPercent = obj.contourPercent;
    contourMethod = obj.contourMethod;
    minFlag = obj.minFlag;
    min = obj.min;
    maxFlag = obj.maxFlag;
    max = obj.max;
    scaling = obj.scaling;
    variable = obj.variable;

    IsosurfaceAttributes::SelectAll();
}

// Type map format string
const char *IsosurfaceAttributes::TypeMapFormatString = ISOSURFACEATTRIBUTES_TMFS;
const AttributeGroup::private_tmfs_t IsosurfaceAttributes::TmfsStruct = {ISOSURFACEATTRIBUTES_TMFS};


// ****************************************************************************
// Method: IsosurfaceAttributes::IsosurfaceAttributes
//
// Purpose: 
//   Default constructor for the IsosurfaceAttributes class.
//
// Note:       Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:   omitted
//
// Modifications:
//   
// ****************************************************************************

IsosurfaceAttributes::IsosurfaceAttributes() : 
    AttributeSubject(IsosurfaceAttributes::TypeMapFormatString),
    variable("default")
{
    IsosurfaceAttributes::Init();
}

// ****************************************************************************
// Method: IsosurfaceAttributes::IsosurfaceAttributes
//
// Purpose: 
//   Constructor for the derived classes of IsosurfaceAttributes class.
//
// Note:       Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:   omitted
//
// Modifications:
//   
// ****************************************************************************

IsosurfaceAttributes::IsosurfaceAttributes(private_tmfs_t tmfs) : 
    AttributeSubject(tmfs.tmfs),
    variable("default")
{
    IsosurfaceAttributes::Init();
}

// ****************************************************************************
// Method: IsosurfaceAttributes::IsosurfaceAttributes
//
// Purpose: 
//   Copy constructor for the IsosurfaceAttributes class.
//
// Note:       Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:   omitted
//
// Modifications:
//   
// ****************************************************************************

IsosurfaceAttributes::IsosurfaceAttributes(const IsosurfaceAttributes &obj) : 
    AttributeSubject(IsosurfaceAttributes::TypeMapFormatString)
{
    IsosurfaceAttributes::Copy(obj);
}

// ****************************************************************************
// Method: IsosurfaceAttributes::IsosurfaceAttributes
//
// Purpose: 
//   Copy constructor for derived classes of the IsosurfaceAttributes class.
//
// Note:       Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:   omitted
//
// Modifications:
//   
// ****************************************************************************

IsosurfaceAttributes::IsosurfaceAttributes(const IsosurfaceAttributes &obj, private_tmfs_t tmfs) : 
    AttributeSubject(tmfs.tmfs)
{
    IsosurfaceAttributes::Copy(obj);
}

// ****************************************************************************
// Method: IsosurfaceAttributes::~IsosurfaceAttributes
//
// Purpose: 
//   Destructor for the IsosurfaceAttributes class.
//
// Note:       Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:   omitted
//
// Modifications:
//   
// ****************************************************************************

IsosurfaceAttributes::~IsosurfaceAttributes()
{
    // nothing here
}

// ****************************************************************************
// Method: IsosurfaceAttributes::operator = 
//
// Purpose: 
//   Assignment operator for the IsosurfaceAttributes class.
//
// Note:       Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:   omitted
//
// Modifications:
//   
// ****************************************************************************

IsosurfaceAttributes& 
IsosurfaceAttributes::operator = (const IsosurfaceAttributes &obj)
{
    if (this == &obj) return *this;

    IsosurfaceAttributes::Copy(obj);

    return *this;
}

// ****************************************************************************
// Method: IsosurfaceAttributes::operator == 
//
// Purpose: 
//   Comparison operator == for the IsosurfaceAttributes class.
//
// Note:       Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:   omitted
//
// Modifications:
//   
// ****************************************************************************

bool
IsosurfaceAttributes::operator == (const IsosurfaceAttributes &obj) const
{
    // Create the return value
    return ((contourNLevels == obj.contourNLevels) &&
            (contourValue == obj.contourValue) &&
            (contourPercent == obj.contourPercent) &&
            (contourMethod == obj.contourMethod) &&
            (minFlag == obj.minFlag) &&
            (min == obj.min) &&
            (maxFlag == obj.maxFlag) &&
            (max == obj.max) &&
            (scaling == obj.scaling) &&
            (variable == obj.variable));
}

// ****************************************************************************
// Method: IsosurfaceAttributes::operator != 
//
// Purpose: 
//   Comparison operator != for the IsosurfaceAttributes class.
//
// Note:       Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:   omitted
//
// Modifications:
//   
// ****************************************************************************

bool
IsosurfaceAttributes::operator != (const IsosurfaceAttributes &obj) const
{
    return !(this->operator == (obj));
}

// ****************************************************************************
// Method: IsosurfaceAttributes::TypeName
//
// Purpose: 
//   Type name method for the IsosurfaceAttributes class.
//
// Note:       Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:   omitted
//
// Modifications:
//   
// ****************************************************************************

const std::string
IsosurfaceAttributes::TypeName() const
{
    return "IsosurfaceAttributes";
}

// ****************************************************************************
// Method: IsosurfaceAttributes::CopyAttributes
//
// Purpose: 
//   CopyAttributes method for the IsosurfaceAttributes class.
//
// Note:       Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:   omitted
//
// Modifications:
//   
// ****************************************************************************

bool
IsosurfaceAttributes::CopyAttributes(const AttributeGroup *atts)
{
    if(TypeName() != atts->TypeName())
        return false;

    // Call assignment operator.
    const IsosurfaceAttributes *tmp = (const IsosurfaceAttributes *)atts;
    *this = *tmp;

    return true;
}

// ****************************************************************************
// Method: IsosurfaceAttributes::CreateCompatible
//
// Purpose: 
//   CreateCompatible method for the IsosurfaceAttributes class.
//
// Note:       Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:   omitted
//
// Modifications:
//   
// ****************************************************************************

AttributeSubject *
IsosurfaceAttributes::CreateCompatible(const std::string &tname) const
{
    AttributeSubject *retval = 0;
    if(TypeName() == tname)
        retval = new IsosurfaceAttributes(*this);
    // Other cases could go here too. 

    return retval;
}

// ****************************************************************************
// Method: IsosurfaceAttributes::NewInstance
//
// Purpose: 
//   NewInstance method for the IsosurfaceAttributes class.
//
// Note:       Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:   omitted
//
// Modifications:
//   
// ****************************************************************************

AttributeSubject *
IsosurfaceAttributes::NewInstance(bool copy) const
{
    AttributeSubject *retval = 0;
    if(copy)
        retval = new IsosurfaceAttributes(*this);
    else
        retval = new IsosurfaceAttributes;

    return retval;
}

// ****************************************************************************
// Method: IsosurfaceAttributes::SelectAll
//
// Purpose: 
//   Selects all attributes.
//
// Note:       Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:   omitted
//
// Modifications:
//   
// ****************************************************************************

void
IsosurfaceAttributes::SelectAll()
{
    Select(ID_contourNLevels, (void *)&contourNLevels);
    Select(ID_contourValue,   (void *)&contourValue);
    Select(ID_contourPercent, (void *)&contourPercent);
    Select(ID_contourMethod,  (void *)&contourMethod);
    Select(ID_minFlag,        (void *)&minFlag);
    Select(ID_min,            (void *)&min);
    Select(ID_maxFlag,        (void *)&maxFlag);
    Select(ID_max,            (void *)&max);
    Select(ID_scaling,        (void *)&scaling);
    Select(ID_variable,       (void *)&variable);
}

///////////////////////////////////////////////////////////////////////////////
// Persistence methods
///////////////////////////////////////////////////////////////////////////////

// ****************************************************************************
// Method: IsosurfaceAttributes::CreateNode
//
// Purpose: 
//   This method creates a DataNode representation of the object so it can be saved to a config file.
//
// Note:       Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:   omitted
//
// Modifications:
//   
// ****************************************************************************

bool
IsosurfaceAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    IsosurfaceAttributes defaultObject;
    bool addToParent = false;
    // Create a node for IsosurfaceAttributes.
    DataNode *node = new DataNode("IsosurfaceAttributes");

    if(completeSave || !FieldsEqual(ID_contourNLevels, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("contourNLevels", contourNLevels));
    }

    if(completeSave || !FieldsEqual(ID_contourValue, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("contourValue", contourValue));
    }

    if(completeSave || !FieldsEqual(ID_contourPercent, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("contourPercent", contourPercent));
    }

    if(completeSave || !FieldsEqual(ID_contourMethod, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("contourMethod", Select_by_ToString(contourMethod)));
    }

    if(completeSave || !FieldsEqual(ID_minFlag, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("minFlag", minFlag));
    }

    if(completeSave || !FieldsEqual(ID_min, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("min", min));
    }

    if(completeSave || !FieldsEqual(ID_maxFlag, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("maxFlag", maxFlag));
    }

    if(completeSave || !FieldsEqual(ID_max, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("max", max));
    }

    if(completeSave || !FieldsEqual(ID_scaling, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("scaling", Scaling_ToString(scaling)));
    }

    if(completeSave || !FieldsEqual(ID_variable, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("variable", variable));
    }


    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}

// ****************************************************************************
// Method: IsosurfaceAttributes::SetFromNode
//
// Purpose: 
//   This method sets attributes in this object from values in a DataNode representation of the object.
//
// Note:       Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:   omitted
//
// Modifications:
//   
// ****************************************************************************

void
IsosurfaceAttributes::SetFromNode(DataNode *parentNode)
{
    if(parentNode == 0)
        return;

    DataNode *searchNode = parentNode->GetNode("IsosurfaceAttributes");
    if(searchNode == 0)
        return;

    DataNode *node;
    if((node = searchNode->GetNode("contourNLevels")) != 0)
        SetContourNLevels(node->AsInt());
    if((node = searchNode->GetNode("contourValue")) != 0)
        SetContourValue(node->AsDoubleVector());
    if((node = searchNode->GetNode("contourPercent")) != 0)
        SetContourPercent(node->AsDoubleVector());
    if((node = searchNode->GetNode("contourMethod")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 3)
                SetContourMethod(Select_by(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            Select_by value;
            if(Select_by_FromString(node->AsString(), value))
                SetContourMethod(value);
        }
    }
    if((node = searchNode->GetNode("minFlag")) != 0)
        SetMinFlag(node->AsBool());
    if((node = searchNode->GetNode("min")) != 0)
        SetMin(node->AsDouble());
    if((node = searchNode->GetNode("maxFlag")) != 0)
        SetMaxFlag(node->AsBool());
    if((node = searchNode->GetNode("max")) != 0)
        SetMax(node->AsDouble());
    if((node = searchNode->GetNode("scaling")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 2)
                SetScaling(Scaling(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            Scaling value;
            if(Scaling_FromString(node->AsString(), value))
                SetScaling(value);
        }
    }
    if((node = searchNode->GetNode("variable")) != 0)
        SetVariable(node->AsString());
}

///////////////////////////////////////////////////////////////////////////////
// Set property methods
///////////////////////////////////////////////////////////////////////////////

void
IsosurfaceAttributes::SetContourNLevels(int contourNLevels_)
{
    contourNLevels = contourNLevels_;
    Select(ID_contourNLevels, (void *)&contourNLevels);
}

void
IsosurfaceAttributes::SetContourValue(const doubleVector &contourValue_)
{
    contourValue = contourValue_;
    Select(ID_contourValue, (void *)&contourValue);
}

void
IsosurfaceAttributes::SetContourPercent(const doubleVector &contourPercent_)
{
    contourPercent = contourPercent_;
    Select(ID_contourPercent, (void *)&contourPercent);
}

void
IsosurfaceAttributes::SetContourMethod(IsosurfaceAttributes::Select_by contourMethod_)
{
    contourMethod = contourMethod_;
    Select(ID_contourMethod, (void *)&contourMethod);
}

void
IsosurfaceAttributes::SetMinFlag(bool minFlag_)
{
    minFlag = minFlag_;
    Select(ID_minFlag, (void *)&minFlag);
}

void
IsosurfaceAttributes::SetMin(double min_)
{
    min = min_;
    Select(ID_min, (void *)&min);
}

void
IsosurfaceAttributes::SetMaxFlag(bool maxFlag_)
{
    maxFlag = maxFlag_;
    Select(ID_maxFlag, (void *)&maxFlag);
}

void
IsosurfaceAttributes::SetMax(double max_)
{
    max = max_;
    Select(ID_max, (void *)&max);
}

void
IsosurfaceAttributes::SetScaling(IsosurfaceAttributes::Scaling scaling_)
{
    scaling = scaling_;
    Select(ID_scaling, (void *)&scaling);
}

void
IsosurfaceAttributes::SetVariable(const std::string &variable_)
{
    variable = variable_;
    Select(ID_variable, (void *)&variable);
}

///////////////////////////////////////////////////////////////////////////////
// Get property methods
///////////////////////////////////////////////////////////////////////////////

int
IsosurfaceAttributes::GetContourNLevels() const
{
    return contourNLevels;
}

const doubleVector &
IsosurfaceAttributes::GetContourValue() const
{
    return contourValue;
}

doubleVector &
IsosurfaceAttributes::GetContourValue()
{
    return contourValue;
}

const doubleVector &
IsosurfaceAttributes::GetContourPercent() const
{
    return contourPercent;
}

doubleVector &
IsosurfaceAttributes::GetContourPercent()
{
    return contourPercent;
}

IsosurfaceAttributes::Select_by
IsosurfaceAttributes::GetContourMethod() const
{
    return Select_by(contourMethod);
}

bool
IsosurfaceAttributes::GetMinFlag() const
{
    return minFlag;
}

double
IsosurfaceAttributes::GetMin() const
{
    return min;
}

bool
IsosurfaceAttributes::GetMaxFlag() const
{
    return maxFlag;
}

double
IsosurfaceAttributes::GetMax() const
{
    return max;
}

IsosurfaceAttributes::Scaling
IsosurfaceAttributes::GetScaling() const
{
    return Scaling(scaling);
}

const std::string &
IsosurfaceAttributes::GetVariable() const
{
    return variable;
}

std::string &
IsosurfaceAttributes::GetVariable()
{
    return variable;
}

///////////////////////////////////////////////////////////////////////////////
// Select property methods
///////////////////////////////////////////////////////////////////////////////

void
IsosurfaceAttributes::SelectContourValue()
{
    Select(ID_contourValue, (void *)&contourValue);
}

void
IsosurfaceAttributes::SelectContourPercent()
{
    Select(ID_contourPercent, (void *)&contourPercent);
}

void
IsosurfaceAttributes::SelectVariable()
{
    Select(ID_variable, (void *)&variable);
}

///////////////////////////////////////////////////////////////////////////////
// Keyframing methods
///////////////////////////////////////////////////////////////////////////////

// ****************************************************************************
// Method: IsosurfaceAttributes::GetFieldName
//
// Purpose: 
//   This method returns the name of a field given its index.
//
// Note:       Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:   omitted
//
// Modifications:
//   
// ****************************************************************************

std::string
IsosurfaceAttributes::GetFieldName(int index) const
{
    switch (index)
    {
    case ID_contourNLevels: return "contourNLevels";
    case ID_contourValue:   return "contourValue";
    case ID_contourPercent: return "contourPercent";
    case ID_contourMethod:  return "contourMethod";
    case ID_minFlag:        return "minFlag";
    case ID_min:            return "min";
    case ID_maxFlag:        return "maxFlag";
    case ID_max:            return "max";
    case ID_scaling:        return "scaling";
    case ID_variable:       return "variable";
    default:  return "invalid index";
    }
}

// ****************************************************************************
// Method: IsosurfaceAttributes::GetFieldType
//
// Purpose: 
//   This method returns the type of a field given its index.
//
// Note:       Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:   omitted
//
// Modifications:
//   
// ****************************************************************************

AttributeGroup::FieldType
IsosurfaceAttributes::GetFieldType(int index) const
{
    switch (index)
    {
    case ID_contourNLevels: return FieldType_int;
    case ID_contourValue:   return FieldType_doubleVector;
    case ID_contourPercent: return FieldType_doubleVector;
    case ID_contourMethod:  return FieldType_enum;
    case ID_minFlag:        return FieldType_bool;
    case ID_min:            return FieldType_double;
    case ID_maxFlag:        return FieldType_bool;
    case ID_max:            return FieldType_double;
    case ID_scaling:        return FieldType_enum;
    case ID_variable:       return FieldType_variablename;
    default:  return FieldType_unknown;
    }
}

// ****************************************************************************
// Method: IsosurfaceAttributes::GetFieldTypeName
//
// Purpose: 
//   This method returns the name of a field type given its index.
//
// Note:       Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:   omitted
//
// Modifications:
//   
// ****************************************************************************

std::string
IsosurfaceAttributes::GetFieldTypeName(int index) const
{
    switch (index)
    {
    case ID_contourNLevels: return "int";
    case ID_contourValue:   return "doubleVector";
    case ID_contourPercent: return "doubleVector";
    case ID_contourMethod:  return "enum";
    case ID_minFlag:        return "bool";
    case ID_min:            return "double";
    case ID_maxFlag:        return "bool";
    case ID_max:            return "double";
    case ID_scaling:        return "enum";
    case ID_variable:       return "variablename";
    default:  return "invalid index";
    }
}

// ****************************************************************************
// Method: IsosurfaceAttributes::FieldsEqual
//
// Purpose: 
//   This method compares two fields and return true if they are equal.
//
// Note:       Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation:   omitted
//
// Modifications:
//   
// ****************************************************************************

bool
IsosurfaceAttributes::FieldsEqual(int index_, const AttributeGroup *rhs) const
{
    const IsosurfaceAttributes &obj = *((const IsosurfaceAttributes*)rhs);
    bool retval = false;
    switch (index_)
    {
    case ID_contourNLevels:
        {  // new scope
        retval = (contourNLevels == obj.contourNLevels);
        }
        break;
    case ID_contourValue:
        {  // new scope
        retval = (contourValue == obj.contourValue);
        }
        break;
    case ID_contourPercent:
        {  // new scope
        retval = (contourPercent == obj.contourPercent);
        }
        break;
    case ID_contourMethod:
        {  // new scope
        retval = (contourMethod == obj.contourMethod);
        }
        break;
    case ID_minFlag:
        {  // new scope
        retval = (minFlag == obj.minFlag);
        }
        break;
    case ID_min:
        {  // new scope
        retval = (min == obj.min);
        }
        break;
    case ID_maxFlag:
        {  // new scope
        retval = (maxFlag == obj.maxFlag);
        }
        break;
    case ID_max:
        {  // new scope
        retval = (max == obj.max);
        }
        break;
    case ID_scaling:
        {  // new scope
        retval = (scaling == obj.scaling);
        }
        break;
    case ID_variable:
        {  // new scope
        retval = (variable == obj.variable);
        }
        break;
    default: retval = false;
    }

    return retval;
}

///////////////////////////////////////////////////////////////////////////////
// User-defined methods.
///////////////////////////////////////////////////////////////////////////////

