vtkExtractSelection.h 4.18 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkExtractSelection.h

  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
/**
 * @class   vtkExtractSelection
 * @brief   extract a subset from a vtkDataSet.
 *
 * vtkExtractSelection extracts some subset of cells and points from
 * its input dataset. The dataset is given on its first input port.
 * The subset is described by the contents of the vtkSelection on its
 * second input port. Depending on the content of the vtkSelection,
 * this will use either a vtkExtractSelectedIds, vtkExtractSelectedFrustum
 * vtkExtractSelectedLocations or a vtkExtractSelectedThreshold to perform
 * the extraction.
 * @sa
 * vtkSelection vtkExtractSelectedIds vtkExtractSelectedFrustum
 * vtkExtractSelectedLocations vtkExtractSelectedThresholds
*/
30

31 32
#ifndef vtkExtractSelection_h
#define vtkExtractSelection_h
33

34
#include "vtkFiltersExtractionModule.h" // For export macro
35
#include "vtkExtractSelectionBase.h"
36

37
class vtkExtractSelectedBlock;
38
class vtkExtractSelectedFrustum;
39
class vtkExtractSelectedIds;
40
class vtkExtractSelectedLocations;
Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
41
class vtkExtractSelectedRows;
42
class vtkExtractSelectedThresholds;
43
class vtkProbeSelectedLocations;
44
class vtkSelection;
45
class vtkSelectionNode;
46

47
class VTKFILTERSEXTRACTION_EXPORT vtkExtractSelection : public vtkExtractSelectionBase
48 49 50
{
public:
  static vtkExtractSelection *New();
51
  vtkTypeMacro(vtkExtractSelection, vtkExtractSelectionBase);
52
  void PrintSelf(ostream& os, vtkIndent indent) override;
53

54 55 56 57 58
  //@{
  /**
   * When On, this returns an unstructured grid that outlines selection area.
   * Off is the default. Applicable only to Frustum selection extraction.
   */
59 60 61
  vtkSetMacro(ShowBounds,int);
  vtkGetMacro(ShowBounds,int);
  vtkBooleanMacro(ShowBounds,int);
62
  //@}
63

64 65 66 67 68 69
  //@{
  /**
   * When On, vtkProbeSelectedLocations is used for extracting selections of
   * content type vtkSelection::LOCATIONS. Default is off and then
   * vtkExtractSelectedLocations is used.
   */
70 71 72
  vtkSetMacro(UseProbeForLocations, vtkTypeBool);
  vtkGetMacro(UseProbeForLocations, vtkTypeBool);
  vtkBooleanMacro(UseProbeForLocations, vtkTypeBool);
73
  //@}
74

75 76
protected:
  vtkExtractSelection();
77
  ~vtkExtractSelection() override;
78

79
  int FillInputPortInformation(int port, vtkInformation* info) override;
80

81
  //sets up empty output dataset
82
  int RequestDataObject(vtkInformation* request,
83
                                vtkInformationVector** inputVector,
84
                                vtkInformationVector* outputVector) override;
85 86

  // runs the algorithm and fills the output with results
87
  int RequestData(vtkInformation *,
88
                  vtkInformationVector **,
89
                  vtkInformationVector *) override;
90

91
  // used for composite, non-hierarhical input.
92
  vtkDataObject* RequestDataInternal(
93
    unsigned int composite_index,
Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
94
    vtkDataObject* non_composite_input, vtkSelection* sel,
95 96 97
    vtkInformation* outInfo);

  // Used for hierarchical input.
98
  vtkDataObject* RequestDataInternal(
99 100 101
    unsigned int composite_index,
    unsigned int level,
    unsigned int index,
Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
102
    vtkDataObject* non_composite_input, vtkSelection* sel,
103 104 105 106
    vtkInformation* outInfo);


  // called for non-composite input or for a block in a composite dataset.
107
  vtkDataObject* RequestDataFromBlock(vtkDataObject* input,
108
    vtkSelectionNode* sel, vtkInformation* outInfo);
109

110
  vtkExtractSelectedBlock* BlockFilter;
111
  vtkExtractSelectedFrustum* FrustumFilter;
Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
112
  vtkExtractSelectedIds* IdsFilter;
113
  vtkExtractSelectedLocations* LocationsFilter;
Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
114
  vtkExtractSelectedRows* RowsFilter;
115
  vtkExtractSelectedThresholds* ThresholdsFilter;
116
  vtkProbeSelectedLocations* ProbeFilter;
117

118
  vtkTypeBool UseProbeForLocations;
119
  int ShowBounds;
120
private:
121 122
  vtkExtractSelection(const vtkExtractSelection&) = delete;
  void operator=(const vtkExtractSelection&) = delete;
123 124 125
};

#endif