Commit 114998ed authored by hrchilds's avatar hrchilds
Browse files

Update from August 2, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@292 18c085ea-50e0-402c-830e-de6fd14e8384
parent f87e70b3
This diff is collapsed.
......@@ -13,7 +13,7 @@
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:31 PDT 2003
// Creation: Fri Jul 30 15:35:10 PST 2004
//
// Modifications:
//
......@@ -60,12 +60,13 @@ public:
// Property selection methods
virtual void SelectAll();
void SelectHostName();
void SelectOutputDirectory();
void SelectFileName();
void SelectLastRealFilename();
// Property setting methods
void SetHostName(const std::string &hostName_);
void SetOutputToCurrentDirectory(bool outputToCurrentDirectory_);
void SetOutputDirectory(const std::string &outputDirectory_);
void SetFileName(const std::string &fileName_);
void SetFamily(bool family_);
void SetFormat(FileFormat format_);
......@@ -82,8 +83,9 @@ public:
void SetCompression(CompressionType compression_);
// Property getting methods
const std::string &GetHostName() const;
std::string &GetHostName();
bool GetOutputToCurrentDirectory() const;
const std::string &GetOutputDirectory() const;
std::string &GetOutputDirectory();
const std::string &GetFileName() const;
std::string &GetFileName();
bool GetFamily() const;
......@@ -126,7 +128,8 @@ public:
// User-defined methods
bool CurrentFormatIsImageFormat(void);
private:
std::string hostName;
bool outputToCurrentDirectory;
std::string outputDirectory;
std::string fileName;
bool family;
int format;
......
......@@ -20,8 +20,11 @@
Jpeg
Deflate
</Enum>
<Field name="hostName" label="hostName" type="string">
localhost
<Field name="outputToCurrentDirectory" label="Output to current directory" type="bool">
true
</Field>
<Field name="outputDirectory" label="outputDirectory" type="string">
.
</Field>
<Field name="fileName" label="fileName" type="string">
visit
......
......@@ -630,6 +630,68 @@ avtSILRestriction::TurnOffSet(int ind)
}
// ****************************************************************************
// Method: avtSILRestriction::ReverseSet
//
// Purpose:
// Reverses the on/off state all of the sets under the specified state.
//
// Arguments:
// ind ; The index of the set whose selection we're going to reverse.
//
// Programmer: Brad Whitlock
// Creation: Fri Jul 30 14:52:58 PST 2004
//
// Modifications:
//
// ****************************************************************************
void
avtSILRestriction::ReverseSet(int ind)
{
// Get all of the leaf sets under the specified set.
intVector leaves;
GetLeafSets(ind, leaves);
// Reverse the selection of all of the subsets.
if(leaves.size() == 0)
{
SetState state = (SetState)useSet[ind];
if(state == AllUsed ||
state == AllUsedOtherProc)
{
TurnOffSet(ind);
}
else if(state == NoneUsed)
{
TurnOnSet(ind);
}
}
else
{
for(int i = 0; i < leaves.size(); ++i)
{
int setId = leaves[i];
SetState state = (SetState)useSet[setId];
if(state == AllUsed ||
state == AllUsedOtherProc)
{
TurnOffSet(setId);
}
else if(state == NoneUsed)
{
TurnOnSet(setId);
}
}
}
if (!suspendCorrectnessChecking)
{
EnsureRestrictionCorrectness(topSet);
}
}
// ****************************************************************************
// Method: avtSILRestriction::TurnBoolSet
//
......
......@@ -66,6 +66,10 @@ typedef ref_ptr<avtSILRestriction> avtSILRestriction_p;
// Hank Childs, Wed Dec 4 17:23:12 PST 2002
// Pulled out many traversal routines for the 'Traverser class.
//
// Brad Whitlock, Fri Jul 30 14:54:53 PST 2004
// Added ReverseSet to reverse the selection of a set and all of its
// subsets.
//
// ****************************************************************************
class DBATTS_API avtSILRestriction : public avtSIL
......@@ -85,6 +89,7 @@ class DBATTS_API avtSILRestriction : public avtSIL
int GetTopSet() const { return topSet; };
void TurnOnSet(int);
void TurnOffSet(int);
void ReverseSet(int);
void TurnOnAll(void);
void TurnOffAll(void);
......
......@@ -5,6 +5,7 @@
#include <avtPickQuery.h>
#include <float.h>
#include <snprintf.h>
#include <vtkCellData.h>
#include <vtkDataSet.h>
......@@ -416,7 +417,10 @@ avtPickQuery::DeterminePickedNode(vtkDataSet *ds, int &foundEl)
//
// Kathleen Bonnell, Thu Nov 20 15:06:49 PST 2003
// Swapped 'VarIsMaterial' with check of varType.
//
//
// Brad Whitlock, Thu Jul 29 17:25:40 PST 2004
// I made it use SNPRINTF.
//
// ****************************************************************************
void
......@@ -432,11 +436,11 @@ avtPickQuery::SetRealIds(vtkDataSet *ds)
stringVector elStrings;
foundEl = vtkVisItUtility::CalculateRealID(foundEl, forCell, ds);
sprintf(fString, "(%d)", foundEl);
SNPRINTF(fString, 20, "(%d)", foundEl);
for (i = 0; i < incEls.size(); i++)
{
incEls[i] = vtkVisItUtility::CalculateRealID(incEls[i], !forCell, ds);
sprintf(tmp, "(%d)", incEls[i]);
SNPRINTF(tmp, 20, "(%d)", incEls[i]);
elStrings.push_back(tmp);
}
......@@ -499,7 +503,9 @@ avtPickQuery::VerifyInput()
// Creation: May 10, 2004
//
// Modifications:
//
// Brad Whitlock, Thu Jul 29 17:26:26 PST 2004
// I made it use SNPRINTF.
//
// ****************************************************************************
void
......@@ -527,11 +533,11 @@ avtPickQuery::GetNodeCoords(vtkDataSet *ds, const int nodeId)
false);
if (pickAtts.GetDimension() == 2)
{
sprintf(buff, "<%d, %d>", ijk[0], ijk[1]);
SNPRINTF(buff, 80, "<%d, %d>", ijk[0], ijk[1]);
}
else
{
sprintf(buff, "<%d, %d, %d>", ijk[0], ijk[1], ijk[2]);
SNPRINTF(buff, 80, "<%d, %d, %d>", ijk[0], ijk[1], ijk[2]);
}
nodeCoords.push_back(buff);
pickAtts.SetDnodeCoords(nodeCoords);
......@@ -543,11 +549,11 @@ avtPickQuery::GetNodeCoords(vtkDataSet *ds, const int nodeId)
true);
if (pickAtts.GetDimension() == 2)
{
sprintf(buff, "<%d, %d>", ijk[0], ijk[1]);
SNPRINTF(buff, 80, "<%d, %d>", ijk[0], ijk[1]);
}
else
{
sprintf(buff, "<%d, %d, %d>", ijk[0], ijk[1], ijk[2]);
SNPRINTF(buff, 80, "<%d, %d, %d>", ijk[0], ijk[1], ijk[2]);
}
nodeCoords.push_back(buff);
pickAtts.SetBnodeCoords(nodeCoords);
......@@ -558,11 +564,11 @@ avtPickQuery::GetNodeCoords(vtkDataSet *ds, const int nodeId)
nodeCoords.clear();
if (pickAtts.GetDimension() == 2)
{
sprintf(buff, "<%g, %g>", coord[0], coord[1]);
SNPRINTF(buff, 80, "<%g, %g>", coord[0], coord[1]);
}
else
{
sprintf(buff, "<%g, %g, %g>", coord[0], coord[1], coord[2]);
SNPRINTF(buff, 80, "<%g, %g, %g>", coord[0], coord[1], coord[2]);
}
nodeCoords.push_back(buff);
pickAtts.SetPnodeCoords(nodeCoords);
......@@ -584,7 +590,10 @@ avtPickQuery::GetNodeCoords(vtkDataSet *ds, const int nodeId)
// Creation: May 10, 2004
//
// Modifications:
//
// Brad Whitlock, Thu Jul 29 17:23:14 PST 2004
// I made it use the cell origin for the zonal domain logical coordinates.
// I also made it use SNPRINTF.
//
// ****************************************************************************
void
......@@ -606,11 +615,15 @@ avtPickQuery::GetZoneCoords(vtkDataSet *ds, const int zoneId)
ijk, false);
if (pickAtts.GetDimension() == 2)
{
sprintf(buff, "<%d, %d>", ijk[0], ijk[1]);
SNPRINTF(buff, 80, "<%d, %d>", ijk[0] + cellOrigin,
ijk[1] + cellOrigin);
}
else
{
sprintf(buff, "<%d, %d, %d>", ijk[0], ijk[1], ijk[2]);
SNPRINTF(buff, 80, "<%d, %d, %d>",
ijk[0] + cellOrigin,
ijk[1] + cellOrigin,
ijk[2] + cellOrigin);
}
zoneCoords.push_back(buff);
pickAtts.SetDzoneCoords(zoneCoords);
......@@ -622,11 +635,11 @@ avtPickQuery::GetZoneCoords(vtkDataSet *ds, const int zoneId)
ijk, true);
if (pickAtts.GetDimension() == 2)
{
sprintf(buff, "<%d, %d>", ijk[0], ijk[1]);
SNPRINTF(buff, 80, "<%d, %d>", ijk[0], ijk[1]);
}
else
{
sprintf(buff, "<%d, %d, %d>", ijk[0], ijk[1], ijk[2]);
SNPRINTF(buff, 80, "<%d, %d, %d>", ijk[0], ijk[1], ijk[2]);
}
zoneCoords.push_back(buff);
pickAtts.SetBzoneCoords(zoneCoords);
......@@ -746,7 +759,7 @@ avtPickQuery::RetrieveVarInfo(vtkDataSet* ds)
// data we want is associated with incidentElements
for (int k = 0; k < incidentElements.size(); k++)
{
sprintf(buff, "(%d)", incidentElements[k]);
SNPRINTF(buff, 80, "(%d)", incidentElements[k]);
names.push_back(buff);
varArray->GetTuple(incidentElements[k], temp);
mag = 0;
......@@ -766,7 +779,7 @@ avtPickQuery::RetrieveVarInfo(vtkDataSet* ds)
else
{
// data we want is associated with element
sprintf(buff, "(%d)", element);
SNPRINTF(buff, 80, "(%d)", element);
names.push_back(buff);
varArray->GetTuple(element, temp);
mag = 0.;
......@@ -852,6 +865,9 @@ avtPickQuery::RetrieveVarInfo(vtkDataSet* ds)
// Kathleen Bonnell, Wed Dec 17 15:06:34 PST 2003
// Added logic to support multiple types of coordinates.
//
// Brad Whitlock, Fri Jul 30 08:58:27 PDT 2004
// Made it use SNPRINTF.
//
// ****************************************************************************
bool
......@@ -891,11 +907,11 @@ avtPickQuery::RetrieveNodes(vtkDataSet *ds, int zone)
ptIds->GetId(i), ijk, false);
if (pickAtts.GetDimension() == 2)
{
sprintf(buff, "<%d, %d>", ijk[0], ijk[1]);
SNPRINTF(buff, 80, "<%d, %d>", ijk[0], ijk[1]);
}
else
{
sprintf(buff, "<%d, %d, %d>", ijk[0], ijk[1], ijk[2]);
SNPRINTF(buff, 80, "<%d, %d, %d>", ijk[0], ijk[1], ijk[2]);
}
dnodeCoords.push_back(buff);
}
......@@ -905,11 +921,11 @@ avtPickQuery::RetrieveNodes(vtkDataSet *ds, int zone)
ptIds->GetId(i), ijk, true);
if (pickAtts.GetDimension() == 2)
{
sprintf(buff, "<%d, %d>", ijk[0], ijk[1]);
SNPRINTF(buff, 80, "<%d, %d>", ijk[0], ijk[1]);
}
else
{
sprintf(buff, "<%d, %d, %d>", ijk[0], ijk[1], ijk[2]);
SNPRINTF(buff, 80, "<%d, %d, %d>", ijk[0], ijk[1], ijk[2]);
}
bnodeCoords.push_back(buff);
}
......@@ -919,11 +935,11 @@ avtPickQuery::RetrieveNodes(vtkDataSet *ds, int zone)
ds->GetPoint(ptIds->GetId(i), coord);
if (pickAtts.GetDimension() == 2)
{
sprintf(buff, "<%g, %g>", coord[0], coord[1]);
SNPRINTF(buff, 80, "<%g, %g>", coord[0], coord[1]);
}
else
{
sprintf(buff, "<%g, %g, %g>", coord[0], coord[1], coord[2]);
SNPRINTF(buff, 80, "<%g, %g, %g>", coord[0], coord[1], coord[2]);
}
pnodeCoords.push_back(buff);
}
......@@ -976,6 +992,10 @@ avtPickQuery::RetrieveNodes(vtkDataSet *ds, int zone)
// Kathleen Bonnell, Wed Dec 17 15:06:34 PST 2003
// Added logic to support multiple types of coordinates.
//
// Brad Whitlock, Fri Jul 30 09:00:37 PDT 2004
// I made it use the cell origin for the domain logical indices and I
// changed sprintf to SNPRINTF.
//
// ****************************************************************************
bool
......@@ -1023,11 +1043,13 @@ avtPickQuery::RetrieveZones(vtkDataSet *ds, int foundNode)
if (pickAtts.GetDimension() == 2)
{
sprintf(buff, "<%d, %d>", ijk[0], ijk[1]);
SNPRINTF(buff, 80, "<%d, %d>", ijk[0] + cellOrigin,
ijk[1] + cellOrigin);
}
else
{
sprintf(buff, "<%d, %d, %d>", ijk[0], ijk[1], ijk[2]);
SNPRINTF(buff, 80, "<%d, %d, %d>", ijk[0] + cellOrigin,
ijk[1] + cellOrigin, ijk[2] + cellOrigin);
}
dzoneCoords.push_back(buff);
}
......@@ -1038,11 +1060,11 @@ avtPickQuery::RetrieveZones(vtkDataSet *ds, int foundNode)
if (pickAtts.GetDimension() == 2)
{
sprintf(buff, "<%d, %d>", ijk[0], ijk[1]);
SNPRINTF(buff, 80, "<%d, %d>", ijk[0], ijk[1]);
}
else
{
sprintf(buff, "<%d, %d, %d>", ijk[0], ijk[1], ijk[2]);
SNPRINTF(buff, 80, "<%d, %d, %d>", ijk[0], ijk[1], ijk[2]);
}
bzoneCoords.push_back(buff);
}
......
......@@ -345,6 +345,10 @@ QvisFileSelectionWindow::~QvisFileSelectionWindow()
// Brad Whitlock, Thu Jul 29 13:50:53 PST 2004
// I added support for smart file grouping.
//
// Brad Whitlock, Fri Jul 30 12:01:32 PDT 2004
// I hooked up some more signals and slots so pressing the Enter key will
// let you select files and navigate directories.
//
// ****************************************************************************
void
......@@ -448,13 +452,15 @@ QvisFileSelectionWindow::CreateWindowContents()
//
// Create the directory list.
//
QVBox *directoryVBox = new QVBox(listSplitter, "directoryVBox");
QVBox *directoryVBox = new QVBox(listSplitter, "directoryVBox");
new QLabel("Directories", directoryVBox, "directoryLabel");
directoryList = new QListBox(directoryVBox, "directoryList");
int minColumnWidth = fontMetrics().width("X");
directoryList->setMinimumWidth(minColumnWidth * 20);
connect(directoryList, SIGNAL(doubleClicked(QListBoxItem *)),
this, SLOT(changeDirectory(QListBoxItem *)));
connect(directoryList, SIGNAL(returnPressed(QListBoxItem *)),
this, SLOT(changeDirectory(QListBoxItem *)));
//
// Create the file list.
......@@ -466,6 +472,8 @@ QvisFileSelectionWindow::CreateWindowContents()
fileList->setMinimumWidth(minColumnWidth * 20);
connect(fileList, SIGNAL(doubleClicked(QListBoxItem *)),
this, SLOT(selectFileDblClick(QListBoxItem *)));
connect(fileList, SIGNAL(returnPressed(QListBoxItem *)),
this, SLOT(selectFileReturnPressed(QListBoxItem *)));
connect(fileList, SIGNAL(selectionChanged()),
this, SLOT(selectFileChanged()));
......@@ -499,6 +507,8 @@ QvisFileSelectionWindow::CreateWindowContents()
selectedFileList->setMinimumWidth(minColumnWidth * 30);
connect(selectedFileList, SIGNAL(selectionChanged()),
this, SLOT(selectedFileSelectChanged()));
connect(selectedFileList, SIGNAL(returnPressed(QListBoxItem *)),
this, SLOT(removeSelectedFiles(QListBoxItem *)));
// Create the Ok button
QHBoxLayout *buttonLayout = new QHBoxLayout(topLayout);
......@@ -2212,6 +2222,26 @@ QvisFileSelectionWindow::selectFile()
UpdateSelectedFileList();
}
// ****************************************************************************
// Method: QvisFileSelectionWindow::selectFileReturnPressed
//
// Purpose:
// This method lets us select multiple files from the file list into the
// selected file list by hitting the Enter key.
//
// Programmer: Brad Whitlock
// Creation: Fri Jul 30 11:03:49 PDT 2004
//
// Modifications:
//
// ****************************************************************************
void
QvisFileSelectionWindow::selectFileReturnPressed(QListBoxItem *)
{
selectFile();
}
// ****************************************************************************
// Method: QvisFileSelectionWindow::selectAllFiles
//
......@@ -2299,6 +2329,26 @@ QvisFileSelectionWindow::removeFile()
}
}
// ****************************************************************************
// Method: QvisFileSelectionWindow::removeSelectedFiles
//
// Purpose:
// This method lets us remove files from the selected files list by hitting
// the Enter key.
//
// Programmer: Brad Whitlock
// Creation: Fri Jul 30 11:05:05 PDT 2004
//
// Modifications:
//
// ****************************************************************************
void
QvisFileSelectionWindow::removeSelectedFiles(QListBoxItem *)
{
removeFile();
}
// ****************************************************************************
// Method: QvisFileSelectionWindow::removeAllFiles
//
......@@ -2327,7 +2377,7 @@ QvisFileSelectionWindow::removeAllFiles()
}
// ****************************************************************************
// Method: QvisFileSelectionWindow::selectFile
// Method: QvisFileSelectionWindow::groupFiles
//
// Purpose:
// This is a Qt slot function that groups all of the highlighted files
......
......@@ -83,6 +83,10 @@ class QvisRecentPathRemovalWindow;
// I added smart file grouping support and I fixed a bug in how the hosts
// are added to the host combo box.
//
// Brad Whitlock, Fri Jul 30 10:59:14 PDT 2004
// I added a new slot function so we can select multiple files by hitting
// the return key in the file list.
//
// ****************************************************************************
class GUI_API QvisFileSelectionWindow : public QvisDelayedWindowSimpleObserver
......@@ -136,10 +140,12 @@ private slots:
void selectFile();
void selectFileDblClick(QListBoxItem *item);
void selectFileChanged();
void selectFileReturnPressed(QListBoxItem *);
void selectedFileSelectChanged();
void selectAllFiles();
void removeFile();
void removeAllFiles();
void removeSelectedFiles(QListBoxItem *);
void refreshFiles();
void currentDir(bool val);
void fileGroupingChanged(int val);
......
#include <stdio.h> // for sscanf
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qfiledialog.h>
#include <qgroupbox.h>
#include <qhbox.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qlineedit.h>
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qslider.h>
#include <QvisSaveWindow.h>
......@@ -100,6 +102,10 @@ QvisSaveWindow::~QvisSaveWindow()
// Re-disable tiled windows and host information, since that is not working
// yet.
//
// Brad Whitlock, Fri Jul 30 15:25:59 PST 2004
// I replaced the host line edit with an output directory line edit. I also
// added a save button.
//
// ****************************************************************************
void
......@@ -110,22 +116,43 @@ QvisSaveWindow::CreateWindowContents()
infoBox->setTitle("File information");
topLayout->addWidget(infoBox);
QGridLayout *infoLayout = new QGridLayout(infoBox, 7, 2);
QGridLayout *infoLayout = new QGridLayout(infoBox, 9, 2);
infoLayout->setMargin(10);
infoLayout->setSpacing(5);
infoLayout->addRowSpacing(0, 10);
hostLineEdit = new QLineEdit(infoBox, "hostLineEdit");
connect(hostLineEdit, SIGNAL(returnPressed()), this, SLOT(processHostText()));
QLabel *hostLabel = new QLabel(hostLineEdit, "Host", infoBox, "hostLabel");
infoLayout->addWidget(hostLabel, 1, 0);
infoLayout->addWidget(hostLineEdit, 1, 1);
outputToCurrentDirectoryCheckBox = new QCheckBox("Output files to current directory",
infoBox, "outputToCurrentDirectoryCheckBox");
connect(outputToCurrentDirectoryCheckBox, SIGNAL(toggled(bool)),
this, SLOT(outputToCurrentDirectoryToggled(bool)));
infoLayout->addMultiCellWidget(outputToCurrentDirectoryCheckBox, 1, 1, 0, 1);
QHBox *outputDirectoryParent = new QHBox(infoBox, "outputDirectoryParent");
outputDirectoryLabel = new QLabel("Output directory",
infoBox, "outputDirectoryLabel");
outputDirectoryLineEdit = new QLineEdit(outputDirectoryParent,
"outputDirectoryLineEdit");
connect(outputDirectoryLineEdit, SIGNAL(returnPressed()),
this, SLOT(processOutputDirectoryText()));
outputDirectorySelectButton = new QPushButton("...", outputDirectoryParent,
"outputSelectButton");
outputDirectorySelectButton->setMaximumWidth(
fontMetrics().boundingRect("...").width() + 6);
outputDirectorySelectButton->setSizePolicy(QSizePolicy(QSizePolicy::Fixed,
QSizePolicy::Minimum));
connect(outputDirectorySelectButton, SIGNAL(clicked()),
this, SLOT(selectOutputDirectory()));
outputDirectoryParent->setSpacing(0);
outputDirectoryParent->setStretchFactor(outputDirectoryLineEdit, 100);
outputDirectoryLabel->setBuddy(outputDirectoryParent);
infoLayout->addMultiCellWidget(outputDirectoryLabel, 2, 2, 0, 1);
infoLayout->addMultiCellWidget(outputDirectoryParent, 3, 3, 0, 1);
filenameLineEdit = new QLineEdit(infoBox, "filenameLineEdit");
connect(filenameLineEdit, SIGNAL(returnPressed()), this, SLOT(processFilenameText()));
QLabel *filenameLabel = new QLabel(filenameLineEdit, "Filename", infoBox, "filenameLabel");
infoLayout->addWidget(filenameLabel, 2, 0);
infoLayout->addWidget(filenameLineEdit, 2, 1);
infoLayout->addWidget(filenameLabel, 4, 0);
infoLayout->addWidget(filenameLineEdit, 4, 1);
fileFormatComboBox = new QComboBox(false, infoBox, "fileFormatComboBox");
fileFormatComboBox->insertItem("bmp");
......@@ -144,8 +171,8 @@ QvisSaveWindow::CreateWindowContents()
this, SLOT(fileFormatChanged(int)));
QLabel *formatLabel = new QLabel(fileFormatComboBox, "File type",
infoBox, "formatLabel");
infoLayout->addWidget(formatLabel, 3, 0);
infoLayout->addWidget(fileFormatComboBox, 3, 1);
infoLayout->addWidget(formatLabel, 5, 0);
infoLayout->addWidget(fileFormatComboBox, 5, 1);
// The quality slider.
qualitySlider = new QSlider(Qt::Horizontal, infoBox, "qualitySlider");
......@@ -153,18 +180,21 @@ QvisSaveWindow::CreateWindowContents()
qualitySlider->setMaxValue(100);
connect(qualitySlider, SIGNAL(valueChanged(int)),
this, SLOT(qualityChanged(int)));
infoLayout->addWidget(qualitySlider, 4, 1);