1 /*=========================================================================
2 
3   Program:   Visualization Toolkit
4   Module:    vtkValueSelector.cxx
5 
6   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7   All rights reserved.
8   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10      This software is distributed WITHOUT ANY WARRANTY; without even
11      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12      PURPOSE.  See the above copyright notice for more information.
13 
14 =========================================================================*/
15 #include "vtkValueSelector.h"
16 
17 #include "vtkArrayDispatch.h"
18 #include "vtkAssume.h"
19 #include "vtkDataArrayAccessor.h"
20 #include "vtkDataObject.h"
21 #include "vtkDataSetAttributes.h"
22 #include "vtkInformation.h"
23 #include "vtkObjectFactory.h"
24 #include "vtkSMPTools.h"
25 #include "vtkSelectionNode.h"
26 #include "vtkSignedCharArray.h"
27 #include "vtkSortDataArray.h"
28 #include "vtkStringArray.h"
29 
30 #include <cassert>
31 #include <type_traits>
32 namespace
33 {
34 
35 struct ThresholdSelectionListReshaper
36 {
37 protected:
38   vtkDataArray* FixedArray;
39 public:
ThresholdSelectionListReshaper__anondc9630720111::ThresholdSelectionListReshaper40   ThresholdSelectionListReshaper(vtkDataArray* toFill)
41     : FixedArray(toFill)
42   {
43   }
44   // If the input selection list for a threshold has one component we need
45   // to reshape it into an array with two component tuples (ranges) so it
46   // is interpreted correctly later.
47   template<typename SelectionListArrayType>
operator ()__anondc9630720111::ThresholdSelectionListReshaper48   void operator()(SelectionListArrayType* originalList)
49   {
50     // created with NewInstance from the originalList, we know it is the same type
51     auto fixedList = SelectionListArrayType::FastDownCast(this->FixedArray);
52     assert(originalList->GetNumberOfComponents() == 1);
53     assert(fixedList->GetNumberOfComponents() == 2);
54 
55     vtkDataArrayAccessor<SelectionListArrayType> originalAccessor(originalList);
56     vtkDataArrayAccessor<SelectionListArrayType> fixedAccessor(fixedList);
57 
58     for (vtkIdType i = 0; i < fixedList->GetNumberOfTuples(); ++i)
59     {
60       fixedAccessor.Set(i, 0, originalAccessor.Get(2 * i, 0));
61       fixedAccessor.Set(i, 1, originalAccessor.Get(2 * i + 1, 0));
62     }
63   }
64 };
65 
66 //----------------------------------------------------------------------------
67 // This is used for the cases where the SelectionList is a 1-component array,
68 // implying that the values are exact matches.
69 struct ArrayValueMatchFunctor
70 {
71   vtkSignedCharArray* InsidednessArray;
72   int ComponentNo;
73 
ArrayValueMatchFunctor__anondc9630720111::ArrayValueMatchFunctor74   ArrayValueMatchFunctor(vtkSignedCharArray* insidednessArray, int comp)
75     : InsidednessArray(insidednessArray)
76     , ComponentNo(comp)
77   {
78   }
79 
80   // this is used for selecting entries where the field array has matching
81   // values.
82   template <typename InputArrayType, typename SelectionListArrayType>
operator ()__anondc9630720111::ArrayValueMatchFunctor83   void operator()(InputArrayType* fArray, SelectionListArrayType* selList)
84   {
85     assert(selList->GetNumberOfComponents() == 1);
86     assert(fArray->GetNumberOfComponents() > this->ComponentNo);
87 
88     using ValueType = typename vtkDataArrayAccessor<SelectionListArrayType>::APIType;
89     vtkDataArrayAccessor<InputArrayType> faccessor(fArray);
90 
91     static_assert(std::is_same<ValueType,
92                     typename vtkDataArrayAccessor<SelectionListArrayType>::APIType>::value,
93       "value types mismatched!");
94 
95     const ValueType* haystack_begin = selList->GetPointer(0);
96     const ValueType* haystack_end = haystack_begin + selList->GetNumberOfValues();
97     const int comp = fArray->GetNumberOfComponents() == 1 ? 0 : this->ComponentNo;
98 
99     vtkSignedCharArray* insidednessArray = this->InsidednessArray;
100     assert(insidednessArray->GetNumberOfTuples() == fArray->GetNumberOfTuples());
101     if (comp >= 0)
102     {
103       vtkSMPTools::For(0, fArray->GetNumberOfTuples(), [=](vtkIdType begin, vtkIdType end) {
104         for (vtkIdType cc = begin; cc < end; ++cc)
105         {
106           auto val = faccessor.Get(cc, comp);
107           insidednessArray->SetValue(
108             cc, std::binary_search(haystack_begin, haystack_end, val) ? 1 : 0);
109         }
110       });
111     }
112     else
113     {
114       const int num_components = fArray->GetNumberOfComponents();
115 
116       // compare vector magnitude.
117       vtkSMPTools::For(0, fArray->GetNumberOfTuples(), [=](vtkIdType begin, vtkIdType end) {
118         for (vtkIdType cc = begin; cc < end; ++cc)
119         {
120           ValueType val = ValueType(0);
121           for (int kk = 0; kk < num_components; ++kk)
122           {
123             const auto valKK = faccessor.Get(cc, comp);
124             val += valKK * valKK;
125           }
126           const auto magnitude = static_cast<ValueType>(std::sqrt(val));
127           insidednessArray->SetValue(
128             cc, std::binary_search(haystack_begin, haystack_end, magnitude) ? 1 : 0);
129         }
130       });
131     }
132   }
133 
134   // this is used to select indices
135   template <typename SelectionListArrayType>
operator ()__anondc9630720111::ArrayValueMatchFunctor136   void operator()(SelectionListArrayType* selList)
137   {
138     assert(selList->GetNumberOfComponents() == 1);
139 
140     this->InsidednessArray->FillValue(0);
141 
142     const vtkIdType numDataValues = this->InsidednessArray->GetNumberOfTuples();
143     const vtkIdType numSelList = selList->GetNumberOfTuples();
144     vtkDataArrayAccessor<SelectionListArrayType> selListAccessor(selList);
145     for (vtkIdType cc = 0; cc < numSelList; ++cc)
146     {
147       auto cid = static_cast<vtkIdType>(selListAccessor.Get(cc, 0));
148       if (cid >= 0 && cid < numDataValues)
149       {
150         this->InsidednessArray->SetValue(cid, 1);
151       }
152     }
153   }
154 };
155 
156 //----------------------------------------------------------------------------
157 // This is used for the cases where the SelectionList is a 2-component array,
158 // implying that the values are ranges.
159 struct ArrayValueRangeFunctor
160 {
161   vtkSignedCharArray* InsidednessArray;
162   int ComponentNo;
163 
ArrayValueRangeFunctor__anondc9630720111::ArrayValueRangeFunctor164   ArrayValueRangeFunctor(vtkSignedCharArray* insidednessArray, int comp)
165     : InsidednessArray(insidednessArray)
166     , ComponentNo(comp)
167   {
168   }
169 
170   // for selecting using field array values
171   template <typename InputArrayType, typename SelectionListArrayType>
operator ()__anondc9630720111::ArrayValueRangeFunctor172   void operator()(InputArrayType* fArray, SelectionListArrayType* selList)
173   {
174     assert(selList->GetNumberOfComponents() == 2);
175     assert(fArray->GetNumberOfComponents() > this->ComponentNo);
176     assert(this->InsidednessArray->GetNumberOfTuples() == fArray->GetNumberOfTuples());
177 
178     using ValueType = typename vtkDataArrayAccessor<SelectionListArrayType>::APIType;
179     vtkDataArrayAccessor<InputArrayType> fAccessor(fArray);
180 
181     static_assert(std::is_same<ValueType,
182                     typename vtkDataArrayAccessor<SelectionListArrayType>::APIType>::value,
183       "value types mismatched!");
184 
185     vtkDataArrayAccessor<SelectionListArrayType> rangeAccessor(selList);
186     const int comp = fArray->GetNumberOfComponents() == 1 ? 0 : this->ComponentNo;
187     const vtkIdType numRanges = selList->GetNumberOfTuples();
188 
189     if (comp >= 0)
190     {
191       vtkSMPTools::For(0, fArray->GetNumberOfTuples(), [=](vtkIdType begin, vtkIdType end) {
192         for (vtkIdType cc = begin; cc < end; ++cc)
193         {
194           const auto val = fAccessor.Get(cc, comp);
195           bool match = false;
196           for (vtkIdType r = 0; r < numRanges && !match; ++r)
197           {
198             match = (val >= rangeAccessor.Get(r, 0) && val <= rangeAccessor.Get(r, 1));
199           }
200           this->InsidednessArray->SetValue(cc, match ? 1 : 0);
201         }
202       });
203     }
204     else
205     {
206       const int num_components = fArray->GetNumberOfComponents();
207 
208       // compare vector magnitude.
209       vtkSMPTools::For(0, fArray->GetNumberOfTuples(), [=](vtkIdType begin, vtkIdType end) {
210         for (vtkIdType cc = begin; cc < end; ++cc)
211         {
212           ValueType val = ValueType(0);
213           for (int kk = 0; kk < num_components; ++kk)
214           {
215             const auto valKK = fAccessor.Get(cc, comp);
216             val += valKK * valKK;
217           }
218           const auto magnitude = static_cast<ValueType>(std::sqrt(val));
219           bool match = false;
220           for (vtkIdType r = 0; r < numRanges && !match; ++r)
221           {
222             match = (magnitude >= rangeAccessor.Get(r, 0) && magnitude <= rangeAccessor.Get(r, 1));
223           }
224           this->InsidednessArray->SetValue(cc, match ? 1 : 0);
225         }
226       });
227     }
228   }
229 
230   // this is used to select indices
231   template <typename SelectionListArrayType>
operator ()__anondc9630720111::ArrayValueRangeFunctor232   void operator()(SelectionListArrayType* selList)
233   {
234     assert(selList->GetNumberOfComponents() == 2);
235 
236     vtkDataArrayAccessor<SelectionListArrayType> rangeAccessor(selList);
237 
238     const vtkIdType numValues = this->InsidednessArray->GetNumberOfTuples();
239     const vtkIdType numRanges = selList->GetNumberOfTuples();
240 
241     this->InsidednessArray->FillValue(0);
242     for (vtkIdType cc = 0; cc < numRanges; ++cc)
243     {
244       vtkIdType start = std::min(static_cast<vtkIdType>(rangeAccessor.Get(cc, 0)), numValues - 1);
245       vtkIdType last = std::min(static_cast<vtkIdType>(rangeAccessor.Get(cc, 1)), numValues - 1);
246       if (start >= 0 && last >= start)
247       {
248         std::fill_n(this->InsidednessArray->GetPointer(start), (start - last) + 1, 1);
249       }
250     }
251   }
252 };
253 }
254 
255 //----------------------------------------------------------------------------
256 class vtkValueSelector::vtkInternals
257 {
258   vtkSmartPointer<vtkAbstractArray> SelectionList;
259   std::string FieldName;
260   int FieldAssociation;
261   int FieldAttributeType;
262   int ComponentNo;
263 
264 public:
265   // use this constructor when selection is specified as (assoc, name)
vtkInternals(vtkAbstractArray * selectionList,int fieldAssociation,const std::string & fieldName,int component)266   vtkInternals(vtkAbstractArray* selectionList, int fieldAssociation, const std::string& fieldName, int component)
267     : vtkInternals(selectionList, fieldName, fieldAssociation, -1, component)
268   {
269 
270   }
271 
272   // use this constructor when selection is specified as (assoc, attribute type)
vtkInternals(vtkAbstractArray * selectionList,int fieldAssociation,int attributeType,int component)273   vtkInternals(vtkAbstractArray* selectionList, int fieldAssociation, int attributeType, int component)
274     : vtkInternals(selectionList, "", fieldAssociation, attributeType, component)
275   {
276     if (attributeType < 0 || attributeType >= vtkDataSetAttributes::NUM_ATTRIBUTES)
277     {
278       throw std::runtime_error("unsupported attribute type");
279     }
280   }
281 
282   // use this constructor when selection is for ids of element type = assoc.
vtkInternals(vtkAbstractArray * selectionList,int fieldAssociation)283   vtkInternals(vtkAbstractArray* selectionList, int fieldAssociation)
284     : vtkInternals(selectionList, "", fieldAssociation, -1, 0)
285   {
286   }
287 
288   // returns false on any failure or unhandled case.
289   bool Execute(vtkDataObject* dobj, vtkSignedCharArray* darray);
290 
291 private:
vtkInternals(vtkAbstractArray * selectionList,const std::string & fieldName,int fieldAssociation,int attributeType,int component)292   vtkInternals(vtkAbstractArray* selectionList,
293     const std::string& fieldName,
294     int fieldAssociation,
295     int attributeType,
296     int component)
297     : SelectionList(selectionList)
298     , FieldName(fieldName)
299     , FieldAssociation(fieldAssociation)
300     , FieldAttributeType(attributeType)
301     , ComponentNo(component)
302   {
303     if (fieldAssociation < 0 || fieldAssociation >= vtkDataObject::NUMBER_OF_ASSOCIATIONS ||
304       fieldAssociation == vtkDataObject::FIELD_ASSOCIATION_POINTS_THEN_CELLS)
305     {
306       throw std::runtime_error("unsupported field association");
307     }
308 
309     if (selectionList->GetNumberOfComponents() != 1 && selectionList->GetNumberOfComponents() != 2)
310     {
311       // 1-component == exact value match
312       // 2-component == values in range specified by each tuple.
313       throw std::runtime_error("Currently, selecting multi-components arrays is not supported.");
314     }
315 
316     if (selectionList->GetNumberOfComponents() == 1)
317     {
318       // we sort the selection list to speed up extraction later.
319       this->SelectionList.TakeReference(selectionList->NewInstance());
320       this->SelectionList->DeepCopy(selectionList);
321       vtkSortDataArray::Sort(this->SelectionList);
322     }
323     else
324     {
325       // don't bother sorting.
326       this->SelectionList = selectionList;
327     }
328   }
329 
Execute(vtkAbstractArray * darray,vtkSignedCharArray * insidednessArray)330   bool Execute(vtkAbstractArray* darray, vtkSignedCharArray* insidednessArray)
331   {
332     if (auto dataArray = vtkDataArray::SafeDownCast(darray))
333     {
334       return this->Execute(dataArray, insidednessArray);
335     }
336     else if (darray)
337     {
338       // classes like vtkStringArray may be added later, if needed.
339       vtkGenericWarningMacro(<< darray->GetClassName() << " not supported by vtkValueSelector.");
340       return false;
341     }
342     else
343     {
344       // missing array, this can happen.
345       return false;
346     }
347   }
348 
Execute(vtkDataArray * darray,vtkSignedCharArray * insidednessArray)349   bool Execute(vtkDataArray* darray, vtkSignedCharArray* insidednessArray)
350   {
351     assert(vtkDataArray::SafeDownCast(this->SelectionList));
352     if (darray->GetNumberOfComponents() < this->ComponentNo)
353     {
354       // array doesn't have request components. nothing to select.
355       return false;
356     }
357 
358     if (this->SelectionList->GetNumberOfComponents() == 1)
359     {
360       ArrayValueMatchFunctor worker(insidednessArray, this->ComponentNo);
361       if (!vtkArrayDispatch::Dispatch2BySameValueType<vtkArrayDispatch::AllTypes>::Execute(
362             darray, vtkDataArray::SafeDownCast(this->SelectionList), worker))
363       {
364         // should we use slow data array API?
365         vtkGenericWarningMacro("Type mismatch in selection list ("
366           << this->SelectionList->GetClassName() << ") and field array ("
367           << darray->GetClassName() << ").");
368         return false;
369       }
370     }
371     else
372     {
373       ArrayValueRangeFunctor worker(insidednessArray, this->ComponentNo);
374       if (!vtkArrayDispatch::Dispatch2BySameValueType<vtkArrayDispatch::AllTypes>::Execute(
375             darray, vtkDataArray::SafeDownCast(this->SelectionList), worker))
376       {
377         // Use the slow data array API for threshold-based selection. Thresholds
378         // are assumed to be stored in a vtkDoubleArray, which may very well not be the
379         // same as the data array type.
380         vtkDataArray* selList = vtkDataArray::SafeDownCast(this->SelectionList);
381         const int comp = darray->GetNumberOfComponents() == 1 ? 0 : this->ComponentNo;
382         const vtkIdType numRanges = selList->GetNumberOfTuples();
383 
384         if (comp >= 0)
385         {
386           vtkSMPTools::For(0, darray->GetNumberOfTuples(), [=](vtkIdType begin, vtkIdType end) {
387             for (vtkIdType cc = begin; cc < end; ++cc)
388             {
389               const auto val = darray->GetComponent(cc, comp);
390               bool match = false;
391               for (vtkIdType r = 0; r < numRanges && !match; ++r)
392               {
393                 match = (val >= selList->GetComponent(r, 0) &&
394                   val <= selList->GetComponent(r, 1));
395               }
396               insidednessArray->SetValue(cc, match ? 1 : 0);
397             }
398           });
399         }
400         else
401         {
402           const int num_components = darray->GetNumberOfComponents();
403 
404           // compare vector magnitude.
405           vtkSMPTools::For(0, darray->GetNumberOfTuples(), [=](vtkIdType begin, vtkIdType end) {
406             for (vtkIdType cc = begin; cc < end; ++cc)
407             {
408               double val = double(0);
409               for (int kk = 0; kk < num_components; ++kk)
410               {
411                 const auto valKK = darray->GetComponent(cc, comp);
412                 val += valKK * valKK;
413               }
414               const auto magnitude = std::sqrt(val);
415               bool match = false;
416               for (vtkIdType r = 0; r < numRanges && !match; ++r)
417               {
418                 match = (magnitude >= selList->GetComponent(r, 0) &&
419                   magnitude <= selList->GetComponent(r, 1));
420               }
421               insidednessArray->SetValue(cc, match ? 1 : 0);
422             }
423           });
424         }
425       }
426     }
427 
428     insidednessArray->Modified();
429     return true;
430   }
431 
432   // this is used for when selecting elements by ids
Execute(vtkSignedCharArray * insidednessArray)433   bool Execute(vtkSignedCharArray* insidednessArray)
434   {
435     assert(vtkDataArray::SafeDownCast(this->SelectionList));
436 
437     if (this->SelectionList->GetNumberOfComponents() == 1)
438     {
439       ArrayValueMatchFunctor worker(insidednessArray, 0);
440       if (!vtkArrayDispatch::DispatchByValueType<vtkArrayDispatch::Integrals>::Execute(
441             vtkDataArray::SafeDownCast(this->SelectionList), worker))
442       {
443         // should we use slow data array API?
444         vtkGenericWarningMacro("Unsupported selection list array type ("
445           << this->SelectionList->GetClassName() << ").");
446         return false;
447       }
448     }
449     else
450     {
451       ArrayValueRangeFunctor worker(insidednessArray, 0);
452       if (!vtkArrayDispatch::DispatchByValueType<vtkArrayDispatch::Integrals>::Execute(
453             vtkDataArray::SafeDownCast(this->SelectionList), worker))
454       {
455         // should we use slow data array API?
456         vtkGenericWarningMacro("Unsupported selection list array type ("
457           << this->SelectionList->GetClassName() << ").");
458         return false;
459       }
460     }
461     insidednessArray->Modified();
462     return true;
463   }
464 };
465 
466 //----------------------------------------------------------------------------
Execute(vtkDataObject * dobj,vtkSignedCharArray * insidednessArray)467 bool vtkValueSelector::vtkInternals::Execute(
468   vtkDataObject* dobj, vtkSignedCharArray* insidednessArray)
469 {
470   if (this->FieldAssociation != -1 && !this->FieldName.empty())
471   {
472     auto* dsa = dobj->GetAttributesAsFieldData(this->FieldAssociation);
473     return dsa ? this->Execute(dsa->GetAbstractArray(this->FieldName.c_str()), insidednessArray)
474                : false;
475   }
476   else if (this->FieldAssociation != -1 && this->FieldAttributeType != -1)
477   {
478     auto* dsa = dobj->GetAttributes(this->FieldAssociation);
479     return dsa ? this->Execute(dsa->GetAbstractAttribute(this->FieldAttributeType), insidednessArray)
480                : false;
481   }
482   else if (this->FieldAssociation != -1)
483   {
484     return this->Execute(insidednessArray);
485   }
486   return false;
487 }
488 
489 //============================================================================
490 vtkStandardNewMacro(vtkValueSelector);
491 //----------------------------------------------------------------------------
vtkValueSelector()492 vtkValueSelector::vtkValueSelector()
493   : Internals(nullptr)
494 {
495 }
496 
497 //----------------------------------------------------------------------------
~vtkValueSelector()498 vtkValueSelector::~vtkValueSelector()
499 {
500 }
501 
502 //----------------------------------------------------------------------------
Initialize(vtkSelectionNode * node,const std::string & insidednessArrayName)503 void vtkValueSelector::Initialize(vtkSelectionNode* node, const std::string& insidednessArrayName)
504 {
505   assert(node);
506 
507   this->Superclass::Initialize(node, insidednessArrayName);
508 
509   this->Internals.reset();
510 
511   try
512   {
513     vtkSmartPointer<vtkAbstractArray> selectionList = node->GetSelectionList();
514     if (!selectionList || selectionList->GetNumberOfTuples() == 0)
515     {
516       // empty selection list, nothing to do.
517       return;
518     }
519 
520     auto properties = node->GetProperties();
521 
522     const int contentType = node->GetContentType();
523     const int fieldType = node->GetFieldType();
524     const int assoc = vtkSelectionNode::ConvertSelectionFieldToAttributeType(fieldType);
525     const int component_no = properties->Has(vtkSelectionNode::COMPONENT_NUMBER())
526       ? properties->Get(vtkSelectionNode::COMPONENT_NUMBER())
527       : 0;
528 
529     switch (contentType)
530     {
531       case vtkSelectionNode::GLOBALIDS:
532         this->Internals.reset(
533           new vtkInternals(selectionList, assoc, vtkDataSetAttributes::GLOBALIDS, component_no));
534         break;
535 
536       case vtkSelectionNode::PEDIGREEIDS:
537         this->Internals.reset(
538           new vtkInternals(selectionList, assoc, vtkDataSetAttributes::PEDIGREEIDS, component_no));
539         break;
540 
541       case vtkSelectionNode::THRESHOLDS:
542           if (selectionList->GetNumberOfComponents() == 1)
543           {
544 #ifndef VTK_LEGACY_SILENT
545             vtkWarningMacro("Warning: range selections should use two-component arrays to specify the"
546                 " range.  Using single component arrays with a tuple for the low and high ends of the"
547                 " range is legacy behavior and may be removed in future releases.");
548 #endif
549             auto selList = vtkDataArray::SafeDownCast(selectionList.GetPointer());
550             if (selList)
551             {
552               selectionList = vtkSmartPointer<vtkAbstractArray>::NewInstance(selList);
553               selectionList->SetNumberOfComponents(2);
554               selectionList->SetNumberOfTuples(selList->GetNumberOfTuples()/2);
555               selectionList->SetName(selList->GetName());
556 
557               ThresholdSelectionListReshaper reshaper(vtkDataArray::SafeDownCast(selectionList));
558 
559               if (!vtkArrayDispatch::Dispatch::Execute(
560                     selList, reshaper))
561               {
562                 // should never happen, we create an array with the same type
563                 vtkErrorMacro("Mismatch in selection list fixup code");
564                 break;
565               }
566             }
567           }
568           VTK_FALLTHROUGH;
569       case vtkSelectionNode::VALUES:
570         if (selectionList->GetName() == nullptr || selectionList->GetName()[0] == '\0')
571         {
572           // if selectionList has no name, we're selected scalars (this is old
573           // behavior, and we're preserving it).
574           this->Internals.reset(new vtkInternals(selectionList, assoc, vtkDataSetAttributes::SCALARS, component_no));
575         }
576         else
577         {
578           this->Internals.reset(new vtkInternals(selectionList, assoc, selectionList->GetName(), component_no));
579         }
580         break;
581 
582       case vtkSelectionNode::INDICES:
583         this->Internals.reset(new vtkInternals(selectionList, assoc));
584         break;
585 
586       default:
587         vtkErrorMacro("vtkValueSelector doesn't support content-type: " << contentType);
588         break;
589     };
590   }
591   catch (const std::runtime_error& e)
592   {
593     vtkErrorMacro(<< e.what());
594   }
595 }
596 
597 //----------------------------------------------------------------------------
Finalize()598 void vtkValueSelector::Finalize()
599 {
600   this->Internals.reset();
601 }
602 
603 //----------------------------------------------------------------------------
ComputeSelectedElementsForBlock(vtkDataObject * input,vtkSignedCharArray * insidednessArray,unsigned int vtkNotUsed (compositeIndex),unsigned int vtkNotUsed (amrLevel),unsigned int vtkNotUsed (amrIndex))604 bool vtkValueSelector::ComputeSelectedElementsForBlock(vtkDataObject* input,
605     vtkSignedCharArray* insidednessArray, unsigned int vtkNotUsed(compositeIndex),
606     unsigned int vtkNotUsed(amrLevel), unsigned int vtkNotUsed(amrIndex))
607 {
608   assert(input != nullptr && insidednessArray != nullptr);
609   return this->Internals ? this->Internals->Execute(input, insidednessArray) : false;
610 }
611 
612 //----------------------------------------------------------------------------
PrintSelf(ostream & os,vtkIndent indent)613 void vtkValueSelector::PrintSelf(ostream& os, vtkIndent indent)
614 {
615   this->Superclass::PrintSelf(os, indent);
616 }
617