Viskores  1.0
ExtractStructured.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 
19 #ifndef viskores_filter_entity_extraction_ExtractStructured_h
20 #define viskores_filter_entity_extraction_ExtractStructured_h
21 
22 #include <viskores/RangeId3.h>
23 #include <viskores/filter/Filter.h>
25 
26 namespace viskores
27 {
28 namespace filter
29 {
30 namespace entity_extraction
31 {
48 class VISKORES_FILTER_ENTITY_EXTRACTION_EXPORT ExtractStructured : public viskores::filter::Filter
49 {
50 public:
59  viskores::RangeId3 GetVOI() const { return this->VOI; }
60 
64  viskores::Id i1,
65  viskores::Id j0,
66  viskores::Id j1,
67  viskores::Id k0,
68  viskores::Id k1)
69  {
70  this->VOI = viskores::RangeId3(i0, i1, j0, j1, k0, k1);
71  }
74  void SetVOI(viskores::Id extents[6]) { this->VOI = viskores::RangeId3(extents); }
77  void SetVOI(viskores::Id3 minPoint, viskores::Id3 maxPoint)
78  {
79  this->VOI = viskores::RangeId3(minPoint, maxPoint);
80  }
83  void SetVOI(const viskores::RangeId3& voi) { this->VOI = voi; }
84 
91  viskores::Id3 GetSampleRate() const { return this->SampleRate; }
92 
96  {
97  this->SampleRate = viskores::Id3(i, j, k);
98  }
99 
102  void SetSampleRate(viskores::Id3 sampleRate) { this->SampleRate = sampleRate; }
103 
119  bool GetIncludeBoundary() const { return this->IncludeBoundary; }
122  void SetIncludeBoundary(bool value) { this->IncludeBoundary = value; }
123 
124  // Set if VOI is specified in global (rather than in local) point indices
125  // (NOTE: Deprecated this method since this does not seem to work as
126  // expected and there are no tests for it. Furthermore, neither Viskores nor
127  // VTK-h/Ascent seem to use this method. If your are using this method
128  // somewhere else and think it should remain, please open a merge request to
129  // "de-deprecate" it and add a test and documentation of the expected
130  // behavior.)
133  void SetIncludeOffset(bool value) { this->IncludeOffset = value; }
134 
135 private:
137  viskores::cont::DataSet DoExecute(const viskores::cont::DataSet& input) override;
138 
139  viskores::RangeId3 VOI = viskores::RangeId3(0, -1, 0, -1, 0, -1);
140  viskores::Id3 SampleRate = { 1, 1, 1 };
141  bool IncludeBoundary = false;
142  bool IncludeOffset = false;
143 };
144 
145 } // namespace entity_extraction
146 } // namespace filter
147 } // namespace viskores
148 
149 #endif // viskores_filter_entity_extraction_ExtractStructured_h
viskores::filter::entity_extraction::ExtractStructured::SetVOI
void SetVOI(viskores::Id extents[6])
Specifies what volume of interest (VOI) should be extracted by the filter.
Definition: ExtractStructured.h:74
viskores::cont::DataSet
Contains and manages the geometric data structures that Viskores operates on.
Definition: DataSet.h:66
viskores::filter::Filter
Base class for all filters.
Definition: Filter.h:171
viskores::filter::entity_extraction::ExtractStructured::SetSampleRate
void SetSampleRate(viskores::Id i, viskores::Id j, viskores::Id k)
Specifies the sample rate of the VOI.
Definition: ExtractStructured.h:95
viskores::filter::entity_extraction::ExtractStructured
Select a piece (e.g., volume of interest) and/or subsample structured points dataset.
Definition: ExtractStructured.h:48
viskores::Id
viskores::Int64 Id
Base type to use to index arrays.
Definition: Types.h:235
VISKORES_CONT
#define VISKORES_CONT
Definition: ExportMacros.h:65
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::filter::entity_extraction::ExtractStructured::SetIncludeBoundary
void SetIncludeBoundary(bool value)
Specifies if the outer boundary should always be included.
Definition: ExtractStructured.h:122
viskores::filter::entity_extraction::ExtractStructured::SetVOI
void SetVOI(viskores::Id i0, viskores::Id i1, viskores::Id j0, viskores::Id j1, viskores::Id k0, viskores::Id k1)
Specifies what volume of interest (VOI) should be extracted by the filter.
Definition: ExtractStructured.h:63
viskores::filter::entity_extraction::ExtractStructured::GetSampleRate
viskores::Id3 GetSampleRate() const
Specifies the sample rate of the VOI.
Definition: ExtractStructured.h:91
VISKORES_DEPRECATED
#define VISKORES_DEPRECATED(...)
Definition: Deprecated.h:156
viskores_filter_entity_extraction_export.h
viskores::filter::entity_extraction::ExtractStructured::SetVOI
void SetVOI(viskores::Id3 minPoint, viskores::Id3 maxPoint)
Specifies what volume of interest (VOI) should be extracted by the filter.
Definition: ExtractStructured.h:77
viskores::Id3
viskores::Vec< viskores::Id, 3 > Id3
Id3 corresponds to a 3-dimensional index for 3d arrays.
Definition: Types.h:1053
viskores::RangeId3
Represent 3D integer range.
Definition: RangeId3.h:35
viskores::filter::entity_extraction::ExtractStructured::GetVOI
viskores::RangeId3 GetVOI() const
Specifies what volume of interest (VOI) should be extracted by the filter.
Definition: ExtractStructured.h:59
viskores::filter::entity_extraction::ExtractStructured::GetIncludeBoundary
bool GetIncludeBoundary() const
Specifies if the outer boundary should always be included.
Definition: ExtractStructured.h:119
viskores::filter::entity_extraction::ExtractStructured::SetSampleRate
void SetSampleRate(viskores::Id3 sampleRate)
Specifies the sample rate of the VOI.
Definition: ExtractStructured.h:102
RangeId3.h
viskores::Vec< viskores::Id, 3 >
viskores::filter::entity_extraction::ExtractStructured::SetVOI
void SetVOI(const viskores::RangeId3 &voi)
Specifies what volume of interest (VOI) should be extracted by the filter.
Definition: ExtractStructured.h:83
Filter.h