VTK-m  2.2
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>
15 #include <vtkm/filter/Filter.h>
17 
18 namespace vtkm
19 {
20 namespace filter
21 {
22 namespace entity_extraction
23 {
41 {
42 public:
50  VTKM_CONT
51  vtkm::RangeId3 GetVOI() const { return this->VOI; }
52 
54  VTKM_CONT
55  void SetVOI(vtkm::Id i0, vtkm::Id i1, vtkm::Id j0, vtkm::Id j1, vtkm::Id k0, vtkm::Id k1)
56  {
57  this->VOI = vtkm::RangeId3(i0, i1, j0, j1, k0, k1);
58  }
60  VTKM_CONT
61  void SetVOI(vtkm::Id extents[6]) { this->VOI = vtkm::RangeId3(extents); }
63  VTKM_CONT
64  void SetVOI(vtkm::Id3 minPoint, vtkm::Id3 maxPoint)
65  {
66  this->VOI = vtkm::RangeId3(minPoint, maxPoint);
67  }
69  VTKM_CONT
70  void SetVOI(const vtkm::RangeId3& voi) { this->VOI = voi; }
71 
77  VTKM_CONT
78  vtkm::Id3 GetSampleRate() const { return this->SampleRate; }
79 
81  VTKM_CONT
82  void SetSampleRate(vtkm::Id i, vtkm::Id j, vtkm::Id k) { this->SampleRate = vtkm::Id3(i, j, k); }
83 
85  VTKM_CONT
86  void SetSampleRate(vtkm::Id3 sampleRate) { this->SampleRate = sampleRate; }
87 
102  VTKM_CONT
103  bool GetIncludeBoundary() const { return this->IncludeBoundary; }
105  VTKM_CONT
106  void SetIncludeBoundary(bool value) { this->IncludeBoundary = value; }
107 
108  // Set if VOI is specified in global (rather than in local) point indices
109  // (NOTE: Deprecated this method since this does not seem to work as
110  // expected and there are no tests for it. Furthermore, neither VTK-m nor
111  // VTK-h/Ascent seem to use this method. If your are using this method
112  // somewhere else and think it should remain, please open a merge request to
113  // "de-deprecate" it and add a test and documentation of the expected
114  // behavior.)
115  VTKM_DEPRECATED(2.1)
116  VTKM_CONT
117  void SetIncludeOffset(bool value) { this->IncludeOffset = value; }
118 
119 private:
120  VTKM_CONT
121  vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input) override;
122 
123  vtkm::RangeId3 VOI = vtkm::RangeId3(0, -1, 0, -1, 0, -1);
124  vtkm::Id3 SampleRate = { 1, 1, 1 };
125  bool IncludeBoundary = false;
126  bool IncludeOffset = false;
127 };
128 
129 } // namespace entity_extraction
130 } // namespace filter
131 } // namespace vtkm
132 
133 #endif // vtk_m_filter_entity_extraction_ExtractStructured_h
vtkm::filter::entity_extraction::ExtractStructured::GetSampleRate
vtkm::Id3 GetSampleRate() const
Specifies the sample rate of the VOI.
Definition: ExtractStructured.h:78
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::filter::entity_extraction::ExtractStructured::SetVOI
void SetVOI(vtkm::Id extents[6])
Specifies what volume of interest (VOI) should be extracted by the filter.
Definition: ExtractStructured.h:61
vtkm::filter::entity_extraction::ExtractStructured::SetIncludeBoundary
void SetIncludeBoundary(bool value)
Specifies if the outer boundary should always be included.
Definition: ExtractStructured.h:106
VTKM_FILTER_ENTITY_EXTRACTION_EXPORT
#define VTKM_FILTER_ENTITY_EXTRACTION_EXPORT
Definition: vtkm_filter_entity_extraction_export.h:44
vtkm::cont::DataSet
Contains and manages the geometric data structures that VTK-m operates on.
Definition: DataSet.h:57
vtkm::filter::entity_extraction::ExtractStructured
Select a piece (e.g., volume of interest) and/or subsample structured points dataset.
Definition: ExtractStructured.h:40
vtkm::filter::entity_extraction::ExtractStructured::SetSampleRate
void SetSampleRate(vtkm::Id i, vtkm::Id j, vtkm::Id k)
Specifies the sample rate of the VOI.
Definition: ExtractStructured.h:82
vtkm::filter::entity_extraction::ExtractStructured::SetVOI
void SetVOI(vtkm::Id i0, vtkm::Id i1, vtkm::Id j0, vtkm::Id j1, vtkm::Id k0, vtkm::Id k1)
Specifies what volume of interest (VOI) should be extracted by the filter.
Definition: ExtractStructured.h:55
vtkm::filter::entity_extraction::ExtractStructured::SetVOI
void SetVOI(const vtkm::RangeId3 &voi)
Specifies what volume of interest (VOI) should be extracted by the filter.
Definition: ExtractStructured.h:70
vtkm::filter::entity_extraction::ExtractStructured::SetVOI
void SetVOI(vtkm::Id3 minPoint, vtkm::Id3 maxPoint)
Specifies what volume of interest (VOI) should be extracted by the filter.
Definition: ExtractStructured.h:64
vtkm::filter::Filter
Base class for all filters.
Definition: Filter.h:163
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::Id
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
vtkm::Id3
vtkm::Vec< vtkm::Id, 3 > Id3
Id3 corresponds to a 3-dimensional index for 3d arrays.
Definition: Types.h:1041
vtkm::Vec< vtkm::Id, 3 >
vtkm_filter_entity_extraction_export.h
vtkm::filter::entity_extraction::ExtractStructured::GetIncludeBoundary
bool GetIncludeBoundary() const
Specifies if the outer boundary should always be included.
Definition: ExtractStructured.h:103
vtkm::RangeId3
Represent 3D integer range.
Definition: RangeId3.h:27
RangeId3.h
vtkm::filter::entity_extraction::ExtractStructured::SetSampleRate
void SetSampleRate(vtkm::Id3 sampleRate)
Specifies the sample rate of the VOI.
Definition: ExtractStructured.h:86
VTKM_DEPRECATED
#define VTKM_DEPRECATED(...)
Definition: Deprecated.h:145
vtkm::filter::entity_extraction::ExtractStructured::GetVOI
vtkm::RangeId3 GetVOI() const
Specifies what volume of interest (VOI) should be extracted by the filter.
Definition: ExtractStructured.h:51
Filter.h