Commit cb182d0e authored by Cory Quammen's avatar Cory Quammen

Make sure inherited properties have same number of elements as parent

ParaView was checking that inherited properties were the same name and
type, but not that they had the same number of elements. This resulted
in an error message when a TextRepresentation would inherit from a
UnstructuredGridRepresentation, for example. Both representations have
an Orientation property, but they have a different number of elements.
parent 734ec3a1
......@@ -33,6 +33,7 @@
#include "vtkSMTransferFunctionManager.h"
#include "vtkSMTransferFunctionProxy.h"
#include "vtkSMUtilities.h"
#include "vtkSMVectorProperty.h"
#include "vtkSMViewLayoutProxy.h"
#include "vtkSMViewProxy.h"
#include "vtkSmartPointer.h"
......@@ -197,12 +198,16 @@ void vtkInheritRepresentationProperties(vtkSMRepresentationProxy* repr, vtkSMSou
// representation, which is incorrect.
continue;
}
auto destVP = vtkSMVectorProperty::SafeDownCast(dest);
auto sourceVP = vtkSMVectorProperty::SafeDownCast(source);
if (dest && source &&
// the property wasn't modified since initialization or if it is
// "Representation" property -- (HACK)
(dest->GetMTime() < initTimeStamp || strcmp("Representation", pname) == 0) &&
// the property types match.
strcmp(dest->GetClassName(), source->GetClassName()) == 0)
strcmp(dest->GetClassName(), source->GetClassName()) == 0 &&
// ensure vector properties have the same number of elements
!(destVP && sourceVP && destVP->GetNumberOfElements() != sourceVP->GetNumberOfElements()))
{
dest->Copy(source);
}
......
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