File: /home/padewitte/projets/webcomponents/myscript-js/src/input/math/mathParameter.js
'use strict';
(function (scope) {
/**
* Parameters used for math recognition
*
* @class MathParameter
* @extends AbstractParameter
* @constructor
*/
function MathParameter(obj) {
scope.AbstractParameter.call(this, obj);
this.resultTypes = [];
this.userResources = [];
if (obj) {
if (obj.resultTypes) {
this.resultTypes = obj.resultTypes;
}
if (obj.columnarOperation) {
this.columnarOperation = obj.columnarOperation;
}
if (obj.userResources) {
this.userResources = obj.userResources;
}
if (obj.scratchOutDetectionSensitivity) {
this.scratchOutDetectionSensitivity = obj.scratchOutDetectionSensitivity;
}
}
}
/**
* Inheritance property
*/
MathParameter.prototype = new scope.AbstractParameter();
/**
* Constructor property
*/
MathParameter.prototype.constructor = MathParameter;
/**
* Get the math result types (e.g. LaTex, MathML, SymbolTree)
*
* @method getResultTypes
* @returns {Array}
*/
MathParameter.prototype.getResultTypes = function () {
return this.resultTypes;
};
/**
* Set the math result types (e.g. LaTex, MathML, SymbolTree)
*
* @method setResultTypes
* @param {Array} resultTypes
*/
MathParameter.prototype.setResultTypes = function (resultTypes) {
this.resultTypes = resultTypes;
};
/**
* Get the math result result orientation to columnar operations
*
* @method isColumnar
* @returns {Boolean}
*/
MathParameter.prototype.isColumnar = function () {
return this.columnarOperation;
};
/**
* Set the math result orientation to columnar operations
*
* @method setColumnar
* @param {Boolean} columnar
*/
MathParameter.prototype.setColumnar = function (columnar) {
this.columnarOperation = columnar;
};
/**
* Get the user resources
*
* @method getUserResources
* @returns {Array}
*/
MathParameter.prototype.getUserResources = function () {
return this.userResources;
};
/**
* Set the user resources
*
* @method setUserResources
* @param {Array} userResources
*/
MathParameter.prototype.setUserResources = function (userResources) {
this.userResources = userResources;
};
/**
* Get the sensitivity of the scratch-out detection
*
* @method getScratchOutDetectionSensitivity
* @returns {Number}
*/
MathParameter.prototype.getScratchOutDetectionSensitivity = function () {
return this.scratchOutDetectionSensitivity;
};
/**
* Set the sensitivity of the scratch-out detection
*
* @method setScratchOutDetectionSensitivity
* @param {Number} scratchOutDetectionSensitivity
*/
MathParameter.prototype.setScratchOutDetectionSensitivity = function (scratchOutDetectionSensitivity) {
this.scratchOutDetectionSensitivity = scratchOutDetectionSensitivity;
};
// Export
scope.MathParameter = MathParameter;
})(MyScript);