Commit 1a45af9e authored by pugmire's avatar pugmire

Ellipsoid glyphing.


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@11926 18c085ea-50e0-402c-830e-de6fd14e8384
parent c109967b
......@@ -200,6 +200,21 @@ PyVectorAttributes_ToString(const VectorAttributes *atts, const char *prefix)
else
SNPRINTF(tmpStr, 1000, "%sorigOnly = 0\n", prefix);
str += tmpStr;
const char *glyphType_names = "Arrow, Ellipsoid";
switch (atts->GetGlyphType())
{
case VectorAttributes::Arrow:
SNPRINTF(tmpStr, 1000, "%sglyphType = %sArrow # %s\n", prefix, prefix, glyphType_names);
str += tmpStr;
break;
case VectorAttributes::Ellipsoid:
SNPRINTF(tmpStr, 1000, "%sglyphType = %sEllipsoid # %s\n", prefix, prefix, glyphType_names);
str += tmpStr;
break;
default:
break;
}
return str;
}
......@@ -877,6 +892,39 @@ VectorAttributes_GetOrigOnly(PyObject *self, PyObject *args)
return retval;
}
/*static*/ PyObject *
VectorAttributes_SetGlyphType(PyObject *self, PyObject *args)
{
VectorAttributesObject *obj = (VectorAttributesObject *)self;
int ival;
if(!PyArg_ParseTuple(args, "i", &ival))
return NULL;
// Set the glyphType in the object.
if(ival >= 0 && ival < 2)
obj->data->SetGlyphType(VectorAttributes::GlyphType(ival));
else
{
fprintf(stderr, "An invalid glyphType value was given. "
"Valid values are in the range of [0,1]. "
"You can also use the following names: "
"Arrow, Ellipsoid.");
return NULL;
}
Py_INCREF(Py_None);
return Py_None;
}
/*static*/ PyObject *
VectorAttributes_GetGlyphType(PyObject *self, PyObject *args)
{
VectorAttributesObject *obj = (VectorAttributesObject *)self;
PyObject *retval = PyInt_FromLong(long(obj->data->GetGlyphType()));
return retval;
}
PyMethodDef PyVectorAttributes_methods[VECTORATTRIBUTES_NMETH] = {
......@@ -929,6 +977,8 @@ PyMethodDef PyVectorAttributes_methods[VECTORATTRIBUTES_NMETH] = {
{"GetStemWidth", VectorAttributes_GetStemWidth, METH_VARARGS},
{"SetOrigOnly", VectorAttributes_SetOrigOnly, METH_VARARGS},
{"GetOrigOnly", VectorAttributes_GetOrigOnly, METH_VARARGS},
{"SetGlyphType", VectorAttributes_SetGlyphType, METH_VARARGS},
{"GetGlyphType", VectorAttributes_GetGlyphType, METH_VARARGS},
{NULL, NULL}
};
......@@ -1031,6 +1081,13 @@ PyVectorAttributes_getattr(PyObject *self, char *name)
return VectorAttributes_GetStemWidth(self, NULL);
if(strcmp(name, "origOnly") == 0)
return VectorAttributes_GetOrigOnly(self, NULL);
if(strcmp(name, "glyphType") == 0)
return VectorAttributes_GetGlyphType(self, NULL);
if(strcmp(name, "Arrow") == 0)
return PyInt_FromLong(long(VectorAttributes::Arrow));
if(strcmp(name, "Ellipsoid") == 0)
return PyInt_FromLong(long(VectorAttributes::Ellipsoid));
// Try and handle legacy fields in VectorAttributes
if(strcmp(name, "highQuality") == 0)
......@@ -1100,6 +1157,8 @@ PyVectorAttributes_setattr(PyObject *self, char *name, PyObject *args)
obj = VectorAttributes_SetStemWidth(self, tuple);
else if(strcmp(name, "origOnly") == 0)
obj = VectorAttributes_SetOrigOnly(self, tuple);
else if(strcmp(name, "glyphType") == 0)
obj = VectorAttributes_SetGlyphType(self, tuple);
// Try and handle legacy fields in VectorAttributes
if(obj == NULL)
......
......@@ -44,7 +44,7 @@
//
// Functions exposed to the VisIt module.
//
#define VECTORATTRIBUTES_NMETH 50
#define VECTORATTRIBUTES_NMETH 52
void PyVectorAttributes_StartUp(VectorAttributes *subj, void *data);
void PyVectorAttributes_CloseDown();
PyMethodDef * PyVectorAttributes_GetMethodTable(int *nMethods);
......
......@@ -173,6 +173,9 @@ QvisVectorPlotWindow::~QvisVectorPlotWindow()
// Allen Sanderson, Sun Mar 7 12:49:56 PST 2010
// Change layout of window for 2.0 interface changes.
//
// Dave Pugmire, Mon Jul 19 09:38:17 EDT 2010
// Add ellipsoid glyphing.
//
// ****************************************************************************
void
......@@ -365,60 +368,72 @@ QvisVectorPlotWindow::CreateWindowContents()
styleLayout->setMargin(5);
styleLayout->setSpacing(10);
styleLayout->setColumnStretch(1, 10);
int row = 0;
glyphTypeLabel = new QLabel(tr("Glyph type"), styleGroupBox);
styleLayout->addWidget(glyphTypeLabel, row, 0);
glyphType = new QComboBox(styleGroupBox);
glyphType->addItem(tr("Arrow"));
glyphType->addItem(tr("Ellipsoid"));
connect(glyphType, SIGNAL(activated(int)), this, SLOT(glyphTypeChanged(int)));
styleLayout->addWidget(glyphType, row, 1);
row++;
// Create the line stem method radio buttons
lineStemButtonGroup = new QButtonGroup(styleGroupBox);
connect(lineStemButtonGroup, SIGNAL(buttonClicked(int)),
this, SLOT(lineStemMethodChanged(int)));
rb = new QRadioButton(tr("Line"), styleGroupBox);
lineStemButtonGroup->addButton(rb, 0);
styleLayout->addWidget(rb, 0, 0);
rb = new QRadioButton(tr("Cylinder"), styleGroupBox);
lineStemButtonGroup->addButton(rb, 1);
styleLayout->addWidget(rb, 1, 0);
styleLayout->addWidget(rb, row, 0);
// Create the lineStyle widget.
lineStyleLabel = new QLabel(tr("Style"), styleGroupBox);
styleLayout->addWidget(lineStyleLabel, row, 1);
lineStyle = new QvisLineStyleWidget(0, styleGroupBox);
styleLayout->addWidget(lineStyle, 0, 2);
styleLayout->addWidget(lineStyle, row, 2);
lineStyleLabel->setBuddy(lineStyle);
connect(lineStyle, SIGNAL(lineStyleChanged(int)),
this, SLOT(lineStyleChanged(int)));
lineStyleLabel = new QLabel(tr("Style"), styleGroupBox);
lineStyleLabel->setBuddy(lineStyle);
styleLayout->addWidget(lineStyleLabel, 0, 1);
// Create the lineWidth widget.
lineWidthLabel = new QLabel(tr("Width"), styleGroupBox);
styleLayout->addWidget(lineWidthLabel, row, 3);
lineWidth = new QvisLineWidthWidget(0, styleGroupBox);
styleLayout->addWidget(lineWidth, 0, 4);
styleLayout->addWidget(lineWidth, row, 4);
connect(lineWidth, SIGNAL(lineWidthChanged(int)),
this, SLOT(lineWidthChanged(int)));
lineWidthLabel = new QLabel(tr("Width"), styleGroupBox);
lineWidthLabel->setBuddy(lineWidth);
styleLayout->addWidget(lineWidthLabel, 0, 3);
row++;
rb = new QRadioButton(tr("Cylinder"), styleGroupBox);
lineStemButtonGroup->addButton(rb, 1);
styleLayout->addWidget(rb, row, 0);
// Add the stem width edit.
stemWidthEdit = new QLineEdit(styleGroupBox);
connect(stemWidthEdit, SIGNAL(returnPressed()),
this, SLOT(processStemWidthText()));
styleLayout->addWidget(stemWidthEdit, 1, 2);
styleLayout->addWidget(stemWidthEdit, row, 2);
stemWidthLabel = new QLabel(tr("Width"), styleGroupBox);
stemWidthLabel->setBuddy(stemWidthEdit);
styleLayout->addWidget(stemWidthLabel, 1, 1);
styleLayout->addWidget(stemWidthLabel, row, 1);
row++;
// Add the "draw head" toggle button.
drawHeadToggle = new QCheckBox(tr("Draw head"), styleGroupBox);
connect(drawHeadToggle, SIGNAL(clicked(bool)),
this, SLOT(drawHeadToggled(bool)));
styleLayout->addWidget(drawHeadToggle, 4, 0);
styleLayout->addWidget(drawHeadToggle, row, 0);
// Add the head size edit.
headSizeLineEdit = new QLineEdit(styleGroupBox);
connect(headSizeLineEdit, SIGNAL(returnPressed()),
this, SLOT(processHeadSizeText()));
styleLayout->addWidget(headSizeLineEdit, 4, 2);
styleLayout->addWidget(headSizeLineEdit, row, 2);
QLabel *headSizeLabel = new QLabel(tr("Size"), styleGroupBox);
headSizeLabel->setBuddy(headSizeLineEdit);
styleLayout->addWidget(headSizeLabel, 4, 1);
styleLayout->addWidget(headSizeLabel, row, 1);
row++;
//
// Create the radio buttons to choose the glyph origin
......@@ -442,8 +457,8 @@ QvisVectorPlotWindow::CreateWindowContents()
rb = new QRadioButton(tr("Tail"), originBox);
originButtonGroup->addButton(rb,2);
originLayout->addWidget(rb);
styleLayout->addWidget(originBox, 3, 0, 1, 3);
styleLayout->addWidget(originBox, row, 0, 1, 3);
row++;
//
// Create the geometry group
......@@ -545,6 +560,9 @@ QvisVectorPlotWindow::CreateWindowContents()
// Brad Whitlock, Tue Jul 29 11:07:34 PDT 2008
// Qt 4.
//
// Dave Pugmire, Mon Jul 19 09:38:17 EDT 2010
// Add ellipsoid glyphing.
//
// ****************************************************************************
void
......@@ -562,7 +580,7 @@ QvisVectorPlotWindow::UpdateWindow(bool doAll)
if(!vectorAtts->IsSelected(i))
continue;
}
switch(i)
{
case VectorAttributes::ID_useStride:
......@@ -711,6 +729,37 @@ QvisVectorPlotWindow::UpdateWindow(bool doAll)
limitToOrigToggle->setChecked(vectorAtts->GetOrigOnly());
limitToOrigToggle->blockSignals(false);
break;
case VectorAttributes::ID_glyphType:
glyphType->blockSignals(true);
if (vectorAtts->GetGlyphType() == VectorAttributes::Arrow)
{
lineStemButtonGroup->button(0)->setEnabled(true);
lineStemButtonGroup->button(1)->setEnabled(true);
drawHeadToggle->setEnabled(true);
headSizeLineEdit->setEnabled(true);
lineWidth->setEnabled(vectorAtts->GetLineStem());
lineStyle->setEnabled(vectorAtts->GetLineStem());
lineWidthLabel->setEnabled(vectorAtts->GetLineStem());
lineStyleLabel->setEnabled(vectorAtts->GetLineStem());
stemWidthEdit->setEnabled(!vectorAtts->GetLineStem());
stemWidthLabel->setEnabled(!vectorAtts->GetLineStem());
}
else if (vectorAtts->GetGlyphType() == VectorAttributes::Ellipsoid)
{
lineStemButtonGroup->button(0)->setEnabled(false);
lineStemButtonGroup->button(1)->setEnabled(false);
drawHeadToggle->setEnabled(false);
headSizeLineEdit->setEnabled(false);
lineWidth->setEnabled(false);
lineStyle->setEnabled(false);
lineWidthLabel->setEnabled(false);
lineStyleLabel->setEnabled(false);
stemWidthEdit->setEnabled(false);
stemWidthLabel->setEnabled(false);
}
glyphType->blockSignals(false);
break;
}
} // end for
}
......@@ -1273,6 +1322,16 @@ QvisVectorPlotWindow::originTypeChanged(int index)
Apply();
}
void
QvisVectorPlotWindow::glyphTypeChanged(int newType)
{
if (newType == 0)
vectorAtts->SetGlyphType(VectorAttributes::Arrow);
else if (newType == 1)
vectorAtts->SetGlyphType(VectorAttributes::Ellipsoid);
Apply();
}
// ****************************************************************************
// Method: QvisVectorPlotWindow::limitsSelectChanged
//
......
......@@ -96,6 +96,9 @@ class VectorAttributes;
// Allen Sanderson, Sun Mar 7 12:49:56 PST 2010
// Change layout of window for 2.0 interface changes.
//
// Dave Pugmire, Mon Jul 19 09:38:17 EDT 2010
// Add ellipsoid glyphing.
//
// ****************************************************************************
class QvisVectorPlotWindow : public QvisPostableWindowObserver
......@@ -132,6 +135,7 @@ private slots:
void colorModeChanged(int);
void colorTableClicked(bool useDefault, const QString &ctName);
void originTypeChanged(int);
void glyphTypeChanged(int newType);
void minToggled(bool on);
void maxToggled(bool on);
......@@ -169,6 +173,8 @@ private:
QButtonGroup *lineStemButtonGroup;
QvisLineStyleWidget *lineStyle;
QvisLineWidthWidget *lineWidth;
QLabel *glyphTypeLabel;
QComboBox *glyphType;
QLabel *lineStyleLabel;
QLabel *lineWidthLabel;
QLineEdit *stemWidthEdit;
......
......@@ -14,6 +14,10 @@
OriginalData
CurrentPlot
</Enum>
<Enum name="GlyphType">
Arrow
Ellipsoid
</Enum>
<Field name="useStride" label="Use stride" type="bool">
false
</Field>
......@@ -89,6 +93,9 @@
<Field name="origOnly" label="Limit to original node/cell" type="bool">
true
</Field>
<Field name="glyphType" label="glyphType" type="enum" subtype="GlyphType">
Arrow
</Field>
<Function name="ChangesRequireRecalculation" user="true" member="true">
</Function>
</Attribute>
......
......@@ -151,6 +151,43 @@ VectorAttributes::LimitsMode_FromString(const std::string &s, VectorAttributes::
return false;
}
//
// Enum conversion methods for VectorAttributes::GlyphType
//
static const char *GlyphType_strings[] = {
"Arrow", "Ellipsoid"};
std::string
VectorAttributes::GlyphType_ToString(VectorAttributes::GlyphType t)
{
int index = int(t);
if(index < 0 || index >= 2) index = 0;
return GlyphType_strings[index];
}
std::string
VectorAttributes::GlyphType_ToString(int t)
{
int index = (t < 0 || t >= 2) ? 0 : t;
return GlyphType_strings[index];
}
bool
VectorAttributes::GlyphType_FromString(const std::string &s, VectorAttributes::GlyphType &val)
{
val = VectorAttributes::Arrow;
for(int i = 0; i < 2; ++i)
{
if(s == GlyphType_strings[i])
{
val = (GlyphType)i;
return true;
}
}
return false;
}
// ****************************************************************************
// Method: VectorAttributes::VectorAttributes
//
......@@ -190,6 +227,7 @@ void VectorAttributes::Init()
geometryQuality = Fast;
stemWidth = 0.08;
origOnly = true;
glyphType = Arrow;
VectorAttributes::SelectAll();
}
......@@ -235,6 +273,7 @@ void VectorAttributes::Copy(const VectorAttributes &obj)
geometryQuality = obj.geometryQuality;
stemWidth = obj.stemWidth;
origOnly = obj.origOnly;
glyphType = obj.glyphType;
VectorAttributes::SelectAll();
}
......@@ -417,7 +456,8 @@ VectorAttributes::operator == (const VectorAttributes &obj) const
(lineStem == obj.lineStem) &&
(geometryQuality == obj.geometryQuality) &&
(stemWidth == obj.stemWidth) &&
(origOnly == obj.origOnly));
(origOnly == obj.origOnly) &&
(glyphType == obj.glyphType));
}
// ****************************************************************************
......@@ -585,6 +625,7 @@ VectorAttributes::SelectAll()
Select(ID_geometryQuality, (void *)&geometryQuality);
Select(ID_stemWidth, (void *)&stemWidth);
Select(ID_origOnly, (void *)&origOnly);
Select(ID_glyphType, (void *)&glyphType);
}
///////////////////////////////////////////////////////////////////////////////
......@@ -763,6 +804,12 @@ VectorAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool force
node->AddNode(new DataNode("origOnly", origOnly));
}
if(completeSave || !FieldsEqual(ID_glyphType, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("glyphType", GlyphType_ToString(glyphType)));
}
// Add the node to the parent node.
if(addToParent || forceAdd)
......@@ -889,6 +936,22 @@ VectorAttributes::SetFromNode(DataNode *parentNode)
SetStemWidth(node->AsDouble());
if((node = searchNode->GetNode("origOnly")) != 0)
SetOrigOnly(node->AsBool());
if((node = searchNode->GetNode("glyphType")) != 0)
{
// Allow enums to be int or string in the config file
if(node->GetNodeType() == INT_NODE)
{
int ival = node->AsInt();
if(ival >= 0 && ival < 2)
SetGlyphType(GlyphType(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
GlyphType value;
if(GlyphType_FromString(node->AsString(), value))
SetGlyphType(value);
}
}
}
///////////////////////////////////////////////////////////////////////////////
......@@ -1063,6 +1126,13 @@ VectorAttributes::SetOrigOnly(bool origOnly_)
Select(ID_origOnly, (void *)&origOnly);
}
void
VectorAttributes::SetGlyphType(VectorAttributes::GlyphType glyphType_)
{
glyphType = glyphType_;
Select(ID_glyphType, (void *)&glyphType);
}
///////////////////////////////////////////////////////////////////////////////
// Get property methods
///////////////////////////////////////////////////////////////////////////////
......@@ -1223,6 +1293,12 @@ VectorAttributes::GetOrigOnly() const
return origOnly;
}
VectorAttributes::GlyphType
VectorAttributes::GetGlyphType() const
{
return GlyphType(glyphType);
}
///////////////////////////////////////////////////////////////////////////////
// Select property methods
///////////////////////////////////////////////////////////////////////////////
......@@ -1287,6 +1363,7 @@ VectorAttributes::GetFieldName(int index) const
case ID_geometryQuality: return "geometryQuality";
case ID_stemWidth: return "stemWidth";
case ID_origOnly: return "origOnly";
case ID_glyphType: return "glyphType";
default: return "invalid index";
}
}
......@@ -1335,6 +1412,7 @@ VectorAttributes::GetFieldType(int index) const
case ID_geometryQuality: return FieldType_enum;
case ID_stemWidth: return FieldType_double;
case ID_origOnly: return FieldType_bool;
case ID_glyphType: return FieldType_enum;
default: return FieldType_unknown;
}
}
......@@ -1383,6 +1461,7 @@ VectorAttributes::GetFieldTypeName(int index) const
case ID_geometryQuality: return "enum";
case ID_stemWidth: return "double";
case ID_origOnly: return "bool";
case ID_glyphType: return "enum";
default: return "invalid index";
}
}
......@@ -1529,6 +1608,11 @@ VectorAttributes::FieldsEqual(int index_, const AttributeGroup *rhs) const
retval = (origOnly == obj.origOnly);
}
break;
case ID_glyphType:
{ // new scope
retval = (glyphType == obj.glyphType);
}
break;
default: retval = false;
}
......
......@@ -77,6 +77,11 @@ public:
OriginalData,
CurrentPlot
};
enum GlyphType
{
Arrow,
Ellipsoid
};
// These constructors are for objects of this class
VectorAttributes();
......@@ -131,6 +136,7 @@ public:
void SetGeometryQuality(Quality geometryQuality_);
void SetStemWidth(double stemWidth_);
void SetOrigOnly(bool origOnly_);
void SetGlyphType(GlyphType glyphType_);
// Property getting methods
bool GetUseStride() const;
......@@ -159,6 +165,7 @@ public:
Quality GetGeometryQuality() const;
double GetStemWidth() const;
bool GetOrigOnly() const;
GlyphType GetGlyphType() const;
// Persistence methods
virtual bool CreateNode(DataNode *node, bool completeSave, bool forceAdd);
......@@ -180,6 +187,11 @@ public:
protected:
static std::string LimitsMode_ToString(int);
public:
static std::string GlyphType_ToString(GlyphType);
static bool GlyphType_FromString(const std::string &, GlyphType &);
protected:
static std::string GlyphType_ToString(int);
public:
// Keyframing methods
virtual std::string GetFieldName(int index) const;
......@@ -216,6 +228,7 @@ public:
ID_geometryQuality,
ID_stemWidth,
ID_origOnly,
ID_glyphType,
ID__LAST
};
......@@ -244,11 +257,12 @@ private:
int geometryQuality;
double stemWidth;
bool origOnly;
int glyphType;
// Static class format string for type map.
static const char *TypeMapFormatString;
static const private_tmfs_t TmfsStruct;
};
#define VECTORATTRIBUTES_TMFS "biiiidbbdbbbasibbiddbidb"
#define VECTORATTRIBUTES_TMFS "biiiidbbdbbbasibbiddbidbi"
#endif
......@@ -60,7 +60,7 @@ import llnl.visit.ColorAttribute;
public class VectorAttributes extends AttributeSubject implements Plugin
{
private static int numAdditionalAttributes = 24;
private static int VectorAttributes_numAdditionalAtts = 25;
// Enum values
public final static int QUALITY_FAST = 0;
......@@ -73,10 +73,13 @@ public class VectorAttributes extends AttributeSubject implements Plugin
public final static int LIMITSMODE_ORIGINALDATA = 0;
public final static int LIMITSMODE_CURRENTPLOT = 1;
public final static int GLYPHTYPE_ARROW = 0;
public final static int GLYPHTYPE_ELLIPSOID = 1;
public VectorAttributes()
{
super(numAdditionalAttributes);
super(VectorAttributes_numAdditionalAtts);
useStride = false;
stride = 1;
......@@ -102,11 +105,12 @@ public class VectorAttributes extends AttributeSubject implements Plugin
geometryQuality = QUALITY_FAST;
stemWidth = 0.08;
origOnly = true;
glyphType = GLYPHTYPE_ARROW;
}
public VectorAttributes(int nMoreFields)
{
super(numAdditionalAttributes + nMoreFields);
super(VectorAttributes_numAdditionalAtts + nMoreFields);
useStride = false;
stride = 1;
......@@ -132,11 +136,12 @@ public class VectorAttributes extends AttributeSubject implements Plugin
geometryQuality = QUALITY_FAST;
stemWidth = 0.08;
origOnly = true;
glyphType = GLYPHTYPE_ARROW;
}
public VectorAttributes(VectorAttributes obj)
{
super(numAdditionalAttributes);
super(VectorAttributes_numAdditionalAtts);
useStride = obj.useStride;
stride = obj.stride;
......@@ -162,6 +167,7 @@ public class VectorAttributes extends AttributeSubject implements Plugin
geometryQuality = obj.geometryQuality;
stemWidth = obj.stemWidth;
origOnly = obj.origOnly;
glyphType = obj.glyphType;
SelectAll();
}
......@@ -173,7 +179,7 @@ public class VectorAttributes extends AttributeSubject implements Plugin
public int GetNumAdditionalAttributes()
{
return numAdditionalAttributes;
return VectorAttributes_numAdditionalAtts;
}
public boolean equals(VectorAttributes obj)
......@@ -202,7 +208,8 @@ public class VectorAttributes extends AttributeSubject implements Plugin
(lineStem == obj.lineStem) &&
(geometryQuality == obj.geometryQuality) &&
(stemWidth == obj.stemWidth) &&
(origOnly == obj.origOnly));
(origOnly == obj.origOnly) &&
(glyphType == obj.glyphType));
}
public String GetName() { return "Vector"; }
......@@ -353,6 +360,12 @@ public class VectorAttributes extends AttributeSubject implements Plugin
Select(23);
}
public void SetGlyphType(int glyphType_)
{
glyphType = glyphType_;
Select(24);
}
// Property getting methods
public boolean GetUseStride() { return useStride; }
public int GetStride() { return stride; }
......@@ -378,6 +391,7 @@ public class VectorAttributes extends AttributeSubject implements Plugin
public int GetGeometryQuality() { return geometryQuality; }
public double GetStemWidth() { return stemWidth; }
public boolean GetOrigOnly() { return origOnly; }
public int GetGlyphType() { return glyphType; }
// Write and read methods.
public void WriteAtts(CommunicationBuffer buf)
......@@ -430,6 +444,8 @@ public class VectorAttributes extends AttributeSubject implements Plugin
buf.WriteDouble(stemWidth);
if(WriteSelect(23, buf))
buf.WriteBool(origOnly);
if(WriteSelect(24, buf))
buf.WriteInt(glyphType);
}
public void ReadAtts(int index, CommunicationBuffer buf)
......@@ -509,6 +525,9 @@ public class VectorAttributes extends AttributeSubject implements Plugin
case 23:
SetOrigOnly(buf.ReadBool());
break;
case 24:
SetGlyphType(buf.ReadInt());
break;
}
}
......@@ -556,6 +575,12 @@ public class VectorAttributes extends AttributeSubject implements Plugin
str = str + "\n";
str = str + doubleToString("stemWidth", stemWidth, indent) + "\n";
str = str + boolToString("origOnly", origOnly, indent) + "\n";
str = str + indent + "glyphType = ";
if(glyphType == GLYPHTYPE_ARROW)
str = str + "GLYPHTYPE_ARROW";
if(glyphType == GLYPHTYPE_ELLIPSOID)
str = str + "GLYPHTYPE_ELLIPSOID";
str = str + "\n";
return str;
}
......@@ -585,5 +610,6 @@ public class VectorAttributes extends AttributeSubject implements Plugin
private int geometryQuality;
private double stemWidth;
private boolean origOnly;
private int glyphType;
}
......@@ -452,6 +452,8 @@ avtVectorPlot::SetAtts(const AttributeGroup *a)
}
vectorFilter->SetLimitToOriginal(atts.GetOrigOnly());
glyph->SetArrow(atts.GetGlyphType() == VectorAttributes::Arrow);
glyph->SetMakeHead(atts.GetHeadOn());
glyph->SetHeadSize(atts.GetHeadSize());
glyph->SetLineStem(atts.GetLineStem());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment