Commit bdc1fd76 authored by Sebastien Jourdain's avatar Sebastien Jourdain

Remove deprecated API from Undo/Redo

parent 5edb803f
......@@ -118,132 +118,6 @@ void pqUndoStackBuilder::OnStateChange( vtkSMSession *session,
}
}
//-----------------------------------------------------------------------------
void pqUndoStackBuilder::OnUnRegisterProxy(const char* group,
const char* name, vtkSMProxy* proxy)
{
// proxies registered as prototypes don't participate in
// undo/redo.
vtksys::RegularExpression prototypesRe("_prototypes$");
if (!proxy || (group && prototypesRe.find(group) != 0))
{
return;
}
#ifdef FIXME_COLLABORATION
vtkSMProxyUnRegisterUndoElement* elem =
pqProxyUnRegisterUndoElement::New();
elem->SetConnectionID(this->ConnectionID);
elem->ProxyToUnRegister(group, name, proxy);
this->UndoSet->AddElement(elem);
elem->Delete();
#endif
}
//-----------------------------------------------------------------------------
void pqUndoStackBuilder::OnPropertyModified(vtkSMProxy* proxy,
const char* pname)
{
if (proxy->IsA("vtkSMViewProxy"))
{
if (strcmp(pname, "GUISize" )== 0)
{
// GUISize is updated by the GUI.
return;
}
if (strcmp(pname, "WindowPosition") == 0)
{
// WindowPosition is updated by the GUI.
return;
}
if (strcmp(pname, "ViewTime") == 0)
{
// Render module's ViewTime is controlled by the GUI.
return;
}
}
if (proxy->IsA("vtkSMAnimationSceneProxy") &&
strcmp(pname, "ViewModules") == 0)
{
// ViewModules are updated by the GUI automatically
// as view modules are addeed, removed.
return;
}
if (proxy->IsA("vtkSMScalarBarWidgetRepresentationProxy"))
{
// For scalar bar, we don't want the position changes to get recorded in the
// undo-stack automatically.
vtkSMProperty* prop = proxy->GetProperty(pname);
if (prop && prop->GetInformationProperty())
{
return;
}
}
else if (proxy->IsA("vtkSMNewWidgetRepresentationProxy"))
{
// We don't record 3D widget changes.
return;
}
if (proxy->IsA("vtkSMTimeKeeperProxy") &&
strcmp(pname, "Views") == 0)
{
// Views are updated by the GUI automatically.
return;
}
#ifdef FIXME_COLLABORATION
bool auto_element = this->GetEnableMonitoring()==0 &&
!this->IgnoreIsolatedChanges && !this->UndoRedoing;
if (/*auto_element && */proxy->IsA("vtkSMViewProxy"))
{
// Ignore interaction changes.
const char* names[] = {
"CameraPosition", "CameraFocalPoint",
"CameraViewAngle",
"CameraParallelScale",
"CameraViewUp", "CameraClippingRange", "CenterOfRotation", 0};
for (int cc=0; names[cc]; cc++)
{
if (strcmp(pname, names[cc]) == 0)
{
return;
}
}
}
if (auto_element)
{
vtksys_ios::ostringstream stream;
vtkSMProperty* prop = proxy->GetProperty(pname);
if (prop->GetInformationOnly() || prop->GetIsInternal())
{
return;
}
stream << "Changed '" << prop->GetXMLLabel() <<"'";
this->Begin(stream.str().c_str());
}
this->Superclass::OnPropertyModified(proxy, pname);
if (auto_element)
{
this->End();
if (this->UndoSet->GetNumberOfElements() > 0)
{
this->PushToStack();
}
}
#endif
}
//-----------------------------------------------------------------------------
void pqUndoStackBuilder::PrintSelf(ostream& os, vtkIndent indent)
{
......
......@@ -98,15 +98,6 @@ protected:
bool IgnoreIsolatedChanges;
bool UndoRedoing;
// Added to ignore property changes we are told to ignore.
virtual void OnPropertyModified(vtkSMProxy* proxy,
const char* propname);
// Added to create pqProxyUnRegisterUndoElement which handles
// helper proxies as well.
virtual void OnUnRegisterProxy(const char* group, const char* name,
vtkSMProxy*);
private:
pqUndoStackBuilder(const pqUndoStackBuilder&); // Not implemented.
void operator=(const pqUndoStackBuilder&); // Not implemented.
......
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