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

Method ClipBoxInOut

Filters/General/vtkBoxClipDataSet.cxx:2875–3435  ·  view source on GitHub ↗

------------------------------------------------------------------------------ ClipBoxInOut The difference between ClipBox and ClipBoxInOut is the outputs. The ClipBoxInOut generate both outputs: inside and outside the clip box.

Source from the content-addressed store, hash-verified

2873// The ClipBoxInOut generate both outputs: inside and outside the clip box.
2874//
2875void vtkBoxClipDataSet::ClipBoxInOut(vtkPoints* newPoints, vtkGenericCell* cell,
2876 vtkIncrementalPointLocator* locator, vtkCellArray** tets, vtkPointData* inPD,
2877 vtkPointData** outPD, vtkCellData* inCD, vtkIdType cellId, vtkCellData** outCD)
2878{
2879 vtkIdType cellType = cell->GetCellType();
2880 vtkIdList* cellIds = cell->GetPointIds();
2881 vtkCellArray* arraytetra = vtkCellArray::New();
2882 vtkPoints* cellPts = cell->GetPoints();
2883 vtkIdType npts = cellPts->GetNumberOfPoints();
2884 std::vector<vtkIdType> cellptId(npts);
2885 vtkIdType iid[4];
2886 const vtkIdType* v_id = nullptr;
2887 vtkIdType *verts, v1, v2;
2888 vtkIdType ptId;
2889 vtkIdType ptIdout[4];
2890 vtkIdType tab_id[6];
2891 vtkIdType ptstetra = 4;
2892
2893 int i, j;
2894 int allInside;
2895 int cutInd;
2896
2897 unsigned int planes;
2898 unsigned int idcellnew;
2899 unsigned int idtetranew;
2900
2901 /* Edges Tetrahedron */
2902 vtkIdType edges[6][2] = {
2903 { 0, 1 },
2904 { 1, 2 },
2905 { 2, 0 },
2906 { 0, 3 },
2907 { 1, 3 },
2908 { 2, 3 },
2909 };
2910 double value, deltaScalar;
2911 double t;
2912 double v[3], x[3];
2913 double v_tetra[4][3];
2914 double *p1, *p2;
2915
2916 for (i = 0; i < npts; i++)
2917 {
2918 cellptId[i] = cellIds->GetId(i);
2919 }
2920
2921 // Convert all volume cells to tetrahedra
2922 this->CellGrid(cellType, npts, cellptId.data(), arraytetra);
2923 unsigned int totalnewtetra = arraytetra->GetNumberOfCells();
2924
2925 for (idtetranew = 0; idtetranew < totalnewtetra; idtetranew++)
2926 {
2927 arraytetra->GetNextCell(ptstetra, v_id);
2928
2929 for (allInside = 1, i = 0; i < 4; i++)
2930 {
2931 cellPts->GetPoint(v_id[i], v);
2932

Callers 1

RequestDataMethod · 0.95

Calls 15

CellGridMethod · 0.95
InterpolateEdgeMethod · 0.95
CreateTetraMethod · 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

Tested by

no test coverage detected