// SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
// SPDX-License-Identifier: BSD-3-Clause
#ifndef vtkPVExtractCellsByType_h
#define vtkPVExtractCellsByType_h

#include "vtkPVVTKExtensionsExtractionModule.h" // For export macro

#include <vtkExtractCellsByType.h>
#include <vtkNew.h> // for vtkNew

class vtkDataArraySelection;

/**
 * vtkPVExtractCellsByType extends vtkExtractCellsByType with a
 * vtkDataArraySelection to control the list of extracted cells types.
 */
class VTKPVVTKEXTENSIONSEXTRACTION_EXPORT vtkPVExtractCellsByType : public vtkExtractCellsByType
{
public:
  static vtkPVExtractCellsByType* New();
  vtkTypeMacro(vtkPVExtractCellsByType, vtkExtractCellsByType);

  /**
   * Get the current selection of cell types for extraction.
   * You can add/remove/enable/disable cell types from this object.
   * See AddCellsType RemoveCellType
   */
  vtkGetNewMacro(CellTypeSelection, vtkDataArraySelection);

protected:
  vtkPVExtractCellsByType();
  ~vtkPVExtractCellsByType() override = default;

private:
  vtkPVExtractCellsByType(const vtkPVExtractCellsByType&) = delete;
  void operator=(const vtkPVExtractCellsByType&) = delete;

  void UpdateFromSelection();

  vtkNew<vtkDataArraySelection> CellTypeSelection;
};

#endif
