Commit 841d042c authored by allens's avatar allens

added alternate coordinate systems

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@16436 18c085ea-50e0-402c-830e-de6fd14e8384
parent 6a5b630f
......@@ -3,9 +3,10 @@
<Files components="W">
</Files>
<Attribute name="LineSamplerAttributes" purpose="This class contains attributes for the line sampler operator." persistent="true" keyframe="true" exportAPI="" exportInclude="">
<Enum name="CoordinateSystem">
<Enum name="MeshGeometry">
Cartesian
Cylindrical
Toroidal
</Enum>
<Enum name="ArrayConfiguration">
Geometry
......@@ -70,8 +71,8 @@
CurrentTimeStep
MultipleTimeSteps
</Enum>
<Field name="coordinateSystem" label="Coordinate system" type="enum" subtype="CoordinateSystem">
Cylindrical
<Field name="meshGeometry" label="Mesh geometry" type="enum" subtype="MeshGeometry">
Toroidal
</Field>
<Field name="arrayConfiguration" label="Array configuration" type="enum" subtype="ArrayConfiguration">
Geometry
......@@ -107,7 +108,7 @@
<Field name="rowOffset" label="Grid: Offset between rows" type="double">
0.100
</Field>
<Field name="arrayOrigin" label="Array origin" type="doubleArray" length="3">
<Field name="arrayOrigin" label="Array origin (R,Phi,Z)" type="doubleArray" length="3">
0.000000
0.000000
0.000000
......
......@@ -40,36 +40,37 @@
#include <DataNode.h>
//
// Enum conversion methods for LineSamplerAttributes::CoordinateSystem
// Enum conversion methods for LineSamplerAttributes::MeshGeometry
//
static const char *CoordinateSystem_strings[] = {
"Cartesian", "Cylindrical"};
static const char *MeshGeometry_strings[] = {
"Cartesian", "Cylindrical", "Toroidal"
};
std::string
LineSamplerAttributes::CoordinateSystem_ToString(LineSamplerAttributes::CoordinateSystem t)
LineSamplerAttributes::MeshGeometry_ToString(LineSamplerAttributes::MeshGeometry t)
{
int index = int(t);
if(index < 0 || index >= 2) index = 0;
return CoordinateSystem_strings[index];
if(index < 0 || index >= 3) index = 0;
return MeshGeometry_strings[index];
}
std::string
LineSamplerAttributes::CoordinateSystem_ToString(int t)
LineSamplerAttributes::MeshGeometry_ToString(int t)
{
int index = (t < 0 || t >= 2) ? 0 : t;
return CoordinateSystem_strings[index];
int index = (t < 0 || t >= 3) ? 0 : t;
return MeshGeometry_strings[index];
}
bool
LineSamplerAttributes::CoordinateSystem_FromString(const std::string &s, LineSamplerAttributes::CoordinateSystem &val)
LineSamplerAttributes::MeshGeometry_FromString(const std::string &s, LineSamplerAttributes::MeshGeometry &val)
{
val = LineSamplerAttributes::Cartesian;
for(int i = 0; i < 2; ++i)
for(int i = 0; i < 3; ++i)
{
if(s == CoordinateSystem_strings[i])
if(s == MeshGeometry_strings[i])
{
val = (CoordinateSystem)i;
val = (MeshGeometry)i;
return true;
}
}
......@@ -617,7 +618,7 @@ LineSamplerAttributes::TimeSampling_FromString(const std::string &s, LineSampler
void LineSamplerAttributes::Init()
{
coordinateSystem = Cylindrical;
meshGeometry = Toroidal;
arrayConfiguration = Geometry;
boundary = Data;
nArrays = 1;
......@@ -693,7 +694,7 @@ void LineSamplerAttributes::Init()
void LineSamplerAttributes::Copy(const LineSamplerAttributes &obj)
{
coordinateSystem = obj.coordinateSystem;
meshGeometry = obj.meshGeometry;
arrayConfiguration = obj.arrayConfiguration;
boundary = obj.boundary;
nArrays = obj.nArrays;
......@@ -907,7 +908,7 @@ LineSamplerAttributes::operator == (const LineSamplerAttributes &obj) const
arrayOrigin_equal = (arrayOrigin[i] == obj.arrayOrigin[i]);
// Create the return value
return ((coordinateSystem == obj.coordinateSystem) &&
return ((meshGeometry == obj.meshGeometry) &&
(arrayConfiguration == obj.arrayConfiguration) &&
(boundary == obj.boundary) &&
(nArrays == obj.nArrays) &&
......@@ -1099,7 +1100,7 @@ LineSamplerAttributes::NewInstance(bool copy) const
void
LineSamplerAttributes::SelectAll()
{
Select(ID_coordinateSystem, (void *)&coordinateSystem);
Select(ID_meshGeometry, (void *)&meshGeometry);
Select(ID_arrayConfiguration, (void *)&arrayConfiguration);
Select(ID_boundary, (void *)&boundary);
Select(ID_nArrays, (void *)&nArrays);
......@@ -1180,10 +1181,10 @@ LineSamplerAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool
// Create a node for LineSamplerAttributes.
DataNode *node = new DataNode("LineSamplerAttributes");
if(completeSave || !FieldsEqual(ID_coordinateSystem, &defaultObject))
if(completeSave || !FieldsEqual(ID_meshGeometry, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("coordinateSystem", CoordinateSystem_ToString(coordinateSystem)));
node->AddNode(new DataNode("meshGeometry", MeshGeometry_ToString(meshGeometry)));
}
if(completeSave || !FieldsEqual(ID_arrayConfiguration, &defaultObject))
......@@ -1510,20 +1511,20 @@ LineSamplerAttributes::SetFromNode(DataNode *parentNode)
return;
DataNode *node;
if((node = searchNode->GetNode("coordinateSystem")) != 0)
if((node = searchNode->GetNode("meshGeometry")) != 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)
SetCoordinateSystem(CoordinateSystem(ival));
if(ival >= 0 && ival < 3)
SetMeshGeometry(MeshGeometry(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
CoordinateSystem value;
if(CoordinateSystem_FromString(node->AsString(), value))
SetCoordinateSystem(value);
MeshGeometry value;
if(MeshGeometry_FromString(node->AsString(), value))
SetMeshGeometry(value);
}
}
if((node = searchNode->GetNode("arrayConfiguration")) != 0)
......@@ -1825,10 +1826,10 @@ LineSamplerAttributes::SetFromNode(DataNode *parentNode)
///////////////////////////////////////////////////////////////////////////////
void
LineSamplerAttributes::SetCoordinateSystem(LineSamplerAttributes::CoordinateSystem coordinateSystem_)
LineSamplerAttributes::SetMeshGeometry(LineSamplerAttributes::MeshGeometry meshGeometry_)
{
coordinateSystem = coordinateSystem_;
Select(ID_coordinateSystem, (void *)&coordinateSystem);
meshGeometry = meshGeometry_;
Select(ID_meshGeometry, (void *)&meshGeometry);
}
void
......@@ -2173,10 +2174,10 @@ LineSamplerAttributes::SetChannelListToroidalAngle(double channelListToroidalAng
// Get property methods
///////////////////////////////////////////////////////////////////////////////
LineSamplerAttributes::CoordinateSystem
LineSamplerAttributes::GetCoordinateSystem() const
LineSamplerAttributes::MeshGeometry
LineSamplerAttributes::GetMeshGeometry() const
{
return CoordinateSystem(coordinateSystem);
return MeshGeometry(meshGeometry);
}
LineSamplerAttributes::ArrayConfiguration
......@@ -2531,7 +2532,7 @@ LineSamplerAttributes::GetFieldName(int index) const
{
switch (index)
{
case ID_coordinateSystem: return "coordinateSystem";
case ID_meshGeometry: return "meshGeometry";
case ID_arrayConfiguration: return "arrayConfiguration";
case ID_boundary: return "boundary";
case ID_nArrays: return "nArrays";
......@@ -2604,7 +2605,7 @@ LineSamplerAttributes::GetFieldType(int index) const
{
switch (index)
{
case ID_coordinateSystem: return FieldType_enum;
case ID_meshGeometry: return FieldType_enum;
case ID_arrayConfiguration: return FieldType_enum;
case ID_boundary: return FieldType_enum;
case ID_nArrays: return FieldType_int;
......@@ -2677,7 +2678,7 @@ LineSamplerAttributes::GetFieldTypeName(int index) const
{
switch (index)
{
case ID_coordinateSystem: return "enum";
case ID_meshGeometry: return "enum";
case ID_arrayConfiguration: return "enum";
case ID_boundary: return "enum";
case ID_nArrays: return "int";
......@@ -2752,9 +2753,9 @@ LineSamplerAttributes::FieldsEqual(int index_, const AttributeGroup *rhs) const
bool retval = false;
switch (index_)
{
case ID_coordinateSystem:
case ID_meshGeometry:
{ // new scope
retval = (coordinateSystem == obj.coordinateSystem);
retval = (meshGeometry == obj.meshGeometry);
}
break;
case ID_arrayConfiguration:
......
......@@ -60,10 +60,11 @@
class LineSamplerAttributes : public AttributeSubject
{
public:
enum CoordinateSystem
enum MeshGeometry
{
Cartesian,
Cylindrical
Cylindrical,
Toroidal
};
enum ArrayConfiguration
{
......@@ -173,7 +174,7 @@ public:
void SelectWallList();
// Property setting methods
void SetCoordinateSystem(CoordinateSystem coordinateSystem_);
void SetMeshGeometry(MeshGeometry meshGeometry_);
void SetArrayConfiguration(ArrayConfiguration arrayConfiguration_);
void SetBoundary(Boundary boundary_);
void SetNArrays(int nArrays_);
......@@ -224,7 +225,7 @@ public:
void SetChannelListToroidalAngle(double channelListToroidalAngle_);
// Property getting methods
CoordinateSystem GetCoordinateSystem() const;
MeshGeometry GetMeshGeometry() const;
ArrayConfiguration GetArrayConfiguration() const;
Boundary GetBoundary() const;
int GetNArrays() const;
......@@ -282,10 +283,10 @@ public:
virtual void SetFromNode(DataNode *node);
// Enum conversion functions
static std::string CoordinateSystem_ToString(CoordinateSystem);
static bool CoordinateSystem_FromString(const std::string &, CoordinateSystem &);
static std::string MeshGeometry_ToString(MeshGeometry);
static bool MeshGeometry_FromString(const std::string &, MeshGeometry &);
protected:
static std::string CoordinateSystem_ToString(int);
static std::string MeshGeometry_ToString(int);
public:
static std::string ArrayConfiguration_ToString(ArrayConfiguration);
static bool ArrayConfiguration_FromString(const std::string &, ArrayConfiguration &);
......@@ -367,7 +368,7 @@ public:
// IDs that can be used to identify fields in case statements
enum {
ID_coordinateSystem = 0,
ID_meshGeometry = 0,
ID_arrayConfiguration,
ID_boundary,
ID_nArrays,
......@@ -420,7 +421,7 @@ public:
};
private:
int coordinateSystem;
int meshGeometry;
int arrayConfiguration;
int boundary;
int nArrays;
......
......@@ -64,8 +64,9 @@ public class LineSamplerAttributes extends AttributeSubject implements Plugin
private static int LineSamplerAttributes_numAdditionalAtts = 49;
// Enum values
public final static int COORDINATESYSTEM_CARTESIAN = 0;
public final static int COORDINATESYSTEM_CYLINDRICAL = 1;
public final static int MESHGEOMETRY_CARTESIAN = 0;
public final static int MESHGEOMETRY_CYLINDRICAL = 1;
public final static int MESHGEOMETRY_TOROIDAL = 2;
public final static int ARRAYCONFIGURATION_GEOMETRY = 0;
public final static int ARRAYCONFIGURATION_MANUAL = 1;
......@@ -121,7 +122,7 @@ public class LineSamplerAttributes extends AttributeSubject implements Plugin
{
super(LineSamplerAttributes_numAdditionalAtts);
coordinateSystem = COORDINATESYSTEM_CYLINDRICAL;
meshGeometry = MESHGEOMETRY_TOROIDAL;
arrayConfiguration = ARRAYCONFIGURATION_GEOMETRY;
boundary = BOUNDARY_DATA;
nArrays = 1;
......@@ -185,7 +186,7 @@ public class LineSamplerAttributes extends AttributeSubject implements Plugin
{
super(LineSamplerAttributes_numAdditionalAtts + nMoreFields);
coordinateSystem = COORDINATESYSTEM_CYLINDRICAL;
meshGeometry = MESHGEOMETRY_TOROIDAL;
arrayConfiguration = ARRAYCONFIGURATION_GEOMETRY;
boundary = BOUNDARY_DATA;
nArrays = 1;
......@@ -251,7 +252,7 @@ public class LineSamplerAttributes extends AttributeSubject implements Plugin
int i;
coordinateSystem = obj.coordinateSystem;
meshGeometry = obj.meshGeometry;
arrayConfiguration = obj.arrayConfiguration;
boundary = obj.boundary;
nArrays = obj.nArrays;
......@@ -358,7 +359,7 @@ public class LineSamplerAttributes extends AttributeSubject implements Plugin
wallList_equal = wallList1.equals(wallList2);
}
// Create the return value
return ((coordinateSystem == obj.coordinateSystem) &&
return ((meshGeometry == obj.meshGeometry) &&
(arrayConfiguration == obj.arrayConfiguration) &&
(boundary == obj.boundary) &&
(nArrays == obj.nArrays) &&
......@@ -413,9 +414,9 @@ public class LineSamplerAttributes extends AttributeSubject implements Plugin
public String GetVersion() { return "1.0"; }
// Property setting methods
public void SetCoordinateSystem(int coordinateSystem_)
public void SetMeshGeometry(int meshGeometry_)
{
coordinateSystem = coordinateSystem_;
meshGeometry = meshGeometry_;
Select(0);
}
......@@ -718,7 +719,7 @@ public class LineSamplerAttributes extends AttributeSubject implements Plugin
}
// Property getting methods
public int GetCoordinateSystem() { return coordinateSystem; }
public int GetMeshGeometry() { return meshGeometry; }
public int GetArrayConfiguration() { return arrayConfiguration; }
public int GetBoundary() { return boundary; }
public int GetNArrays() { return nArrays; }
......@@ -772,7 +773,7 @@ public class LineSamplerAttributes extends AttributeSubject implements Plugin
public void WriteAtts(CommunicationBuffer buf)
{
if(WriteSelect(0, buf))
buf.WriteInt(coordinateSystem);
buf.WriteInt(meshGeometry);
if(WriteSelect(1, buf))
buf.WriteInt(arrayConfiguration);
if(WriteSelect(2, buf))
......@@ -876,7 +877,7 @@ public class LineSamplerAttributes extends AttributeSubject implements Plugin
switch(index)
{
case 0:
SetCoordinateSystem(buf.ReadInt());
SetMeshGeometry(buf.ReadInt());
break;
case 1:
SetArrayConfiguration(buf.ReadInt());
......@@ -1028,11 +1029,13 @@ public class LineSamplerAttributes extends AttributeSubject implements Plugin
public String toString(String indent)
{
String str = new String();
str = str + indent + "coordinateSystem = ";
if(coordinateSystem == COORDINATESYSTEM_CARTESIAN)
str = str + "COORDINATESYSTEM_CARTESIAN";
if(coordinateSystem == COORDINATESYSTEM_CYLINDRICAL)
str = str + "COORDINATESYSTEM_CYLINDRICAL";
str = str + indent + "meshGeometry = ";
if(meshGeometry == MESHGEOMETRY_CARTESIAN)
str = str + "MESHGEOMETRY_CARTESIAN";
if(meshGeometry == MESHGEOMETRY_CYLINDRICAL)
str = str + "MESHGEOMETRY_CYLINDRICAL";
if(meshGeometry == MESHGEOMETRY_TOROIDAL)
str = str + "MESHGEOMETRY_TOROIDAL";
str = str + "\n";
str = str + indent + "arrayConfiguration = ";
if(arrayConfiguration == ARRAYCONFIGURATION_GEOMETRY)
......@@ -1171,7 +1174,7 @@ public class LineSamplerAttributes extends AttributeSubject implements Plugin
// Attributes
private int coordinateSystem;
private int meshGeometry;
private int arrayConfiguration;
private int boundary;
private int nArrays;
......
......@@ -76,15 +76,19 @@ PyLineSamplerAttributes_ToString(const LineSamplerAttributes *atts, const char *
std::string str;
char tmpStr[1000];
const char *coordinateSystem_names = "Cartesian, Cylindrical";
switch (atts->GetCoordinateSystem())
const char *meshGeometry_names = "Cartesian, Cylindrical, Toroidal";
switch (atts->GetMeshGeometry())
{
case LineSamplerAttributes::Cartesian:
SNPRINTF(tmpStr, 1000, "%scoordinateSystem = %sCartesian # %s\n", prefix, prefix, coordinateSystem_names);
SNPRINTF(tmpStr, 1000, "%smeshGeometry = %sCartesian # %s\n", prefix, prefix, meshGeometry_names);
str += tmpStr;
break;
case LineSamplerAttributes::Cylindrical:
SNPRINTF(tmpStr, 1000, "%scoordinateSystem = %sCylindrical # %s\n", prefix, prefix, coordinateSystem_names);
SNPRINTF(tmpStr, 1000, "%smeshGeometry = %sCylindrical # %s\n", prefix, prefix, meshGeometry_names);
str += tmpStr;
break;
case LineSamplerAttributes::Toroidal:
SNPRINTF(tmpStr, 1000, "%smeshGeometry = %sToroidal # %s\n", prefix, prefix, meshGeometry_names);
str += tmpStr;
break;
default:
......@@ -452,7 +456,7 @@ LineSamplerAttributes_Notify(PyObject *self, PyObject *args)
}
/*static*/ PyObject *
LineSamplerAttributes_SetCoordinateSystem(PyObject *self, PyObject *args)
LineSamplerAttributes_SetMeshGeometry(PyObject *self, PyObject *args)
{
LineSamplerAttributesObject *obj = (LineSamplerAttributesObject *)self;
......@@ -460,15 +464,15 @@ LineSamplerAttributes_SetCoordinateSystem(PyObject *self, PyObject *args)
if(!PyArg_ParseTuple(args, "i", &ival))
return NULL;
// Set the coordinateSystem in the object.
if(ival >= 0 && ival < 2)
obj->data->SetCoordinateSystem(LineSamplerAttributes::CoordinateSystem(ival));
// Set the meshGeometry in the object.
if(ival >= 0 && ival < 3)
obj->data->SetMeshGeometry(LineSamplerAttributes::MeshGeometry(ival));
else
{
fprintf(stderr, "An invalid coordinateSystem value was given. "
"Valid values are in the range of [0,1]. "
fprintf(stderr, "An invalid meshGeometry value was given. "
"Valid values are in the range of [0,2]. "
"You can also use the following names: "
"Cartesian, Cylindrical.");
"Cartesian, Cylindrical, Toroidal.");
return NULL;
}
......@@ -477,10 +481,10 @@ LineSamplerAttributes_SetCoordinateSystem(PyObject *self, PyObject *args)
}
/*static*/ PyObject *
LineSamplerAttributes_GetCoordinateSystem(PyObject *self, PyObject *args)
LineSamplerAttributes_GetMeshGeometry(PyObject *self, PyObject *args)
{
LineSamplerAttributesObject *obj = (LineSamplerAttributesObject *)self;
PyObject *retval = PyInt_FromLong(long(obj->data->GetCoordinateSystem()));
PyObject *retval = PyInt_FromLong(long(obj->data->GetMeshGeometry()));
return retval;
}
......@@ -1874,8 +1878,8 @@ LineSamplerAttributes_GetChannelListToroidalAngle(PyObject *self, PyObject *args
PyMethodDef PyLineSamplerAttributes_methods[LINESAMPLERATTRIBUTES_NMETH] = {
{"Notify", LineSamplerAttributes_Notify, METH_VARARGS},
{"SetCoordinateSystem", LineSamplerAttributes_SetCoordinateSystem, METH_VARARGS},
{"GetCoordinateSystem", LineSamplerAttributes_GetCoordinateSystem, METH_VARARGS},
{"SetMeshGeometry", LineSamplerAttributes_SetMeshGeometry, METH_VARARGS},
{"GetMeshGeometry", LineSamplerAttributes_GetMeshGeometry, METH_VARARGS},
{"SetArrayConfiguration", LineSamplerAttributes_SetArrayConfiguration, METH_VARARGS},
{"GetArrayConfiguration", LineSamplerAttributes_GetArrayConfiguration, METH_VARARGS},
{"SetBoundary", LineSamplerAttributes_SetBoundary, METH_VARARGS},
......@@ -2000,12 +2004,14 @@ LineSamplerAttributes_compare(PyObject *v, PyObject *w)
PyObject *
PyLineSamplerAttributes_getattr(PyObject *self, char *name)
{
if(strcmp(name, "coordinateSystem") == 0)
return LineSamplerAttributes_GetCoordinateSystem(self, NULL);
if(strcmp(name, "meshGeometry") == 0)
return LineSamplerAttributes_GetMeshGeometry(self, NULL);
if(strcmp(name, "Cartesian") == 0)
return PyInt_FromLong(long(LineSamplerAttributes::Cartesian));
if(strcmp(name, "Cylindrical") == 0)
return PyInt_FromLong(long(LineSamplerAttributes::Cylindrical));
if(strcmp(name, "Toroidal") == 0)
return PyInt_FromLong(long(LineSamplerAttributes::Toroidal));
if(strcmp(name, "arrayConfiguration") == 0)
return LineSamplerAttributes_GetArrayConfiguration(self, NULL);
......@@ -2201,8 +2207,8 @@ PyLineSamplerAttributes_setattr(PyObject *self, char *name, PyObject *args)
Py_INCREF(args);
PyObject *obj = NULL;
if(strcmp(name, "coordinateSystem") == 0)
obj = LineSamplerAttributes_SetCoordinateSystem(self, tuple);
if(strcmp(name, "meshGeometry") == 0)
obj = LineSamplerAttributes_SetMeshGeometry(self, tuple);
else if(strcmp(name, "arrayConfiguration") == 0)
obj = LineSamplerAttributes_SetArrayConfiguration(self, tuple);
else if(strcmp(name, "boundary") == 0)
......
......@@ -91,7 +91,7 @@ class QvisLineSamplerWindow : public QvisOperatorWindow
void UpdateWindow(bool doAll);
virtual void GetCurrentValues(int which_widget);
private slots:
void coordinateSystemChanged(int val);
void meshGeometryChanged(int val);
void arrayConfigurationChanged(int val);
void boundaryChanged(int val);
void nArraysProcessText();
......@@ -147,6 +147,7 @@ class QvisLineSamplerWindow : public QvisOperatorWindow
void EnableGeometry(bool flag);
void EnableList(bool flag);
void UpdateMeshGeometry();
private:
QTabWidget *propertyTabs;
......@@ -168,8 +169,8 @@ class QvisLineSamplerWindow : public QvisOperatorWindow
QPushButton *channelListDeleteAllChannels;
QPushButton *channelListReadChannels;
QPushButton *wallReadFile;
QWidget *coordinateSystem;
QButtonGroup *coordinateSystemButtonGroup;
QWidget *meshGeometry;
QButtonGroup *meshGeometryButtonGroup;
QWidget *arrayConfiguration;
QButtonGroup *arrayConfigurationButtonGroup;
QWidget *boundary;
......@@ -226,8 +227,13 @@ class QvisLineSamplerWindow : public QvisOperatorWindow
// QLineEdit *sampleArc;
QWidget *channelIntegration;
QButtonGroup *channelIntegrationButtonGroup;
QRadioButton *channelIntegrationNone;
QRadioButton *channelIntegrationSummation;
QWidget *toroidalIntegration;
QButtonGroup *toroidalIntegrationButtonGroup;
QRadioButton *toroidalIntegrationNone;
QRadioButton *toroidalIntegrationTime;
QRadioButton *toroidalIntegrationSummation;
QWidget *toroidalAngleSampling;
QButtonGroup *toroidalAngleSamplingButtonGroup;
QLineEdit *toroidalAngleStart;
......@@ -241,7 +247,7 @@ class QvisLineSamplerWindow : public QvisOperatorWindow
QLineEdit *nChannelListArrays;
QLineEdit *channelListToroidalArrayAngle;
QLineEdit *channelListToroidalAngle;
QLabel *coordinateSystemLabel;
QLabel *meshGeometryLabel;
QLabel *arrayConfigurationLabel;
QLabel *boundaryLabel;
QLabel *nArraysLabel;
......
......@@ -282,7 +282,7 @@ avtLineSamplerFilter::Execute()
// Free the memory from the GetAllLeaves function call.
delete [] dsets;
// Time axis value
// Time axis value - only used when time sampling.
double timeAxisValue;
if( atts.GetTimeSampling() ==
......@@ -314,8 +314,6 @@ avtLineSamplerFilter::Execute()
lastTimeAxisValue = timeAxisValue;
}
vtkDataSet *tmp_ds;
double startAngle, stopAngle, deltaAngle;
if( atts.GetToroidalIntegration() ==
......@@ -341,7 +339,12 @@ avtLineSamplerFilter::Execute()
// Embed the sample toroidally as time in an outer loop.
for( cachedAngle=startAngle; cachedAngle<stopAngle; cachedAngle+=deltaAngle )
{
tmp_ds = ExecuteChannelData(currDs, 0, "");
vtkDataSet *tmp_ds = ExecuteChannelData(currDs, 0, "");
if( tmp_ds == NULL )
{
return;
}
if( atts.GetTimeSampling() ==
LineSamplerAttributes::CurrentTimeStep &&
......@@ -349,6 +352,8 @@ avtLineSamplerFilter::Execute()
LineSamplerAttributes::NoToroidalIntegration )
{
composite_ds = tmp_ds;
return;
}
else // if( atts.GetTimeSampling() ==
// LineSamplerAttributes::MultipleTimeSteps ||
......@@ -376,7 +381,7 @@ avtLineSamplerFilter::Execute()
vtkUnstructuredGrid *uGrid;
// First dataset so use it as the basis for the summation.
// First time through, create a dataset for the collating.
if( composite_ds == NULL )
{
//Create and initalize the new dataset
......@@ -406,11 +411,13 @@ avtLineSamplerFilter::Execute()
else //if( atts.GetArrayConfiguration() == LineSamplerAttributes::Manual )
{
nArrays = atts.GetNChannelListArrays();
std::vector<double> listOfChannels = atts.GetChannelList();
// Currently only one type of conf file.
std::vector<double> listOfChannels = atts.GetChannelList();
nChannels = listOfChannels.size() / 4;
}
// Sanity check.
if( nPoints != nArrays* nChannels )
{
std::string msg;
......@@ -428,6 +435,8 @@ avtLineSamplerFilter::Execute()
double nextPathPoint[3];
// When samplng toroidally and over time use the time as the
// major "index" and the angle (0->360) as the minor "index".
if( atts.GetTimeSampling() ==
LineSamplerAttributes::MultipleTimeSteps &&
atts.GetToroidalIntegration() ==
......@@ -437,11 +446,15 @@ avtLineSamplerFilter::Execute()
cachedAngle - (double) (360.0 * (int) (cachedAngle / 360.0));
}
// Pure sampling over time so use the value specifed by the
// user.
else if( atts.GetTimeSampling() ==
LineSamplerAttributes::MultipleTimeSteps )
{
nextPathPoint[0] = timeAxisValue;
}
// Toroidal sampling so use the angle (0->360).
else if( atts.GetToroidalIntegration() ==
LineSamplerAttributes::ToroidalTimeSample )
{
......@@ -592,8 +605,9 @@ avtLineSamplerFilter::ExecuteChannelData(vtkDataSet *in_ds, int, std::string)
if( nArrays > 1 && toroidalArrayAngle == 0)
{
std::string msg;
msg += "The number of array is greater than one. " +
std::string("But the angle between is zero, returning a single array." );
msg += "The number of arrays is greater than one. " +
std::string("But the angle/distance between each is zero, ") +
std::string("returning a single array." );
avtCallback::IssueWarning(msg.c_str());
......@@ -869,6 +883,21 @@ avtLineSamplerFilter::ExecuteChannelData(vtkDataSet *in_ds, int, std::string)
toroidalAngle += (double) a * toroidalArrayAngle;
if( atts.GetMeshGeometry() == LineSamplerAttributes::Cartesian )
{
double yOffset = localBounds[3] - localBounds[2];
while( toroidalAngle < localBounds[2] ) toroidalAngle += yOffset;
while( toroidalAngle > localBounds[3] ) toroidalAngle -= yOffset;
}
else if( atts.GetMeshGeometry() == LineSamplerAttributes::Cylindrical )
{
while( toroidalAngle < 0.0 ) toroidalAngle += 360.0;
while( toroidalAngle > 360.0 ) toroidalAngle -= 360.0;
toroidalAngle = 2.0 * M_PI * toroidalAngle/360.0;
}
// Initial translation based on the user origin for the
// central channel.
avtVector translate( r, 0, z );
......@@ -908,12 +937,15 @@ avtLineSamplerFilter::ExecuteChannelData(vtkDataSet *in_ds, int, std::string)
transform->RotateZ( zTilt );
// Toroidal rotation.
if( toroidalAngle != 0 )
if( atts.GetMeshGeometry() == LineSamplerAttributes::Toroidal &&
toroidalAngle != 0 )
transform->RotateZ( toroidalAngle );
// Transform the normal
applyTransform( transform, normal );
// Transform the start and stop points and check the extents so
// that the channel goes from the start point through the dataset
// appropriately.
......@@ -985,8 +1017,24 @@ avtLineSamplerFilter::ExecuteChannelData(vtkDataSet *in_ds, int, std::string)
checkBounds( in_ds, startPoint, stopPoint );
// Toroidal translation.
if( (atts.GetMeshGeometry() == LineSamplerAttributes::Cartesian ||
atts.GetMeshGeometry() == LineSamplerAttributes::Cylindrical) &&
toroidalAngle != 0 )
{
transform->Identity();
transform->Translate( 0, toroidalAngle, 0 );
applyTransform( transform, startPoint );
applyTransform( transform, stopPoint ); </