Commit 1fc08f2a authored by hrchilds's avatar hrchilds
Browse files

Update from March 12, 2007

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@829 18c085ea-50e0-402c-830e-de6fd14e8384
parent 0f561696
<?xml version="1.0"?>
<Plugin name="Histogram" type="plot" label="Histogram" version="1.0" enabled="true" mdspecificcode="false" onlyengine="false" noengine="false" vartype="scalar,array" iconFile="Histogram.xpm">
<Plugin name="Histogram" type="plot" label="Histogram" version="1.0" enabled="true" mdspecificcode="false" engspecificcode="true" onlyengine="false" noengine="false" vartype="scalar,array" iconFile="Histogram.xpm">
<Attribute name="HistogramAttributes" purpose="Attributes for Histogram Plot" persistent="true" exportAPI="" exportInclude="" codefile="HistogramAttributes.code">
<Enum name="OutputType">
Curve
......@@ -13,9 +13,20 @@
ManyVarsForSingleZone
ManyZonesForSingleVar
</Enum>
<Field name="basedOn" label="basedOn" type="enum" subtype="BasedOn">
<Enum name="BinContribution">
Auto
Frequency
Weighted
</Enum>
<Field name="basedOn" label="Histogram based on" type="enum" subtype="BasedOn">
ManyZonesForSingleVar
</Field>
<Field name="histogramType" label="Histogram Method" type="enum" subtype="BinContribution" enabler="basedOn:ManyZonesForSingleVar">
Auto
</Field>
<Field name="twoDAmount" label="2D weight contribution" type="enum" subtype="TwoDAmount" enabler="histogramType:Weighted">
RevolvedVolume
</Field>
<Field name="specifyRange" label="Specify Range?" type="bool" enabler="basedOn:ManyZonesForSingleVar">
false
</Field>
......@@ -28,9 +39,6 @@
<Field name="numBins" label="Number of Bins" type="int" enabler="basedOn:ManyZonesForSingleVar">
32
</Field>
<Field name="twoDAmount" label="Calculate 2D based on" type="enum" subtype="TwoDAmount" enabler="basedOn:ManyZonesForSingleVar">
RevolvedVolume
</Field>
<Field name="domain" label="domain" type="int" enabler="basedOn:ManyVarsForSingleZone">
0
</Field>
......
This diff is collapsed.
......@@ -22,7 +22,8 @@ HistogramAttributes::ChangesRequireRecalculation(const HistogramAttributes &obj)
return true;
if (domain != obj.GetDomain())
return true;
if (histogramType != obj.GetHistogramType())
return true;
return false;
}
......
......@@ -51,7 +51,7 @@
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Fri Jan 12 15:22:02 PST 2007
// Creation: Thu Mar 8 15:21:18 PST 2007
//
// Modifications:
//
......@@ -75,6 +75,12 @@ public:
ManyVarsForSingleZone,
ManyZonesForSingleVar
};
enum BinContribution
{
Auto,
Frequency,
Weighted
};
HistogramAttributes();
HistogramAttributes(const HistogramAttributes &obj);
......@@ -95,11 +101,12 @@ public:
// Property setting methods
void SetBasedOn(BasedOn basedOn_);
void SetHistogramType(BinContribution histogramType_);
void SetTwoDAmount(TwoDAmount twoDAmount_);
void SetSpecifyRange(bool specifyRange_);
void SetMin(double min_);
void SetMax(double max_);
void SetNumBins(int numBins_);
void SetTwoDAmount(TwoDAmount twoDAmount_);
void SetDomain(int domain_);
void SetZone(int zone_);
void SetUseBinWidths(bool useBinWidths_);
......@@ -110,11 +117,12 @@ public:
// Property getting methods
BasedOn GetBasedOn() const;
BinContribution GetHistogramType() const;
TwoDAmount GetTwoDAmount() const;
bool GetSpecifyRange() const;
double GetMin() const;
double GetMax() const;
int GetNumBins() const;
TwoDAmount GetTwoDAmount() const;
int GetDomain() const;
int GetZone() const;
bool GetUseBinWidths() const;
......@@ -144,6 +152,11 @@ public:
protected:
static std::string BasedOn_ToString(int);
public:
static std::string BinContribution_ToString(BinContribution);
static bool BinContribution_FromString(const std::string &, BinContribution &);
protected:
static std::string BinContribution_ToString(int);
public:
// Keyframing methods
virtual std::string GetFieldName(int index) const;
......@@ -156,11 +169,12 @@ public:
virtual bool VarChangeRequiresReset(void);
private:
int basedOn;
int histogramType;
int twoDAmount;
bool specifyRange;
double min;
double max;
int numBins;
int twoDAmount;
int domain;
int zone;
bool useBinWidths;
......
......@@ -51,7 +51,7 @@ import llnl.visit.ColorAttribute;
// Notes: Autogenerated by xml2java.
//
// Programmer: xml2java
// Creation: Fri Jan 12 15:22:04 PST 2007
// Creation: Mon Mar 12 13:13:34 PST 2007
//
// Modifications:
//
......@@ -69,17 +69,22 @@ public class HistogramAttributes extends AttributeSubject implements Plugin
public final static int BASEDON_MANYVARSFORSINGLEZONE = 0;
public final static int BASEDON_MANYZONESFORSINGLEVAR = 1;
public final static int BINCONTRIBUTION_AUTO = 0;
public final static int BINCONTRIBUTION_FREQUENCY = 1;
public final static int BINCONTRIBUTION_WEIGHTED = 2;
public HistogramAttributes()
{
super(13);
super(14);
basedOn = BASEDON_MANYZONESFORSINGLEVAR;
histogramType = BINCONTRIBUTION_AUTO;
twoDAmount = TWODAMOUNT_REVOLVEDVOLUME;
specifyRange = false;
min = 0;
max = 1;
numBins = 32;
twoDAmount = TWODAMOUNT_REVOLVEDVOLUME;
domain = 0;
zone = 0;
useBinWidths = true;
......@@ -91,14 +96,15 @@ public class HistogramAttributes extends AttributeSubject implements Plugin
public HistogramAttributes(HistogramAttributes obj)
{
super(13);
super(14);
basedOn = obj.basedOn;
histogramType = obj.histogramType;
twoDAmount = obj.twoDAmount;
specifyRange = obj.specifyRange;
min = obj.min;
max = obj.max;
numBins = obj.numBins;
twoDAmount = obj.twoDAmount;
domain = obj.domain;
zone = obj.zone;
useBinWidths = obj.useBinWidths;
......@@ -114,11 +120,12 @@ public class HistogramAttributes extends AttributeSubject implements Plugin
{
// Create the return value
return ((basedOn == obj.basedOn) &&
(histogramType == obj.histogramType) &&
(twoDAmount == obj.twoDAmount) &&
(specifyRange == obj.specifyRange) &&
(min == obj.min) &&
(max == obj.max) &&
(numBins == obj.numBins) &&
(twoDAmount == obj.twoDAmount) &&
(domain == obj.domain) &&
(zone == obj.zone) &&
(useBinWidths == obj.useBinWidths) &&
......@@ -138,85 +145,92 @@ public class HistogramAttributes extends AttributeSubject implements Plugin
Select(0);
}
public void SetSpecifyRange(boolean specifyRange_)
public void SetHistogramType(int histogramType_)
{
specifyRange = specifyRange_;
histogramType = histogramType_;
Select(1);
}
public void SetMin(double min_)
public void SetTwoDAmount(int twoDAmount_)
{
min = min_;
twoDAmount = twoDAmount_;
Select(2);
}
public void SetMax(double max_)
public void SetSpecifyRange(boolean specifyRange_)
{
max = max_;
specifyRange = specifyRange_;
Select(3);
}
public void SetNumBins(int numBins_)
public void SetMin(double min_)
{
numBins = numBins_;
min = min_;
Select(4);
}
public void SetTwoDAmount(int twoDAmount_)
public void SetMax(double max_)
{
twoDAmount = twoDAmount_;
max = max_;
Select(5);
}
public void SetNumBins(int numBins_)
{
numBins = numBins_;
Select(6);
}
public void SetDomain(int domain_)
{
domain = domain_;
Select(6);
Select(7);
}
public void SetZone(int zone_)
{
zone = zone_;
Select(7);
Select(8);
}
public void SetUseBinWidths(boolean useBinWidths_)
{
useBinWidths = useBinWidths_;
Select(8);
Select(9);
}
public void SetOutputType(int outputType_)
{
outputType = outputType_;
Select(9);
Select(10);
}
public void SetLineStyle(int lineStyle_)
{
lineStyle = lineStyle_;
Select(10);
Select(11);
}
public void SetLineWidth(int lineWidth_)
{
lineWidth = lineWidth_;
Select(11);
Select(12);
}
public void SetColor(ColorAttribute color_)
{
color = color_;
Select(12);
Select(13);
}
// Property getting methods
public int GetBasedOn() { return basedOn; }
public int GetHistogramType() { return histogramType; }
public int GetTwoDAmount() { return twoDAmount; }
public boolean GetSpecifyRange() { return specifyRange; }
public double GetMin() { return min; }
public double GetMax() { return max; }
public int GetNumBins() { return numBins; }
public int GetTwoDAmount() { return twoDAmount; }
public int GetDomain() { return domain; }
public int GetZone() { return zone; }
public boolean GetUseBinWidths() { return useBinWidths; }
......@@ -231,28 +245,30 @@ public class HistogramAttributes extends AttributeSubject implements Plugin
if(WriteSelect(0, buf))
buf.WriteInt(basedOn);
if(WriteSelect(1, buf))
buf.WriteBool(specifyRange);
buf.WriteInt(histogramType);
if(WriteSelect(2, buf))
buf.WriteDouble(min);
buf.WriteInt(twoDAmount);
if(WriteSelect(3, buf))
buf.WriteDouble(max);
buf.WriteBool(specifyRange);
if(WriteSelect(4, buf))
buf.WriteInt(numBins);
buf.WriteDouble(min);
if(WriteSelect(5, buf))
buf.WriteInt(twoDAmount);
buf.WriteDouble(max);
if(WriteSelect(6, buf))
buf.WriteInt(domain);
buf.WriteInt(numBins);
if(WriteSelect(7, buf))
buf.WriteInt(zone);
buf.WriteInt(domain);
if(WriteSelect(8, buf))
buf.WriteBool(useBinWidths);
buf.WriteInt(zone);
if(WriteSelect(9, buf))
buf.WriteInt(outputType);
buf.WriteBool(useBinWidths);
if(WriteSelect(10, buf))
buf.WriteInt(lineStyle);
buf.WriteInt(outputType);
if(WriteSelect(11, buf))
buf.WriteInt(lineWidth);
buf.WriteInt(lineStyle);
if(WriteSelect(12, buf))
buf.WriteInt(lineWidth);
if(WriteSelect(13, buf))
color.Write(buf);
}
......@@ -267,41 +283,44 @@ public class HistogramAttributes extends AttributeSubject implements Plugin
SetBasedOn(buf.ReadInt());
break;
case 1:
SetSpecifyRange(buf.ReadBool());
SetHistogramType(buf.ReadInt());
break;
case 2:
SetMin(buf.ReadDouble());
SetTwoDAmount(buf.ReadInt());
break;
case 3:
SetMax(buf.ReadDouble());
SetSpecifyRange(buf.ReadBool());
break;
case 4:
SetNumBins(buf.ReadInt());
SetMin(buf.ReadDouble());
break;
case 5:
SetTwoDAmount(buf.ReadInt());
SetMax(buf.ReadDouble());
break;
case 6:
SetDomain(buf.ReadInt());
SetNumBins(buf.ReadInt());
break;
case 7:
SetZone(buf.ReadInt());
SetDomain(buf.ReadInt());
break;
case 8:
SetUseBinWidths(buf.ReadBool());
SetZone(buf.ReadInt());
break;
case 9:
SetOutputType(buf.ReadInt());
SetUseBinWidths(buf.ReadBool());
break;
case 10:
SetLineStyle(buf.ReadInt());
SetOutputType(buf.ReadInt());
break;
case 11:
SetLineWidth(buf.ReadInt());
SetLineStyle(buf.ReadInt());
break;
case 12:
SetLineWidth(buf.ReadInt());
break;
case 13:
color.Read(buf);
Select(12);
Select(13);
break;
}
}
......@@ -310,11 +329,12 @@ public class HistogramAttributes extends AttributeSubject implements Plugin
// Attributes
private int basedOn;
private int histogramType;
private int twoDAmount;
private boolean specifyRange;
private double min;
private double max;
private int numBins;
private int twoDAmount;
private int domain;
private int zone;
private boolean useBinWidths;
......
......@@ -49,7 +49,7 @@
// Note: Autogenerated by xml2python. Do not modify by hand!
//
// Programmer: xml2python
// Creation: Fri Jan 12 15:22:04 PST 2007
// Creation: Mon Mar 12 13:11:12 PST 2007
//
// ****************************************************************************
......@@ -86,17 +86,23 @@ PyHistogramAttributes_ToString(const HistogramAttributes *atts, const char *pref
str += tmpStr;
}
if(atts->GetSpecifyRange())
SNPRINTF(tmpStr, 1000, "%sspecifyRange = 1\n", prefix);
const char *histogramType_names = "Auto, Frequency, Weighted";
if(atts->GetHistogramType() == HistogramAttributes::Auto)
{
SNPRINTF(tmpStr, 1000, "%shistogramType = %sAuto # %s\n", prefix, prefix, histogramType_names);
str += tmpStr;
}
else if(atts->GetHistogramType() == HistogramAttributes::Frequency)
{
SNPRINTF(tmpStr, 1000, "%shistogramType = %sFrequency # %s\n", prefix, prefix, histogramType_names);
str += tmpStr;
}
else
SNPRINTF(tmpStr, 1000, "%sspecifyRange = 0\n", prefix);
str += tmpStr;
SNPRINTF(tmpStr, 1000, "%smin = %g\n", prefix, atts->GetMin());
str += tmpStr;
SNPRINTF(tmpStr, 1000, "%smax = %g\n", prefix, atts->GetMax());
str += tmpStr;
SNPRINTF(tmpStr, 1000, "%snumBins = %d\n", prefix, atts->GetNumBins());
str += tmpStr;
{
SNPRINTF(tmpStr, 1000, "%shistogramType = %sWeighted # %s\n", prefix, prefix, histogramType_names);
str += tmpStr;
}
const char *twoDAmount_names = "Area, RevolvedVolume";
if(atts->GetTwoDAmount() == HistogramAttributes::Area)
{
......@@ -109,6 +115,17 @@ PyHistogramAttributes_ToString(const HistogramAttributes *atts, const char *pref
str += tmpStr;
}
if(atts->GetSpecifyRange())
SNPRINTF(tmpStr, 1000, "%sspecifyRange = 1\n", prefix);
else
SNPRINTF(tmpStr, 1000, "%sspecifyRange = 0\n", prefix);
str += tmpStr;
SNPRINTF(tmpStr, 1000, "%smin = %g\n", prefix, atts->GetMin());
str += tmpStr;
SNPRINTF(tmpStr, 1000, "%smax = %g\n", prefix, atts->GetMax());
str += tmpStr;
SNPRINTF(tmpStr, 1000, "%snumBins = %d\n", prefix, atts->GetNumBins());
str += tmpStr;
SNPRINTF(tmpStr, 1000, "%sdomain = %d\n", prefix, atts->GetDomain());
str += tmpStr;
SNPRINTF(tmpStr, 1000, "%szone = %d\n", prefix, atts->GetZone());
......@@ -183,6 +200,72 @@ HistogramAttributes_GetBasedOn(PyObject *self, PyObject *args)
return retval;
}
static PyObject *
HistogramAttributes_SetHistogramType(PyObject *self, PyObject *args)
{
HistogramAttributesObject *obj = (HistogramAttributesObject *)self;
int ival;
if(!PyArg_ParseTuple(args, "i", &ival))
return NULL;
// Set the histogramType in the object.
if(ival >= 0 && ival < 3)
obj->data->SetHistogramType(HistogramAttributes::BinContribution(ival));
else
{
fprintf(stderr, "An invalid histogramType value was given. "
"Valid values are in the range of [0,2]. "
"You can also use the following names: "
"Auto, Frequency, Weighted.");
return NULL;
}
Py_INCREF(Py_None);
return Py_None;
}
static PyObject *
HistogramAttributes_GetHistogramType(PyObject *self, PyObject *args)
{
HistogramAttributesObject *obj = (HistogramAttributesObject *)self;
PyObject *retval = PyInt_FromLong(long(obj->data->GetHistogramType()));
return retval;
}
static PyObject *
HistogramAttributes_SetTwoDAmount(PyObject *self, PyObject *args)
{
HistogramAttributesObject *obj = (HistogramAttributesObject *)self;
int ival;
if(!PyArg_ParseTuple(args, "i", &ival))
return NULL;
// Set the twoDAmount in the object.
if(ival >= 0 && ival < 2)
obj->data->SetTwoDAmount(HistogramAttributes::TwoDAmount(ival));
else
{
fprintf(stderr, "An invalid twoDAmount value was given. "
"Valid values are in the range of [0,1]. "
"You can also use the following names: "
"Area, RevolvedVolume.");
return NULL;
}
Py_INCREF(Py_None);
return Py_None;
}
static PyObject *
HistogramAttributes_GetTwoDAmount(PyObject *self, PyObject *args)
{
HistogramAttributesObject *obj = (HistogramAttributesObject *)self;
PyObject *retval = PyInt_FromLong(long(obj->data->GetTwoDAmount()));
return retval;
}
static PyObject *
HistogramAttributes_SetSpecifyRange(PyObject *self, PyObject *args)
{
......@@ -279,39 +362,6 @@ HistogramAttributes_GetNumBins(PyObject *self, PyObject *args)
return retval;
}
static PyObject *
HistogramAttributes_SetTwoDAmount(PyObject *self, PyObject *args)
{
HistogramAttributesObject *obj = (HistogramAttributesObject *)self;
int ival;
if(!PyArg_ParseTuple(args, "i", &ival))
return NULL;
// Set the twoDAmount in the object.
if(ival >= 0 && ival < 2)
obj->data->SetTwoDAmount(HistogramAttributes::TwoDAmount(ival));
else
{
fprintf(stderr, "An invalid twoDAmount value was given. "
"Valid values are in the range of [0,1]. "
"You can also use the following names: "
"Area, RevolvedVolume.");
return NULL;
}
Py_INCREF(Py_None);
return Py_None;
}
static PyObject *
HistogramAttributes_GetTwoDAmount(PyObject *self, PyObject *args)
{
HistogramAttributesObject *obj = (HistogramAttributesObject *)self;
PyObject *retval = PyInt_FromLong(long(obj->data->GetTwoDAmount()));
return retval;
}
static PyObject *
HistogramAttributes_SetDomain(PyObject *self, PyObject *args)
{
......@@ -557,6 +607,10 @@ static struct PyMethodDef HistogramAttributes_methods[] = {
{"Notify", HistogramAttributes_Notify, METH_VARARGS},
{"SetBasedOn", HistogramAttributes_SetBasedOn, METH_VARARGS},
{"GetBasedOn", HistogramAttributes_GetBasedOn, METH_VARARGS},
{"SetHistogramType", HistogramAttributes_SetHistogramType, METH_VARARGS},
{"GetHistogramType", HistogramAttributes_GetHistogramType, METH_VARARGS},
{"SetTwoDAmount", HistogramAttributes_SetTwoDAmount, METH_VARARGS},
{"GetTwoDAmount", HistogramAttributes_GetTwoDAmount, METH_VARARGS},
{"SetSpecifyRange", HistogramAttributes_SetSpecifyRange, METH_VARARGS},
{"GetSpecifyRange", HistogramAttributes_GetSpecifyRange, METH_VARARGS},
{"SetMin", HistogramAttributes_SetMin, METH_VARARGS},
......@@ -565,8 +619,6 @@ static struct PyMethodDef HistogramAttributes_methods[] = {
{"GetMax", HistogramAttributes_GetMax, METH_VARARGS},
{"SetNumBins", HistogramAttributes_SetNumBins, METH_VARARGS},
{"GetNumBins", HistogramAttributes_GetNumBins, METH_VARARGS},
{"SetTwoDAmount", HistogramAttributes_SetTwoDAmount, METH_VARARGS},
{"GetTwoDAmount", HistogramAttributes_GetTwoDAmount, METH_VARARGS},
{"SetDomain", HistogramAttributes_SetDomain, METH_VARARGS},
{"GetDomain", HistogramAttributes_GetDomain, METH_VARARGS},
{"SetZone", HistogramAttributes_SetZone, METH_VARARGS},
......@@ -614,6 +666,22 @@ HistogramAttributes_getattr(PyObject *self, char *name)
else if(strcmp(name, "ManyZonesForSingleVar") == 0)