Apply fixjsstyle to libtess.js

This commit is contained in:
Tom Payne
2013-09-03 11:29:03 +02:00
parent 31f3e92494
commit f8efa7c6a4
21 changed files with 604 additions and 410 deletions

View File

@@ -36,14 +36,16 @@
// requre libtess.GluHalfEdge
/*global libtess */
/**
* Each face has a pointer to the next and previous faces in the
* circular list, and a pointer to a half-edge with this face as
* the left face (null if this is the dummy header). There is also
* a field "data" for client data.
*
* @param {libtess.GluFace=} opt_nextFace [description]
* @param {libtess.GluFace=} opt_prevFace [description]
* @param {libtess.GluFace=} opt_nextFace [description].
* @param {libtess.GluFace=} opt_prevFace [description].
* @constructor
*/
libtess.GluFace = function(opt_nextFace, opt_prevFace) {
@@ -66,7 +68,7 @@ libtess.GluFace = function(opt_nextFace, opt_prevFace) {
* @type {libtess.GluHalfEdge}
*/
this.anEdge = null;
/**
* room for client's data
* @type {Object}
@@ -78,13 +80,13 @@ libtess.GluFace = function(opt_nextFace, opt_prevFace) {
* @type {libtess.GluFace}
*/
this.trail = null;
/**
* Flag for conversion to strips.
* @type {boolean}
*/
this.marked = false;
/**
* This face is in the polygon interior.
* @type {boolean}

View File

@@ -38,6 +38,8 @@
// require libtess.ActiveRegion
/*global libtess */
/**
* The fundamental data structure is the "half-edge". Two half-edges
* go together to make an edge, but they point in opposite directions.
@@ -63,12 +65,12 @@
* e.sym stores a pointer in the opposite direction, thus it is
* always true that e.sym.next.sym.next === e.
*
* @param {libtess.GluHalfEdge=} opt_nextEdge [description]
* @param {libtess.GluHalfEdge=} opt_nextEdge [description].
* @constructor
*/
libtess.GluHalfEdge = function(opt_nextEdge) {
// TODO(bckenny): are these the right defaults? (from gl_meshNewMesh requirements)
/**
* doubly-linked list (prev==sym->next)
* @type {!libtess.GluHalfEdge}
@@ -108,7 +110,7 @@ libtess.GluHalfEdge = function(opt_nextEdge) {
// Internal data (keep hidden)
// NOTE(bckenny): can't be private, though...
/**
* a region with this upper edge (see sweep.js)
* @type {libtess.ActiveRegion}
@@ -126,65 +128,73 @@ libtess.GluHalfEdge = function(opt_nextEdge) {
// TODO(bckenny): using methods as aliases for sym connections for now.
// not sure about this approach. getters? renames?
/**
* [rFace description]
* @return {libtess.GluFace} [description]
* @return {libtess.GluFace} [description].
*/
libtess.GluHalfEdge.prototype.rFace = function() {
return this.sym.lFace;
};
/**
* [dst description]
* @return {libtess.GluVertex} [description]
* @return {libtess.GluVertex} [description].
*/
libtess.GluHalfEdge.prototype.dst = function() {
return this.sym.org;
};
/**
* [oPrev description]
* @return {libtess.GluHalfEdge} [description]
* @return {libtess.GluHalfEdge} [description].
*/
libtess.GluHalfEdge.prototype.oPrev = function() {
return this.sym.lNext;
};
/**
* [lPrev description]
* @return {libtess.GluHalfEdge} [description]
* @return {libtess.GluHalfEdge} [description].
*/
libtess.GluHalfEdge.prototype.lPrev = function() {
return this.oNext.sym;
};
/**
* [dPrev description]
* @return {libtess.GluHalfEdge} [description]
* @return {libtess.GluHalfEdge} [description].
*/
libtess.GluHalfEdge.prototype.dPrev = function() {
return this.lNext.sym;
};
/**
* [rPrev description]
* @return {libtess.GluHalfEdge} [description]
* @return {libtess.GluHalfEdge} [description].
*/
libtess.GluHalfEdge.prototype.rPrev = function() {
return this.sym.oNext;
};
/**
* [dNext description]
* @return {libtess.GluHalfEdge} [description]
* @return {libtess.GluHalfEdge} [description].
*/
libtess.GluHalfEdge.prototype.dNext = function() {
return this.rPrev().sym;
};
/**
* [rNext description]
* @return {libtess.GluHalfEdge} [description]
* @return {libtess.GluHalfEdge} [description].
*/
libtess.GluHalfEdge.prototype.rNext = function() {
return this.oPrev().sym;

View File

@@ -37,6 +37,8 @@
// require libtess.GluVertex
/*global libtess */
/**
* Creates a new mesh with no edges, no vertices,
* and no loops (what we usually call a "face").
@@ -61,7 +63,7 @@ libtess.GluMesh = function() {
* @type {libtess.GluHalfEdge}
*/
this.eHead = new libtess.GluHalfEdge();
/**
* and its symmetric counterpart
* @type {libtess.GluHalfEdge}
@@ -73,6 +75,7 @@ libtess.GluMesh = function() {
this.eHeadSym.sym = this.eHead;
};
// TODO(bckenny): #ifndef NDEBUG
/**
* Checks mesh for self-consistency.
@@ -85,7 +88,7 @@ libtess.GluMesh.prototype.checkMesh = function() {
var fHead = this.fHead;
var vHead = this.vHead;
var eHead = this.eHead;
var e;
// faces
@@ -101,7 +104,7 @@ libtess.GluMesh.prototype.checkMesh = function() {
libtess.assert(e.oNext.sym.lNext === e);
libtess.assert(e.lFace === f);
e = e.lNext;
} while(e !== f.anEdge);
} while (e !== f.anEdge);
}
libtess.assert(f.prev === fPrev && f.anEdge === null && f.data === null);
@@ -118,7 +121,7 @@ libtess.GluMesh.prototype.checkMesh = function() {
libtess.assert(e.oNext.sym.lNext === e);
libtess.assert(e.org === v);
e = e.oNext;
} while(e !== v.anEdge);
} while (e !== v.anEdge);
}
libtess.assert(v.prev === vPrev && v.anEdge === null && v.data === null);

View File

@@ -35,14 +35,16 @@
// requre libtess.GluHalfEdge
/*global libtess */
/**
* Each vertex has a pointer to next and previous vertices in the
* circular list, and a pointer to a half-edge with this vertex as
* the origin (null if this is the dummy header). There is also a
* field "data" for client data.
*
* @param {libtess.GluVertex=} opt_nextVertex [description]
* @param {libtess.GluVertex=} opt_prevVertex [description]
* @param {libtess.GluVertex=} opt_nextVertex [description].
* @param {libtess.GluVertex=} opt_prevVertex [description].
* @constructor
*/
libtess.GluVertex = function(opt_nextVertex, opt_prevVertex) {
@@ -65,7 +67,7 @@ libtess.GluVertex = function(opt_nextVertex, opt_prevVertex) {
* @type {libtess.GluHalfEdge}
*/
this.anEdge = null;
/**
* The client's data.
* @type {Object}