Commit 7dc5a7d1 authored by hrchilds's avatar hrchilds

Update from February 9, 2005

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@410 18c085ea-50e0-402c-830e-de6fd14e8384
parent cf0b474a
......@@ -3560,6 +3560,14 @@ QvisGUIApplication::GetVirtualDatabaseDefinitions(
// Added code to compare virtual file definitions before reopening the
// open database.
//
// Brad Whitlock, Mon Feb 7 14:23:34 PST 2005
// I changed this mode of refreshing the selected files list so that it
// only adds new files to the selected files list. The previous behavior
// reread all directories and only kept files that match the filter. Doing
// so made it possible for files to disappear from the selected files list.
// The new method merges the old selected files list with the new, updated
// selected files list.
//
// ****************************************************************************
void
......@@ -3589,7 +3597,7 @@ QvisGUIApplication::RefreshFileList()
//
// Reread all of the directories that are in the applied file list.
//
QualifiedFilenameVector refreshedFiles;
QualifiedFilenameVector refreshedFiles(fileServer->GetAppliedFileList());
std::map<QualifiedFilename, bool>::const_iterator pos;
for(pos = paths.begin(); pos != paths.end(); ++pos)
{
......@@ -3604,7 +3612,14 @@ QvisGUIApplication::RefreshFileList()
// Filter the new list of files add them to the refreshed list.
QualifiedFilenameVector newFiles(fileServer->GetFilteredFileList());
for(i = 0; i < newFiles.size(); ++i)
refreshedFiles.push_back(newFiles[i]);
{
// Only add the file if it's not already in the list.
if(std::find(refreshedFiles.begin(), refreshedFiles.end(),
newFiles[i]) == refreshedFiles.end())
{
refreshedFiles.push_back(newFiles[i]);
}
}
}
CATCH(VisItException)
{
......
......@@ -75,6 +75,9 @@ GetMetaDataRPCExecutor::~GetMetaDataRPCExecutor()
// Handle errors through exceptions instead of error codes. This allows
// real error messages to make it to the user.
//
// Brad Whitlock, Wed Feb 9 11:36:17 PDT 2005
// I made it print the metadata to debug5 all the time.
//
// ****************************************************************************
void
......@@ -89,10 +92,11 @@ GetMetaDataRPCExecutor::Update(Subject *s)
{
// Either send a successful reply or send an error.
parent->ReadMetaData(rpc->GetFile(), rpc->GetTimeState());
#ifdef DEBUG
debug2 << "MetaData=" << endl;
parent->GetCurrentMetaData()->Print(debug2);
#endif
debug5 << "MetaData=" << endl;
if(debug5_real)
parent->GetCurrentMetaData()->Print(debug5_real);
rpc->SendReply(parent->GetCurrentMetaData());
}
CATCH2(DatabaseException, dbe)
......
......@@ -579,7 +579,7 @@ ViewerPlotList::CreateTimeSlider(const std::string &newTimeSlider, int state)
//
// Arguments:
//
// Returns:
// Returns: True if the time slider changed; false otherwise.
//
// Note:
//
......@@ -587,14 +587,18 @@ ViewerPlotList::CreateTimeSlider(const std::string &newTimeSlider, int state)
// Creation: Mon Apr 19 08:59:42 PDT 2004
//
// Modifications:
//
// Brad Whitlock, Tue Feb 8 14:41:08 PST 2005
// I made it return whether or not the time slider changed as a result
// of calling this method.
//
// ****************************************************************************
void
bool
ViewerPlotList::ValidateTimeSlider()
{
ViewerFileServer *fs = ViewerFileServer::Instance();
DatabaseCorrelationList *cL = fs->GetDatabaseCorrelationList();
bool tsChanged = false;
if(HasActiveTimeSlider())
{
......@@ -629,6 +633,7 @@ ViewerPlotList::ValidateTimeSlider()
debug1 << "There were no MT databases so there can't be "
"an active time slider." << endl;
activeTimeSlider = "";
tsChanged = true;
}
else
{
......@@ -644,6 +649,7 @@ ViewerPlotList::ValidateTimeSlider()
<< " so use the active source for the new "
"time slider." << endl;
activeTimeSlider = hostDatabaseName;
tsChanged = true;
}
}
// else do nothing because even though the hostDB is ST
......@@ -664,8 +670,11 @@ ViewerPlotList::ValidateTimeSlider()
activeTimeSlider = hostDatabaseName;
else
CreateTimeSlider(hostDatabaseName, 0);
tsChanged = true;
}
}
return tsChanged;
}
// ****************************************************************************
......@@ -3321,6 +3330,12 @@ ViewerPlotList::DeletePlot(ViewerPlot *whichOne, bool doUpdate)
// I added code to make sure that we don't set the time slider to the
// active source unless the active source is an MT database.
//
// Brad Whitlock, Tue Feb 8 14:50:55 PST 2005
// I removed a block of code that used to set the time slider to the
// hostDatabaseName if the active time slider did not use the
// hostDatabaseName in its correlation and replaced it with very similar
// logic by calling ValidateTimeSlider in all cases.
//
// ****************************************************************************
void
......@@ -3365,28 +3380,15 @@ ViewerPlotList::DeleteActivePlots()
{
// If there are no plots, make sure we stop animation.
animationMode = StopMode;
}
//
// Make sure that we change the active time slider to be the
// active source if the correlation for the active time slider
// does not contain the active source.
//
if(HasActiveTimeSlider())
{
DatabaseCorrelationList *cL = ViewerFileServer::Instance()->
GetDatabaseCorrelationList();
DatabaseCorrelation *tsCorrelation = cL->FindCorrelation(
activeTimeSlider);
if(tsCorrelation != 0 &&
!tsCorrelation->UsesDatabase(hostDatabaseName) &&
cL->FindCorrelation(hostDatabaseName) != 0)
{
SetActiveTimeSlider(hostDatabaseName);
ViewerWindowManager::Instance()->UpdateWindowInformation(
WINDOWINFO_TIMESLIDERS, window->GetWindowId());
}
}
//
// Determine whether or not it is appropriate to have a time slider.
//
if(ValidateTimeSlider())
{
ViewerWindowManager::Instance()->UpdateWindowInformation(
WINDOWINFO_TIMESLIDERS, window->GetWindowId());
}
//
......
......@@ -210,6 +210,9 @@ typedef std::map<std::string, int> StringIntMap;
// Added NotActivePlotList to isolate logic for checking if the plot
// list belongs to the active window. Changed AlterTimeSlider.
//
// Brad Whitlock, Tue Feb 8 14:53:18 PST 2005
// Added return value for ValidateTimeSlider.
//
// ****************************************************************************
......@@ -245,7 +248,7 @@ public:
bool DeleteTimeSlider(const std::string &ts, bool update = true);
void GetTimeSliderStates(const std::string &ts, int &state, int &nStates) const;
bool TimeSliderExists(const std::string &ts) const;
void ValidateTimeSlider();
bool ValidateTimeSlider();
int ResizeTimeSliders(const stringVector &sliders, bool clearCache);
void ForwardStep();
void BackwardStep();
......
......@@ -46,6 +46,8 @@ Text2DObject_SetVisible(PyObject *self, PyObject *args)
// Set the visible in the object.
obj->data->SetVisible(ival != 0);
/*CUSTOM*/
UpdateAnnotationHelper(obj->data);
Py_INCREF(Py_None);
return Py_None;
......@@ -70,6 +72,8 @@ Text2DObject_SetActive(PyObject *self, PyObject *args)
// Set the active in the object.
obj->data->SetActive(ival != 0);
/*CUSTOM*/
UpdateAnnotationHelper(obj->data);
Py_INCREF(Py_None);
return Py_None;
......@@ -120,6 +124,8 @@ Text2DObject_SetPosition(PyObject *self, PyObject *args)
// Mark the position in the object as modified.
obj->data->SelectPosition();
/*CUSTOM*/
UpdateAnnotationHelper(obj->data);
Py_INCREF(Py_None);
return Py_None;
......@@ -151,6 +157,7 @@ Text2DObject_SetWidth(PyObject *self, PyObject *args)
float *pos2 = obj->data->GetPosition2();
pos2[0] = fval;
obj->data->SelectPosition2();
UpdateAnnotationHelper(obj->data);
Py_INCREF(Py_None);
return Py_None;
......@@ -224,6 +231,8 @@ Text2DObject_SetTextColor(PyObject *self, PyObject *args)
// Set the textColor in the object.
ColorAttribute ca(c[0], c[1], c[2], c[3]);
obj->data->SetTextColor(ca);
/*CUSTOM*/
UpdateAnnotationHelper(obj->data);
Py_INCREF(Py_None);
return Py_None;
......@@ -254,6 +263,8 @@ Text2DObject_SetUseForegroundForTextColor(PyObject *self, PyObject *args)
// Set the useForegroundForTextColor in the object.
obj->data->SetUseForegroundForTextColor(ival != 0);
/*CUSTOM*/
UpdateAnnotationHelper(obj->data);
Py_INCREF(Py_None);
return Py_None;
......@@ -280,6 +291,7 @@ Text2DObject_SetText(PyObject *self, PyObject *args)
/*CUSTOM*/
stringVector s; s.push_back(str);
obj->data->SetText(s);
UpdateAnnotationHelper(obj->data);
Py_INCREF(Py_None);
return Py_None;
......@@ -306,8 +318,11 @@ Text2DObject_SetFontFamily(PyObject *self, PyObject *args)
// Set the fontFamily in the object.
if(ival >= 0 && ival < 3)
{
/*CUSTOM*/
obj->data->SetFontFamily(AnnotationObject::FontFamily(ival));
UpdateAnnotationHelper(obj->data);
}
else
{
fprintf(stderr, "An invalid fontFamily value was given. "
......@@ -340,6 +355,8 @@ Text2DObject_SetFontBold(PyObject *self, PyObject *args)
// Set the fontBold in the object.
obj->data->SetFontBold(ival != 0);
/*CUSTOM*/
UpdateAnnotationHelper(obj->data);
Py_INCREF(Py_None);
return Py_None;
......@@ -364,6 +381,8 @@ Text2DObject_SetFontItalic(PyObject *self, PyObject *args)
// Set the fontItalic in the object.
obj->data->SetFontItalic(ival != 0);
/*CUSTOM*/
UpdateAnnotationHelper(obj->data);
Py_INCREF(Py_None);
return Py_None;
......@@ -388,6 +407,8 @@ Text2DObject_SetFontShadow(PyObject *self, PyObject *args)
// Set the fontShadow in the object.
obj->data->SetFontShadow(ival != 0);
/*CUSTOM*/
UpdateAnnotationHelper(obj->data);
Py_INCREF(Py_None);
return Py_None;
......@@ -508,7 +529,6 @@ Text2DObject_setattr(PyObject *self, char *name, PyObject *args)
PyTuple_SET_ITEM(tuple, 0, args);
Py_INCREF(args);
bool retval = false;
bool update = true;
if(strcmp(name, "visible") == 0)
retval = (Text2DObject_SetVisible(self, tuple) != NULL);
......@@ -532,15 +552,6 @@ Text2DObject_setattr(PyObject *self, char *name, PyObject *args)
retval = (Text2DObject_SetFontItalic(self, tuple) != NULL);
else if(strcmp(name, "fontShadow") == 0)
retval = (Text2DObject_SetFontShadow(self, tuple) != NULL);
else
update = false;
/*CUSTOM*/
if(update)
{
Text2DObjectObject *obj = (Text2DObjectObject *)self;
UpdateAnnotationHelper(obj->data);
}
Py_DECREF(tuple);
return retval ? 0 : -1;
......
......@@ -45,6 +45,8 @@ TimeSliderObject_SetVisible(PyObject *self, PyObject *args)
// Set the visible in the object.
obj->data->SetVisible(ival != 0);
/* CUSTOM */
UpdateAnnotationHelper(obj->data);
Py_INCREF(Py_None);
return Py_None;
......@@ -69,6 +71,8 @@ TimeSliderObject_SetActive(PyObject *self, PyObject *args)
// Set the active in the object.
obj->data->SetActive(ival != 0);
/* CUSTOM */
UpdateAnnotationHelper(obj->data);
Py_INCREF(Py_None);
return Py_None;
......@@ -119,6 +123,8 @@ TimeSliderObject_SetPosition(PyObject *self, PyObject *args)
// Mark the position in the object as modified.
obj->data->SelectPosition();
/* CUSTOM */
UpdateAnnotationHelper(obj->data);
Py_INCREF(Py_None);
return Py_None;
......@@ -150,6 +156,7 @@ TimeSliderObject_SetWidth(PyObject *self, PyObject *args)
float *pos2 = obj->data->GetPosition2();
pos2[0] = fval;
obj->data->SelectPosition2();
UpdateAnnotationHelper(obj->data);
Py_INCREF(Py_None);
return Py_None;
......@@ -179,6 +186,7 @@ TimeSliderObject_SetHeight(PyObject *self, PyObject *args)
float *pos2 = obj->data->GetPosition2();
pos2[1] = fval;
obj->data->SelectPosition2();
UpdateAnnotationHelper(obj->data);
Py_INCREF(Py_None);
return Py_None;
......@@ -252,6 +260,7 @@ TimeSliderObject_SetTextColor(PyObject *self, PyObject *args)
// Set the textColor in the object.
ColorAttribute ca(c[0], c[1], c[2], c[3]);
obj->data->SetTextColor(ca);
UpdateAnnotationHelper(obj->data);
Py_INCREF(Py_None);
return Py_None;
......@@ -282,6 +291,8 @@ TimeSliderObject_SetUseForegroundForTextColor(PyObject *self, PyObject *args)
// Set the useForegroundForTextColor in the object.
obj->data->SetUseForegroundForTextColor(ival != 0);
/* CUSTOM */
UpdateAnnotationHelper(obj->data);
Py_INCREF(Py_None);
return Py_None;
......@@ -354,6 +365,7 @@ TimeSliderObject_SetStartColor(PyObject *self, PyObject *args)
ColorAttribute ca(c[0], c[1], c[2], c[3]);
/*CUSTOM*/
obj->data->SetColor1(ca);
UpdateAnnotationHelper(obj->data);
Py_INCREF(Py_None);
return Py_None;
......@@ -433,6 +445,7 @@ TimeSliderObject_SetEndColor(PyObject *self, PyObject *args)
ColorAttribute ca(c[0], c[1], c[2], c[3]);
/*CUSTOM*/
obj->data->SetColor2(ca);
UpdateAnnotationHelper(obj->data);
Py_INCREF(Py_None);
return Py_None;
......@@ -466,6 +479,7 @@ TimeSliderObject_SetText(PyObject *self, PyObject *args)
/*CUSTOM*/
stringVector s; s.push_back(str);
obj->data->SetText(s);
UpdateAnnotationHelper(obj->data);
Py_INCREF(Py_None);
return Py_None;
......@@ -496,6 +510,7 @@ TimeSliderObject_SetTimeDisplay(PyObject *self, PyObject *args)
/*CUSTOM*/
int val = (obj->data->GetIntAttribute1() & (~12)) | ((ival & 3) << 2);
obj->data->SetIntAttribute1(val);
UpdateAnnotationHelper(obj->data);
}
else
{
......@@ -536,6 +551,7 @@ TimeSliderObject_SetPercentComplete(PyObject *self, PyObject *args)
/*CUSTOM*/
float percent = fval * 0.01f;
obj->data->SetFloatAttribute1(percent);
UpdateAnnotationHelper(obj->data);
}
else
{
......@@ -571,6 +587,7 @@ TimeSliderObject_SetRounded(PyObject *self, PyObject *args)
/*CUSTOM*/
int v = (obj->data->GetIntAttribute1() & (~1)) | (ival?1:0);
obj->data->SetIntAttribute1(v);
UpdateAnnotationHelper(obj->data);
Py_INCREF(Py_None);
return Py_None;
......@@ -599,6 +616,7 @@ TimeSliderObject_SetShaded(PyObject *self, PyObject *args)
/*CUSTOM*/
int v = (obj->data->GetIntAttribute1() & (~2)) | ((ival?1:0) << 1);
obj->data->SetIntAttribute1(v);
UpdateAnnotationHelper(obj->data);
Py_INCREF(Py_None);
return Py_None;
......@@ -736,7 +754,6 @@ TimeSliderObject_setattr(PyObject *self, char *name, PyObject *args)
PyTuple_SET_ITEM(tuple, 0, args);
Py_INCREF(args);
bool retval = false;
bool update = true;
if(strcmp(name, "visible") == 0)
retval = (TimeSliderObject_SetVisible(self, tuple) != NULL);
......@@ -766,15 +783,6 @@ TimeSliderObject_setattr(PyObject *self, char *name, PyObject *args)
retval = (TimeSliderObject_SetRounded(self, tuple) != NULL);
else if(strcmp(name, "shaded") == 0)
retval = (TimeSliderObject_SetShaded(self, tuple) != NULL);
else
update = false;
/*CUSTOM*/
if(update)
{
TimeSliderObjectObject *obj = (TimeSliderObjectObject *)self;
UpdateAnnotationHelper(obj->data);
}
Py_DECREF(tuple);
return retval ? 0 : -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