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

Method ClipBoxInOut2D

Filters/General/vtkBoxClipDataSet.cxx:4364–4777  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4362//-------------------------------------------------------
4363
4364void vtkBoxClipDataSet::ClipBoxInOut2D(vtkPoints* newPoints, vtkGenericCell* cell,
4365 vtkIncrementalPointLocator* locator, vtkCellArray** tets, vtkPointData* inPD,
4366 vtkPointData** outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData** outCD)
4367{
4368 vtkIdType cellType = cell->GetCellType();
4369 vtkIdList* cellIds = cell->GetPointIds();
4370 vtkCellArray* arraytriangle = vtkCellArray::New();
4371 vtkPoints* cellPts = cell->GetPoints();
4372 vtkIdType npts = cellPts->GetNumberOfPoints();
4373 std::vector<vtkIdType> cellptId(npts);
4374 vtkIdType iid[3];
4375 const vtkIdType* v_id = nullptr;
4376 vtkIdType *verts, v1, v2;
4377 vtkIdType ptId;
4378 vtkIdType ptIdout[4];
4379 vtkIdType tab_id[3];
4380 vtkIdType ptstriangle = 3;
4381
4382 int i, j;
4383 unsigned int allInside;
4384 unsigned int cutInd;
4385 unsigned int planes;
4386 unsigned int idcellnew;
4387
4388 /* Edges Triangle */
4389 vtkIdType edges[3][2] = {
4390 { 0, 1 },
4391 { 1, 2 },
4392 { 2, 0 },
4393 };
4394 double value, deltaScalar;
4395 double t, *p1, *p2;
4396 double v[3], x[3];
4397 double v_triangle[3][3];
4398
4399 // To avoid false positive warning.
4400 tab_id[0] = 0;
4401 tab_id[1] = 0;
4402 tab_id[2] = 0;
4403
4404 for (i = 0; i < npts; i++)
4405 {
4406 cellptId[i] = cellIds->GetId(i);
4407 }
4408
4409 // Convert all 2D cells to triangle
4410 this->CellGrid(cellType, npts, cellptId.data(), arraytriangle);
4411 unsigned int totalnewtriangle = arraytriangle->GetNumberOfCells();
4412 unsigned int idtrianglenew;
4413
4414 for (idtrianglenew = 0; idtrianglenew < totalnewtriangle; idtrianglenew++)
4415 {
4416 arraytriangle->GetNextCell(ptstriangle, v_id);
4417
4418 for (allInside = 1, i = 0; i < 3; i++)
4419 {
4420 cellPts->GetPoint(v_id[i], v);
4421

Callers 1

RequestDataMethod · 0.95

Calls 15

CellGridMethod · 0.95
InterpolateEdgeMethod · 0.95
DeleteMethod · 0.65
NewFunction · 0.50
GetCellTypeMethod · 0.45
GetPointIdsMethod · 0.45
GetPointsMethod · 0.45
GetNumberOfPointsMethod · 0.45
GetIdMethod · 0.45
dataMethod · 0.45
GetNumberOfCellsMethod · 0.45
GetNextCellMethod · 0.45

Tested by

no test coverage detected