Commit 73868a00 authored by cyrush's avatar cyrush

added structured query results and a shapelet decomposition query

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@2740 18c085ea-50e0-402c-830e-de6fd14e8384
parent 487cc689
......@@ -284,6 +284,9 @@
# Eric Brugger, Fri Jun 29 09:31:52 PDT 2007
# Removed the setting of the NOT_DISTRIB variable.
#
# Cyrus Harrison, Mon Dec 17 15:52:30 PST 2007
# Added XMLNode, Variant, and MapNode.
#
##############################################################################
##
......@@ -340,11 +343,12 @@ SRC= AnimationAttributes.C \
InteractorAttributes.C \
KeepAliveRPC.C \
KeyframeAttributes.C \
LightAttributes.C \
LightList.C \
Line.C \
LightAttributes.C \
LightList.C \
Line.C \
MapNode.C \
MaterialAttributes.C \
MeshManagementAttributes.C \
MeshManagementAttributes.C \
MessageAttributes.C \
MovieAttributes.C \
NamespaceAttributes.C \
......@@ -361,11 +365,11 @@ SRC= AnimationAttributes.C \
Point.C \
PointAttributes.C \
PrinterAttributes.C \
ProcessAttributes.C \
ProcessAttributes.C \
QueryAttributes.C \
QueryList.C \
QueryOverTimeAttributes.C \
QuitRPC.C \
QuitRPC.C \
RenderingAttributes.C \
ResampleAttributes.C \
SaveWindowAttributes.C \
......@@ -381,16 +385,18 @@ SRC= AnimationAttributes.C \
SurfaceFilterAttributes.C \
SyncAttributes.C \
TimeFormat.C \
Variant.C \
View2DAttributes.C \
View3DAttributes.C \
ViewAttributes.C \
ViewCurveAttributes.C \
VisItRPC.C \
VisItRPC.C \
VisualCueInfo.C \
VisualCueList.C \
VisualCueList.C \
WindowAttributes.C \
WindowInformation.C \
Xfer.C
Xfer.C \
XMLNode.C
HDR=$(SRC:.C=.h)
OBJ=$(SRC:.C=.o)
......
This diff is collapsed.
/*****************************************************************************
*
* Copyright (c) 2000 - 2007, The Regents of the University of California
* Produced at the Lawrence Livermore National Laboratory
* All rights reserved.
*
* This file is part of VisIt. For details, see http://www.llnl.gov/visit/. 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 materials provided with the distribution.
* - Neither the name of the UC/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 THE REGENTS OF THE UNIVERSITY OF
* CALIFORNIA, 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.
*
*****************************************************************************/
#ifndef MAP_NODE_H
#define MAP_NODE_H
#include <state_exports.h>
#include <XMLNode.h>
#include <Variant.h>
#include <map>
// ****************************************************************************
// Class: MapNode
//
// Purpose:
// Provides a nested map type.
//
// Programmer: Cyrus Harrison
// Creation: December 14, 2007
//
// Modifications:
//
// ****************************************************************************
class STATE_API MapNode : public Variant
{
public:
MapNode();
MapNode(const MapNode&);
MapNode(const XMLNode&);
MapNode(const XMLNode*);
MapNode &operator=(const MapNode&);
MapNode &operator=(bool);
MapNode &operator=(char);
MapNode &operator=(unsigned char);
MapNode &operator=(const char *); // interp as string
MapNode &operator=(int);
MapNode &operator=(long);
MapNode &operator=(float);
MapNode &operator=(double);
MapNode &operator=(const std::string &);
MapNode &operator=(const boolVector &);
MapNode &operator=(const charVector &);
MapNode &operator=(const unsignedCharVector &);
MapNode &operator=(const intVector &);
MapNode &operator=(const longVector &);
MapNode &operator=(const floatVector &);
MapNode &operator=(const doubleVector &);
MapNode &operator=(const stringVector &);
virtual ~MapNode();
MapNode &operator[](const std::string &);
MapNode *GetEntry(const std::string &);
const MapNode *GetEntry(const std::string &) const;
void RemoveEntry(const std::string &);
bool HasEntry(const std::string &) const;
void GetEntryNames(stringVector &) const;
int GetNumEntries() const {return entries.size();}
virtual std::string ToXML() const;
virtual XMLNode ToXMLNode() const;
private:
void SetValue(const XMLNode &);
std::map<std::string,MapNode> entries;
};
#endif
......@@ -154,7 +154,7 @@ QueryAttributes::DataType_FromString(const std::string &s, QueryAttributes::Data
}
// Type map format string
const char *QueryAttributes::TypeMapFormatString = "ss*sDiid*iii*iibssd*d*s";
const char *QueryAttributes::TypeMapFormatString = "ss*sDiid*iii*iibssd*d*ss";
// ****************************************************************************
// Method: QueryAttributes::QueryAttributes
......@@ -165,7 +165,7 @@ const char *QueryAttributes::TypeMapFormatString = "ss*sDiid*iii*iibssd*d*s";
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Sep 18 08:06:47 PDT 2007
// Creation: Mon Dec 17 15:54:40 PST 2007
//
// Modifications:
//
......@@ -200,7 +200,7 @@ QueryAttributes::QueryAttributes() :
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Sep 18 08:06:47 PDT 2007
// Creation: Mon Dec 17 15:54:40 PST 2007
//
// Modifications:
//
......@@ -230,6 +230,7 @@ QueryAttributes::QueryAttributes(const QueryAttributes &obj) :
darg1 = obj.darg1;
darg2 = obj.darg2;
floatFormat = obj.floatFormat;
xmlResult = obj.xmlResult;
SelectAll();
}
......@@ -243,7 +244,7 @@ QueryAttributes::QueryAttributes(const QueryAttributes &obj) :
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Sep 18 08:06:47 PDT 2007
// Creation: Mon Dec 17 15:54:40 PST 2007
//
// Modifications:
//
......@@ -263,7 +264,7 @@ QueryAttributes::~QueryAttributes()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Sep 18 08:06:47 PDT 2007
// Creation: Mon Dec 17 15:54:40 PST 2007
//
// Modifications:
//
......@@ -294,6 +295,7 @@ QueryAttributes::operator = (const QueryAttributes &obj)
darg1 = obj.darg1;
darg2 = obj.darg2;
floatFormat = obj.floatFormat;
xmlResult = obj.xmlResult;
SelectAll();
return *this;
......@@ -308,7 +310,7 @@ QueryAttributes::operator = (const QueryAttributes &obj)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Sep 18 08:06:47 PDT 2007
// Creation: Mon Dec 17 15:54:40 PST 2007
//
// Modifications:
//
......@@ -342,7 +344,8 @@ QueryAttributes::operator == (const QueryAttributes &obj) const
(yUnits == obj.yUnits) &&
(darg1 == obj.darg1) &&
(darg2 == obj.darg2) &&
(floatFormat == obj.floatFormat));
(floatFormat == obj.floatFormat) &&
(xmlResult == obj.xmlResult));
}
// ****************************************************************************
......@@ -354,7 +357,7 @@ QueryAttributes::operator == (const QueryAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Sep 18 08:06:47 PDT 2007
// Creation: Mon Dec 17 15:54:40 PST 2007
//
// Modifications:
//
......@@ -375,7 +378,7 @@ QueryAttributes::operator != (const QueryAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Sep 18 08:06:47 PDT 2007
// Creation: Mon Dec 17 15:54:40 PST 2007
//
// Modifications:
//
......@@ -396,7 +399,7 @@ QueryAttributes::TypeName() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Sep 18 08:06:47 PDT 2007
// Creation: Mon Dec 17 15:54:40 PST 2007
//
// Modifications:
//
......@@ -424,7 +427,7 @@ QueryAttributes::CopyAttributes(const AttributeGroup *atts)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Sep 18 08:06:47 PDT 2007
// Creation: Mon Dec 17 15:54:40 PST 2007
//
// Modifications:
//
......@@ -450,7 +453,7 @@ QueryAttributes::CreateCompatible(const std::string &tname) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Sep 18 08:06:47 PDT 2007
// Creation: Mon Dec 17 15:54:40 PST 2007
//
// Modifications:
//
......@@ -477,7 +480,7 @@ QueryAttributes::NewInstance(bool copy) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Sep 18 08:06:47 PDT 2007
// Creation: Mon Dec 17 15:54:40 PST 2007
//
// Modifications:
//
......@@ -504,6 +507,7 @@ QueryAttributes::SelectAll()
Select(15, (void *)&darg1);
Select(16, (void *)&darg2);
Select(17, (void *)&floatFormat);
Select(18, (void *)&xmlResult);
}
///////////////////////////////////////////////////////////////////////////////
......@@ -519,7 +523,7 @@ QueryAttributes::SelectAll()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Sep 18 08:06:47 PDT 2007
// Creation: Mon Dec 17 15:54:40 PST 2007
//
// Modifications:
//
......@@ -644,6 +648,12 @@ QueryAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceA
node->AddNode(new DataNode("floatFormat", floatFormat));
}
if(completeSave || !FieldsEqual(18, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("xmlResult", xmlResult));
}
// Add the node to the parent node.
if(addToParent || forceAdd)
......@@ -663,7 +673,7 @@ QueryAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceA
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Sep 18 08:06:47 PDT 2007
// Creation: Mon Dec 17 15:54:40 PST 2007
//
// Modifications:
//
......@@ -745,6 +755,8 @@ QueryAttributes::SetFromNode(DataNode *parentNode)
SetDarg2(node->AsDoubleVector());
if((node = searchNode->GetNode("floatFormat")) != 0)
SetFloatFormat(node->AsString());
if((node = searchNode->GetNode("xmlResult")) != 0)
SetXmlResult(node->AsString());
}
///////////////////////////////////////////////////////////////////////////////
......@@ -879,6 +891,13 @@ QueryAttributes::SetFloatFormat(const std::string &floatFormat_)
Select(17, (void *)&floatFormat);
}
void
QueryAttributes::SetXmlResult(const std::string &xmlResult_)
{
xmlResult = xmlResult_;
Select(18, (void *)&xmlResult);
}
///////////////////////////////////////////////////////////////////////////////
// Get property methods
///////////////////////////////////////////////////////////////////////////////
......@@ -1057,6 +1076,18 @@ QueryAttributes::GetFloatFormat()
return floatFormat;
}
const std::string &
QueryAttributes::GetXmlResult() const
{
return xmlResult;
}
std::string &
QueryAttributes::GetXmlResult()
{
return xmlResult;
}
///////////////////////////////////////////////////////////////////////////////
// Select property methods
///////////////////////////////////////////////////////////////////////////////
......@@ -1127,6 +1158,12 @@ QueryAttributes::SelectFloatFormat()
Select(17, (void *)&floatFormat);
}
void
QueryAttributes::SelectXmlResult()
{
Select(18, (void *)&xmlResult);
}
///////////////////////////////////////////////////////////////////////////////
// Keyframing methods
///////////////////////////////////////////////////////////////////////////////
......@@ -1140,7 +1177,7 @@ QueryAttributes::SelectFloatFormat()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Sep 18 08:06:47 PDT 2007
// Creation: Mon Dec 17 15:54:40 PST 2007
//
// Modifications:
//
......@@ -1169,6 +1206,7 @@ QueryAttributes::GetFieldName(int index) const
case 15: return "darg1";
case 16: return "darg2";
case 17: return "floatFormat";
case 18: return "xmlResult";
default: return "invalid index";
}
}
......@@ -1182,7 +1220,7 @@ QueryAttributes::GetFieldName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Sep 18 08:06:47 PDT 2007
// Creation: Mon Dec 17 15:54:40 PST 2007
//
// Modifications:
//
......@@ -1211,6 +1249,7 @@ QueryAttributes::GetFieldType(int index) const
case 15: return FieldType_doubleVector;
case 16: return FieldType_doubleVector;
case 17: return FieldType_string;
case 18: return FieldType_string;
default: return FieldType_unknown;
}
}
......@@ -1224,7 +1263,7 @@ QueryAttributes::GetFieldType(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Sep 18 08:06:47 PDT 2007
// Creation: Mon Dec 17 15:54:40 PST 2007
//
// Modifications:
//
......@@ -1253,6 +1292,7 @@ QueryAttributes::GetFieldTypeName(int index) const
case 15: return "doubleVector";
case 16: return "doubleVector";
case 17: return "string";
case 18: return "string";
default: return "invalid index";
}
}
......@@ -1266,7 +1306,7 @@ QueryAttributes::GetFieldTypeName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Sep 18 08:06:47 PDT 2007
// Creation: Mon Dec 17 15:54:40 PST 2007
//
// Modifications:
//
......@@ -1376,6 +1416,11 @@ QueryAttributes::FieldsEqual(int index_, const AttributeGroup *rhs) const
retval = (floatFormat == obj.floatFormat);
}
break;
case 18:
{ // new scope
retval = (xmlResult == obj.xmlResult);
}
break;
default: retval = false;
}
......
......@@ -51,7 +51,7 @@
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Sep 18 08:06:47 PDT 2007
// Creation: Mon Dec 17 15:54:40 PST 2007
//
// Modifications:
//
......@@ -111,6 +111,7 @@ public:
void SelectDarg1();
void SelectDarg2();
void SelectFloatFormat();
void SelectXmlResult();
// Property setting methods
void SetName(const std::string &name_);
......@@ -131,6 +132,7 @@ public:
void SetDarg1(const doubleVector &darg1_);
void SetDarg2(const doubleVector &darg2_);
void SetFloatFormat(const std::string &floatFormat_);
void SetXmlResult(const std::string &xmlResult_);
// Property getting methods
const std::string &GetName() const;
......@@ -162,6 +164,8 @@ public:
doubleVector &GetDarg2();
const std::string &GetFloatFormat() const;
std::string &GetFloatFormat();
const std::string &GetXmlResult() const;
std::string &GetXmlResult();
// Persistence methods
virtual bool CreateNode(DataNode *node, bool completeSave, bool forceAdd);
......@@ -214,6 +218,7 @@ private:
doubleVector darg1;
doubleVector darg2;
std::string floatFormat;
std::string xmlResult;
// Static class format string for type map.
static const char *TypeMapFormatString;
......
......@@ -72,6 +72,8 @@
<Field name="floatFormat" label="floatFormat" type="string">
%g
</Field>
<Field name="xmlResult" label="xmlResult" type="string">
</Field>
<Function name="Reset" user="true" member="true">
</Function>
<Function name="PrintSelf" user="true" member="true">
......
......@@ -84,21 +84,21 @@ static const char *WindowType_strings[] = {
"Basic", "SinglePoint", "DoublePoint",
"DomainNode", "DomainNodeVars", "DomainZone",
"DomainZoneVars", "ActualData", "ActualDataVars",
"LineDistribution", "HohlraumFlux", "ConnCompSummary"
};
"LineDistribution", "HohlraumFlux", "ConnCompSummary",
"ShapeletsDecomp"};
std::string
QueryList::WindowType_ToString(QueryList::WindowType t)
{
int index = int(t);
if(index < 0 || index >= 12) index = 0;
if(index < 0 || index >= 13) index = 0;
return WindowType_strings[index];
}
std::string
QueryList::WindowType_ToString(int t)
{
int index = (t < 0 || t >= 12) ? 0 : t;
int index = (t < 0 || t >= 13) ? 0 : t;
return WindowType_strings[index];
}
......@@ -106,7 +106,7 @@ bool
QueryList::WindowType_FromString(const std::string &s, QueryList::WindowType &val)
{
val = QueryList::Basic;
for(int i = 0; i < 12; ++i)
for(int i = 0; i < 13; ++i)
{
if(s == WindowType_strings[i])
{
......@@ -206,7 +206,7 @@ const char *QueryList::TypeMapFormatString = "s*i*i*i*i*i*i*i*i*";
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Sep 28 14:45:00 PST 2007
// Creation: Tue Dec 18 15:55:21 PST 2007
//
// Modifications:
//
......@@ -226,7 +226,7 @@ QueryList::QueryList() :
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Sep 28 14:45:00 PST 2007
// Creation: Tue Dec 18 15:55:21 PST 2007
//
// Modifications:
//
......@@ -257,7 +257,7 @@ QueryList::QueryList(const QueryList &obj) :
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Sep 28 14:45:00 PST 2007
// Creation: Tue Dec 18 15:55:21 PST 2007
//
// Modifications:
//
......@@ -277,7 +277,7 @@ QueryList::~QueryList()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Sep 28 14:45:00 PST 2007
// Creation: Tue Dec 18 15:55:21 PST 2007
//
// Modifications:
//
......@@ -310,7 +310,7 @@ QueryList::operator = (const QueryList &obj)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Sep 28 14:45:00 PST 2007
// Creation: Tue Dec 18 15:55:21 PST 2007
//
// Modifications:
//
......@@ -340,7 +340,7 @@ QueryList::operator == (const QueryList &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Sep 28 14:45:00 PST 2007
// Creation: Tue Dec 18 15:55:21 PST 2007
//
// Modifications:
//
......@@ -361,7 +361,7 @@ QueryList::operator != (const QueryList &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Sep 28 14:45:00 PST 2007
// Creation: Tue Dec 18 15:55:21 PST 2007
//
// Modifications:
//
......@@ -382,7 +382,7 @@ QueryList::TypeName() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Sep 28 14:45:00 PST 2007
// Creation: Tue Dec 18 15:55:21 PST 2007
//
// Modifications:
//
......@@ -410,7 +410,7 @@ QueryList::CopyAttributes(const AttributeGroup *atts)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Sep 28 14:45:00 PST 2007
// Creation: Tue Dec 18 15:55:21 PST 2007
//
// Modifications:
//
......@@ -436,7 +436,7 @@ QueryList::CreateCompatible(const std::string &tname) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Sep 28 14:45:00 PST 2007
// Creation: Tue Dec 18 15:55:21 PST 2007
//
// Modifications:
//
......@@ -463,7 +463,7 @@ QueryList::NewInstance(bool copy) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Sep 28 14:45:00 PST 2007
// Creation: Tue Dec 18 15:55:21 PST 2007
//
// Modifications:
//
......@@ -496,7 +496,7 @@ QueryList::SelectAll()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Sep 28 14:45:00 PST 2007
// Creation: Tue Dec 18 15:55:21 PST 2007
//
// Modifications:
//
......@@ -586,7 +586,7 @@ QueryList::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Sep 28 14:45:00 PST 2007
// Creation: Tue Dec 18 15:55:21 PST 2007
//