mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +00:00
Revert from VOIIsGlobal to IncludeOffset. Add comment about deprecation reasoning.
This commit is contained in:
parent
523c8f3f21
commit
7bea5413cf
@ -74,7 +74,7 @@ vtkm::cont::DataSet ExtractStructured::DoExecute(const vtkm::cont::DataSet& inpu
|
||||
this->VOI,
|
||||
this->SampleRate,
|
||||
this->IncludeBoundary,
|
||||
this->VOIIsGlobal);
|
||||
this->IncludeOffset);
|
||||
|
||||
// Create map arrays for mapping fields. Could potentially save some time to first check to see
|
||||
// if these arrays would be used.
|
||||
|
@ -78,17 +78,16 @@ public:
|
||||
VTKM_CONT
|
||||
void SetIncludeBoundary(bool value) { this->IncludeBoundary = value; }
|
||||
|
||||
/// Get if VOI is specified in global point (rather than in local) indices
|
||||
/// Set if VOI is specified in global (rather than in local) point indices
|
||||
/// (NOTE: Depracted this method since this does not seem to work as
|
||||
/// expected and there are no tests for it. Furthermore, neither VTK-m nor
|
||||
/// VTK-h/Ascent seem to use this method. If your are using this method
|
||||
/// somewhere else and think it should remain, please open a merge request to
|
||||
/// "de-deprecate" it and add a test and documentation of the expected
|
||||
/// behavior.)
|
||||
VTKM_DEPRECATED(2.1)
|
||||
VTKM_CONT
|
||||
bool GetVOIIsGlobal() const { return this->VOIIsGlobal; }
|
||||
/// Set if VOI is specified in global point (rather than in local) indices
|
||||
VTKM_CONT
|
||||
void SetVOIIsGlobal(bool value) { this->VOIIsGlobal = value; }
|
||||
/// Set if VOI is specified in global point (rather than in local) indices
|
||||
/// (depracted in favor of a method with a name that better conveys purpose)
|
||||
VTKM_DEPRECATED(2.0)
|
||||
VTKM_CONT
|
||||
void SetIncludeOffset(bool value) { this->VOIIsGlobal = value; }
|
||||
void SetIncludeOffset(bool value) { this->IncludeOffset = value; }
|
||||
|
||||
private:
|
||||
VTKM_CONT
|
||||
@ -97,7 +96,7 @@ private:
|
||||
vtkm::RangeId3 VOI = vtkm::RangeId3(0, -1, 0, -1, 0, -1);
|
||||
vtkm::Id3 SampleRate = { 1, 1, 1 };
|
||||
bool IncludeBoundary = false;
|
||||
bool VOIIsGlobal = false;
|
||||
bool IncludeOffset = false;
|
||||
};
|
||||
|
||||
} // namespace entity_extraction
|
||||
|
@ -203,7 +203,7 @@ public:
|
||||
const vtkm::RangeId3& voi,
|
||||
const vtkm::Id3& sampleRate,
|
||||
bool includeBoundary,
|
||||
bool voiIsGlobal)
|
||||
bool includeOffset)
|
||||
{
|
||||
vtkm::Id pdims = cellset.GetPointDimensions();
|
||||
vtkm::Id offsets = cellset.GetGlobalPointIndexStart();
|
||||
@ -215,14 +215,14 @@ public:
|
||||
voi,
|
||||
sampleRate,
|
||||
includeBoundary,
|
||||
voiIsGlobal);
|
||||
includeOffset);
|
||||
}
|
||||
|
||||
inline UncertainCellSetStructured Run(const vtkm::cont::CellSetStructured<2>& cellset,
|
||||
const vtkm::RangeId3& voi,
|
||||
const vtkm::Id3& sampleRate,
|
||||
bool includeBoundary,
|
||||
bool voiIsGlobal)
|
||||
bool includeOffset)
|
||||
{
|
||||
vtkm::Id2 pdims = cellset.GetPointDimensions();
|
||||
vtkm::Id2 offsets = cellset.GetGlobalPointIndexStart();
|
||||
@ -234,19 +234,20 @@ public:
|
||||
voi,
|
||||
sampleRate,
|
||||
includeBoundary,
|
||||
voiIsGlobal);
|
||||
includeOffset);
|
||||
}
|
||||
|
||||
inline UncertainCellSetStructured Run(const vtkm::cont::CellSetStructured<3>& cellset,
|
||||
const vtkm::RangeId3& voi,
|
||||
const vtkm::Id3& sampleRate,
|
||||
bool includeBoundary,
|
||||
bool voiIsGlobal)
|
||||
bool includeOffset)
|
||||
{
|
||||
vtkm::Id3 pdims = cellset.GetPointDimensions();
|
||||
vtkm::Id3 offsets = cellset.GetGlobalPointIndexStart();
|
||||
vtkm::Id3 gpdims = cellset.GetGlobalPointDimensions();
|
||||
return this->Compute(3, pdims, offsets, gpdims, voi, sampleRate, includeBoundary, voiIsGlobal);
|
||||
return this->Compute(
|
||||
3, pdims, offsets, gpdims, voi, sampleRate, includeBoundary, includeOffset);
|
||||
}
|
||||
|
||||
UncertainCellSetStructured Compute(const int dimensionality,
|
||||
@ -256,7 +257,7 @@ public:
|
||||
const vtkm::RangeId3& voi,
|
||||
const vtkm::Id3& sampleRate,
|
||||
bool includeBoundary,
|
||||
bool voiIsGlobal)
|
||||
bool includeOffset)
|
||||
{
|
||||
// Verify input parameters
|
||||
vtkm::Id3 offset_vec(0, 0, 0);
|
||||
@ -271,7 +272,7 @@ public:
|
||||
{
|
||||
throw vtkm::cont::ErrorBadValue("Bad sampling rate");
|
||||
}
|
||||
if (voiIsGlobal)
|
||||
if (includeOffset)
|
||||
{
|
||||
vtkm::Id3 tmpDims = ptdim;
|
||||
offset_vec = offsets;
|
||||
@ -338,7 +339,7 @@ public:
|
||||
vtkm::Id3 empty = { 0, 0, 0 };
|
||||
return MakeCellSetStructured(empty, empty, globalPointDimensions, dimensionality);
|
||||
}
|
||||
if (!voiIsGlobal)
|
||||
if (!includeOffset)
|
||||
{
|
||||
// compute output dimensions
|
||||
this->OutputDimensions = vtkm::Id3(1, 1, 1);
|
||||
@ -395,13 +396,13 @@ private:
|
||||
const vtkm::RangeId3& voi,
|
||||
const vtkm::Id3& sampleRate,
|
||||
bool includeBoundary,
|
||||
bool voiIsGlobal,
|
||||
bool includeOffset,
|
||||
UncertainCellSetStructured& output)
|
||||
: Worklet(worklet)
|
||||
, VOI(&voi)
|
||||
, SampleRate(&sampleRate)
|
||||
, IncludeBoundary(includeBoundary)
|
||||
, VOIIsGlobal(voiIsGlobal)
|
||||
, IncludeOffset(includeOffset)
|
||||
, Output(&output)
|
||||
{
|
||||
}
|
||||
@ -410,7 +411,7 @@ private:
|
||||
void operator()(const vtkm::cont::CellSetStructured<N>& cellset) const
|
||||
{
|
||||
*this->Output = this->Worklet->Run(
|
||||
cellset, *this->VOI, *this->SampleRate, this->IncludeBoundary, this->VOIIsGlobal);
|
||||
cellset, *this->VOI, *this->SampleRate, this->IncludeBoundary, this->IncludeOffset);
|
||||
}
|
||||
|
||||
template <typename CellSetType>
|
||||
@ -424,7 +425,7 @@ private:
|
||||
const vtkm::RangeId3* VOI;
|
||||
const vtkm::Id3* SampleRate;
|
||||
bool IncludeBoundary;
|
||||
bool VOIIsGlobal;
|
||||
bool IncludeOffset;
|
||||
UncertainCellSetStructured* Output;
|
||||
};
|
||||
|
||||
@ -434,10 +435,10 @@ public:
|
||||
const vtkm::RangeId3& voi,
|
||||
const vtkm::Id3& sampleRate,
|
||||
bool includeBoundary,
|
||||
bool voiIsGlobal)
|
||||
bool includeOffset)
|
||||
{
|
||||
UncertainCellSetStructured output;
|
||||
CallRun cr(this, voi, sampleRate, includeBoundary, voiIsGlobal, output);
|
||||
CallRun cr(this, voi, sampleRate, includeBoundary, includeOffset, output);
|
||||
vtkm::cont::CastAndCall(cellset, cr);
|
||||
return output;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user