MCPcopy Create free account
hub / github.com/Kitware/VTK / RequestData

Method RequestData

Filters/Sources/vtkUniformHyperTreeGridSource.cxx:35–188  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

33
34//------------------------------------------------------------------------------
35int vtkUniformHyperTreeGridSource::RequestData(
36 vtkInformation*, vtkInformationVector**, vtkInformationVector* outputVector)
37{
38 // Retrieve the output
39 vtkDataObject* outputDO = vtkDataObject::GetData(outputVector, 0);
40 vtkUniformHyperTreeGrid* output = vtkUniformHyperTreeGrid::SafeDownCast(outputDO);
41 if (!output)
42 {
43 vtkErrorMacro("pre: output_not_uniformHyperTreeGrid: " << outputDO->GetClassName());
44 return 0;
45 }
46
47 output->Initialize();
48
49 vtkCellData* outData = output->GetCellData();
50
51 this->LevelBitsIndexCnt.clear();
52 this->LevelBitsIndexCnt.push_back(0);
53
54 // When using descriptor-based definition, initialize descriptor parsing
55 if (this->UseDescriptor)
56 {
57 // Calculate refined block size
58 this->BlockSize = this->BranchFactor;
59 for (unsigned int i = 1; i < this->Dimension; ++i)
60 {
61 this->BlockSize *= this->BranchFactor;
62 }
63
64 if (!this->DescriptorBits && !this->InitializeFromStringDescriptor())
65 {
66 return 0;
67 }
68 else if (this->DescriptorBits && !this->InitializeFromBitsDescriptor())
69 {
70 return 0;
71 }
72 } // if this->UseDescriptor
73
74 // Set straightforward grid parameters
75 output->SetTransposedRootIndexing(this->TransposedRootIndexing);
76 output->SetBranchFactor(this->BranchFactor);
77
78 // Set parameters that depend on dimension
79 switch (this->Dimension)
80 {
81 case 1:
82 {
83 // Set 1D grid size depending on orientation
84 unsigned int axis = this->Orientation;
85 unsigned int gs[] = { 1, 1, 1 };
86 unsigned n = this->Dimensions[axis];
87 gs[axis] = n;
88 output->SetDimensions(gs);
89
90 // Assign coordinates
91 switch (axis)
92 {

Callers

nothing calls this directly

Calls 15

SetBranchFactorMethod · 0.80
SetGridScaleMethod · 0.80
SetScalarsMethod · 0.80
SetVectorsMethod · 0.80
GetDataFunction · 0.50
GetClassNameMethod · 0.45
InitializeMethod · 0.45
GetCellDataMethod · 0.45
clearMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected