From: Anthony Geay Date: Tue, 13 Feb 2018 06:31:42 +0000 (+0100) Subject: Make the SimpleMode work with input unstructured grid X-Git-Tag: V8_5_0a1^0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bd660b6ea76001b6ff18e79ede16b691808028e9;p=modules%2Fparavis.git Make the SimpleMode work with input unstructured grid --- diff --git a/src/Plugins/SimpleMode/IO/vtkSimpleMode.cxx b/src/Plugins/SimpleMode/IO/vtkSimpleMode.cxx index 0affd5c1..7942578b 100644 --- a/src/Plugins/SimpleMode/IO/vtkSimpleMode.cxx +++ b/src/Plugins/SimpleMode/IO/vtkSimpleMode.cxx @@ -28,7 +28,7 @@ #include "vtkStreamingDemandDrivenPipeline.h" #include "vtkUnstructuredGrid.h" -#include "vtkPolyData.h" +#include "vtkDataSet.h" #include "vtkMultiBlockDataSet.h" #include "vtkInformationStringKey.h" @@ -298,7 +298,7 @@ void vtkSimpleMode::SetInputArrayToProcess(int idx, int port, int connection, in { if(idx==0) this->Internal->setFieldForReal(name); - vtkPolyDataAlgorithm::SetInputArrayToProcess(idx,port,connection,ff,name); + vtkDataSetAlgorithm::SetInputArrayToProcess(idx,port,connection,ff,name); } double GetOptimalRatioFrom(vtkUnstructuredGrid *dataset, vtkDoubleArray *array) @@ -334,6 +334,12 @@ double GetOptimalRatioFrom(vtkUnstructuredGrid *dataset, vtkDoubleArray *array) return maxGeoDelta/maxDispDelta; } +int vtkSimpleMode::FillOutputPortInformation( int vtkNotUsed(port), vtkInformation* info) +{ + info->Set(vtkDataObject::DATA_TYPE_NAME(), "vtkPolyData"); + return 1; +} + int vtkSimpleMode::RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) { //std::cerr << "########################################## vtkSimpleMode::RequestInformation ##########################################" << std::endl; diff --git a/src/Plugins/SimpleMode/IO/vtkSimpleMode.h b/src/Plugins/SimpleMode/IO/vtkSimpleMode.h index db110c2b..160bb9d0 100644 --- a/src/Plugins/SimpleMode/IO/vtkSimpleMode.h +++ b/src/Plugins/SimpleMode/IO/vtkSimpleMode.h @@ -21,15 +21,15 @@ #ifndef vtkSimpleMode_h__ #define vtkSimpleMode_h__ -#include "vtkPolyDataAlgorithm.h" +#include "vtkDataSetAlgorithm.h" class vtkMutableDirectedGraph; -class VTK_EXPORT vtkSimpleMode : public vtkPolyDataAlgorithm +class VTK_EXPORT vtkSimpleMode : public vtkDataSetAlgorithm { public: static vtkSimpleMode* New(); - vtkTypeMacro(vtkSimpleMode, vtkPolyDataAlgorithm) + vtkTypeMacro(vtkSimpleMode, vtkDataSetAlgorithm) void PrintSelf(ostream& os, vtkIndent indent); void SetInputArrayToProcess(int idx, int port, int connection, int fieldAssociation, const char *name); vtkGetMacro(Factor,double); @@ -39,7 +39,7 @@ public: protected: vtkSimpleMode(); ~vtkSimpleMode(); - + int FillOutputPortInformation( int vtkNotUsed(port), vtkInformation* info); int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector);