Commit b6e4c07c authored by hrchilds's avatar hrchilds

Update from September 11, 2003

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@75 18c085ea-50e0-402c-830e-de6fd14e8384
parent b00fdded
......@@ -41,6 +41,9 @@ class ViewerPlot;
// Brad Whitlock, Thu Apr 10 13:14:52 PST 2003
// I added Removeable, Moveable, and AllowsSubsequentOperators.
//
// Kathleen Bonnell, Thu Sep 11 10:18:54 PDT 2003
// I added a bool argument to InitializeOperatorAtts.
//
// ****************************************************************************
class PLUGIN_API GeneralOperatorPluginInfo
......@@ -77,7 +80,8 @@ class PLUGIN_API ViewerOperatorPluginInfo : public virtual CommonOperatorPluginI
virtual void GetClientAtts(AttributeSubject *atts) = 0;
virtual void InitializeOperatorAtts(AttributeSubject *atts,
const ViewerPlot *plot) = 0;
const ViewerPlot *plot,
const bool fromDefault) = 0;
virtual const char **XPMIconData() const { return 0; }
virtual bool Removeable() const { return true; }
virtual bool Moveable() const { return true; }
......
This diff is collapsed.
......@@ -15,6 +15,9 @@ Definition:
// Kathleen Bonnell, Wed Jul 23 17:28:30 PDT 2003
// Don't print cellPoint if it is invalid (== FLT_MAX).
//
// Kathleen Bonnell, Wed Sep 10 08:02:02 PDT 2003
// Added meshInfo.
//
// ****************************************************************************
void
PickAttributes::PrintSelf(ostream &os)
......@@ -32,7 +35,15 @@ PickAttributes::PrintSelf(ostream &os)
os << "\n";
os << fileName.c_str() << " ";
os << "timestep " << timeStep << " ";
os << "domain " << domain << "\n";
if (meshInfo.empty())
{
if (domain != -1)
os << "domain " << domain << "\n";
}
else
{
os << "\n" << meshInfo.c_str() << "\n";
}
os << "active variable: " << activeVariable.c_str() << "\n";
os << "selected variables: ";
for (i = 0; i < variables.size(); i++)
......@@ -95,7 +106,7 @@ PickAttributes::PrintSelf(ostream &os)
}
Function: CreateOutputString
Declaration: void CreateOutputString(std::string &os);
Declaration: void CreateOutputString(std::string &os, bool withLetter = true);
Definition:
// ****************************************************************************
// Method: PickAttributes::CreateOutputString
......@@ -112,9 +123,13 @@ Definition:
// Kathleen Bonnell, Wed Jul 23 17:28:30 PDT 2003
// Don't include cellPoint or pickLetter if invalid.
//
// Kathleen Bonnell, Wed Sep 10 08:02:02 PDT 2003
// Added meshInfo. So that outputstring can be created with (default)
// or without the 'pickletter', added argument withLetter.
//
// ****************************************************************************
void
PickAttributes::CreateOutputString(std::string &os)
PickAttributes::CreateOutputString(std::string &os, bool withLetter)
{
if (!fulfilled)
return;
......@@ -129,19 +144,29 @@ PickAttributes::CreateOutputString(std::string &os)
else
fileName = databaseName.substr(pos+1) ;
if (pickLetter.size() != 0)
sprintf(buff, "\n%s: ", pickLetter.c_str());
else
sprintf(buff, "\n");
os += buff;
if (withLetter)
{
if (pickLetter.size() != 0)
sprintf(buff, "\n%s: ", pickLetter.c_str());
else
sprintf(buff, "\n");
os += buff;
}
os += fileName;
if (domain != -1)
if (meshInfo.empty())
{
sprintf(buff, " timestep %d domain %d\n", timeStep, domain);
if (domain != -1)
{
sprintf(buff, " timestep %d domain %d\n", timeStep, domain);
}
else
{
sprintf(buff, " timestep %d \n", timeStep);
}
}
else
else
{
sprintf(buff, " timestep %d \n", timeStep);
sprintf(buff, " timestep %d \n%s\n", timeStep, meshInfo.c_str());
}
os += buff;
if (cellPoint[0] != FLT_MAX)
......@@ -244,6 +269,8 @@ Definition:
// Creation: June 26, 2003
//
// Modifications:
// Kathleen Bonnell, Wed Sep 10 08:02:02 PDT 2003
// Reset meshInfo.
//
// ****************************************************************************
......@@ -265,6 +292,8 @@ PickAttributes::PrepareForNewPick()
if (!nodeCoords.empty())
nodeCoords.clear();
meshInfo = "";
ClearPickVarInfos();
}
......@@ -15,7 +15,7 @@ class PickVarInfo;
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Jul 24 12:43:48 PDT 2003
// Creation: Wed Sep 10 17:24:11 PST 2003
//
// Modifications:
//
......@@ -56,6 +56,7 @@ public:
void SelectNodeCoords();
void SelectRayPoint1();
void SelectRayPoint2();
void SelectMeshInfo();
// Property setting methods
void SetClearWindow(bool clearWindow_);
......@@ -79,6 +80,7 @@ public:
void SetRayPoint2(const float *rayPoint2_);
void SetNeedTransformMessage(bool needTransformMessage_);
void SetPickType(PickType pickType_);
void SetMeshInfo(const std::string &meshInfo_);
// Property getting methods
bool GetClearWindow() const;
......@@ -113,6 +115,8 @@ public:
float *GetRayPoint2();
bool GetNeedTransformMessage() const;
PickType GetPickType() const;
const std::string &GetMeshInfo() const;
std::string &GetMeshInfo();
// Persistence methods
virtual bool CreateNode(DataNode *node, bool forceAdd);
......@@ -145,7 +149,7 @@ public:
// User-defined methods
void PrintSelf(ostream &os);
void CreateOutputString(std::string &os);
void CreateOutputString(std::string &os, bool withLetter = true);
void PrepareForNewPick();
protected:
AttributeGroup *CreateSubAttributeGroup(int index);
......@@ -171,6 +175,7 @@ private:
float rayPoint2[3];
bool needTransformMessage;
int pickType;
std::string meshInfo;
};
#endif
......@@ -69,6 +69,8 @@
<Field name="pickType" label="pickType" type="enum" subtype="PickType" internal="true">
Zone
</Field>
<Field name="meshInfo" label="MeshInfo" type="string" internal="true">
</Field>
<Function name="PrintSelf" user="true" member="true">
</Function>
<Function name="CreateOutputString" user="true" member="true">
......
......@@ -670,6 +670,10 @@ avtDatabase::GetFileListFromTextFile(const char *textfile,
// methods whether or not this is a zone pick. Reflect some name changes
// in pickAtts.
//
// Kathleen Bonnell, Tue Sep 9 16:51:10 PDT 2003
// Always call QueryMesh, don't keep vars of type AVT_MESH in pickAtts'
// PickVarInfo.
//
// ****************************************************************************
void
......@@ -738,7 +742,11 @@ avtDatabase::Query(PickAttributes *pa)
}
}
std::string meshInfo;
QueryMesh(pa->GetActiveVariable(), foundDomain, meshInfo);
pa->SetMeshInfo(meshInfo);
intVector removeMe;
for (int varNum = 0; varNum < userVars.size(); varNum++)
{
vName = userVars[varNum];
......@@ -764,8 +772,8 @@ avtDatabase::Query(PickAttributes *pa)
QueryMaterial(vName, foundDomain, foundEl, ts, incEls,
pa->GetPickVarInfo(varNum), zonePick);
break;
case AVT_MESH : success =
QueryMesh(vName, foundDomain, pa->GetPickVarInfo(varNum));
case AVT_MESH :
removeMe.push_back(varNum);
break;
default :
break;
......@@ -781,6 +789,15 @@ avtDatabase::Query(PickAttributes *pa)
ENDTRY
}
//
// Remove any PickVarInfos (genenerally for vars whose type is AVT_MESH)
//
if (removeMe.size() > 0)
{
for (int i = removeMe.size() -1; i >= 0; --i)
pa->RemovePickVarInfo(removeMe[i]);
}
const char *fname = GetFilename(ts);
pa->SetDatabaseName(fname);
}
......
......@@ -92,6 +92,9 @@ class PickVarInfo;
// Kathleen Bonnell, Fri Jun 20 13:52:00 PDT 2003
// Added QueryZones, added parameter to other Query methods.
//
// Kathleen Bonnell, Tue Sep 9 16:51:10 PDT 2003
// Changed PickVarInfo argument in QueryMesh to std::string.
//
// ****************************************************************************
class DATABASE_API avtDatabase
......@@ -164,7 +167,7 @@ class DATABASE_API avtDatabase
std::vector<std::string> &)
{return false; };
virtual bool QueryMesh(const std::string &, const int,
PickVarInfo &) {return false; };
std::string &) {return false; };
virtual bool QueryZones(const std::string &, const int, int &,
const int, std::vector<int> &,
......
......@@ -4089,7 +4089,7 @@ avtGenericDatabase::QueryNodes(const std::string &varName, const int dom,
// Arguments:
// varName The variable on which to retrieve data.
// dom The domain to query.
// varInfo A place to store the results.
// meshInfo A place to store the results.
//
// Returns:
// True if data was successfully retrieved, false otherwise.
......@@ -4097,47 +4097,51 @@ avtGenericDatabase::QueryNodes(const std::string &varName, const int dom,
// Programmer: Kathleen Bonnell
// Creation: April 18, 2003
//
// Modifications:
// Kathleen Bonnell, Tue Sep 9 16:51:10 PDT 2003
// Changed PickVarInfo argument to std::string.
//
// ****************************************************************************
bool
avtGenericDatabase::QueryMesh(const std::string &varName, const int dom,
PickVarInfo &varInfo)
std::string &meshInfo)
{
bool rv = false;
string mesh = GetMetaData()->MeshForVar(varName);
const avtMeshMetaData *mmd = GetMetaData()->GetMesh(mesh);
char meshInfo[256];
string msg = " ";
char temp[256];
if (!mmd)
{
debug5 << "Querying mesh, but could not retrieve"
<< " meta data!" << endl;
return false;
}
sprintf(temp, "%s: ", mesh.c_str());
meshInfo += temp;
if (mmd->numGroups > 0 && dom < mmd->groupIds.size())
{
sprintf(meshInfo, " %s %d" , mmd->groupPieceName.c_str(),
sprintf(temp, " %s %d " , mmd->groupPieceName.c_str(),
mmd->groupIds[dom]);
msg += meshInfo;
meshInfo += temp;
rv = true;
}
if (mmd->numBlocks > 1)
{
if ( mmd->blockNames.size() == 0)
{
sprintf(meshInfo, " %s %d" , mmd->blockPieceName.c_str(),
sprintf(temp, " %s %d " , mmd->blockPieceName.c_str(),
dom + mmd->blockOrigin);
msg += meshInfo;
meshInfo += temp;
}
else
{
sprintf(meshInfo, " %s %s" , mmd->blockPieceName.c_str(),
sprintf(temp, " %s %s " , mmd->blockPieceName.c_str(),
mmd->blockNames[dom].c_str());
msg += meshInfo;
meshInfo += temp;
}
rv = true;
}
varInfo.SetMiscMessage(msg);
//
// This is where we could allow the interface to add more information.
//
......
......@@ -144,6 +144,9 @@ class PickVarInfo;
// Hank Childs, Tue Jul 29 15:59:56 PDT 2003
// Added AssociateBounds and ScaleMesh.
//
// Kathleen Bonnell, Tue Sep 9 16:51:10 PDT 2003
// Changed PickVarInfo argument in QueryMesh to std::string.
//
// ****************************************************************************
class DATABASE_API avtGenericDatabase : public avtDatasetDatabase
......@@ -261,7 +264,7 @@ class DATABASE_API avtGenericDatabase : public avtDatasetDatabase
std::vector<std::string> &);
virtual bool QueryMesh(const std::string &, const int,
PickVarInfo &);
std::string &);
virtual bool QueryZones(const std::string&, const int, int &,
const int, std::vector<int> &,
......
......@@ -24,6 +24,9 @@
// Hank Childs, Wed May 29 09:06:05 PDT 2002
// Initialized spinMode.
//
// Brad Whitlock, Wed Sep 10 15:28:12 PST 2003
// Initialized spinModeSuspended.
//
// ****************************************************************************
VisWinInteractions::VisWinInteractions(VisWindowColleagueProxy &c,
......@@ -33,6 +36,7 @@ VisWinInteractions::VisWinInteractions(VisWindowColleagueProxy &c,
mode = NAVIGATE;
bboxMode = true;
spinMode = false;
spinModeSuspended = false;
hotPointInteractor = new VisitHotPointInteractor(i);
mediator.SetInteractor(hotPointInteractor);
}
......@@ -370,6 +374,43 @@ VisWinInteractions::GetSpinMode() const
return spinMode;
}
// ****************************************************************************
// Method: VisWinInteractions::SetSpinModeSuspended
//
// Purpose:
// Sets whether spin mode is temporarily suspended.
//
// Programmer: Brad Whitlock
// Creation: Wed Sep 10 15:29:02 PST 2003
//
// ****************************************************************************
void
VisWinInteractions::SetSpinModeSuspended(bool val)
{
spinModeSuspended = val;
}
// ****************************************************************************
// Method: VisWinInteractions::GetSpinModeSuspdended
//
// Purpose:
// Determines whether the spin mode is suspended.
//
// Returns: true if spin mode is suspended, false otherwise.
//
// Programmer: Brad Whitlock
// Creation: Wed Sep 10 15:59:18 PST 2003
//
// ****************************************************************************
bool
VisWinInteractions::GetSpinModeSuspended() const
{
return spinModeSuspended;
}
// ****************************************************************************
// Method: VisWinInteractions::NoPlots
......
......@@ -43,6 +43,9 @@ class VisitHotPointInteractor;
// Kathleen Bonnell, Wed May 8 14:06:50 PDT 2002
// Add support for curve mode.
//
// Brad Whitlock, Wed Sep 10 15:27:35 PST 2003
// Added support for temporarily suspending spin mode.
//
// ****************************************************************************
class VISWINDOW_API VisWinInteractions : public VisWinColleague
......@@ -58,6 +61,8 @@ class VISWINDOW_API VisWinInteractions : public VisWinColleague
bool GetBoundingBoxMode() const;
void SetSpinMode(bool);
bool GetSpinMode() const;
void SetSpinModeSuspended(bool);
bool GetSpinModeSuspended() const;
virtual void Start2DMode();
virtual void Stop2DMode();
......@@ -73,6 +78,7 @@ class VISWINDOW_API VisWinInteractions : public VisWinColleague
INTERACTION_MODE mode;
bool bboxMode;
bool spinMode;
bool spinModeSuspended;
VisitHotPointInteractor *hotPointInteractor;
};
......
......@@ -53,7 +53,10 @@ Navigate3D::Navigate3D(VisWindowInteractorProxy &v) : VisitInteractor(v)
// Kathleen Bonnell, Fri Dec 13 14:07:15 PST 2002
// Retrieve the LastPosition from the renderWindowInteractor. It is no
// longer a member of the parent class.
//
//
// Brad Whitlock, Wed Sep 10 16:05:08 PST 2003
// I added support for temporarily suspending spin mode.
//
// ****************************************************************************
void
......@@ -93,16 +96,26 @@ Navigate3D::OnTimer(void)
if (!matchedUpState && shouldSpin)
{
VisWindow *vw = proxy;
if (vw->GetSpinMode() == true)
if(!vw->GetSpinModeSuspended())
{
OldX = spinOldX;
OldY = spinOldY;
RotateCamera(spinNewX, spinNewY);
rwi->CreateTimer(VTKI_TIMER_UPDATE);
if (vw->GetSpinMode())
{
OldX = spinOldX;
OldY = spinOldY;
RotateCamera(spinNewX, spinNewY);
rwi->CreateTimer(VTKI_TIMER_UPDATE);
}
else
{
DisableSpinMode();
}
}
else
else if(vw->GetSpinMode())
{
DisableSpinMode();
// Don't mess with the camera, just create another timer so
// we keep getting into this method until spin mode is no
// longer suspended.
rwi->CreateTimer(VTKI_TIMER_UPDATE);
}
}
}
......@@ -289,6 +302,8 @@ Navigate3D::EndMiddleButtonAction()
// Programmer: Hank Childs
// Creation: May 29, 2002
//
// Modifications:
//
// ****************************************************************************
void
......
......@@ -1939,6 +1939,47 @@ VisWindow::GetSpinMode() const
}
// ****************************************************************************
// Method: VisWindow::SetSpinModeSuspended
//
// Purpose:
// Sets the VisWindow's spin mode suspension flag.
//
// Programmer: Brad Whitlock
// Creation: Wed Sep 10 16:02:22 PST 2003
//
// ****************************************************************************
void
VisWindow::SetSpinModeSuspended(bool mode)
{
if(mode != interactions->GetSpinModeSuspended())
{
interactions->SetSpinModeSuspended(mode);
}
}
// ****************************************************************************
// Method: VisWindow::GetSpinModeSuspended
//
// Purpose:
// Gets whether spin mode is suspended.
//
// Returns: true if spin mode is suspended, false otherwise.
//
// Programmer: Brad Whitlock
// Creation: Wed Sep 10 16:01:57 PST 2003
//
// ****************************************************************************
bool
VisWindow::GetSpinModeSuspended() const
{
return interactions->GetSpinModeSuspended();
}
// ****************************************************************************
// Method: VisWindow::ResetView
//
......
......@@ -225,6 +225,9 @@ class VisitInteractor;
// Eric Brugger, Wed Aug 20 10:06:56 PDT 2003
// Removed GetTypeIsCurve and SetTypeIsCurve. Added GetWindowMode.
//
// Brad Whitlock, Wed Sep 10 16:00:51 PST 2003
// Added GetSpinModeSuspended and SetSpinModeSuspended.
//
// ****************************************************************************
class VISWINDOW_API VisWindow
......@@ -295,6 +298,8 @@ public:
bool GetBoundingBoxMode() const;
void SetSpinMode(bool);
bool GetSpinMode() const;
void SetSpinModeSuspended(bool);
bool GetSpinModeSuspended() const;
void SetViewExtentsType(avtExtentType);
void ResetView(void);
......
......@@ -100,6 +100,9 @@ QvisMessageWindow::~QvisMessageWindow()
// Brad Whitlock, Tue May 20 15:07:59 PST 2003
// I made it work with the regenerated MessageAttributes.
//
// Brad Whitlock, Wed Sep 10 09:44:44 PDT 2003
// I made the cursor get reset for error and warning messages.
//
// *************************************************************************************
void
......@@ -113,11 +116,13 @@ QvisMessageWindow::Update(Subject *)
show();
qApp->beep();
severityLabel->setText(QString("Error!"));
RestoreCursor();
}
else if(ma->GetSeverity() == MessageAttributes::Warning)
{
show();
severityLabel->setText(QString("Warning"));
severityLabel->setText(QString("Warning"));
RestoreCursor();
}
else if(ma->GetSeverity() == MessageAttributes::Message)
severityLabel->setText(QString("Message"));
......
......@@ -131,6 +131,11 @@ QvisOperatorWindow::GetCurrentValues(int)
// Jeremy Meredith, Mon Jun 23 16:18:29 PDT 2003
// Changed GetAllID to GetEnabledID.
//
// Kathleen Bonnell, Thu Sep 11 10:35:39 PDT 2003
// When the operator needs to be added, set client atts (instead of default),
// but let the operator know to initalize from client via a flag passed
// to AddOperator. This allows the 'Reset' operation to work as expected.
//
// ****************************************************************************
void
......@@ -182,12 +187,12 @@ QvisOperatorWindow::SetOperatorOptions()
"Yes", "No", 0,
0, 1 ) == 0)
{
// Set the default attributes so when we apply the operator,
// it only causes the plot to be modified one time. Otherwise
// we have to add the operator and then set its options
// which would cause the plot to be generated twice.
viewer->SetDefaultOperatorOptions(operatorType);
viewer->AddOperator(operatorType);
// Set the client attributes, and set the 'fromDefault' flag
// to false in the call to AddOperator, so that the operator
// knows to initialize the atts from client rather than the
// ususal default atts.
viewer->SetOperatorOptions(operatorType);
viewer->AddOperator(operatorType, false);
}
}
else
......
This diff is collapsed.
......@@ -45,6 +45,9 @@ class PickAttributes;
// Brad Whitlock, Tue Sep 9 09:02:03 PDT 2003
// I made it use QMultiLineEdit instead of QListBox.
//
// Kathleen Bonnell, Wed Sep 10 08:02:02 PDT 2003
// Added the savePicks checkbox. Remove AddInformation, no longer necessary.
//
// ****************************************************************************
class GUI_API QvisPickWindow : public QvisPostableWindowObserver
......@@ -72,11 +75,12 @@ private slots:
void useNodeCoordsToggled(bool val);
void logicalCoordsToggled(bool val);
void autoShowToggled(bool);
void savePicksToggled(bool);
private:
void UpdatePage(void);
void ClearPages(void);
void AddInformation(QString &, const QString &, int &) const;
bool savePicks;
bool autoShow;
int nextPage;
QString lastLetter;
......@@ -87,6 +91,7 @@ private:
QCheckBox *useNodeCoords;
QCheckBox *logicalCoords;
QCheckBox *autoShowCheckBox;
QCheckBox *savePicksCheckBox;
QLineEdit *varsLineEdit;
PickAttributes *pickAtts;
......
......@@ -349,6 +349,10 @@ QvisPlotManagerWidget::CreateMenus()
// I moved the code that sets the enabled state for the Plots and Operators
// menus to UpdatePlotAndOperatorMenuEnabledState.
//
// Brad Whitlock, Wed Sep 10 09:04:34 PDT 2003
// I moved the code that sets the enabled state for the Hide, Delete,
// and Draw buttons to UpdateHideDeleteDrawButtonsEnabledState.
//
// ****************************************************************************
void
......@@ -434,9 +438,7 @@ QvisPlotManagerWidget::Update(Subject *TheChangedSubject)
// or not the engine is busy.
activePlots->setEnabled(canChange);
plotListBox->setEnabled(canChange);
hideButton->setEnabled(canChange);
deleteButton->setEnabled(canChange);
drawButton->setEnabled(canChange);
UpdateHideDeleteDrawButtonsEnabledState();
applyOperatorToggle->setEnabled(canChange);
bool havePlots = (plotAttsMenu->count() > 0);
......@@ -479,13 +481,14 @@ QvisPlotManagerWidget::Update(Subject *TheChangedSubject)
// I added a check to prevent updates to the listbox if they are not
// necessary.
//
// Brad Whitlock, Wed Sep 10 08:57:46 PDT 2003
// I changed the code so the Hide button is enabled when is should be enabled.
//
// ****************************************************************************
void
QvisPlotManagerWidget::UpdatePlotList()
{
int nHideablePlots = 0;
if(plotListBox->NeedsUpdated(plotList))
{
// Update the plot list.
......@@ -520,25 +523,52 @@ QvisPlotManagerWidget::UpdatePlotList()
current.GetHiddenFlag(), (int)current.GetStateType(),
current.GetDatabaseName().c_str(),current.GetPlotVar().c_str());
#endif
// Figure out how many plots are selected and complete. These are
// the plots that can be hidden.
bool hideableState = (current.GetStateType() == Plot::Completed) ||
(current.GetStateType() == Plot::Error);
bool canHide = hideableState || current.GetHiddenFlag();
if(current.GetActiveFlag() && canHide)
++nHideablePlots;
} // end for
}
// Set the enabled states for the hide, delete buttons.
// Set the enabled states for the hide, delete, and draw buttons.
UpdateHideDeleteDrawButtonsEnabledState();