Commit bc5b16b6 authored by allens's avatar allens

fixed bug in cell data add option for showing point when creating lines

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@15839 18c085ea-50e0-402c-830e-de6fd14e8384
parent 151699a0
......@@ -29,6 +29,9 @@
<Field name="connectParticles" label="Connect Particles" type="bool">
false
</Field>
<Field name="showPoints" label="Show points" type="bool" enabler="connectParticles:true">
false
</Field>
<Field name="indexVariable" label="Index Variable" type="variablename" enabler="connectParticles:true" vartypes="01000000000">
</Field>
</Attribute>
......
......@@ -99,6 +99,7 @@ void PersistentParticlesAttributes::Init()
startPathType = Absolute;
stopPathType = Absolute;
connectParticles = false;
showPoints = false;
PersistentParticlesAttributes::SelectAll();
}
......@@ -129,6 +130,7 @@ void PersistentParticlesAttributes::Copy(const PersistentParticlesAttributes &ob
traceVariableY = obj.traceVariableY;
traceVariableZ = obj.traceVariableZ;
connectParticles = obj.connectParticles;
showPoints = obj.showPoints;
indexVariable = obj.indexVariable;
PersistentParticlesAttributes::SelectAll();
......@@ -300,6 +302,7 @@ PersistentParticlesAttributes::operator == (const PersistentParticlesAttributes
(traceVariableY == obj.traceVariableY) &&
(traceVariableZ == obj.traceVariableZ) &&
(connectParticles == obj.connectParticles) &&
(showPoints == obj.showPoints) &&
(indexVariable == obj.indexVariable));
}
......@@ -453,6 +456,7 @@ PersistentParticlesAttributes::SelectAll()
Select(ID_traceVariableY, (void *)&traceVariableY);
Select(ID_traceVariableZ, (void *)&traceVariableZ);
Select(ID_connectParticles, (void *)&connectParticles);
Select(ID_showPoints, (void *)&showPoints);
Select(ID_indexVariable, (void *)&indexVariable);
}
......@@ -540,6 +544,12 @@ PersistentParticlesAttributes::CreateNode(DataNode *parentNode, bool completeSav
node->AddNode(new DataNode("connectParticles", connectParticles));
}
if(completeSave || !FieldsEqual(ID_showPoints, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("showPoints", showPoints));
}
if(completeSave || !FieldsEqual(ID_indexVariable, &defaultObject))
{
addToParent = true;
......@@ -628,6 +638,8 @@ PersistentParticlesAttributes::SetFromNode(DataNode *parentNode)
SetTraceVariableZ(node->AsString());
if((node = searchNode->GetNode("connectParticles")) != 0)
SetConnectParticles(node->AsBool());
if((node = searchNode->GetNode("showPoints")) != 0)
SetShowPoints(node->AsBool());
if((node = searchNode->GetNode("indexVariable")) != 0)
SetIndexVariable(node->AsString());
}
......@@ -699,6 +711,13 @@ PersistentParticlesAttributes::SetConnectParticles(bool connectParticles_)
Select(ID_connectParticles, (void *)&connectParticles);
}
void
PersistentParticlesAttributes::SetShowPoints(bool showPoints_)
{
showPoints = showPoints_;
Select(ID_showPoints, (void *)&showPoints);
}
void
PersistentParticlesAttributes::SetIndexVariable(const std::string &indexVariable_)
{
......@@ -782,6 +801,12 @@ PersistentParticlesAttributes::GetConnectParticles() const
return connectParticles;
}
bool
PersistentParticlesAttributes::GetShowPoints() const
{
return showPoints;
}
const std::string &
PersistentParticlesAttributes::GetIndexVariable() const
{
......@@ -855,6 +880,7 @@ PersistentParticlesAttributes::GetFieldName(int index) const
case ID_traceVariableY: return "traceVariableY";
case ID_traceVariableZ: return "traceVariableZ";
case ID_connectParticles: return "connectParticles";
case ID_showPoints: return "showPoints";
case ID_indexVariable: return "indexVariable";
default: return "invalid index";
}
......@@ -889,6 +915,7 @@ PersistentParticlesAttributes::GetFieldType(int index) const
case ID_traceVariableY: return FieldType_variablename;
case ID_traceVariableZ: return FieldType_variablename;
case ID_connectParticles: return FieldType_bool;
case ID_showPoints: return FieldType_bool;
case ID_indexVariable: return FieldType_variablename;
default: return FieldType_unknown;
}
......@@ -923,6 +950,7 @@ PersistentParticlesAttributes::GetFieldTypeName(int index) const
case ID_traceVariableY: return "variablename";
case ID_traceVariableZ: return "variablename";
case ID_connectParticles: return "bool";
case ID_showPoints: return "bool";
case ID_indexVariable: return "variablename";
default: return "invalid index";
}
......@@ -995,6 +1023,11 @@ PersistentParticlesAttributes::FieldsEqual(int index_, const AttributeGroup *rhs
retval = (connectParticles == obj.connectParticles);
}
break;
case ID_showPoints:
{ // new scope
retval = (showPoints == obj.showPoints);
}
break;
case ID_indexVariable:
{ // new scope
retval = (indexVariable == obj.indexVariable);
......
......@@ -106,6 +106,7 @@ public:
void SetTraceVariableY(const std::string &traceVariableY_);
void SetTraceVariableZ(const std::string &traceVariableZ_);
void SetConnectParticles(bool connectParticles_);
void SetShowPoints(bool showPoints_);
void SetIndexVariable(const std::string &indexVariable_);
// Property getting methods
......@@ -121,6 +122,7 @@ public:
const std::string &GetTraceVariableZ() const;
std::string &GetTraceVariableZ();
bool GetConnectParticles() const;
bool GetShowPoints() const;
const std::string &GetIndexVariable() const;
std::string &GetIndexVariable();
......@@ -153,6 +155,7 @@ public:
ID_traceVariableY,
ID_traceVariableZ,
ID_connectParticles,
ID_showPoints,
ID_indexVariable,
ID__LAST
};
......@@ -167,12 +170,13 @@ private:
std::string traceVariableY;
std::string traceVariableZ;
bool connectParticles;
bool showPoints;
std::string indexVariable;
// Static class format string for type map.
static const char *TypeMapFormatString;
static const private_tmfs_t TmfsStruct;
};
#define PERSISTENTPARTICLESATTRIBUTES_TMFS "iiiiisssbs"
#define PERSISTENTPARTICLESATTRIBUTES_TMFS "iiiiisssbbs"
#endif
......@@ -59,7 +59,7 @@ import llnl.visit.Plugin;
public class PersistentParticlesAttributes extends AttributeSubject implements Plugin
{
private static int PersistentParticlesAttributes_numAdditionalAtts = 10;
private static int PersistentParticlesAttributes_numAdditionalAtts = 11;
// Enum values
public final static int PATHTYPEENUM_ABSOLUTE = 0;
......@@ -79,6 +79,7 @@ public class PersistentParticlesAttributes extends AttributeSubject implements P
traceVariableY = new String("");
traceVariableZ = new String("");
connectParticles = false;
showPoints = false;
indexVariable = new String("");
}
......@@ -95,6 +96,7 @@ public class PersistentParticlesAttributes extends AttributeSubject implements P
traceVariableY = new String("");
traceVariableZ = new String("");
connectParticles = false;
showPoints = false;
indexVariable = new String("");
}
......@@ -111,6 +113,7 @@ public class PersistentParticlesAttributes extends AttributeSubject implements P
traceVariableY = new String(obj.traceVariableY);
traceVariableZ = new String(obj.traceVariableZ);
connectParticles = obj.connectParticles;
showPoints = obj.showPoints;
indexVariable = new String(obj.indexVariable);
SelectAll();
......@@ -138,6 +141,7 @@ public class PersistentParticlesAttributes extends AttributeSubject implements P
(traceVariableY.equals(obj.traceVariableY)) &&
(traceVariableZ.equals(obj.traceVariableZ)) &&
(connectParticles == obj.connectParticles) &&
(showPoints == obj.showPoints) &&
(indexVariable.equals(obj.indexVariable)));
}
......@@ -199,10 +203,16 @@ public class PersistentParticlesAttributes extends AttributeSubject implements P
Select(8);
}
public void SetShowPoints(boolean showPoints_)
{
showPoints = showPoints_;
Select(9);
}
public void SetIndexVariable(String indexVariable_)
{
indexVariable = indexVariable_;
Select(9);
Select(10);
}
// Property getting methods
......@@ -215,6 +225,7 @@ public class PersistentParticlesAttributes extends AttributeSubject implements P
public String GetTraceVariableY() { return traceVariableY; }
public String GetTraceVariableZ() { return traceVariableZ; }
public boolean GetConnectParticles() { return connectParticles; }
public boolean GetShowPoints() { return showPoints; }
public String GetIndexVariable() { return indexVariable; }
// Write and read methods.
......@@ -239,6 +250,8 @@ public class PersistentParticlesAttributes extends AttributeSubject implements P
if(WriteSelect(8, buf))
buf.WriteBool(connectParticles);
if(WriteSelect(9, buf))
buf.WriteBool(showPoints);
if(WriteSelect(10, buf))
buf.WriteString(indexVariable);
}
......@@ -274,6 +287,9 @@ public class PersistentParticlesAttributes extends AttributeSubject implements P
SetConnectParticles(buf.ReadBool());
break;
case 9:
SetShowPoints(buf.ReadBool());
break;
case 10:
SetIndexVariable(buf.ReadString());
break;
}
......@@ -301,6 +317,7 @@ public class PersistentParticlesAttributes extends AttributeSubject implements P
str = str + stringToString("traceVariableY", traceVariableY, indent) + "\n";
str = str + stringToString("traceVariableZ", traceVariableZ, indent) + "\n";
str = str + boolToString("connectParticles", connectParticles, indent) + "\n";
str = str + boolToString("showPoints", showPoints, indent) + "\n";
str = str + stringToString("indexVariable", indexVariable, indent) + "\n";
return str;
}
......@@ -316,6 +333,7 @@ public class PersistentParticlesAttributes extends AttributeSubject implements P
private String traceVariableY;
private String traceVariableZ;
private boolean connectParticles;
private boolean showPoints;
private String indexVariable;
}
......@@ -123,6 +123,11 @@ PyPersistentParticlesAttributes_ToString(const PersistentParticlesAttributes *at
else
SNPRINTF(tmpStr, 1000, "%sconnectParticles = 0\n", prefix);
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, "%sindexVariable = \"%s\"\n", prefix, atts->GetIndexVariable().c_str());
str += tmpStr;
return str;
......@@ -371,6 +376,30 @@ PersistentParticlesAttributes_GetConnectParticles(PyObject *self, PyObject *args
return retval;
}
/*static*/ PyObject *
PersistentParticlesAttributes_SetShowPoints(PyObject *self, PyObject *args)
{
PersistentParticlesAttributesObject *obj = (PersistentParticlesAttributesObject *)self;
int ival;
if(!PyArg_ParseTuple(args, "i", &ival))
return NULL;
// Set the showPoints in the object.
obj->data->SetShowPoints(ival != 0);
Py_INCREF(Py_None);
return Py_None;
}
/*static*/ PyObject *
PersistentParticlesAttributes_GetShowPoints(PyObject *self, PyObject *args)
{
PersistentParticlesAttributesObject *obj = (PersistentParticlesAttributesObject *)self;
PyObject *retval = PyInt_FromLong(obj->data->GetShowPoints()?1L:0L);
return retval;
}
/*static*/ PyObject *
PersistentParticlesAttributes_SetIndexVariable(PyObject *self, PyObject *args)
{
......@@ -417,6 +446,8 @@ PyMethodDef PyPersistentParticlesAttributes_methods[PERSISTENTPARTICLESATTRIBUTE
{"GetTraceVariableZ", PersistentParticlesAttributes_GetTraceVariableZ, METH_VARARGS},
{"SetConnectParticles", PersistentParticlesAttributes_SetConnectParticles, METH_VARARGS},
{"GetConnectParticles", PersistentParticlesAttributes_GetConnectParticles, METH_VARARGS},
{"SetShowPoints", PersistentParticlesAttributes_SetShowPoints, METH_VARARGS},
{"GetShowPoints", PersistentParticlesAttributes_GetShowPoints, METH_VARARGS},
{"SetIndexVariable", PersistentParticlesAttributes_SetIndexVariable, METH_VARARGS},
{"GetIndexVariable", PersistentParticlesAttributes_GetIndexVariable, METH_VARARGS},
{NULL, NULL}
......@@ -475,6 +506,8 @@ PyPersistentParticlesAttributes_getattr(PyObject *self, char *name)
return PersistentParticlesAttributes_GetTraceVariableZ(self, NULL);
if(strcmp(name, "connectParticles") == 0)
return PersistentParticlesAttributes_GetConnectParticles(self, NULL);
if(strcmp(name, "showPoints") == 0)
return PersistentParticlesAttributes_GetShowPoints(self, NULL);
if(strcmp(name, "indexVariable") == 0)
return PersistentParticlesAttributes_GetIndexVariable(self, NULL);
......@@ -509,6 +542,8 @@ PyPersistentParticlesAttributes_setattr(PyObject *self, char *name, PyObject *ar
obj = PersistentParticlesAttributes_SetTraceVariableZ(self, tuple);
else if(strcmp(name, "connectParticles") == 0)
obj = PersistentParticlesAttributes_SetConnectParticles(self, tuple);
else if(strcmp(name, "showPoints") == 0)
obj = PersistentParticlesAttributes_SetShowPoints(self, tuple);
else if(strcmp(name, "indexVariable") == 0)
obj = PersistentParticlesAttributes_SetIndexVariable(self, tuple);
......
......@@ -44,7 +44,7 @@
//
// Functions exposed to the VisIt module.
//
#define PERSISTENTPARTICLESATTRIBUTES_NMETH 22
#define PERSISTENTPARTICLESATTRIBUTES_NMETH 24
void PyPersistentParticlesAttributes_StartUp(PersistentParticlesAttributes *subj, void *data);
void PyPersistentParticlesAttributes_CloseDown();
PyMethodDef * PyPersistentParticlesAttributes_GetMethodTable(int *nMethods);
......
......@@ -42,6 +42,7 @@
#include <ViewerProxy.h>
#include <QCheckBox>
#include <QGroupBox>
#include <QLabel>
#include <QLayout>
#include <QLineEdit>
......@@ -127,9 +128,17 @@ QvisPersistentParticlesWindow::CreateWindowContents()
QGridLayout *mainLayout = new QGridLayout(0);
topLayout->addLayout(mainLayout);
QGroupBox * timeGroup = new QGroupBox(central);
timeGroup->setTitle(tr("Time Slices"));
topLayout->addWidget(timeGroup);
QGridLayout *timeLayout = new QGridLayout(timeGroup);
timeLayout->setMargin(5);
timeLayout->setSpacing(10);
// Start
startPathTypeLabel = new QLabel(tr("Type of path"), central);
mainLayout->addWidget(startPathTypeLabel,0,0);
timeLayout->addWidget(startPathTypeLabel,0,0);
startPathType = new QWidget(central);
startPathTypeButtonGroup= new QButtonGroup(startPathType);
QHBoxLayout *startPathTypeLayout = new QHBoxLayout(startPathType);
......@@ -144,18 +153,18 @@ QvisPersistentParticlesWindow::CreateWindowContents()
startPathTypeLayout->addWidget(startPathTypePathTypeEnumRelative);
connect(startPathTypeButtonGroup, SIGNAL(buttonClicked(int)),
this, SLOT(startPathTypeChanged(int)));
mainLayout->addWidget(startPathType, 0,1);
timeLayout->addWidget(startPathType, 0,1);
startIndexLabel = new QLabel(tr("Index of first time slice"), central);
mainLayout->addWidget(startIndexLabel,1,0);
timeLayout->addWidget(startIndexLabel,1,0);
startIndex = new QLineEdit(central);
connect(startIndex, SIGNAL(returnPressed()),
this, SLOT(startIndexProcessText()));
mainLayout->addWidget(startIndex, 1,1);
timeLayout->addWidget(startIndex, 1,1);
// Stop
stopPathTypeLabel = new QLabel(tr("Type of path"), central);
mainLayout->addWidget(stopPathTypeLabel,2,0);
timeLayout->addWidget(stopPathTypeLabel,2,0);
stopPathType = new QWidget(central);
stopPathTypeButtonGroup= new QButtonGroup(stopPathType);
QHBoxLayout *stopPathTypeLayout = new QHBoxLayout(stopPathType);
......@@ -169,61 +178,85 @@ QvisPersistentParticlesWindow::CreateWindowContents()
stopPathTypeLayout->addWidget(stopPathTypePathTypeEnumRelative);
connect(stopPathTypeButtonGroup, SIGNAL(buttonClicked(int)),
this, SLOT(stopPathTypeChanged(int)));
mainLayout->addWidget(stopPathType, 2,1);
timeLayout->addWidget(stopPathType, 2,1);
stopIndexLabel = new QLabel(tr("Index of last time slice"), central);
mainLayout->addWidget(stopIndexLabel,3,0);
timeLayout->addWidget(stopIndexLabel,3,0);
stopIndex = new QLineEdit(central);
connect(stopIndex, SIGNAL(returnPressed()),
this, SLOT(stopIndexProcessText()));
mainLayout->addWidget(stopIndex, 3,1);
timeLayout->addWidget(stopIndex, 3,1);
// Stride
strideLabel = new QLabel(tr("Skip rate between time slices"), central);
mainLayout->addWidget(strideLabel,4,0);
timeLayout->addWidget(strideLabel,4,0);
stride = new QLineEdit(central);
connect(stride, SIGNAL(returnPressed()),
this, SLOT(strideProcessText()));
mainLayout->addWidget(stride, 4,1);
timeLayout->addWidget(stride, 4,1);
// Coordinate replacement
QGroupBox * coordinateGroup = new QGroupBox(central);
coordinateGroup->setTitle(tr("Coordinate replacement"));
topLayout->addWidget(coordinateGroup);
QGridLayout *coordinateLayout = new QGridLayout(coordinateGroup);
coordinateLayout->setMargin(5);
coordinateLayout->setSpacing(10);
// Coordinates
traceVariableXLabel = new QLabel(tr("X-Coordinate"), central);
mainLayout->addWidget(traceVariableXLabel,5,0);
coordinateLayout->addWidget(traceVariableXLabel,1,0);
int traceVariableXMask = QvisVariableButton::Scalars;
traceVariableX = new QvisVariableButton(true, true, true, traceVariableXMask, central);
connect(traceVariableX, SIGNAL(activated(const QString&)),
this, SLOT(traceVariableXChanged(const QString&)));
mainLayout->addWidget(traceVariableX, 5,1);
coordinateLayout->addWidget(traceVariableX, 1,1);
traceVariableYLabel = new QLabel(tr("Y-Coordinate"), central);
mainLayout->addWidget(traceVariableYLabel,6,0);
coordinateLayout->addWidget(traceVariableYLabel,2,0);
int traceVariableYMask = QvisVariableButton::Scalars;
traceVariableY = new QvisVariableButton(true, true, true, traceVariableYMask, central);
connect(traceVariableY, SIGNAL(activated(const QString&)),
this, SLOT(traceVariableYChanged(const QString&)));
mainLayout->addWidget(traceVariableY, 6,1);
coordinateLayout->addWidget(traceVariableY, 2,1);
traceVariableZLabel = new QLabel(tr("Z-Coordinate"), central);
mainLayout->addWidget(traceVariableZLabel,7,0);
coordinateLayout->addWidget(traceVariableZLabel,3,0);
int traceVariableZMask = QvisVariableButton::Scalars;
traceVariableZ = new QvisVariableButton(true, true, true, traceVariableZMask, central);
connect(traceVariableZ, SIGNAL(activated(const QString&)),
this, SLOT(traceVariableZChanged(const QString&)));
mainLayout->addWidget(traceVariableZ, 7,1);
coordinateLayout->addWidget(traceVariableZ, 3,1);
connectParticles = new QCheckBox(tr("Connect Particles"), central);
QGroupBox * connectionsGroup = new QGroupBox(central);
connectionsGroup->setTitle(tr("Connect particles"));
topLayout->addWidget(connectionsGroup);
QGridLayout *connectionsLayout = new QGridLayout(connectionsGroup);
connectionsLayout->setMargin(5);
connectionsLayout->setSpacing(10);
connectParticles = new QCheckBox(tr("Connect particles"), central);
connect(connectParticles, SIGNAL(toggled(bool)),
this, SLOT(connectParticlesChanged(bool)));
mainLayout->addWidget(connectParticles, 8,0);
connectionsLayout->addWidget(connectParticles, 0,0);
showPoints = new QCheckBox(tr("Show points"), central);
connect(showPoints, SIGNAL(toggled(bool)),
this, SLOT(showPointsChanged(bool)));
connectionsLayout->addWidget(showPoints, 0,1);
indexVariableLabel = new QLabel(tr("Index Variable"), central);
mainLayout->addWidget(indexVariableLabel,9,0);
indexVariableLabel = new QLabel(tr("Index variable"), central);
connectionsLayout->addWidget(indexVariableLabel,1,0);
int indexVariableMask = QvisVariableButton::Scalars;
indexVariable = new QvisVariableButton(true, true, true, indexVariableMask, central);
connect(indexVariable, SIGNAL(activated(const QString&)),
this, SLOT(indexVariableChanged(const QString&)));
mainLayout->addWidget(indexVariable, 9,1);
connectionsLayout->addWidget(indexVariable, 1,1);
}
......@@ -304,22 +337,21 @@ QvisPersistentParticlesWindow::UpdateWindow(bool doAll)
traceVariableZ->blockSignals(false);
break;
case PersistentParticlesAttributes::ID_connectParticles:
if (atts->GetConnectParticles() == true)
{
indexVariable->setEnabled(true);
if(indexVariableLabel)
indexVariableLabel->setEnabled(true);
}
else
{
indexVariable->setEnabled(false);
if(indexVariableLabel)
indexVariableLabel->setEnabled(false);
}
showPoints->setEnabled( atts->GetConnectParticles() );
indexVariable->setEnabled( atts->GetConnectParticles() );
if(indexVariableLabel)
indexVariableLabel->setEnabled( atts->GetConnectParticles() );
connectParticles->blockSignals(true);
connectParticles->setChecked(atts->GetConnectParticles());
connectParticles->blockSignals(false);
break;
case PersistentParticlesAttributes::ID_showPoints:
showPoints->blockSignals(true);
showPoints->setChecked(atts->GetShowPoints());
showPoints->blockSignals(false);
break;
case PersistentParticlesAttributes::ID_indexVariable:
indexVariable->blockSignals(true);
indexVariable->setText(QString(atts->GetIndexVariable().c_str()));
......@@ -508,6 +540,14 @@ QvisPersistentParticlesWindow::connectParticlesChanged(bool val)
}
void
QvisPersistentParticlesWindow::showPointsChanged(bool val)
{
atts->SetShowPoints(val);
Apply();
}
void
QvisPersistentParticlesWindow::indexVariableChanged(const QString &varName)
{
......@@ -515,5 +555,3 @@ QvisPersistentParticlesWindow::indexVariableChanged(const QString &varName)
SetUpdate(false);
Apply();
}
......@@ -97,6 +97,7 @@ class QvisPersistentParticlesWindow : public QvisOperatorWindow
void traceVariableYChanged(const QString &varName);
void traceVariableZChanged(const QString &varName);
void connectParticlesChanged(bool val);
void showPointsChanged(bool val);
void indexVariableChanged(const QString &varName);
private:
QLineEdit *startIndex;
......@@ -110,6 +111,7 @@ class QvisPersistentParticlesWindow : public QvisOperatorWindow
QvisVariableButton *traceVariableY;
QvisVariableButton *traceVariableZ;
QCheckBox *connectParticles;
QCheckBox *showPoints;
QvisVariableButton *indexVariable;
QLabel *startIndexLabel;
QLabel *startPathTypeLabel;
......
......@@ -386,13 +386,6 @@ avtPersistentParticlesFilter::IterateMergeData(int ts, avtDataTree_p tree)
//If data is only merged (i.e. no paths are computed) but at least one
//variable needs to be replaced, then replace the variable and return.
//Get the needed data.
vtkPointSet* uGrid =0;
vtkPoints* currPoints=0;
vtkDataArray* currXData =0;
vtkDataArray* currYData =0;
vtkDataArray* currZData =0;
//Ask for the dataset
vtkDataSet **dsets;
int nds;
......@@ -421,16 +414,18 @@ avtPersistentParticlesFilter::IterateMergeData(int ts, avtDataTree_p tree)
// Free the memory from the GetAllLeaves function call.
delete [] dsets;
uGrid = vtkPointSet::SafeDownCast(currDs);
vtkPointSet *uGrid = vtkPointSet::SafeDownCast(currDs);
if (uGrid == 0)
{
EXCEPTION1(ImproperUseException, "avtPersistentParticlesFilter only supports "
"vtkPointSet data");
}
//Get the point data from the current timestep
currPoints = uGrid->GetPoints();
vtkPoints *currPoints = uGrid->GetPoints();
//Get the data to be used as x variable
currXData = 0;
vtkDataArray *currXData = 0;
if( replaceX ){
currXData = uGrid->GetPointData()->GetArray( atts.GetTraceVariableX().c_str() );
if( currXData == 0 )
......@@ -438,20 +433,31 @@ avtPersistentParticlesFilter::IterateMergeData(int ts, avtDataTree_p tree)
}
//Get the data to be used as y variable
currYData = 0;
vtkDataArray *currYData = 0;
if( replaceY ){
currYData = uGrid->GetPointData()->GetArray( atts.GetTraceVariableY().c_str() );
if( currYData == 0 )
EXCEPTION1(ImproperUseException, "Y coordinate variable not found.");
}
//Get the data to be used as z variable
currZData = 0;
vtkDataArray *currZData = 0;
if( atts.GetTraceVariableZ() != "default" ){
currZData = uGrid->GetPointData()->GetArray( atts.GetTraceVariableZ().c_str() );
if( currZData == 0 )
EXCEPTION1(ImproperUseException, "Z coordinate variable not found.");
}