Commit e7525333 authored by allens's avatar allens

removed the coordinate transfrom from the operator

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23700 18c085ea-50e0-402c-830e-de6fd14e8384
parent 7c686361
......@@ -250,7 +250,6 @@ IntegralCurveAttributes::ChangesRequireRecalculation(const IntegralCurveAttribut
cropEndFlag != obj.cropEndFlag ||
cropEnd != obj.cropEnd ||
cropValue != obj.cropValue ||
coordinateSystem != obj.coordinateSystem ||
showPoints != obj.showPoints ||
showLines != obj.showLines ||
pathlines != obj.pathlines ||
......
......@@ -45,11 +45,6 @@
Tubes
Ribbons
</Enum>
<Enum name="CoordinateSystem">
AsIs
CylindricalToCartesian
CartesianToCylindrical
</Enum>
<Enum name="IntegrationDirection">
Forward
Backward
......@@ -245,9 +240,6 @@
<Field name="displayGeometry" label="Display geometry" type="enum" subtype="DisplayGeometry">
Lines
</Field>
<Field name="coordinateSystem" label="coordinateSystem" type="enum" subtype="CoordinateSystem">
AsIs
</Field>
<Field name="showLines" label="Show Lines" type="bool">
true
</Field>
......
......@@ -201,44 +201,6 @@ IntegralCurveAttributes::DisplayGeometry_FromString(const std::string &s, Integr
return false;
}
//
// Enum conversion methods for IntegralCurveAttributes::CoordinateSystem
//
static const char *CoordinateSystem_strings[] = {
"AsIs", "CylindricalToCartesian", "CartesianToCylindrical"
};
std::string
IntegralCurveAttributes::CoordinateSystem_ToString(IntegralCurveAttributes::CoordinateSystem t)
{
int index = int(t);
if(index < 0 || index >= 3) index = 0;
return CoordinateSystem_strings[index];
}
std::string
IntegralCurveAttributes::CoordinateSystem_ToString(int t)
{
int index = (t < 0 || t >= 3) ? 0 : t;
return CoordinateSystem_strings[index];
}
bool
IntegralCurveAttributes::CoordinateSystem_FromString(const std::string &s, IntegralCurveAttributes::CoordinateSystem &val)
{
val = IntegralCurveAttributes::AsIs;
for(int i = 0; i < 3; ++i)
{
if(s == CoordinateSystem_strings[i])
{
val = (CoordinateSystem)i;
return true;
}
}
return false;
}
//
// Enum conversion methods for IntegralCurveAttributes::IntegrationDirection
//
......@@ -556,7 +518,6 @@ void IntegralCurveAttributes::Init()
pathlinesPeriod = 0;
pathlinesCMFE = POS_CMFE;
displayGeometry = Lines;
coordinateSystem = AsIs;
showLines = true;
showPoints = false;
cropBeginFlag = false;
......@@ -672,7 +633,6 @@ void IntegralCurveAttributes::Copy(const IntegralCurveAttributes &obj)
pathlinesPeriod = obj.pathlinesPeriod;
pathlinesCMFE = obj.pathlinesCMFE;
displayGeometry = obj.displayGeometry;
coordinateSystem = obj.coordinateSystem;
showLines = obj.showLines;
showPoints = obj.showPoints;
cropBeginFlag = obj.cropBeginFlag;
......@@ -943,7 +903,6 @@ IntegralCurveAttributes::operator == (const IntegralCurveAttributes &obj) const
(pathlinesPeriod == obj.pathlinesPeriod) &&
(pathlinesCMFE == obj.pathlinesCMFE) &&
(displayGeometry == obj.displayGeometry) &&
(coordinateSystem == obj.coordinateSystem) &&
(showLines == obj.showLines) &&
(showPoints == obj.showPoints) &&
(cropBeginFlag == obj.cropBeginFlag) &&
......@@ -1268,7 +1227,6 @@ IntegralCurveAttributes::SelectAll()
Select(ID_pathlinesPeriod, (void *)&pathlinesPeriod);
Select(ID_pathlinesCMFE, (void *)&pathlinesCMFE);
Select(ID_displayGeometry, (void *)&displayGeometry);
Select(ID_coordinateSystem, (void *)&coordinateSystem);
Select(ID_showLines, (void *)&showLines);
Select(ID_showPoints, (void *)&showPoints);
Select(ID_cropBeginFlag, (void *)&cropBeginFlag);
......@@ -1589,12 +1547,6 @@ IntegralCurveAttributes::CreateNode(DataNode *parentNode, bool completeSave, boo
node->AddNode(new DataNode("displayGeometry", DisplayGeometry_ToString(displayGeometry)));
}
if(completeSave || !FieldsEqual(ID_coordinateSystem, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("coordinateSystem", CoordinateSystem_ToString(coordinateSystem)));
}
if(completeSave || !FieldsEqual(ID_showLines, &defaultObject))
{
addToParent = true;
......@@ -1989,22 +1941,6 @@ IntegralCurveAttributes::SetFromNode(DataNode *parentNode)
SetDisplayGeometry(value);
}
}
if((node = searchNode->GetNode("coordinateSystem")) != 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 < 3)
SetCoordinateSystem(CoordinateSystem(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
CoordinateSystem value;
if(CoordinateSystem_FromString(node->AsString(), value))
SetCoordinateSystem(value);
}
}
if((node = searchNode->GetNode("showLines")) != 0)
SetShowLines(node->AsBool());
if((node = searchNode->GetNode("showPoints")) != 0)
......@@ -2412,13 +2348,6 @@ IntegralCurveAttributes::SetDisplayGeometry(IntegralCurveAttributes::DisplayGeom
Select(ID_displayGeometry, (void *)&displayGeometry);
}
void
IntegralCurveAttributes::SetCoordinateSystem(IntegralCurveAttributes::CoordinateSystem coordinateSystem_)
{
coordinateSystem = coordinateSystem_;
Select(ID_coordinateSystem, (void *)&coordinateSystem);
}
void
IntegralCurveAttributes::SetShowLines(bool showLines_)
{
......@@ -2921,12 +2850,6 @@ IntegralCurveAttributes::GetDisplayGeometry() const
return DisplayGeometry(displayGeometry);
}
IntegralCurveAttributes::CoordinateSystem
IntegralCurveAttributes::GetCoordinateSystem() const
{
return CoordinateSystem(coordinateSystem);
}
bool
IntegralCurveAttributes::GetShowLines() const
{
......@@ -3221,7 +3144,6 @@ IntegralCurveAttributes::GetFieldName(int index) const
case ID_pathlinesPeriod: return "pathlinesPeriod";
case ID_pathlinesCMFE: return "pathlinesCMFE";
case ID_displayGeometry: return "displayGeometry";
case ID_coordinateSystem: return "coordinateSystem";
case ID_showLines: return "showLines";
case ID_showPoints: return "showPoints";
case ID_cropBeginFlag: return "cropBeginFlag";
......@@ -3314,7 +3236,6 @@ IntegralCurveAttributes::GetFieldType(int index) const
case ID_pathlinesPeriod: return FieldType_double;
case ID_pathlinesCMFE: return FieldType_enum;
case ID_displayGeometry: return FieldType_enum;
case ID_coordinateSystem: return FieldType_enum;
case ID_showLines: return FieldType_bool;
case ID_showPoints: return FieldType_bool;
case ID_cropBeginFlag: return FieldType_bool;
......@@ -3407,7 +3328,6 @@ IntegralCurveAttributes::GetFieldTypeName(int index) const
case ID_pathlinesPeriod: return "double";
case ID_pathlinesCMFE: return "enum";
case ID_displayGeometry: return "enum";
case ID_coordinateSystem: return "enum";
case ID_showLines: return "bool";
case ID_showPoints: return "bool";
case ID_cropBeginFlag: return "bool";
......@@ -3723,11 +3643,6 @@ IntegralCurveAttributes::FieldsEqual(int index_, const AttributeGroup *rhs) cons
retval = (displayGeometry == obj.displayGeometry);
}
break;
case ID_coordinateSystem:
{ // new scope
retval = (coordinateSystem == obj.coordinateSystem);
}
break;
case ID_showLines:
{ // new scope
retval = (showLines == obj.showLines);
......@@ -3931,7 +3846,6 @@ IntegralCurveAttributes::ChangesRequireRecalculation(const IntegralCurveAttribut
cropEndFlag != obj.cropEndFlag ||
cropEnd != obj.cropEnd ||
cropValue != obj.cropValue ||
coordinateSystem != obj.coordinateSystem ||
showPoints != obj.showPoints ||
showLines != obj.showLines ||
pathlines != obj.pathlines ||
......
......@@ -97,12 +97,6 @@ public:
Tubes,
Ribbons
};
enum CoordinateSystem
{
AsIs,
CylindricalToCartesian,
CartesianToCylindrical
};
enum IntegrationDirection
{
Forward,
......@@ -228,7 +222,6 @@ public:
void SetPathlinesPeriod(double pathlinesPeriod_);
void SetPathlinesCMFE(PathlinesCMFE pathlinesCMFE_);
void SetDisplayGeometry(DisplayGeometry displayGeometry_);
void SetCoordinateSystem(CoordinateSystem coordinateSystem_);
void SetShowLines(bool showLines_);
void SetShowPoints(bool showPoints_);
void SetCropBeginFlag(bool cropBeginFlag_);
......@@ -310,7 +303,6 @@ public:
double GetPathlinesPeriod() const;
PathlinesCMFE GetPathlinesCMFE() const;
DisplayGeometry GetDisplayGeometry() const;
CoordinateSystem GetCoordinateSystem() const;
bool GetShowLines() const;
bool GetShowPoints() const;
bool GetCropBeginFlag() const;
......@@ -361,11 +353,6 @@ public:
static bool DisplayGeometry_FromString(const std::string &, DisplayGeometry &);
protected:
static std::string DisplayGeometry_ToString(int);
public:
static std::string CoordinateSystem_ToString(CoordinateSystem);
static bool CoordinateSystem_FromString(const std::string &, CoordinateSystem &);
protected:
static std::string CoordinateSystem_ToString(int);
public:
static std::string IntegrationDirection_ToString(IntegrationDirection);
static bool IntegrationDirection_FromString(const std::string &, IntegrationDirection &);
......@@ -453,7 +440,6 @@ public:
ID_pathlinesPeriod,
ID_pathlinesCMFE,
ID_displayGeometry,
ID_coordinateSystem,
ID_showLines,
ID_showPoints,
ID_cropBeginFlag,
......@@ -526,7 +512,6 @@ private:
double pathlinesPeriod;
int pathlinesCMFE;
int displayGeometry;
int coordinateSystem;
bool showLines;
bool showPoints;
bool cropBeginFlag;
......@@ -556,6 +541,6 @@ private:
static const char *TypeMapFormatString;
static const private_tmfs_t TmfsStruct;
};
#define INTEGRALCURVEATTRIBUTES_TMFS "iDDDDDDdDDbd*iiiisiibdbddbddiddidDiiiiibbddiiibbbdbdidddbbiibbbbddddis"
#define INTEGRALCURVEATTRIBUTES_TMFS "iDDDDDDdDDbd*iiiisiibdbddbddiddidDiiiiibbddiibbbdbdidddbbiibbbbddddis"
#endif
......@@ -552,25 +552,6 @@ PyIntegralCurveAttributes_ToString(const IntegralCurveAttributes *atts, const ch
break;
}
const char *coordinateSystem_names = "AsIs, CylindricalToCartesian, CartesianToCylindrical";
switch (atts->GetCoordinateSystem())
{
case IntegralCurveAttributes::AsIs:
SNPRINTF(tmpStr, 1000, "%scoordinateSystem = %sAsIs # %s\n", prefix, prefix, coordinateSystem_names);
str += tmpStr;
break;
case IntegralCurveAttributes::CylindricalToCartesian:
SNPRINTF(tmpStr, 1000, "%scoordinateSystem = %sCylindricalToCartesian # %s\n", prefix, prefix, coordinateSystem_names);
str += tmpStr;
break;
case IntegralCurveAttributes::CartesianToCylindrical:
SNPRINTF(tmpStr, 1000, "%scoordinateSystem = %sCartesianToCylindrical # %s\n", prefix, prefix, coordinateSystem_names);
str += tmpStr;
break;
default:
break;
}
if(atts->GetShowLines())
SNPRINTF(tmpStr, 1000, "%sshowLines = 1\n", prefix);
else
......@@ -2142,39 +2123,6 @@ IntegralCurveAttributes_GetDisplayGeometry(PyObject *self, PyObject *args)
return retval;
}
/*static*/ PyObject *
IntegralCurveAttributes_SetCoordinateSystem(PyObject *self, PyObject *args)
{
IntegralCurveAttributesObject *obj = (IntegralCurveAttributesObject *)self;
int ival;
if(!PyArg_ParseTuple(args, "i", &ival))
return NULL;
// Set the coordinateSystem in the object.
if(ival >= 0 && ival < 3)
obj->data->SetCoordinateSystem(IntegralCurveAttributes::CoordinateSystem(ival));
else
{
fprintf(stderr, "An invalid coordinateSystem value was given. "
"Valid values are in the range of [0,2]. "
"You can also use the following names: "
"AsIs, CylindricalToCartesian, CartesianToCylindrical.");
return NULL;
}
Py_INCREF(Py_None);
return Py_None;
}
/*static*/ PyObject *
IntegralCurveAttributes_GetCoordinateSystem(PyObject *self, PyObject *args)
{
IntegralCurveAttributesObject *obj = (IntegralCurveAttributesObject *)self;
PyObject *retval = PyInt_FromLong(long(obj->data->GetCoordinateSystem()));
return retval;
}
/*static*/ PyObject *
IntegralCurveAttributes_SetShowLines(PyObject *self, PyObject *args)
{
......@@ -2861,8 +2809,6 @@ PyMethodDef PyIntegralCurveAttributes_methods[INTEGRALCURVEATTRIBUTES_NMETH] = {
{"GetPathlinesCMFE", IntegralCurveAttributes_GetPathlinesCMFE, METH_VARARGS},
{"SetDisplayGeometry", IntegralCurveAttributes_SetDisplayGeometry, METH_VARARGS},
{"GetDisplayGeometry", IntegralCurveAttributes_GetDisplayGeometry, METH_VARARGS},
{"SetCoordinateSystem", IntegralCurveAttributes_SetCoordinateSystem, METH_VARARGS},
{"GetCoordinateSystem", IntegralCurveAttributes_GetCoordinateSystem, METH_VARARGS},
{"SetShowLines", IntegralCurveAttributes_SetShowLines, METH_VARARGS},
{"GetShowLines", IntegralCurveAttributes_GetShowLines, METH_VARARGS},
{"SetShowPoints", IntegralCurveAttributes_SetShowPoints, METH_VARARGS},
......@@ -3126,15 +3072,6 @@ PyIntegralCurveAttributes_getattr(PyObject *self, char *name)
if(strcmp(name, "Ribbons") == 0)
return PyInt_FromLong(long(IntegralCurveAttributes::Ribbons));
if(strcmp(name, "coordinateSystem") == 0)
return IntegralCurveAttributes_GetCoordinateSystem(self, NULL);
if(strcmp(name, "AsIs") == 0)
return PyInt_FromLong(long(IntegralCurveAttributes::AsIs));
if(strcmp(name, "CylindricalToCartesian") == 0)
return PyInt_FromLong(long(IntegralCurveAttributes::CylindricalToCartesian));
if(strcmp(name, "CartesianToCylindrical") == 0)
return PyInt_FromLong(long(IntegralCurveAttributes::CartesianToCylindrical));
if(strcmp(name, "showLines") == 0)
return IntegralCurveAttributes_GetShowLines(self, NULL);
if(strcmp(name, "showPoints") == 0)
......@@ -3297,8 +3234,6 @@ PyIntegralCurveAttributes_setattr(PyObject *self, char *name, PyObject *args)
obj = IntegralCurveAttributes_SetPathlinesCMFE(self, tuple);
else if(strcmp(name, "displayGeometry") == 0)
obj = IntegralCurveAttributes_SetDisplayGeometry(self, tuple);
else if(strcmp(name, "coordinateSystem") == 0)
obj = IntegralCurveAttributes_SetCoordinateSystem(self, tuple);
else if(strcmp(name, "showLines") == 0)
obj = IntegralCurveAttributes_SetShowLines(self, tuple);
else if(strcmp(name, "showPoints") == 0)
......
......@@ -44,7 +44,7 @@
//
// Functions exposed to the VisIt module.
//
#define INTEGRALCURVEATTRIBUTES_NMETH 140
#define INTEGRALCURVEATTRIBUTES_NMETH 138
void PyIntegralCurveAttributes_StartUp(IntegralCurveAttributes *subj, void *data);
void PyIntegralCurveAttributes_CloseDown();
PyMethodDef * PyIntegralCurveAttributes_GetMethodTable(int *nMethods);
......
......@@ -824,31 +824,6 @@ QvisIntegralCurveWindow::CreateAppearanceTab(QWidget *pageAppearance)
SLOT(showPointsChanged(bool)));
displayLayout->addWidget(showPoints, 0, 1);
// Create the coordinate group
QGroupBox *coordinateGrp = new QGroupBox(central);
coordinateGrp->setTitle(tr("Coordinate transform"));
mainLayout->addWidget(coordinateGrp, 2, 0);
QGridLayout *coordinateLayout = new QGridLayout(coordinateGrp);
coordinateLayout->setMargin(5);
coordinateLayout->setSpacing(10);
coordinateButtonGroup = new QButtonGroup(coordinateGrp);
QRadioButton *asIsButton = new QRadioButton(tr("None"), coordinateGrp);
QRadioButton *toCartesianButton = new QRadioButton(tr("Cylindrical to Cartesian"), coordinateGrp);
QRadioButton *toCylindricalButton = new QRadioButton(tr("Cartesian to Cylindrical"), coordinateGrp);
coordinateButtonGroup->addButton(asIsButton, 0);
coordinateButtonGroup->addButton(toCartesianButton, 1);
coordinateButtonGroup->addButton(toCylindricalButton, 2);
coordinateLayout->addWidget(asIsButton, 0, 0);
coordinateLayout->addWidget(toCartesianButton, 0, 1);
coordinateLayout->addWidget(toCylindricalButton, 0, 2);
connect(coordinateButtonGroup, SIGNAL(buttonClicked(int)), this,
SLOT(coordinateButtonGroupChanged(int)));
// Create the crop group
QGroupBox *cropGrp = new QGroupBox(pageAppearance);
cropGrp->setTitle(tr("Crop a portion of the integral curve (for animations)"));
......@@ -1495,11 +1470,6 @@ QvisIntegralCurveWindow::UpdateWindow(bool doAll)
parallelAlgo->setCurrentIndex(atts->GetParallelizationAlgorithmType());
parallelAlgo->blockSignals(false);
break;
case IntegralCurveAttributes::ID_coordinateSystem:
coordinateButtonGroup->blockSignals(true);
coordinateButtonGroup->button(atts->GetCoordinateSystem())->setChecked(true);
coordinateButtonGroup->blockSignals(false);
break;
case IntegralCurveAttributes::ID_maxProcessCount:
maxSLCount->blockSignals(true);
maxSLCount->setValue(atts->GetMaxProcessCount());
......@@ -2975,13 +2945,6 @@ QvisIntegralCurveWindow::dataVariableChanged(const QString &var)
Apply();
}
void
QvisIntegralCurveWindow::coordinateButtonGroupChanged(int val)
{
atts->SetCoordinateSystem((IntegralCurveAttributes::CoordinateSystem) val);
Apply();
}
void
QvisIntegralCurveWindow::absTolProcessText()
{
......
......@@ -258,8 +258,6 @@ class QvisIntegralCurveWindow : public QvisOperatorWindow
void showLinesChanged(bool val);
void showPointsChanged(bool val);
void coordinateButtonGroupChanged(int val);
// Advanced
void parallelAlgorithmChanged(int val);
void maxSLCountChanged(int val);
......@@ -365,8 +363,6 @@ class QvisIntegralCurveWindow : public QvisOperatorWindow
QCheckBox *showLines;
QCheckBox *showPoints;
QButtonGroup *coordinateButtonGroup;
// Advanced
QLabel *parallelAlgoLabel;
QComboBox *parallelAlgo;
......
......@@ -67,9 +67,7 @@
#include <limits>
std::string avtIntegralCurveFilter::colorVarArrayName = "colorVar";
std::string avtIntegralCurveFilter::thetaArrayName = "theta";
std::string avtIntegralCurveFilter::tangentsArrayName = "tangents";
......@@ -672,8 +670,6 @@ avtIntegralCurveFilter::SetAtts(const AttributeGroup *a)
}
SetVelocitiesForLighting(1);
SetCoordinateSystem(atts.GetCoordinateSystem());
}
// ****************************************************************************
......@@ -2532,50 +2528,9 @@ avtIntegralCurveFilter::CreateIntegralCurveOutput(std::vector<avtIntegralCurve *
line->GetPointIds()->SetId(j-beginIndex, pIdx);
double pt[3] = {0, 0, 0};
if( coordinateSystem == 0 )
{
pt[0] = s.position.x;
pt[1] = s.position.y;
pt[2] = s.position.z;
}
else if( coordinateSystem == 1 )
{
pt[0] = s.position.x*cos(s.position.y);
pt[1] = s.position.x*sin(s.position.y);
pt[2] = s.position.z;
}
else if( coordinateSystem == 2 )
{
pt[0] = sqrt(s.position.x*s.position.x+
s.position.y*s.position.y);
pt[1] = atan2( s.position.y, s.position.x );
pt[2] = s.position.z;
// Check for going past 2*pi mark in the CCW dirrection.
if( lastPhi < 0 && 0 < pt[1] && pt[1] - lastPhi > 1.75 * M_PI )
{
angle -= 2.0 * M_PI;
}
// Check for going past 2*pi mark in the CW dirrection.
if( pt[1] < 0 && 0 < lastPhi && lastPhi - pt[1] > 1.75 * M_PI )
{
angle += 2.0 * M_PI;
}
// Store the relative phi value
lastPhi = pt[1];
// Update to get teh absolute phi value.
pt[1] += angle;
}
// Points
points->InsertPoint(pIdx, pt[0], pt[1], pt[2] );
points->InsertPoint(pIdx,
s.position.x, s.position.y, s.position.z);
float speed = s.velocity.length();
......@@ -2583,8 +2538,8 @@ avtIntegralCurveFilter::CreateIntegralCurveOutput(std::vector<avtIntegralCurve *
s.velocity *= 1.0f/speed;
// Tangents
tangents->InsertTuple3(pIdx,
s.velocity.x, s.velocity.y, s.velocity.z);
tangents->
InsertTuple3(pIdx, s.velocity.x, s.velocity.y, s.velocity.z);
double data_value = 0.0f;
......@@ -2648,6 +2603,8 @@ avtIntegralCurveFilter::CreateIntegralCurveOutput(std::vector<avtIntegralCurve *
if( atts.GetShowPoints() )
{
double pt[3] = {s.position.x, s.position.y, s.position.z};
vtkPolyData *vert = CreateVTKVertex(pt, data_value,
secondaryVariables,
s.secondarys );
......
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