Method used to decorate a given object (publicAPI+model) with vtkVariantArray characteristics.
Argument
Type
Required
Description
publicAPI
Yes
object on which methods will be bounds (public)
model
Yes
object on which data structure will be bounds (protected)
initialValues
IVariantArrayInitialValues
Yes
(default: {})
getComponent
Get the data component at the location specified by tupleIdx and compIdx.
Argument
Type
Required
Description
tupleIdx
Number
Yes
compIdx
Number
No
getData
getDataType
getName
getNumberOfComponents
getNumberOfTuples
getNumberOfValues
getTuple
Argument
Type
Required
Description
idx
Number
Yes
tupleToFill
Array.
No
getTupleLocation
Argument
Type
Required
Description
idx
Number
No
newClone
newInstance
Method used to create a new instance of vtkVariantArray
Argument
Type
Required
Description
initialValues
IVariantArrayInitialValues
Yes
for pre-setting some of its content
setComponent
Set the data component at the location specified by tupleIdx and compIdx to value. Note that i is less than NumberOfTuples and j is less than NumberOfComponents. Make sure enough memory has been allocated (use SetNumberOfTuples() and SetNumberOfComponents()).
export interface vtkVariantArray extends vtkObject { /** * Get the data component at the location specified by tupleIdx and compIdx. * @param {Number} tupleIdx * @param {Number} [compIdx] */ getComponent(tupleIdx: number, compIdx?: number): void;
/** * Set the data component at the location specified by tupleIdx and compIdx * to value. * Note that i is less than NumberOfTuples and j is less than * NumberOfComponents. Make sure enough memory has been allocated * (use SetNumberOfTuples() and SetNumberOfComponents()). * @param {Number} tupleIdx * @param {Number} compIdx * @param {String} value */ setComponent(tupleIdx: number, compIdx: number, value: string): void;
/** * Method used to decorate a given object (publicAPI+model) with vtkVariantArray characteristics. * * @param publicAPI object on which methods will be bounds (public) * @param model object on which data structure will be bounds (protected) * @param {IVariantArrayInitialValues} initialValues (default: {}) */ exportfunctionextend( publicAPI: object, model: object, initialValues: IVariantArrayInitialValues ): void;
/** * Method used to create a new instance of vtkVariantArray * @param {IVariantArrayInitialValues} initialValues for pre-setting some of its content */ exportfunctionnewInstance( initialValues: IVariantArrayInitialValues ): vtkVariantArray;
functionvtkVariantArray(publicAPI, model) { // Set our className model.classHierarchy.push('vtkVariantArray');
// Description: // Return the data component at the location specified by tupleIdx and // compIdx. publicAPI.getComponent = (tupleIdx, compIdx = 0) => model.values[tupleIdx * model.numberOfComponents + compIdx];
// Description: // Set the data component at the location specified by tupleIdx and compIdx // to value. // Note that i is less than NumberOfTuples and j is less than // NumberOfComponents. Make sure enough memory has been allocated // (use SetNumberOfTuples() and SetNumberOfComponents()). publicAPI.setComponent = (tupleIdx, compIdx, value) => { if (value !== model.values[tupleIdx * model.numberOfComponents + compIdx]) { model.values[tupleIdx * model.numberOfComponents + compIdx] = value; publicAPI.modified(); } };