Skip to content

Cell ​

Introduction ​

vtkCell is an abstract method to define a cell

Methods ​

deepCopy ​

Copy this cell by completely copying internal data structures.

ArgumentTypeRequiredDescription
cellvtkCellYesThe cell you want to use.

extend ​

Method used to decorate a given object (publicAPI+model) with vtkCell characteristics.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesICellInitialValuesNo(default: {})

getBounds ​

Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax].

getLength2 ​

Compute Length squared of cell (i.e., bounding box diagonal squared).

getNumberOfPoints ​

Get the number of points in the cell.

getParametricDistance ​

Get the distance of the parametric coordinate provided to the cell. If inside the cell, a distance of zero is returned. This is used during picking to get the correct cell picked. (The tolerance will occasionally allow cells to be picked who are not really intersected "inside" the cell.)

ArgumentTypeRequiredDescription
pcoordsVector3YesThe coordinates of the point.

getPoints ​

getPointsIds ​

initialize ​

Initialize the cell with point coordinates and cell point ids, example :

js
const points = vtkPoints.newInstance();
points.setData(Float32Array.from([0, 0, 0, 0, 0, 1, ..., 255, 255, 255]));
const pointIdsList = [13, 10, 235];
// Create cell
const triangle = vtkTriangle.newInstance();
// Initialize cell
triangle.initialize(points, pointIdsList);

If pointIdsList is null, points are shallow copied and pointIdsList is generated as such: [0, 1, ..., N-1] where N is the number of points. If pointIdsList is not null, only pointIdsList point coordinates are copied into the cell. pointIdsList is shallow copied.

ArgumentTypeRequiredDescription
pointsvtkPointsYes
pointIdsListArray[Number]No

newInstance ​

Method used to create a new instance of vtkCell.

ArgumentTypeRequiredDescription
initialValuesICellInitialValuesNofor pre-setting some of its content