Commit 2deb755a authored by Berk Geveci's avatar Berk Geveci
Browse files

ENH: Added update for better backwards compatibility in states. Since displays...

ENH: Added update for better backwards compatibility in states. Since displays and render modules were replaced by representations and views, we need some hints to help convert old states to new ones
parent f78f4b57
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "vtkPVGeometryInformation.h" #include "vtkPVGeometryInformation.h"
#include "vtkPVOpenGLExtensionsInformation.h" #include "vtkPVOpenGLExtensionsInformation.h"
#include "vtkPVUpdateSuppressor.h" #include "vtkPVUpdateSuppressor.h"
#include "vtkPVXMLElement.h"
#include "vtkSMDataTypeDomain.h" #include "vtkSMDataTypeDomain.h"
#include "vtkSMDoubleVectorProperty.h" #include "vtkSMDoubleVectorProperty.h"
#include "vtkSMInputProperty.h" #include "vtkSMInputProperty.h"
...@@ -40,7 +41,7 @@ ...@@ -40,7 +41,7 @@
#include "vtkSMStringVectorProperty.h" #include "vtkSMStringVectorProperty.h"
vtkStandardNewMacro(vtkSMDataObjectDisplayProxy); vtkStandardNewMacro(vtkSMDataObjectDisplayProxy);
vtkCxxRevisionMacro(vtkSMDataObjectDisplayProxy, "1.39"); vtkCxxRevisionMacro(vtkSMDataObjectDisplayProxy, "1.39.2.1");
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -1976,6 +1977,35 @@ const char* vtkSMDataObjectDisplayProxy::GetMaterialCM() ...@@ -1976,6 +1977,35 @@ const char* vtkSMDataObjectDisplayProxy::GetMaterialCM()
return svp->GetElement(0); return svp->GetElement(0);
} }
//-----------------------------------------------------------------------------
vtkPVXMLElement* vtkSMDataObjectDisplayProxy::SaveState(vtkPVXMLElement* root)
{
vtkPVXMLElement* proxyElem = this->Superclass::SaveState(root);
if (proxyElem)
{
// Add hint about the volume rendering pipeline so that future revisions can
// convert the state correctly.
vtkPVXMLElement* volumePipelineHint = vtkPVXMLElement::New();
volumePipelineHint->SetName("VolumePipelineType");
switch (this->VolumePipelineType)
{
case UNSTRUCTURED_GRID:
volumePipelineHint->AddAttribute("type", "UNSTRUCTURED_GRID");
break;
case IMAGE_DATA:
volumePipelineHint->AddAttribute("type", "IMAGE_DATA");
break;
default:
volumePipelineHint->AddAttribute("type", "NONE");
}
proxyElem->AddNestedElement(volumePipelineHint);
volumePipelineHint->Delete();
}
return proxyElem;
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void vtkSMDataObjectDisplayProxy::PrintSelf(ostream& os, vtkIndent indent) void vtkSMDataObjectDisplayProxy::PrintSelf(ostream& os, vtkIndent indent)
{ {
......
...@@ -369,6 +369,12 @@ protected: ...@@ -369,6 +369,12 @@ protected:
// Get information about extensions from the view module. // Get information about extensions from the view module.
void UpdateRenderModuleExtensions(vtkSMAbstractViewModuleProxy*); void UpdateRenderModuleExtensions(vtkSMAbstractViewModuleProxy*);
// Description:
// Saves the state of the proxy.
// Overridden to add hint to the state about the volume pipeline so that
// future versions of state loader can convert the state correctly.
virtual vtkPVXMLElement* SaveState(vtkPVXMLElement* root);
// IVars to avoid unnecessary setting of values. // IVars to avoid unnecessary setting of values.
int Visibility; int Visibility;
int Representation; int Representation;
......
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