Commit 4a82f2f1 authored by hrchilds's avatar hrchilds

Update from June 9, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@258 18c085ea-50e0-402c-830e-de6fd14e8384
parent 98858b0c
......@@ -31,13 +31,16 @@ PARSER_API std::string GetTokenTypeString(int t);
// Creation: April 5, 2002
//
// Modifications:
// Sean Ahern, Thu Apr 18 11:25:16 PDT 2002
// Made the base class ExprGrammarNode so that I can separate out the
// code that talks to the engine.
// Sean Ahern, Thu Apr 18 11:25:16 PDT 2002
// Made the base class ExprGrammarNode so that I can separate out the
// code that talks to the engine.
//
// Sean Ahern, Wed Oct 16 16:41:59 PDT 2002
// Moved the engine communication code to a separate set of classes
// that are owned by the viewer. I may collapse ExprGrammarNode again.
// Sean Ahern, Wed Oct 16 16:41:59 PDT 2002
// Moved the engine communication code to a separate set of classes
// that are owned by the viewer. I may collapse ExprGrammarNode again.
//
// Jeremy Meredith, Wed Jun 9 10:20:08 PDT 2004
// Added GetValue to BoolConst.
//
// ****************************************************************************
class PARSER_API Token : public ExprGrammarNode
......@@ -129,6 +132,7 @@ class PARSER_API BoolConst : public Token
BoolConst(const Pos &p, const std::string &v) : Token(p, TT_BoolConst), val(v == "true" || v == "on") { }
virtual ~BoolConst() { }
virtual void PrintNode(ostream &o) { o << "Bool("<<(val?"true":"false")<<")\n"; }
bool GetValue(void) { return val; }
private:
bool val;
};
......
......@@ -225,6 +225,9 @@
# Brad Whitlock, Thu Apr 22 10:42:08 PDT 2004
# Added -lmisc to the libs since that's needed for the Mac.
#
# Mark C. Miller, Wed Jun 9 17:44:38 PDT 2004
# Added source files for VisualCues
#
##############################################################################
##
......@@ -312,6 +315,8 @@ SRC= AnimationAttributes.C \
ViewAttributes.C \
ViewCurveAttributes.C \
VisItRPC.C \
VisualCueInfo.C \
VisualCueList.C \
WindowAttributes.C \
WindowInformation.C \
Xfer.C
......
#include <VisualCueInfo.h>
#include <DataNode.h>
//
// Enum conversion methods for VisualCueInfo::CueType
//
static const char *CueType_strings[] = {
"PickPoint", "RefLine", "Unknown"
};
std::string
VisualCueInfo::CueType_ToString(VisualCueInfo::CueType t)
{
int index = int(t);
if(index < 0 || index >= 3) index = 0;
return CueType_strings[index];
}
std::string
VisualCueInfo::CueType_ToString(int t)
{
int index = (t < 0 || t >= 3) ? 0 : t;
return CueType_strings[index];
}
bool
VisualCueInfo::CueType_FromString(const std::string &s, VisualCueInfo::CueType &val)
{
val = VisualCueInfo::PickPoint;
for(int i = 0; i < 3; ++i)
{
if(s == CueType_strings[i])
{
val = (CueType)i;
return true;
}
}
return false;
}
// ****************************************************************************
// Method: VisualCueInfo::VisualCueInfo
//
// Purpose:
// Constructor for the VisualCueInfo class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 8 20:03:32 PST 2004
//
// Modifications:
//
// ****************************************************************************
VisualCueInfo::VisualCueInfo() : AttributeSubject("d*iassbiid"),
color(0, 0, 0)
{
cueType = Unknown;
showLabel = false;
lineStyle = 0;
lineWidth = 0;
opacity = 1;
}
// ****************************************************************************
// Method: VisualCueInfo::VisualCueInfo
//
// Purpose:
// Copy constructor for the VisualCueInfo class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 8 20:03:32 PST 2004
//
// Modifications:
//
// ****************************************************************************
VisualCueInfo::VisualCueInfo(const VisualCueInfo &obj) : AttributeSubject("d*iassbiid")
{
points = obj.points;
cueType = obj.cueType;
color = obj.color;
glyphType = obj.glyphType;
label = obj.label;
showLabel = obj.showLabel;
lineStyle = obj.lineStyle;
lineWidth = obj.lineWidth;
opacity = obj.opacity;
SelectAll();
}
// ****************************************************************************
// Method: VisualCueInfo::~VisualCueInfo
//
// Purpose:
// Destructor for the VisualCueInfo class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 8 20:03:32 PST 2004
//
// Modifications:
//
// ****************************************************************************
VisualCueInfo::~VisualCueInfo()
{
// nothing here
}
// ****************************************************************************
// Method: VisualCueInfo::operator =
//
// Purpose:
// Assignment operator for the VisualCueInfo class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 8 20:03:32 PST 2004
//
// Modifications:
//
// ****************************************************************************
void
VisualCueInfo::operator = (const VisualCueInfo &obj)
{
points = obj.points;
cueType = obj.cueType;
color = obj.color;
glyphType = obj.glyphType;
label = obj.label;
showLabel = obj.showLabel;
lineStyle = obj.lineStyle;
lineWidth = obj.lineWidth;
opacity = obj.opacity;
SelectAll();
}
// ****************************************************************************
// Method: VisualCueInfo::operator ==
//
// Purpose:
// Comparison operator == for the VisualCueInfo class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 8 20:03:32 PST 2004
//
// Modifications:
//
// ****************************************************************************
bool
VisualCueInfo::operator == (const VisualCueInfo &obj) const
{
// Create the return value
return ((points == obj.points) &&
(cueType == obj.cueType) &&
(color == obj.color) &&
(glyphType == obj.glyphType) &&
(label == obj.label) &&
(showLabel == obj.showLabel) &&
(lineStyle == obj.lineStyle) &&
(lineWidth == obj.lineWidth) &&
(opacity == obj.opacity));
}
// ****************************************************************************
// Method: VisualCueInfo::operator !=
//
// Purpose:
// Comparison operator != for the VisualCueInfo class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 8 20:03:32 PST 2004
//
// Modifications:
//
// ****************************************************************************
bool
VisualCueInfo::operator != (const VisualCueInfo &obj) const
{
return !(this->operator == (obj));
}
// ****************************************************************************
// Method: VisualCueInfo::TypeName
//
// Purpose:
// Type name method for the VisualCueInfo class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 8 20:03:32 PST 2004
//
// Modifications:
//
// ****************************************************************************
const std::string
VisualCueInfo::TypeName() const
{
return "VisualCueInfo";
}
// ****************************************************************************
// Method: VisualCueInfo::CopyAttributes
//
// Purpose:
// CopyAttributes method for the VisualCueInfo class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 8 20:03:32 PST 2004
//
// Modifications:
//
// ****************************************************************************
bool
VisualCueInfo::CopyAttributes(const AttributeGroup *atts)
{
if(TypeName() != atts->TypeName())
return false;
// Call assignment operator.
const VisualCueInfo *tmp = (const VisualCueInfo *)atts;
*this = *tmp;
return true;
}
// ****************************************************************************
// Method: VisualCueInfo::CreateCompatible
//
// Purpose:
// CreateCompatible method for the VisualCueInfo class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 8 20:03:32 PST 2004
//
// Modifications:
//
// ****************************************************************************
AttributeSubject *
VisualCueInfo::CreateCompatible(const std::string &tname) const
{
AttributeSubject *retval = 0;
if(TypeName() == tname)
retval = new VisualCueInfo(*this);
// Other cases could go here too.
return retval;
}
// ****************************************************************************
// Method: VisualCueInfo::NewInstance
//
// Purpose:
// NewInstance method for the VisualCueInfo class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 8 20:03:32 PST 2004
//
// Modifications:
//
// ****************************************************************************
AttributeSubject *
VisualCueInfo::NewInstance(bool copy) const
{
AttributeSubject *retval = 0;
if(copy)
retval = new VisualCueInfo(*this);
else
retval = new VisualCueInfo;
return retval;
}
// ****************************************************************************
// Method: VisualCueInfo::SelectAll
//
// Purpose:
// Selects all attributes.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 8 20:03:32 PST 2004
//
// Modifications:
//
// ****************************************************************************
void
VisualCueInfo::SelectAll()
{
Select(0, (void *)&points);
Select(1, (void *)&cueType);
Select(2, (void *)&color);
Select(3, (void *)&glyphType);
Select(4, (void *)&label);
Select(5, (void *)&showLabel);
Select(6, (void *)&lineStyle);
Select(7, (void *)&lineWidth);
Select(8, (void *)&opacity);
}
///////////////////////////////////////////////////////////////////////////////
// Set property methods
///////////////////////////////////////////////////////////////////////////////
void
VisualCueInfo::SetPoints(const doubleVector &points_)
{
points = points_;
Select(0, (void *)&points);
}
void
VisualCueInfo::SetCueType(VisualCueInfo::CueType cueType_)
{
cueType = cueType_;
Select(1, (void *)&cueType);
}
void
VisualCueInfo::SetColor(const ColorAttribute &color_)
{
color = color_;
Select(2, (void *)&color);
}
void
VisualCueInfo::SetGlyphType(const std::string &glyphType_)
{
glyphType = glyphType_;
Select(3, (void *)&glyphType);
}
void
VisualCueInfo::SetLabel(const std::string &label_)
{
label = label_;
Select(4, (void *)&label);
}
void
VisualCueInfo::SetShowLabel(bool showLabel_)
{
showLabel = showLabel_;
Select(5, (void *)&showLabel);
}
void
VisualCueInfo::SetLineStyle(int lineStyle_)
{
lineStyle = lineStyle_;
Select(6, (void *)&lineStyle);
}
void
VisualCueInfo::SetLineWidth(int lineWidth_)
{
lineWidth = lineWidth_;
Select(7, (void *)&lineWidth);
}
void
VisualCueInfo::SetOpacity(double opacity_)
{
opacity = opacity_;
Select(8, (void *)&opacity);
}
///////////////////////////////////////////////////////////////////////////////
// Get property methods
///////////////////////////////////////////////////////////////////////////////
const doubleVector &
VisualCueInfo::GetPoints() const
{
return points;
}
doubleVector &
VisualCueInfo::GetPoints()
{
return points;
}
VisualCueInfo::CueType
VisualCueInfo::GetCueType() const
{
return CueType(cueType);
}
const ColorAttribute &
VisualCueInfo::GetColor() const
{
return color;
}
ColorAttribute &
VisualCueInfo::GetColor()
{
return color;
}
const std::string &
VisualCueInfo::GetGlyphType() const
{
return glyphType;
}
std::string &
VisualCueInfo::GetGlyphType()
{
return glyphType;
}
const std::string &
VisualCueInfo::GetLabel() const
{
return label;
}
std::string &
VisualCueInfo::GetLabel()
{
return label;
}
bool
VisualCueInfo::GetShowLabel() const
{
return showLabel;
}
int
VisualCueInfo::GetLineStyle() const
{
return lineStyle;
}
int
VisualCueInfo::GetLineWidth() const
{
return lineWidth;
}
double
VisualCueInfo::GetOpacity() const
{
return opacity;
}
///////////////////////////////////////////////////////////////////////////////
// Select property methods
///////////////////////////////////////////////////////////////////////////////
void
VisualCueInfo::SelectPoints()
{
Select(0, (void *)&points);
}
void
VisualCueInfo::SelectColor()
{
Select(2, (void *)&color);
}
void
VisualCueInfo::SelectGlyphType()
{
Select(3, (void *)&glyphType);
}
void
VisualCueInfo::SelectLabel()
{
Select(4, (void *)&label);
}
///////////////////////////////////////////////////////////////////////////////
// Keyframing methods
///////////////////////////////////////////////////////////////////////////////
// ****************************************************************************
// Method: VisualCueInfo::GetFieldName
//
// Purpose:
// This method returns the name of a field given its index.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 8 20:03:32 PST 2004
//
// Modifications:
//
// ****************************************************************************
std::string
VisualCueInfo::GetFieldName(int index) const
{
switch (index)
{
case 0: return "points";
case 1: return "cueType";
case 2: return "color";
case 3: return "glyphType";
case 4: return "label";
case 5: return "showLabel";
case 6: return "lineStyle";
case 7: return "lineWidth";
case 8: return "opacity";
default: return "invalid index";
}
}
// ****************************************************************************
// Method: VisualCueInfo::GetFieldType
//
// Purpose:
// This method returns the type of a field given its index.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Jun 8 20:03:32 PST 2004
//
// Modifications:
//
// ****************************************************************************
AttributeGroup::FieldType
VisualCueInfo::GetFieldType(int index) const
{
switch (index)
{
case 0: return FieldType_doubleVector;