HopefulLlama/UnitTestSCAD

View on GitHub
docs/api_OpenSCADFunction.js.html

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Source: api/OpenSCADFunction.js</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Source: api/OpenSCADFunction.js</h1>

    



    
    <section>
        <article>
            <pre class="prettyprint source linenums"><code>const AbstractParent = require('./AbstractParent');
const FunctionFile = require('../file/FunctionFile');
const TypeConverter = require('../types/TypeConverter');
const Types = require('../types/Types');

/** @class */
class Function extends AbstractParent {
  /**
   * @param {Options} options
   */
  constructor(options) {
    super(options, FunctionFile);
    /**
     * @memberof Function
     * @instance
     * @member {string} output The extracted output from execution of the .scad file.
     */
    /**
     * @memberof Function
     * @instance
     * @member {Type} type The detected type of the value retrieved from the OpenSCAD function.
     */
    this.type = TypeConverter.getType(this.output);
  }

  /**
   * Returns true if this type is of type {@link OpenSCADBoolean}.
   * @returns {boolean} True if this type is of type {@link OpenSCADBoolean}.
   */
  isBoolean() {
    return this.type === Types.BOOLEAN;
  }

  /**
   * Returns true if this type is of type {@link OpenSCADInfinity}.
   * @returns {boolean} True if this type is of type {@link OpenSCADInfinity}.
   */
  isInf() {
    return this.type === Types.INF;
  }

  /**
   * Returns true if this type is of type {@link OpenSCADNaN}.
   * @returns {boolean} True if this type is of type {@link OpenSCADNaN}.
   */
  isNan() {
    return this.type === Types.NAN;
  }

  /**
   * Returns true if this type is of type {@link OpenSCADNumber}.
   * @returns {boolean} True if this type is of type {@link OpenSCADNumber}.
   */
  isNumber() {
    return this.type === Types.NUMBER;
  }

  /**
   * Returns true if this type is of type {@link OpenSCADRange}.
   * @returns {boolean} True if this type is of type {@link OpenSCADBoolean}.
   */
  isRange() {
    return this.type === Types.RANGE;
  }

  /**
   * Returns true if this type is of type {@link OpenSCADString}.
   * @returns {boolean} True if this type is of type {@link OpenSCADString}.
   */
  isString() {
    return this.type === Types.STRING;
  }

  /**
   * Returns true if this type is of type {@link OpenSCADUndefined}.
   * @returns {boolean} True if this type is of type {@link OpenSCADUndefined}.
   */
  isUndef() {
    return this.type === Types.UNDEF;
  }

  /**
   * Returns true if this type is of type {@link OpenSCADVector}.
   * @returns {boolean} True if this type is of type {@link OpenSCADVector}.
   */
  isVector() {
    return this.type === Types.VECTOR;
  }
}

module.exports = Function;</code></pre>
        </article>
    </section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Function.html">Function</a></li><li><a href="ThreeDModule.html">ThreeDModule</a></li><li><a href="TwoDModule.html">TwoDModule</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>