|
| 1 | +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; |
| 2 | +import { Vector3 } from '../../../types'; |
| 3 | +import { DesiredOutputPrecision } from '../../../Common/DataModel/DataSetAttributes'; |
| 4 | + |
| 5 | +/** |
| 6 | + * |
| 7 | + */ |
| 8 | +export interface IPlaneSourceInitialValues { |
| 9 | + numberOfSides?: number; |
| 10 | + center?: Vector3; |
| 11 | + normal?: Vector3; |
| 12 | + radius?: number; |
| 13 | + generatePolygon?: boolean; |
| 14 | + generatePolyline?: boolean; |
| 15 | + outputPointsPrecision?: DesiredOutputPrecision; |
| 16 | +} |
| 17 | + |
| 18 | +type vtkRegularPolygonSourceBase = vtkObject & |
| 19 | + Omit< |
| 20 | + vtkAlgorithm, |
| 21 | + | 'getInputData' |
| 22 | + | 'setInputData' |
| 23 | + | 'setInputConnection' |
| 24 | + | 'getInputConnection' |
| 25 | + | 'addInputConnection' |
| 26 | + | 'addInputData' |
| 27 | + >; |
| 28 | + |
| 29 | +export interface vtkRegularPolygonSource extends vtkRegularPolygonSourceBase { |
| 30 | + /** |
| 31 | + * Get the center of the regular polygon. |
| 32 | + * @returns {Vector3} center of the polygon |
| 33 | + */ |
| 34 | + getCenter(): Vector3; |
| 35 | + |
| 36 | + /** |
| 37 | + * Get a reference to the center of the regular polygon. |
| 38 | + * @returns {Vector3} reference to the center of the polygon |
| 39 | + */ |
| 40 | + getCenterByReference(): Vector3; |
| 41 | + |
| 42 | + /** |
| 43 | + * Get whether to generate polygon points. |
| 44 | + * @returns {Boolean} true if polygon points are generated, false otherwise |
| 45 | + */ |
| 46 | + getGeneratePolygon(): boolean; |
| 47 | + |
| 48 | + /** |
| 49 | + * Get whether to generate polyline points. |
| 50 | + * @returns {Boolean} true if polyline points are generated, false otherwise |
| 51 | + */ |
| 52 | + getGeneratePolyline(): boolean; |
| 53 | + |
| 54 | + /** |
| 55 | + * Get the normal of the regular polygon. |
| 56 | + * @returns {Vector3} normal of the polygon |
| 57 | + */ |
| 58 | + getNormal(): Vector3; |
| 59 | + |
| 60 | + /** |
| 61 | + * Get a reference to the normal of the regular polygon. |
| 62 | + * @returns {Vector3} reference to the normal of the polygon |
| 63 | + */ |
| 64 | + getNormalByReference(): Vector3; |
| 65 | + |
| 66 | + /** |
| 67 | + * Get the number of sides for the regular polygon. |
| 68 | + * @returns {Number} number of sides |
| 69 | + */ |
| 70 | + getNumberOfSides(): number; |
| 71 | + |
| 72 | + /** |
| 73 | + * Get the output points precision. |
| 74 | + * @returns {DesiredOutputPrecision} the output points precision |
| 75 | + */ |
| 76 | + getOutputPointsPrecision(): DesiredOutputPrecision; |
| 77 | + |
| 78 | + /** |
| 79 | + * Get the radius of the regular polygon. |
| 80 | + * @returns {Number} radius of the polygon |
| 81 | + */ |
| 82 | + getRadius(): number; |
| 83 | + |
| 84 | + /** |
| 85 | + * |
| 86 | + * @param inData |
| 87 | + * @param outData |
| 88 | + */ |
| 89 | + requestData(inData: any, outData: any): void; |
| 90 | + |
| 91 | + /** |
| 92 | + * Set the center of the regular polygon. |
| 93 | + * @param {Vector3} center |
| 94 | + * @returns {Boolean} true if the value was changed, false otherwise |
| 95 | + */ |
| 96 | + setCenter(center: Vector3): boolean; |
| 97 | + |
| 98 | + /** |
| 99 | + * Set whether to generate polygon points. |
| 100 | + * @param generatePolygon |
| 101 | + * @returns {Boolean} true if the value was changed, false otherwise |
| 102 | + */ |
| 103 | + setGeneratePolygon(generatePolygon: boolean): boolean; |
| 104 | + |
| 105 | + /** |
| 106 | + * Set whether to generate polyline points. |
| 107 | + * @param generatePolyline |
| 108 | + * @returns {Boolean} true if the value was changed, false otherwise |
| 109 | + */ |
| 110 | + setGeneratePolyline(generatePolyline: boolean): boolean; |
| 111 | + |
| 112 | + /** |
| 113 | + * Set the normal of the regular polygon. |
| 114 | + * @param {Vector3} normal |
| 115 | + * @returns {Boolean} true if the value was changed, false otherwise |
| 116 | + */ |
| 117 | + setNormal(normal: Vector3): boolean; |
| 118 | + |
| 119 | + /** |
| 120 | + * Set the number of sides for the regular polygon. |
| 121 | + * @param numberOfSides |
| 122 | + * @returns {Boolean} true if the value was changed, false otherwise |
| 123 | + */ |
| 124 | + setNumberOfSides(numberOfSides: number): boolean; |
| 125 | + |
| 126 | + /** |
| 127 | + * Set the output points precision. |
| 128 | + * @param outputPointsPrecision |
| 129 | + * @returns {Boolean} true if the value was changed, false otherwise |
| 130 | + */ |
| 131 | + setOutputPointsPrecision( |
| 132 | + outputPointsPrecision: DesiredOutputPrecision |
| 133 | + ): boolean; |
| 134 | + |
| 135 | + /** |
| 136 | + * Set the radius of the regular polygon. |
| 137 | + * @param radius |
| 138 | + * @returns {Boolean} true if the value was changed, false otherwise |
| 139 | + */ |
| 140 | + setRadius(radius: number): boolean; |
| 141 | +} |
| 142 | + |
| 143 | +/** |
| 144 | + * Method used to decorate a given object (publicAPI+model) with vtkRegularPolygonSource characteristics. |
| 145 | + * |
| 146 | + * @param publicAPI object on which methods will be bounds (public) |
| 147 | + * @param model object on which data structure will be bounds (protected) |
| 148 | + * @param {IPlaneSourceInitialValues} [initialValues] (default: {}) |
| 149 | + */ |
| 150 | +export function extend( |
| 151 | + publicAPI: object, |
| 152 | + model: object, |
| 153 | + initialValues?: IPlaneSourceInitialValues |
| 154 | +): void; |
| 155 | + |
| 156 | +/** |
| 157 | + * Method used to create a new instance of vtkRegularPolygonSource. |
| 158 | + * @param {IPlaneSourceInitialValues} [initialValues] for pre-setting some of its content |
| 159 | + */ |
| 160 | +export function newInstance( |
| 161 | + initialValues?: IPlaneSourceInitialValues |
| 162 | +): vtkRegularPolygonSource; |
| 163 | + |
| 164 | +/** |
| 165 | + * vtkRegularPolygonSource is a source object that creates a single n-sided |
| 166 | + * polygon and/or polyline. The polygon is centered at a specified point, |
| 167 | + * orthogonal to a specified normal, and with a circumscribing radius set by the |
| 168 | + * user. The user can also specify the number of sides of the polygon ranging |
| 169 | + * from [3,N]. |
| 170 | + * |
| 171 | + * @example |
| 172 | + * ```js |
| 173 | + * import vtkRegularPolygonSource from '@kitware/vtk.js/Filters/Sources/RegularPolygonSource'; |
| 174 | + * |
| 175 | + * const regularPolygonSource = vtkRegularPolygonSource.newInstance(); |
| 176 | + * const polydata = regularPolygonSource.getOutputData(); |
| 177 | + * ``` |
| 178 | + */ |
| 179 | +export declare const vtkRegularPolygonSource: { |
| 180 | + newInstance: typeof newInstance; |
| 181 | + extend: typeof extend; |
| 182 | +}; |
| 183 | +export default vtkRegularPolygonSource; |
0 commit comments