-------------------------------------------------------
| 4013 | |
| 4014 | //------------------------------------------------------- |
| 4015 | void vtkBoxClipDataSet::ClipBox2D(vtkPoints* newPoints, vtkGenericCell* cell, |
| 4016 | vtkIncrementalPointLocator* locator, vtkCellArray* tets, vtkPointData* inPD, vtkPointData* outPD, |
| 4017 | vtkCellData* inCD, vtkIdType cellId, vtkCellData* outCD) |
| 4018 | { |
| 4019 | vtkIdType cellType = cell->GetCellType(); |
| 4020 | vtkIdList* cellIds = cell->GetPointIds(); |
| 4021 | vtkCellArray* arraytriangle = vtkCellArray::New(); |
| 4022 | vtkPoints* cellPts = cell->GetPoints(); |
| 4023 | vtkIdType npts = cellPts->GetNumberOfPoints(); |
| 4024 | std::vector<vtkIdType> cellptId(npts); |
| 4025 | vtkIdType iid[3]; |
| 4026 | const vtkIdType* v_id = nullptr; |
| 4027 | vtkIdType *verts, v1, v2; |
| 4028 | vtkIdType ptId; |
| 4029 | vtkIdType tab_id[3]; |
| 4030 | vtkIdType ptstriangle = 3; |
| 4031 | |
| 4032 | int i, j; |
| 4033 | unsigned int allInside; |
| 4034 | unsigned int planes; |
| 4035 | unsigned int cutInd; |
| 4036 | |
| 4037 | /* Edges Triangle*/ |
| 4038 | vtkIdType edges[3][2] = { |
| 4039 | { 0, 1 }, |
| 4040 | { 1, 2 }, |
| 4041 | { 2, 0 }, |
| 4042 | }; |
| 4043 | double value, deltaScalar; |
| 4044 | double t, *p1, *p2; |
| 4045 | double v[3], x[3]; |
| 4046 | double v_triangle[3][3]; |
| 4047 | |
| 4048 | // To avoid false positive warning. |
| 4049 | tab_id[0] = 0; |
| 4050 | tab_id[1] = 0; |
| 4051 | tab_id[2] = 0; |
| 4052 | |
| 4053 | for (i = 0; i < npts; i++) |
| 4054 | { |
| 4055 | cellptId[i] = cellIds->GetId(i); |
| 4056 | } |
| 4057 | |
| 4058 | // Convert all 2d cells to triangle |
| 4059 | this->CellGrid(cellType, npts, cellptId.data(), arraytriangle); |
| 4060 | |
| 4061 | unsigned int totalnewtriangle = arraytriangle->GetNumberOfCells(); |
| 4062 | unsigned int idtrianglenew; |
| 4063 | |
| 4064 | for (idtrianglenew = 0; idtrianglenew < totalnewtriangle; idtrianglenew++) |
| 4065 | { |
| 4066 | arraytriangle->GetNextCell(ptstriangle, v_id); |
| 4067 | |
| 4068 | for (allInside = 1, i = 0; i < 3; i++) |
| 4069 | { |
| 4070 | cellPts->GetPoint(v_id[i], v); |
| 4071 | |
| 4072 | if (!(((v[0] >= this->BoundBoxClip[0][0]) && (v[0] <= this->BoundBoxClip[0][1]) && |
no test coverage detected