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

Method Initialize

Filters/CellGrid/vtkCellGridSampleQuery.cxx:29–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29bool vtkCellGridSampleQuery::Initialize()
30{
31 this->Superclass::Initialize();
32
33 this->OutputOffsets.clear();
34 this->AttributeMap.clear();
35 this->MaximumParametricDimension = 0;
36 this->SourceCellId = nullptr;
37 this->SourceCellType = nullptr;
38 this->SourceCellSite = nullptr;
39 if (!this->Input || !this->Output)
40 {
41 return false;
42 }
43
44 if (this->IncludeSourceCellInfo)
45 {
46 this->SourceCellType =
47 vtkTypeUInt32Array::SafeDownCast(this->Output->GetColumnByName("SourceCellType"));
48 if (!this->SourceCellType)
49 {
50 this->SourceCellType = vtkSmartPointer<vtkTypeUInt32Array>::New();
51 this->SourceCellType->SetName("SourceCellType");
52 this->Output->AddColumn(this->SourceCellType);
53 }
54
55 this->SourceCellId =
56 vtkIdTypeArray::SafeDownCast(this->Output->GetColumnByName("vtkOriginalCellIds"));
57 if (!this->SourceCellId)
58 {
59 this->SourceCellId = vtkSmartPointer<vtkIdTypeArray>::New();
60 this->SourceCellType->SetName("vtkOriginalCellIds");
61 this->Output->AddColumn(this->SourceCellId);
62 }
63 }
64
65 if (this->IncludeSourceCellSite)
66 {
67 this->SourceCellSite =
68 vtkDataArray::SafeDownCast(this->Output->GetColumnByName("SourceCellSite"));
69 if (!this->SourceCellSite)
70 {
71 this->SourceCellSite = vtkSmartPointer<vtkDoubleArray>::New();
72 this->SourceCellSite->SetName("SourceCellSite");
73 this->Output->AddColumn(this->SourceCellSite);
74 }
75 }
76
77 for (const auto& inputAtt : this->Input->GetCellAttributeList())
78 {
79 vtkNew<vtkDoubleArray> outputCol;
80 outputCol->SetNumberOfComponents(inputAtt->GetNumberOfComponents());
81 outputCol->SetName(inputAtt->GetName().Data().c_str());
82 this->Output->AddColumn(outputCol);
83 this->AttributeMap[inputAtt] = outputCol;
84 }
85
86 return true;

Callers

nothing calls this directly

Calls 11

GetColumnByNameMethod · 0.80
GetCellAttributeListMethod · 0.80
NewFunction · 0.50
clearMethod · 0.45
SetNameMethod · 0.45
AddColumnMethod · 0.45
SetNumberOfComponentsMethod · 0.45
GetNumberOfComponentsMethod · 0.45
c_strMethod · 0.45
DataMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected