The X Toolkit API

X.triplets

/**
* Create an ordered container for triplets (3D tuples) with a
* fixed memory size.
*
* @param {!number} size The number of triplets to store. This is used to
*                       allocate memory: 4 bytes * size.
* @param {X.triplets=} data Initial data as another X.triplets container.
* @constructor
* @extends X.base
*/
var t = new X.triplets();
/**
* The centroid of the bounding box.
*
* @type {!Array}
* @protected
*/
t._centroid = $_CENTROID;
/**
* The className of this class.
*
* @type {string}
* @protected
*/
t._classname = $_CLASSNAME;
/**
* The pointer to the current position in the float array.
*
* @type {!number}
* @protected
*/
t._dataPointer = $_DATAPOINTER;
/**
* The 'dirty' flag of this object.
*
* @type {boolean}
* @protected
*/
t._dirty = $_DIRTY;
/**
* This marks the triplets container as fresh meaning unused.
*
* @type {!boolean}
* @protected
*/
t._fresh = $_FRESH;
/**
* The uniqueId of this instance. Each class instance in XTK has a uniqueId.
*
* @type {number}
* @protected
*/
t._id = $_ID;
/**
* The maxA border of the bounding box.
*
* @type {number}
* @protected
*/
t._maxA = $_MAXA;
/**
* The maxB border of the bounding box.
*
* @type {number}
* @protected
*/
t._maxB = $_MAXB;
/**
* The maxC border of the bounding box.
*
* @type {number}
* @protected
*/
t._maxC = $_MAXC;
/**
* The minA border of the bounding box.
*
* @type {number}
* @protected
*/
t._minA = $_MINA;
/**
* The minB border of the bounding box.
*
* @type {number}
* @protected
*/
t._minB = $_MINB;
/**
* The minC border of the bounding box.
*
* @type {number}
* @protected
*/
t._minC = $_MINC;
/**
* The one dimensional float array storing all triplets.
*
* @type {!Float32Array}
* @private
*/
t._triplets = $_TRIPLETS;
/**
* Get the className of this object.
*
* @return {string} The className of this object.
* @public
*/
var _classname = t.classname;
/**
* Get the number of triplets in this container.
*
* @return {!number} The number of triplets in this container.
* @public
*/
var _count = t.count;
/**
* Get the id of this instance.
*
* @return {string} The className of this object.
* @public
*/
var _id = t.id;
/**
* Get the length of this container. This equals the number of triplets
* multiplied by 3.
*
* @return {!number} The length of this container.
* @public
*/
var _length = t.length;
/**
* Add a triplet to this container.
*
* @param {!number} a The first value of the triplet.
* @param {!number} b The second value of the triplet.
* @param {!number} c The third value of the triplet.
* @return {!number} The id of the added triplet.
* @throws {Error} An exception if the passed coordinates are invalid.
* @public
*/
var add = t.add($A, $B, $C);
/**
* Delete all triplets in this container.
*
* @public
*/
t.clear();
/**
* Get the triplet with the given id.
*
* @param {!number} id The id of the requested triplet.
* @return {!Array} The triplet with the given id as a 1D Array with length 3.
* @public
*/
var get = t.get($ID);
/**
* Remove a given triplet from this container.
*
* @param {!number} id The id of the to be removed triplet.
* @public
*/
t.remove($ID);
/**
* Adjust the size of the internal array to match
* the real content.
*/
t.resize();


CONSTRUCTORS
X.triplets

PROPERTIES
_centroid
_classname
_dataPointer
_dirty
_fresh
_id
_maxA
_maxB
_maxC
_minA
_minB
_minC
_triplets

GETTERS/SETTERS
classname
count
id
length

FUNCTIONS
add
clear
get
remove
resize

STATIC



SOURCECODE