Commit c0026816 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

BUG: Since addition of new UpdateVTKObjects(vtkClientServerStream&) overrload,

subclasss needed to override that as well to ensure that changes are pushed
correctly.
parent 7b2c509e
......@@ -23,8 +23,7 @@
//----------------------------------------------------------------------------
vtkStandardNewMacro(vtkSMBoxProxy);
vtkCxxRevisionMacro(vtkSMBoxProxy, "1.3");
vtkCxxRevisionMacro(vtkSMBoxProxy, "1.4");
//----------------------------------------------------------------------------
vtkSMBoxProxy::vtkSMBoxProxy()
......@@ -34,7 +33,6 @@ vtkSMBoxProxy::vtkSMBoxProxy()
this->Scale[0] = this->Scale[1] = this->Scale[2] = 1.0;
}
//----------------------------------------------------------------------------
vtkSMBoxProxy::~vtkSMBoxProxy()
{
......@@ -42,26 +40,21 @@ vtkSMBoxProxy::~vtkSMBoxProxy()
}
//----------------------------------------------------------------------------
void vtkSMBoxProxy::UpdateVTKObjects()
void vtkSMBoxProxy::UpdateVTKObjects(vtkClientServerStream& stream)
{
this->Superclass::UpdateVTKObjects();
this->Superclass::UpdateVTKObjects(stream);
vtkMatrix4x4* mat = vtkMatrix4x4::New();
this->GetMatrix(mat);
vtkClientServerStream str;
str << vtkClientServerStream::Invoke
<< this->GetID()
<< "SetTransform"
<< vtkClientServerStream::InsertArray(
&(mat->Element[0][0]),16)
<< vtkClientServerStream::End;
vtkProcessModule* pm = vtkProcessModule::GetProcessModule();
pm->SendStream(this->ConnectionID, this->Servers, str, 0);
stream << vtkClientServerStream::Invoke
<< this->GetID()
<< "SetTransform"
<< vtkClientServerStream::InsertArray(&(mat->Element[0][0]),16)
<< vtkClientServerStream::End;
mat->Delete();
}
//----------------------------------------------------------------------------
void vtkSMBoxProxy::GetMatrix(vtkMatrix4x4* mat)
{
......
......@@ -47,9 +47,8 @@ public:
// Description:
// Push values on to the VTK objects.
// This computes the transform matrix from the Position/Scale/Rotation
// values and sets that on to the vtkBox
virtual void UpdateVTKObjects();
virtual void UpdateVTKObjects()
{ return this->Superclass::UpdateVTKObjects(); }
protected:
vtkSMBoxProxy();
......@@ -59,6 +58,12 @@ protected:
double Rotation[3];
double Scale[3];
// Description:
// Push values on to the VTK objects.
// This computes the transform matrix from the Position/Scale/Rotation
// values and sets that on to the vtkBox
virtual void UpdateVTKObjects(vtkClientServerStream& stream);
// Description:
// Computes the transform matrix from Position/Rotation/Scale
void GetMatrix(vtkMatrix4x4 *mat);
......
......@@ -21,7 +21,7 @@
#include "vtkTransform.h"
vtkStandardNewMacro(vtkSMBoxRepresentationProxy);
vtkCxxRevisionMacro(vtkSMBoxRepresentationProxy, "1.1");
vtkCxxRevisionMacro(vtkSMBoxRepresentationProxy, "1.2");
//----------------------------------------------------------------------------
vtkSMBoxRepresentationProxy::vtkSMBoxRepresentationProxy()
{
......@@ -55,7 +55,7 @@ void vtkSMBoxRepresentationProxy::CreateVTKObjects()
}
//----------------------------------------------------------------------------
void vtkSMBoxRepresentationProxy::UpdateVTKObjects()
void vtkSMBoxRepresentationProxy::UpdateVTKObjects(vtkClientServerStream& stream)
{
if (this->InUpdateVTKObjects)
{
......@@ -64,18 +64,15 @@ void vtkSMBoxRepresentationProxy::UpdateVTKObjects()
int something_changed = this->ArePropertiesModified();
this->Superclass::UpdateVTKObjects();
this->Superclass::UpdateVTKObjects(stream);
if (something_changed)
{
vtkClientServerStream stream;
stream << vtkClientServerStream::Invoke
<< this->GetID()
<< "SetTransform"
<< this->GetSubProxy("Transform")->GetID()
<< vtkClientServerStream::End;
vtkProcessModule::GetProcessModule()->SendStream(
this->GetConnectionID(), this->GetServers(), stream);
}
}
......
......@@ -29,7 +29,8 @@ public:
vtkTypeRevisionMacro(vtkSMBoxRepresentationProxy, vtkSMWidgetRepresentationProxy);
void PrintSelf(ostream& os, vtkIndent indent);
virtual void UpdateVTKObjects();
virtual void UpdateVTKObjects()
{this->Superclass::UpdateVTKObjects();}
virtual void UpdatePropertyInformation();
virtual void UpdatePropertyInformation(vtkSMProperty* prop)
{ this->Superclass::UpdatePropertyInformation(prop); }
......@@ -41,6 +42,7 @@ protected:
// This method is overridden to set the transform on the vtkWidgetRepresentation.
virtual void CreateVTKObjects();
virtual void UpdateVTKObjects(vtkClientServerStream&);
private:
vtkSMBoxRepresentationProxy(const vtkSMBoxRepresentationProxy&); // Not implemented
......
......@@ -46,7 +46,7 @@ public:
vtkStandardNewMacro(vtkSMCompoundSourceProxy);
vtkCxxRevisionMacro(vtkSMCompoundSourceProxy, "1.3");
vtkCxxRevisionMacro(vtkSMCompoundSourceProxy, "1.4");
//----------------------------------------------------------------------------
vtkSMCompoundSourceProxy::vtkSMCompoundSourceProxy()
{
......@@ -173,7 +173,7 @@ void vtkSMCompoundSourceProxy::CreateVTKObjects()
}
//----------------------------------------------------------------------------
void vtkSMCompoundSourceProxy::UpdateVTKObjects()
void vtkSMCompoundSourceProxy::UpdateVTKObjects(vtkClientServerStream& stream)
{
// update subproxies that don't have inputs first.
// This is required for Readers/Sources that need the ExtractPieces filter to
......@@ -190,11 +190,11 @@ void vtkSMCompoundSourceProxy::UpdateVTKObjects()
// GetNumberOfAlgorithmRequiredInputPorts always returns 0.
if (!source || source->GetNumberOfAlgorithmRequiredInputPorts() == 0)
{
it2->second.GetPointer()->UpdateVTKObjects();
it2->second.GetPointer()->UpdateVTKObjects(stream);
}
}
this->Superclass::UpdateVTKObjects();
this->Superclass::UpdateVTKObjects(stream);
}
//----------------------------------------------------------------------------
......
......@@ -113,7 +113,8 @@ public:
// Description:
// Overloaded to ensure that the chain of subproxies is updated in correct
// sequence.
virtual void UpdateVTKObjects();
virtual void UpdateVTKObjects()
{ this->Superclass::UpdateVTKObjects(); }
// Description:
// This method saves state information about the proxy
......@@ -132,6 +133,11 @@ protected:
vtkSMCompoundSourceProxy();
~vtkSMCompoundSourceProxy();
// Description:
// Overloaded to ensure that the chain of subproxies is updated in correct
// sequence.
virtual void UpdateVTKObjects(vtkClientServerStream&);
// Description:
// Given a class name (by setting VTKClassName) and server ids (by
// setting ServerIDs), this methods instantiates the objects on the
......
......@@ -16,12 +16,11 @@
#include "vtkClientServerStream.h"
#include "vtkObjectFactory.h"
#include "vtkProcessModule.h"
#include "vtkSMDoubleVectorProperty.h"
//----------------------------------------------------------------------------
vtkStandardNewMacro(vtkSMImplicitPlaneProxy);
vtkCxxRevisionMacro(vtkSMImplicitPlaneProxy, "1.6");
vtkCxxRevisionMacro(vtkSMImplicitPlaneProxy, "1.7");
//----------------------------------------------------------------------------
vtkSMImplicitPlaneProxy::vtkSMImplicitPlaneProxy()
......@@ -36,9 +35,9 @@ vtkSMImplicitPlaneProxy::~vtkSMImplicitPlaneProxy()
}
//----------------------------------------------------------------------------
void vtkSMImplicitPlaneProxy::UpdateVTKObjects()
void vtkSMImplicitPlaneProxy::UpdateVTKObjects(vtkClientServerStream& stream)
{
this->Superclass::UpdateVTKObjects();
this->Superclass::UpdateVTKObjects(stream);
double origin[3];
......@@ -56,12 +55,10 @@ void vtkSMImplicitPlaneProxy::UpdateVTKObjects()
origin[i] = this->Origin[i] + this->Offset*normal->GetElement(i);
}
vtkClientServerStream str;
str << vtkClientServerStream::Invoke
stream
<< vtkClientServerStream::Invoke
<< this->GetID() << "SetOrigin" << origin[0] << origin[1] << origin[2]
<< vtkClientServerStream::End;
vtkProcessModule* pm = vtkProcessModule::GetProcessModule();
pm->SendStream(this->ConnectionID, this->Servers, str);
}
//----------------------------------------------------------------------------
......
......@@ -43,12 +43,14 @@ public:
// Description:
// Push values to the VTK objects.
virtual void UpdateVTKObjects();
virtual void UpdateVTKObjects()
{ this->Superclass::UpdateVTKObjects(); }
protected:
vtkSMImplicitPlaneProxy();
~vtkSMImplicitPlaneProxy();
virtual void UpdateVTKObjects(vtkClientServerStream& stream);
double Origin[3];
double Offset;
......
......@@ -22,7 +22,7 @@
#include "vtkMath.h"
vtkStandardNewMacro(vtkSMLookupTableProxy);
vtkCxxRevisionMacro(vtkSMLookupTableProxy, "1.17");
vtkCxxRevisionMacro(vtkSMLookupTableProxy, "1.18");
//---------------------------------------------------------------------------
vtkSMLookupTableProxy::vtkSMLookupTableProxy()
......@@ -57,9 +57,9 @@ void vtkSMLookupTableProxy::CreateVTKObjects()
}
//---------------------------------------------------------------------------
void vtkSMLookupTableProxy::UpdateVTKObjects()
void vtkSMLookupTableProxy::UpdateVTKObjects(vtkClientServerStream& stream)
{
this->Superclass::UpdateVTKObjects();
this->Superclass::UpdateVTKObjects(stream);
this->Build();
}
......
......@@ -36,7 +36,8 @@ public:
// Description:
// push properties to VTK object.
// Also call Build(), hence rebuilds the lookup table.
virtual void UpdateVTKObjects();
virtual void UpdateVTKObjects()
{ this->Superclass::UpdateVTKObjects(); }
// Description:
// This map is used for arrays with this name
......@@ -70,6 +71,11 @@ protected:
vtkSMLookupTableProxy();
~vtkSMLookupTableProxy();
// Description:
// push properties to VTK object.
// Also call Build(), hence rebuilds the lookup table.
virtual void UpdateVTKObjects(vtkClientServerStream& stream);
// This method is overridden to change the servers.
virtual void CreateVTKObjects();
......
......@@ -20,7 +20,7 @@
#include <vtksys/SystemTools.hxx>
vtkStandardNewMacro(vtkSMNetworkImageSourceProxy);
vtkCxxRevisionMacro(vtkSMNetworkImageSourceProxy, "1.7");
vtkCxxRevisionMacro(vtkSMNetworkImageSourceProxy, "1.8");
//----------------------------------------------------------------------------
vtkSMNetworkImageSourceProxy::vtkSMNetworkImageSourceProxy()
{
......@@ -62,9 +62,9 @@ void vtkSMNetworkImageSourceProxy::SetSourceProcess(int proc)
}
//----------------------------------------------------------------------------
void vtkSMNetworkImageSourceProxy::UpdateVTKObjects()
void vtkSMNetworkImageSourceProxy::UpdateVTKObjects(vtkClientServerStream& stream)
{
this->Superclass::UpdateVTKObjects();
this->Superclass::UpdateVTKObjects(stream);
if (this->UpdateNeeded && !this->ForceNoUpdates)
{
this->UpdateImage();
......
......@@ -55,7 +55,9 @@ public:
void SetSourceProcessToRenderServerRoot()
{ this->SetSourceProcess(RENDER_SERVER_ROOT); }
virtual void UpdateVTKObjects();
virtual void UpdateVTKObjects()
{ this->Superclass::UpdateVTKObjects(); }
//BTX
protected:
......@@ -64,6 +66,7 @@ protected:
void UpdateImage();
virtual void ReviveVTKObjects();
virtual void UpdateVTKObjects(vtkClientServerStream& stream);
char* FileName;
int SourceProcess;
......
......@@ -18,7 +18,7 @@
#include "vtkProcessModule.h"
vtkStandardNewMacro(vtkSMPVLookupTableProxy);
vtkCxxRevisionMacro(vtkSMPVLookupTableProxy, "1.2");
vtkCxxRevisionMacro(vtkSMPVLookupTableProxy, "1.3");
//-----------------------------------------------------------------------------
vtkSMPVLookupTableProxy::vtkSMPVLookupTableProxy()
{
......@@ -31,9 +31,9 @@ vtkSMPVLookupTableProxy::~vtkSMPVLookupTableProxy()
}
//-----------------------------------------------------------------------------
void vtkSMPVLookupTableProxy::UpdateVTKObjects()
void vtkSMPVLookupTableProxy::UpdateVTKObjects(vtkClientServerStream& stream)
{
this->Superclass::UpdateVTKObjects();
this->Superclass::UpdateVTKObjects(stream);
this->InvokeCommand("Build");
}
......
......@@ -31,12 +31,14 @@ public:
// Description:
// Overriden to call Build() on the vtkPVLookupTable.
virtual void UpdateVTKObjects();
virtual void UpdateVTKObjects()
{ this->Superclass::UpdateVTKObjects(); }
protected:
vtkSMPVLookupTableProxy();
~vtkSMPVLookupTableProxy();
virtual void UpdateVTKObjects(vtkClientServerStream& stream);
private:
vtkSMPVLookupTableProxy(const vtkSMPVLookupTableProxy&); // Not implemented.
void operator=(const vtkSMPVLookupTableProxy&); // Not implemented.
......
......@@ -713,7 +713,7 @@ protected:
// Description:
// Internal UpdateVTKObjects() which collapses all server-side sends into the
// stream.
void UpdateVTKObjects(vtkClientServerStream& stream);
virtual void UpdateVTKObjects(vtkClientServerStream& stream);
// Description:
// Updates state from an XML element. Returns 0 on failure.
......
......@@ -24,7 +24,7 @@
//----------------------------------------------------------------------------
vtkStandardNewMacro(vtkSMTransformProxy);
vtkCxxRevisionMacro(vtkSMTransformProxy, "1.4");
vtkCxxRevisionMacro(vtkSMTransformProxy, "1.5");
//----------------------------------------------------------------------------
......@@ -41,21 +41,18 @@ vtkSMTransformProxy::~vtkSMTransformProxy()
}
//----------------------------------------------------------------------------
void vtkSMTransformProxy::UpdateVTKObjects()
void vtkSMTransformProxy::UpdateVTKObjects(vtkClientServerStream& stream)
{
this->Superclass::UpdateVTKObjects();
this->Superclass::UpdateVTKObjects(stream);
vtkMatrix4x4* mat = vtkMatrix4x4::New();
this->GetMatrix(mat);
vtkClientServerStream str;
str << vtkClientServerStream::Invoke
<< this->GetID() << "SetMatrix"
<< vtkClientServerStream::InsertArray(
&(mat->Element[0][0]),16)
<< vtkClientServerStream::End;
vtkProcessModule* pm = vtkProcessModule::GetProcessModule();
pm->SendStream(this->ConnectionID, this->Servers, str);
stream << vtkClientServerStream::Invoke
<< this->GetID() << "SetMatrix"
<< vtkClientServerStream::InsertArray(&(mat->Element[0][0]),16)
<< vtkClientServerStream::End;
mat->Delete();
}
......
......@@ -48,12 +48,15 @@ public:
// Push values on to the VTK objects.
// This computes the transform matrix from the Position/Scale/Rotation
// values and sets that on to the transform
virtual void UpdateVTKObjects();
virtual void UpdateVTKObjects()
{ this->Superclass::UpdateVTKObjects(); }
protected:
vtkSMTransformProxy();
~vtkSMTransformProxy();
virtual void UpdateVTKObjects(vtkClientServerStream& stream);
double Position[3];
double Rotation[3];
double Scale[3];
......
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