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

Method Clip

Common/DataModel/vtkGenericAdaptorCell.cxx:452–650  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

450
451//------------------------------------------------------------------------------
452void vtkGenericAdaptorCell::Clip(double value, vtkImplicitFunction* f,
453 vtkGenericAttributeCollection* attributes, vtkGenericCellTessellator* tess, int insideOut,
454 vtkIncrementalPointLocator* locator, vtkCellArray* connectivity, vtkPointData* outPd,
455 vtkCellData* outCd, vtkPointData* internalPd, vtkPointData* secondaryPd, vtkCellData* secondaryCd)
456{
457 assert("pre: attributes_exist" && attributes != nullptr);
458 assert("pre: tessellator_exists" && tess != nullptr);
459 assert("pre: locator_exists" && locator != nullptr);
460 assert("pre: connectivity_exist" && connectivity != nullptr);
461 assert("pre: internalPd_exists" && internalPd != nullptr);
462 assert("pre: secondaryPd_exists" && secondaryPd != nullptr);
463 assert("pre: secondaryCd_exists" && secondaryCd != nullptr);
464
465 int i;
466 int j;
467 int c;
468 double contVal = -1000;
469 double* values;
470
471 vtkCell* linearCell = nullptr;
472 vtkIdType ptsCount = 0;
473
474 this->Reset();
475
476 // for each cell-centered attribute: copy the value in the secondary
477 // cell data.
478 secondaryCd->Reset();
479 int attrib = 0;
480 while (attrib < attributes->GetNumberOfAttributes())
481 {
482 if (attributes->GetAttribute(attrib)->GetCentering() == vtkCellCentered)
483 {
484 vtkDataArray* array = secondaryCd->GetArray(attributes->GetAttribute(attrib)->GetName());
485 values = attributes->GetAttribute(attrib)->GetTuple(this);
486 array->InsertNextTuple(values);
487 }
488 attrib++;
489 }
490
491 int attribute = this->GetHighestOrderAttribute(attributes);
492 if (this->IsGeometryLinear() &&
493 (attribute == -1 || this->IsAttributeLinear(attributes->GetAttribute(attribute))))
494 {
495 // linear case
496 switch (this->GetType())
497 {
498 case VTK_HIGHER_ORDER_TRIANGLE:
499 linearCell = this->Triangle;
500 ptsCount = 3;
501 break;
502 case VTK_HIGHER_ORDER_QUAD:
503 linearCell = this->Quad;
504 ptsCount = 4;
505 break;
506 case VTK_HIGHER_ORDER_TETRAHEDRON:
507 linearCell = this->Tetra;
508 ptsCount = 4;
509 break;

Callers

nothing calls this directly

Calls 15

ResetMethod · 0.95
IsGeometryLinearMethod · 0.95
IsAttributeLinearMethod · 0.95
AllocateTuplesMethod · 0.95
GetCenteringMethod · 0.80
FunctionValueMethod · 0.80
SetTuple1Method · 0.80
assertFunction · 0.50
GetNumberOfAttributesMethod · 0.45
GetAttributeMethod · 0.45

Tested by

no test coverage detected