diff --git a/Qt/Core/pqPipelineRepresentation.cxx b/Qt/Core/pqPipelineRepresentation.cxx index 3c0819d..07ed590 100644 --- a/Qt/Core/pqPipelineRepresentation.cxx +++ b/Qt/Core/pqPipelineRepresentation.cxx @@ -81,6 +81,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "pqSettings.h" #include "pqSMAdaptor.h" #include "pqUndoStack.h" +#include "vtkPVXMLElement.h" //----------------------------------------------------------------------------- @@ -318,6 +318,34 @@ void pqPipelineRepresentation::setDefaultPropertyValues() vtkPVDataSetAttributesInformation* attrInfo; vtkPVArrayInformation* arrayInfo; + // Get the Representation hints and set it + pqPipelineSource* source = this->getOutputPortFromInput()->getSource(); + vtkPVXMLElement* hints = source->getHints(); + + // flag value is true when representation type is set. + // This avoids setting it once again to a different representation type. + bool representationIsSet = false; + + if (hints) + { + for (unsigned int cc=0; cc < hints->GetNumberOfNestedElements(); cc++) + { + vtkPVXMLElement* child = hints->GetNestedElement(cc); + if (child && child->GetName()) + { + if (strcmp(child->GetName(), "Representation") == 0) + { + if (child->GetAttribute("type")) + { + pqSMAdaptor::setEnumerationProperty(repr->GetProperty("Representation"), + child->GetAttribute("type")); + representationIsSet = true; + } + } + } + } + } + // Get the time that this representation is going to use. vtkPVDataInformation* dataInfo = 0; @@ -325,7 +353,7 @@ void pqPipelineRepresentation::setDefaultPropertyValues() // get data set type // and set the default representation - if (dataInfo && repr->IsA("vtkSMPVRepresentationProxy")) + if (dataInfo && repr->IsA("vtkSMPVRepresentationProxy") && !(representationIsSet)) { int dataSetType = dataInfo->GetDataSetType(); if(dataSetType == VTK_POLY_DATA ||