Commit 94dc3a3c authored by pugmire's avatar pugmire
Browse files

Line/point render styles for plots.



git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@11803 18c085ea-50e0-402c-830e-de6fd14e8384
parent a3b8129b
......@@ -199,7 +199,6 @@ PoincareAttributes::PoincareAttsRequireRecalculation(const PoincareAttributes &o
singlePlane != obj.singlePlane ||
showLines != obj.showLines ||
showPoints != obj.showPoints ||
pointSize != obj.pointSize;
showPoints != obj.showPoints;
}
......@@ -183,12 +183,20 @@
<Field name="lineWidth" label="Line width" type="linewidth">
0
</Field>
<Field name="lineStyle" label="lineStyle" type="linestyle">
</Field>
<Field name="showPoints" label="Show Points" type="bool">
false
</Field>
<Field name="pointSize" label="size" type="int">
<Field name="pointSize" label="pointSize" type="double">
1.000000
</Field>
<Field name="pointSizePixels" label="pointSizePixels" type="int">
1
</Field>
<Field name="pointType" label="pointType" type="int">
0
</Field>
<Field name="legendFlag" label="Legend" type="bool">
true
</Field>
......
......@@ -408,6 +408,8 @@ void PoincareAttributes::Init()
lineWidth = 0;
showPoints = false;
pointSize = 1;
pointSizePixels = 1;
pointType = 0;
legendFlag = true;
lightingFlag = true;
streamlineAlgorithmType = LoadOnDemand;
......@@ -484,8 +486,11 @@ void PoincareAttributes::Copy(const PoincareAttributes &obj)
showRidgelines = obj.showRidgelines;
showLines = obj.showLines;
lineWidth = obj.lineWidth;
lineStyle = obj.lineStyle;
showPoints = obj.showPoints;
pointSize = obj.pointSize;
pointSizePixels = obj.pointSizePixels;
pointType = obj.pointType;
legendFlag = obj.legendFlag;
lightingFlag = obj.lightingFlag;
streamlineAlgorithmType = obj.streamlineAlgorithmType;
......@@ -706,8 +711,11 @@ PoincareAttributes::operator == (const PoincareAttributes &obj) const
(showRidgelines == obj.showRidgelines) &&
(showLines == obj.showLines) &&
(lineWidth == obj.lineWidth) &&
(lineStyle == obj.lineStyle) &&
(showPoints == obj.showPoints) &&
(pointSize == obj.pointSize) &&
(pointSizePixels == obj.pointSizePixels) &&
(pointType == obj.pointType) &&
(legendFlag == obj.legendFlag) &&
(lightingFlag == obj.lightingFlag) &&
(streamlineAlgorithmType == obj.streamlineAlgorithmType) &&
......@@ -922,8 +930,11 @@ PoincareAttributes::SelectAll()
Select(ID_showRidgelines, (void *)&showRidgelines);
Select(ID_showLines, (void *)&showLines);
Select(ID_lineWidth, (void *)&lineWidth);
Select(ID_lineStyle, (void *)&lineStyle);
Select(ID_showPoints, (void *)&showPoints);
Select(ID_pointSize, (void *)&pointSize);
Select(ID_pointSizePixels, (void *)&pointSizePixels);
Select(ID_pointType, (void *)&pointType);
Select(ID_legendFlag, (void *)&legendFlag);
Select(ID_lightingFlag, (void *)&lightingFlag);
Select(ID_streamlineAlgorithmType, (void *)&streamlineAlgorithmType);
......@@ -1204,6 +1215,12 @@ PoincareAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool for
node->AddNode(new DataNode("lineWidth", lineWidth));
}
if(completeSave || !FieldsEqual(ID_lineStyle, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("lineStyle", lineStyle));
}
if(completeSave || !FieldsEqual(ID_showPoints, &defaultObject))
{
addToParent = true;
......@@ -1216,6 +1233,18 @@ PoincareAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool for
node->AddNode(new DataNode("pointSize", pointSize));
}
if(completeSave || !FieldsEqual(ID_pointSizePixels, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("pointSizePixels", pointSizePixels));
}
if(completeSave || !FieldsEqual(ID_pointType, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("pointType", pointType));
}
if(completeSave || !FieldsEqual(ID_legendFlag, &defaultObject))
{
addToParent = true;
......@@ -1466,10 +1495,16 @@ PoincareAttributes::SetFromNode(DataNode *parentNode)
SetShowLines(node->AsBool());
if((node = searchNode->GetNode("lineWidth")) != 0)
SetLineWidth(node->AsInt());
if((node = searchNode->GetNode("lineStyle")) != 0)
SetLineStyle(node->AsInt());
if((node = searchNode->GetNode("showPoints")) != 0)
SetShowPoints(node->AsBool());
if((node = searchNode->GetNode("pointSize")) != 0)
SetPointSize(node->AsInt());
SetPointSize(node->AsDouble());
if((node = searchNode->GetNode("pointSizePixels")) != 0)
SetPointSizePixels(node->AsInt());
if((node = searchNode->GetNode("pointType")) != 0)
SetPointType(node->AsInt());
if((node = searchNode->GetNode("legendFlag")) != 0)
SetLegendFlag(node->AsBool());
if((node = searchNode->GetNode("lightingFlag")) != 0)
......@@ -1788,6 +1823,13 @@ PoincareAttributes::SetLineWidth(int lineWidth_)
Select(ID_lineWidth, (void *)&lineWidth);
}
void
PoincareAttributes::SetLineStyle(int lineStyle_)
{
lineStyle = lineStyle_;
Select(ID_lineStyle, (void *)&lineStyle);
}
void
PoincareAttributes::SetShowPoints(bool showPoints_)
{
......@@ -1796,12 +1838,26 @@ PoincareAttributes::SetShowPoints(bool showPoints_)
}
void
PoincareAttributes::SetPointSize(int pointSize_)
PoincareAttributes::SetPointSize(double pointSize_)
{
pointSize = pointSize_;
Select(ID_pointSize, (void *)&pointSize);
}
void
PoincareAttributes::SetPointSizePixels(int pointSizePixels_)
{
pointSizePixels = pointSizePixels_;
Select(ID_pointSizePixels, (void *)&pointSizePixels);
}
void
PoincareAttributes::SetPointType(int pointType_)
{
pointType = pointType_;
Select(ID_pointType, (void *)&pointType);
}
void
PoincareAttributes::SetLegendFlag(bool legendFlag_)
{
......@@ -2118,18 +2174,36 @@ PoincareAttributes::GetLineWidth() const
return lineWidth;
}
int
PoincareAttributes::GetLineStyle() const
{
return lineStyle;
}
bool
PoincareAttributes::GetShowPoints() const
{
return showPoints;
}
int
double
PoincareAttributes::GetPointSize() const
{
return pointSize;
}
int
PoincareAttributes::GetPointSizePixels() const
{
return pointSizePixels;
}
int
PoincareAttributes::GetPointType() const
{
return pointType;
}
bool
PoincareAttributes::GetLegendFlag() const
{
......@@ -2264,8 +2338,11 @@ PoincareAttributes::GetFieldName(int index) const
case ID_showRidgelines: return "showRidgelines";
case ID_showLines: return "showLines";
case ID_lineWidth: return "lineWidth";
case ID_lineStyle: return "lineStyle";
case ID_showPoints: return "showPoints";
case ID_pointSize: return "pointSize";
case ID_pointSizePixels: return "pointSizePixels";
case ID_pointType: return "pointType";
case ID_legendFlag: return "legendFlag";
case ID_lightingFlag: return "lightingFlag";
case ID_streamlineAlgorithmType: return "streamlineAlgorithmType";
......@@ -2336,8 +2413,11 @@ PoincareAttributes::GetFieldType(int index) const
case ID_showRidgelines: return FieldType_bool;
case ID_showLines: return FieldType_bool;
case ID_lineWidth: return FieldType_linewidth;
case ID_lineStyle: return FieldType_linestyle;
case ID_showPoints: return FieldType_bool;
case ID_pointSize: return FieldType_int;
case ID_pointSize: return FieldType_double;
case ID_pointSizePixels: return FieldType_int;
case ID_pointType: return FieldType_int;
case ID_legendFlag: return FieldType_bool;
case ID_lightingFlag: return FieldType_bool;
case ID_streamlineAlgorithmType: return FieldType_enum;
......@@ -2408,8 +2488,11 @@ PoincareAttributes::GetFieldTypeName(int index) const
case ID_showRidgelines: return "bool";
case ID_showLines: return "bool";
case ID_lineWidth: return "linewidth";
case ID_lineStyle: return "linestyle";
case ID_showPoints: return "bool";
case ID_pointSize: return "int";
case ID_pointSize: return "double";
case ID_pointSizePixels: return "int";
case ID_pointType: return "int";
case ID_legendFlag: return "bool";
case ID_lightingFlag: return "bool";
case ID_streamlineAlgorithmType: return "enum";
......@@ -2657,6 +2740,11 @@ PoincareAttributes::FieldsEqual(int index_, const AttributeGroup *rhs) const
retval = (lineWidth == obj.lineWidth);
}
break;
case ID_lineStyle:
{ // new scope
retval = (lineStyle == obj.lineStyle);
}
break;
case ID_showPoints:
{ // new scope
retval = (showPoints == obj.showPoints);
......@@ -2667,6 +2755,16 @@ PoincareAttributes::FieldsEqual(int index_, const AttributeGroup *rhs) const
retval = (pointSize == obj.pointSize);
}
break;
case ID_pointSizePixels:
{ // new scope
retval = (pointSizePixels == obj.pointSizePixels);
}
break;
case ID_pointType:
{ // new scope
retval = (pointType == obj.pointType);
}
break;
case ID_legendFlag:
{ // new scope
retval = (legendFlag == obj.legendFlag);
......@@ -2814,7 +2912,6 @@ PoincareAttributes::PoincareAttsRequireRecalculation(const PoincareAttributes &o
singlePlane != obj.singlePlane ||
showLines != obj.showLines ||
showPoints != obj.showPoints ||
pointSize != obj.pointSize;
showPoints != obj.showPoints;
}
......@@ -189,8 +189,11 @@ public:
void SetShowRidgelines(bool showRidgelines_);
void SetShowLines(bool showLines_);
void SetLineWidth(int lineWidth_);
void SetLineStyle(int lineStyle_);
void SetShowPoints(bool showPoints_);
void SetPointSize(int pointSize_);
void SetPointSize(double pointSize_);
void SetPointSizePixels(int pointSizePixels_);
void SetPointType(int pointType_);
void SetLegendFlag(bool legendFlag_);
void SetLightingFlag(bool lightingFlag_);
void SetStreamlineAlgorithmType(StreamlineAlgorithmType streamlineAlgorithmType_);
......@@ -244,8 +247,11 @@ public:
bool GetShowRidgelines() const;
bool GetShowLines() const;
int GetLineWidth() const;
int GetLineStyle() const;
bool GetShowPoints() const;
int GetPointSize() const;
double GetPointSize() const;
int GetPointSizePixels() const;
int GetPointType() const;
bool GetLegendFlag() const;
bool GetLightingFlag() const;
StreamlineAlgorithmType GetStreamlineAlgorithmType() const;
......@@ -352,8 +358,11 @@ public:
ID_showRidgelines,
ID_showLines,
ID_lineWidth,
ID_lineStyle,
ID_showPoints,
ID_pointSize,
ID_pointSizePixels,
ID_pointType,
ID_legendFlag,
ID_lightingFlag,
ID_streamlineAlgorithmType,
......@@ -404,8 +413,11 @@ private:
bool showRidgelines;
bool showLines;
int lineWidth;
int lineStyle;
bool showPoints;
int pointSize;
double pointSize;
int pointSizePixels;
int pointType;
bool legendFlag;
bool lightingFlag;
int streamlineAlgorithmType;
......@@ -417,6 +429,6 @@ private:
static const char *TypeMapFormatString;
static const private_tmfs_t TmfsStruct;
};
#define POINCAREATTRIBUTES_TMFS "idiiiDDDiidddiiddiiiidddbbiasibibibbbbbibibbiiii"
#define POINCAREATTRIBUTES_TMFS "idiiiDDDiidddiiddiiiidddbbiasibibibbbbbiibdiibbiiii"
#endif
......@@ -60,7 +60,7 @@ import llnl.visit.ColorAttribute;
public class PoincareAttributes extends AttributeSubject implements Plugin
{
private static int PoincareAttributes_numAdditionalAtts = 48;
private static int PoincareAttributes_numAdditionalAtts = 51;
// Enum values
public final static int SOURCETYPE_SPECIFIEDPOINT = 0;
......@@ -156,8 +156,11 @@ public class PoincareAttributes extends AttributeSubject implements Plugin
showRidgelines = false;
showLines = true;
lineWidth = 0;
lineStyle = 0;
showPoints = false;
pointSize = 1;
pointSizePixels = 1;
pointType = 0;
legendFlag = true;
lightingFlag = true;
streamlineAlgorithmType = STREAMLINEALGORITHMTYPE_LOADONDEMAND;
......@@ -219,8 +222,11 @@ public class PoincareAttributes extends AttributeSubject implements Plugin
showRidgelines = false;
showLines = true;
lineWidth = 0;
lineStyle = 0;
showPoints = false;
pointSize = 1;
pointSizePixels = 1;
pointType = 0;
legendFlag = true;
lightingFlag = true;
streamlineAlgorithmType = STREAMLINEALGORITHMTYPE_LOADONDEMAND;
......@@ -287,8 +293,11 @@ public class PoincareAttributes extends AttributeSubject implements Plugin
showRidgelines = obj.showRidgelines;
showLines = obj.showLines;
lineWidth = obj.lineWidth;
lineStyle = obj.lineStyle;
showPoints = obj.showPoints;
pointSize = obj.pointSize;
pointSizePixels = obj.pointSizePixels;
pointType = obj.pointType;
legendFlag = obj.legendFlag;
lightingFlag = obj.lightingFlag;
streamlineAlgorithmType = obj.streamlineAlgorithmType;
......@@ -369,8 +378,11 @@ public class PoincareAttributes extends AttributeSubject implements Plugin
(showRidgelines == obj.showRidgelines) &&
(showLines == obj.showLines) &&
(lineWidth == obj.lineWidth) &&
(lineStyle == obj.lineStyle) &&
(showPoints == obj.showPoints) &&
(pointSize == obj.pointSize) &&
(pointSizePixels == obj.pointSizePixels) &&
(pointType == obj.pointType) &&
(legendFlag == obj.legendFlag) &&
(lightingFlag == obj.lightingFlag) &&
(streamlineAlgorithmType == obj.streamlineAlgorithmType) &&
......@@ -653,52 +665,70 @@ public class PoincareAttributes extends AttributeSubject implements Plugin
Select(39);
}
public void SetLineStyle(int lineStyle_)
{
lineStyle = lineStyle_;
Select(40);
}
public void SetShowPoints(boolean showPoints_)
{
showPoints = showPoints_;
Select(40);
Select(41);
}
public void SetPointSize(int pointSize_)
public void SetPointSize(double pointSize_)
{
pointSize = pointSize_;
Select(41);
Select(42);
}
public void SetPointSizePixels(int pointSizePixels_)
{
pointSizePixels = pointSizePixels_;
Select(43);
}
public void SetPointType(int pointType_)
{
pointType = pointType_;
Select(44);
}
public void SetLegendFlag(boolean legendFlag_)
{
legendFlag = legendFlag_;
Select(42);
Select(45);
}
public void SetLightingFlag(boolean lightingFlag_)
{
lightingFlag = lightingFlag_;
Select(43);
Select(46);
}
public void SetStreamlineAlgorithmType(int streamlineAlgorithmType_)
{
streamlineAlgorithmType = streamlineAlgorithmType_;
Select(44);
Select(47);
}
public void SetMaxStreamlineProcessCount(int maxStreamlineProcessCount_)
{
maxStreamlineProcessCount = maxStreamlineProcessCount_;
Select(45);
Select(48);
}
public void SetMaxDomainCacheSize(int maxDomainCacheSize_)
{
maxDomainCacheSize = maxDomainCacheSize_;
Select(46);
Select(49);
}
public void SetWorkGroupSize(int workGroupSize_)
{
workGroupSize = workGroupSize_;
Select(47);
Select(50);
}
// Property getting methods
......@@ -742,8 +772,11 @@ public class PoincareAttributes extends AttributeSubject implements Plugin
public boolean GetShowRidgelines() { return showRidgelines; }
public boolean GetShowLines() { return showLines; }
public int GetLineWidth() { return lineWidth; }
public int GetLineStyle() { return lineStyle; }
public boolean GetShowPoints() { return showPoints; }
public int GetPointSize() { return pointSize; }
public double GetPointSize() { return pointSize; }
public int GetPointSizePixels() { return pointSizePixels; }
public int GetPointType() { return pointType; }
public boolean GetLegendFlag() { return legendFlag; }
public boolean GetLightingFlag() { return lightingFlag; }
public int GetStreamlineAlgorithmType() { return streamlineAlgorithmType; }
......@@ -835,20 +868,26 @@ public class PoincareAttributes extends AttributeSubject implements Plugin
if(WriteSelect(39, buf))
buf.WriteInt(lineWidth);
if(WriteSelect(40, buf))
buf.WriteBool(showPoints);
buf.WriteInt(lineStyle);
if(WriteSelect(41, buf))
buf.WriteInt(pointSize);
buf.WriteBool(showPoints);
if(WriteSelect(42, buf))
buf.WriteBool(legendFlag);
buf.WriteDouble(pointSize);
if(WriteSelect(43, buf))
buf.WriteBool(lightingFlag);
buf.WriteInt(pointSizePixels);
if(WriteSelect(44, buf))
buf.WriteInt(streamlineAlgorithmType);
buf.WriteInt(pointType);
if(WriteSelect(45, buf))
buf.WriteInt(maxStreamlineProcessCount);
buf.WriteBool(legendFlag);
if(WriteSelect(46, buf))
buf.WriteInt(maxDomainCacheSize);
buf.WriteBool(lightingFlag);
if(WriteSelect(47, buf))
buf.WriteInt(streamlineAlgorithmType);
if(WriteSelect(48, buf))
buf.WriteInt(maxStreamlineProcessCount);
if(WriteSelect(49, buf))
buf.WriteInt(maxDomainCacheSize);
if(WriteSelect(50, buf))
buf.WriteInt(workGroupSize);
}
......@@ -978,27 +1017,36 @@ public class PoincareAttributes extends AttributeSubject implements Plugin
SetLineWidth(buf.ReadInt());
break;
case 40:
SetShowPoints(buf.ReadBool());
SetLineStyle(buf.ReadInt());
break;
case 41:
SetPointSize(buf.ReadInt());
SetShowPoints(buf.ReadBool());
break;
case 42:
SetLegendFlag(buf.ReadBool());
SetPointSize(buf.ReadDouble());
break;
case 43:
SetLightingFlag(buf.ReadBool());
SetPointSizePixels(buf.ReadInt());
break;
case 44:
SetStreamlineAlgorithmType(buf.ReadInt());
SetPointType(buf.ReadInt());
break;
case 45:
SetMaxStreamlineProcessCount(buf.ReadInt());
SetLegendFlag(buf.ReadBool());
break;
case 46:
SetMaxDomainCacheSize(buf.ReadInt());
SetLightingFlag(buf.ReadBool());
break;
case 47:
SetStreamlineAlgorithmType(buf.ReadInt());
break;
case 48:
SetMaxStreamlineProcessCount(buf.ReadInt());
break;
case 49:
SetMaxDomainCacheSize(buf.ReadInt());
break;
case 50:
SetWorkGroupSize(buf.ReadInt());
break;
}
......@@ -1110,8 +1158,11 @@ public class PoincareAttributes extends AttributeSubject implements Plugin
str = str + boolToString("showRidgelines", showRidgelines, indent) + "\n";
str = str + boolToString("showLines", showLines, indent) + "\n";
str = str + intToString("lineWidth", lineWidth, indent) + "\n";
str = str + intToString("lineStyle", lineStyle, indent) + "\n";
str = str + boolToString("showPoints", showPoints, indent) + "\n";
str = str + intToString("pointSize", pointSize, indent) + "\n";
str = str + doubleToString("pointSize", pointSize, indent) + "\n";
str = str + intToString("pointSizePixels", pointSizePixels, indent) + "\n";
str = str + intToString("pointType", pointType, indent) + "\n";
str = str + boolToString("legendFlag", legendFlag, indent) + "\n";
str = str + boolToString("lightingFlag", lightingFlag, indent) + "\n";
str = str + indent + "streamlineAlgorithmType = ";
......@@ -1170,8 +1221,11 @@ public class PoincareAttributes extends AttributeSubject implements Plugin
private boolean showRidgelines;
private boolean showLines;
private int lineWidth;
private int lineStyle;
private boolean showPoints;
private int pointSize;
private double pointSize;
private int pointSizePixels;
private int pointType;
private boolean legendFlag;
private boolean lightingFlag;
private int streamlineAlgorithmType;
......
......@@ -376,12 +376,19 @@ PyPoincareAttributes_ToString(const PoincareAttributes *atts, const char *prefix
str += tmpStr;
SNPRINTF(tmpStr, 1000, "%slineWidth = %d\n", prefix, atts->GetLineWidth());
str += tmpStr;
const char *lineStyle_values[] = {"SOLID", "DASH", "DOT", "DOTDASH"};
SNPRINTF(tmpStr, 1000, "%slineStyle = %s%s # SOLID, DASH, DOT, DOTDASH\n", prefix, prefix, lineStyle_values[atts->GetLineStyle()]);
str += tmpStr;
if(atts->GetShowPoints())
SNPRINTF(tmpStr, 1000, "%sshowPoints = 1\n", prefix);
else
SNPRINTF(tmpStr, 1000, "%sshowPoints = 0\n", prefix);
str += tmpStr;
SNPRINTF(tmpStr, 1000, "%spointSize = %d\n", prefix, atts->GetPointSize());
SNPRINTF(tmpStr, 1000, "%spointSize = %g\n", prefix, atts->GetPointSize());
str += tmpStr;
SNPRINTF(tmpStr, 1000, "%spointSizePixels = %d\n", prefix, atts->GetPointSizePixels());
str += tmpStr;
SNPRINTF(tmpStr, 1000, "%spointType = %d\n", prefix, atts->GetPointType());
str += tmpStr;
if(atts->GetLegendFlag())
SNPRINTF(tmpStr, 1000, "%slegendFlag = 1\n", prefix);
......@@ -1599,6 +1606,39 @@ PoincareAttributes_GetLineWidth(PyObject *self, PyObject *args)
return retval;
}