Commit acbb03ea authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

Cleaning up vtkPMProxy to no longer use a vtkClientServerID.

vtkPMProxy was unnecessary assigning a vtkClientServerID to the vtkObject.
Removed that API all together. I was forgetting that vtkClientServerStream can
directly work with a vtkObject*, and hence the vtkClientServerID indirection was
used initially. Got rid of that. Makes the code a bit more readable.
parent 6a8cd641
......@@ -63,8 +63,8 @@ bool vtkPMArraySelectionProperty::Pull(vtkSMMessage* msgToFill)
result->set_type(Variant::STRING);
// Get the ID for the reader.
vtkClientServerID readerID = this->GetVTKObjectID();
if(readerID.ID)
vtkObjectBase *reader = this->GetVTKObject();
if (reader != NULL)
{
vtksys_ios::ostringstream aname;
aname << "GetNumberOf" << this->Command << "Arrays" << ends;
......@@ -72,7 +72,7 @@ bool vtkPMArraySelectionProperty::Pull(vtkSMMessage* msgToFill)
// Get the number of arrays.
vtkClientServerStream stream;
stream << vtkClientServerStream::Invoke
<< readerID
<< reader
<< aname.str().c_str()
<< vtkClientServerStream::End;
......@@ -92,7 +92,7 @@ bool vtkPMArraySelectionProperty::Pull(vtkSMMessage* msgToFill)
// Get the array name.
stream << vtkClientServerStream::Invoke
<< readerID
<< reader
<< naname.str().c_str()
<< i
<< vtkClientServerStream::End;
......@@ -119,7 +119,7 @@ bool vtkPMArraySelectionProperty::Pull(vtkSMMessage* msgToFill)
saname << "Get" << this->Command << "ArrayStatus" << ends;
// Get the array status.
stream << vtkClientServerStream::Invoke
<< readerID
<< reader
<< saname.str().c_str()
<< name.c_str()
<< vtkClientServerStream::End;
......@@ -142,9 +142,7 @@ bool vtkPMArraySelectionProperty::Pull(vtkSMMessage* msgToFill)
}
else
{
vtkErrorMacro("GetArraySettings cannot get an ID from "
<< this->GetVTKObject()->GetClassName()
<< "(" << this->GetVTKObject() << ").");
vtkErrorMacro("GetArraySettings called on NULL vtkObject");
}
return true;
}
......@@ -15,8 +15,7 @@
#include "vtkPMCompoundSourceProxy.h"
#include "vtkAlgorithm.h"
#include "vtkClientServerInterpreter.h"
#include "vtkClientServerStream.h"
#include "vtkAlgorithmOutput.h"
#include "vtkInformation.h"
#include "vtkMultiProcessController.h"
#include "vtkObjectFactory.h"
......@@ -82,7 +81,7 @@ public:
typedef vtkstd::vector<PortInfo> VectorOfPortInfo;
VectorOfPortInfo ExposedPorts;
vtkstd::vector<vtkClientServerID> OutputPortIDs;
vtkstd::vector<vtkSmartPointer<vtkAlgorithmOutput> > OutputPorts;
bool NeedOutputPortCreation;
};
//*****************************************************************************
......@@ -100,19 +99,19 @@ vtkPMCompoundSourceProxy::~vtkPMCompoundSourceProxy()
}
//----------------------------------------------------------------------------
vtkClientServerID vtkPMCompoundSourceProxy::GetOutputPortID(int port)
vtkAlgorithmOutput* vtkPMCompoundSourceProxy::GetOutputPort(int port)
{
if(this->Internals->NeedOutputPortCreation)
{
this->CreateOutputPorts();
}
if (static_cast<int>(this->Internals->OutputPortIDs.size()) > port)
if (static_cast<int>(this->Internals->OutputPorts.size()) > port)
{
return this->Internals->OutputPortIDs[port];
return this->Internals->OutputPorts[port];
}
return vtkClientServerID();
return NULL;
}
//----------------------------------------------------------------------------
......@@ -121,28 +120,23 @@ bool vtkPMCompoundSourceProxy::CreateOutputPorts()
if(this->Internals->NeedOutputPortCreation)
{
int ports = this->Internals->GetNumberOfOutputPorts();
this->Internals->OutputPortIDs.resize(ports, vtkClientServerID(0));
this->Internals->OutputPorts.resize(ports);
vtkClientServerStream stream;
for (int cc=0; cc < ports; cc++)
{
vtkClientServerID portID = this->Interpreter->GetNextAvailableId();
this->Internals->OutputPortIDs[cc] = portID;
vtkPMProxy* algo =
this->GetSubProxyHelper(
this->Internals->ExposedPorts[cc].ProxyName.c_str());
stream << vtkClientServerStream::Invoke
<< algo->GetVTKObject()
<< "GetOutputPort"
<< this->Internals->ExposedPorts[cc].PortIndex
<< vtkClientServerStream::End;
stream << vtkClientServerStream::Assign << portID
<< vtkClientServerStream::LastResult
<< vtkClientServerStream::End;
vtkPMSourceProxy* subProxy = vtkPMSourceProxy::SafeDownCast(
this->GetSubProxyHelper(
this->Internals->ExposedPorts[cc].ProxyName.c_str()));
if (!subProxy)
{
vtkErrorMacro("Failed to locate subproxy: " <<
this->Internals->ExposedPorts[cc].ProxyName.c_str());
return false;
}
this->Internals->OutputPorts[cc] = subProxy->GetOutputPort(
this->Internals->ExposedPorts[cc].PortIndex);
}
this->Interpreter->ProcessStream(stream);
this->Internals->NeedOutputPortCreation = false;
}
......
......@@ -33,8 +33,8 @@ public:
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Returns the vtkClientServerID for an output port, if valid.
virtual vtkClientServerID GetOutputPortID(int port);
// Returns the vtkAlgorithmOutput for an output port, if valid.
virtual vtkAlgorithmOutput* GetOutputPort(int port);
//BTX
protected:
......
......@@ -57,7 +57,7 @@ bool vtkPMDataArrayProperty::Pull(vtkSMMessage* msgToFill)
// Invoke property's method on the root node of the server
vtkClientServerStream str;
str << vtkClientServerStream::Invoke
<< this->GetVTKObjectID() << this->GetCommand()
<< this->GetVTKObject() << this->GetCommand()
<< vtkClientServerStream::End;
this->ProcessMessage(str);
......
......@@ -60,12 +60,12 @@ bool vtkPMFileSeriesReaderProxy::CreateVTKObjects(vtkSMMessage* message)
vtkClientServerStream stream;
stream << vtkClientServerStream::Invoke
<< this->GetVTKObjectID() << "SetReader" << reader
<< this->GetVTKObject() << "SetReader" << reader
<< vtkClientServerStream::End;
if (this->GetFileNameMethod())
{
stream << vtkClientServerStream::Invoke
<< this->GetVTKObjectID()
<< this->GetVTKObject()
<< "SetFileNameMethod"
<< this->GetFileNameMethod()
<< vtkClientServerStream::End;
......
......@@ -14,6 +14,7 @@
=========================================================================*/
#include "vtkPMInputProperty.h"
#include "vtkAlgorithmOutput.h"
#include "vtkClientServerStream.h"
#include "vtkObjectFactory.h"
#include "vtkPMSourceProxy.h"
......@@ -81,11 +82,11 @@ bool vtkPMInputProperty::Push(vtkSMMessage* message, int offset)
}
vtkClientServerStream stream;
vtkClientServerID objectId = this->GetVTKObjectID();
vtkObjectBase* object = this->GetVTKObject();
if (this->CleanCommand)
{
stream << vtkClientServerStream::Invoke
<< objectId
<< object
<< this->CleanCommand
<< vtkClientServerStream::End;
}
......@@ -94,24 +95,28 @@ bool vtkPMInputProperty::Push(vtkSMMessage* message, int offset)
{
vtkPMSourceProxy* pmproxy = vtkPMSourceProxy::SafeDownCast(
this->GetPMObject(proxy_ids[cc]));
stream << vtkClientServerStream::Invoke
<< objectId
<< this->GetCommand();
stream << vtkClientServerStream::Invoke << object << this->GetCommand();
if (this->PortIndex > 0)
{
stream << this->PortIndex;
}
stream
<< (pmproxy? pmproxy->GetOutputPortID(output_ports[cc]) : vtkClientServerID(0))
<< vtkClientServerStream::End;
if (pmproxy)
{
stream << pmproxy->GetOutputPort(output_ports[cc]);
}
else
{
stream << static_cast<vtkObjectBase*>(NULL);
}
stream << vtkClientServerStream::End;
}
if (this->NullOnEmpty && this->CleanCommand == NULL && proxy_ids.size() == 0)
{
stream << vtkClientServerStream::Invoke
<< objectId
<< object
<< this->GetCommand()
<< vtkClientServerID(0)
<< static_cast<vtkObjectBase*>(NULL)
<< vtkClientServerStream::End;
}
......
......@@ -137,7 +137,7 @@ void vtkPMPVRepresentationProxy::OnVTKObjectModified()
{
vtkClientServerStream stream;
stream << vtkClientServerStream::Invoke
<< iter->second.SubProxy->GetVTKObjectID()
<< iter->second.SubProxy->GetVTKObject()
<< "SetRepresentation"
<< iter->second.SubText.c_str()
<< vtkClientServerStream::End;
......
......@@ -93,17 +93,6 @@ bool vtkPMProperty::ReadXMLAttributes(
return true;
}
//----------------------------------------------------------------------------
vtkClientServerID vtkPMProperty::GetVTKObjectID()
{
if (this->ProxyHelper)
{
return this->ProxyHelper->GetVTKObjectID();
}
return vtkClientServerID(0);
}
//----------------------------------------------------------------------------
vtkPMObject* vtkPMProperty::GetPMObject(vtkTypeUInt32 globalid)
{
......@@ -129,8 +118,7 @@ vtkObjectBase* vtkPMProperty::GetVTKObject()
{
if (this->ProxyHelper)
{
return this->ProxyHelper->GetInterpreter()->GetObjectFromID(
this->ProxyHelper->GetVTKObjectID());
return this->ProxyHelper->GetVTKObject();
}
return NULL;
}
......@@ -158,15 +146,14 @@ void vtkPMProperty::PrintSelf(ostream& os, vtkIndent indent)
bool vtkPMProperty::Push(vtkSMMessage*, int)
{
if ( this->InformationOnly || !this->Command || this->UpdateSelf ||
this->GetVTKObjectID().IsNull() )
this->GetVTKObject() == NULL)
{
return true;
}
vtkClientServerStream stream;
vtkClientServerID objectId = this->GetVTKObjectID();
stream << vtkClientServerStream::Invoke;
stream << objectId << this->Command;
stream << this->GetVTKObject() << this->Command;
stream << vtkClientServerStream::End;
return this->ProcessMessage(stream);
}
......@@ -79,10 +79,6 @@ protected:
friend class vtkPMProxy;
// Description:
// Convenience method to obtain interpreter id for the VTK Object.
vtkClientServerID GetVTKObjectID();
// Description:
// Convenience method to obtain a vtkPMObject subclass given its global id.
vtkPMObject* GetPMObject(vtkTypeUInt32 globalid);
......
......@@ -47,7 +47,6 @@ vtkStandardNewMacro(vtkPMProxy);
vtkPMProxy::vtkPMProxy()
{
this->Internals = new vtkInternals();
this->VTKObjectID = vtkClientServerID(0);
this->VTKObject = NULL;
this->ObjectsCreated = false;
......@@ -104,7 +103,7 @@ void vtkPMProxy::Push(vtkSMMessage* message)
{
vtkClientServerStream stream;
stream << vtkClientServerStream::Invoke
<< this->GetVTKObjectID()
<< this->GetVTKObject()
<< this->PostPush
<< vtkClientServerStream::End;
this->Interpreter->ProcessStream(stream);
......@@ -131,7 +130,7 @@ void vtkPMProxy::Invoke(vtkSMMessage* message)
this->Interpreter->SetGlobalWarningDisplay( disableError ? 0 : 1);
vtkClientServerStream stream;
stream << vtkClientServerStream::Invoke << this->GetVTKObjectID()
stream << vtkClientServerStream::Invoke << this->GetVTKObject()
<< command.c_str();
for (int cc=0; cc < arguments->variant_size(); cc++)
{
......@@ -274,13 +273,7 @@ bool vtkPMProxy::CreateVTKObjects(vtkSMMessage* message)
if (className && className[0])
{
this->SetVTKClassName(className);
this->VTKObjectID = this->Interpreter->GetNextAvailableId();
vtkClientServerStream stream;
stream << vtkClientServerStream::New
<< className << this->VTKObjectID
<< vtkClientServerStream::End;
this->Interpreter->ProcessStream(stream);
this->VTKObject = this->Interpreter->GetObjectFromID(this->VTKObjectID);
this->VTKObject.TakeReference(vtkInstantiator::CreateInstance(className));
}
#ifdef FIXME_COLLABORATION
......@@ -338,7 +331,7 @@ bool vtkPMProxy::CreateVTKObjects(vtkSMMessage* message)
{
vtkClientServerStream stream;
stream << vtkClientServerStream::Invoke
<< this->GetVTKObjectID()
<< this->GetVTKObject()
<< this->PostCreation
<< vtkClientServerStream::End;
this->Interpreter->ProcessStream(stream);
......@@ -350,17 +343,7 @@ bool vtkPMProxy::CreateVTKObjects(vtkSMMessage* message)
//----------------------------------------------------------------------------
void vtkPMProxy::DeleteVTKObjects()
{
if (this->VTKObjectID.IsNull() == false && this->Interpreter)
{
vtkClientServerStream stream;
stream << vtkClientServerStream::Delete
<< this->VTKObjectID
<< vtkClientServerStream::End;
this->Interpreter->ProcessStream(stream);
}
this->VTKObject = NULL;
this->VTKObjectID = vtkClientServerID();
}
//----------------------------------------------------------------------------
......@@ -371,11 +354,7 @@ void vtkPMProxy::OnCreateVTKObjects()
//----------------------------------------------------------------------------
vtkObjectBase* vtkPMProxy::GetVTKObject()
{
if (this->VTKObjectID.IsNull() == false && this->Interpreter)
{
return this->Interpreter->GetObjectFromID(this->VTKObjectID);
}
return NULL;
return this->VTKObject.GetPointer();
}
//----------------------------------------------------------------------------
......
......@@ -22,7 +22,7 @@
#define __vtkPMProxy_h
#include "vtkPMObject.h"
#include "vtkClientServerID.h"
#include "vtkSmartPointer.h" // needed for vtkSmartPointer.
class vtkSMProxyDefinitionManager;
class vtkPVXMLElement;
......@@ -49,12 +49,6 @@ public:
virtual void Invoke(vtkSMMessage* msg);
//ETX
//BTX
// Description:
// Provides access to the id for the VTK object this proxy holds, if any;
// returns vtkClientServerID(0) otherwise.
vtkGetMacro(VTKObjectID, vtkClientServerID);
// Description:
// Returns access to the VTKObject pointer, if any.
// Note this is a raw pointer to the local instance of the VTK object. Any
......@@ -70,6 +64,7 @@ public:
// Returns the VTKClassName.
vtkGetStringMacro(VTKClassName);
//BTX
protected:
vtkPMProxy();
~vtkPMProxy();
......@@ -124,8 +119,7 @@ protected:
char* PostPush;
char* PostCreation;
vtkWeakPointer<vtkObjectBase> VTKObject;
vtkClientServerID VTKObjectID;
vtkSmartPointer<vtkObjectBase> VTKObject;
bool ObjectsCreated;
private:
......
......@@ -192,14 +192,14 @@ bool vtkPMProxyProperty::Push(vtkSMMessage* message, int offset)
vtkstd::vector<vtkTypeUInt32> proxy_ids;
vtkClientServerStream stream;
vtkClientServerID objectId = this->GetVTKObjectID();
vtkObjectBase* object = this->GetVTKObject();
// Deal with previous values to remove
if (this->CleanCommand)
{
this->Cache->CleanCommand();
stream << vtkClientServerStream::Invoke
<< objectId
<< object
<< this->CleanCommand
<< vtkClientServerStream::End;
}
......@@ -215,7 +215,7 @@ bool vtkPMProxyProperty::Push(vtkSMMessage* message, int offset)
if(arg != NULL)
{
stream << vtkClientServerStream::Invoke
<< objectId
<< object
<< this->GetRemoveCommand()
<< arg
<< vtkClientServerStream::End;
......@@ -237,7 +237,7 @@ bool vtkPMProxyProperty::Push(vtkSMMessage* message, int offset)
if(arg != NULL || proxy_ids[cc] == 2)
{
stream << vtkClientServerStream::Invoke
<< objectId
<< object
<< this->GetCommand()
<< arg
<< vtkClientServerStream::End;
......@@ -252,7 +252,7 @@ bool vtkPMProxyProperty::Push(vtkSMMessage* message, int offset)
if (this->NullOnEmpty && this->CleanCommand == NULL && proxy_ids.size() == 0)
{
stream << vtkClientServerStream::Invoke
<< objectId
<< object
<< this->GetCommand()
<< vtkClientServerID(0)
<< vtkClientServerStream::End;
......
......@@ -40,14 +40,14 @@ bool vtkPMScalarBarActorProxy::CreateVTKObjects(vtkSMMessage* message)
// Label Text property
stream << vtkClientServerStream::Invoke
<< this->GetVTKObjectID()
<< this->GetVTKObject()
<< "SetLabelTextProperty"
<< this->GetSubProxyHelper("LabelTextProperty")->GetVTKObject()
<< vtkClientServerStream::End;
// Title text property
stream << vtkClientServerStream::Invoke
<< this->GetVTKObjectID()
<< this->GetVTKObject()
<< "SetTitleTextProperty"
<< this->GetSubProxyHelper("TitleTextProperty")->GetVTKObject()
<< vtkClientServerStream::End;
......
......@@ -47,9 +47,9 @@ bool vtkPMSelectionRepresentationProxy::CreateVTKObjects(vtkSMMessage* message)
vtkClientServerStream stream;
stream << vtkClientServerStream::Invoke
<< this->GetVTKObjectID()
<< this->GetVTKObject()
<< "SetLabelRepresentation"
<< label_repr->GetVTKObjectID()
<< label_repr->GetVTKObject()
<< vtkClientServerStream::End;
this->Interpreter->ProcessStream(stream);
return true;
......
......@@ -15,13 +15,15 @@
#include "vtkPMSourceProxy.h"
#include "vtkAlgorithm.h"
#include "vtkClientServerInterpreter.h"
#include "vtkClientServerStream.h"
#include "vtkAlgorithmOutput.h"
#include "vtkCommand.h"
#include "vtkInformation.h"
#include "vtkInstantiator.h"
#include "vtkMultiProcessController.h"
#include "vtkObjectFactory.h"
#include "vtkPVExtentTranslator.h"
#include "vtkPVExtractPieces.h"
#include "vtkPVPostFilter.h"
#include "vtkPVXMLElement.h"
#include "vtkSMMessage.h"
#include "vtkStreamingDemandDrivenPipeline.h"
......@@ -36,10 +38,11 @@
class vtkPMSourceProxy::vtkInternals
{
public:
vtkstd::vector<vtkClientServerID> OutputPortIDs;
vtkstd::vector<vtkClientServerID> ExtractPiecesIDs;
vtkstd::vector<vtkClientServerID> PostFilterIDs;
vtkstd::vector<vtkSmartPointer<vtkAlgorithmOutput> > OutputPorts;
vtkstd::vector<vtkSmartPointer<vtkPVExtractPieces> > ExtractPieces;
vtkstd::vector<vtkSmartPointer<vtkPVPostFilter> > PostFilters;
};
//*****************************************************************************
vtkStandardNewMacro(vtkPMSourceProxy);
//----------------------------------------------------------------------------
......@@ -47,52 +50,25 @@ vtkPMSourceProxy::vtkPMSourceProxy()
{
this->ExecutiveName = 0;
this->SetExecutiveName("vtkPVCompositeDataPipeline");
this->Internals = new vtkInternals();
}
//----------------------------------------------------------------------------
vtkPMSourceProxy::~vtkPMSourceProxy()
{
if (this->Interpreter)
{
vtkClientServerStream stream;
vtkstd::vector<vtkClientServerID>::iterator iter;
for (iter = this->Internals->ExtractPiecesIDs.begin();
iter != this->Internals->ExtractPiecesIDs.end(); ++iter)
{
if (!iter->IsNull())
{
stream << vtkClientServerStream::Delete << *iter
<< vtkClientServerStream::End;
}
}
for (iter = this->Internals->PostFilterIDs.begin();
iter != this->Internals->PostFilterIDs.end(); ++iter)
{
if (!iter->IsNull())
{
stream << vtkClientServerStream::Delete << *iter
<< vtkClientServerStream::End;
}
}
this->Interpreter->ProcessStream(stream);
}
this->SetExecutiveName(0);
delete this->Internals;
}
//----------------------------------------------------------------------------
vtkClientServerID vtkPMSourceProxy::GetOutputPortID(int port)
vtkAlgorithmOutput* vtkPMSourceProxy::GetOutputPort(int port)
{
if (static_cast<int>(this->Internals->OutputPortIDs.size()) > port)
if (static_cast<int>(this->Internals->OutputPorts.size()) > port)
{
return this->Internals->OutputPortIDs[port];
return this->Internals->OutputPorts[port];
}
return vtkClientServerID();
return NULL;
}
//----------------------------------------------------------------------------
......@@ -108,44 +84,30 @@ bool vtkPMSourceProxy::CreateVTKObjects(vtkSMMessage* message)
return false;
}
vtkClientServerID sourceID = this->GetVTKObjectID();
if (sourceID.IsNull())
vtkAlgorithm* algorithm = vtkAlgorithm::SafeDownCast(this->GetVTKObject());
if (algorithm == NULL)
{
return true;
}
vtkClientServerStream stream;
if (this->ExecutiveName &&
!this->GetVTKObject()->IsA("vtkPVDataRepresentation"))
{
vtkClientServerID execId = this->Interpreter->GetNextAvailableId();
stream << vtkClientServerStream::New
<< this->ExecutiveName
<< execId
<< vtkClientServerStream::End;
stream << vtkClientServerStream::Invoke
<< sourceID
<< "SetExecutive"
<< execId
<< vtkClientServerStream::End;
stream << vtkClientServerStream::Delete
<< execId
<< vtkClientServerStream::End;
vtkExecutive* executive = vtkExecutive::SafeDownCast(
vtkInstantiator::CreateInstance(this->ExecutiveName));
if (executive)
{
algorithm->SetExecutive(executive);
executive->FastDelete();
}
}
// Register observer to record the execution time for each algorithm in the
// local timer-log.
vtkObject::SafeDownCast(this->GetVTKObject())->AddObserver(
algorithm->AddObserver(
vtkCommand::StartEvent, this, &vtkPMSourceProxy::MarkStartEvent);
vtkObject::SafeDownCast(this->GetVTKObject())->AddObserver(
algorithm->AddObserver(
vtkCommand::EndEvent, this, &vtkPMSourceProxy::MarkEndEvent);
if (!this->Interpreter->ProcessStream(stream))
{
return false;
}
return this->CreateOutputPorts();
}
......@@ -159,9 +121,9 @@ bool vtkPMSourceProxy::CreateOutputPorts()
}
int ports = algo->GetNumberOfOutputPorts();
this->Internals->OutputPortIDs.resize(ports, vtkClientServerID(0));
this->Internals->ExtractPiecesIDs.resize(ports, vtkClientServerID(0));
this->Internals->PostFilterIDs.resize(ports, vtkClientServerID(0));
this->Internals->OutputPorts.resize(ports);
this->Internals->ExtractPieces.resize(ports);
this->Internals->PostFilters.resize(ports);
for (int cc=0; cc < ports; cc++)
{
......@@ -176,20 +138,8 @@ bool vtkPMSourceProxy::CreateOutputPorts()
//----------------------------------------------------------------------------
bool vtkPMSourceProxy::InitializeOutputPort(vtkAlgorithm* algo, int port)
{
// Assign an ID to this output port.
vtkClientServerID portID = this->Interpreter->GetNextAvailableId();
this->Internals->OutputPortIDs[port] = portID;
vtkClientServerStream stream;
stream << vtkClientServerStream::Invoke
<< this->GetVTKObjectID()
<< "GetOutputPort" << port
<< vtkClientServerStream::End;
stream << vtkClientServerStream::Assign << portID
<< vtkClientServerStream::LastResult
<< vtkClientServerStream::End;
this->Interpreter->ProcessStream(stream);
// Save the output port in internal data-structure.
this->Internals->OutputPorts[port] = algo->GetOutputPort(port);
this->CreateTranslatorIfNecessary(algo, port);
int num_of_required_inputs = 0;
......@@ -246,65 +196,29 @@ bool vtkPMSourceProxy::CreateTranslatorIfNecessary(vtkAlgorithm* algo, int port)
//----------------------------------------------------------------------------
void vtkPMSourceProxy::InsertExtractPiecesIfNecessary(vtkAlgorithm*, int port)
{
vtkClientServerID portID = this->Internals->OutputPortIDs[port];
vtkClientServerID extractID = this->Interpreter->GetNextAvailableId();
this->Internals->ExtractPiecesIDs[port] = extractID;
vtkClientServerStream stream;
stream << vtkClientServerStream::New
<< "vtkPVExtractPieces" << extractID
<< vtkClientServerStream::End;
stream << vtkClientServerStream::Invoke
<< extractID
<< "SetInputConnection"
<< portID
<< vtkClientServerStream::End;
stream << vtkClientServerStream::Delete
<< portID
<< vtkClientServerStream::End
<< vtkClientServerStream::Invoke
<< extractID
<< "GetOutputPort"
<< 0
<< vtkClientServerStream::End
<< vtkClientServerStream::Assign
<< portID
<< vtkClientServerStream::LastResult
<< vtkClientServerStream::End;
this->Interpreter->ProcessStream(stream);