Commit 76dd65dc authored by hrchilds's avatar hrchilds

Update from June 24, 2003

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@20 18c085ea-50e0-402c-830e-de6fd14e8384
parent 32d468a0
......@@ -375,6 +375,10 @@ VisWinQuery::QueryIsValid(const PickAttributes *pa, const Line *lineAtts)
// Kathleen Bonnell, Fri Jun 6 15:17:45 PDT 2003
// Added support for FullFrame mode.
//
// Kathleen Bonnell, Tue Jun 24 18:26:44 PDT 2003
// To resolve z-buffer issues in 2d, make sure the z-coord of the
// attachment point is moved towards the camera.
//
// ****************************************************************************
void
......@@ -392,18 +396,10 @@ VisWinQuery::Pick(const PickAttributes *pa)
}
else
{
//
// Due to numerical precision issues on different platforms, the
// calculated PickPoint in 2D does not always have z == 0.
// Force it so that the pick letters will always be displayed in
// front of the plot.
//
attachmentPoint[2] = 0.;
pp->SetMode3D(false);
}
pp->SetDesignator(pa->GetPickLetter().c_str());
pp->SetAttachmentPoint(attachmentPoint);
float fg[3];
mediator.GetForegroundColor(fg);
......@@ -423,6 +419,14 @@ VisWinQuery::Pick(const PickAttributes *pa)
projection[0] = distance*(pos[0] - foc[0]);
projection[1] = distance*(pos[1] - foc[1]);
projection[2] = distance*(pos[2] - foc[2]);
// avoid z-buffer issues in 2D
if (mediator.GetMode() == WINMODE_2D)
{
attachmentPoint[2] = projection[2];
}
pp->SetAttachmentPoint(attachmentPoint);
pp->Shift(projection);
if (mediator.GetFullFrameMode())
......@@ -875,3 +879,5 @@ VisWinQuery::FullFrameOff()
(*it2)->ResetPosition();
}
}
......@@ -1436,6 +1436,9 @@ ConnectViewer(ParentProcess &viewer, int *argc, char **argv[])
// Brad Whitlock, Tue Apr 9 13:43:12 PST 2002
// Ported to Windows.
//
// Hank Childs, Tue Jun 24 18:02:01 PDT 2003
// Allow for timeouts during network executions.
//
// ****************************************************************************
void
......@@ -1477,13 +1480,16 @@ PAR_EventLoop(MPIXfer &xfer, QuitRPC &quit)
MPI_Bcast((void *)&buf, 1, PAR_STATEBUFFER, 0, MPI_COMM_WORLD);
// We have work to do, so cancel the alarm.
DisableTimeout();
int num_seconds_in_half_hour = 30*60;
ResetTimeout(num_seconds_in_half_hour);
// Add the state information to the connection.
conn.Append((unsigned char *)buf.buffer, buf.nbytes);
// Process the state information.
xfer.Process();
ResetTimeout(timeout * 60);
}
}
}
......@@ -1521,6 +1527,9 @@ PAR_EventLoop(MPIXfer &xfer, QuitRPC &quit)
// Brad Whitlock, Mon Mar 25 16:03:54 PST 2002
// Made the connection and timeout code more general.
//
// Hank Childs, Tue Jun 24 18:02:01 PDT 2003
// Allow for timeouts during network executions.
//
// ****************************************************************************
bool
......@@ -1543,10 +1552,13 @@ EventLoop(Xfer &xfer, QuitRPC &quit)
TRY
{
// We've got some work to do. Disable the alarm.
DisableTimeout();
int num_seconds_in_half_hour = 30*60;
ResetTimeout(num_seconds_in_half_hour);
// Process input.
ProcessInput(xfer);
ResetTimeout(timeout * 60);
}
CATCH(LostConnectionException)
{
......
......@@ -1358,7 +1358,10 @@ DeleteActivePlotsAction::~DeleteActivePlotsAction()
// Creation: Fri Mar 21 15:51:48 PST 2003
//
// Modifications:
//
// Brad Whitlock, Mon Jun 23 16:30:51 PST 2003
// I made the ClearPickPoints and ClearRefLines methods use the window
// instead of the window manager.
//
// ****************************************************************************
void
......@@ -1367,8 +1370,8 @@ DeleteActivePlotsAction::Execute()
window->GetAnimation()->GetPlotList()->DeleteActivePlots();
if(window->GetAnimation()->GetPlotList()->GetNumPlots() == 0)
{
windowMgr->ClearPickPoints();
windowMgr->ClearRefLines();
window->ClearPickPoints();
window->ClearRefLines();
windowMgr->ResetLineoutDesignation();
windowMgr->DisableAllTools();
}
......
......@@ -151,6 +151,7 @@ public:
// Creation: May 13, 2003
//
// Modifications:
// Brad Whitlock, Tue Jun 24 13:34:10 PST 2003
//
// ****************************************************************************
......@@ -163,6 +164,7 @@ public:
virtual void Execute();
virtual bool Enabled() const;
virtual bool Toggled() const;
virtual bool AllowInToolbar() const { return false; }
};
// ****************************************************************************
......
......@@ -252,6 +252,9 @@ public:
// Kathleen Bonnell, Thu May 15 11:52:56 PDT 2003
// Added ToggleFullFrameAction.
//
// Brad Whitlock, Mon Jun 23 16:33:39 PST 2003
// I added ClearPickPointsAction, ClearRefLinesAction.
//
// ****************************************************************************
......@@ -276,7 +279,10 @@ ViewerActionManager::ViewerActionManager(ViewerWindow *win) : actionGroups()
AddAction(new SetActiveWindowAction(win), ViewerRPC::SetActiveWindowRPC);
AddAction(new ClearWindowAction(win), ViewerRPC::ClearWindowRPC);
// AddAction(new ClearAllWindowsAction(win), ViewerRPC::ClearAllWindowsRPC);
AddAction(new ClearAllWindowsAction(win), ViewerRPC::ClearAllWindowsRPC);
AddAction(new ClearPickPointsAction(win), ViewerRPC::ClearPickPointsRPC);
AddAction(new ClearReferenceLinesAction(win), ViewerRPC::ClearRefLinesRPC);
AddAction(new InvertBackgroundAction(win), ViewerRPC::InvertBackgroundRPC);
AddAction(new SetWindowLayoutAction(win), ViewerRPC::SetWindowLayoutRPC);
......@@ -414,6 +420,10 @@ ViewerActionManager::EnableActions(ViewerWindowManagerAttributes *wma)
// Brad Whitlock, Tue Apr 1 10:39:12 PDT 2003
// I added HideToolbarForAllWindows to the Customize menu.
//
// Brad Whitlock, Tue Jun 24 13:37:26 PST 2003
// I changed the code that adds actions to the general toolbar so that
// actions that are not supposed to be added to the toolbar are not added.
//
// ****************************************************************************
void
......@@ -483,8 +493,11 @@ ViewerActionManager::RealizeActionGroups()
AddActionGroup(newGroup);
win->GetToolbar()->AddAction(action->GetName(), action);
}
else if(actionInNGroups[i] == 0)
else if(actionInNGroups[i] == 0 && action->AllowInToolbar())
{
debug1 << "Adding " << ViewerRPC::ViewerRPCType_ToString(ActionIndex(i)) << " to the general toolbar" << endl;
win->GetToolbar()->AddAction("general", action);
}
}
}
......
......@@ -2006,76 +2006,6 @@ ViewerSubject::CopyPlotsToWindow()
CopyPlotsToWindow(from, to);
}
// ****************************************************************************
// Method: ViewerSubject::ClearAllWindows
//
// Purpose:
// Execute the ClearAllWindows RPC.
//
// Programmer: Eric Brugger
// Creation: October 4, 2000
//
// Modifications:
//
// ****************************************************************************
void
ViewerSubject::ClearAllWindows()
{
//
// Perform the rpc.
//
ViewerWindowManager::Instance()->ClearAllWindows();
}
// ****************************************************************************
// Method: ViewerSubject::ClearPickPoints
//
// Purpose:
// This is a Qt slot function that clears the pick points from
// the specified window.
//
// Arguments:
// windowIndex The index of the window.
//
// Programmer: Kathleen Bonnell
// Creation: November 27, 2001
//
// ****************************************************************************
void
ViewerSubject::ClearPickPoints(int windowIndex)
{
//
// Reset the window's view.
//
ViewerWindowManager::Instance()->ClearPickPoints(windowIndex);
}
// ****************************************************************************
// Method: ViewerSubject::ClearRefLines
//
// Purpose:
// This is a Qt slot function that clears the ref lines from
// the specified window.
//
// Arguments:
// windowIndex The index of the window.
//
// Programmer: Kathleen Bonnell
// Creation: April 25, 2002
//
// ****************************************************************************
void
ViewerSubject::ClearRefLines(int windowIndex)
{
//
// Reset the window's view.
//
ViewerWindowManager::Instance()->ClearRefLines(windowIndex);
}
// ****************************************************************************
// Method: ViewerSubject::IconifyAllWindows
//
......@@ -3370,30 +3300,6 @@ ViewerSubject::ProcessExpressions()
//fprintf(stderr, "ViewerSubject::ProcessExpressions(): NOT YET IMPLEMENTED\n");
}
// ****************************************************************************
// Method: ViewerSubject::ClearWindow
//
// Purpose:
// This is a Qt slot function that executes the ClearWindow RPC.
//
// Programmer: Eric Brugger
// Creation: August 22, 2000
//
// Modifications:
// Brad Whitlock, Tue Nov 7 12:22:37 PDT 2000
// Modified to use ViewerWindowManager::ClearWindow.
//
// ****************************************************************************
void
ViewerSubject::ClearWindow(int windowIndex)
{
//
// Perform the rpc.
//
ViewerWindowManager::Instance()->ClearWindow(windowIndex);
}
// ****************************************************************************
// Method: ViewerSubject::ToggleCameraViewMode
//
......@@ -4077,8 +3983,12 @@ ViewerSubject::LaunchProgressCB(void *d, int stage)
// I removed some RPC's related to plots and operators since they are now
// handled by actions.
//
// Eric Brugger, Fri Apr 18 12:46:00 PDT 2003
// I replaced auto center view with maintain view.
// Eric Brugger, Fri Apr 18 12:46:00 PDT 2003
// I replaced auto center view with maintain view.
//
// Brad Whitlock, Mon Jun 23 16:22:51 PST 2003
// I removed ClearWindow, ClearAllWindows, ClearRefLines, ClearPickPoints
// since they are now actions.
//
// ****************************************************************************
......@@ -4100,12 +4010,6 @@ ViewerSubject::HandleViewerRPC()
case ViewerRPC::CloseRPC:
Close();
break;
case ViewerRPC::ClearWindowRPC:
ClearWindow();
break;
case ViewerRPC::ClearAllWindowsRPC:
ClearAllWindows();
break;
case ViewerRPC::OpenDatabaseRPC:
OpenDatabase();
break;
......@@ -4223,9 +4127,6 @@ ViewerSubject::HandleViewerRPC()
case ViewerRPC::ToggleMaintainViewModeRPC:
ToggleMaintainViewMode();
break;
case ViewerRPC::ClearPickPointsRPC:
ClearPickPoints();
break;
case ViewerRPC::ToggleCameraViewModeRPC:
ToggleCameraViewMode();
break;
......@@ -4247,9 +4148,6 @@ ViewerSubject::HandleViewerRPC()
case ViewerRPC::SetViewExtentsTypeRPC:
SetViewExtentsType();
break;
case ViewerRPC::ClearRefLinesRPC:
ClearRefLines();
break;
case ViewerRPC::SetRenderingAttributesRPC:
SetRenderingAttributes();
break;
......
......@@ -305,7 +305,6 @@ private:
// RPC handler methods.
void Close();
void ConnectToMetaDataServer();
void ClearAllWindows();
void IconifyAllWindows();
void DeIconifyAllWindows();
void ShowAllWindows();
......@@ -372,13 +371,10 @@ private slots:
void ConnectWindow(ViewerWindow *win);
void DisconnectWindow(ViewerWindow *win);
void ClearWindow(int windowIndex = -1);
void ToggleMaintainViewMode(int windowIndex = -1);
void ToggleCameraViewMode(int windowIndex = -1);
void ToggleLockTime(int windowIndex = -1);
void ToggleLockTools(int windowIndex = -1);
void ClearPickPoints(int windowIndex = -1);
void ClearRefLines(int windowIndex = -1);
void CopyViewToWindow(int from, int to);
void CopyLightingToWindow(int from, int to);
......
......@@ -5166,39 +5166,6 @@ ViewerWindowManager::AnimationCallback()
}
}
// ****************************************************************************
// Method: ViewerWindowManager::ClearPickPoints
//
// Purpose:
// This is a Qt slot function that is called when the popup menu's invert
// button is clicked.
//
// Arguments:
// windowIndex The index of the window that called this method.
//
// Programmer: Kathleen Bonnell
// Creation: November 27, 2001
//
// Modifications:
// Kathleen Bonnell, Fri Nov 15 09:07:36 PST 2002
// Removed call to UpdatePickAtts, now handled by ViewerQueryManager.
//
// ****************************************************************************
void
ViewerWindowManager::ClearPickPoints(int windowIndex)
{
if(windowIndex < -1 || windowIndex >= maxWindows)
return;
int index = (windowIndex == -1) ? activeWindow : windowIndex;
if(windows[index] != 0)
{
windows[index]->ClearPickPoints();
}
}
// ****************************************************************************
// Method: ViewerWindowManager::GetPrinterClientAtts
//
......@@ -5250,33 +5217,6 @@ ViewerWindowManager::GetRenderingAttributes()
return renderAtts;
}
// ****************************************************************************
// Method: ViewerWindowManager::ClearRefLines
//
// Purpose:
// This is a Qt slot function that is delete button is clicked.
//
// Arguments:
// windowIndex The index of the window that called this method.
//
// Programmer: Kathleen Bonnell
// Creation: January 14, 2002
//
// ****************************************************************************
void
ViewerWindowManager::ClearRefLines(int windowIndex)
{
if(windowIndex < -1 || windowIndex >= maxWindows)
return;
int index = (windowIndex == -1) ? activeWindow : windowIndex;
if(windows[index] != 0)
{
windows[index]->ClearRefLines();
}
}
// ****************************************************************************
// Method: ViewerWindowManager::GetLineoutWindow
//
......
......@@ -256,7 +256,6 @@ class VIEWER_API ViewerWindowManager : public QObject
void CopyAnimationToWindow(int from, int to);
void DeleteWindow();
void DeleteWindow(ViewerWindow *win);
void ClearPickPoints(int windowIndex = -1);
void DisableRedraw(int windowIndex = -1);
bool FileInUse(const char *host, const char *dbName) const;
void IconifyAllWindows();
......@@ -303,7 +302,6 @@ class VIEWER_API ViewerWindowManager : public QObject
void ToggleFullFrameMode(int windowIndex = -1);
void SetViewExtentsType(avtExtentType, int windowIndex = -1);
void UpdateColorTable(const char *ctName);
void ClearRefLines(int windowIndex = -1);
void ResetLineoutDesignation(int windowIndex = -1);
int *GetWindowIndices(int *nwin) const;
int GetNumWindows() const;
......
......@@ -11,7 +11,7 @@
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 14:47:57 PST 2003
// Creation: Tue Jun 24 11:35:39 PDT 2003
//
// Modifications:
//
......@@ -37,7 +37,7 @@ ViewerWindowManagerAttributes::ViewerWindowManagerAttributes() : AttributeSubjec
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 14:47:57 PST 2003
// Creation: Tue Jun 24 11:35:39 PDT 2003
//
// Modifications:
//
......@@ -80,7 +80,7 @@ ViewerWindowManagerAttributes::ViewerWindowManagerAttributes(const ViewerWindowM
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 14:47:57 PST 2003
// Creation: Tue Jun 24 11:35:39 PDT 2003
//
// Modifications:
//
......@@ -104,7 +104,7 @@ ViewerWindowManagerAttributes::~ViewerWindowManagerAttributes()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 14:47:57 PST 2003
// Creation: Tue Jun 24 11:35:39 PDT 2003
//
// Modifications:
//
......@@ -148,7 +148,7 @@ ViewerWindowManagerAttributes::operator = (const ViewerWindowManagerAttributes &
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 14:47:57 PST 2003
// Creation: Tue Jun 24 11:35:39 PDT 2003
//
// Modifications:
//
......@@ -186,7 +186,7 @@ ViewerWindowManagerAttributes::operator == (const ViewerWindowManagerAttributes
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 14:47:57 PST 2003
// Creation: Tue Jun 24 11:35:39 PDT 2003
//
// Modifications:
//
......@@ -207,7 +207,7 @@ ViewerWindowManagerAttributes::operator != (const ViewerWindowManagerAttributes
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 14:47:57 PST 2003
// Creation: Tue Jun 24 11:35:39 PDT 2003
//
// Modifications:
//
......@@ -228,7 +228,7 @@ ViewerWindowManagerAttributes::TypeName() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 14:47:57 PST 2003
// Creation: Tue Jun 24 11:35:39 PDT 2003
//
// Modifications:
//
......@@ -256,7 +256,7 @@ ViewerWindowManagerAttributes::CopyAttributes(const AttributeGroup *atts)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 14:47:57 PST 2003
// Creation: Tue Jun 24 11:35:39 PDT 2003
//
// Modifications:
//
......@@ -282,7 +282,7 @@ ViewerWindowManagerAttributes::CreateCompatible(const std::string &tname) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 14:47:57 PST 2003
// Creation: Tue Jun 24 11:35:39 PDT 2003
//
// Modifications:
//
......@@ -308,7 +308,7 @@ ViewerWindowManagerAttributes::SelectAll()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 14:47:57 PST 2003
// Creation: Tue Jun 24 11:35:39 PDT 2003
//
// Modifications:
//
......@@ -577,7 +577,7 @@ ViewerWindowManagerAttributes::SelectActionConfigurations()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 14:47:57 PST 2003
// Creation: Tue Jun 24 11:35:39 PDT 2003
//
// Modifications:
//
......@@ -602,7 +602,7 @@ ViewerWindowManagerAttributes::AddActionGroupDescription(const ActionGroupDescri
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 14:47:57 PST 2003
// Creation: Tue Jun 24 11:35:39 PDT 2003
//
// Modifications:
//
......@@ -630,7 +630,7 @@ ViewerWindowManagerAttributes::ClearActionGroupDescriptions()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 14:47:57 PST 2003
// Creation: Tue Jun 24 11:35:39 PDT 2003
//
// Modifications:
//
......@@ -665,7 +665,7 @@ ViewerWindowManagerAttributes::RemoveActionGroupDescription(int index)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 14:47:57 PST 2003
// Creation: Tue Jun 24 11:35:39 PDT 2003
//
// Modifications:
//
......@@ -686,7 +686,7 @@ ViewerWindowManagerAttributes::GetNumActionGroupDescriptions() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 14:47:57 PST 2003
// Creation: Tue Jun 24 11:35:39 PDT 2003
//
// Modifications:
//
......@@ -707,7 +707,7 @@ ViewerWindowManagerAttributes::GetActionGroupDescription(int i)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 14:47:57 PST 2003
// Creation: Tue Jun 24 11:35:39 PDT 2003
//
// Modifications:
//
......@@ -728,7 +728,7 @@ ViewerWindowManagerAttributes::GetActionGroupDescription(int i) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 14:47:57 PST 2003
// Creation: Tue Jun 24 11:35:39 PDT 2003
//
// Modifications:
//
......@@ -749,7 +749,7 @@ ViewerWindowManagerAttributes::operator [] (int i)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 14:47:57 PST 2003
// Creation: Tue Jun 24 11:35:39 PDT 2003
//
// Modifications:
//
......@@ -774,7 +774,7 @@ ViewerWindowManagerAttributes::operator [] (int i) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 14:47:57 PST 2003
// Creation: Tue Jun 24 11:35:39 PDT 2003
//
// Modifications:
//
......@@ -804,7 +804,7 @@ ViewerWindowManagerAttributes::GetFieldName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 14:47:57 PST 2003
// Creation: Tue Jun 24 11:35:39 PDT 2003
//
// Modifications:
//
......@@ -834,7 +834,7 @@ ViewerWindowManagerAttributes::GetFieldType(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 14:47:57 PST 2003
// Creation: Tue Jun 24 11:35:39 PDT 2003
//
// Modifications:
//
......@@ -864,7 +864,7 @@ ViewerWindowManagerAttributes::GetFieldTypeName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 20 14:47:57 PST 2003
// Creation: Tue Jun 24 11:35:39 PDT 2003
//
// Modifications:
//
......@@ -943,6 +943,9 @@ ViewerWindowManagerAttributes::FieldsEqual(int index_, const AttributeGroup *rhs
// Kathleen Bonnell, Thu May 15 13:13:52 PDT 2003
// Added ToggleFullFrameRPC to the viewGroup for 1.1.5.
//
// Brad Whitlock, Mon Jun 23 16:39:49 PST 2003
// I added the Clear action group for 1.1.6.
//
// ****************************************************************************
void
......@@ -1014,7 +1017,6 @@ ViewerWindowManagerAttributes::ProcessOldVersions(DataNode *parentNode,
//
if(VersionLessThan(configVersion, "1.1.1"))
{
AddAction(actionNode, "Window", ViewerRPC::ClearWindowRPC);
AddAction(actionNode, "View", ViewerRPC::SaveViewRPC);
}
......@@ -1040,6 +1042,7 @@ ViewerWindowManagerAttributes::ProcessOldVersions(DataNode *parentNode,
plotGroup.AddAction(ViewerRPC::DeleteActivePlotsRPC);
AddActionGroup(actionNode, plotGroup);
}
//
// Add actions that are new in 1.1.5
//
......@@ -1047,6 +1050,75 @@ ViewerWindowManagerAttributes::ProcessOldVersions(DataNode *parentNode,
{
AddAction(actionNode, "View", ViewerRPC::ToggleFullFrameRPC);
}
//
// Add actions that are new in 1.1.6
//
if(VersionLessThan(configVersion, "1.1.6"))
{
ActionGroupDescription clearGroup("Clear");
clearGroup.SetVisible(true);
clearGroup.AddAction(ViewerRPC::ClearWindowRPC);
clearGroup.AddAction(ViewerRPC::ClearAllWindowsRPC);
clearGroup.AddAction(ViewerRPC::ClearPickPointsRPC);
clearGroup.AddAction(ViewerRPC::ClearRefLinesRPC);
AddActionGroup(actionNode, clearGroup);
// Remove ClearWindowRPC from the Window action group.
RemoveActionFromNode(actionNode, "Window",
ViewerRPC::ClearWindowRPC);
}
}
// ****************************************************************************
// Method: ViewerWindowManagerAttributes::RemoveActionFromNode
//
// Purpose:
// Removes an action from an action group in a DataNode.
//
// Arguments:
// node : The node that contains the action groups.
// actionGroupName : The name of the action group from which we're removing
// the action.
// action : The action to be removed.
//
// Programmer: Brad Whitlock
// Creation: Tue Jun 24 11:33:38 PDT 2003
//
// Modifications:
//
// ****************************************************************************
void
ViewerWindowManagerAttributes::RemoveActionFromNode(DataNode *node,
const char *actionGroupName, ViewerRPC::ViewerRPCType action)
{
// See if the ClearWindow action is in the Window action group.
// If it is, remove it.
std::string AGName(actionGroupName);
std::string actionName(ViewerRPC::ViewerRPCType_ToString(action));
DataNode **actionNodes = node->GetChildren();
for(int i = 0; i < node->GetNumChildren(); ++i)
{
DataNode *nameNode = actionNodes[i]->GetNode("name");
DataNode *aNode = actionNodes[i]->GetNode("actions");
if(nameNode != 0 && aNode != 0 &&
nameNode->AsString() == AGName)
{
stringVector newActions;
const stringVector &oldActions = aNode->AsStringVector();
for(int j = 0; j < oldActions.size(); ++j)
{
if(oldActions[j] != actionName)
newActions.push_back(oldActions[j]);
}
aNode->SetStringVector(newActions);
break;
}
}
}
......