VTK-m  2.0
ExtractStructured.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 
11 #ifndef vtk_m_filter_entity_extraction_ExtractStructured_h
12 #define vtk_m_filter_entity_extraction_ExtractStructured_h
13 
14 #include <vtkm/RangeId3.h>
16 #include <vtkm/filter/entity_extraction/vtkm_filter_entity_extraction_export.h>
17 
18 namespace vtkm
19 {
20 namespace filter
21 {
22 namespace entity_extraction
23 {
40 class VTKM_FILTER_ENTITY_EXTRACTION_EXPORT ExtractStructured : public vtkm::filter::FilterField
41 {
42 public:
43  // Set the bounding box for the volume of interest
44  VTKM_CONT
45  vtkm::RangeId3 GetVOI() const { return this->VOI; }
46 
47  VTKM_CONT
48  void SetVOI(vtkm::Id i0, vtkm::Id i1, vtkm::Id j0, vtkm::Id j1, vtkm::Id k0, vtkm::Id k1)
49  {
50  this->VOI = vtkm::RangeId3(i0, i1, j0, j1, k0, k1);
51  }
52  VTKM_CONT
53  void SetVOI(vtkm::Id extents[6]) { this->VOI = vtkm::RangeId3(extents); }
54  VTKM_CONT
55  void SetVOI(vtkm::Id3 minPoint, vtkm::Id3 maxPoint)
56  {
57  this->VOI = vtkm::RangeId3(minPoint, maxPoint);
58  }
59  VTKM_CONT
60  void SetVOI(const vtkm::RangeId3& voi) { this->VOI = voi; }
61 
63  VTKM_CONT
64  vtkm::Id3 GetSampleRate() const { return this->SampleRate; }
65 
67  VTKM_CONT
68  void SetSampleRate(vtkm::Id i, vtkm::Id j, vtkm::Id k) { this->SampleRate = vtkm::Id3(i, j, k); }
69 
71  VTKM_CONT
72  void SetSampleRate(vtkm::Id3 sampleRate) { this->SampleRate = sampleRate; }
73 
75  VTKM_CONT
76  bool GetIncludeBoundary() const { return this->IncludeBoundary; }
78  VTKM_CONT
79  void SetIncludeBoundary(bool value) { this->IncludeBoundary = value; }
80 
81  VTKM_CONT
82  void SetIncludeOffset(bool value) { this->IncludeOffset = value; }
83 
84 private:
85  VTKM_CONT
86  vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input) override;
87 
88  vtkm::RangeId3 VOI = vtkm::RangeId3(0, -1, 0, -1, 0, -1);
89  vtkm::Id3 SampleRate = { 1, 1, 1 };
90  bool IncludeBoundary = false;
91  bool IncludeOffset = false;
92 };
93 
94 } // namespace entity_extraction
95 } // namespace filter
96 } // namespace vtkm
97 
98 #endif // vtk_m_filter_entity_extraction_ExtractStructured_h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::cont::DataSet
Definition: DataSet.h:34
vtkm::filter::entity_extraction::ExtractStructured
Select piece (e.g., volume of interest) and/or subsample structured points dataset.
Definition: ExtractStructured.h:40
vtkm::filter::entity_extraction::ExtractStructured::SetVOI
VTKM_CONT void SetVOI(vtkm::Id extents[6])
Definition: ExtractStructured.h:53
vtkm::filter::entity_extraction::ExtractStructured::SetIncludeBoundary
VTKM_CONT void SetIncludeBoundary(bool value)
Set if we should include the outer boundary on a subsample.
Definition: ExtractStructured.h:79
vtkm::filter::entity_extraction::ExtractStructured::SetSampleRate
VTKM_CONT void SetSampleRate(vtkm::Id3 sampleRate)
Set the Sampling rate.
Definition: ExtractStructured.h:72
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
vtkm::filter::entity_extraction::ExtractStructured::SetIncludeOffset
VTKM_CONT void SetIncludeOffset(bool value)
Definition: ExtractStructured.h:82
FilterField.h
vtkm::filter::FilterField
Definition: FilterField.h:21
vtkm::filter::entity_extraction::ExtractStructured::SetVOI
VTKM_CONT void SetVOI(vtkm::Id i0, vtkm::Id i1, vtkm::Id j0, vtkm::Id j1, vtkm::Id k0, vtkm::Id k1)
Definition: ExtractStructured.h:48
vtkm::filter::entity_extraction::ExtractStructured::GetIncludeBoundary
VTKM_CONT bool GetIncludeBoundary() const
Get if we should include the outer boundary on a subsample.
Definition: ExtractStructured.h:76
vtkm::filter::entity_extraction::ExtractStructured::SetVOI
VTKM_CONT void SetVOI(vtkm::Id3 minPoint, vtkm::Id3 maxPoint)
Definition: ExtractStructured.h:55
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::filter::entity_extraction::ExtractStructured::GetSampleRate
VTKM_CONT vtkm::Id3 GetSampleRate() const
Get the Sampling rate.
Definition: ExtractStructured.h:64
vtkm::filter::entity_extraction::ExtractStructured::SetSampleRate
VTKM_CONT void SetSampleRate(vtkm::Id i, vtkm::Id j, vtkm::Id k)
Set the Sampling rate.
Definition: ExtractStructured.h:68
vtkm::Id3
vtkm::Vec< vtkm::Id, 3 > Id3
Id3 corresponds to a 3-dimensional index for 3d arrays.
Definition: Types.h:1003
vtkm::Vec< vtkm::Id, 3 >
vtkm::RangeId3
Represent 3D integer range.
Definition: RangeId3.h:27
RangeId3.h
vtkm::filter::entity_extraction::ExtractStructured::SetVOI
VTKM_CONT void SetVOI(const vtkm::RangeId3 &voi)
Definition: ExtractStructured.h:60
vtkm::filter::entity_extraction::ExtractStructured::GetVOI
VTKM_CONT vtkm::RangeId3 GetVOI() const
Definition: ExtractStructured.h:45