Commit 83ace51f authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

Bringing back setting up of extract selection in vtkSMSourceProxy.

Also uncommented code in Qt that was using the extract selection.
parent e95d3a94
......@@ -117,7 +117,6 @@ pqQueryDialog::pqQueryDialog(
// Setup the spreadsheet view.
this->Internals->spreadsheet->setModel(NULL);
#ifdef FIXME_COLLABORATION
// Link the selection color to the global selection color so that it will
// affect all views, otherwise user may be get confused ;).
vtkSMGlobalPropertiesManager* globalPropertiesManager =
......@@ -131,7 +130,6 @@ pqQueryDialog::pqQueryDialog(
"color", SIGNAL(colorChanged(const QVariant&)),
globalPropertiesManager,
globalPropertiesManager->GetProperty("SelectionColor"));
#endif
this->Internals->LabelColorAdaptor = new pqSignalAdaptorColor(
this->Internals->labelColor,
......
......@@ -749,7 +749,6 @@ void pqSelectionInspectorPanel::updateDisplayStyleGUI()
"value", SIGNAL(valueChanged(double)),
reprProxy, reprProxy->GetProperty("SelectionOpacity"));
#ifdef FIXME_COLLABORATION
// setup for choosing color
// Note: we are linking to the global property for selection color here, so
// that all selection colors are affected instead of simply the current
......@@ -760,7 +759,7 @@ void pqSelectionInspectorPanel::updateDisplayStyleGUI()
this->Implementation->SelectionColorAdaptor,
"color", SIGNAL(colorChanged(const QVariant&)),
gpm, gpm->GetProperty("SelectionColor"));
#endif
// We also need to save the color change in the settings so that it's
// preserved across sessions.
QObject::connect(
......@@ -1504,7 +1503,6 @@ void pqSelectionInspectorPanel::createNewSelectionSourceIfNeeded()
if (strcmp(curSelSource->GetXMLName(), "FrustumSelectionSource") == 0 ||
strcmp(curSelSource->GetXMLName(), "ThresholdSelectionSource") == 0)
{
#ifdef FIXME_COLLABORATION
// We need to determine how many ids are present approximately.
vtkSMSourceProxy* sourceProxy =
vtkSMSourceProxy::SafeDownCast(port->getSource()->getProxy());
......@@ -1527,7 +1525,6 @@ void pqSelectionInspectorPanel::createNewSelectionSourceIfNeeded()
curSelSource = 0;
}
}
#endif
}
}
......
......@@ -77,27 +77,23 @@ public:
void clearSelection()
{
#ifdef FIXME_COLLABORATION
if (this->SelectedPort)
{
vtkSMSourceProxy* src = vtkSMSourceProxy::SafeDownCast(
this->SelectedPort->getSource()->getProxy());
src->CleanSelectionInputs(this->SelectedPort->getPortNumber());
}
#endif
this->SelectedPort = 0;
}
vtkSMProxy* getSelectionSourceProxy()
{
#ifdef FIXME_COLLABORATION
if (this->SelectedPort)
{
vtkSMSourceProxy* src = vtkSMSourceProxy::SafeDownCast(
this->SelectedPort->getSource()->getProxy());
return src->GetSelectionInput(this->SelectedPort->getPortNumber());
}
#endif
return 0;
}
......
......@@ -844,7 +844,6 @@ void pqSignalAdaptorCompositeTreeWidget::updateSelectionCounts()
// Iterate over the selection data information and then update the labels.
vtkSMSourceProxy* sourceProxy = this->Internal->Domain->GetSource();
#ifdef FIXME_COLLABORATION
if (!sourceProxy ||
!sourceProxy->GetSelectionOutput(this->Internal->Domain->GetSourcePort()))
{
......@@ -878,7 +877,6 @@ void pqSignalAdaptorCompositeTreeWidget::updateSelectionCounts()
item->setToolTip(0, item->text(0));
}
}
#endif
}
//-----------------------------------------------------------------------------
......@@ -890,7 +888,6 @@ void pqSignalAdaptorCompositeTreeWidget::setupSelectionUpdatedCallback(
this->Internal->VTKConnectSelection->Disconnect();
if (source)
{
#ifdef FIXME_COLLABORATION
vtkSMSourceProxy* selProxy = source->GetSelectionOutput(port);
if (selProxy)
{
......@@ -898,6 +895,5 @@ void pqSignalAdaptorCompositeTreeWidget::setupSelectionUpdatedCallback(
selProxy, vtkCommand::UpdateDataEvent,
this, SLOT(updateSelectionCounts()), 0, 0, Qt::QueuedConnection);
}
#endif
}
}
......@@ -456,10 +456,8 @@ void pqContextView::selectionChanged()
selectionSource->UpdateVTKObjects();
// Set the selection on the representation's source
#ifdef FIXME_COLLABORATION
repSource->CleanSelectionInputs(opPort->getPortNumber());
repSource->SetSelectionInput(opPort->getPortNumber(), selectionSource, 0);
#endif
selectionSource->Delete();
emit this->selected(opPort);
......
......@@ -147,11 +147,9 @@ QString pqOutputPort::getPortName() const
/// Called to set the selection input.
void pqOutputPort::setSelectionInput(vtkSMSourceProxy* selSrc, int port)
{
#ifdef FIXME_COLLABORATION
vtkSMSourceProxy* src = vtkSMSourceProxy::SafeDownCast(
this->getSource()->getProxy());
src->SetSelectionInput(this->getPortNumber(), selSrc, port);
#endif
}
//-----------------------------------------------------------------------------
......@@ -159,13 +157,9 @@ void pqOutputPort::setSelectionInput(vtkSMSourceProxy* selSrc, int port)
/// proxy.
vtkSMSourceProxy* pqOutputPort::getSelectionInput()
{
#ifdef FIXME_COLLABORATION
vtkSMSourceProxy* src = vtkSMSourceProxy::SafeDownCast(
this->getSource()->getProxy());
return src->GetSelectionInput(this->getPortNumber());
#else
return NULL;
#endif
}
//-----------------------------------------------------------------------------
......@@ -173,13 +167,9 @@ vtkSMSourceProxy* pqOutputPort::getSelectionInput()
/// proxy.
unsigned int pqOutputPort::getSelectionInputPort()
{
#ifdef FIXME_COLLABORATION
vtkSMSourceProxy* src = vtkSMSourceProxy::SafeDownCast(
this->getSource()->getProxy());
return src->GetSelectionInputPort(this->getPortNumber());
#else
return 0;
#endif
}
......
......@@ -225,14 +225,12 @@ void pqSpreadSheetView::onCreateSelection(vtkSMSourceProxy* selSource)
pqOutputPort* opport = repr->getOutputPortFromInput();
vtkSMSourceProxy* input = vtkSMSourceProxy::SafeDownCast(
opport->getSource()->getProxy());
#ifdef FIXME_COLLABORATION
input->CleanSelectionInputs(opport->getPortNumber());
if (selSource)
{
input->SetSelectionInput(
opport->getPortNumber(), selSource, 0);
}
#endif
emit this->selected(opport);
}
else
......
......@@ -578,7 +578,6 @@ bool pqSpreadSheetViewModel::isDataValid( const QModelIndex &idx) const
//-----------------------------------------------------------------------------
void pqSpreadSheetViewModel::resetCompositeDataSetIndex()
{
#ifdef FIXME_COLLABORATION
if (!this->activeRepresentation())
{
return;
......@@ -630,7 +629,6 @@ void pqSpreadSheetViewModel::resetCompositeDataSetIndex()
vtkSMPropertyHelper(reprProxy, "CompositeDataSetIndex").Set(cur_index);
reprProxy->UpdateVTKObjects();
#endif
}
//-----------------------------------------------------------------------------
......
......@@ -253,16 +253,26 @@ void vtkPMSourceProxy::Invoke(vtkSMMessage* message)
bool doTime = arguments->variant(2).integer(0) != 0;
this->UpdatePipeline(port_index, time, doTime);
message->Clear();
return;
}
else if (command == "UpdateInformation")
{
this->UpdateInformation();
message->Clear();
return;
}
return this->Superclass::Invoke(message);
else if (command == "SetupSelectionProxy")
{
assert(arguments->variant_size() == 2);
int index = arguments->variant(0).integer(0);
vtkTypeUInt32 guid = static_cast<vtkTypeUInt32>(
arguments->variant(1).integer(0));
this->SetupSelectionProxy(index,
vtkPMProxy::SafeDownCast(this->GetPMObject(guid)));
message->Clear();
}
else
{
return this->Superclass::Invoke(message);
}
}
//----------------------------------------------------------------------------
......@@ -297,6 +307,14 @@ void vtkPMSourceProxy::UpdatePipeline(int port, double time, bool doTime)
sddp->Update(port);
}
//----------------------------------------------------------------------------
void vtkPMSourceProxy::SetupSelectionProxy(int port, vtkPMProxy* extractSelection)
{
vtkAlgorithm* algo = vtkAlgorithm::SafeDownCast(
extractSelection->GetVTKObject());
algo->SetInputConnection(this->GetOutputPort(port));
}
//----------------------------------------------------------------------------
void vtkPMSourceProxy::MarkStartEvent()
{
......
......@@ -89,6 +89,10 @@ protected:
// Triggers UpdateInformation().
virtual void UpdateInformation();
// Description:
// setups extract selection proxies.
virtual void SetupSelectionProxy(int port, vtkPMProxy* extractSelection);
// Description:
// Callbacks to add start/end events to the timer log.
void MarkStartEvent();
......
......@@ -469,10 +469,9 @@ void vtkSMSourceProxy::CreateSelectionProxies()
return;
}
this->CreateOutputPorts();
#ifdef FIXME_COLLABORATION
vtkClientServerStream stream;
vtkSMProxyManager* pxm = vtkSMProxyManager::GetProxyManager();
vtkSMProxyManager* pxm = this->GetProxyManager();
unsigned int numOutputPorts = this->GetNumberOfOutputPorts();
for (unsigned int cc=0; cc < numOutputPorts; cc++)
{
......@@ -481,35 +480,23 @@ void vtkSMSourceProxy::CreateSelectionProxies()
pxm->NewProxy("filters", "PVExtractSelection")));
if (esProxy)
{
esProxy->SetServers(this->Servers);
esProxy->SetConnectionID(this->ConnectionID);
esProxy->SetLocation(this->Location);
// since we don't want the ExtractSelection proxy to further create
// extract selection proxies even by accident :).
esProxy->SelectionProxiesCreated = true;
esProxy->UpdateVTKObjects();
vtkSMOutputPort* port = this->GetOutputPort(cc);
// We don't use input property since that leads to reference loop cycles
// and I don't feel like doing the garbage collection thing right now.
stream << vtkClientServerStream::Invoke
<< port->GetProducerID() /* we use a crooked means of getting at
the ID so that this code works for
vtkSMCompoundSourceProxy*/
<< "GetOutputPort"
<< port->GetPortIndex()
<< vtkClientServerStream::End;
stream << vtkClientServerStream::Invoke
<< esProxy->GetID()
<< "SetInputConnection"
<< vtkClientServerStream::LastResult
<< vtkClientServerStream::End;
vtkSMMessage message;
message << pvstream::InvokeRequest()
<< "SetupSelectionProxy" << static_cast<int>(cc)
<< static_cast<int>(esProxy->GetGlobalID());
this->Invoke(&message);
}
this->PInternals->SelectionProxies.push_back(esProxy);
}
vtkProcessModule::GetProcessModule()->SendStream(
this->ConnectionID, this->Servers, stream);
#endif
this->SelectionProxiesCreated = true;
}
......
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