How to fix a custom VTK reader?

Hi, I’m a beginner of paraview, and now I’m developing a custom reader.
My paraview version is 3.14, so I followed this example:

After plugin loaded, I found RequestData not called.
I tried these things:
Draw a single point instead of reading file, show nothing;
Call RequestData in RequestInformation, now output has value, bu still show nothing.
Where is my mistake?
Here is part of my code:

class VTK_EXPORT SimworksGridReader : public vtkUnstructuredGridAlgorithm
  static SimworksGridReader *New();
  void PrintSelf(ostream& os, vtkIndent indent);
  // Description:
  // Get the output of this reader.
  vtkUnstructuredGrid *GetOutput();
  vtkUnstructuredGrid *GetOutput(int idx);
  void SetOutput(vtkUnstructuredGrid *output);

  virtual int RequestData(vtkInformation *, vtkInformationVector **,
                          vtkInformationVector *);
  virtual int RequestInformation(vtkInformation* request,
      vtkInformationVector** inputVector,
      vtkInformationVector* outputVector);

  virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **,
                                  vtkInformationVector *);
  virtual int FillOutputPortInformation(int, vtkInformation*);
  SimworksGridReader(const SimworksGridReader&);  // Not implemented.
  void operator=(const SimworksGridReader&);  // Not implemented.
  char* FileName;

int SimworksGridReader::FillOutputPortInformation(int,
    vtkInformation* info)
    info->Set(vtkDataObject::DATA_TYPE_NAME(), "vtkUnstructuredGrid"); 
    info->Set(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(), -1);
    return 1;

int SimworksGridReader::RequestInformation(vtkInformation* request,
    vtkInformationVector** inputVector,
    vtkInformationVector* outputVector)
    vtkInformation* info = outputVector->GetInformationObject(0);
    return 1;

int SimworksGridReader::RequestData(
  vtkInformation *request,
  vtkInformationVector **inputVector,
  vtkInformationVector *outputVector)
  vtkInformation *outInfo = outputVector->GetInformationObject(0);
  int size, ncells=0;
  vtkCellArray *cells=NULL;
  int *types=NULL;
  vtkIdType *idArray;

  vtkUnstructuredGrid *output = vtkUnstructuredGrid::SafeDownCast(

  vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
  cells = vtkCellArray::New();
  ncells = 1;
  size =1;
  idArray = cells->WritePointer(ncells, size);
  idArray[0] = 0;
  types = new int[ncells];
  types[0] = 1;
  output->SetCells(types, cells);
  return 1;

Thanks in advance.

Does the example you linked works for you ?

Thanks! I tried the example exactly, after that I found i was misled by later version. In version 3.14, RequestData is called after user press “Apply” button, while later version will show the grid immediately. Now the problem is solved.