Commit fc8940d8 authored by hrchilds's avatar hrchilds

Update from December 3, 2003

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@135 18c085ea-50e0-402c-830e-de6fd14e8384
parent 45765032
......@@ -9,20 +9,21 @@
//
static const char *PickType_strings[] = {
"Zone", "Node"};
"Zone", "Node", "CurveZone",
"CurveNode"};
std::string
PickAttributes::PickType_ToString(PickAttributes::PickType t)
{
int index = int(t);
if(index < 0 || index >= 2) index = 0;
if(index < 0 || index >= 4) index = 0;
return PickType_strings[index];
}
std::string
PickAttributes::PickType_ToString(int t)
{
int index = (t < 0 || t >= 2) ? 0 : t;
int index = (t < 0 || t >= 4) ? 0 : t;
return PickType_strings[index];
}
......@@ -30,7 +31,7 @@ bool
PickAttributes::PickType_FromString(const std::string &s, PickAttributes::PickType &val)
{
val = PickAttributes::Zone;
for(int i = 0; i < 2; ++i)
for(int i = 0; i < 4; ++i)
{
if(s == PickType_strings[i])
{
......@@ -50,7 +51,7 @@ PickAttributes::PickType_FromString(const std::string &s, PickAttributes::PickTy
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -103,7 +104,7 @@ PickAttributes::PickAttributes() : AttributeSubject("bbsiiiissFFi*s*a*bbs*FFbisi
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -186,7 +187,7 @@ PickAttributes::PickAttributes(const PickAttributes &obj) : AttributeSubject("bb
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -210,7 +211,7 @@ PickAttributes::~PickAttributes()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -294,7 +295,7 @@ PickAttributes::operator = (const PickAttributes &obj)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -384,7 +385,7 @@ PickAttributes::operator == (const PickAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -405,7 +406,7 @@ PickAttributes::operator != (const PickAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -426,7 +427,7 @@ PickAttributes::TypeName() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -454,7 +455,7 @@ PickAttributes::CopyAttributes(const AttributeGroup *atts)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -480,7 +481,7 @@ PickAttributes::CreateCompatible(const std::string &tname) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -507,7 +508,7 @@ PickAttributes::NewInstance(bool copy) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -555,7 +556,7 @@ PickAttributes::SelectAll()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -580,7 +581,7 @@ PickAttributes::CreateSubAttributeGroup(int)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -785,7 +786,7 @@ PickAttributes::CreateNode(DataNode *parentNode, bool forceAdd)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -864,7 +865,7 @@ PickAttributes::SetFromNode(DataNode *parentNode)
if(node->GetNodeType() == INT_NODE)
{
int ival = node->AsInt();
if(ival >= 0 && ival < 2)
if(ival >= 0 && ival < 4)
SetPickType(PickType(ival));
}
else if(node->GetNodeType() == STRING_NODE)
......@@ -1475,7 +1476,7 @@ PickAttributes::SelectZoneCoords()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -1500,7 +1501,7 @@ PickAttributes::AddPickVarInfo(const PickVarInfo &obj)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -1528,7 +1529,7 @@ PickAttributes::ClearPickVarInfos()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -1563,7 +1564,7 @@ PickAttributes::RemovePickVarInfo(int index)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -1584,7 +1585,7 @@ PickAttributes::GetNumPickVarInfos() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -1605,7 +1606,7 @@ PickAttributes::GetPickVarInfo(int i)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -1626,7 +1627,7 @@ PickAttributes::GetPickVarInfo(int i) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -1647,7 +1648,7 @@ PickAttributes::operator [] (int i)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -1672,7 +1673,7 @@ PickAttributes::operator [] (int i) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -1724,7 +1725,7 @@ PickAttributes::GetFieldName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -1776,7 +1777,7 @@ PickAttributes::GetFieldType(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -1828,7 +1829,7 @@ PickAttributes::GetFieldTypeName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -2083,7 +2084,22 @@ PickAttributes::PrintSelf(ostream &os)
for (i = 0; i < variables.size(); i++)
os << variables[i].c_str() << " ";
os << "\n";
if (cellPoint[0] != FLT_MAX)
if (pickType == CurveNode)
{
os << "PickedPoint: <" << nodePoint[0] << ", "
<< nodePoint[1] << ", "
<< nodePoint[2] << ">\n";
}
else if (pickType == CurveZone)
{
os << "EndPoint1: <" << nodePoint[0] << ", "
<< nodePoint[1] << ", "
<< nodePoint[2] << ">\n";
os << "EndPoint2: <" << cellPoint[0] << ", "
<< cellPoint[1] << ", "
<< cellPoint[2] << ">\n";
}
else if (cellPoint[0] != FLT_MAX)
{
if (!needTransformMessage)
{
......@@ -2170,6 +2186,10 @@ PickAttributes::PrintSelf(ostream &os)
// Kathleen Bonnell, Tue Nov 18 10:06:40 PST 2003
// Support logical zone numbers.
//
// Kathleen Bonnell, Tue Dec 2 17:33:13 PST 2003
// Minor changes so that picking on Curves does not display unnecessary
// information.
//
// ****************************************************************************
void
PickAttributes::CreateOutputString(std::string &os, bool withLetter)
......@@ -2212,7 +2232,18 @@ PickAttributes::CreateOutputString(std::string &os, bool withLetter)
sprintf(buff, " timestep %d \n%s\n", timeStep, meshInfo.c_str());
}
os += buff;
if (cellPoint[0] != FLT_MAX)
if (pickType == CurveNode)
{
sprintf(buff, "Point: <%f, %f>\n", nodePoint[0], nodePoint[1]);
os += buff;
}
else if (pickType == CurveZone)
{
sprintf(buff, "Point1: <%f, %f>\nPoint2: <%f, %f>\n",
nodePoint[0], nodePoint[1], cellPoint[0], cellPoint[1]);
os += buff;
}
else if (cellPoint[0] != FLT_MAX)
{
if (dimension == 2)
{
......@@ -2256,6 +2287,7 @@ PickAttributes::CreateOutputString(std::string &os, bool withLetter)
sprintf(buff, "Zone: %d %s\n", elementNumber,
zoneCoords[0].c_str());
}
os += buff;
}
else if (pickType == Node)
{
......@@ -2268,8 +2300,8 @@ PickAttributes::CreateOutputString(std::string &os, bool withLetter)
sprintf(buff, "Node: %d %s\n", elementNumber,
nodeCoords[0].c_str());
}
os += buff;
}
os += buff;
if (pickType == Zone)
{
os += "Nodes: " ;
......@@ -2371,3 +2403,36 @@ PickAttributes::PrepareForNewPick()
ClearPickVarInfos();
}
// ****************************************************************************
// Method: PickAttributes::Reset
//
// Purpose:
// Restore pick to default state.
//
// Programmer: Kathleen Bonnell
// Creation: November 26, 2003
//
// Modifications:
//
// ****************************************************************************
void
PickAttributes::Reset()
{
// This does most of the work for us.
PrepareForNewPick();
// Now do the rest.
timeStep = -1;
rayPoint1[0] = rayPoint1[1] = rayPoint1[2] = 0;
rayPoint2[0] = rayPoint2[1] = rayPoint2[2] = 0;
pickType = Zone;
useNodeCoords = false;
logicalCoords = false;
logicalZone = false;
if (!variables.empty())
variables.clear();
variables.push_back("default");
}
......@@ -52,7 +52,22 @@ PickAttributes::PrintSelf(ostream &os)
for (i = 0; i < variables.size(); i++)
os << variables[i].c_str() << " ";
os << "\n";
if (cellPoint[0] != FLT_MAX)
if (pickType == CurveNode)
{
os << "PickedPoint: <" << nodePoint[0] << ", "
<< nodePoint[1] << ", "
<< nodePoint[2] << ">\n";
}
else if (pickType == CurveZone)
{
os << "EndPoint1: <" << nodePoint[0] << ", "
<< nodePoint[1] << ", "
<< nodePoint[2] << ">\n";
os << "EndPoint2: <" << cellPoint[0] << ", "
<< cellPoint[1] << ", "
<< cellPoint[2] << ">\n";
}
else if (cellPoint[0] != FLT_MAX)
{
if (!needTransformMessage)
{
......@@ -142,6 +157,10 @@ Definition:
// Kathleen Bonnell, Tue Nov 18 10:06:40 PST 2003
// Support logical zone numbers.
//
// Kathleen Bonnell, Tue Dec 2 17:33:13 PST 2003
// Minor changes so that picking on Curves does not display unnecessary
// information.
//
// ****************************************************************************
void
PickAttributes::CreateOutputString(std::string &os, bool withLetter)
......@@ -184,7 +203,18 @@ PickAttributes::CreateOutputString(std::string &os, bool withLetter)
sprintf(buff, " timestep %d \n%s\n", timeStep, meshInfo.c_str());
}
os += buff;
if (cellPoint[0] != FLT_MAX)
if (pickType == CurveNode)
{
sprintf(buff, "Point: <%f, %f>\n", nodePoint[0], nodePoint[1]);
os += buff;
}
else if (pickType == CurveZone)
{
sprintf(buff, "Point1: <%f, %f>\nPoint2: <%f, %f>\n",
nodePoint[0], nodePoint[1], cellPoint[0], cellPoint[1]);
os += buff;
}
else if (cellPoint[0] != FLT_MAX)
{
if (dimension == 2)
{
......@@ -228,6 +258,7 @@ PickAttributes::CreateOutputString(std::string &os, bool withLetter)
sprintf(buff, "Zone: %d %s\n", elementNumber,
zoneCoords[0].c_str());
}
os += buff;
}
else if (pickType == Node)
{
......@@ -240,8 +271,8 @@ PickAttributes::CreateOutputString(std::string &os, bool withLetter)
sprintf(buff, "Node: %d %s\n", elementNumber,
nodeCoords[0].c_str());
}
os += buff;
}
os += buff;
if (pickType == Zone)
{
os += "Nodes: " ;
......@@ -346,3 +377,39 @@ PickAttributes::PrepareForNewPick()
ClearPickVarInfos();
}
Function: Reset
Declaration: void Reset();
Definition:
// ****************************************************************************
// Method: PickAttributes::Reset
//
// Purpose:
// Restore pick to default state.
//
// Programmer: Kathleen Bonnell
// Creation: November 26, 2003
//
// Modifications:
//
// ****************************************************************************
void
PickAttributes::Reset()
{
// This does most of the work for us.
PrepareForNewPick();
// Now do the rest.
timeStep = -1;
rayPoint1[0] = rayPoint1[1] = rayPoint1[2] = 0;
rayPoint2[0] = rayPoint2[1] = rayPoint2[2] = 0;
pickType = Zone;
useNodeCoords = false;
logicalCoords = false;
logicalZone = false;
if (!variables.empty())
variables.clear();
variables.push_back("default");
}
......@@ -15,7 +15,7 @@ class PickVarInfo;
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Nov 18 13:59:02 PST 2003
// Creation: Wed Dec 3 12:08:53 PDT 2003
//
// Modifications:
//
......@@ -27,7 +27,9 @@ public:
enum PickType
{
Zone,
Node
Node,
CurveZone,
CurveNode
};
PickAttributes();
......@@ -171,6 +173,7 @@ public:
void PrintSelf(ostream &os);
void CreateOutputString(std::string &os, bool withLetter = true);
void PrepareForNewPick();
void Reset();
protected:
AttributeGroup *CreateSubAttributeGroup(int index);
private:
......
......@@ -3,6 +3,8 @@
<Enum name="PickType">
Zone
Node
CurveZone
CurveNode
</Enum>
<Field name="clearWindow" label="clearWindow" type="bool" internal="true">
false
......@@ -100,6 +102,8 @@
</Function>
<Function name="PrepareForNewPick" user="true" member="true">
</Function>
<Function name="Reset" user="true" member="true">
</Function>
<Include file="source" quoted="false">
stdio.h
</Include>
......
......@@ -88,13 +88,13 @@ QueryAttributes::VarType_FromString(const std::string &s, QueryAttributes::VarTy
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Mon Nov 24 16:51:16 PST 2003
// Creation: Tue Dec 2 18:16:39 PST 2003
//
// Modifications:
//
// ****************************************************************************
QueryAttributes::QueryAttributes() : AttributeSubject("ss*sFiid*iii*")
QueryAttributes::QueryAttributes() : AttributeSubject("ss*sFiid*iii*b")
{
variables.push_back("default");
worldPoint[0] = 0;
......@@ -105,6 +105,7 @@ QueryAttributes::QueryAttributes() : AttributeSubject("ss*sFiid*iii*")
resultsValue.push_back(0);
elementType = Zone;
timeStep = 0;
currentPlotOnly = false;
}
// ****************************************************************************
......@@ -116,13 +117,13 @@ QueryAttributes::QueryAttributes() : AttributeSubject("ss*sFiid*iii*")
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Mon Nov 24 16:51:16 PST 2003
// Creation: Tue Dec 2 18:16:39 PST 2003
//
// Modifications:
//
// ****************************************************************************
QueryAttributes::QueryAttributes(const QueryAttributes &obj) : AttributeSubject("ss*sFiid*iii*")
QueryAttributes::QueryAttributes(const QueryAttributes &obj) : AttributeSubject("ss*sFiid*iii*b")
{
name = obj.name;
variables = obj.variables;
......@@ -137,6 +138,7 @@ QueryAttributes::QueryAttributes(const QueryAttributes &obj) : AttributeSubject(
elementType = obj.elementType;
timeStep = obj.timeStep;
varTypes = obj.varTypes;
currentPlotOnly = obj.currentPlotOnly;
SelectAll();
}
......@@ -150,7 +152,7 @@ QueryAttributes::QueryAttributes(const QueryAttributes &obj) : AttributeSubject(
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Mon Nov 24 16:51:16 PST 2003
// Creation: Tue Dec 2 18:16:39 PST 2003
//
// Modifications:
//
......@@ -170,7 +172,7 @@ QueryAttributes::~QueryAttributes()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Mon Nov 24 16:51:16 PST 2003
// Creation: Tue Dec 2 18:16:39 PST 2003
//
// Modifications:
//
......@@ -192,6 +194,7 @@ QueryAttributes::operator = (const QueryAttributes &obj)
elementType = obj.elementType;
timeStep = obj.timeStep;
varTypes = obj.varTypes;
currentPlotOnly = obj.currentPlotOnly;
SelectAll();
}
......@@ -205,7 +208,7 @@ QueryAttributes::operator = (const QueryAttributes &obj)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Mon Nov 24 16:51:16 PST 2003
// Creation: Tue Dec 2 18:16:39 PST 2003
//
// Modifications:
//
......@@ -231,7 +234,8 @@ QueryAttributes::operator == (const QueryAttributes &obj) const
(resultsValue == obj.resultsValue) &&
(elementType == obj.elementType) &&
(timeStep == obj.timeStep) &&
(varTypes == obj.varTypes));
(varTypes == obj.varTypes) &&
(currentPlotOnly == obj.currentPlotOnly));
}
// ****************************************************************************
......@@ -243,7 +247,7 @@ QueryAttributes::operator == (const QueryAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Mon Nov 24 16:51:16 PST 2003
// Creation: Tue Dec 2 18:16:39 PST 2003
//
// Modifications:
//
......@@ -264,7 +268,7 @@ QueryAttributes::operator != (const QueryAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts