|
| 1 | +import { DesiredOutputPrecision } from '../../../Common/DataModel/DataSetAttributes'; |
| 2 | +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; |
| 3 | +import { Vector3 } from '../../../types'; |
| 4 | + |
| 5 | +/** |
| 6 | + * |
| 7 | + */ |
| 8 | +export interface IArcSourceInitialValues { |
| 9 | + point1?: Vector3; |
| 10 | + point2?: Vector3; |
| 11 | + center?: Vector3; |
| 12 | + normal?: Vector3; |
| 13 | + polarVector?: Vector3; |
| 14 | + angle?: number; |
| 15 | + resolution?: number; |
| 16 | + negative?: boolean; |
| 17 | + useNormalAndAngle?: boolean; |
| 18 | + outputPointsPrecision?: DesiredOutputPrecision; |
| 19 | +} |
| 20 | + |
| 21 | +type vtkArcSourceBase = vtkObject & |
| 22 | + Omit< |
| 23 | + vtkAlgorithm, |
| 24 | + | 'getInputData' |
| 25 | + | 'setInputData' |
| 26 | + | 'setInputConnection' |
| 27 | + | 'getInputConnection' |
| 28 | + | 'addInputConnection' |
| 29 | + | 'addInputData' |
| 30 | + >; |
| 31 | + |
| 32 | +export interface vtkArcSource extends vtkArcSourceBase { |
| 33 | + /** |
| 34 | + * Get the angle of the arc. |
| 35 | + */ |
| 36 | + getAngle(): number; |
| 37 | + |
| 38 | + /** |
| 39 | + * Get the center of the arc. |
| 40 | + */ |
| 41 | + getCenter(): Vector3; |
| 42 | + |
| 43 | + /** |
| 44 | + * Get the center of the arc by reference. |
| 45 | + */ |
| 46 | + getCenterByReference(): Vector3; |
| 47 | + |
| 48 | + /** |
| 49 | + * Get the first point of the arc. |
| 50 | + */ |
| 51 | + getPoint1(): Vector3; |
| 52 | + |
| 53 | + /** |
| 54 | + * Get the first point of the arc by reference. |
| 55 | + */ |
| 56 | + getPoint1ByReference(): Vector3; |
| 57 | + |
| 58 | + /** |
| 59 | + * Get the second point of the arc. |
| 60 | + */ |
| 61 | + getPoint2(): Vector3; |
| 62 | + |
| 63 | + /** |
| 64 | + * Get the second point of the arc by reference. |
| 65 | + */ |
| 66 | + getPoint2ByReference(): Vector3; |
| 67 | + |
| 68 | + /** |
| 69 | + * Get the normal vector of the arc. |
| 70 | + */ |
| 71 | + getNormal(): Vector3; |
| 72 | + |
| 73 | + /** |
| 74 | + * Get the normal vector of the arc by reference. |
| 75 | + */ |
| 76 | + getNormalByReference(): Vector3; |
| 77 | + |
| 78 | + /** |
| 79 | + * Get the polar vector of the arc. |
| 80 | + */ |
| 81 | + getPolarVector(): Vector3; |
| 82 | + |
| 83 | + /** |
| 84 | + * Get the polar vector of the arc by reference. |
| 85 | + */ |
| 86 | + getPolarVectorByReference(): Vector3; |
| 87 | + |
| 88 | + /** |
| 89 | + * Get the resolution of the arc. |
| 90 | + */ |
| 91 | + getResolution(): number; |
| 92 | + |
| 93 | + /** |
| 94 | + * Get the negative flag of the arc. |
| 95 | + */ |
| 96 | + getNegative(): boolean; |
| 97 | + |
| 98 | + /** |
| 99 | + * Get the output points precision. |
| 100 | + */ |
| 101 | + getOutputPointsPrecision(): DesiredOutputPrecision; |
| 102 | + |
| 103 | + /** |
| 104 | + * Get the use normal and angle flag. |
| 105 | + */ |
| 106 | + getUseNormalAndAngle(): boolean; |
| 107 | + |
| 108 | + /** |
| 109 | + * |
| 110 | + * @param inData |
| 111 | + * @param outData |
| 112 | + */ |
| 113 | + requestData(inData: any, outData: any): void; |
| 114 | + |
| 115 | + /** |
| 116 | + * Set the first point of the arc. |
| 117 | + * @param {Vector3} point1 The first point's coordinates. |
| 118 | + */ |
| 119 | + setPoint1(point1: Vector3): boolean; |
| 120 | + |
| 121 | + /** |
| 122 | + * Set the first point of the arc by reference. |
| 123 | + * @param {Vector3} point1 The first point's coordinates. |
| 124 | + */ |
| 125 | + setPoint1From(point1: Vector3): boolean; |
| 126 | + |
| 127 | + /** |
| 128 | + * Set the second point of the arc. |
| 129 | + * @param {Vector3} point2 The second point's coordinates. |
| 130 | + */ |
| 131 | + setPoint2(point2: Vector3): boolean; |
| 132 | + |
| 133 | + /** |
| 134 | + * Set the second point of the arc by reference. |
| 135 | + * @param {Vector3} point2 The second point's coordinates. |
| 136 | + */ |
| 137 | + setPoint2From(point2: Vector3): boolean; |
| 138 | + |
| 139 | + /** |
| 140 | + * Set the center of the arc. |
| 141 | + * @param {Vector3} center The center point's coordinates. |
| 142 | + */ |
| 143 | + setCenter(center: Vector3): boolean; |
| 144 | + |
| 145 | + /** |
| 146 | + * Set the center of the arc by reference. |
| 147 | + * @param {Vector3} center The center point's coordinates. |
| 148 | + */ |
| 149 | + setCenterFrom(center: Vector3): boolean; |
| 150 | + |
| 151 | + /** |
| 152 | + * Set the normal vector of the arc. |
| 153 | + * @param {Vector3} normal The normal vector's coordinates. |
| 154 | + */ |
| 155 | + setNormal(normal: Vector3): boolean; |
| 156 | + |
| 157 | + /** |
| 158 | + * Set the normal vector of the arc by reference. |
| 159 | + * @param {Vector3} normal The normal vector's coordinates. |
| 160 | + */ |
| 161 | + setNormalFrom(normal: Vector3): boolean; |
| 162 | + |
| 163 | + /** |
| 164 | + * Set the polar vector of the arc. |
| 165 | + * @param {Vector3} polarVector The polar vector's coordinates. |
| 166 | + */ |
| 167 | + setPolarVector(polarVector: Vector3): boolean; |
| 168 | + |
| 169 | + /** |
| 170 | + * Set the polar vector of the arc by reference. |
| 171 | + * @param {Vector3} polarVector The polar vector's coordinates. |
| 172 | + */ |
| 173 | + setPolarVectorFrom(polarVector: Vector3): boolean; |
| 174 | + |
| 175 | + /** |
| 176 | + * Set the angle of the arc. |
| 177 | + * @param {Number} angle The angle in radians. |
| 178 | + */ |
| 179 | + setAngle(angle: number): boolean; |
| 180 | + |
| 181 | + /** |
| 182 | + * Set the resolution of the arc. |
| 183 | + * @param {Number} resolution The number of points in the arc. |
| 184 | + */ |
| 185 | + setResolution(resolution: number): boolean; |
| 186 | + |
| 187 | + /** |
| 188 | + * Set the negative flag of the arc. |
| 189 | + * @param {Boolean} negative If true, the arc will be drawn in the negative direction. |
| 190 | + */ |
| 191 | + setNegative(negative: boolean): boolean; |
| 192 | + |
| 193 | + /** |
| 194 | + * Set the use normal and angle flag. |
| 195 | + * @param {Boolean} useNormalAndAngle If true, the normal and angle will be used to define the arc. |
| 196 | + */ |
| 197 | + setUseNormalAndAngle(useNormalAndAngle: boolean): boolean; |
| 198 | + |
| 199 | + /** |
| 200 | + * Set the output points precision. |
| 201 | + * @param {DesiredOutputPrecision} precision The desired output precision. |
| 202 | + */ |
| 203 | + setOutputPointsPrecision(precision: DesiredOutputPrecision): boolean; |
| 204 | +} |
| 205 | + |
| 206 | +/** |
| 207 | + * Method used to decorate a given object (publicAPI+model) with vtkArcSource characteristics. |
| 208 | + * |
| 209 | + * @param publicAPI object on which methods will be bounds (public) |
| 210 | + * @param model object on which data structure will be bounds (protected) |
| 211 | + * @param {IArcSourceInitialValues} [initialValues] (default: {}) |
| 212 | + */ |
| 213 | +export function extend( |
| 214 | + publicAPI: object, |
| 215 | + model: object, |
| 216 | + initialValues?: IArcSourceInitialValues |
| 217 | +): void; |
| 218 | + |
| 219 | +/** |
| 220 | + * Method used to create a new instance of vtkArcSource. |
| 221 | + * @param {IArcSourceInitialValues} [initialValues] for pre-setting some of its content |
| 222 | + */ |
| 223 | +export function newInstance( |
| 224 | + initialValues?: IArcSourceInitialValues |
| 225 | +): vtkArcSource; |
| 226 | + |
| 227 | +/** |
| 228 | + * vtkArcSource is a source object that creates an arc defined by two endpoints |
| 229 | + * and a center. The number of segments composing the polyline is controlled by |
| 230 | + * setting the object resolution. |
| 231 | + * |
| 232 | + * @example |
| 233 | + * ```js |
| 234 | + * import vtkArcSource from '@kitware/vtk.js/Filters/Sources/ArcSource'; |
| 235 | + * |
| 236 | + * const arc = vtkArcSource.newInstance(); |
| 237 | + * const polydata = arc.getOutputData(); |
| 238 | + * ``` |
| 239 | + */ |
| 240 | +export declare const vtkArcSource: { |
| 241 | + newInstance: typeof newInstance; |
| 242 | + extend: typeof extend; |
| 243 | +}; |
| 244 | +export default vtkArcSource; |
0 commit comments