Commit 92c21943 authored by Sebastien Jourdain's avatar Sebastien Jourdain

First step in the new undo/redo

parent 624c394a
......@@ -39,13 +39,15 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pqActiveObjects.h"
#include "pqServerManagerModel.h"
#include "vtkSMProxyManager.h"
#include "vtkSMSession.h"
#include <QDebug>
//-----------------------------------------------------------------------------
pqUndoRedoBehavior::pqUndoRedoBehavior(QObject* parentObject)
: Superclass(parentObject)
{
#ifdef FIXME_COLLABORATION
pqApplicationCore* core = pqApplicationCore::instance();
if (core->getUndoStack())
{
......@@ -59,7 +61,7 @@ pqUndoRedoBehavior::pqUndoRedoBehavior(QObject* parentObject)
builder->Delete();
// TODO: I don't know how to handle the registering of undo-elements.
#ifdef FIXME_COLLABORATION
pqSplitViewUndoElement* svu_elem = pqSplitViewUndoElement::New();
stack->registerElementForLoader(svu_elem);
svu_elem->Delete();
......@@ -67,6 +69,7 @@ pqUndoRedoBehavior::pqUndoRedoBehavior(QObject* parentObject)
pqCloseViewUndoElement* cvu_elem = pqCloseViewUndoElement::New();
stack->registerElementForLoader(cvu_elem);
cvu_elem->Delete();
#endif
QObject::connect(
&pqActiveObjects::instance(), SIGNAL(serverChanged(pqServer*)),
......@@ -86,15 +89,19 @@ pqUndoRedoBehavior::pqUndoRedoBehavior(QObject* parentObject)
SIGNAL(finishedRemovingServer()),
stack, SLOT(clear()));
// FIXME QObject::connect(
// FIXME &this->Implementation->VCRController, SIGNAL(beginNonUndoableChanges()),
// FIXME this->Implementation->UndoStack, SLOT(beginNonUndoableChanges()));
// FIXME QObject::connect(
// FIXME &this->Implementation->VCRController, SIGNAL(endNonUndoableChanges()),
// FIXME this->Implementation->UndoStack, SLOT(endNonUndoableChanges()));
// FIXME disable undo when VCR is used
// QObject::connect(
// &this->Implementation->VCRController, SIGNAL(beginNonUndoableChanges()),
// this->Implementation->UndoStack, SLOT(beginNonUndoableChanges()));
// QObject::connect(
// &this->Implementation->VCRController, SIGNAL(endNonUndoableChanges()),
// this->Implementation->UndoStack, SLOT(endNonUndoableChanges()));
core->setUndoStack(stack);
#endif
// FIXME COLLABORATION (Utkarsh): Where the binding should occur ???
vtkSMProxyManager::GetProxyManager()->GetSession()->SetUndoStackBuilder(builder);
}
......
......@@ -41,7 +41,6 @@ pqUndoRedoReaction::pqUndoRedoReaction(QAction* parentObject, bool _undo)
this->Undo = _undo;
this->enable(false);
#ifdef FIXME_COLLABORATION
pqUndoStack* stack = pqApplicationCore::instance()->getUndoStack();
if (!stack)
{
......@@ -53,13 +52,11 @@ pqUndoRedoReaction::pqUndoRedoReaction(QAction* parentObject, bool _undo)
{
this->setUndoStack(stack);
}
#endif
}
//-----------------------------------------------------------------------------
void pqUndoRedoReaction::setUndoStack(pqUndoStack* stack)
{
#ifdef FIXME_COLLABORATION
if (this->Undo)
{
QObject::connect(stack, SIGNAL(canUndoChanged(bool)),
......@@ -74,13 +71,11 @@ void pqUndoRedoReaction::setUndoStack(pqUndoStack* stack)
QObject::connect(stack, SIGNAL(redoLabelChanged(const QString&)),
this, SLOT(setLabel(const QString&)));
}
#endif
}
//-----------------------------------------------------------------------------
void pqUndoRedoReaction::undo()
{
#ifdef FIXME_COLLABORATION
pqUndoStack* stack = pqApplicationCore::instance()->getUndoStack();
if (!stack)
{
......@@ -88,13 +83,11 @@ void pqUndoRedoReaction::undo()
return;
}
stack->undo();
#endif
}
//-----------------------------------------------------------------------------
void pqUndoRedoReaction::redo()
{
#ifdef FIXME_COLLABORATION
pqUndoStack* stack = pqApplicationCore::instance()->getUndoStack();
if (!stack)
{
......@@ -102,7 +95,6 @@ void pqUndoRedoReaction::redo()
return;
}
stack->redo();
#endif
}
//-----------------------------------------------------------------------------
......
......@@ -39,6 +39,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "vtkSMProxyManager.h"
#include "vtkSMUndoStack.h"
#include "vtkUndoSet.h"
#include "vtkSMSession.h"
#include "vtkSMRemoteObject.h"
#include <vtksys/ios/sstream>
#include <vtksys/RegularExpression.hxx>
......@@ -52,89 +54,150 @@ vtkStandardNewMacro(pqUndoStackBuilder);
pqUndoStackBuilder::pqUndoStackBuilder()
{
this->IgnoreIsolatedChanges = false;
vtkMemberFunctionCommand<pqUndoStackBuilder>* observer =
vtkMemberFunctionCommand<pqUndoStackBuilder>::New();
observer->SetCallback(*this, &pqUndoStackBuilder::OnStartEvent);
this->StartObserver = observer;
observer = vtkMemberFunctionCommand<pqUndoStackBuilder>::New();
observer->SetCallback(*this, &pqUndoStackBuilder::OnEndEvent);
this->EndObserver = observer;
this->UndoRedoing = false;
}
//-----------------------------------------------------------------------------
pqUndoStackBuilder::~pqUndoStackBuilder()
{
if (this->UndoStack)
{
this->UndoStack->RemoveObserver(this->StartObserver);
this->UndoStack->RemoveObserver(this->EndObserver);
}
this->StartObserver->Delete();
this->EndObserver->Delete();
}
//-----------------------------------------------------------------------------
void pqUndoStackBuilder::OnStartEvent()
void pqUndoStackBuilder::SetUndoStack(vtkSMUndoStack* stack)
{
this->UndoRedoing = true;
}
if (this->UndoStack == stack)
{
return;
}
this->Superclass::SetUndoStack(stack);
}
//-----------------------------------------------------------------------------
void pqUndoStackBuilder::OnEndEvent()
void pqUndoStackBuilder::OnCreation( vtkSMSession *session,
vtkTypeUInt32 globalId,
const vtkSMMessage *creationState)
{
this->UndoRedoing = false;
}
vtkSMRemoteObject* proxy = session->GetRemoteObject(globalId);
// FIXME make sure we don't escape too much (Utkarsh)
if( !proxy || (proxy && (
proxy->IsA("vtkSMViewProxy") ||
proxy->IsA("vtkSMCameraProxy") ||
proxy->IsA("vtkSMTimeKeeperProxy") ||
proxy->IsA("vtkSMAnimationScene") ||
proxy->IsA("vtkSMAnimationSceneProxy") ||
proxy->IsA("vtkSMNewWidgetRepresentationProxy") ||
proxy->IsA("vtkSMScalarBarWidgetRepresentationProxy"))))
{
return;
}
bool auto_element = !this->IgnoreAllChanges &&
!this->IgnoreIsolatedChanges && !this->UndoRedoing;
if (auto_element)
{
vtksys_ios::ostringstream stream;
stream << "Changed '" << proxy->GetClassName() <<"'";
this->Begin(stream.str().c_str());
}
this->Superclass::OnCreation(session, globalId, creationState);
if (auto_element)
{
this->End();
if (this->UndoSet->GetNumberOfElements() > 0)
{
this->PushToStack();
}
}
}
//-----------------------------------------------------------------------------
void pqUndoStackBuilder::SetUndoStack(vtkSMUndoStack* stack)
void pqUndoStackBuilder::OnDeletion( vtkSMSession *session,
vtkTypeUInt32 globalId,
const vtkSMMessage *previousState)
{
if (this->UndoStack == stack)
vtkSMRemoteObject* proxy = session->GetRemoteObject(globalId);
// FIXME make sure we don't escape too much (Utkarsh)
if( !proxy || (proxy && (
//proxy->IsA("vtkSMViewProxy") ||
proxy->IsA("vtkSMCameraProxy") ||
proxy->IsA("vtkSMTimeKeeperProxy") ||
proxy->IsA("vtkSMAnimationScene") ||
proxy->IsA("vtkSMAnimationSceneProxy") ||
proxy->IsA("vtkSMNewWidgetRepresentationProxy") ||
proxy->IsA("vtkSMScalarBarWidgetRepresentationProxy"))))
{
return;
}
if (this->UndoStack)
bool auto_element = !this->IgnoreAllChanges &&
!this->IgnoreIsolatedChanges && !this->UndoRedoing;
if (auto_element)
{
this->UndoStack->RemoveObserver(this->StartObserver);
this->UndoStack->RemoveObserver(this->EndObserver);
vtksys_ios::ostringstream stream;
stream << "Changed '" << proxy->GetClassName() <<"'";
this->Begin(stream.str().c_str());
}
this->Superclass::SetUndoStack(stack);
this->Superclass::OnDeletion(session, globalId, previousState);
if (this->UndoStack)
if (auto_element)
{
this->UndoStack->AddObserver(vtkCommand::StartEvent, this->StartObserver);
this->UndoStack->AddObserver(vtkCommand::EndEvent, this->EndObserver);
this->End();
if (this->UndoSet->GetNumberOfElements() > 0)
{
this->PushToStack();
}
}
}
//-----------------------------------------------------------------------------
void pqUndoStackBuilder::ExecuteEvent(vtkObject* caller, unsigned long eventid,
void* data)
void pqUndoStackBuilder::OnUpdate( vtkSMSession *session,
vtkTypeUInt32 globalId,
const vtkSMMessage *oldState,
const vtkSMMessage *newState)
{
#ifdef FIXME_COLLABORATION
if (this->GetIgnoreAllChanges() || this->HandleChangeEvents() ||
eventid != vtkCommand::PropertyModifiedEvent)
vtkSMRemoteObject* proxy = session->GetRemoteObject(globalId);
// FIXME make sure we don't escape too much (Utkarsh)
if( !proxy || (proxy && (
//proxy->IsA("vtkSMViewProxy") ||
proxy->IsA("vtkSMCameraProxy") ||
proxy->IsA("vtkSMTimeKeeperProxy") ||
proxy->IsA("vtkSMAnimationScene") ||
proxy->IsA("vtkSMAnimationSceneProxy") ||
proxy->IsA("vtkSMNewWidgetRepresentationProxy") ||
proxy->IsA("vtkSMScalarBarWidgetRepresentationProxy"))))
{
this->Superclass::ExecuteEvent(caller, eventid, data);
return;
}
// Property modification events are automatically added to stack
// under certain conditions even when the undo stack builder is not building an
// active undo element.
if (!this->IgnoreIsolatedChanges && !this->UndoRedoing)
bool auto_element = !this->IgnoreAllChanges &&
!this->IgnoreIsolatedChanges && !this->UndoRedoing;
if (auto_element)
{
vtkSMProxyManager::ModifiedPropertyInformation &info =*(reinterpret_cast<
vtkSMProxyManager::ModifiedPropertyInformation*>(data));
this->OnPropertyModified(info.Proxy, info.PropertyName);
vtksys_ios::ostringstream stream;
stream << "Changed '" << proxy->GetClassName() <<"'";
this->Begin(stream.str().c_str());
}
this->Superclass::OnUpdate(session, globalId, oldState, newState);
if (auto_element)
{
this->End();
if (this->UndoSet->GetNumberOfElements() > 0)
{
this->PushToStack();
}
}
#endif
}
//-----------------------------------------------------------------------------
......
......@@ -85,19 +85,23 @@ public:
/// Overridden to add observers to not record changes when the
/// stack is being undone/redone.
virtual void SetUndoStack(vtkSMUndoStack*);
/// Overridden to filter unwanted event and manage auto undoset creation
virtual void OnCreation(vtkSMSession *session, vtkTypeUInt32 globalId,
const vtkSMMessage *creationState);
virtual void OnUpdate(vtkSMSession *session, vtkTypeUInt32 globalId,
const vtkSMMessage *previousState,
const vtkSMMessage *newState);
virtual void OnDeletion(vtkSMSession *session, vtkTypeUInt32 globalId,
const vtkSMMessage *previousState);
protected:
pqUndoStackBuilder();
~pqUndoStackBuilder();
virtual void ExecuteEvent(vtkObject* caller, unsigned long eventid,
void* data);
bool IgnoreIsolatedChanges;
bool UndoRedoing;
void OnStartEvent();
void OnEndEvent();
// Added to ignore property changes we are told to ignore.
virtual void OnPropertyModified(vtkSMProxy* proxy,
const char* propname);
......@@ -110,9 +114,6 @@ protected:
private:
pqUndoStackBuilder(const pqUndoStackBuilder&); // Not implemented.
void operator=(const pqUndoStackBuilder&); // Not implemented.
vtkCommand* StartObserver;
vtkCommand* EndObserver;
};
#endif
......
......@@ -116,7 +116,7 @@ QT4_WRAP_CPP(MOC_BUILT_SOURCES
pqTimeKeeper.h
pqTwoDRenderView.h
# pqScatterPlotView.h
#pqUndoStack.h
pqUndoStack.h
pqView.h
pqViewExporterManager.h
pqXMLEventObserver.h
......@@ -353,8 +353,8 @@ ADD_LIBRARY(pqCore
pqTreeLayoutStrategyInterface.h
pqTwoDRenderView.cxx
pqTwoDRenderView.h
# pqUndoStack.cxx
# pqUndoStack.h
pqUndoStack.cxx
pqUndoStack.h
pqView.cxx
pqViewExporterManager.cxx
pqViewExporterManager.h
......
......@@ -72,9 +72,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pqSMAdaptor.h"
#include "pqStandardServerManagerModelInterface.h"
#include "pqStandardViewModules.h"
#ifdef FIXME_COLLABORATION
#include "pqUndoStack.h"
#endif
#include "pqXMLUtil.h"
#include "vtkInitializationHelper.h"
#include "vtkProcessModuleAutoMPI.h"
......@@ -293,7 +291,6 @@ void pqApplicationCore::setLookupTableManager(pqLookupTableManager* mgr)
}
}
#ifdef FIXME_COLLABORATION
//-----------------------------------------------------------------------------
void pqApplicationCore::setUndoStack(pqUndoStack* stack)
{
......@@ -307,7 +304,6 @@ void pqApplicationCore::setUndoStack(pqUndoStack* stack)
emit this->undoStackChanged(stack);
}
}
#endif
//-----------------------------------------------------------------------------
void pqApplicationCore::setDisplayPolicy(pqDisplayPolicy* policy)
......
......@@ -101,13 +101,11 @@ public:
pqObjectBuilder* getObjectBuilder() const
{ return this->ObjectBuilder; }
#ifdef FIXME_COLLABORATION
/// Set/Get the application's central undo stack. By default no undo stack is
/// provided. Applications must set on up as required.
void setUndoStack(pqUndoStack* stack);
pqUndoStack* getUndoStack() const
{ return this->UndoStack; }
#endif
/// Custom Applications may need use various "managers"
/// All such manager can be registered with the pqApplicationCore
......
......@@ -32,15 +32,17 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pqUndoStack.h"
#include "vtkEventQtSlotConnect.h"
#include "vtkProcessModuleConnectionManager.h"
// FIXME COLLABORATION #include "vtkProcessModuleConnectionManager.h"
#include "vtkProcessModule.h"
#include "vtkSmartPointer.h"
#include "vtkSMProxyManager.h"
#include "vtkSMUndoRedoStateLoader.h"
#include "vtkSMUndoStackBuilder.h"
#include "vtkSMUndoStack.h"
#include "vtkPVXMLElement.h" // vistrails
#include "vtkSMIdBasedProxyLocator.h" // vistrails
#include "vtkUndoSet.h"
#include "vtkSMUndoElement.h"
#include "vtkSMProxyUndoElement.h"
#include "vtkSMRemoteObjectUpdateUndoElement.h"
#include <QtDebug>
......@@ -49,7 +51,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pqApplicationCore.h"
#include "pqHelperProxyRegisterUndoElement.h"
#include "pqProxyModifiedStateUndoElement.h"
#include "pqProxyUnRegisterUndoElement.h"
#include "pqServer.h"
//-----------------------------------------------------------------------------
......@@ -63,7 +64,6 @@ public:
vtkSmartPointer<vtkSMUndoStack> UndoStack;
vtkSmartPointer<vtkSMUndoStackBuilder> UndoStackBuilder;
vtkSmartPointer<vtkEventQtSlotConnect> VTKConnector;
vtkSmartPointer<vtkSMUndoRedoStateLoader> StateLoader;
QList<bool> IgnoreAllChangesStack;
int NestedCount;
......@@ -77,7 +77,6 @@ pqUndoStack::pqUndoStack(bool clientOnly,
{
this->Implementation = new pqImplementation();
this->Implementation->UndoStack = vtkSmartPointer<vtkSMUndoStack>::New();
this->Implementation->UndoStack->SetClientOnly(clientOnly);
if (builder)
{
......@@ -93,23 +92,6 @@ pqUndoStack::pqUndoStack(bool clientOnly,
builder->SetUndoStack(this->Implementation->UndoStack);
vtkSMUndoRedoStateLoader* loader = vtkSMUndoRedoStateLoader::New();
vtkSMUndoElement* elem = pqHelperProxyRegisterUndoElement::New();
loader->RegisterElement(elem);
elem->Delete();
elem = pqProxyUnRegisterUndoElement::New();
loader->RegisterElement(elem);
elem->Delete();
elem = pqProxyModifiedStateUndoElement::New();
loader->RegisterElement(elem);
elem->Delete();
this->Implementation->UndoStack->SetStateLoader(loader);
this->Implementation->StateLoader = loader;
loader->Delete();
this->Implementation->VTKConnector = vtkSmartPointer<vtkEventQtSlotConnect>::New();
this->Implementation->VTKConnector->Connect(this->Implementation->UndoStack,
vtkCommand::ModifiedEvent, this, SLOT(onStackChanged()), NULL, 1.0);
......@@ -152,12 +134,6 @@ const QString pqUndoStack::redoLabel()
//-----------------------------------------------------------------------------
void pqUndoStack::addToActiveUndoSet(vtkUndoElement* element)
{
if (this->Implementation->UndoStackBuilder->GetConnectionID()
== vtkProcessModuleConnectionManager::GetNullConnectionID())
{
return;
}
if (this->ignoreAllChanges())
{
return;
......@@ -166,12 +142,6 @@ void pqUndoStack::addToActiveUndoSet(vtkUndoElement* element)
this->Implementation->UndoStackBuilder->Add(element);
}
//-----------------------------------------------------------------------------
void pqUndoStack::registerElementForLoader(vtkSMUndoElement* elem )
{
this->Implementation->StateLoader->RegisterElement(elem);
}
//-----------------------------------------------------------------------------
void pqUndoStack::onStackChanged()
{
......@@ -197,30 +167,9 @@ void pqUndoStack::onStackChanged()
emit this->redoLabelChanged(redo_label);
}
//begin vistrails
vtkUndoSet* pqUndoStack::getLastUndoSet() {
return this->Implementation->UndoStack->getLastUndoSet();
}
vtkUndoSet* pqUndoStack::getUndoSetFromXML(vtkPVXMLElement *root) {
vtkSMIdBasedProxyLocator* locator = vtkSMIdBasedProxyLocator::New();
locator->SetConnectionID(this->Implementation->UndoStackBuilder->GetConnectionID());
locator->SetDeserializer(this->Implementation->StateLoader);
vtkUndoSet* undoSet = this->Implementation->StateLoader->LoadUndoRedoSet(root, locator);
locator->Delete();
return undoSet;
}
//end vistrails
//-----------------------------------------------------------------------------
void pqUndoStack::beginUndoSet(QString label)
{
if (this->Implementation->UndoStackBuilder->GetConnectionID()
== vtkProcessModuleConnectionManager::GetNullConnectionID())
{
return;
}
if(this->Implementation->NestedCount == 0)
{
this->Implementation->UndoStackBuilder->Begin(label.toAscii().data());
......@@ -232,11 +181,6 @@ void pqUndoStack::beginUndoSet(QString label)
//-----------------------------------------------------------------------------
void pqUndoStack::endUndoSet()
{
if (this->Implementation->UndoStackBuilder->GetConnectionID()
== vtkProcessModuleConnectionManager::GetNullConnectionID())
{
return;
}
if(this->Implementation->NestedCount == 0)
{
qDebug() << "endUndoSet called without a beginUndoSet.";
......@@ -255,7 +199,6 @@ void pqUndoStack::undo()
{
this->beginNonUndoableChanges();
this->Implementation->UndoStack->Undo();
this->endNonUndoableChanges();
// Update of proxies have to happen in order.
vtkSMProxyManager::GetProxyManager()->UpdateRegisteredProxies("sources", 1);
......@@ -263,28 +206,19 @@ void pqUndoStack::undo()
vtkSMProxyManager::GetProxyManager()->UpdateRegisteredProxies("representations", 1);
vtkSMProxyManager::GetProxyManager()->UpdateRegisteredProxies("scalar_bars", 1);
vtkSMProxyManager::GetProxyManager()->UpdateRegisteredProxies(1);
pqApplicationCore::instance()->render();
emit this->undone();
}
this->endNonUndoableChanges(); // FIXME used to be just after the undo
// vistrails begin
void pqUndoStack::Push(const char *label, vtkUndoSet *set) {
this->beginNonUndoableChanges();
this->Implementation->UndoStack->Push(
this->Implementation->UndoStackBuilder->GetConnectionID(), label, set);
this->endNonUndoableChanges();
}
// vistrails end
pqApplicationCore::instance()->render();
emit this->undone();
}
//-----------------------------------------------------------------------------
void pqUndoStack::redo()
{
this->beginNonUndoableChanges();
this->Implementation->UndoStack->Redo();
this->endNonUndoableChanges();
// Update of proxies have to happen in order.
vtkSMProxyManager::GetProxyManager()->UpdateRegisteredProxies("sources", 1);
......@@ -292,7 +226,11 @@ void pqUndoStack::redo()
vtkSMProxyManager::GetProxyManager()->UpdateRegisteredProxies("representations", 1);
vtkSMProxyManager::GetProxyManager()->UpdateRegisteredProxies("scalar_bars", 1);
vtkSMProxyManager::GetProxyManager()->UpdateRegisteredProxies(1);
this->endNonUndoableChanges(); // FIXME used to be just after the redo
pqApplicationCore::instance()->render();
emit this->redone();
}
......@@ -334,14 +272,10 @@ void pqUndoStack::setActiveServer(pqServer* server)
{
if (server)
{
this->Implementation->UndoStackBuilder->SetConnectionID(
server->GetConnectionID());
this->endNonUndoableChanges();
}
else
{
this->Implementation->UndoStackBuilder->SetConnectionID(
vtkProcessModuleConnectionManager::GetNullConnectionID());
this->beginNonUndoableChanges();
}
}
......
......@@ -148,68 +148,56 @@ private:
inline void BEGIN_UNDO_SET(const QString& name)
{
#ifdef FIXME_COLLABORATION
pqUndoStack* usStack = pqApplicationCore::instance()->getUndoStack();
if (usStack)
{
usStack->beginUndoSet(name);
}
#endif
}
inline void END_UNDO_SET()
{
#ifdef FIXME_COLLABORATION
pqUndoStack* usStack = pqApplicationCore::instance()->getUndoStack();
if (usStack)
{
usStack->endUndoSet();
}
#endif
}
inline void CLEAR_UNDO_STACK()
{
#ifdef FIXME_COLLABORATION
pqUndoStack* usStack = pqApplicationCore::instance()->getUndoStack();
if (usStack)
{
usStack->clear();
}
#endif
}
inline void ADD_UNDO_ELEM(vtkUndoElement* elem)
{
#ifdef FIXME_COLLABORATION
pqUndoStack* usStack = pqApplicationCore::instance()->getUndoStack();
if (usStack)
{
usStack->addToActiveUndoSet(elem);
}
#endif
}
inline void BEGIN_UNDO_EXCLUDE()
{
#ifdef FIXME_COLLABORATION
pqUndoStack* usStack = pqApplicationCore::instance()->getUndoStack();
if (usStack)
{
usStack->beginNonUndoableChanges();
}
#endif
}
inline void END_UNDO_EXCLUDE()
{
#ifdef FIXME_COLLABORATION
pqUndoStack* usStack = pqApplicationCore::instance()->getUndoStack();
if (usStack)
{
usStack->endNonUndoableChanges();
}
#endif
}
#endif
......@@ -243,23 +243,44 @@ struct vtkSMProxyManagerInternals
{
// Fill equivalent temporary data structure
vtkstd::set<vtkSMProxyManagerEntry> newStateContent;
vtkstd::vector<vtkTypeUInt32> proxyToReset;
int max = newState->ExtensionSize(ProxyManagerState::registered_proxy);
for(int cc=0; cc < max; cc++)
{
ProxyManagerState_ProxyRegistrationInfo reg =
newState->GetExtension(ProxyManagerState::registered_proxy, cc);
vtkSMProxy *proxy =
vtkSMProxy::SafeDownCast(this->ProxyManager->GetSession()->GetRemoteObject(reg.global_id()));
if(proxy)
vtkSMProxy::SafeDownCast(
this->ProxyManager->GetSession()->GetRemoteObject(reg.global_id()));
if(!proxy)
{
newStateContent.insert(vtkSMProxyManagerEntry(reg.group().c_str(), reg.name().c_str(), proxy));
proxyToReset.push_back(reg.global_id());
vtkSMProxy *proxy =
vtkSMProxy::SafeDownCast(
this->ProxyManager->GetSession()->ReNewRemoteObject(reg.global_id(),false));
if(proxy)