Updates will be applied - 3:30pm EDT (UTC -400). No downtime expected.

Commit 6bbe2f44 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

Fixed rendering of selection.

Now making a selection through selection inspector shows up correctly in 3D
views.
parent 83ace51f
......@@ -131,7 +131,7 @@ void vtkPVCompositeRepresentation::RemoveInputConnection(int port, vtkAlgorithmO
bool vtkPVCompositeRepresentation::AddToView(vtkView* view)
{
view->AddRepresentation(this->CubeAxesRepresentation);
//view->AddRepresentation(this->SelectionRepresentation);
view->AddRepresentation(this->SelectionRepresentation);
return this->Superclass::AddToView(view);
}
......@@ -147,7 +147,7 @@ bool vtkPVCompositeRepresentation::RemoveFromView(vtkView* view)
void vtkPVCompositeRepresentation::MarkModified()
{
this->CubeAxesRepresentation->MarkModified();
//this->SelectionRepresentation->MarkModified();
this->SelectionRepresentation->MarkModified();
this->Superclass::MarkModified();
}
......
......@@ -14,31 +14,30 @@
=========================================================================*/
#include "vtkSMPVRepresentationProxy.h"
#include "vtkClientServerStream.h"
#include "vtkCollection.h"
#include "vtkCommand.h"
#include "vtkObjectFactory.h"
#include "vtkProcessModule.h"
#include "vtkPVXMLElement.h"
#include "vtkSmartPointer.h"
#include "vtkSMEnumerationDomain.h"
#include "vtkSMIntVectorProperty.h"
#include "vtkSMProperty.h"
#include "vtkSMPropertyHelper.h"
#include <vtkstd/string>
#include <vtkstd/map>
#include <vtkstd/set>
#include <vtkstd/string>
class vtkSMPVRepresentationProxy::vtkStringSet :
public vtkstd::set<vtkstd::string> {};
vtkStandardNewMacro(vtkSMPVRepresentationProxy);
//----------------------------------------------------------------------------
vtkSMPVRepresentationProxy::vtkSMPVRepresentationProxy()
{
this->SetKernelClassName("vtkPMPVRepresentationProxy");
this->RepresentationSubProxies = new vtkStringSet();
}
//----------------------------------------------------------------------------
vtkSMPVRepresentationProxy::~vtkSMPVRepresentationProxy()
{
delete this->RepresentationSubProxies;
}
//----------------------------------------------------------------------------
......@@ -77,6 +76,75 @@ void vtkSMPVRepresentationProxy::OnPropertyUpdated(vtkObject*,
}
}
//----------------------------------------------------------------------------
void vtkSMPVRepresentationProxy::SetPropertyModifiedFlag(const char* name, int flag)
{
vtkSMProxy* selectionRepr = this->GetSubProxy("SelectionRepresentation");
if (name && strcmp(name, "Input") == 0)
{
vtkSMPropertyHelper helper(this, name);
for (unsigned int cc=0; cc < helper.GetNumberOfElements(); cc++)
{
vtkSMSourceProxy* input = vtkSMSourceProxy::SafeDownCast(
helper.GetAsProxy(cc));
if (input && selectionRepr)
{
input->CreateSelectionProxies();
vtkSMSourceProxy* esProxy = input->GetSelectionOutput(
helper.GetOutputPort(cc));
if (!esProxy)
{
vtkErrorMacro("Input proxy does not support selection extraction.");
}
else
{
vtkSMPropertyHelper(selectionRepr, "Input").Set(esProxy);
selectionRepr->UpdateVTKObjects();
}
}
}
// Next we ensure that input is set on all input properties for the
// subproxies. This ensures that domains and such on subproxies can still
// function correctly.
// This piece of code is a disgrace :). We shouldn't have to do these kinds of
// hacks. It implies that something's awry with the way domains and
// updated/defined for sub-proxies.
for (vtkStringSet::iterator iter = this->RepresentationSubProxies->begin();
iter != this->RepresentationSubProxies->end(); ++iter)
{
vtkSMProxy* subProxy = this->GetSubProxy((*iter).c_str());
if (subProxy && subProxy->GetProperty("Input"))
{
subProxy->GetProperty("Input")->Copy(this->GetProperty("Input"));
subProxy->UpdateProperty("Input");
subProxy->GetProperty("Input")->UpdateDependentDomains();
}
}
}
this->Superclass::SetPropertyModifiedFlag(name, flag);
}
//----------------------------------------------------------------------------
int vtkSMPVRepresentationProxy::ReadXMLAttributes(
vtkSMProxyManager* pm, vtkPVXMLElement* element)
{
for (unsigned int cc=0; cc < element->GetNumberOfNestedElements(); ++cc)
{
if (element->GetName() &&
strcmp(element->GetName(), "RepresentationType") == 0 &&
element->GetAttribute("subproxy") != NULL)
{
this->RepresentationSubProxies->insert(
element->GetAttribute("subproxy"));
}
}
return this->Superclass::ReadXMLAttributes(pm, element);
}
//----------------------------------------------------------------------------
void vtkSMPVRepresentationProxy::PrintSelf(ostream& os, vtkIndent indent)
{
......
......@@ -47,10 +47,22 @@ protected:
// this->InvalidateDataInformation() is called.
void OnPropertyUpdated(vtkObject*, unsigned long, void* calldata);
// 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);
// Description:
// Overridden to process "RepresentationType" elements.
int ReadXMLAttributes(vtkSMProxyManager* pm, vtkPVXMLElement* element);
private:
vtkSMPVRepresentationProxy(const vtkSMPVRepresentationProxy&); // Not implemented
void operator=(const vtkSMPVRepresentationProxy&); // Not implemented
class vtkStringSet;
vtkStringSet* RepresentationSubProxies;
//ETX
};
......
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