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

Method GetComponent

Testing/GenericBridge/vtkBridgeAttribute.cxx:316–349  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Description: Put component `i' of the attribute at all points of cell `c' in `values'. \pre valid_component: (i>=0) && (i IsAtEnd() \pre values_exist: values!=0 \pre valid_values: sizeof(values)>=c->GetCell()->GetNumberOfPoints()

Source from the content-addressed store, hash-verified

314// \pre values_exist: values!=0
315// \pre valid_values: sizeof(values)>=c->GetCell()->GetNumberOfPoints()
316void vtkBridgeAttribute::GetComponent(int i, vtkGenericCellIterator* c, double* values)
317{
318 assert("pre: c_exists" && c != nullptr);
319 assert("pre: c_valid" && !c->IsAtEnd());
320
321 int j;
322 int size;
323 vtkBridgeCellIterator* c2 = static_cast<vtkBridgeCellIterator*>(c);
324
325 if (this->Pd != nullptr)
326 {
327 j = 0;
328 size = c2->GetCell()->GetNumberOfPoints();
329 while (j < size)
330 {
331 vtkIdType id = static_cast<vtkBridgeCell*>(c2->GetCell())->Cell->GetPointId(j);
332 values[j] = this->Data->GetArray(this->AttributeNumber)->GetComponent(id, i);
333 ++j;
334 }
335 }
336 else
337 {
338 values[0] =
339 this->Data->GetArray(this->AttributeNumber)->GetComponent(c2->GetCell()->GetId(), i);
340 // duplicate:
341 size = c2->GetCell()->GetNumberOfPoints();
342 j = 1;
343 while (j < size)
344 {
345 values[j] = values[0];
346 ++j;
347 }
348 }
349}
350
351//------------------------------------------------------------------------------
352// Description:

Callers

nothing calls this directly

Calls 7

assertFunction · 0.50
IsAtEndMethod · 0.45
GetNumberOfPointsMethod · 0.45
GetCellMethod · 0.45
GetPointIdMethod · 0.45
GetArrayMethod · 0.45
GetIdMethod · 0.45

Tested by

no test coverage detected