Commit 3b927e22 authored by allens's avatar allens

added the ability to use the plot description in the legend title and allowed...

added the ability to use the plot description in the legend title and allowed for operators to change the display name of the variable in the legend

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@20741 18c085ea-50e0-402c-830e-de6fd14e8384
parent e49ea9d5
......@@ -313,6 +313,40 @@ avtPlot::GetDataExtents(std::vector<double> &extents)
}
// ****************************************************************************
// Method: avtPlot::SetPlotTitle
//
// Purpose:
// Sets the title for the plot.
//
// Arguments:
// title The title of the plot.
//
// Programmer: Hank Childs
// Creation: March 9, 2001
//
// ****************************************************************************
void
avtPlot::SetPlotTitle(const char *title)
{
if( title && strlen(title) )
GetLegend()->SetTitle( title );
else
{
// Get the name of the plot
std::string plotName( GetName() );
// All plots should end in "Plot" so strip that off.
std::size_t pos = plotName.find_last_of("Plot");
if( pos != std::string::npos)
plotName.erase( pos-3, 4 );
GetLegend()->SetTitle( plotName.c_str() );
}
}
// ****************************************************************************
// Method: avtPlot::SetVarName
//
......
......@@ -306,6 +306,7 @@ class PLOTTER_API avtPlot
void SetDataExtents(const std::vector<double> &);
virtual void GetDataExtents(std::vector<double> &);
virtual void SetPlotTitle(const char *title);
virtual void SetVarName(const char *name);
void SetVarUnits(const char *units);
void SetMeshType(const avtMeshType);
......
......@@ -187,6 +187,10 @@ class PLUGIN_API ViewerOperatorPluginInfo : public virtual CommonOperatorPluginI
virtual void InitializeOperatorAtts(AttributeSubject *atts,
const ViewerPlot *plot,
const bool fromDefault) = 0;
virtual void UpdateOperatorAtts(AttributeSubject *atts,
const ViewerPlot *plot) = 0;
virtual std::string GetOperatorVarDescription(AttributeSubject *atts,
const ViewerPlot *plot) = 0;
virtual QString *GetMenuName() const = 0;
virtual const char **XPMIconData() const { return 0; }
virtual bool GetUserSelectable() const { return true; }
......
......@@ -94,10 +94,15 @@ class AMRStitchCellViewerPluginInfo : public virtual ViewerOperatorPluginInfo, p
virtual AttributeSubject *GetDefaultAtts();
virtual void SetClientAtts(AttributeSubject *atts);
virtual void GetClientAtts(AttributeSubject *atts);
virtual void GetClientAtts(AttributeSubject *atts, const bool, const bool);
virtual void InitializeOperatorAtts(AttributeSubject *atts,
const ViewerPlot *plot,
const bool fromDefault);
virtual void UpdateOperatorAtts(AttributeSubject *atts,
const ViewerPlot *plot);
virtual std::string GetOperatorVarDescription(AttributeSubject *atts,
const ViewerPlot *plot);
virtual QString *GetMenuName() const;
virtual const char **XPMIconData() const;
......
......@@ -162,6 +162,26 @@ AMRStitchCellViewerPluginInfo::GetClientAtts(AttributeSubject *atts)
*(AMRStitchCellAttributes *)atts = *clientAtts;
}
// ****************************************************************************
// Method: AMRStitchCellViewerPluginInfo::GetClientAtts
//
// Purpose:
// Get the viewer client attributes.
//
// Arguments:
// atts A pointer to return the client default attributes in.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
void
AMRStitchCellViewerPluginInfo::GetClientAtts(AttributeSubject *atts, const bool, const bool)
{
GetClientAtts(atts);
}
// ****************************************************************************
// Method: AMRStitchCellViewerPluginInfo::InitializeOperatorAtts
//
......@@ -188,7 +208,53 @@ AMRStitchCellViewerPluginInfo::InitializeOperatorAtts(AttributeSubject *atts,
*(AMRStitchCellAttributes*)atts = *defaultAtts;
else
*(AMRStitchCellAttributes*)atts = *clientAtts;
UpdateOperatorAtts(atts, plot);
}
// ****************************************************************************
// Method: AMRStitchCellViewerPluginInfo::UpdateOperatorAtts
//
// Purpose:
// Update the operator attributes when using operator expressions.
//
// Arguments:
// atts The attribute subject to update.
// plot The viewer plot that owns the operator.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
void
AMRStitchCellViewerPluginInfo::UpdateOperatorAtts(AttributeSubject *atts,
const ViewerPlot *plot)
{
}
// ****************************************************************************
// Method: AMRStitchCellViewerPluginInfo::GetOperatorVarDescription
//
// Purpose:
// Return the operator variable description.
//
// Arguments:
// atts The current attributes.
// plot The viewer plot that owns the operator.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
std::string
AMRStitchCellViewerPluginInfo::GetOperatorVarDescription(AttributeSubject *atts,
const ViewerPlot *plot)
{
return std::string("");
}
// ****************************************************************************
// Method: AMRStitchCellViewerPluginInfo::GetMenuName
//
......
......@@ -94,10 +94,15 @@ class BoundaryOpViewerPluginInfo : public virtual ViewerOperatorPluginInfo, publ
virtual AttributeSubject *GetDefaultAtts();
virtual void SetClientAtts(AttributeSubject *atts);
virtual void GetClientAtts(AttributeSubject *atts);
virtual void GetClientAtts(AttributeSubject *atts, const bool, const bool);
virtual void InitializeOperatorAtts(AttributeSubject *atts,
const ViewerPlot *plot,
const bool fromDefault);
virtual void UpdateOperatorAtts(AttributeSubject *atts,
const ViewerPlot *plot);
virtual std::string GetOperatorVarDescription(AttributeSubject *atts,
const ViewerPlot *plot);
virtual QString *GetMenuName() const;
virtual const char **XPMIconData() const;
......
......@@ -162,6 +162,26 @@ BoundaryOpViewerPluginInfo::GetClientAtts(AttributeSubject *atts)
*(BoundaryOpAttributes *)atts = *clientAtts;
}
// ****************************************************************************
// Method: BoundaryOpViewerPluginInfo::GetClientAtts
//
// Purpose:
// Get the viewer client attributes.
//
// Arguments:
// atts A pointer to return the client default attributes in.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
void
BoundaryOpViewerPluginInfo::GetClientAtts(AttributeSubject *atts, const bool, const bool)
{
GetClientAtts(atts);
}
// ****************************************************************************
// Method: BoundaryOpViewerPluginInfo::InitializeOperatorAtts
//
......@@ -188,7 +208,53 @@ BoundaryOpViewerPluginInfo::InitializeOperatorAtts(AttributeSubject *atts,
*(BoundaryOpAttributes*)atts = *defaultAtts;
else
*(BoundaryOpAttributes*)atts = *clientAtts;
UpdateOperatorAtts(atts, plot);
}
// ****************************************************************************
// Method: BoundaryOpViewerPluginInfo::UpdateOperatorAtts
//
// Purpose:
// Update the operator attributes when using operator expressions.
//
// Arguments:
// atts The attribute subject to update.
// plot The viewer plot that owns the operator.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
void
BoundaryOpViewerPluginInfo::UpdateOperatorAtts(AttributeSubject *atts,
const ViewerPlot *plot)
{
}
// ****************************************************************************
// Method: BoundaryOpViewerPluginInfo::GetOperatorVarDescription
//
// Purpose:
// Return the operator variable description.
//
// Arguments:
// atts The current attributes.
// plot The viewer plot that owns the operator.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
std::string
BoundaryOpViewerPluginInfo::GetOperatorVarDescription(AttributeSubject *atts,
const ViewerPlot *plot)
{
return std::string("");
}
// ****************************************************************************
// Method: BoundaryOpViewerPluginInfo::GetMenuName
//
......
......@@ -94,10 +94,15 @@ class BoxViewerPluginInfo : public virtual ViewerOperatorPluginInfo, public virt
virtual AttributeSubject *GetDefaultAtts();
virtual void SetClientAtts(AttributeSubject *atts);
virtual void GetClientAtts(AttributeSubject *atts);
virtual void GetClientAtts(AttributeSubject *atts, const bool, const bool);
virtual void InitializeOperatorAtts(AttributeSubject *atts,
const ViewerPlot *plot,
const bool fromDefault);
virtual void UpdateOperatorAtts(AttributeSubject *atts,
const ViewerPlot *plot);
virtual std::string GetOperatorVarDescription(AttributeSubject *atts,
const ViewerPlot *plot);
virtual QString *GetMenuName() const;
virtual const char **XPMIconData() const;
......
......@@ -162,6 +162,26 @@ BoxViewerPluginInfo::GetClientAtts(AttributeSubject *atts)
*(BoxAttributes *)atts = *clientAtts;
}
// ****************************************************************************
// Method: BoxViewerPluginInfo::GetClientAtts
//
// Purpose:
// Get the viewer client attributes.
//
// Arguments:
// atts A pointer to return the client default attributes in.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
void
BoxViewerPluginInfo::GetClientAtts(AttributeSubject *atts, const bool, const bool)
{
GetClientAtts(atts);
}
// ****************************************************************************
// Method: BoxViewerPluginInfo::InitializeOperatorAtts
//
......@@ -188,7 +208,53 @@ BoxViewerPluginInfo::InitializeOperatorAtts(AttributeSubject *atts,
*(BoxAttributes*)atts = *defaultAtts;
else
*(BoxAttributes*)atts = *clientAtts;
UpdateOperatorAtts(atts, plot);
}
// ****************************************************************************
// Method: BoxViewerPluginInfo::UpdateOperatorAtts
//
// Purpose:
// Update the operator attributes when using operator expressions.
//
// Arguments:
// atts The attribute subject to update.
// plot The viewer plot that owns the operator.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
void
BoxViewerPluginInfo::UpdateOperatorAtts(AttributeSubject *atts,
const ViewerPlot *plot)
{
}
// ****************************************************************************
// Method: BoxViewerPluginInfo::GetOperatorVarDescription
//
// Purpose:
// Return the operator variable description.
//
// Arguments:
// atts The current attributes.
// plot The viewer plot that owns the operator.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
std::string
BoxViewerPluginInfo::GetOperatorVarDescription(AttributeSubject *atts,
const ViewerPlot *plot)
{
return std::string("");
}
// ****************************************************************************
// Method: BoxViewerPluginInfo::GetMenuName
//
......
......@@ -99,6 +99,10 @@ class CartographicProjectionViewerPluginInfo : public virtual ViewerOperatorPlug
virtual void InitializeOperatorAtts(AttributeSubject *atts,
const ViewerPlot *plot,
const bool fromDefault);
virtual void UpdateOperatorAtts(AttributeSubject *atts,
const ViewerPlot *plot);
virtual std::string GetOperatorVarDescription(AttributeSubject *atts,
const ViewerPlot *plot);
virtual QString *GetMenuName() const;
virtual const char **XPMIconData() const;
......
......@@ -208,7 +208,53 @@ CartographicProjectionViewerPluginInfo::InitializeOperatorAtts(AttributeSubject
*(CartographicProjectionAttributes*)atts = *defaultAtts;
else
*(CartographicProjectionAttributes*)atts = *clientAtts;
UpdateOperatorAtts(atts, plot);
}
// ****************************************************************************
// Method: CartographicProjectionViewerPluginInfo::UpdateOperatorAtts
//
// Purpose:
// Update the operator attributes when using operator expressions.
//
// Arguments:
// atts The attribute subject to update.
// plot The viewer plot that owns the operator.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
void
CartographicProjectionViewerPluginInfo::UpdateOperatorAtts(AttributeSubject *atts,
const ViewerPlot *plot)
{
}
// ****************************************************************************
// Method: CartographicProjectionViewerPluginInfo::GetOperatorVarDescription
//
// Purpose:
// Return the operator variable description.
//
// Arguments:
// atts The current attributes.
// plot The viewer plot that owns the operator.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
std::string
CartographicProjectionViewerPluginInfo::GetOperatorVarDescription(AttributeSubject *atts,
const ViewerPlot *plot)
{
return std::string("");
}
// ****************************************************************************
// Method: CartographicProjectionViewerPluginInfo::GetMenuName
//
......
......@@ -98,6 +98,10 @@ class ChannelCommViewerPluginInfo : public virtual ViewerOperatorPluginInfo, pub
virtual void InitializeOperatorAtts(AttributeSubject *atts,
const ViewerPlot *plot,
const bool fromDefault);
virtual void UpdateOperatorAtts(AttributeSubject *atts,
const ViewerPlot *plot);
virtual std::string GetOperatorVarDescription(AttributeSubject *atts,
const ViewerPlot *plot);
virtual QString *GetMenuName() const;
static void InitializeGlobalObjects();
......
......@@ -208,7 +208,53 @@ ChannelCommViewerPluginInfo::InitializeOperatorAtts(AttributeSubject *atts,
*(ChannelCommAttributes*)atts = *defaultAtts;
else
*(ChannelCommAttributes*)atts = *clientAtts;
UpdateOperatorAtts(atts, plot);
}
// ****************************************************************************
// Method: ChannelCommViewerPluginInfo::UpdateOperatorAtts
//
// Purpose:
// Update the operator attributes when using operator expressions.
//
// Arguments:
// atts The attribute subject to update.
// plot The viewer plot that owns the operator.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
void
ChannelCommViewerPluginInfo::UpdateOperatorAtts(AttributeSubject *atts,
const ViewerPlot *plot)
{
}
// ****************************************************************************
// Method: ChannelCommViewerPluginInfo::GetOperatorVarDescription
//
// Purpose:
// Return the operator variable description.
//
// Arguments:
// atts The current attributes.
// plot The viewer plot that owns the operator.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
std::string
ChannelCommViewerPluginInfo::GetOperatorVarDescription(AttributeSubject *atts,
const ViewerPlot *plot)
{
return std::string("");
}
// ****************************************************************************
// Method: ChannelCommViewerPluginInfo::GetMenuName
//
......
......@@ -94,10 +94,15 @@ class ClipViewerPluginInfo : public virtual ViewerOperatorPluginInfo, public vir
virtual AttributeSubject *GetDefaultAtts();
virtual void SetClientAtts(AttributeSubject *atts);
virtual void GetClientAtts(AttributeSubject *atts);
virtual void GetClientAtts(AttributeSubject *atts, const bool, const bool);
virtual void InitializeOperatorAtts(AttributeSubject *atts,
const ViewerPlot *plot,
const bool fromDefault);
virtual void UpdateOperatorAtts(AttributeSubject *atts,
const ViewerPlot *plot);
virtual std::string GetOperatorVarDescription(AttributeSubject *atts,
const ViewerPlot *plot);
virtual QString *GetMenuName() const;
virtual const char **XPMIconData() const;
......
......@@ -162,6 +162,26 @@ ClipViewerPluginInfo::GetClientAtts(AttributeSubject *atts)
*(ClipAttributes *)atts = *clientAtts;
}
// ****************************************************************************
// Method: ClipViewerPluginInfo::GetClientAtts
//
// Purpose:
// Get the viewer client attributes.
//
// Arguments:
// atts A pointer to return the client default attributes in.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
void
ClipViewerPluginInfo::GetClientAtts(AttributeSubject *atts, const bool, const bool)
{
GetClientAtts(atts);
}
// ****************************************************************************
// Method: ClipViewerPluginInfo::InitializeOperatorAtts
//
......@@ -188,7 +208,53 @@ ClipViewerPluginInfo::InitializeOperatorAtts(AttributeSubject *atts,
*(ClipAttributes*)atts = *defaultAtts;
else
*(ClipAttributes*)atts = *clientAtts;
UpdateOperatorAtts(atts, plot);
}
// ****************************************************************************
// Method: ClipViewerPluginInfo::UpdateOperatorAtts
//
// Purpose:
// Update the operator attributes when using operator expressions.
//
// Arguments:
// atts The attribute subject to update.
// plot The viewer plot that owns the operator.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
void
ClipViewerPluginInfo::UpdateOperatorAtts(AttributeSubject *atts,
const ViewerPlot *plot)
{
}
// ****************************************************************************
// Method: ClipViewerPluginInfo::GetOperatorVarDescription
//
// Purpose:
// Return the operator variable description.
//
// Arguments:
// atts The current attributes.
// plot The viewer plot that owns the operator.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
std::string
ClipViewerPluginInfo::GetOperatorVarDescription(AttributeSubject *atts,
const ViewerPlot *plot)
{
return std::string("");
}
// ****************************************************************************
// Method: ClipViewerPluginInfo::GetMenuName
//
......
......@@ -94,10 +94,15 @@ class ConeViewerPluginInfo : public virtual ViewerOperatorPluginInfo, public vir
virtual AttributeSubject *GetDefaultAtts();
virtual void SetClientAtts(AttributeSubject *atts);
virtual void GetClientAtts(AttributeSubject *atts);
virtual void GetClientAtts(AttributeSubject *atts, const bool, const bool);
virtual void InitializeOperatorAtts(AttributeSubject *atts,
const ViewerPlot *plot,
const bool fromDefault);
virtual void UpdateOperatorAtts(AttributeSubject *atts,
const ViewerPlot *plot);
virtual std::string GetOperatorVarDescription(AttributeSubject *atts,
const ViewerPlot *plot);
virtual QString *GetMenuName() const;
virtual const char **XPMIconData() const;
......
......@@ -162,6 +162,26 @@ ConeViewerPluginInfo::GetClientAtts(AttributeSubject *atts)
*(ConeAttributes *)atts = *clientAtts;
}
// ****************************************************************************
// Method: ConeViewerPluginInfo::GetClientAtts
//
// Purpose:
// Get the viewer client attributes.
//
// Arguments:
// atts A pointer to return the client default attributes in.
//
// Programmer: generated by xml2info
// Creation: omitted
//
// ****************************************************************************
void
ConeViewerPluginInfo::GetClientAtts(AttributeSubject *atts, const bool, const bool)
{
GetClientAtts(atts);
}
// ****************************************************************************
// Method: ConeViewerPluginInfo::InitializeOperatorAtts
//
......@@ -188,7 +208,53 @@ ConeViewerPluginInfo::InitializeOperatorAtts(AttributeSubject *atts,
*(ConeAttributes*)atts = *defaultAtts;
else
*(ConeAttributes*)atts = *clientAtts;
UpdateOperatorAtts(atts, plot);
}
// ****************************************************************************
// Method: ConeViewerPluginInfo::UpdateOperatorAtts
//
// Purpose:
// Update the operator attributes when using operator expressions.
//
// Arguments:
// atts The attribute subject to update.
// plot The viewer plot that owns the operator.
//
// Programmer: generated by xml2info
// Creation: omitted