Commit 8171fb35 authored by hrchilds's avatar hrchilds
Browse files

Update from August 26, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@309 18c085ea-50e0-402c-830e-de6fd14e8384
parent 3376a0b3
......@@ -69,12 +69,17 @@ avtNodePickQuery::~avtNodePickQuery()
// When material-selection has been applied, ensure that RetriveVarInfo
// will be using the correct zone ids for this dataset.
//
// Kathleen Bonnell, Thu Aug 26 09:50:31 PDT 2004
// Handle case when pickatts.domain has not yet been set. (e.g. when
// picking 2d contour or boundary plots.)
//
// ****************************************************************************
void
avtNodePickQuery::Execute(vtkDataSet *ds, const int dom)
{
if (dom != pickAtts.GetDomain() || pickAtts.GetFulfilled() || ds == NULL)
if (ds == NULL || pickAtts.GetFulfilled() ||
(pickAtts.GetDomain() != -1 && dom != pickAtts.GetDomain()))
{
return;
}
......@@ -85,13 +90,10 @@ avtNodePickQuery::Execute(vtkDataSet *ds, const int dom)
(type == VTK_STRUCTURED_GRID || type == VTK_RECTILINEAR_GRID ||
ds->GetFieldData()->GetArray("vtkOriginalDimensions") != NULL );
//
//
//
if (pickedNode == -1)
{
pickedNode = DeterminePickedNode(ds);
if (pickedNode == -1)
if (pickedNode == -1 && pickAtts.GetDomain() != -1)
{
// the node could not be found, no further processing required.
// SetDomain and ElementNumber to -1 to indicate failure.
......@@ -141,6 +143,13 @@ avtNodePickQuery::Execute(vtkDataSet *ds, const int dom)
if (needRealId && ghostType == AVT_CREATED_GHOSTS)
SetRealIds(ds);
//
// The database needs a valid domain
//
if (pickAtts.GetDomain() == -1)
pickAtts.SetDomain(dom);
//
// Allow the database to add any missing information.
//
......
......@@ -256,6 +256,9 @@ avtPickQuery::PostExecute(void)
// When material selection has been applied, request OriginalZoneNumbers
// and OriginalNodeNumbers.
//
// Kathleen Bonnell, Thu Aug 26 09:50:31 PDT 2004
// Don't restrict domains if pickAtts.domain has not yet been set.
//
// ****************************************************************************
avtDataObject_p
......@@ -298,7 +301,7 @@ avtPickQuery::ApplyFilters(avtDataObject_p inData)
pickAtts.GetTimeStep(), querySILR);
int i;
if (!singleDomain)
if (!singleDomain && pickAtts.GetDomain() != -1)
{
intVector dlist;
dlist.push_back(pickAtts.GetDomain());
......
......@@ -82,12 +82,17 @@ avtZonePickQuery::SetInvTransform(const avtMatrix *m)
// When material selection has been applied, ensure that RetrieveVarInfo
// will be using the correct zone id for this dataset.
//
// Kathleen Bonnell, Thu Aug 26 09:50:31 PDT 2004
// Handle case when pickatts.domain has not yet been set. (e.g. when
// picking 2d contour or boundary plots.)
//
// ****************************************************************************
void
avtZonePickQuery::Execute(vtkDataSet *ds, const int dom)
{
if (dom != pickAtts.GetDomain() || pickAtts.GetFulfilled() || ds == NULL)
if (ds == NULL || pickAtts.GetFulfilled() ||
(pickAtts.GetDomain() != -1 && dom != pickAtts.GetDomain()))
{
return;
}
......@@ -106,20 +111,24 @@ avtZonePickQuery::Execute(vtkDataSet *ds, const int dom)
float *cellPoint = pickAtts.GetCellPoint();
pickedZone = vtkVisItUtility::FindCell(ds, cellPoint);
//
// If a valid zone still hasn't been found, there's some kind of
// problem, it should have been found for this domain.
//
if (pickedZone == -1)
{
pickAtts.SetDomain(-1);
pickAtts.SetElementNumber(-1);
debug5 << "PICK BIG PROBLEM! "
<< "Could not find zone corresponding to pick point" << endl;
pickAtts.SetErrorMessage("Pick encountered an internal "
"error (could not find zone corresponding to pick point).\n"
"Please contact a VisIt developer");
pickAtts.SetError(true);
if (pickAtts.GetDomain() != -1)
{
//
// If a valid zone still hasn't been found, and we were
// expecting one for this domain, there's some kind of
// problem.
//
pickAtts.SetDomain(-1);
pickAtts.SetElementNumber(-1);
debug5 << "PICK BIG PROBLEM! Could not find zone"
<< "corresponding to pick point" << endl;
pickAtts.SetErrorMessage("Pick encountered an internal error"
" (could not find zone corresponding to pick point).\n"
"Please contact a VisIt developer");
pickAtts.SetError(true);
}
return;
}
pickAtts.SetElementNumber(pickedZone);
......@@ -159,6 +168,12 @@ avtZonePickQuery::Execute(vtkDataSet *ds, const int dom)
if (needRealId && ghostType == AVT_CREATED_GHOSTS)
SetRealIds(ds);
//
// The database needs a valid domain
//
if (pickAtts.GetDomain() == -1)
pickAtts.SetDomain(dom);
//
// Allow the database to add any missing information.
//
......
......@@ -192,6 +192,11 @@ avtMinMaxQuery::PreExecute()
// Kathleen Bonnell, Tue Jul 27 09:53:01 PDT 2004
// Store the value per material, even if not mixed.
//
// Kathleen Bonnell, Thu Aug 26 10:22:00 PDT 2004
// Changed min/max val check to <= or >= so that serial and parallel
// versions will always return the same results.
// (ThisProcessorHasMinimum/MaximumValue has changed).
//
// ****************************************************************************
void
......@@ -307,7 +312,7 @@ avtMinMaxQuery::Execute(vtkDataSet *ds, const int dom)
{
if (doMin)
{
if (val <= minInfo1.GetValue())
if (val < minInfo1.GetValue())
{
haveMin1 = true;
minInfo1.SetElementNum(elNum);
......@@ -316,7 +321,7 @@ avtMinMaxQuery::Execute(vtkDataSet *ds, const int dom)
}
ds->GetPointCells(elNum, cellIds);
if (cellIds->GetNumberOfIds() > 0 &&
val <= minInfo2.GetValue())
val < minInfo2.GetValue())
{
haveMin2 = true;
minInfo2.SetElementNum(elNum);
......@@ -327,7 +332,7 @@ avtMinMaxQuery::Execute(vtkDataSet *ds, const int dom)
}
if (doMax)
{
if (val >= maxInfo1.GetValue())
if (val > maxInfo1.GetValue())
{
haveMax1 = true;
maxInfo1.SetElementNum(elNum);
......@@ -336,7 +341,7 @@ avtMinMaxQuery::Execute(vtkDataSet *ds, const int dom)
}
ds->GetPointCells(elNum, cellIds);
if (cellIds->GetNumberOfIds() > 0 &&
val >= maxInfo2.GetValue())
val > maxInfo2.GetValue())
{
haveMax2 = true;
maxInfo2.SetElementNum(elNum);
......@@ -368,7 +373,7 @@ avtMinMaxQuery::Execute(vtkDataSet *ds, const int dom)
if (doMin && !ghost)
{
if (val <= minInfo1.GetValue())
if (val < minInfo1.GetValue())
{
haveMin1 = true;
minInfo1.SetElementNum(elNum);
......@@ -377,7 +382,7 @@ avtMinMaxQuery::Execute(vtkDataSet *ds, const int dom)
}
for (i = 0; i < matValues.size(); i++)
{
if (matValues[i] <= minInfo2.GetValue())
if (matValues[i] < minInfo2.GetValue())
{
haveMin2 = true;
minInfo2.SetElementNum(elNum);
......@@ -389,7 +394,7 @@ avtMinMaxQuery::Execute(vtkDataSet *ds, const int dom)
}
if (doMax && !ghost)
{
if (val >= maxInfo1.GetValue())
if (val > maxInfo1.GetValue())
{
haveMax1 = true;
maxInfo1.SetElementNum(elNum);
......@@ -398,7 +403,7 @@ avtMinMaxQuery::Execute(vtkDataSet *ds, const int dom)
}
for (i = 0; i < matValues.size(); i++)
{
if (matValues[i] >= maxInfo2.GetValue())
if (matValues[i] > maxInfo2.GetValue())
{
haveMax2 = true;
maxInfo2.SetElementNum(elNum);
......
......@@ -362,6 +362,9 @@ avtVTKFileFormat::FreeUpResources(void)
// Hank Childs, Wed Sep 24 08:02:08 PDT 2003
// Add support for tensors.
//
// Hank Childs, Thu Aug 26 08:32:09 PDT 2004
// Only declare the mesh as 2D if Z=0 for all points.
//
// ****************************************************************************
void
......@@ -403,7 +406,7 @@ avtVTKFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
float bounds[6];
dataset->GetBounds(bounds);
if (bounds[4] == bounds[5])
if ((bounds[4] == bounds[5]) && (bounds[5] == 0.))
{
spat = 2;
topo = 2;
......
......@@ -2024,6 +2024,9 @@ NetworkManager::StopPickMode(void)
// Kathleen Bonnell, Wed Jun 2 09:48:29 PDT 2004
// Add support for new pick classes.
//
// Kathleen Bonnell, Thu Aug 26 11:18:47 PDT 2004
// Skip LocateQuery if picking on 2d boundary or contour plots.
//
// ****************************************************************************
void
......@@ -2064,6 +2067,8 @@ NetworkManager::Pick(const int id, PickAttributes *pa)
avtDataAttributes &queryInputAtts = queryInput->GetInfo().GetAttributes();
avtDataValidity &queryInputVal = queryInput->GetInfo().GetValidity();
bool skipLocate = queryInputAtts.GetTopologicalDimension() == 1 &&
queryInputAtts.GetSpatialDimension() == 2;
avtLocateQuery *lQ = NULL;
avtPickQuery *pQ = NULL;
avtCurvePickQuery *cpQ = NULL;
......@@ -2073,25 +2078,40 @@ NetworkManager::Pick(const int id, PickAttributes *pa)
if (pa->GetPickType() != PickAttributes::CurveNode &&
pa->GetPickType() != PickAttributes::CurveZone)
{
if (skipLocate) // picking lines, set up pick atts appropriately
{
float *pt = pa->GetRayPoint1();
pt[2] = 0.;
pa->SetRayPoint1(pt);
pa->SetRayPoint2(pt);
pa->SetPickPoint(pt);
pa->SetCellPoint(pt);
}
if (pa->GetPickType() == PickAttributes::Zone)
{
lQ = new avtLocateCellQuery;
pQ = new avtZonePickQuery;
lQ->SetInput(queryInput);
lQ->SetPickAtts(pa);
lQ->PerformQuery(&qa);
*pa = *(lQ->GetPickAtts());
delete lQ;
if (!skipLocate)
{
lQ = new avtLocateCellQuery;
lQ->SetInput(queryInput);
lQ->SetPickAtts(pa);
lQ->PerformQuery(&qa);
*pa = *(lQ->GetPickAtts());
delete lQ;
}
}
else if (pa->GetPickType() == PickAttributes::Node)
{
lQ = new avtLocateNodeQuery;
pQ = new avtNodePickQuery;
lQ->SetInput(queryInput);
lQ->SetPickAtts(pa);
lQ->PerformQuery(&qa);
*pa = *(lQ->GetPickAtts());
delete lQ;
if (!skipLocate)
{
lQ = new avtLocateNodeQuery;
lQ->SetInput(queryInput);
lQ->SetPickAtts(pa);
lQ->PerformQuery(&qa);
*pa = *(lQ->GetPickAtts());
delete lQ;
}
}
else if (pa->GetPickType() == PickAttributes::DomainNode)
{
......
......@@ -3,7 +3,6 @@
#include <IndexSelectAttributes.h>
#include <ViewerProxy.h>
#include <qcheckbox.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qlineedit.h>
......@@ -11,17 +10,13 @@
#include <qvbox.h>
#include <qbuttongroup.h>
#include <qradiobutton.h>
#include <QvisColorTableButton.h>
#include <QvisOpacitySlider.h>
#include <QvisColorButton.h>
#include <QvisLineStyleWidget.h>
#include <QvisLineWidthWidget.h>
#include <stdio.h>
#include <string>
using std::string;
bool ParseDimensions(const char *, int *);
#define MAX_VAL 1000
// ****************************************************************************
// Method: QvisIndexSelectWindow::QvisIndexSelectWindow
......@@ -83,15 +78,19 @@ QvisIndexSelectWindow::~QvisIndexSelectWindow()
// Hank Childs, Fri Jul 12 15:47:43 PDT 2002
// Fix typo (AI->All).
//
// Kathleen Bonnell, Thu Aug 26 16:55:59 PDT 2004
// Changed Min/Max/Incr from LineEdit to SpinBox for usability, added
// labels and group boxes for each dim.
//
// ****************************************************************************
void
QvisIndexSelectWindow::CreateWindowContents()
{
QGridLayout *wholeLayout = new QGridLayout(topLayout, 2, 1, 10,
QGridLayout *wholeLayout = new QGridLayout(topLayout, 5, 4, 10,
"wholeLayout");
QGridLayout *mainLayout = new QGridLayout(4,2, 10, "mainLayout");
wholeLayout->addLayout(mainLayout, 0, 0);
wholeLayout->addMultiCellLayout(mainLayout, 0, 0, 0, 3);
mainLayout->addWidget(new QLabel("Dimension", central, "dimLabel"),0,0);
......@@ -107,25 +106,126 @@ QvisIndexSelectWindow::CreateWindowContents()
dimLayout->addWidget(dimDimensionThreeD);
connect(dim, SIGNAL(clicked(int)),
this, SLOT(dimChanged(int)));
mainLayout->addWidget(dim, 0,1);
mainLayout->addWidget(new QLabel("Min, max, incr", central, "oneDLabel"),1,0);
oneD = new QLineEdit(central, "oneD");
connect(oneD, SIGNAL(returnPressed()),
this, SLOT(oneDProcessText()));
mainLayout->addWidget(oneD, 1,1);
mainLayout->addWidget(new QLabel("Min, max, incr", central, "twoDLabel"),2,0);
twoD = new QLineEdit(central, "twoD");
connect(twoD, SIGNAL(returnPressed()),
this, SLOT(twoDProcessText()));
mainLayout->addWidget(twoD, 2,1);
mainLayout->addWidget(new QLabel("Min, max, incr", central, "threeDLabel"),3,0);
threeD = new QLineEdit(central, "xMin");
connect(threeD, SIGNAL(returnPressed()),
this, SLOT(threeDProcessText()));
mainLayout->addWidget(threeD, 3,1);
mainLayout->addMultiCellWidget(dim, 0,0,1,2);
QGridLayout *labelLayout = new QGridLayout(1, 3, 10, "labelLayout");
wholeLayout->addMultiCellLayout(labelLayout, 1, 1, 0,3 );
QLabel *minLabel = new QLabel("Min", central, "minLabel");
minLabel->setAlignment(AlignCenter);
labelLayout->addWidget(minLabel, 0, 0);
QLabel *maxLabel = new QLabel("Max", central, "maxLabel");
maxLabel->setAlignment(AlignCenter);
labelLayout->addWidget(maxLabel, 0, 1);
QLabel *incrLabel = new QLabel("Incr", central, "incrLabel");
incrLabel->setAlignment(AlignCenter);
labelLayout->addWidget(incrLabel, 0, 2);
//
// Create the oneD spinBoxes
//
oneDWidgetGroup = new QGroupBox(central, "oneDWidgetGroup");
oneDWidgetGroup->setFrameShape(QFrame::NoFrame);
QGridLayout *oneDLayout = new QGridLayout(oneDWidgetGroup, 1, 6);
oneDLabel = new QLabel(central, "I", oneDWidgetGroup);
oneDLabel->setAlignment(AlignCenter);
oneDLayout->addWidget(oneDLabel, 0, 0);
// Set Up Min
oneDMin = new QSpinBox(0, MAX_VAL, 1, oneDWidgetGroup, "oneDMin");
connect(oneDMin, SIGNAL(valueChanged(int)),
this, SLOT(oneDMinChanged(int)));
oneDLayout->addWidget(oneDMin, 0, 1);
oneDLayout->addItem(new QSpacerItem(5, 5), 0, 2);
// Set Up Max
oneDMax = new QSpinBox(-1, MAX_VAL, 1, oneDWidgetGroup, "oneDMax");
oneDMax->setSpecialValueText("max");
oneDMax->setValue(-1);
connect(oneDMax, SIGNAL(valueChanged(int)),
this, SLOT(oneDMaxChanged(int)));
oneDLayout->addWidget(oneDMax, 0, 3);
oneDLayout->addItem(new QSpacerItem(5, 5), 0, 4);
// Set Up Incr
oneDIncr = new QSpinBox(1, MAX_VAL, 1, oneDWidgetGroup, "oneDIncr");
connect(oneDIncr, SIGNAL(valueChanged(int)),
this, SLOT(oneDIncrChanged(int)));
oneDLayout->addWidget(oneDIncr, 0, 5);
wholeLayout->addMultiCellWidget(oneDWidgetGroup, 2,2, 0,3);
//
// Create the twoD spinBoxes
//
twoDWidgetGroup = new QGroupBox(central, "twoDWidgetGroup");
twoDWidgetGroup->setFrameShape(QFrame::NoFrame);
QGridLayout *twoDLayout = new QGridLayout(twoDWidgetGroup, 1, 6);
twoDLabel = new QLabel(central, "J", twoDWidgetGroup);
twoDLabel->setAlignment(AlignCenter);
twoDLayout->addWidget(twoDLabel, 0, 0);
// Set Up Min
twoDMin = new QSpinBox(0, MAX_VAL, 1, twoDWidgetGroup, "twoDMin");
connect(twoDMin, SIGNAL(valueChanged(int)),
this, SLOT(twoDMinChanged(int)));
twoDLayout->addWidget(twoDMin, 0, 1);
twoDLayout->addItem(new QSpacerItem(5, 5), 0, 2);
// Set Up Max
twoDMax = new QSpinBox(-1, MAX_VAL, 1, twoDWidgetGroup, "twoDMax");
twoDMax->setSpecialValueText("max");
twoDMax->setValue(-1);
connect(twoDMax, SIGNAL(valueChanged(int)),
this, SLOT(twoDMaxChanged(int)));
twoDLayout->addWidget(twoDMax, 0, 3);
twoDLayout->addItem(new QSpacerItem(5, 5), 0, 4);
// Set Up Incr
twoDIncr = new QSpinBox(1, MAX_VAL, 1, twoDWidgetGroup, "twoDIncr");
connect(twoDIncr, SIGNAL(valueChanged(int)),
this, SLOT(twoDIncrChanged(int)));
twoDLayout->addWidget(twoDIncr, 0, 5);
wholeLayout->addMultiCellWidget(twoDWidgetGroup, 3,3, 0,3);
//
// Create the threeD spinBoxes
//
threeDWidgetGroup = new QGroupBox(central, "threeDWidgetGroup");
threeDWidgetGroup->setFrameShape(QFrame::NoFrame);
QGridLayout *threeDLayout = new QGridLayout(threeDWidgetGroup, 1, 6);
threeDLabel = new QLabel(central, "K", threeDWidgetGroup);
threeDLabel->setAlignment(AlignCenter);
threeDLayout->addWidget(threeDLabel, 0, 0);
// Set Up Min
threeDMin = new QSpinBox(0, MAX_VAL, 1, threeDWidgetGroup, "threeDMin");
connect(threeDMin, SIGNAL(valueChanged(int)),
this, SLOT(threeDMinChanged(int)));
threeDLayout->addWidget(threeDMin, 0, 1);
threeDLayout->addItem(new QSpacerItem(5, 5), 0, 2);
// Set Up Max
threeDMax = new QSpinBox(-1, MAX_VAL, 1, threeDWidgetGroup, "threeDMax");
threeDMax->setSpecialValueText("max");
threeDMax->setValue(-1);
connect(threeDMax, SIGNAL(valueChanged(int)),
this, SLOT(threeDMaxChanged(int)));
threeDLayout->addWidget(threeDMax, 0, 3);
threeDLayout->addItem(new QSpacerItem(5, 5), 0, 4);
// Set Up Incr
threeDIncr = new QSpinBox(1, MAX_VAL, 1, threeDWidgetGroup, "threeDIncr");
connect(threeDIncr, SIGNAL(valueChanged(int)),
this, SLOT(threeDIncrChanged(int)));
threeDLayout->addWidget(threeDIncr, 0, 5);
wholeLayout->addMultiCellWidget(threeDWidgetGroup, 4,4, 0,3);
whichData = new QButtonGroup(central, "whichData");
whichData->setFrameStyle(QFrame::NoFrame);
......@@ -153,7 +253,7 @@ QvisIndexSelectWindow::CreateWindowContents()
this, SLOT(groupIndexProcessText()));
whichDataLayout->addWidget(groupIndex);
wholeLayout->addWidget(whichData, 1,0);
wholeLayout->addMultiCellWidget(whichData, 5,5,0,3);
}
......@@ -167,6 +267,8 @@ QvisIndexSelectWindow::CreateWindowContents()
// Creation: Thu Jun 6 17:02:08 PST 2002
//
// Modifications:
// Kathleen Bonnell, Thu Aug 26 16:55:59 PDT 2004
// Changed Min/Max/Incr from LineEdit to SpinBox.
//
// ****************************************************************************
......@@ -185,66 +287,64 @@ QvisIndexSelectWindow::UpdateWindow(bool doAll)
}
}
char tmp[1024];
switch(i)
{
case 0: //dim
if (atts->GetDim() == IndexSelectAttributes::TwoD ||
atts->GetDim() == IndexSelectAttributes::ThreeD)
twoD->setEnabled(true);
twoDWidgetGroup->setEnabled(true);
else
twoD->setEnabled(false);
twoDWidgetGroup->setEnabled(false);
if (atts->GetDim() == IndexSelectAttributes::ThreeD)
threeD->setEnabled(true);
threeDWidgetGroup->setEnabled(true);
else
threeD->setEnabled(false);
threeDWidgetGroup->setEnabled(false);
dim->setButton(atts->GetDim());
break;
case 1: //xMin
oneDMin->blockSignals(true);
oneDMin->setValue(atts->GetXMin());
oneDMin->blockSignals(false);
break;
case 2: //xMax
oneDMax->blockSignals(true);
oneDMax->setValue(atts->GetXMax());
oneDMax->blockSignals(false);
break;
case 3: //xIncr
if (atts->GetXMax() < 0)
{
sprintf(tmp, "%d:max:%d", atts->GetXMin(), atts->GetXIncr());
}
else
{
sprintf(tmp, "%d:%d:%d", atts->GetXMin(), atts->GetXMax(),
atts->GetXIncr());
}
temp = tmp;
oneD->setText(temp);
oneDIncr->blockSignals(true);
oneDIncr->setValue(atts->GetXIncr());
oneDIncr->blockSignals(false);
break;
case 4: //yMin
twoDMin->blockSignals(true);
twoDMin->setValue(atts->GetYMin());
twoDMin->blockSignals(false);
break;
case 5: //yMax
twoDMax->blockSignals(true);
twoDMax->setValue(atts->GetYMax());
twoDMax->blockSignals(false);
break;
case 6: //yIncr
if (atts->GetYMax() < 0)
{
sprintf(tmp, "%d:max:%d", atts->GetYMin(), atts->GetYIncr());
}
else
{
sprintf(tmp, "%d:%d:%d", atts->GetYMin(), atts->GetYMax(),
atts->GetYIncr());
}
temp = tmp;
twoD->setText(temp);
twoDIncr->blockSignals(true);
twoDIncr->setValue(atts->GetYIncr());
twoDIncr->blockSignals(false);
break;
case 7: //zMin
threeDMin->blockSignals(true);
threeDMin->setValue(atts->GetZMin());
threeDMin->blockSignals(false);
break;
case 8: //zMax