mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +00:00
Properly handle global (whole mesh) fields in data set filters
Generally, fields that have a WHOLE_MESH association might be valid even if the structure of the mesh changes. Thus, it makes sense for filters to pass this data pretty much all the time. Also cleaned up some code and comments to make the relationship between `MapFieldOntoOutput` and `DoMapField` more clear.
This commit is contained in:
parent
f8fd0ce316
commit
5498ecd35b
@ -84,6 +84,7 @@ public:
|
||||
|
||||
VTKM_CONT bool IsFieldCell() const { return this->FieldAssociation == Association::CELL_SET; }
|
||||
VTKM_CONT bool IsFieldPoint() const { return this->FieldAssociation == Association::POINTS; }
|
||||
VTKM_CONT bool IsFieldGlobal() const { return this->FieldAssociation == Association::WHOLE_MESH; }
|
||||
|
||||
VTKM_CONT vtkm::Id GetNumberOfValues() const { return this->Data.GetNumberOfValues(); }
|
||||
|
||||
|
@ -11,35 +11,10 @@
|
||||
|
||||
#include <vtkm/filter/ClipWithField.h>
|
||||
|
||||
#include <vtkm/filter/MapFieldPermutation.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace filter
|
||||
{
|
||||
|
||||
VTKM_FILTER_EXPORT bool ClipWithField::MapFieldOntoOutput(vtkm::cont::DataSet& result,
|
||||
const vtkm::cont::Field& field)
|
||||
{
|
||||
if (field.IsFieldPoint())
|
||||
{
|
||||
// Handled by DoMapField, which the superclass will call.
|
||||
// Actually already done by other version of MapFieldOntoOutput. (Stupid policies.)
|
||||
//return this->FilterDataSetWithField<ClipWithField>::MapFieldOntoOutput(result, field, policy);
|
||||
VTKM_ASSERT(false && "Should not be here");
|
||||
return false;
|
||||
}
|
||||
else if (field.IsFieldCell())
|
||||
{
|
||||
vtkm::cont::ArrayHandle<vtkm::Id> permutation = this->Worklet.GetCellMapOutputToInput();
|
||||
return vtkm::filter::MapFieldPermutation(field, permutation, result);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
VTKM_FILTER_INSTANTIATE_EXECUTE_METHOD(ClipWithField);
|
||||
}
|
||||
|
@ -14,6 +14,8 @@
|
||||
#include <vtkm/filter/vtkm_filter_export.h>
|
||||
|
||||
#include <vtkm/filter/FilterDataSetWithField.h>
|
||||
#include <vtkm/filter/MapFieldPermutation.h>
|
||||
|
||||
#include <vtkm/worklet/Clip.h>
|
||||
|
||||
namespace vtkm
|
||||
@ -46,9 +48,6 @@ public:
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
vtkm::filter::PolicyBase<DerivedPolicy> policy);
|
||||
|
||||
VTKM_FILTER_EXPORT VTKM_CONT bool MapFieldOntoOutput(vtkm::cont::DataSet& result,
|
||||
const vtkm::cont::Field& field);
|
||||
|
||||
template <typename DerivedPolicy>
|
||||
VTKM_CONT bool MapFieldOntoOutput(vtkm::cont::DataSet& result,
|
||||
const vtkm::cont::Field& field,
|
||||
@ -56,12 +55,25 @@ public:
|
||||
{
|
||||
if (field.IsFieldPoint())
|
||||
{
|
||||
// DIE, POLICIES, DIE!
|
||||
// If the field is a point field, then we need to do a custom interpolation of the points.
|
||||
// In this case, we need to call the superclass's MapFieldOntoOutput, which will in turn
|
||||
// call our DoMapField.
|
||||
return this->FilterDataSetWithField<ClipWithField>::MapFieldOntoOutput(result, field, policy);
|
||||
}
|
||||
else if (field.IsFieldCell())
|
||||
{
|
||||
// Use the precompiled field permutation function.
|
||||
vtkm::cont::ArrayHandle<vtkm::Id> permutation = this->Worklet.GetCellMapOutputToInput();
|
||||
return vtkm::filter::MapFieldPermutation(field, permutation, result);
|
||||
}
|
||||
else if (field.IsFieldGlobal())
|
||||
{
|
||||
result.AddField(field);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return this->MapFieldOntoOutput(result, field);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,34 +11,10 @@
|
||||
#define vtkm_filter_ClipWithImplicitFunction_cxx
|
||||
#include <vtkm/filter/ClipWithImplicitFunction.h>
|
||||
|
||||
#include <vtkm/filter/MapFieldPermutation.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace filter
|
||||
{
|
||||
|
||||
VTKM_FILTER_EXPORT bool ClipWithImplicitFunction::MapFieldOntoOutput(vtkm::cont::DataSet& result,
|
||||
const vtkm::cont::Field& field)
|
||||
{
|
||||
if (field.IsFieldPoint())
|
||||
{
|
||||
// Handled by DoMapField, which the superclass will call.
|
||||
// Actually already done by other version of MapFieldOntoOutput. (Stupid policies.)
|
||||
//return this->FilterDataSet<ClipWithImplicitFunction>::MapFieldOntoOutput(result, field, policy);
|
||||
VTKM_ASSERT(false && "Should not be here");
|
||||
return false;
|
||||
}
|
||||
else if (field.IsFieldCell())
|
||||
{
|
||||
vtkm::cont::ArrayHandle<vtkm::Id> permutation = this->Worklet.GetCellMapOutputToInput();
|
||||
return vtkm::filter::MapFieldPermutation(field, permutation, result);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
VTKM_FILTER_INSTANTIATE_EXECUTE_METHOD(ClipWithImplicitFunction);
|
||||
}
|
||||
|
@ -14,6 +14,7 @@
|
||||
|
||||
#include <vtkm/cont/ImplicitFunctionHandle.h>
|
||||
#include <vtkm/filter/FilterDataSet.h>
|
||||
#include <vtkm/filter/MapFieldPermutation.h>
|
||||
#include <vtkm/worklet/Clip.h>
|
||||
|
||||
namespace vtkm
|
||||
@ -43,9 +44,6 @@ public:
|
||||
vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input,
|
||||
vtkm::filter::PolicyBase<DerivedPolicy> policy);
|
||||
|
||||
VTKM_FILTER_EXPORT VTKM_CONT bool MapFieldOntoOutput(vtkm::cont::DataSet& result,
|
||||
const vtkm::cont::Field& field);
|
||||
|
||||
template <typename DerivedPolicy>
|
||||
VTKM_CONT bool MapFieldOntoOutput(vtkm::cont::DataSet& result,
|
||||
const vtkm::cont::Field& field,
|
||||
@ -53,13 +51,26 @@ public:
|
||||
{
|
||||
if (field.IsFieldPoint())
|
||||
{
|
||||
// DIE, POLICIES, DIE!
|
||||
// If the field is a point field, then we need to do a custom interpolation of the points.
|
||||
// In this case, we need to call the superclass's MapFieldOntoOutput, which will in turn
|
||||
// call our DoMapField.
|
||||
return this->FilterDataSet<ClipWithImplicitFunction>::MapFieldOntoOutput(
|
||||
result, field, policy);
|
||||
}
|
||||
else if (field.IsFieldCell())
|
||||
{
|
||||
// Use the precompiled field permutation function.
|
||||
vtkm::cont::ArrayHandle<vtkm::Id> permutation = this->Worklet.GetCellMapOutputToInput();
|
||||
return vtkm::filter::MapFieldPermutation(field, permutation, result);
|
||||
}
|
||||
else if (field.IsFieldGlobal())
|
||||
{
|
||||
result.AddField(field);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return this->MapFieldOntoOutput(result, field);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,8 +10,6 @@
|
||||
#define vtkm_filter_Contour_cxx
|
||||
#include <vtkm/filter/Contour.h>
|
||||
|
||||
#include <vtkm/filter/MapFieldPermutation.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace filter
|
||||
@ -69,28 +67,5 @@ VTKM_FILTER_EXPORT vtkm::Float64 Contour::GetIsoValue(vtkm::Id index) const
|
||||
{
|
||||
return this->IsoValues[static_cast<std::size_t>(index)];
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
VTKM_FILTER_EXPORT bool Contour::MapFieldOntoOutput(vtkm::cont::DataSet& result,
|
||||
const vtkm::cont::Field& field)
|
||||
{
|
||||
if (field.IsFieldPoint())
|
||||
{
|
||||
// Handled by DoMapField, which the superclass will call.
|
||||
// Actually already done by other version of MapFieldOntoOutput. (Stupid policies.)
|
||||
//return this->FilterDataSetWithField<Contour>::MapFieldOntoOutput(result, field, policy);
|
||||
VTKM_ASSERT(false && "Should not be here");
|
||||
return false;
|
||||
}
|
||||
else if (field.IsFieldCell())
|
||||
{
|
||||
vtkm::cont::ArrayHandle<vtkm::Id> permutation = this->Worklet.GetCellIdMap();
|
||||
return vtkm::filter::MapFieldPermutation(field, permutation, result);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,8 @@
|
||||
#include <vtkm/filter/vtkm_filter_export.h>
|
||||
|
||||
#include <vtkm/filter/FilterDataSetWithField.h>
|
||||
#include <vtkm/filter/MapFieldPermutation.h>
|
||||
|
||||
#include <vtkm/worklet/Contour.h>
|
||||
|
||||
namespace vtkm
|
||||
@ -111,9 +113,6 @@ public:
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
vtkm::filter::PolicyBase<DerivedPolicy> policy);
|
||||
|
||||
VTKM_FILTER_EXPORT VTKM_CONT bool MapFieldOntoOutput(vtkm::cont::DataSet& result,
|
||||
const vtkm::cont::Field& field);
|
||||
|
||||
template <typename DerivedPolicy>
|
||||
VTKM_CONT bool MapFieldOntoOutput(vtkm::cont::DataSet& result,
|
||||
const vtkm::cont::Field& field,
|
||||
@ -121,12 +120,25 @@ public:
|
||||
{
|
||||
if (field.IsFieldPoint())
|
||||
{
|
||||
// DIE, POLICIES, DIE!
|
||||
// If the field is a point field, then we need to do a custom interpolation of the points.
|
||||
// In this case, we need to call the superclass's MapFieldOntoOutput, which will in turn
|
||||
// call our DoMapField.
|
||||
return this->FilterDataSetWithField<Contour>::MapFieldOntoOutput(result, field, policy);
|
||||
}
|
||||
else if (field.IsFieldCell())
|
||||
{
|
||||
// Use the precompiled field permutation function.
|
||||
vtkm::cont::ArrayHandle<vtkm::Id> permutation = this->Worklet.GetCellIdMap();
|
||||
return vtkm::filter::MapFieldPermutation(field, permutation, result);
|
||||
}
|
||||
else if (field.IsFieldGlobal())
|
||||
{
|
||||
result.AddField(field);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return this->MapFieldOntoOutput(result, field);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -82,9 +82,16 @@ bool ExternalFaces::MapFieldOntoOutput(vtkm::cont::DataSet& result, const vtkm::
|
||||
{
|
||||
return vtkm::filter::MapFieldPermutation(field, this->Worklet.GetCellIdMap(), result);
|
||||
}
|
||||
|
||||
else if (field.IsFieldGlobal())
|
||||
{
|
||||
result.AddField(field);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
VTKM_FILTER_INSTANTIATE_EXECUTE_METHOD(ExternalFaces);
|
||||
|
@ -39,6 +39,11 @@ VTKM_FILTER_EXPORT bool ExtractGeometry::MapFieldOntoOutput(vtkm::cont::DataSet&
|
||||
vtkm::cont::ArrayHandle<vtkm::Id> permutation = this->Worklet.GetValidCellIds();
|
||||
return vtkm::filter::MapFieldPermutation(field, permutation, result);
|
||||
}
|
||||
else if (field.IsFieldGlobal())
|
||||
{
|
||||
result.AddField(field);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
|
@ -84,11 +84,18 @@ inline VTKM_CONT bool ExtractPoints::MapFieldOntoOutput(
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
else if (field.IsFieldGlobal())
|
||||
{
|
||||
result.AddField(field);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// cell data does not apply
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -36,14 +36,20 @@ bool ExtractStructured::MapFieldOntoOutput(vtkm::cont::DataSet& result,
|
||||
{
|
||||
return vtkm::filter::MapFieldPermutation(field, this->PointFieldMap, result);
|
||||
}
|
||||
|
||||
if (field.IsFieldCell())
|
||||
else if (field.IsFieldCell())
|
||||
{
|
||||
return vtkm::filter::MapFieldPermutation(field, this->CellFieldMap, result);
|
||||
}
|
||||
|
||||
else if (field.IsFieldGlobal())
|
||||
{
|
||||
result.AddField(field);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void ExtractStructured::PostExecute(const vtkm::cont::PartitionedDataSet&,
|
||||
|
@ -376,6 +376,11 @@ VTKM_CONT bool GhostCellRemove::MapFieldOntoOutput(vtkm::cont::DataSet& result,
|
||||
{
|
||||
return vtkm::filter::MapFieldPermutation(field, this->Worklet.GetValidCellIds(), result);
|
||||
}
|
||||
else if (field.IsFieldGlobal())
|
||||
{
|
||||
result.AddField(field);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
|
@ -327,13 +327,21 @@ inline VTKM_CONT vtkm::cont::DataSet Lagrangian::DoExecute(
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
template <typename DerivedPolicy>
|
||||
inline VTKM_CONT bool Lagrangian::MapFieldOntoOutput(vtkm::cont::DataSet&,
|
||||
const vtkm::cont::Field&,
|
||||
inline VTKM_CONT bool Lagrangian::MapFieldOntoOutput(vtkm::cont::DataSet& result,
|
||||
const vtkm::cont::Field& field,
|
||||
vtkm::filter::PolicyBase<DerivedPolicy>)
|
||||
{
|
||||
if (field.IsFieldGlobal())
|
||||
{
|
||||
result.AddField(field);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace vtkm::filter
|
||||
|
||||
#endif
|
||||
|
@ -157,12 +157,20 @@ inline VTKM_CONT vtkm::cont::DataSet LagrangianStructures::DoExecute(
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename DerivedPolicy>
|
||||
inline VTKM_CONT bool LagrangianStructures::MapFieldOntoOutput(
|
||||
vtkm::cont::DataSet&,
|
||||
const vtkm::cont::Field&,
|
||||
vtkm::cont::DataSet& result,
|
||||
const vtkm::cont::Field& field,
|
||||
vtkm::filter::PolicyBase<DerivedPolicy>)
|
||||
{
|
||||
if (field.IsFieldGlobal())
|
||||
{
|
||||
result.AddField(field);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace vtkm::filter
|
||||
#endif
|
||||
|
@ -73,7 +73,7 @@ inline VTKM_CONT bool Mask::MapFieldOntoOutput(vtkm::cont::DataSet& result,
|
||||
const vtkm::cont::Field& field,
|
||||
vtkm::filter::PolicyBase<DerivedPolicy>)
|
||||
{
|
||||
if (field.IsFieldPoint())
|
||||
if (field.IsFieldPoint() || field.IsFieldGlobal())
|
||||
{
|
||||
result.AddField(field); // pass through
|
||||
return true;
|
||||
|
@ -76,10 +76,17 @@ inline VTKM_CONT bool MaskPoints::MapFieldOntoOutput(vtkm::cont::DataSet& result
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
else if (field.IsFieldGlobal())
|
||||
{
|
||||
result.AddField(field);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// cell data does not apply
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -54,18 +54,25 @@ VTKM_CONT inline bool Probe::MapFieldOntoOutput(vtkm::cont::DataSet& result,
|
||||
{
|
||||
if (field.IsFieldPoint())
|
||||
{
|
||||
// This is a special interpolation that is handled by DoMapField. The superclass'
|
||||
// MapFieldOntoOutput will handle this.
|
||||
// If the field is a point field, then we need to do a custom interpolation of the points.
|
||||
// In this case, we need to call the superclass's MapFieldOntoOutput, which will in turn
|
||||
// call our DoMapField.
|
||||
return this->FilterDataSet<Probe>::MapFieldOntoOutput(result, field, policy);
|
||||
}
|
||||
|
||||
if (field.IsFieldCell())
|
||||
else if (field.IsFieldCell())
|
||||
{
|
||||
return vtkm::filter::MapFieldPermutation(field, this->Worklet.GetCellIds(), result);
|
||||
}
|
||||
|
||||
else if (field.IsFieldGlobal())
|
||||
{
|
||||
result.AddField(field);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T, typename StorageType, typename DerivedPolicy>
|
||||
VTKM_CONT inline bool Probe::DoMapField(vtkm::cont::DataSet& result,
|
||||
|
@ -68,7 +68,7 @@ inline VTKM_CONT bool SplitSharpEdges::MapFieldOntoOutput(vtkm::cont::DataSet& r
|
||||
{
|
||||
return vtkm::filter::MapFieldPermutation(field, this->Worklet.GetNewPointsIdArray(), result);
|
||||
}
|
||||
else if (field.IsFieldCell())
|
||||
else if (field.IsFieldCell() || field.IsFieldGlobal())
|
||||
{
|
||||
result.AddField(field); // pass through
|
||||
return true;
|
||||
|
@ -68,23 +68,29 @@ inline VTKM_CONT bool Tetrahedralize::MapFieldOntoOutput(vtkm::cont::DataSet& re
|
||||
const vtkm::cont::Field& field,
|
||||
vtkm::filter::PolicyBase<DerivedPolicy>)
|
||||
{
|
||||
// point data is copied as is because it was not collapsed
|
||||
if (field.IsFieldPoint())
|
||||
{
|
||||
// point data is copied as is because it was not collapsed
|
||||
result.AddField(field);
|
||||
return true;
|
||||
}
|
||||
|
||||
// cell data must be scattered to the cells created per input cell
|
||||
if (field.IsFieldCell())
|
||||
else if (field.IsFieldCell())
|
||||
{
|
||||
// cell data must be scattered to the cells created per input cell
|
||||
vtkm::cont::ArrayHandle<vtkm::Id> permutation =
|
||||
this->Worklet.GetOutCellScatter().GetOutputToInputMap();
|
||||
return vtkm::filter::MapFieldPermutation(field, permutation, result);
|
||||
}
|
||||
|
||||
else if (field.IsFieldGlobal())
|
||||
{
|
||||
result.AddField(field);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -20,20 +20,21 @@ namespace filter
|
||||
VTKM_FILTER_EXPORT bool Threshold::MapFieldOntoOutput(vtkm::cont::DataSet& result,
|
||||
const vtkm::cont::Field& field)
|
||||
{
|
||||
if (field.IsFieldPoint())
|
||||
if (field.IsFieldPoint() || field.IsFieldGlobal())
|
||||
{
|
||||
//we copy the input handle to the result dataset, reusing the metadata
|
||||
result.AddField(field);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (field.IsFieldCell())
|
||||
else if (field.IsFieldCell())
|
||||
{
|
||||
return vtkm::filter::MapFieldPermutation(field, this->Worklet.GetValidCellIds(), result);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
VTKM_FILTER_INSTANTIATE_EXECUTE_METHOD(Threshold);
|
||||
|
@ -206,10 +206,17 @@ inline VTKM_CONT bool ThresholdPoints::MapFieldOntoOutput(
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
else if (field.IsFieldGlobal())
|
||||
{
|
||||
result.AddField(field);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// cell data does not apply
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -90,23 +90,29 @@ inline VTKM_CONT bool Triangulate::MapFieldOntoOutput(vtkm::cont::DataSet& resul
|
||||
const vtkm::cont::Field& field,
|
||||
vtkm::filter::PolicyBase<DerivedPolicy>)
|
||||
{
|
||||
// point data is copied as is because it was not collapsed
|
||||
if (field.IsFieldPoint())
|
||||
{
|
||||
// point data is copied as is because it was not collapsed
|
||||
result.AddField(field);
|
||||
return true;
|
||||
}
|
||||
|
||||
// cell data must be scattered to the cells created per input cell
|
||||
if (field.IsFieldCell())
|
||||
else if (field.IsFieldCell())
|
||||
{
|
||||
// cell data must be scattered to the cells created per input cell
|
||||
vtkm::cont::ArrayHandle<vtkm::Id> permutation =
|
||||
this->Worklet.GetOutCellScatter().GetOutputToInputMap();
|
||||
return vtkm::filter::MapFieldPermutation(field, permutation, result);
|
||||
}
|
||||
|
||||
else if (field.IsFieldGlobal())
|
||||
{
|
||||
result.AddField(field);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -64,15 +64,21 @@ inline VTKM_CONT bool Tube::MapFieldOntoOutput(vtkm::cont::DataSet& result,
|
||||
return vtkm::filter::MapFieldPermutation(
|
||||
field, this->Worklet.GetOutputPointSourceIndex(), result);
|
||||
}
|
||||
|
||||
if (field.IsFieldCell())
|
||||
else if (field.IsFieldCell())
|
||||
{
|
||||
return vtkm::filter::MapFieldPermutation(
|
||||
field, this->Worklet.GetOutputCellSourceIndex(), result);
|
||||
}
|
||||
|
||||
else if (field.IsFieldGlobal())
|
||||
{
|
||||
result.AddField(field);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace vtkm::filter
|
||||
#endif
|
||||
|
@ -56,14 +56,20 @@ inline VTKM_CONT bool VertexClustering::MapFieldOntoOutput(vtkm::cont::DataSet&
|
||||
{
|
||||
return vtkm::filter::MapFieldPermutation(field, this->Worklet.GetPointIdMap(), result);
|
||||
}
|
||||
|
||||
if (field.IsFieldCell())
|
||||
else if (field.IsFieldCell())
|
||||
{
|
||||
return vtkm::filter::MapFieldPermutation(field, this->Worklet.GetCellIdMap(), result);
|
||||
}
|
||||
|
||||
else if (field.IsFieldGlobal())
|
||||
{
|
||||
result.AddField(field);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user