Commit 568ceb67 authored by hrchilds's avatar hrchilds
Browse files

Update from August 27, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@310 18c085ea-50e0-402c-830e-de6fd14e8384
parent 8171fb35
......@@ -30,6 +30,9 @@
// Creation: Thu Nov 6 14:25:58 PST 2003
//
// Modifications:
// Eric Brugger, Wed Aug 25 15:10:57 PDT 2004
// Modify the interpretation of the time slider's Position2 to the more
// standard vtk interpretation where the coordinate is relative to Position.
//
// ****************************************************************************
......@@ -50,8 +53,7 @@ avtTimeSliderColleague::avtTimeSliderColleague(VisWindowColleagueProxy &m) :
GetSliderRect(DEFAULT_X, DEFAULT_Y, DEFAULT_WIDTH, DEFAULT_HEIGHT, rect);
timeSlider = vtkTimeSliderActor::New();
timeSlider->GetPositionCoordinate()->SetValue(rect[0], rect[1]);
timeSlider->GetPosition2Coordinate()->SetValue(rect[0] + rect[2],
rect[1] + rect[3]);
timeSlider->GetPosition2Coordinate()->SetValue(rect[2], rect[3]);
timeSlider->SetStartColor(0.,1.,1.,1.);
timeSlider->SetEndColor(1.,1.,1.,0.6);
......@@ -223,6 +225,12 @@ avtTimeSliderColleague::ShouldBeAddedToRenderer() const
// Creation: Thu Nov 6 14:29:01 PST 2003
//
// Modifications:
// Eric Brugger, Wed Aug 25 15:10:57 PDT 2004
// Modify the interpretation of the time slider's Position2 to the more
// standard vtk interpretation where the coordinate is relative to Position.
// Remove a workaround where the text height and width were set when the
// text string was changed. This doesn't seem to be necessary and it
// set the size incorrectly.
//
// ****************************************************************************
......@@ -290,7 +298,6 @@ avtTimeSliderColleague::SetOptions(const AnnotationObject &annot)
//
// Set the labels if the text vector is different
//
bool textChanged = false;
if(currentOptions.GetText() != annot.GetText())
{
const stringVector &text = annot.GetText();
......@@ -298,10 +305,6 @@ avtTimeSliderColleague::SetOptions(const AnnotationObject &annot)
SetText(text[0].c_str());
else
SetText("");
// Set the width to a size we don't want so we can update it later.
textActor->SetWidth(0.1);
textActor->SetHeight(0.1);
textChanged = true;
}
//
......@@ -316,9 +319,8 @@ avtTimeSliderColleague::SetOptions(const AnnotationObject &annot)
// Set the time slider's coordinates.
float rect[4];
GetSliderRect(p1[0], p1[1], p2[0], p2[1], rect);
timeSlider->GetPositionCoordinate()->SetValue(rect[0], rect[1], 0.f);
timeSlider->GetPosition2Coordinate()->SetValue(rect[0] + rect[2],
rect[1] + rect[3], 0.f);
timeSlider->GetPositionCoordinate()->SetValue(rect[0], rect[1]);
timeSlider->GetPosition2Coordinate()->SetValue(rect[2], rect[3]);
// Set the text actor's coordinates.
vtkCoordinate *pos = textActor->GetPositionCoordinate();
......@@ -386,6 +388,9 @@ avtTimeSliderColleague::SetOptions(const AnnotationObject &annot)
// Creation: Thu Oct 30 14:13:21 PST 2003
//
// Modifications:
// Eric Brugger, Wed Aug 25 15:10:57 PDT 2004
// Modify the interpretation of the time slider's Position2 to the more
// standard vtk interpretation where the coordinate is relative to Position.
//
// ****************************************************************************
......@@ -397,12 +402,13 @@ avtTimeSliderColleague::GetOptions(AnnotationObject &annot)
annot.SetActive(GetActive());
const float *p1 = textActor->GetPosition();
const float *p2 = timeSlider->GetPosition2();
const float *p2 = textActor->GetPosition2();
const float *p3 = timeSlider->GetPosition2();
annot.SetPosition(p1);
// Store the width and height in position2.
float p2wh[3];
p2wh[0] = p2[0] - p1[0];
p2wh[1] = p2[1] - p1[1];
p2wh[0] = p2[0];
p2wh[1] = p2[1] + p3[1];
p2wh[2] = p2[2];
annot.SetPosition2(p2wh);
......@@ -694,6 +700,8 @@ avtTimeSliderColleague::GetTextRect(float x, float y, float width,
// Creation: Wed Dec 3 11:18:57 PDT 2003
//
// Modifications:
// Eric Brugger, Wed Aug 25 15:10:57 PDT 2004
// Correct the calculation of the height of the rectangle.
//
// ****************************************************************************
......@@ -704,6 +712,6 @@ avtTimeSliderColleague::GetSliderRect(float x, float y, float width,
rect[0] = x;
rect[1] = y + height - SliderHeight(height);
rect[2] = width;
rect[3] = height - SliderHeight(height);
rect[3] = SliderHeight(height);
}
......@@ -179,6 +179,9 @@ QvisTimeSliderInterface::~QvisTimeSliderInterface()
// Creation: Wed Nov 5 11:48:15 PDT 2003
//
// Modifications:
// Eric Brugger, Wed Aug 25 14:52:12 PDT 2004
// Modify the float to percent conversion for the width and height to
// avoid numeric issues where the percent value would be one too small.
//
// ****************************************************************************
......@@ -188,9 +191,11 @@ QvisTimeSliderInterface::UpdateControls()
// Set the start position.
positionEdit->setPosition(annot->GetPosition()[0], annot->GetPosition()[1]);
// Set the spinbox values for the width and height
int w(int(annot->GetPosition2()[0] * 100.f));
int h(int(annot->GetPosition2()[1] * 100.f));
// Set the spinbox values for the width and height. The 0.5 is added
// to avoid numeric issues converting back and forth between float and
// integer.
int w(int(annot->GetPosition2()[0] * 100.f + 0.5f));
int h(int(annot->GetPosition2()[1] * 100.f + 0.5f));
widthSpinBox->blockSignals(true);
widthSpinBox->setValue(w);
widthSpinBox->blockSignals(false);
......
......@@ -1484,6 +1484,10 @@ MDServerConnection::FileHasVisItExtension(const std::string &file) const
// extraSmartGrouping flag that does additional work to try and prevent
// certain Ale3D databases from being grouped into virtual databases.
//
// Brad Whitlock, Fri Aug 27 17:39:32 PST 2004
// I fixed a bug that caused multiple virtual databases to get the
// definitions confused if they had similar names.
//
// ****************************************************************************
void
......@@ -1622,58 +1626,57 @@ MDServerConnection::GetFilteredFileList(GetFileListRPC::FileList &files,
//
// Now that we've assembled a list of filenames, go back and fix the
// ones that had a pattern but had no successors and thus were only
// one file long.
// one file long. Note that we're traversing the files.names vector
// instead of the keys in the newVirtualFiles map so we are guaranteed
// to get the same filename ordering, which is important for the way
// we store the virtual file information in the files object.
//
for(pos = newVirtualFiles.begin(); pos != newVirtualFiles.end(); ++pos)
if(newVirtualFiles.size() > 0)
{
if(pos->second.files.size() == 1)
for(int fileIndex = 0; fileIndex < files.names.size(); ++fileIndex)
{
// Change the name in the files list back to the original file name.
for(i = 0; i < files.names.size(); ++i)
// Look for the current filename in the new virtual files map. If the
// name is not in the list then it's not a virtual file.
pos = newVirtualFiles.find(files.names[fileIndex]);
if(pos == newVirtualFiles.end())
continue;
if(pos->second.files.size() == 1)
{
if(files.names[i] == pos->first.name)
{
files.names[i] = pos->second.files[0];
break;
}
// Change the name in the files list back to the original file name.
files.names[fileIndex] = pos->second.files[0];
}
}
else
{
// Determine a good root name for the database.
std::string rootName(pos->first.name + " database");
// Change the name in the files list from the pattern name
// to the new root name. Also change the file type to VIRTUAL.
for(i = 0; i < files.names.size(); ++i)
else
{
if(files.names[i] == pos->first.name)
{
files.names[i] = rootName;
files.types[i] = GetFileListRPC::VIRTUAL;
break;
}
// Determine a good root name for the database.
std::string rootName(pos->first.name + " database");
// Change the name in the files list from the pattern name
// to the new root name. Also change the file type to VIRTUAL.
files.names[fileIndex] = rootName;
files.types[fileIndex] = GetFileListRPC::VIRTUAL;
// Add the timestep names to the file list's virtual files list.
for(i = 0; i < pos->second.files.size(); ++i)
files.virtualNames.push_back(pos->second.files[i]);
files.numVirtualFiles.push_back(pos->second.files.size());
// Create a good path.
std::string path(currentWorkingDirectory);
if(path[path.size() - 1] != SLASH_CHAR)
path += SLASH_STRING;
// Add the file to the virtual files map. Give the data from the
// new vector of filenames to the existing vector of filenames
// because swapping is cheaper than copying. Note that if the
// key does not exist in the virtualFiles map, calling
// its [] operator, as we are doing, automatically adds the key
// to the map.
std::string key(path + rootName);
virtualFiles[key].path = path;
virtualFiles[key].files.swap(pos->second.files);
}
// Add the timestep names to the file list's virtual files list.
for(i = 0; i < pos->second.files.size(); ++i)
files.virtualNames.push_back(pos->second.files[i]);
files.numVirtualFiles.push_back(pos->second.files.size());
// Create a good path.
std::string path(currentWorkingDirectory);
if(path[path.size() - 1] != SLASH_CHAR)
path += SLASH_STRING;
// Add the file to the virtual files map. Give the data from the
// new vector of filenames to the existing vector of filenames
// because swapping is cheaper than copying. Note that if the
// key does not exist in the virtualFiles map, calling
// its [] operator, as we are doing, automatically adds the key
// to the map.
std::string key(path + rootName);
virtualFiles[key].path = path;
virtualFiles[key].files.swap(pos->second.files);
}
}
}
......
......@@ -32,6 +32,9 @@ vtkStandardNewMacro(vtkTimeSliderActor);
// Creation: Tue Oct 28 11:00:37 PDT 2003
//
// Modifications:
// Eric Brugger, Wed Aug 25 15:00:06 PDT 2004
// Modify the interpretation of Position2 to the more standard vtk
// interpretation where the coordinate is relative to Position.
//
// ****************************************************************************
......@@ -63,7 +66,7 @@ vtkTimeSliderActor::vtkTimeSliderActor() : vtkActor2D()
this->SetPosition(DEFAULT_X_OFFSET, DEFAULT_Y_OFFSET);
this->SetWidth(DEFAULT_WIDTH);
this->SetHeight(DEFAULT_HEIGHT);
this->SetPosition2(DEFAULT_X_OFFSET+DEFAULT_WIDTH, DEFAULT_Y_OFFSET+DEFAULT_HEIGHT);
this->SetPosition2(DEFAULT_WIDTH, DEFAULT_HEIGHT);
}
// ****************************************************************************
......@@ -181,13 +184,18 @@ vtkTimeSliderActor::AddEndCapCells(int center, vtkCellArray *polys)
// Brad Whitlock, Tue Dec 9 08:38:22 PDT 2003
// Fixed a bug that caused the end caps to become separated from the main bar.
//
// Eric Brugger, Wed Aug 25 15:00:06 PDT 2004
// Modify the interpretation of Position2 to the more standard vtk
// interpretation where the coordinate is relative to Position.
//
// ****************************************************************************
void
vtkTimeSliderActor::CreateSlider(vtkViewport *viewport)
{
float BL[2] = {this->GetPosition()[0], this->GetPosition()[1]};
float TR[2] = {this->GetPosition2()[0], this->GetPosition2()[1]};
float TR[2] = {this->GetPosition()[0] + this->GetPosition2()[0],
this->GetPosition()[1] + this->GetPosition2()[1]};
#ifdef CREATE_POLYDATA_IN_SCREEN_SPACE
viewport->NormalizedDisplayToDisplay(BL[0], BL[1]);
......
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