3#ifndef HDFTestUtilities_h
4#define HDFTestUtilities_h
33 this->Descriptors = descriptors;
35 void SetMasks(
const std::vector<std::string>& masks) { this->Masks = masks; }
38 this->Dimensions = dimensions;
59 std::vector<double> timeSteps(this->Descriptors.size());
60 std::iota(timeSteps.begin(), timeSteps.end(), 0);
61 double timeRange[2] = { timeSteps.front(), timeSteps.back() };
63 static_cast<int>(timeSteps.size()));
65 static_cast<int>(
sizeof(timeRange) /
sizeof(timeRange[0])));
73 intSource->SetDimensions(3, 3, 2);
74 intSource->SetBranchFactor(2);
75 intSource->SetMaxDepth(4);
76 intSource->SetUseMask(!this->Masks.empty());
77 intSource->SetDimensions(this->Dimensions.data());
78 intSource->SetBranchFactor(BranchFactor);
79 if (intSource->GetUseMask())
81 intSource->SetMask(this->Masks.at(
static_cast<int>(this->RequestedTime)).c_str());
84 intSource->SetDescriptor(this->Descriptors.at(
static_cast<int>(this->RequestedTime)).c_str());
108 if (outInfo->
Has(vtkSDDP::UPDATE_PIECE_NUMBER()))
110 intSource->UpdatePiece(outInfo->
Get(vtkSDDP::UPDATE_PIECE_NUMBER()),
111 outInfo->
Get(vtkSDDP::UPDATE_NUMBER_OF_PIECES()), 0);
118 output->ShallowCopy(intSource->GetOutputDataObject(0));
127 std::vector<std::string> Descriptors;
128 std::vector<std::string> Masks;
129 std::array<unsigned int, 3> Dimensions;
130 unsigned int BranchFactor = 2;
132 double RequestedTime = 0.0;
Custom source to generate time-dependent HTG.
vtkHTGChangingDescriptorSource()
static vtkHTGChangingDescriptorSource * New()
void SetDimensions(const std::array< unsigned int, 3 > &dimensions)
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *outputVector) override
void SetMasks(const std::vector< std::string > &masks)
int ProcessTrees(vtkHyperTreeGrid *, vtkDataObject *) override
Main routine to process individual trees in the grid This is pure virtual method to be implemented by...
void SetBranchFactor(const unsigned int bf)
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *outputVector) override
This is called by the superclass.
void SetDescriptors(const std::vector< std::string > &descriptors)
int FillOutputPortInformation(int, vtkInformation *info) override
Fill the output port information objects for this algorithm.
virtual void SetNumberOfOutputPorts(int n)
Set the number of output ports provided by the algorithm.
virtual void SetNumberOfInputPorts(int n)
Set the number of input ports used by the algorithm.
general representation of visualization data
vtkHyperTreeGridAlgorithm()
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
static vtkHyperTreeGrid * SafeDownCast(vtkObjectBase *o)
Allocate and hold a VTK object.
Executive supporting partial updates.