Commit 008dfbab authored by hrchilds's avatar hrchilds
Browse files

Update from September 4, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@316 18c085ea-50e0-402c-830e-de6fd14e8384
parent 2f4c2b77
......@@ -115,6 +115,44 @@ QueryList::WindowType_FromString(const std::string &s, QueryList::WindowType &va
return false;
}
//
// Enum conversion methods for QueryList::Groups
//
static const char *Groups_strings[] = {
"CurveRelated", "MeshRelated", "PickRelated",
"TimeRelated", "VariableRelated"};
std::string
QueryList::Groups_ToString(QueryList::Groups t)
{
int index = int(t);
if(index < 0 || index >= 5) index = 0;
return Groups_strings[index];
}
std::string
QueryList::Groups_ToString(int t)
{
int index = (t < 0 || t >= 5) ? 0 : t;
return Groups_strings[index];
}
bool
QueryList::Groups_FromString(const std::string &s, QueryList::Groups &val)
{
val = QueryList::CurveRelated;
for(int i = 0; i < 5; ++i)
{
if(s == Groups_strings[i])
{
val = (Groups)i;
return true;
}
}
return false;
}
// ****************************************************************************
// Method: QueryList::QueryList
//
......@@ -124,7 +162,7 @@ QueryList::WindowType_FromString(const std::string &s, QueryList::WindowType &va
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Apr 1 18:53:28 PST 2004
// Creation: Sat Sep 4 11:20:22 PDT 2004
//
// Modifications:
//
......@@ -143,7 +181,7 @@ QueryList::QueryList() : AttributeSubject("s*i*i*i*i*i*i*i*")
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Apr 1 18:53:28 PST 2004
// Creation: Sat Sep 4 11:20:22 PDT 2004
//
// Modifications:
//
......@@ -153,11 +191,11 @@ QueryList::QueryList(const QueryList &obj) : AttributeSubject("s*i*i*i*i*i*i*i*"
{
names = obj.names;
types = obj.types;
groups = obj.groups;
coordRep = obj.coordRep;
numInputs = obj.numInputs;
allowedVarTypes = obj.allowedVarTypes;
winType = obj.winType;
actualData = obj.actualData;
timeQuery = obj.timeQuery;
SelectAll();
......@@ -172,7 +210,7 @@ QueryList::QueryList(const QueryList &obj) : AttributeSubject("s*i*i*i*i*i*i*i*"
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Apr 1 18:53:28 PST 2004
// Creation: Sat Sep 4 11:20:22 PDT 2004
//
// Modifications:
//
......@@ -192,7 +230,7 @@ QueryList::~QueryList()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Apr 1 18:53:28 PST 2004
// Creation: Sat Sep 4 11:20:22 PDT 2004
//
// Modifications:
//
......@@ -203,11 +241,11 @@ QueryList::operator = (const QueryList &obj)
{
names = obj.names;
types = obj.types;
groups = obj.groups;
coordRep = obj.coordRep;
numInputs = obj.numInputs;
allowedVarTypes = obj.allowedVarTypes;
winType = obj.winType;
actualData = obj.actualData;
timeQuery = obj.timeQuery;
SelectAll();
......@@ -222,7 +260,7 @@ QueryList::operator = (const QueryList &obj)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Apr 1 18:53:28 PST 2004
// Creation: Sat Sep 4 11:20:22 PDT 2004
//
// Modifications:
//
......@@ -234,11 +272,11 @@ QueryList::operator == (const QueryList &obj) const
// Create the return value
return ((names == obj.names) &&
(types == obj.types) &&
(groups == obj.groups) &&
(coordRep == obj.coordRep) &&
(numInputs == obj.numInputs) &&
(allowedVarTypes == obj.allowedVarTypes) &&
(winType == obj.winType) &&
(actualData == obj.actualData) &&
(timeQuery == obj.timeQuery));
}
......@@ -251,7 +289,7 @@ QueryList::operator == (const QueryList &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Apr 1 18:53:28 PST 2004
// Creation: Sat Sep 4 11:20:22 PDT 2004
//
// Modifications:
//
......@@ -272,7 +310,7 @@ QueryList::operator != (const QueryList &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Apr 1 18:53:28 PST 2004
// Creation: Sat Sep 4 11:20:22 PDT 2004
//
// Modifications:
//
......@@ -293,7 +331,7 @@ QueryList::TypeName() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Apr 1 18:53:28 PST 2004
// Creation: Sat Sep 4 11:20:22 PDT 2004
//
// Modifications:
//
......@@ -321,7 +359,7 @@ QueryList::CopyAttributes(const AttributeGroup *atts)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Apr 1 18:53:28 PST 2004
// Creation: Sat Sep 4 11:20:22 PDT 2004
//
// Modifications:
//
......@@ -347,7 +385,7 @@ QueryList::CreateCompatible(const std::string &tname) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Apr 1 18:53:28 PST 2004
// Creation: Sat Sep 4 11:20:22 PDT 2004
//
// Modifications:
//
......@@ -374,7 +412,7 @@ QueryList::NewInstance(bool copy) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Apr 1 18:53:28 PST 2004
// Creation: Sat Sep 4 11:20:22 PDT 2004
//
// Modifications:
//
......@@ -385,11 +423,11 @@ QueryList::SelectAll()
{
Select(0, (void *)&names);
Select(1, (void *)&types);
Select(2, (void *)&coordRep);
Select(3, (void *)&numInputs);
Select(4, (void *)&allowedVarTypes);
Select(5, (void *)&winType);
Select(6, (void *)&actualData);
Select(2, (void *)&groups);
Select(3, (void *)&coordRep);
Select(4, (void *)&numInputs);
Select(5, (void *)&allowedVarTypes);
Select(6, (void *)&winType);
Select(7, (void *)&timeQuery);
}
......@@ -406,7 +444,7 @@ QueryList::SelectAll()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Apr 1 18:53:28 PST 2004
// Creation: Sat Sep 4 11:20:22 PDT 2004
//
// Modifications:
//
......@@ -438,31 +476,31 @@ QueryList::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
if(completeSave || !FieldsEqual(2, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("coordRep", coordRep));
node->AddNode(new DataNode("groups", groups));
}
if(completeSave || !FieldsEqual(3, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("numInputs", numInputs));
node->AddNode(new DataNode("coordRep", coordRep));
}
if(completeSave || !FieldsEqual(4, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("allowedVarTypes", allowedVarTypes));
node->AddNode(new DataNode("numInputs", numInputs));
}
if(completeSave || !FieldsEqual(5, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("winType", winType));
node->AddNode(new DataNode("allowedVarTypes", allowedVarTypes));
}
if(completeSave || !FieldsEqual(6, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("actualData", actualData));
node->AddNode(new DataNode("winType", winType));
}
if(completeSave || !FieldsEqual(7, &defaultObject))
......@@ -490,7 +528,7 @@ QueryList::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Apr 1 18:53:28 PST 2004
// Creation: Sat Sep 4 11:20:22 PDT 2004
//
// Modifications:
//
......@@ -512,6 +550,8 @@ QueryList::SetFromNode(DataNode *parentNode)
SetNames(node->AsStringVector());
if((node = searchNode->GetNode("types")) != 0)
SetTypes(node->AsIntVector());
if((node = searchNode->GetNode("groups")) != 0)
SetGroups(node->AsIntVector());
if((node = searchNode->GetNode("coordRep")) != 0)
SetCoordRep(node->AsIntVector());
if((node = searchNode->GetNode("numInputs")) != 0)
......@@ -520,8 +560,6 @@ QueryList::SetFromNode(DataNode *parentNode)
SetAllowedVarTypes(node->AsIntVector());
if((node = searchNode->GetNode("winType")) != 0)
SetWinType(node->AsIntVector());
if((node = searchNode->GetNode("actualData")) != 0)
SetActualData(node->AsIntVector());
if((node = searchNode->GetNode("timeQuery")) != 0)
SetTimeQuery(node->AsIntVector());
}
......@@ -544,39 +582,39 @@ QueryList::SetTypes(const intVector &types_)
Select(1, (void *)&types);
}
void
QueryList::SetGroups(const intVector &groups_)
{
groups = groups_;
Select(2, (void *)&groups);
}
void
QueryList::SetCoordRep(const intVector &coordRep_)
{
coordRep = coordRep_;
Select(2, (void *)&coordRep);
Select(3, (void *)&coordRep);
}
void
QueryList::SetNumInputs(const intVector &numInputs_)
{
numInputs = numInputs_;
Select(3, (void *)&numInputs);
Select(4, (void *)&numInputs);
}
void
QueryList::SetAllowedVarTypes(const intVector &allowedVarTypes_)
{
allowedVarTypes = allowedVarTypes_;
Select(4, (void *)&allowedVarTypes);
Select(5, (void *)&allowedVarTypes);
}
void
QueryList::SetWinType(const intVector &winType_)
{
winType = winType_;
Select(5, (void *)&winType);
}
void
QueryList::SetActualData(const intVector &actualData_)
{
actualData = actualData_;
Select(6, (void *)&actualData);
Select(6, (void *)&winType);
}
void
......@@ -614,6 +652,18 @@ QueryList::GetTypes()
return types;
}
const intVector &
QueryList::GetGroups() const
{
return groups;
}
intVector &
QueryList::GetGroups()
{
return groups;
}
const intVector &
QueryList::GetCoordRep() const
{
......@@ -662,18 +712,6 @@ QueryList::GetWinType()
return winType;
}
const intVector &
QueryList::GetActualData() const
{
return actualData;
}
intVector &
QueryList::GetActualData()
{
return actualData;
}
const intVector &
QueryList::GetTimeQuery() const
{
......@@ -703,33 +741,33 @@ QueryList::SelectTypes()
}
void
QueryList::SelectCoordRep()
QueryList::SelectGroups()
{
Select(2, (void *)&coordRep);
Select(2, (void *)&groups);
}
void
QueryList::SelectNumInputs()
QueryList::SelectCoordRep()
{
Select(3, (void *)&numInputs);
Select(3, (void *)&coordRep);
}
void
QueryList::SelectAllowedVarTypes()
QueryList::SelectNumInputs()
{
Select(4, (void *)&allowedVarTypes);
Select(4, (void *)&numInputs);
}
void
QueryList::SelectWinType()
QueryList::SelectAllowedVarTypes()
{
Select(5, (void *)&winType);
Select(5, (void *)&allowedVarTypes);
}
void
QueryList::SelectActualData()
QueryList::SelectWinType()
{
Select(6, (void *)&actualData);
Select(6, (void *)&winType);
}
void
......@@ -751,7 +789,7 @@ QueryList::SelectTimeQuery()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Apr 1 18:53:28 PST 2004
// Creation: Sat Sep 4 11:20:22 PDT 2004
//
// Modifications:
//
......@@ -764,11 +802,11 @@ QueryList::GetFieldName(int index) const
{
case 0: return "names";
case 1: return "types";
case 2: return "coordRep";
case 3: return "numInputs";
case 4: return "allowedVarTypes";
case 5: return "winType";
case 6: return "actualData";
case 2: return "groups";
case 3: return "coordRep";
case 4: return "numInputs";
case 5: return "allowedVarTypes";
case 6: return "winType";
case 7: return "timeQuery";
default: return "invalid index";
}
......@@ -783,7 +821,7 @@ QueryList::GetFieldName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Apr 1 18:53:28 PST 2004
// Creation: Sat Sep 4 11:20:22 PDT 2004
//
// Modifications:
//
......@@ -815,7 +853,7 @@ QueryList::GetFieldType(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Apr 1 18:53:28 PST 2004
// Creation: Sat Sep 4 11:20:22 PDT 2004
//
// Modifications:
//
......@@ -847,7 +885,7 @@ QueryList::GetFieldTypeName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Apr 1 18:53:28 PST 2004
// Creation: Sat Sep 4 11:20:22 PDT 2004
//
// Modifications:
//
......@@ -872,27 +910,27 @@ QueryList::FieldsEqual(int index_, const AttributeGroup *rhs) const
break;
case 2:
{ // new scope
retval = (coordRep == obj.coordRep);
retval = (groups == obj.groups);
}
break;
case 3:
{ // new scope
retval = (numInputs == obj.numInputs);
retval = (coordRep == obj.coordRep);
}
break;
case 4:
{ // new scope
retval = (allowedVarTypes == obj.allowedVarTypes);
retval = (numInputs == obj.numInputs);
}
break;
case 5:
{ // new scope
retval = (winType == obj.winType);
retval = (allowedVarTypes == obj.allowedVarTypes);
}
break;
case 6:
{ // new scope
retval = (actualData == obj.actualData);
retval = (winType == obj.winType);
}
break;
case 7:
......@@ -930,39 +968,16 @@ QueryList::FieldsEqual(int index_, const AttributeGroup *rhs) const
// ****************************************************************************
void
QueryList::AddQuery(const std::string &name, QueryList::QueryType t,
QueryList::CoordinateRepresentation rep, int number_input, int allowedVars)
QueryList::AddQuery(const std::string &name, QueryType t, Groups g, CoordinateRepresentation r, WindowType w, int num_input, int allowedVars, bool timeQ)
{
names.push_back(name);
types.push_back((int)t);
coordRep.push_back((int)rep);
numInputs.push_back(number_input);
groups.push_back((int)g);
coordRep.push_back((int)r);
numInputs.push_back(num_input);
allowedVarTypes.push_back(allowedVars);
timeQuery.push_back(0);
//
// This will be set by user selecting a button, if WindowType is
// CurrentPlot or CurrentPlotVars. Otherwise, it doesn't make sense, so
// just set it to 0.
//
actualData.push_back(0);
//
// Default window type for each query type. If a query needs a different
// window, it can be set via SetWindowType.
//
if (t == QueryList::DatabaseQuery)
{
winType.push_back((int)QueryList::Basic);
}
else if (t == QueryList::PointQuery)
{
winType.push_back((int)QueryList::SinglePoint);
}
else if (t == QueryList::LineQuery)
{
winType.push_back((int)QueryList::DoublePoint);
}
timeQuery.push_back((int)timeQ);
winType.push_back((int)w);
}
// ****************************************************************************
......@@ -977,8 +992,8 @@ QueryList::AddQuery(const std::string &name, QueryList::QueryType t,
// ****************************************************************************
bool
QueryList::QueryExists(const std::string &name, QueryList::QueryType t,
QueryList::CoordinateRepresentation rep)
QueryList::QueryExists(const std::string &name, QueryType t,
CoordinateRepresentation rep)
{
int i;
bool match = false;
......@@ -1046,77 +1061,6 @@ QueryList::AllowedVarsForQuery(const std::string &name)
return -1;
}
// ****************************************************************************
// Method: UseActualData
//
// Purpose:
// Returns whether or not this query applies only to the actual data.
//
// Programmer: Kathleen Bonnell
// Creation: November 25, 2003
//
// ****************************************************************************
int
QueryList::UseActualData(const std::string &name)
{
int i;
for (i = 0; i < names.size(); i++)
{
if (name == names[i])
{
return actualData[i];
}
}
return -1;
}
// ****************************************************************************
// Method: SetWindowType
//
// Purpose:
// Sets the window type to use for the particular query.
//
// Programmer: Kathleen Bonnell
// Creation: November 18, 2003
//
// ****************************************************************************
void
QueryList::SetWindowType(const std::string &name, WindowType winT)
{
int i;
for (i = 0; i < names.size(); i++)
{
if (name == names[i])
{
winType[i] = (int)winT;
}
}
}
// ****************************************************************************
// Method: AddTimeQuery
//
// Purpose:
// Adds a time query to the query list.
//
// Programmer: Kathleen Bonnell
// Creation: March 22, 2004
//
// Modifications:
//
// ****************************************************************************
void
QueryList::AddTimeQuery(const std::string &name, QueryList::QueryType t,
QueryList::CoordinateRepresentation rep, int number_input, int allowedVars)
{
AddQuery(name, t, rep, number_input, allowedVars);
timeQuery[timeQuery.size()-1] = 1;
}
// ****************************************************************************
// Method: TimeQueryAvailable
//
......
Function: AddQuery
Declaration: void AddQuery(const std::string &name, QueryType t, CoordinateRepresentation rep = WorldSpace, int number_input = 1, int allowedVars = 0);
Declaration: void AddQuery(const std::string &name, QueryType t, Groups g, CoordinateRepresentation r, WindowType w, int num_input, int allowedVars, bool timeQ);
Definition:
// ****************************************************************************
// Method: AddQuery
......@@ -18,42 +18,22 @@ Definition:
// Kathleen Bonnell, Tue Nov 18 08:20:36 PST 2003
// Set default window type based on query type.
//
// Kathleen Bonnell, Sat Sep 4 11:41:18 PDT 2004
// Made all parameters required, added Groups.
//
// ****************************************************************************
void
QueryList::AddQuery(const std::string &name, QueryList::QueryType t,
QueryList::CoordinateRepresentation rep, int number_input, int allowedVars)
QueryList::AddQuery(const std::string &name, QueryType t, Groups g, CoordinateRepresentation r, WindowType w, int num_input, int allowedVars, bool timeQ)
{
names.push_back(name);
types.push_back((int)t);
coordRep.push_back((int)rep);
numInputs.push_back(number_input);