VTK
vtkReconstructFromMoments.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkReconstructFromMoments.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*=========================================================================
16 
17 Copyright (c) 2017, Los Alamos National Security, LLC
18 
19 All rights reserved.
20 
21 Copyright 2017. Los Alamos National Security, LLC.
22 This software was produced under U.S. Government contract DE-AC52-06NA25396
23 for Los Alamos National Laboratory (LANL), which is operated by
24 Los Alamos National Security, LLC for the U.S. Department of Energy.
25 The U.S. Government has rights to use, reproduce, and distribute this software.
26 NEITHER THE GOVERNMENT NOR LOS ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY,
27 EXPRESS OR IMPLIED, OR ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE.
28 If software is modified to produce derivative works, such modified software
29 should be clearly marked, so as not to confuse it with the version available
30 from LANL.
31 
32 Additionally, redistribution and use in source and binary forms, with or
33 without modification, are permitted provided that the following conditions
34 are met:
35 - Redistributions of source code must retain the above copyright notice,
36  this list of conditions and the following disclaimer.
37 - Redistributions in binary form must reproduce the above copyright notice,
38  this list of conditions and the following disclaimer in the documentation
39  and/or other materials provided with the distribution.
40 - Neither the name of Los Alamos National Security, LLC, Los Alamos National
41  Laboratory, LANL, the U.S. Government, nor the names of its contributors
42  may be used to endorse or promote products derived from this software
43  without specific prior written permission.
44 
45 THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND CONTRIBUTORS
46 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
47 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
48 ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL SECURITY, LLC OR
49 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
50 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
51 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
52 OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
53 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
54 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
55 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
56 
57 =========================================================================*/
80 #ifndef vtkReconstructFromMoments_h
81 #define vtkReconstructFromMoments_h
82 
83 #include "vtkDataSetAlgorithm.h"
84 #include "vtkFiltersMomentInvariantsModule.h" // For export macro
85 
86 #include <vector> // For internal vector methods
87 
88 class vtkImageData;
89 
90 class VTKFILTERSMOMENTINVARIANTS_EXPORT vtkReconstructFromMoments : public vtkDataSetAlgorithm
91 {
92 public:
94 
96  void PrintSelf(ostream& os, vtkIndent indent) override;
97 
102  void SetMomentsData(vtkDataObject* input) { this->SetInputData(0, input); };
103 
109  {
110  this->SetInputConnection(0, algOutput);
111  };
112 
117  void SetGridData(vtkDataObject* input) { this->SetInputData(1, input); };
118 
123  void SetGridConnection(vtkAlgorithmOutput* algOutput) { this->SetInputConnection(1, algOutput); };
124 
126 
130  vtkSetMacro(AllowExtrapolation, bool);
131  vtkGetMacro(AllowExtrapolation, bool);
133 
134 protected:
139 
143  ~vtkReconstructFromMoments() override;
144 
146 
153 
154 private:
156  void operator=(const vtkReconstructFromMoments&) = delete;
157 
162  size_t NumberOfFields;
163 
168  size_t NumberOfBasisFunctions;
169 
173  int Dimension;
174 
178  int FieldRank;
179 
183  int Order;
184 
188  std::vector<double> Radii;
189 
193  bool AllowExtrapolation;
194 
200  int FillInputPortInformation(int port, vtkInformation* info) override;
201 
206 
212  void CheckValidity(vtkImageData* momentsData, vtkDataSet* gridData);
213 
218  void InterpretGridData(vtkDataSet* gridData);
219 
224  void InterpretMomentsData(vtkImageData* momentsData);
225 };
226 
227 #endif
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
void SetInputData(vtkDataObject *)
Assign a data object as input.
void SetGridData(vtkDataObject *input)
standard pipeline input for port 1 This input steers the topology of the reconstructed field.
void SetMomentsConnection(vtkAlgorithmOutput *algOutput)
standard pipeline input for port 1 This is the data as produced by vtkComputeMoments or vtkMomentInva...
void SetMomentsData(vtkDataObject *input)
standard pipeline input for port 1 This is the data as produced by vtkComputeMoments or vtkMomentInva...
Proxy object to connect input/output ports.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
reconstruct the underlying function from its moments
virtual void SetInputConnection(int port, vtkAlgorithmOutput *input)
Set the connection for the given input port index.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks the algorithm to do its work.
void SetGridConnection(vtkAlgorithmOutput *algOutput)
standard pipeline input for port 1 This input steers the topology of the reconstructed field.
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when each filter in the pipeline decides what portion of its inp...
Store zero or more vtkInformation instances.
Superclass for algorithms that produce output of the same type as input.
general representation of visualization data
Definition: vtkDataObject.h:58
static vtkDataSetAlgorithm * New()
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.