Commit a93285c3 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

Fixed selection issues with spreadsheet and charts.

There was old code that needed to up upgraded.
parent 821e143a
......@@ -45,26 +45,35 @@ void vtkSMChartRepresentationProxy::PrintSelf(ostream& os, vtkIndent indent)
this->Superclass::PrintSelf(os, indent);
}
#ifdef FIXME
//----------------------------------------------------------------------------
void vtkSMChartRepresentationProxy::AddInput(unsigned int inputPort,
vtkSMSourceProxy* input, unsigned int outputPort, const char* method)
void vtkSMChartRepresentationProxy::SetPropertyModifiedFlag(
const char* name, int flag)
{
this->Superclass::AddInput(inputPort, input, outputPort, method);
input->CreateSelectionProxies();
if (inputPort == 0)
if (name && strcmp(name, "Input") == 0)
{
vtkSMSourceProxy* esProxy = input->GetSelectionOutput(outputPort);
if (!esProxy)
vtkSMPropertyHelper helper(this, name);
for (unsigned int cc=0; cc < helper.GetNumberOfElements(); cc++)
{
vtkErrorMacro("Input proxy does not support selection extraction.");
return;
vtkSMSourceProxy* input = vtkSMSourceProxy::SafeDownCast(
helper.GetAsProxy(cc));
if (input)
{
input->CreateSelectionProxies();
vtkSMSourceProxy* esProxy = input->GetSelectionOutput(
helper.GetOutputPort(cc));
if (!esProxy)
{
vtkErrorMacro("Input proxy does not support selection extraction.");
}
else
{
// We use these internal properties since we need to add consumer dependecy
// on this proxy so that MarkModified() is called correctly.
vtkSMPropertyHelper(this, "InternalInput1").Set(esProxy, 1);
this->UpdateProperty("InternalInput1");
}
}
}
// We use these internal properties since we need to add consumer dependecy
// on this proxy so that MarkModified() is called correctly.
vtkSMPropertyHelper(this, "InternalInput1").Set(esProxy, 1);
this->UpdateProperty("InternalInput1");
}
this->Superclass::SetPropertyModifiedFlag(name, flag);
}
#endif
......@@ -34,23 +34,17 @@ public:
// Returns client side representation object.
vtkChartRepresentation* GetRepresentation();
#ifdef FIXME
// Description:
// vtkChartRepresentation has two input ports one of the data, and
// the other for the extracted selections. The data-input is exposed from the
// proxy, while the extracted selection input is hidden and implicitly defined
// based on the data input. We override this method to handle that.
virtual void AddInput(unsigned int inputPort,
vtkSMSourceProxy* input, unsigned int outputPort, const char* method);
virtual void AddInput(vtkSMSourceProxy* input, const char* method)
{ this->Superclass::AddInput(input, method); }
#endif
//BTX
protected:
vtkSMChartRepresentationProxy();
~vtkSMChartRepresentationProxy();
// Description:
// Overridden to ensure that whenever "Input" property changes, we update the
// "Input" properties for all internal representations (including setting up
// of the link to the extract-selection representation).
virtual void SetPropertyModifiedFlag(const char* name, int flag);
private:
vtkSMChartRepresentationProxy(const vtkSMChartRepresentationProxy&); // Not implemented
void operator=(const vtkSMChartRepresentationProxy&); // Not implemented
......
......@@ -27,32 +27,42 @@ vtkSMSpreadSheetRepresentationProxy::vtkSMSpreadSheetRepresentationProxy()
vtkSMSpreadSheetRepresentationProxy::~vtkSMSpreadSheetRepresentationProxy()
{
}
#ifdef FIXME
//----------------------------------------------------------------------------
void vtkSMSpreadSheetRepresentationProxy::AddInput(unsigned int inputPort,
vtkSMSourceProxy* input, unsigned int outputPort, const char* method)
void vtkSMSpreadSheetRepresentationProxy::SetPropertyModifiedFlag(
const char* name, int flag)
{
this->Superclass::AddInput(inputPort, input, outputPort, method);
input->CreateSelectionProxies();
if (inputPort == 0)
if (name && strcmp(name, "Input") == 0)
{
vtkSMSourceProxy* esProxy = input->GetSelectionOutput(outputPort);
if (!esProxy)
vtkSMPropertyHelper helper(this, name);
for (unsigned int cc=0; cc < helper.GetNumberOfElements(); cc++)
{
vtkErrorMacro("Input proxy does not support selection extraction.");
return;
vtkSMSourceProxy* input = vtkSMSourceProxy::SafeDownCast(
helper.GetAsProxy(cc));
if (input)
{
input->CreateSelectionProxies();
vtkSMSourceProxy* esProxy = input->GetSelectionOutput(
helper.GetOutputPort(cc));
if (!esProxy)
{
vtkErrorMacro("Input proxy does not support selection extraction.");
}
else
{
// We use these internal properties since we need to add consumer dependecy
// on this proxy so that MarkModified() is called correctly.
vtkSMPropertyHelper(this, "InternalInput1").Set(esProxy, 0);
vtkSMPropertyHelper(this, "InternalInput2").Set(esProxy, 1);
this->UpdateProperty("InternalInput1");
this->UpdateProperty("InternalInput2");
}
}
}
// We use these internal properties since we need to add consumer dependecy
// on this proxy so that MarkModified() is called correctly.
vtkSMPropertyHelper(this, "InternalInput1").Set(esProxy, 0);
vtkSMPropertyHelper(this, "InternalInput2").Set(esProxy, 1);
this->UpdateProperty("InternalInput1");
this->UpdateProperty("InternalInput2");
}
this->Superclass::SetPropertyModifiedFlag(name, flag);
}
#endif
//----------------------------------------------------------------------------
void vtkSMSpreadSheetRepresentationProxy::PrintSelf(ostream& os, vtkIndent indent)
......
......@@ -31,23 +31,16 @@ public:
vtkSMRepresentationProxy);
void PrintSelf(ostream& os, vtkIndent indent);
#ifdef FIXME
// Description:
// vtkSpreadSheetRepresentation has three input ports one of the data, and
// the others for the extracted selections. The data-input is exposed from the
// proxy, while the extracted selection input is hidden and implicitly defined
// based on the data input. We override this method to handle that.
virtual void AddInput(unsigned int inputPort,
vtkSMSourceProxy* input, unsigned int outputPort, const char* method);
virtual void AddInput(vtkSMSourceProxy* input, const char* method)
{ this->Superclass::AddInput(input, method); }
#endif
//BTX
protected:
vtkSMSpreadSheetRepresentationProxy();
~vtkSMSpreadSheetRepresentationProxy();
// Description:
// Overridden to ensure that whenever "Input" property changes, we update the
// "Input" properties for all internal representations (including setting up
// of the link to the extract-selection representation).
virtual void SetPropertyModifiedFlag(const char* name, int flag);
private:
vtkSMSpreadSheetRepresentationProxy(const vtkSMSpreadSheetRepresentationProxy&); // 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