vtkExtractTemporalFieldData.h 3.68 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkExtractTemporalFieldData.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.

=========================================================================*/
// .NAME vtkExtractTemporalFieldData - Extract temporal arrays from input field data
// .SECTION Description
17 18 19
// vtkExtractTemporalFieldData extracts arrays from the input vtkFieldData.
// These arrays are assumed to contain temporal data, where the nth tuple
// contains the value for the nth timestep.
20 21 22 23 24 25 26 27 28 29
//
// For composite datasets, the filter has two modes, it can treat each block in
// the dataset individually (default) or just look at the first non-empty field data
// (common for readers vtkExodusIIReader). For latter, set
// HandleCompositeDataBlocksIndividually to false.
//
// The output is a vtkTable (or a multiblock of vtkTables) based of whether
// HandleCompositeDataBlocksIndividually is true and input is a composite
// dataset.
//
30
// This algorithm does not produce a TIME_STEPS or TIME_RANGE information
31
// because it works across time.
32
//
33 34 35 36
// .Section Caveat
// This algorithm works only with source that produce TIME_STEPS().
// Continuous time range is not yet supported.

37 38
#ifndef vtkExtractTemporalFieldData_h
#define vtkExtractTemporalFieldData_h
39

40
#include "vtkFiltersExtractionModule.h" // For export macro
41
#include "vtkDataObjectAlgorithm.h"
42 43

class vtkDataSet;
44
class vtkTable;
45 46
class vtkDataSetAttributes;

47
class VTKFILTERSEXTRACTION_EXPORT vtkExtractTemporalFieldData : public vtkDataObjectAlgorithm
48 49 50
{
public:
  static vtkExtractTemporalFieldData *New();
51
  vtkTypeMacro(vtkExtractTemporalFieldData,vtkDataObjectAlgorithm);
52 53 54 55
  void PrintSelf(ostream& os, vtkIndent indent);

  // Description:
  // Get the number of time steps
56 57 58 59 60 61 62 63 64
  int GetNumberOfTimeSteps();

  // Description:
  // When set to true (default), if the input is a vtkCompositeDataSet, then
  // each block in the input dataset in processed separately. If false, then the first
  // non-empty FieldData is considered.
  vtkSetMacro(HandleCompositeDataBlocksIndividually, bool);
  vtkGetMacro(HandleCompositeDataBlocksIndividually, bool);
  vtkBooleanMacro(HandleCompositeDataBlocksIndividually, bool);
65 66 67 68 69

protected:
  vtkExtractTemporalFieldData();
  ~vtkExtractTemporalFieldData();

70 71 72 73 74 75 76 77 78 79
  int RequestDataObject(vtkInformation*,
                        vtkInformationVector**,
                        vtkInformationVector*) VTK_OVERRIDE;
  int RequestInformation(vtkInformation* request,
                         vtkInformationVector** inputVector,
                         vtkInformationVector* outputVector) VTK_OVERRIDE;
  int RequestData(vtkInformation* request,
                  vtkInformationVector** inputVector,
                  vtkInformationVector* outputVector) VTK_OVERRIDE;
  int FillInputPortInformation(int port, vtkInformation* info) VTK_OVERRIDE;
80 81

  // Description:
82
  // This looks at the arrays in the vtkFieldData of input and copies them
83
  // to the output point data.
84 85
  // Returns true if the input had an "appropriate" field data.
  bool CopyDataToOutput(vtkDataSet *input, vtkTable *output);
86

87
  bool HandleCompositeDataBlocksIndividually;
88
private:
89
  vtkExtractTemporalFieldData(const vtkExtractTemporalFieldData&) VTK_DELETE_FUNCTION;
90
  void operator=(const vtkExtractTemporalFieldData&) VTK_DELETE_FUNCTION;
91 92 93

  class vtkInternals;
  vtkInternals* Internals;
94 95 96
};

#endif