//============================================================================ // Copyright (c) Kitware, Inc. // All rights reserved. // See LICENSE.txt for details. // // This software is distributed WITHOUT ANY WARRANTY; without even // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. See the above copyright notice for more information. //============================================================================ #include #include #include #include #include namespace vtkm { namespace filter { //---------------------------------------------------------------------------- template inline VTKM_CONT FilterDataSet::FilterDataSet() : CellSetIndex(0) , CoordinateSystemIndex(0) { } //---------------------------------------------------------------------------- template inline VTKM_CONT FilterDataSet::~FilterDataSet() { } //----------------------------------------------------------------------------- template template inline VTKM_CONT vtkm::cont::DataSet FilterDataSet::PrepareForExecution( const vtkm::cont::DataSet& input, const vtkm::filter::PolicyBase& policy) { return (static_cast(this))->DoExecute(input, policy); } //----------------------------------------------------------------------------- template template inline VTKM_CONT bool FilterDataSet::MapFieldOntoOutput( vtkm::cont::DataSet& result, const vtkm::cont::Field& field, const vtkm::filter::PolicyBase& policy) { bool valid = false; vtkm::filter::FieldMetadata metaData(field); using FunctorType = internal::ResolveFieldTypeAndMap; FunctorType functor(static_cast(this), result, metaData, policy, valid); using Traits = vtkm::filter::FilterTraits; vtkm::cont::CastAndCall(vtkm::filter::ApplyPolicy(field, policy, Traits()), functor); //the bool valid will be modified by the map algorithm to hold if the //mapping occurred or not. If the mapping was good a new field has been //added to the result that was passed in. return valid; } } }