Commit 3c006309 authored by hrchilds's avatar hrchilds
Browse files

Update from April 5, 2005

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@445 18c085ea-50e0-402c-830e-de6fd14e8384
parent d99e994e
......@@ -71,6 +71,9 @@
# Brad Whitlock, Tue Jan 4 17:31:58 PST 2005
# I added -lexpr so it links on MacOS X.
#
# Jeremy Meredith, Fri Mar 18 16:23:13 PST 2005
# Added avtSimulationCommandSpecification.
#
##############################################################################
@SET_MAKE@
......@@ -82,6 +85,7 @@ SRC=$(MetaData_src) $(SIL_src)
MetaData_src= \
MetaData/avtDatabaseMetaData.C \
MetaData/avtSimulationInformation.C \
MetaData/avtSimulationCommandSpecification.C \
MetaData/avtTypes.C
SIL_src= \
SIL/avtSIL.C \
......
#include <avtSimulationCommandSpecification.h>
#include <DataNode.h>
//
// Enum conversion methods for avtSimulationCommandSpecification::CommandArgumentType
//
static const char *CommandArgumentType_strings[] = {
"CmdArgInt", "CmdArgFloat", "CmdArgString"
};
std::string
avtSimulationCommandSpecification::CommandArgumentType_ToString(avtSimulationCommandSpecification::CommandArgumentType t)
{
int index = int(t);
if(index < 0 || index >= 3) index = 0;
return CommandArgumentType_strings[index];
}
std::string
avtSimulationCommandSpecification::CommandArgumentType_ToString(int t)
{
int index = (t < 0 || t >= 3) ? 0 : t;
return CommandArgumentType_strings[index];
}
bool
avtSimulationCommandSpecification::CommandArgumentType_FromString(const std::string &s, avtSimulationCommandSpecification::CommandArgumentType &val)
{
val = avtSimulationCommandSpecification::CmdArgInt;
for(int i = 0; i < 3; ++i)
{
if(s == CommandArgumentType_strings[i])
{
val = (CommandArgumentType)i;
return true;
}
}
return false;
}
// ****************************************************************************
// Method: avtSimulationCommandSpecification::avtSimulationCommandSpecification
//
// Purpose:
// Constructor for the avtSimulationCommandSpecification class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Mar 18 16:21:33 PST 2005
//
// Modifications:
//
// ****************************************************************************
avtSimulationCommandSpecification::avtSimulationCommandSpecification() : AttributeSubject("si")
{
}
// ****************************************************************************
// Method: avtSimulationCommandSpecification::avtSimulationCommandSpecification
//
// Purpose:
// Copy constructor for the avtSimulationCommandSpecification class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Mar 18 16:21:33 PST 2005
//
// Modifications:
//
// ****************************************************************************
avtSimulationCommandSpecification::avtSimulationCommandSpecification(const avtSimulationCommandSpecification &obj) : AttributeSubject("si")
{
name = obj.name;
argumentType = obj.argumentType;
SelectAll();
}
// ****************************************************************************
// Method: avtSimulationCommandSpecification::~avtSimulationCommandSpecification
//
// Purpose:
// Destructor for the avtSimulationCommandSpecification class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Mar 18 16:21:33 PST 2005
//
// Modifications:
//
// ****************************************************************************
avtSimulationCommandSpecification::~avtSimulationCommandSpecification()
{
// nothing here
}
// ****************************************************************************
// Method: avtSimulationCommandSpecification::operator =
//
// Purpose:
// Assignment operator for the avtSimulationCommandSpecification class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Mar 18 16:21:33 PST 2005
//
// Modifications:
//
// ****************************************************************************
avtSimulationCommandSpecification&
avtSimulationCommandSpecification::operator = (const avtSimulationCommandSpecification &obj)
{
if (this == &obj) return *this;
name = obj.name;
argumentType = obj.argumentType;
SelectAll();
return *this;
}
// ****************************************************************************
// Method: avtSimulationCommandSpecification::operator ==
//
// Purpose:
// Comparison operator == for the avtSimulationCommandSpecification class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Mar 18 16:21:33 PST 2005
//
// Modifications:
//
// ****************************************************************************
bool
avtSimulationCommandSpecification::operator == (const avtSimulationCommandSpecification &obj) const
{
// Create the return value
return ((name == obj.name) &&
(argumentType == obj.argumentType));
}
// ****************************************************************************
// Method: avtSimulationCommandSpecification::operator !=
//
// Purpose:
// Comparison operator != for the avtSimulationCommandSpecification class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Mar 18 16:21:33 PST 2005
//
// Modifications:
//
// ****************************************************************************
bool
avtSimulationCommandSpecification::operator != (const avtSimulationCommandSpecification &obj) const
{
return !(this->operator == (obj));
}
// ****************************************************************************
// Method: avtSimulationCommandSpecification::TypeName
//
// Purpose:
// Type name method for the avtSimulationCommandSpecification class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Mar 18 16:21:33 PST 2005
//
// Modifications:
//
// ****************************************************************************
const std::string
avtSimulationCommandSpecification::TypeName() const
{
return "avtSimulationCommandSpecification";
}
// ****************************************************************************
// Method: avtSimulationCommandSpecification::CopyAttributes
//
// Purpose:
// CopyAttributes method for the avtSimulationCommandSpecification class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Mar 18 16:21:33 PST 2005
//
// Modifications:
//
// ****************************************************************************
bool
avtSimulationCommandSpecification::CopyAttributes(const AttributeGroup *atts)
{
if(TypeName() != atts->TypeName())
return false;
// Call assignment operator.
const avtSimulationCommandSpecification *tmp = (const avtSimulationCommandSpecification *)atts;
*this = *tmp;
return true;
}
// ****************************************************************************
// Method: avtSimulationCommandSpecification::CreateCompatible
//
// Purpose:
// CreateCompatible method for the avtSimulationCommandSpecification class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Mar 18 16:21:33 PST 2005
//
// Modifications:
//
// ****************************************************************************
AttributeSubject *
avtSimulationCommandSpecification::CreateCompatible(const std::string &tname) const
{
AttributeSubject *retval = 0;
if(TypeName() == tname)
retval = new avtSimulationCommandSpecification(*this);
// Other cases could go here too.
return retval;
}
// ****************************************************************************
// Method: avtSimulationCommandSpecification::NewInstance
//
// Purpose:
// NewInstance method for the avtSimulationCommandSpecification class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Mar 18 16:21:33 PST 2005
//
// Modifications:
//
// ****************************************************************************
AttributeSubject *
avtSimulationCommandSpecification::NewInstance(bool copy) const
{
AttributeSubject *retval = 0;
if(copy)
retval = new avtSimulationCommandSpecification(*this);
else
retval = new avtSimulationCommandSpecification;
return retval;
}
// ****************************************************************************
// Method: avtSimulationCommandSpecification::SelectAll
//
// Purpose:
// Selects all attributes.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Mar 18 16:21:33 PST 2005
//
// Modifications:
//
// ****************************************************************************
void
avtSimulationCommandSpecification::SelectAll()
{
Select(0, (void *)&name);
Select(1, (void *)&argumentType);
}
///////////////////////////////////////////////////////////////////////////////
// Set property methods
///////////////////////////////////////////////////////////////////////////////
void
avtSimulationCommandSpecification::SetName(const std::string &name_)
{
name = name_;
Select(0, (void *)&name);
}
void
avtSimulationCommandSpecification::SetArgumentType(avtSimulationCommandSpecification::CommandArgumentType argumentType_)
{
argumentType = argumentType_;
Select(1, (void *)&argumentType);
}
///////////////////////////////////////////////////////////////////////////////
// Get property methods
///////////////////////////////////////////////////////////////////////////////
const std::string &
avtSimulationCommandSpecification::GetName() const
{
return name;
}
std::string &
avtSimulationCommandSpecification::GetName()
{
return name;
}
avtSimulationCommandSpecification::CommandArgumentType
avtSimulationCommandSpecification::GetArgumentType() const
{
return CommandArgumentType(argumentType);
}
///////////////////////////////////////////////////////////////////////////////
// Select property methods
///////////////////////////////////////////////////////////////////////////////
void
avtSimulationCommandSpecification::SelectName()
{
Select(0, (void *)&name);
}
///////////////////////////////////////////////////////////////////////////////
// Keyframing methods
///////////////////////////////////////////////////////////////////////////////
// ****************************************************************************
// Method: avtSimulationCommandSpecification::GetFieldName
//
// Purpose:
// This method returns the name of a field given its index.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Mar 18 16:21:33 PST 2005
//
// Modifications:
//
// ****************************************************************************
std::string
avtSimulationCommandSpecification::GetFieldName(int index) const
{
switch (index)
{
case 0: return "name";
case 1: return "argumentType";
default: return "invalid index";
}
}
// ****************************************************************************
// Method: avtSimulationCommandSpecification::GetFieldType
//
// Purpose:
// This method returns the type of a field given its index.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Mar 18 16:21:33 PST 2005
//
// Modifications:
//
// ****************************************************************************
AttributeGroup::FieldType
avtSimulationCommandSpecification::GetFieldType(int index) const
{
switch (index)
{
case 0: return FieldType_string;
case 1: return FieldType_enum;
default: return FieldType_unknown;
}
}
// ****************************************************************************
// Method: avtSimulationCommandSpecification::GetFieldTypeName
//
// Purpose:
// This method returns the name of a field type given its index.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Mar 18 16:21:33 PST 2005
//
// Modifications:
//
// ****************************************************************************
std::string
avtSimulationCommandSpecification::GetFieldTypeName(int index) const
{
switch (index)
{
case 0: return "string";
case 1: return "enum";
default: return "invalid index";
}
}
// ****************************************************************************
// Method: avtSimulationCommandSpecification::FieldsEqual
//
// Purpose:
// This method compares two fields and return true if they are equal.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Mar 18 16:21:33 PST 2005
//
// Modifications:
//
// ****************************************************************************
bool
avtSimulationCommandSpecification::FieldsEqual(int index_, const AttributeGroup *rhs) const
{
const avtSimulationCommandSpecification &obj = *((const avtSimulationCommandSpecification*)rhs);
bool retval = false;
switch (index_)
{
case 0:
{ // new scope
retval = (name == obj.name);
}
break;
case 1:
{ // new scope
retval = (argumentType == obj.argumentType);
}
break;
default: retval = false;
}
return retval;
}
///////////////////////////////////////////////////////////////////////////////
// User-defined methods.
///////////////////////////////////////////////////////////////////////////////
#ifndef AVTSIMULATIONCOMMANDSPECIFICATION_H
#define AVTSIMULATIONCOMMANDSPECIFICATION_H
#include <dbatts_exports.h>
#include <string>
#include <AttributeSubject.h>
// ****************************************************************************
// Class: avtSimulationCommandSpecification
//
// Purpose:
// Contains the specification for one command
//
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Mar 18 16:21:33 PST 2005
//
// Modifications:
//
// ****************************************************************************
class DBATTS_API avtSimulationCommandSpecification : public AttributeSubject
{
public:
enum CommandArgumentType
{
CmdArgNone,
CmdArgInt,
CmdArgFloat,
CmdArgString
};
avtSimulationCommandSpecification();
avtSimulationCommandSpecification(const avtSimulationCommandSpecification &obj);
virtual ~avtSimulationCommandSpecification();
virtual avtSimulationCommandSpecification& operator = (const avtSimulationCommandSpecification &obj);
virtual bool operator == (const avtSimulationCommandSpecification &obj) const;
virtual bool operator != (const avtSimulationCommandSpecification &obj) const;
virtual const std::string TypeName() const;
virtual bool CopyAttributes(const AttributeGroup *);
virtual AttributeSubject *CreateCompatible(const std::string &) const;
virtual AttributeSubject *NewInstance(bool) const;
// Property selection methods
virtual void SelectAll();
void SelectName();
// Property setting methods
void SetName(const std::string &name_);
void SetArgumentType(CommandArgumentType argumentType_);
// Property getting methods
const std::string &GetName() const;
std::string &GetName();
CommandArgumentType GetArgumentType() const;
// Enum conversion functions
static std::string CommandArgumentType_ToString(CommandArgumentType);
static bool CommandArgumentType_FromString(const std::string &, CommandArgumentType &);
protected:
static std::string CommandArgumentType_ToString(int);
public:
// Keyframing methods
virtual std::string GetFieldName(int index) const;
virtual AttributeGroup::FieldType GetFieldType(int index) const;
virtual std::string GetFieldTypeName(int index) const;
virtual bool FieldsEqual(int index, const AttributeGroup *rhs) const;
private:
std::string name;
int argumentType;
};
#endif
<?xml version="1.0"?>
<Attribute name="avtSimulationCommandSpecification" purpose="Contains the specification for one command" persistent="false" exportAPI="DBATTS_API" exportInclude="dbatts_exports.h">
<Enum name="CommandArgumentType">
CmdArgInt
CmdArgFloat
CmdArgString
</Enum>
<Field name="name" label="name" type="string">
</Field>
<Field name="argumentType" label="argumentType" type="enum" subtype="CommandArgumentType">
</Field>
</Attribute>
......@@ -3,6 +3,7 @@
#include <dbatts_exports.h>
#include <string>
#include <AttributeSubject.h>
class avtSimulationCommandSpecification;
// ****************************************************************************
// Class: avtSimulationInformation
......@@ -13,7 +14,7 @@
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Aug 12 11:51:50 PDT 2004
// Creation: Fri Mar 18 16:28:35 PST 2005
//
// Modifications:
//
......@@ -26,7 +27,7 @@ public: