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

Method SetDataSet

Testing/GenericBridge/vtkBridgeDataSet.cxx:81–121  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Description: Set the dataset that will be manipulated through the adaptor interface. \pre ds_exists: ds!=0

Source from the content-addressed store, hash-verified

79// Set the dataset that will be manipulated through the adaptor interface.
80// \pre ds_exists: ds!=0
81void vtkBridgeDataSet::SetDataSet(vtkDataSet* ds)
82{
83 int i;
84 int c;
85 vtkPointData* pd;
86 vtkCellData* cd;
87 vtkBridgeAttribute* a;
88
89 vtkSetObjectBodyMacro(Implementation, vtkDataSet, ds);
90 // refresh the attribute collection
91 this->Attributes->Reset();
92 if (ds != nullptr)
93 {
94 // point data
95 pd = ds->GetPointData();
96 c = pd->GetNumberOfArrays();
97 i = 0;
98 while (i < c)
99 {
100 a = vtkBridgeAttribute::New();
101 a->InitWithPointData(pd, i);
102 this->Attributes->InsertNextAttribute(a);
103 a->Delete();
104 ++i;
105 }
106 // same thing for cell data.
107 cd = ds->GetCellData();
108 c = cd->GetNumberOfArrays();
109 i = 0;
110 while (i < c)
111 {
112 a = vtkBridgeAttribute::New();
113 a->InitWithCellData(cd, i);
114 this->Attributes->InsertNextAttribute(a);
115 a->Delete();
116 ++i;
117 }
118 this->Tessellator->Initialize(this);
119 }
120 this->Modified();
121}
122
123//------------------------------------------------------------------------------
124// Description:

Callers 1

DataSetPointMapperMethod · 0.45

Calls 11

InitWithPointDataMethod · 0.80
InsertNextAttributeMethod · 0.80
InitWithCellDataMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
ResetMethod · 0.45
GetPointDataMethod · 0.45
GetNumberOfArraysMethod · 0.45
GetCellDataMethod · 0.45
InitializeMethod · 0.45
ModifiedMethod · 0.45

Tested by 1

DataSetPointMapperMethod · 0.36