Commit 273eb973 authored by ghweber's avatar ghweber

Removed attributes used for debugging.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23913 18c085ea-50e0-402c-830e-de6fd14e8384
parent 0156d99f
......@@ -17,19 +17,5 @@
<Field name="CreateCellsOfType" label="Create cells of type" type="enum" subtype="CreateType">
DualGridAndStitchCells
</Field>
<Field name="AddCaseNo" label="Add case number" type="bool">
false
</Field>
<Field name="OnlyProcessListedDomains" label="Only process listed domains" type="bool">
false
</Field>
<Field name="Domains" label="Domains" type="intVector">
</Field>
<Field name="OnlyProcessLevel" label="Only process level" type="bool">
false
</Field>
<Field name="Level" label="Level" type="int">
0
</Field>
</Attribute>
</Plugin>
......@@ -95,10 +95,6 @@ AMRStitchCellAttributes::CreateType_FromString(const std::string &s, AMRStitchCe
void AMRStitchCellAttributes::Init()
{
CreateCellsOfType = DualGridAndStitchCells;
AddCaseNo = false;
OnlyProcessListedDomains = false;
OnlyProcessLevel = false;
Level = 0;
AMRStitchCellAttributes::SelectAll();
}
......@@ -121,11 +117,6 @@ void AMRStitchCellAttributes::Init()
void AMRStitchCellAttributes::Copy(const AMRStitchCellAttributes &obj)
{
CreateCellsOfType = obj.CreateCellsOfType;
AddCaseNo = obj.AddCaseNo;
OnlyProcessListedDomains = obj.OnlyProcessListedDomains;
Domains = obj.Domains;
OnlyProcessLevel = obj.OnlyProcessLevel;
Level = obj.Level;
AMRStitchCellAttributes::SelectAll();
}
......@@ -283,12 +274,7 @@ bool
AMRStitchCellAttributes::operator == (const AMRStitchCellAttributes &obj) const
{
// Create the return value
return ((CreateCellsOfType == obj.CreateCellsOfType) &&
(AddCaseNo == obj.AddCaseNo) &&
(OnlyProcessListedDomains == obj.OnlyProcessListedDomains) &&
(Domains == obj.Domains) &&
(OnlyProcessLevel == obj.OnlyProcessLevel) &&
(Level == obj.Level));
return ((CreateCellsOfType == obj.CreateCellsOfType));
}
// ****************************************************************************
......@@ -432,12 +418,7 @@ AMRStitchCellAttributes::NewInstance(bool copy) const
void
AMRStitchCellAttributes::SelectAll()
{
Select(ID_CreateCellsOfType, (void *)&CreateCellsOfType);
Select(ID_AddCaseNo, (void *)&AddCaseNo);
Select(ID_OnlyProcessListedDomains, (void *)&OnlyProcessListedDomains);
Select(ID_Domains, (void *)&Domains);
Select(ID_OnlyProcessLevel, (void *)&OnlyProcessLevel);
Select(ID_Level, (void *)&Level);
Select(ID_CreateCellsOfType, (void *)&CreateCellsOfType);
}
///////////////////////////////////////////////////////////////////////////////
......@@ -476,36 +457,6 @@ AMRStitchCellAttributes::CreateNode(DataNode *parentNode, bool completeSave, boo
node->AddNode(new DataNode("CreateCellsOfType", CreateType_ToString(CreateCellsOfType)));
}
if(completeSave || !FieldsEqual(ID_AddCaseNo, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("AddCaseNo", AddCaseNo));
}
if(completeSave || !FieldsEqual(ID_OnlyProcessListedDomains, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("OnlyProcessListedDomains", OnlyProcessListedDomains));
}
if(completeSave || !FieldsEqual(ID_Domains, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("Domains", Domains));
}
if(completeSave || !FieldsEqual(ID_OnlyProcessLevel, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("OnlyProcessLevel", OnlyProcessLevel));
}
if(completeSave || !FieldsEqual(ID_Level, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("Level", Level));
}
// Add the node to the parent node.
if(addToParent || forceAdd)
......@@ -558,16 +509,6 @@ AMRStitchCellAttributes::SetFromNode(DataNode *parentNode)
SetCreateCellsOfType(value);
}
}
if((node = searchNode->GetNode("AddCaseNo")) != 0)
SetAddCaseNo(node->AsBool());
if((node = searchNode->GetNode("OnlyProcessListedDomains")) != 0)
SetOnlyProcessListedDomains(node->AsBool());
if((node = searchNode->GetNode("Domains")) != 0)
SetDomains(node->AsIntVector());
if((node = searchNode->GetNode("OnlyProcessLevel")) != 0)
SetOnlyProcessLevel(node->AsBool());
if((node = searchNode->GetNode("Level")) != 0)
SetLevel(node->AsInt());
}
///////////////////////////////////////////////////////////////////////////////
......@@ -581,41 +522,6 @@ AMRStitchCellAttributes::SetCreateCellsOfType(AMRStitchCellAttributes::CreateTyp
Select(ID_CreateCellsOfType, (void *)&CreateCellsOfType);
}
void
AMRStitchCellAttributes::SetAddCaseNo(bool AddCaseNo_)
{
AddCaseNo = AddCaseNo_;
Select(ID_AddCaseNo, (void *)&AddCaseNo);
}
void
AMRStitchCellAttributes::SetOnlyProcessListedDomains(bool OnlyProcessListedDomains_)
{
OnlyProcessListedDomains = OnlyProcessListedDomains_;
Select(ID_OnlyProcessListedDomains, (void *)&OnlyProcessListedDomains);
}
void
AMRStitchCellAttributes::SetDomains(const intVector &Domains_)
{
Domains = Domains_;
Select(ID_Domains, (void *)&Domains);
}
void
AMRStitchCellAttributes::SetOnlyProcessLevel(bool OnlyProcessLevel_)
{
OnlyProcessLevel = OnlyProcessLevel_;
Select(ID_OnlyProcessLevel, (void *)&OnlyProcessLevel);
}
void
AMRStitchCellAttributes::SetLevel(int Level_)
{
Level = Level_;
Select(ID_Level, (void *)&Level);
}
///////////////////////////////////////////////////////////////////////////////
// Get property methods
///////////////////////////////////////////////////////////////////////////////
......@@ -626,52 +532,6 @@ AMRStitchCellAttributes::GetCreateCellsOfType() const
return CreateType(CreateCellsOfType);
}
bool
AMRStitchCellAttributes::GetAddCaseNo() const
{
return AddCaseNo;
}
bool
AMRStitchCellAttributes::GetOnlyProcessListedDomains() const
{
return OnlyProcessListedDomains;
}
const intVector &
AMRStitchCellAttributes::GetDomains() const
{
return Domains;
}
intVector &
AMRStitchCellAttributes::GetDomains()
{
return Domains;
}
bool
AMRStitchCellAttributes::GetOnlyProcessLevel() const
{
return OnlyProcessLevel;
}
int
AMRStitchCellAttributes::GetLevel() const
{
return Level;
}
///////////////////////////////////////////////////////////////////////////////
// Select property methods
///////////////////////////////////////////////////////////////////////////////
void
AMRStitchCellAttributes::SelectDomains()
{
Select(ID_Domains, (void *)&Domains);
}
///////////////////////////////////////////////////////////////////////////////
// Keyframing methods
///////////////////////////////////////////////////////////////////////////////
......@@ -696,12 +556,7 @@ AMRStitchCellAttributes::GetFieldName(int index) const
{
switch (index)
{
case ID_CreateCellsOfType: return "CreateCellsOfType";
case ID_AddCaseNo: return "AddCaseNo";
case ID_OnlyProcessListedDomains: return "OnlyProcessListedDomains";
case ID_Domains: return "Domains";
case ID_OnlyProcessLevel: return "OnlyProcessLevel";
case ID_Level: return "Level";
case ID_CreateCellsOfType: return "CreateCellsOfType";
default: return "invalid index";
}
}
......@@ -726,12 +581,7 @@ AMRStitchCellAttributes::GetFieldType(int index) const
{
switch (index)
{
case ID_CreateCellsOfType: return FieldType_enum;
case ID_AddCaseNo: return FieldType_bool;
case ID_OnlyProcessListedDomains: return FieldType_bool;
case ID_Domains: return FieldType_intVector;
case ID_OnlyProcessLevel: return FieldType_bool;
case ID_Level: return FieldType_int;
case ID_CreateCellsOfType: return FieldType_enum;
default: return FieldType_unknown;
}
}
......@@ -756,12 +606,7 @@ AMRStitchCellAttributes::GetFieldTypeName(int index) const
{
switch (index)
{
case ID_CreateCellsOfType: return "enum";
case ID_AddCaseNo: return "bool";
case ID_OnlyProcessListedDomains: return "bool";
case ID_Domains: return "intVector";
case ID_OnlyProcessLevel: return "bool";
case ID_Level: return "int";
case ID_CreateCellsOfType: return "enum";
default: return "invalid index";
}
}
......@@ -793,31 +638,6 @@ AMRStitchCellAttributes::FieldsEqual(int index_, const AttributeGroup *rhs) cons
retval = (CreateCellsOfType == obj.CreateCellsOfType);
}
break;
case ID_AddCaseNo:
{ // new scope
retval = (AddCaseNo == obj.AddCaseNo);
}
break;
case ID_OnlyProcessListedDomains:
{ // new scope
retval = (OnlyProcessListedDomains == obj.OnlyProcessListedDomains);
}
break;
case ID_Domains:
{ // new scope
retval = (Domains == obj.Domains);
}
break;
case ID_OnlyProcessLevel:
{ // new scope
retval = (OnlyProcessLevel == obj.OnlyProcessLevel);
}
break;
case ID_Level:
{ // new scope
retval = (Level == obj.Level);
}
break;
default: retval = false;
}
......
......@@ -92,24 +92,12 @@ public:
// Property selection methods
virtual void SelectAll();
void SelectDomains();
// Property setting methods
void SetCreateCellsOfType(CreateType CreateCellsOfType_);
void SetAddCaseNo(bool AddCaseNo_);
void SetOnlyProcessListedDomains(bool OnlyProcessListedDomains_);
void SetDomains(const intVector &Domains_);
void SetOnlyProcessLevel(bool OnlyProcessLevel_);
void SetLevel(int Level_);
// Property getting methods
CreateType GetCreateCellsOfType() const;
bool GetAddCaseNo() const;
bool GetOnlyProcessListedDomains() const;
const intVector &GetDomains() const;
intVector &GetDomains();
bool GetOnlyProcessLevel() const;
int GetLevel() const;
CreateType GetCreateCellsOfType() const;
// Persistence methods
virtual bool CreateNode(DataNode *node, bool completeSave, bool forceAdd);
......@@ -132,26 +120,16 @@ public:
// IDs that can be used to identify fields in case statements
enum {
ID_CreateCellsOfType = 0,
ID_AddCaseNo,
ID_OnlyProcessListedDomains,
ID_Domains,
ID_OnlyProcessLevel,
ID_Level,
ID__LAST
};
private:
int CreateCellsOfType;
bool AddCaseNo;
bool OnlyProcessListedDomains;
intVector Domains;
bool OnlyProcessLevel;
int Level;
int CreateCellsOfType;
// Static class format string for type map.
static const char *TypeMapFormatString;
static const private_tmfs_t TmfsStruct;
};
#define AMRSTITCHCELLATTRIBUTES_TMFS "ibbi*bi"
#define AMRSTITCHCELLATTRIBUTES_TMFS "i"
#endif
......@@ -41,8 +41,6 @@ package llnl.visit.operators;
import llnl.visit.AttributeSubject;
import llnl.visit.CommunicationBuffer;
import llnl.visit.Plugin;
import java.lang.Integer;
import java.util.Vector;
// ****************************************************************************
// Class: AMRStitchCellAttributes
......@@ -61,7 +59,7 @@ import java.util.Vector;
public class AMRStitchCellAttributes extends AttributeSubject implements Plugin
{
private static int AMRStitchCellAttributes_numAdditionalAtts = 6;
private static int AMRStitchCellAttributes_numAdditionalAtts = 1;
// Enum values
public final static int CREATETYPE_DUALGRIDANDSTITCHCELLS = 0;
......@@ -74,11 +72,6 @@ public class AMRStitchCellAttributes extends AttributeSubject implements Plugin
super(AMRStitchCellAttributes_numAdditionalAtts);
CreateCellsOfType = CREATETYPE_DUALGRIDANDSTITCHCELLS;
AddCaseNo = false;
OnlyProcessListedDomains = false;
Domains = new Vector();
OnlyProcessLevel = false;
Level = 0;
}
public AMRStitchCellAttributes(int nMoreFields)
......@@ -86,30 +79,13 @@ public class AMRStitchCellAttributes extends AttributeSubject implements Plugin
super(AMRStitchCellAttributes_numAdditionalAtts + nMoreFields);
CreateCellsOfType = CREATETYPE_DUALGRIDANDSTITCHCELLS;
AddCaseNo = false;
OnlyProcessListedDomains = false;
Domains = new Vector();
OnlyProcessLevel = false;
Level = 0;
}
public AMRStitchCellAttributes(AMRStitchCellAttributes obj)
{
super(AMRStitchCellAttributes_numAdditionalAtts);
int i;
CreateCellsOfType = obj.CreateCellsOfType;
AddCaseNo = obj.AddCaseNo;
OnlyProcessListedDomains = obj.OnlyProcessListedDomains;
Domains = new Vector();
for(i = 0; i < obj.Domains.size(); ++i)
{
Integer iv = (Integer)obj.Domains.elementAt(i);
Domains.addElement(new Integer(iv.intValue()));
}
OnlyProcessLevel = obj.OnlyProcessLevel;
Level = obj.Level;
SelectAll();
}
......@@ -126,24 +102,8 @@ public class AMRStitchCellAttributes extends AttributeSubject implements Plugin
public boolean equals(AMRStitchCellAttributes obj)
{
int i;
// Compare the elements in the Domains vector.
boolean Domains_equal = (obj.Domains.size() == Domains.size());
for(i = 0; (i < Domains.size()) && Domains_equal; ++i)
{
// Make references to Integer from Object.
Integer Domains1 = (Integer)Domains.elementAt(i);
Integer Domains2 = (Integer)obj.Domains.elementAt(i);
Domains_equal = Domains1.equals(Domains2);
}
// Create the return value
return ((CreateCellsOfType == obj.CreateCellsOfType) &&
(AddCaseNo == obj.AddCaseNo) &&
(OnlyProcessListedDomains == obj.OnlyProcessListedDomains) &&
Domains_equal &&
(OnlyProcessLevel == obj.OnlyProcessLevel) &&
(Level == obj.Level));
return ((CreateCellsOfType == obj.CreateCellsOfType));
}
public String GetName() { return "AMRStitchCell"; }
......@@ -156,84 +116,19 @@ public class AMRStitchCellAttributes extends AttributeSubject implements Plugin
Select(0);
}
public void SetAddCaseNo(boolean AddCaseNo_)
{
AddCaseNo = AddCaseNo_;
Select(1);
}
public void SetOnlyProcessListedDomains(boolean OnlyProcessListedDomains_)
{
OnlyProcessListedDomains = OnlyProcessListedDomains_;
Select(2);
}
public void SetDomains(Vector Domains_)
{
Domains = Domains_;
Select(3);
}
public void SetOnlyProcessLevel(boolean OnlyProcessLevel_)
{
OnlyProcessLevel = OnlyProcessLevel_;
Select(4);
}
public void SetLevel(int Level_)
{
Level = Level_;
Select(5);
}
// Property getting methods
public int GetCreateCellsOfType() { return CreateCellsOfType; }
public boolean GetAddCaseNo() { return AddCaseNo; }
public boolean GetOnlyProcessListedDomains() { return OnlyProcessListedDomains; }
public Vector GetDomains() { return Domains; }
public boolean GetOnlyProcessLevel() { return OnlyProcessLevel; }
public int GetLevel() { return Level; }
public int GetCreateCellsOfType() { return CreateCellsOfType; }
// Write and read methods.
public void WriteAtts(CommunicationBuffer buf)
{
if(WriteSelect(0, buf))
buf.WriteInt(CreateCellsOfType);
if(WriteSelect(1, buf))
buf.WriteBool(AddCaseNo);
if(WriteSelect(2, buf))
buf.WriteBool(OnlyProcessListedDomains);
if(WriteSelect(3, buf))
buf.WriteIntVector(Domains);
if(WriteSelect(4, buf))
buf.WriteBool(OnlyProcessLevel);
if(WriteSelect(5, buf))
buf.WriteInt(Level);
}
public void ReadAtts(int index, CommunicationBuffer buf)
{
switch(index)
{
case 0:
SetCreateCellsOfType(buf.ReadInt());
break;
case 1:
SetAddCaseNo(buf.ReadBool());
break;
case 2:
SetOnlyProcessListedDomains(buf.ReadBool());
break;
case 3:
SetDomains(buf.ReadIntVector());
break;
case 4:
SetOnlyProcessLevel(buf.ReadBool());
break;
case 5:
SetLevel(buf.ReadInt());
break;
}
SetCreateCellsOfType(buf.ReadInt());
}
public String toString(String indent)
......@@ -247,21 +142,11 @@ public class AMRStitchCellAttributes extends AttributeSubject implements Plugin
if(CreateCellsOfType == CREATETYPE_STITCHCELLS)
str = str + "CREATETYPE_STITCHCELLS";
str = str + "\n";
str = str + boolToString("AddCaseNo", AddCaseNo, indent) + "\n";
str = str + boolToString("OnlyProcessListedDomains", OnlyProcessListedDomains, indent) + "\n";
str = str + intVectorToString("Domains", Domains, indent) + "\n";
str = str + boolToString("OnlyProcessLevel", OnlyProcessLevel, indent) + "\n";
str = str + intToString("Level", Level, indent) + "\n";
return str;
}
// Attributes
private int CreateCellsOfType;
private boolean AddCaseNo;
private boolean OnlyProcessListedDomains;
private Vector Domains; // vector of Integer objects
private boolean OnlyProcessLevel;
private int Level;
private int CreateCellsOfType;
}
......@@ -95,39 +95,6 @@ PyAMRStitchCellAttributes_ToString(const AMRStitchCellAttributes *atts, const ch
break;
}
if(atts->GetAddCaseNo())
SNPRINTF(tmpStr, 1000, "%sAddCaseNo = 1\n", prefix);
else
SNPRINTF(tmpStr, 1000, "%sAddCaseNo = 0\n", prefix);
str += tmpStr;
if(atts->GetOnlyProcessListedDomains())
SNPRINTF(tmpStr, 1000, "%sOnlyProcessListedDomains = 1\n", prefix);
else
SNPRINTF(tmpStr, 1000, "%sOnlyProcessListedDomains = 0\n", prefix);
str += tmpStr;
{ const intVector &Domains = atts->GetDomains();
SNPRINTF(tmpStr, 1000, "%sDomains = (", prefix);
str += tmpStr;
for(size_t i = 0; i < Domains.size(); ++i)
{
SNPRINTF(tmpStr, 1000, "%d", Domains[i]);
str += tmpStr;
if(i < Domains.size() - 1)
{
SNPRINTF(tmpStr, 1000, ", ");
str += tmpStr;
}
}
SNPRINTF(tmpStr, 1000, ")\n");
str += tmpStr;
}
if(atts->GetOnlyProcessLevel())
SNPRINTF(tmpStr, 1000, "%sOnlyProcessLevel = 1\n", prefix);
else
SNPRINTF(tmpStr, 1000, "%sOnlyProcessLevel = 0\n", prefix);
str += tmpStr;
SNPRINTF(tmpStr, 1000, "%sLevel = %d\n", prefix, atts->GetLevel());
str += tmpStr;
return str;
}
......@@ -173,181 +140,12 @@ AMRStitchCellAttributes_GetCreateCellsOfType(PyObject *self, PyObject *args)
return retval;
}
/*static*/ PyObject *
AMRStitchCellAttributes_SetAddCaseNo(PyObject *self, PyObject *args)
{
AMRStitchCellAttributesObject *obj = (AMRStitchCellAttributesObject *)self;
int ival;
if(!PyArg_ParseTuple(args, "i", &ival))
return NULL;
// Set the AddCaseNo in the object.
obj->data->SetAddCaseNo(ival != 0);
Py_INCREF(Py_None);
return Py_None;
}
/*static*/ PyObject *
AMRStitchCellAttributes_GetAddCaseNo(PyObject *self, PyObject *args)
{
AMRStitchCellAttributesObject *obj = (AMRStitchCellAttributesObject *)self;
PyObject *retval = PyInt_FromLong(obj->data->GetAddCaseNo()?1L:0L);
return retval;
}
/*static*/ PyObject *
AMRStitchCellAttributes_SetOnlyProcessListedDomains(PyObject *self, PyObject *args)
{
AMRStitchCellAttributesObject *obj = (AMRStitchCellAttributesObject *)self;
int ival;
if(!PyArg_ParseTuple(args, "i", &ival))
return NULL;
// Set the OnlyProcessListedDomains in the object.
obj->data->SetOnlyProcessListedDomains(ival != 0);
Py_INCREF(Py_None);
return Py_None;
}
/*static*/ PyObject *
AMRStitchCellAttributes_GetOnlyProcessListedDomains(PyObject *self, PyObject *args)
{
AMRStitchCellAttributesObject *obj = (AMRStitchCellAttributesObject *)self;
PyObject *retval = PyInt_FromLong(obj->data->GetOnlyProcessListedDomains()?1L:0L);
return retval;
}
/*static*/ PyObject *
AMRStitchCellAttributes_SetDomains(PyObject *self, PyObject *args)
{
AMRStitchCellAttributesObject *obj = (AMRStitchCellAttributesObject *)self;
intVector &vec = obj->data->GetDomains();
PyObject *tuple;
if(!PyArg_ParseTuple(args, "O", &tuple))
return NULL;
if(PyTuple_Check(tuple))
{
vec.resize(PyTuple_Size(tuple));
for(int i = 0; i < PyTuple_Size(tuple); ++i)
{
PyObject *item = PyTuple_GET_ITEM(tuple, i);
if(PyFloat_Check(item))
vec[i] = int(PyFloat_AS_DOUBLE(item));
else if(PyInt_Check(item))
vec[i] = int(PyInt_AS_LONG(item));
else if(PyLong_Check(item))
vec[i] = int(PyLong_AsLong(item));
else
vec[i] = 0;
}
}
else if(PyFloat_Check(tuple))
{
vec.resize(1);
vec[0] = int(PyFloat_AS_DOUBLE(tuple));
}
else if(PyInt_Check(tuple))
{
vec.resize(1);
vec[0] = int(PyInt_AS_LONG(tuple));
}
else if(PyLong_Check(tuple))
{
vec.resize(1);
vec[0] = int(PyLong_AsLong(tuple));
}
else
return NULL;
// Mark the Domains in the object as modified.
obj->data->SelectDomains();
Py_INCREF(Py_None);
return Py_None;
}
/*static*/ PyObject *
AMRStitchCellAttributes_GetDomains(PyObject *self, PyObject *args)
{
AMRStitchCellAttributesObject *obj = (AMRStitchCellAttributesObject *)self;
// Allocate a tuple the with enough entries to hold the Domains.
const intVector &Domains = obj->data->GetDomains();
PyObject *retval = PyTuple_New(Domains.size());
for(size_t i = 0; i < Domains.size(); ++i)
PyTuple_SET_ITEM(retval, i, PyInt_FromLong(long(Domains[i])));
return retval;
}
/*static*/ PyObject *
AMRStitchCellAttributes_SetOnlyProcessLevel(PyObject *self, PyObject *args)
{
AMRStitchCellAttributesObject *obj = (AMRStitchCellAttributesObject *)self;
int ival;
if(!PyArg_ParseTuple(args, "i", &ival))
return NULL;
// Set the OnlyProcessLevel in the object.
obj->data->SetOnlyProcessLevel(ival != 0);
Py_INCREF(Py_None);
return Py_None;
}
/*static*/ PyObject *
AMRStitchCellAttributes_GetOnlyProcessLevel(PyObject *self,