Commit 6e458e26 authored by hrchilds's avatar hrchilds

Update from November 21, 2003

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@128 18c085ea-50e0-402c-830e-de6fd14e8384
parent efbf7758
......@@ -1677,6 +1677,9 @@ HostProfile::GetShortHostname() const
// Jeremy Meredith, Mon Apr 14 14:35:07 PDT 2003
// Added ability to append a common suffix from patterns.
//
// Jeremy Meredith, Fri Nov 14 10:37:59 PST 2003
// Removed the suffix for now, and stop at the first dot.
//
// ****************************************************************************
std::string
HostProfile::GetShortHostname(const std::string &host)
......@@ -1706,7 +1709,7 @@ HostProfile::GetShortHostname(const std::string &host)
if (patterns[i][p] != c)
c = '\0';
}
if (!c)
if (c=='\0' || c=='.')
break;
if (c != '*' && c != '?')
prefix += c;
......@@ -1728,7 +1731,8 @@ HostProfile::GetShortHostname(const std::string &host)
}
// combine the short name
shortname = prefix + suffix;
//shortname = prefix + suffix;
shortname = prefix;
if (prefix.empty())
return patterns[0];
else
......
......@@ -128,6 +128,9 @@ Definition:
// Jeremy Meredith, Mon Apr 14 14:35:07 PDT 2003
// Added ability to append a common suffix from patterns.
//
// Jeremy Meredith, Fri Nov 14 10:37:59 PST 2003
// Removed the suffix for now, and stop at the first dot.
//
// ****************************************************************************
std::string
HostProfile::GetShortHostname(const std::string &host)
......@@ -157,7 +160,7 @@ HostProfile::GetShortHostname(const std::string &host)
if (patterns[i][p] != c)
c = '\0';
}
if (!c)
if (c=='\0' || c=='.')
break;
if (c != '*' && c != '?')
prefix += c;
......@@ -179,7 +182,8 @@ HostProfile::GetShortHostname(const std::string &host)
}
// combine the short name
shortname = prefix + suffix;
//shortname = prefix + suffix;
shortname = prefix;
if (prefix.empty())
return patterns[0];
else
......
......@@ -107,12 +107,17 @@ Navigate2D::StartLeftButtonAction()
// Kathleen Bonnell, Fri Dec 13 14:07:15 PST 2002
// Removed arguments to match vtk's new interactor api.
//
// Eric Brugger, Thu Nov 20 15:24:17 PST 2003
// Added code to call the view callback.
//
// ****************************************************************************
void
Navigate2D::EndLeftButtonAction()
{
EndPan();
IssueViewCallback();
}
......@@ -161,12 +166,17 @@ Navigate2D::StartMiddleButtonAction()
// Removed arguments to match vtk's new interactor api. Zoom no longer
// implemented by parent class, Dolly performs same function.
//
// Eric Brugger, Thu Nov 20 15:24:17 PST 2003
// Added code to call the view callback.
//
// ****************************************************************************
void
Navigate2D::EndMiddleButtonAction()
{
EndDolly();
IssueViewCallback();
}
......
......@@ -199,6 +199,9 @@ Navigate3D::StartLeftButtonAction()
// Kathleen Bonnell, Fri Dec 13 14:07:15 PST 2002
// Removed arguments to match vtk's new interactor api.
//
// Eric Brugger, Thu Nov 20 15:24:48 PST 2003
// Added code to call the view callback.
//
// ****************************************************************************
void
......@@ -220,6 +223,8 @@ Navigate3D::EndLeftButtonAction()
}
EndBoundingBox();
IssueViewCallback();
}
......@@ -281,6 +286,9 @@ Navigate3D::StartMiddleButtonAction()
// Kathleen Bonnell, Fri Dec 13 14:07:15 PST 2002
// Removed arguments to match vtk's new interactor api.
//
// Eric Brugger, Thu Nov 20 15:24:48 PST 2003
// Added code to call the view callback.
//
// ****************************************************************************
void
......@@ -289,6 +297,8 @@ Navigate3D::EndMiddleButtonAction()
EndZoom();
EndBoundingBox();
IssueViewCallback();
}
......
......@@ -93,12 +93,18 @@ NavigateCurve::StartLeftButtonAction()
// Programmer: Eric Brugger
// Creation: October 15, 2003
//
// Modifications:
// Eric Brugger, Thu Nov 20 15:22:59 PST 2003
// Added code to call the view callback.
//
// ****************************************************************************
void
NavigateCurve::EndLeftButtonAction()
{
EndPan();
IssueViewCallback();
}
......@@ -131,12 +137,18 @@ NavigateCurve::StartMiddleButtonAction()
// Programmer: Eric Brugger
// Creation: October 15, 2003
//
// Modifications:
// Eric Brugger, Thu Nov 20 15:22:59 PST 2003
// Added code to call the view callback.
//
// ****************************************************************************
void
NavigateCurve::EndMiddleButtonAction()
{
EndDolly();
IssueViewCallback();
}
......
......@@ -156,13 +156,17 @@ VisitInteractor::MotionBegin(void)
// Programmer: Hank Childs
// Creation: July 11, 2002
//
// Modifications:
// Eric Brugger, Thu Nov 20 15:10:46 PST 2003
// Remove the call to the view callback and have the derived classes do
// it where appropriate since it was getting called too often.
//
// ****************************************************************************
void
VisitInteractor::MotionEnd(void)
{
proxy.MotionEnd();
IssueViewCallback();
}
......
......@@ -125,6 +125,9 @@ Zoom2D::StartLeftButtonAction()
// Kathleen Bonnell, Fri Dec 13 16:41:12 PST 2002
// Removed arguments to comply with vtk's new interactor interface.
//
// Eric Brugger, Fri Nov 21 08:02:55 PST 2003
// Added code to call the view callback.
//
// ****************************************************************************
void
......@@ -133,6 +136,7 @@ Zoom2D::EndLeftButtonAction()
EndRubberBand();
ZoomCamera();
EndZoom();
IssueViewCallback();
}
......@@ -205,12 +209,16 @@ Zoom2D::StartMiddleButtonAction()
// Kathleen Bonnell, Fri Dec 13 16:41:12 PST 2002
// Removed arguments to comply with vtk's new interactor interface.
//
// Eric Brugger, Fri Nov 21 08:02:55 PST 2003
// Added code to call the view callback.
//
// ****************************************************************************
void
Zoom2D::EndMiddleButtonAction()
{
EndZoom();
IssueViewCallback();
}
......
......@@ -78,6 +78,9 @@ Zoom3D::StartLeftButtonAction()
// Kathleen Bonnell, Fri Dec 13 16:41:12 PST 2002
// Removed arguments in order to comply with vtk's new interactor interface.
//
// Eric Brugger, Fri Nov 21 08:03:45 PST 2003
// Added code to call the view callback.
//
// ****************************************************************************
void
......@@ -86,6 +89,7 @@ Zoom3D::EndLeftButtonAction()
EndRubberBand();
ZoomCamera();
EndZoom();
IssueViewCallback();
}
......@@ -162,6 +166,9 @@ Zoom3D::StartMiddleButtonAction()
// Kathleen Bonnell, Fri Dec 13 16:41:12 PST 2002
// Removed arguments in order to comply with vtk's new interactor interface.
//
// Eric Brugger, Fri Nov 21 08:03:45 PST 2003
// Added code to call the view callback.
//
// ****************************************************************************
void
......@@ -170,6 +177,8 @@ Zoom3D::EndMiddleButtonAction()
EndZoom();
EndBoundingBox();
IssueViewCallback();
}
......
......@@ -80,6 +80,9 @@ ZoomCurve::StartLeftButtonAction()
// Kathleen Bonnell, Fri Dec 13 16:41:12 PST 2002
// Removed arguments to comply with vtk's new interactor interface.
//
// Eric Brugger, Fri Nov 21 08:00:11 PST 2003
// Added code to call the view callback.
//
// ****************************************************************************
void
......@@ -88,6 +91,7 @@ ZoomCurve::EndLeftButtonAction()
EndRubberBand();
ZoomCamera();
EndZoom();
IssueViewCallback();
}
......@@ -160,12 +164,16 @@ ZoomCurve::StartMiddleButtonAction()
// Kathleen Bonnell, Fri Dec 13 16:41:12 PST 2002
// Removed arguments to comply with vtk's new interactor interface.
//
// Eric Brugger, Fri Nov 21 08:00:11 PST 2003
// Added code to call the view callback.
//
// ****************************************************************************
void
ZoomCurve::EndMiddleButtonAction()
{
EndZoom();
IssueViewCallback();
}
......@@ -273,7 +281,6 @@ ZoomCurve::ZoomCamera(void)
void
ZoomCurve::ZoomCamera(const int x, const int y)
{
cerr << "ZoomCurve::ZoomCamera(const int x, const int y)" << endl;
vtkRenderWindowInteractor *rwi = Interactor;
if (OldY != y)
......
package llnl.visit.plots;
import llnl.visit.AttributeSubject;
import llnl.visit.CommunicationBuffer;
import llnl.visit.Plugin;
// ****************************************************************************
// Class: KerbelAttributes
//
// Purpose:
// This class contains the attributes for a Kerbel plot.
//
// Notes: Autogenerated by xml2java.
//
// Programmer: xml2java
// Creation: Fri Nov 21 10:28:29 PDT 2003
//
// Modifications:
//
// ****************************************************************************
public class KerbelAttributes extends AttributeSubject implements Plugin
{
public KerbelAttributes()
{
super(3);
Center = new float[3];
Center[0] = 0f;
Center[1] = 0f;
Center[2] = 0f;
Radius = 1f;
filename = new String("save.xml");
}
public KerbelAttributes(KerbelAttributes obj)
{
super(3);
int i;
Center = new float[3];
Center[0] = obj.Center[0];
Center[1] = obj.Center[1];
Center[2] = obj.Center[2];
Radius = obj.Radius;
filename = new String(obj.filename);
SelectAll();
}
public boolean equals(KerbelAttributes obj)
{
int i;
// Compare the Center arrays.
boolean Center_equal = true;
for(i = 0; i < 3 && Center_equal; ++i)
Center_equal = (Center[i] == obj.Center[i]);
// Create the return value
return (Center_equal &&
(Radius == obj.Radius) &&
(filename == obj.filename));
}
public String GetName() { return "Kerbel"; }
public String GetVersion() { return "1.0"; }
// Property setting methods
public void SetCenter(float[] Center_)
{
Center[0] = Center_[0];
Center[1] = Center_[1];
Center[2] = Center_[2];
Select(0);
}
public void SetCenter(float e0, float e1, float e2)
{
Center[0] = e0;
Center[1] = e1;
Center[2] = e2;
Select(0);
}
public void SetRadius(float Radius_)
{
Radius = Radius_;
Select(1);
}
public void SetFilename(String filename_)
{
filename = filename_;
Select(2);
}
// Property getting methods
public float[] GetCenter() { return Center; }
public float GetRadius() { return Radius; }
public String GetFilename() { return filename; }
// Write and read methods.
public void WriteAtts(CommunicationBuffer buf)
{
if(WriteSelect(0, buf))
buf.WriteFloatArray(Center);
if(WriteSelect(1, buf))
buf.WriteFloat(Radius);
if(WriteSelect(2, buf))
buf.WriteString(filename);
}
public void ReadAtts(int n, CommunicationBuffer buf)
{
for(int i = 0; i < n; ++i)
{
int index = (int)buf.ReadByte();
switch(index)
{
case 0:
SetCenter(buf.ReadFloatArray());
break;
case 1:
SetRadius(buf.ReadFloat());
break;
case 2:
SetFilename(buf.ReadString());
break;
}
}
}
// Attributes
private float[] Center;
private float Radius;
private String filename;
}
......@@ -11,7 +11,7 @@
// Note: Autogenerated by xml2python. Do not modify by hand!
//
// Programmer: xml2python
// Creation: Thu Sep 11 11:50:28 PDT 2003
// Creation: Fri Nov 21 11:28:58 PDT 2003
//
// ****************************************************************************
......@@ -380,6 +380,39 @@ VectorAttributes_GetColorTableName(PyObject *self, PyObject *args)
return retval;
}
static PyObject *
VectorAttributes_SetVectorOrigin(PyObject *self, PyObject *args)
{
VectorAttributesObject *obj = (VectorAttributesObject *)self;
int ival;
if(!PyArg_ParseTuple(args, "i", &ival))
return NULL;
// Set the vectorOrigin in the object.
if(ival >= 0 && ival < 3)
obj->data->SetVectorOrigin(VectorAttributes::OriginType(ival));
else
{
fprintf(stderr, "An invalid vectorOrigin value was given. "
"Valid values are in the range of [0,2]. "
"You can also use the following names: "
"Head, Middle, Tail.");
return NULL;
}
Py_INCREF(Py_None);
return Py_None;
}
static PyObject *
VectorAttributes_GetVectorOrigin(PyObject *self, PyObject *args)
{
VectorAttributesObject *obj = (VectorAttributesObject *)self;
PyObject *retval = PyInt_FromLong(long(obj->data->GetVectorOrigin()));
return retval;
}
static struct PyMethodDef VectorAttributes_methods[] = {
......@@ -408,6 +441,8 @@ static struct PyMethodDef VectorAttributes_methods[] = {
{"GetVectorColor", VectorAttributes_GetVectorColor, METH_VARARGS},
{"SetColorTableName", VectorAttributes_SetColorTableName, METH_VARARGS},
{"GetColorTableName", VectorAttributes_GetColorTableName, METH_VARARGS},
{"SetVectorOrigin", VectorAttributes_SetVectorOrigin, METH_VARARGS},
{"GetVectorOrigin", VectorAttributes_GetVectorOrigin, METH_VARARGS},
{NULL, NULL}
};
......@@ -458,6 +493,15 @@ VectorAttributes_getattr(PyObject *self, char *name)
return VectorAttributes_GetVectorColor(self, NULL);
if(strcmp(name, "colorTableName") == 0)
return VectorAttributes_GetColorTableName(self, NULL);
if(strcmp(name, "vectorOrigin") == 0)
return VectorAttributes_GetVectorOrigin(self, NULL);
if(strcmp(name, "Head") == 0)
return PyInt_FromLong(long(VectorAttributes::Head));
else if(strcmp(name, "Middle") == 0)
return PyInt_FromLong(long(VectorAttributes::Middle));
else if(strcmp(name, "Tail") == 0)
return PyInt_FromLong(long(VectorAttributes::Tail));
return Py_FindMethod(VectorAttributes_methods, self, name);
}
......@@ -496,6 +540,8 @@ VectorAttributes_setattr(PyObject *self, char *name, PyObject *args)
retval = (VectorAttributes_SetVectorColor(self, tuple) != NULL);
else if(strcmp(name, "colorTableName") == 0)
retval = (VectorAttributes_SetColorTableName(self, tuple) != NULL);
else if(strcmp(name, "vectorOrigin") == 0)
retval = (VectorAttributes_SetVectorOrigin(self, tuple) != NULL);
Py_DECREF(tuple);
return retval ? 0 : -1;
......@@ -531,6 +577,14 @@ VectorAttributes_print(PyObject *v, FILE *fp, int flags)
const unsigned char *vectorColor = obj->data->GetVectorColor().GetColor();
fprintf(fp, "vectorColor = (%d, %d, %d, %d)\n", int(vectorColor[0]), int(vectorColor[1]), int(vectorColor[2]), int(vectorColor[3]));
fprintf(fp, "colorTableName = %s\n", obj->data->GetColorTableName().c_str());
const char *vectorOrigin_names = "Head, Middle, Tail";
if(obj->data->GetVectorOrigin() == VectorAttributes::Head)
fprintf(fp, "vectorOrigin = Head # %s\n", vectorOrigin_names);
else if(obj->data->GetVectorOrigin() == VectorAttributes::Middle)
fprintf(fp, "vectorOrigin = Middle # %s\n", vectorOrigin_names);
else
fprintf(fp, "vectorOrigin = Tail # %s\n", vectorOrigin_names);
return 0;
}
......
......@@ -7,6 +7,7 @@
#include <qlabel.h>
#include <qcheckbox.h>
#include <qlineedit.h>
#include <qhbox.h>
#include <VectorAttributes.h>
#include <ViewerProxy.h>
......@@ -98,12 +99,15 @@ QvisVectorPlotWindow::~QvisVectorPlotWindow()
// Brad Whitlock, Fri Aug 29 11:37:35 PDT 2003
// Grouped like items into group boxes.
//
// Jeremy Meredith, Fri Nov 21 12:29:29 PST 2003
// Added vector origin type radio buttons.
//
// ****************************************************************************
void
QvisVectorPlotWindow::CreateWindowContents()
{
QGridLayout *gLayout = new QGridLayout(topLayout, 5, 4);
QGridLayout *gLayout = new QGridLayout(topLayout, 6, 4);
gLayout->setSpacing(10);
// Create the lineStyle widget.
......@@ -229,6 +233,23 @@ QvisVectorPlotWindow::CreateWindowContents()
this, SLOT(processStrideText()));
rgLayout->addWidget(strideLineEdit, 1, 1);
//
// Create the radio buttons to choose the glyph origin
//
originButtonGroup = new QButtonGroup(0, "originButtonGroup");
QHBox *originBox = new QHBox(central, "originBox");
originBox->setSpacing(10);
new QLabel("Vector origin", originBox, "originLabel");
connect(originButtonGroup, SIGNAL(clicked(int)),
this, SLOT(originTypeChanged(int)));
rb = new QRadioButton("Head", originBox);
originButtonGroup->insert(rb,0);
rb = new QRadioButton("Middle", originBox);
originButtonGroup->insert(rb,1);
rb = new QRadioButton("Tail", originBox);
originButtonGroup->insert(rb,2);
gLayout->addMultiCellWidget(originBox, 4, 4, 0, 3);
//
// Add the toggle buttons
//
......@@ -236,12 +257,12 @@ QvisVectorPlotWindow::CreateWindowContents()
// Add the legend toggle button.
legendToggle = new QCheckBox("Legend", central, "legendToggle");
connect(legendToggle, SIGNAL(clicked()), this, SLOT(legendToggled()));
gLayout->addMultiCellWidget(legendToggle, 4, 4, 0, 1);
gLayout->addMultiCellWidget(legendToggle, 5, 5, 0, 1);
// Add the "draw head" toggle button.
drawHeadToggle = new QCheckBox("Draw head", central, "drawHeadToggle");
connect(drawHeadToggle, SIGNAL(clicked()), this, SLOT(drawHeadToggled()));
gLayout->addMultiCellWidget(drawHeadToggle, 4, 4, 2, 3);
gLayout->addMultiCellWidget(drawHeadToggle, 5, 5, 2, 3);
}
// ****************************************************************************
......@@ -277,6 +298,9 @@ QvisVectorPlotWindow::CreateWindowContents()
// Brad Whitlock, Fri Feb 15 11:49:23 PDT 2002
// Fixed format strings.
//
// Jeremy Meredith, Fri Nov 21 12:29:16 PST 2003
// Added vector origin type radio buttons.
//
// ****************************************************************************
void
......@@ -358,6 +382,22 @@ QvisVectorPlotWindow::UpdateWindow(bool doAll)
case 11: // colorTableName
colorTableButton->setColorTable(vectorAtts->GetColorTableName().c_str());
break;
case 12: // vectorOrigin
originButtonGroup->blockSignals(true);
switch (vectorAtts->GetVectorOrigin())
{
case VectorAttributes::Head:
originButtonGroup->setButton(0);
break;
case VectorAttributes::Middle:
originButtonGroup->setButton(1);
break;
case VectorAttributes::Tail:
originButtonGroup->setButton(2);
break;
}
originButtonGroup->blockSignals(false);
break;
}
} // end for
}
......@@ -809,3 +849,35 @@ QvisVectorPlotWindow::colorTableClicked(bool useDefault,
vectorAtts->SetColorTableName(ctName.latin1());
Apply();
}
// ****************************************************************************
// Method:
//
// Purpose:
// Qt slot function to change the state of the vector origin type on
// response to a radio button click.
//
// Arguments:
// index the index of the radio button
//
// Programmer: Jeremy Meredith
// Creation: November 21, 2003
//
// ****************************************************************************
void
QvisVectorPlotWindow::originTypeChanged(int index)
{
if (index==0)
{
vectorAtts->SetVectorOrigin(VectorAttributes::Head);
}
else if (index==1)
{
vectorAtts->SetVectorOrigin(VectorAttributes::Middle);
}
else
{
vectorAtts->SetVectorOrigin(VectorAttributes::Tail);
}
Apply();
}
......@@ -34,6 +34,9 @@ class QvisColorTableButton;
// Brad Whitlock, Fri Aug 29 11:34:52 PDT 2003
// I grouped related fields into group boxes.
//
// Jeremy Meredith, Fri Nov 21 12:06:46 PST 2003
// Added radio buttons for vector origin.
//
// ****************************************************************************
class QvisVectorPlotWindow : public QvisPostableWindowObserver
......@@ -67,6 +70,7 @@ private slots:
void drawHeadToggled();
void colorModeChanged(int);
void colorTableClicked(bool useDefault, const QString &ctName);
void originTypeChanged(int);
private:
int plotType;
VectorAttributes *vectorAtts;
......@@ -86,6 +90,7 @@ private:
QLineEdit *strideLineEdit;
QCheckBox *legendToggle;
QCheckBox *drawHeadToggle;
QButtonGroup *originButtonGroup;
};
#endif
<?xml version="1.0"?>
<Plugin name="Vector" type="plot" label="Vector" version="1.0" vartype="vector" iconFile="Vector.xpm">
<Plugin name="Vector" type="plot" label="Vector" version="1.0" enabled="true" vartype="vector" iconFile="Vector.xpm">
<Attribute name="VectorAttributes" purpose="Attributes for the vector plot" persistent="true" codefile="VectorAttributes.code">
<Enum name="OriginType">
Head
Middle
Tail
</Enum>
<Field name="useStride" label="Use stride" type="bool">
false
</Field>
......@@ -40,6 +45,9 @@
<Field name="colorTableName" label="Color table" type="colortable">
Default
</Field>
<Field name="vectorOrigin" label="Vector Origin" type="enum" subtype="OriginType">
Middle
</Field>
<Function name="ChangesRequireRecalculation" user="true" member="true">
</Function>
</Attribute>
......
This diff is collapsed.
......@@ -8,3 +8,4 @@ VectorAttributes::ChangesRequireRecalculation(const VectorAttributes &obj)
(stride != obj.stride) ||
(nVectors != obj.nVectors));
}
......@@ -13,7 +13,7 @@
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Oct 9 13:31:12 PST 2003
// Creation: Fri Nov 21 11:28:56 PDT 2003
//
// Modifications:
//
......@@ -22,6 +22,13 @@
class VectorAttributes : public AttributeSubject
{
public:
enum OriginType
{
Head,