1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
|
// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
// SPDX-License-Identifier: BSD-3-Clause
/**
* @class vtkHyperTreeGridDepthLimiter
* @brief Hyper tree grid level extraction
*
*
* Extracts all levels down to a specified depth from a HyperTreeGrid
* representation.
* If the required depth is greater or equal to the maximum level of the
* input grid, then the output is identical.
*
* @sa
* vtkHyperTreeGrid vtkHyperTreeGridAlgorithm vtkUniformHyperTreeGrid
*
* @par Thanks:
* This class was written by Guenole Harel and Jacques-Bernard Lekien 2014
* This class was modified by Philippe Pebay, 2016
* This class was modified, 2018, and optimized, 2019, by Jacques-Bernard Lekien,
* by DepthLimiter directly managed by HyperTreeGrid and (super)cursors.
* This work was supported by Commissariat a l'Energie Atomique
* CEA, DAM, DIF, F-91297 Arpajon, France.
*/
#ifndef vtkHyperTreeGridDepthLimiter_h
#define vtkHyperTreeGridDepthLimiter_h
#include "vtkFiltersHyperTreeModule.h" // For export macro
#include "vtkHyperTreeGridAlgorithm.h"
VTK_ABI_NAMESPACE_BEGIN
class vtkBitArray;
class vtkHyperTreeGrid;
class vtkHyperTreeGridNonOrientedCursor;
class VTKFILTERSHYPERTREE_EXPORT vtkHyperTreeGridDepthLimiter : public vtkHyperTreeGridAlgorithm
{
public:
static vtkHyperTreeGridDepthLimiter* New();
vtkTypeMacro(vtkHyperTreeGridDepthLimiter, vtkHyperTreeGridAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent) override;
///@{
/**
* Set/Get True, create a new mask ; False, create a new vtkHyperTreeGrid (HTG)
* Actually, setting to true no longer creates a new mask
* but sets an attribute of the HTG that is used in the HTG and sliders.
* The name of this option is historical and being kept for retro-compatibility reasons.
* Default is true.
*/
vtkSetMacro(JustCreateNewMask, bool);
vtkGetMacro(JustCreateNewMask, bool);
///@}
///@{
/**
* Set/Get maximum depth to which output grid should be limited
* Default is 0.
*/
vtkSetMacro(Depth, unsigned int);
vtkGetMacro(Depth, unsigned int);
///@}
protected:
vtkHyperTreeGridDepthLimiter();
~vtkHyperTreeGridDepthLimiter() override;
/**
* For this algorithm the output is a vtkHyperTreeGrid or
* vtkUniformHyperTreeGrid instance
*/
int FillOutputPortInformation(int, vtkInformation*) override;
/**
* Main routine to extract hyper tree grid levels
*/
int ProcessTrees(vtkHyperTreeGrid*, vtkDataObject*) override;
/**
* Recursively descend into tree down to leaves
*/
void RecursivelyProcessTree(
vtkHyperTreeGridNonOrientedCursor*, vtkHyperTreeGridNonOrientedCursor*);
/**
* Maximum depth of hyper tree grid to be extracted
*/
unsigned int Depth;
/**
* Input mask
*/
vtkBitArray* InMask;
/**
* Output mask constructed by this filter
*/
vtkBitArray* OutMask;
/**
* Keep track of current index in output hyper tree grid
*/
vtkIdType CurrentId;
/**
* With or without copy
*/
bool JustCreateNewMask;
private:
vtkHyperTreeGridDepthLimiter(const vtkHyperTreeGridDepthLimiter&) = delete;
void operator=(const vtkHyperTreeGridDepthLimiter&) = delete;
};
VTK_ABI_NAMESPACE_END
#endif // vtkHyperTreeGridDepthLimiter_h
|