|
| 1 | +import { vtkObject } from '../../../interfaces'; |
| 2 | +import { Nullable } from '../../../types'; |
| 3 | + |
| 4 | +export interface ICellLinksInitialValues {} |
| 5 | + |
| 6 | +/** |
| 7 | + * Link record for a point: number of incident cells and their ids. |
| 8 | + */ |
| 9 | +export interface ICellLink { |
| 10 | + /** |
| 11 | + * Number of cells using the point. |
| 12 | + */ |
| 13 | + ncells: number; |
| 14 | + /** |
| 15 | + * Cell ids that use the point. |
| 16 | + */ |
| 17 | + cells: Nullable<number[]>; |
| 18 | +} |
| 19 | + |
| 20 | +export interface vtkCellLinks extends vtkObject { |
| 21 | + /** |
| 22 | + * Build the link list array from the input dataset. |
| 23 | + * The resulting structure maps each point id to the cells that reference it. |
| 24 | + */ |
| 25 | + buildLinks(data: any): void; |
| 26 | + |
| 27 | + /** |
| 28 | + * Allocate storage for a number of links (typically the number of points). |
| 29 | + * @param {Number} numLinks Number of point links to allocate. |
| 30 | + * @param {Number} [extSize=1000] Growth factor used for future extensions. |
| 31 | + */ |
| 32 | + allocate(numLinks: number, extSize?: number): void; |
| 33 | + |
| 34 | + /** |
| 35 | + * Allocate per-point cell-id arrays based on precomputed link counts. |
| 36 | + * @param {Number} n Number of links (points). |
| 37 | + */ |
| 38 | + allocateLinks(n: number): void; |
| 39 | + |
| 40 | + /** |
| 41 | + * Clear out previously allocated link structures. |
| 42 | + */ |
| 43 | + initialize(): void; |
| 44 | + |
| 45 | + /** |
| 46 | + * Get the full link structure for a point id. |
| 47 | + * @param {Number} ptId Point id. |
| 48 | + */ |
| 49 | + getLink(ptId: number): ICellLink; |
| 50 | + |
| 51 | + /** |
| 52 | + * Get the number of cells using the point. |
| 53 | + * @param {Number} ptId Point id. |
| 54 | + */ |
| 55 | + getNcells(ptId: number): number; |
| 56 | + |
| 57 | + /** |
| 58 | + * Return the list of cell ids that use the point. |
| 59 | + * @param {Number} ptId Point id. |
| 60 | + */ |
| 61 | + getCells(ptId: number): Nullable<number[]>; |
| 62 | + |
| 63 | + /** |
| 64 | + * Insert a new point entry into the links structure. |
| 65 | + * @param {Number} numLinks Initial size of the point's cell-id list. |
| 66 | + */ |
| 67 | + insertNextPoint(numLinks: number): void; |
| 68 | + |
| 69 | + /** |
| 70 | + * Append a cell id to the point's cell-id list. |
| 71 | + * @param {Number} ptId Point id. |
| 72 | + * @param {Number} cellId Cell id. |
| 73 | + */ |
| 74 | + insertNextCellReference(ptId: number, cellId: number): void; |
| 75 | + |
| 76 | + /** |
| 77 | + * Delete a point by removing all links to using cells. |
| 78 | + * @param {Number} ptId Point id. |
| 79 | + */ |
| 80 | + deletePoint(ptId: number): void; |
| 81 | + |
| 82 | + /** |
| 83 | + * Remove the reference from a point to a cell. |
| 84 | + * @param {Number} cellId Cell id. |
| 85 | + * @param {Number} ptId Point id. |
| 86 | + */ |
| 87 | + removeCellReference(cellId: number, ptId: number): void; |
| 88 | + |
| 89 | + /** |
| 90 | + * Add a reference from a point to a cell. |
| 91 | + * @param {Number} cellId Cell id. |
| 92 | + * @param {Number} ptId Point id. |
| 93 | + */ |
| 94 | + addCellReference(cellId: number, ptId: number): void; |
| 95 | + |
| 96 | + /** |
| 97 | + * Resize a point's cell-id list. |
| 98 | + * @param {Number} ptId Point id. |
| 99 | + * @param {Number} size New list size. |
| 100 | + */ |
| 101 | + resizeCellList(ptId: number, size: number): void; |
| 102 | + |
| 103 | + /** |
| 104 | + * Reclaim unused memory. |
| 105 | + */ |
| 106 | + squeeze(): void; |
| 107 | + |
| 108 | + /** |
| 109 | + * Reset to an empty state without freeing memory. |
| 110 | + */ |
| 111 | + reset(): void; |
| 112 | + |
| 113 | + /** |
| 114 | + * Deep-copy from another cell-links instance. |
| 115 | + * @param src Source object. |
| 116 | + */ |
| 117 | + deepCopy(src: any): void; |
| 118 | + |
| 119 | + /** |
| 120 | + * Increment the count of cells using a point. |
| 121 | + * @param {Number} ptId Point id. |
| 122 | + */ |
| 123 | + incrementLinkCount(ptId: number): void; |
| 124 | + |
| 125 | + /** |
| 126 | + * Insert a cell id into a point's cell-id list at a specific position. |
| 127 | + * @param {Number} ptId Point id. |
| 128 | + * @param {Number} pos Position inside the point's list. |
| 129 | + * @param {Number} cellId Cell id. |
| 130 | + */ |
| 131 | + insertCellReference(ptId: number, pos: number, cellId: number): void; |
| 132 | +} |
| 133 | + |
| 134 | +/** |
| 135 | + * Method used to decorate a given object (publicAPI+model) with vtkCellLinks characteristics. |
| 136 | + * |
| 137 | + * @param publicAPI object on which methods will be bounds (public) |
| 138 | + * @param model object on which data structure will be bounds (protected) |
| 139 | + * @param {ICellLinksInitialValues} [initialValues] (default: {}) |
| 140 | + */ |
| 141 | +export function extend( |
| 142 | + publicAPI: object, |
| 143 | + model: object, |
| 144 | + initialValues?: ICellLinksInitialValues |
| 145 | +): void; |
| 146 | + |
| 147 | +/** |
| 148 | + * Method used to create a new instance of vtkCellLinks. |
| 149 | + * @param {ICellLinksInitialValues} [initialValues] for pre-setting some of its content |
| 150 | + */ |
| 151 | +export function newInstance( |
| 152 | + initialValues?: ICellLinksInitialValues |
| 153 | +): vtkCellLinks; |
| 154 | + |
| 155 | +/** |
| 156 | + * vtkCellLinks maps each point to the cells that reference it. |
| 157 | + */ |
| 158 | +export declare const vtkCellLinks: { |
| 159 | + newInstance: typeof newInstance; |
| 160 | + extend: typeof extend; |
| 161 | +}; |
| 162 | +export default vtkCellLinks; |
0 commit comments