From ca5b5d056ee2fad294cc29ed837f63d49b673750 Mon Sep 17 00:00:00 2001 From: Val Erastov Date: Sun, 19 Jul 2015 21:03:54 -0700 Subject: [PATCH] mark all constructor with annotation --- web/app/engine.js | 9 ++++----- web/app/math/graph.js | 1 + web/app/math/lm.js | 1 + web/app/math/matrix.js | 2 ++ web/app/math/qr.js | 1 + web/app/math/vector.js | 5 ++--- web/app/sketcher/canvas.js | 14 ++++++++++++++ web/app/sketcher/constr/constraints.js | 8 ++++++++ web/app/sketcher/constr/solver.js | 2 ++ web/app/sketcher/helpers.js | 3 +-- web/app/sketcher/history.js | 1 + web/app/sketcher/io.js | 4 ++++ web/app/sketcher/main2d.js | 1 + web/app/sketcher/parametric.js | 16 ++++++++++++++++ web/app/sketcher/shapes/arc.js | 3 ++- web/app/sketcher/shapes/circle.js | 4 ++-- web/app/sketcher/shapes/dim.js | 10 +++++----- web/app/sketcher/shapes/segment.js | 4 ++-- web/app/ui.js | 2 ++ 19 files changed, 71 insertions(+), 20 deletions(-) diff --git a/web/app/engine.js b/web/app/engine.js index 2752c6a0..53fc66ad 100644 --- a/web/app/engine.js +++ b/web/app/engine.js @@ -306,7 +306,7 @@ TCAD.geom.extrude = function(source, target) { TCAD.geom.FACE_COUNTER = 0; -/** @Constructor **/ +/** @constructor */ TCAD.Solid = function(polygons, material) { THREE.Geometry.call( this ); this.dynamic = true; //true by default @@ -370,7 +370,7 @@ if (typeof THREE !== "undefined") { TCAD.Solid.prototype = Object.create( THREE.Geometry.prototype ); } -/** @Constructor **/ +/** @constructor */ TCAD.SketchFace = function(solid, poly) { var proto = poly.__face; poly.__face = this; @@ -429,9 +429,7 @@ TCAD.SketchFace.prototype.syncSketches = function(geom) { this.sketchGeom.depth = depth; }; -/** - * Polygon - **/ +/** @constructor */ TCAD.Polygon = function(shell, holes, normal) { if (!holes) { @@ -541,6 +539,7 @@ TCAD.Polygon.prototype.eachVertex = function(handler) { } }; +/** @constructor */ TCAD.Sketch = function() { this.group = new THREE.Object3D(); }; \ No newline at end of file diff --git a/web/app/math/graph.js b/web/app/math/graph.js index 8183a8de..4f7977aa 100644 --- a/web/app/math/graph.js +++ b/web/app/math/graph.js @@ -109,6 +109,7 @@ TCAD.graph.finaAllLoops = function(graph) { return loops; }; +/** @constructor */ TCAD.graph.Graph = function(data) { this.id = function(e) { diff --git a/web/app/math/lm.js b/web/app/math/lm.js index 68ed237a..088f5e32 100644 --- a/web/app/math/lm.js +++ b/web/app/math/lm.js @@ -74,6 +74,7 @@ * * * @version $Id: LevenbergMarquardtOptimizer.java 1416643 2012-12-03 19:37:14Z tn $ + * @constructor */ function LMOptimizer(startPoint, target, model, jacobian) { diff --git a/web/app/math/matrix.js b/web/app/math/matrix.js index f7356694..3ad1199b 100644 --- a/web/app/math/matrix.js +++ b/web/app/math/matrix.js @@ -1,4 +1,5 @@ +/** @constructor */ TCAD.math.Matrix = function(r, c) { this.data = []; this.rSize = r; @@ -119,6 +120,7 @@ TCAD.math.Matrix.prototype.norm = function(v) { return Math.sqrt(sum); }; +/** @constructor */ TCAD.math.Vector = function(n) { TCAD.math.Matrix.call(this, n, 1); }; diff --git a/web/app/math/qr.js b/web/app/math/qr.js index 458f7edd..7b8ab739 100644 --- a/web/app/math/qr.js +++ b/web/app/math/qr.js @@ -14,6 +14,7 @@ TCAD.math.Arrays_fill = function(a, fromIndex, toIndex,val) { a[i] = val; }; +/** @constructor */ TCAD.math.QR = function(matrix) { var vec = TCAD.math.vec; this.matrix = matrix; diff --git a/web/app/math/vector.js b/web/app/math/vector.js index 5c98dda9..8d8b428e 100644 --- a/web/app/math/vector.js +++ b/web/app/math/vector.js @@ -1,4 +1,5 @@ +/** @constructor */ TCAD.Vector = function(x, y, z) { this.x = x || 0; this.y = y || 0; @@ -112,9 +113,7 @@ TCAD.Vector.prototype.three = function() { return new THREE.Vector3(this.x, this.y, this.z); }; - - - +/** @constructor */ TCAD.Matrix = function() { this.reset(); }; diff --git a/web/app/sketcher/canvas.js b/web/app/sketcher/canvas.js index 83ce4e52..26a8f91e 100644 --- a/web/app/sketcher/canvas.js +++ b/web/app/sketcher/canvas.js @@ -63,6 +63,7 @@ TCAD.TWO.utils.setStyle = function(style, ctx, scale) { ctx.fillStyle = style.fillStyle; }; +/** @constructor */ TCAD.TWO.Viewer = function(canvas) { this.canvas = canvas; @@ -357,6 +358,7 @@ TCAD.TWO.Viewer.prototype.deselectAll = function() { while(this.selected.length > 0) this.selected.pop(); }; +/** @constructor */ TCAD.TWO.Layer = function(name, style) { this.name = name; this.style = style; @@ -369,6 +371,7 @@ TCAD.TWO.Viewer.prototype.fullHeavyUIRefresh = function() { this.parametricManager.notify(); }; +/** @constructor */ TCAD.TWO.Polygon = function(points) { this.points = points; this.style = null; @@ -391,6 +394,7 @@ TCAD.TWO.Polygon.prototype.draw = function(ctx) { ctx.stroke(); }; +/** @constructor */ TCAD.TWO.Polyline = function(points) { this.points = points; this.style = null; @@ -417,6 +421,7 @@ TCAD.TWO.utils.genID = function() { return TCAD.TWO.utils.ID_COUNTER ++; }; +/** @constructor */ TCAD.TWO.SketchObject = function() { this.id = TCAD.TWO.utils.genID(); this.aux = false; @@ -494,6 +499,7 @@ TCAD.TWO.SketchObject.prototype.draw = function(ctx, scale, viewer) { } }; +/** @constructor */ TCAD.TWO.Ref = function(value) { this.id = TCAD.TWO.utils.genID(); this.value = value; @@ -507,6 +513,7 @@ TCAD.TWO.Ref.prototype.get = function() { return this.value; }; +/** @constructor */ TCAD.TWO.Param = function(obj, prop) { this.id = TCAD.TWO.utils.genID(); this.obj = obj; @@ -521,6 +528,7 @@ TCAD.TWO.Param.prototype.get = function() { return this.obj[this.prop]; }; +/** @constructor */ TCAD.TWO.EndPoint = function(x, y) { TCAD.TWO.SketchObject.call(this); this.x = x; @@ -556,6 +564,7 @@ TCAD.TWO.EndPoint.prototype.drawImpl = function(ctx, scale) { TCAD.TWO.utils.drawPoint(ctx, this.x, this.y, 3, scale) }; +/** @constructor */ TCAD.TWO.Segment = function(a, b) { TCAD.TWO.SketchObject.call(this); this.a = a; @@ -619,6 +628,7 @@ TCAD.TWO.Segment.prototype.drawImpl = function(ctx, scale) { // ctx.restore(); }; +/** @constructor */ TCAD.TWO.Point = function(x, y, rad) { this.x = x; this.y = y; @@ -630,6 +640,7 @@ TCAD.TWO.Point.prototype.draw = function(ctx, scale) { TCAD.TWO.utils.drawPoint(ctx, this.x, this.y, this.rad, scale); }; +/** @constructor */ TCAD.TWO.CrossHair = function(x, y, rad) { this.x = x; this.y = y; @@ -653,6 +664,7 @@ TCAD.TWO.CrossHair.prototype.draw = function(ctx, scale) { ctx.restore(); }; +/** @constructor */ TCAD.TWO.ToolManager = function(viewer, defaultTool) { this.stack = [defaultTool]; var canvas = viewer.canvas; @@ -704,6 +716,7 @@ TCAD.TWO.ToolManager.prototype.getTool = function() { return this.stack[this.stack.length - 1]; }; +/** @constructor */ TCAD.TWO.PanTool = function(viewer) { this.viewer = viewer; this.dragging = false; @@ -795,6 +808,7 @@ TCAD.TWO.PanTool.prototype.mousewheel = function(e) { this.viewer.refresh(); }; +/** @constructor */ TCAD.TWO.DragTool = function(obj, viewer) { this.obj = obj; this.viewer = viewer; diff --git a/web/app/sketcher/constr/constraints.js b/web/app/sketcher/constr/constraints.js index d585c3f7..791a9db6 100644 --- a/web/app/sketcher/constr/constraints.js +++ b/web/app/sketcher/constr/constraints.js @@ -21,6 +21,7 @@ TCAD.constraints.create = function(name, params, values) { } }; +/** @constructor */ TCAD.constraints.Equal = function(params) { this.params = params; @@ -81,6 +82,7 @@ TCAD.constraints.Weighted = function(constr, weight) { }; +/** @constructor */ TCAD.constraints.EqualsTo = function(params, value) { this.params = params; @@ -96,6 +98,7 @@ TCAD.constraints.EqualsTo = function(params, value) { }; }; +/** @constructor */ TCAD.constraints.P2LDistance = function(params, distance) { this.params = params; @@ -178,6 +181,7 @@ TCAD.constraints.P2LDistance = function(params, distance) { }; +/** @constructor */ TCAD.constraints.P2LDistanceV = function(params) { this.params = params;//.slice(0, params.length -1); @@ -258,6 +262,7 @@ TCAD.constraints.P2LDistanceV = function(params) { }; +/** @constructor */ TCAD.constraints.P2PDistance = function(params, distance) { this.params = params; @@ -293,6 +298,7 @@ TCAD.constraints.P2PDistance = function(params, distance) { }; +/** @constructor */ TCAD.constraints.P2PDistanceV = function(params) { this.params = params; @@ -330,6 +336,7 @@ TCAD.constraints.P2PDistanceV = function(params) { }; +/** @constructor */ TCAD.constraints.Parallel = function(params) { this.params = params; @@ -363,6 +370,7 @@ TCAD.constraints.Parallel = function(params) { } }; +/** @constructor */ TCAD.constraints.Perpendicular = function(params) { this.params = params; diff --git a/web/app/sketcher/constr/solver.js b/web/app/sketcher/constr/solver.js index 2f22a7ad..4a163da3 100644 --- a/web/app/sketcher/constr/solver.js +++ b/web/app/sketcher/constr/solver.js @@ -1,5 +1,6 @@ TCAD.parametric = {}; +/** @constructor */ TCAD.parametric.Param = function(id, value) { this.id = id; this.value = value; @@ -15,6 +16,7 @@ TCAD.parametric.Param.prototype.get = function() { }; +/** @constructor */ TCAD.parametric.System = function(constraints) { this.constraints = constraints; this.params = []; diff --git a/web/app/sketcher/helpers.js b/web/app/sketcher/helpers.js index 255d0bb6..c80c372b 100644 --- a/web/app/sketcher/helpers.js +++ b/web/app/sketcher/helpers.js @@ -1,5 +1,4 @@ - - +/** @constructor */ TCAD.TWO.FilletTool = function(viewer) { this.viewer = viewer; }; diff --git a/web/app/sketcher/history.js b/web/app/sketcher/history.js index 229dcc91..d4bd1c0b 100644 --- a/web/app/sketcher/history.js +++ b/web/app/sketcher/history.js @@ -1,3 +1,4 @@ +/** @constructor */ TCAD.HistoryManager = function(viewer) { this.viewer = viewer; this.dmp = new diff_match_patch(); diff --git a/web/app/sketcher/io.js b/web/app/sketcher/io.js index bab42b08..ce24f23b 100644 --- a/web/app/sketcher/io.js +++ b/web/app/sketcher/io.js @@ -10,6 +10,7 @@ TCAD.io.Types = { VDIM : 'TCAD.TWO.VDimension' } +/** @constructor */ TCAD.IO = function(viewer) { this.viewer = viewer; }; @@ -286,6 +287,7 @@ TCAD.io._format = function(str, args) { }); }; +/** @constructor */ TCAD.io.PrettyColors = function() { var colors = ["#000000", "#00008B", "#006400", "#8B0000", "#FF8C00", "#E9967A"]; var colIdx = 0; @@ -294,6 +296,7 @@ TCAD.io.PrettyColors = function() { } } +/** @constructor */ TCAD.io.TextBuilder = function() { this.data = ""; this.fline = function (chunk, args) { @@ -311,6 +314,7 @@ TCAD.io.TextBuilder = function() { } } +/** @constructor */ TCAD.io.BBox = function() { var bbox = [Number.MAX_VALUE, Number.MAX_VALUE, - Number.MAX_VALUE, - Number.MAX_VALUE]; diff --git a/web/app/sketcher/main2d.js b/web/app/sketcher/main2d.js index 2692e452..d54a7690 100644 --- a/web/app/sketcher/main2d.js +++ b/web/app/sketcher/main2d.js @@ -1,5 +1,6 @@ TCAD.STORAGE_PREFIX = "TCAD.projects."; +/** @constructor */ TCAD.App2D = function() { var app = this; diff --git a/web/app/sketcher/parametric.js b/web/app/sketcher/parametric.js index d7643cc7..42a639f1 100644 --- a/web/app/sketcher/parametric.js +++ b/web/app/sketcher/parametric.js @@ -1,5 +1,6 @@ TCAD.TWO.Constraints = {}; +/** @constructor */ TCAD.TWO.SubSystem = function() { this.alg = 1; this.error = 0; @@ -7,6 +8,7 @@ TCAD.TWO.SubSystem = function() { this.constraints = []; }; +/** @constructor */ TCAD.TWO.ParametricManager = function(viewer) { this.viewer = viewer; this.subSystems = []; @@ -550,6 +552,7 @@ TCAD.TWO.Constraints.Factory = {}; // ------------------------------------------------------------------------------------------------------------------ // +/** @constructor */ TCAD.TWO.Constraints.Coincident = function(a, b) { this.a = a; this.b = b; @@ -582,6 +585,7 @@ TCAD.TWO.Constraints.Coincident.prototype.getObjects = function() { // ------------------------------------------------------------------------------------------------------------------ // +/** @constructor */ TCAD.TWO.Constraints.Lock = function(p, c) { this.p = p; this.c = c; @@ -612,6 +616,7 @@ TCAD.TWO.Constraints.Lock.prototype.getObjects = function() { // ------------------------------------------------------------------------------------------------------------------ // +/** @constructor */ TCAD.TWO.Constraints.Parallel = function(l1, l2) { this.l1 = l1; this.l2 = l2; @@ -641,6 +646,7 @@ TCAD.TWO.Constraints.Parallel.prototype.getObjects = function() { // ------------------------------------------------------------------------------------------------------------------ // +/** @constructor */ TCAD.TWO.Constraints.Perpendicular = function(l1, l2) { this.l1 = l1; this.l2 = l2; @@ -670,6 +676,7 @@ TCAD.TWO.Constraints.Perpendicular.prototype.getObjects = function() { // ------------------------------------------------------------------------------------------------------------------ // +/** @constructor */ TCAD.TWO.Constraints.P2LDistance = function(p, l, d) { this.p = p; this.l = l; @@ -702,6 +709,7 @@ TCAD.TWO.Constraints.P2LDistance.prototype.SettableFields = {'d' : "Enter the di // ------------------------------------------------------------------------------------------------------------------ // +/** @constructor */ TCAD.TWO.Constraints.P2LDistanceV = function(p, l, d) { this.p = p; this.l = l; @@ -732,6 +740,7 @@ TCAD.TWO.Constraints.P2LDistanceV.prototype.getSolveData = function() { // ------------------------------------------------------------------------------------------------------------------ // +/** @constructor */ TCAD.TWO.Constraints.P2PDistance = function(p1, p2, d) { this.p1 = p1; this.p2 = p2; @@ -764,6 +773,7 @@ TCAD.TWO.Constraints.P2PDistance.prototype.SettableFields = {'d' : "Enter the di // ------------------------------------------------------------------------------------------------------------------ // +/** @constructor */ TCAD.TWO.Constraints.P2PDistanceV = function(p1, p2, d) { this.p1 = p1; this.p2 = p2; @@ -794,6 +804,7 @@ TCAD.TWO.Constraints.P2PDistanceV.prototype.getSolveData = function() { // ------------------------------------------------------------------------------------------------------------------ // +/** @constructor */ TCAD.TWO.Constraints.Radius = function(arc, d) { this.arc = arc; this.d = d; @@ -823,6 +834,7 @@ TCAD.TWO.Constraints.Radius.prototype.SettableFields = {'d' : "Enter the radius // ------------------------------------------------------------------------------------------------------------------ // +/** @constructor */ TCAD.TWO.Constraints.RR = function(arc1, arc2) { this.arc1 = arc1; this.arc2 = arc2; @@ -851,6 +863,7 @@ TCAD.TWO.Constraints.RR.prototype.getObjects = function() { // ------------------------------------------------------------------------------------------------------------------ // +/** @constructor */ TCAD.TWO.Constraints.Vertical = function(line) { this.line = line; }; @@ -877,6 +890,7 @@ TCAD.TWO.Constraints.Vertical.prototype.getObjects = function() { // ------------------------------------------------------------------------------------------------------------------ // +/** @constructor */ TCAD.TWO.Constraints.Horizontal = function(line) { this.line = line; }; @@ -903,6 +917,7 @@ TCAD.TWO.Constraints.Horizontal.prototype.getObjects = function() { // ------------------------------------------------------------------------------------------------------------------ // +/** @constructor */ TCAD.TWO.Constraints.Tangent = function(arc, line) { this.arc = arc; this.line = line; @@ -933,6 +948,7 @@ TCAD.TWO.Constraints.Tangent.prototype.getObjects = function() { // ------------------------------------------------------------------------------------------------------------------ // +/** @constructor */ TCAD.TWO.Constraints.PointOnLine = function(point, line) { this.point = point; this.line = line; diff --git a/web/app/sketcher/shapes/arc.js b/web/app/sketcher/shapes/arc.js index 904485d4..48ac0038 100644 --- a/web/app/sketcher/shapes/arc.js +++ b/web/app/sketcher/shapes/arc.js @@ -1,4 +1,4 @@ - +/** @constructor */ TCAD.TWO.Arc = function(a, b, c) { TCAD.TWO.SketchObject.call(this); this.a = a; @@ -90,6 +90,7 @@ TCAD.TWO.Arc.prototype.stabilize = function(viewer) { viewer.parametricManager._add(new TCAD.TWO.Constraints.P2PDistanceV(this.a, this.c, this.r)); }; +/** @constructor */ TCAD.TWO.AddArcTool = function(viewer) { this.viewer = viewer; this.arc = null; diff --git a/web/app/sketcher/shapes/circle.js b/web/app/sketcher/shapes/circle.js index 7fa4f7b0..43ffb2c4 100644 --- a/web/app/sketcher/shapes/circle.js +++ b/web/app/sketcher/shapes/circle.js @@ -1,4 +1,4 @@ - +/** @constructor */ TCAD.TWO.Circle = function(c) { TCAD.TWO.SketchObject.call(this); this.c = c; @@ -40,7 +40,7 @@ TCAD.TWO.Circle.prototype.getDefaultTool = function(viewer) { return editTool; }; - +/** @constructor */ TCAD.TWO.EditCircleTool = function(viewer) { this.viewer = viewer; this.circle = null; diff --git a/web/app/sketcher/shapes/dim.js b/web/app/sketcher/shapes/dim.js index bcb14702..b575cd40 100644 --- a/web/app/sketcher/shapes/dim.js +++ b/web/app/sketcher/shapes/dim.js @@ -1,4 +1,4 @@ - +/** @constructor */ TCAD.TWO.LinearDimension = function(a, b) { TCAD.TWO.SketchObject.call(this); this.a = a; @@ -108,7 +108,7 @@ TCAD.TWO.LinearDimension.prototype.normalDistance = function(aim) { return -1; }; - +/** @constructor */ TCAD.TWO.Dimension = function(a, b) { TCAD.TWO.LinearDimension.call(this, a, b); }; @@ -117,7 +117,7 @@ TCAD.TWO.utils.extend(TCAD.TWO.Dimension, TCAD.TWO.LinearDimension); TCAD.TWO.Dimension.prototype._class = 'TCAD.TWO.Dimension'; - +/** @constructor */ TCAD.TWO.HDimension = function(a, b) { TCAD.TWO.LinearDimension.call(this, a, b); }; @@ -129,7 +129,7 @@ TCAD.TWO.HDimension.prototype._class = 'TCAD.TWO.HDimension'; TCAD.TWO.HDimension.prototype.getA = function() { return this.a }; TCAD.TWO.HDimension.prototype.getB = function() { return {x : this.b.x, y : this.a.y} }; - +/** @constructor */ TCAD.TWO.VDimension = function(a, b) { TCAD.TWO.LinearDimension.call(this, a, b); }; @@ -141,7 +141,7 @@ TCAD.TWO.VDimension.prototype._class = 'TCAD.TWO.VDimension'; TCAD.TWO.VDimension.prototype.getA = function() { return this.a }; TCAD.TWO.VDimension.prototype.getB = function() { return {x : this.a.x, y : this.b.y} }; - +/** @constructor */ TCAD.TWO.AddDimTool = function(viewer, layer, dimCreation) { this.viewer = viewer; this.layer = layer; diff --git a/web/app/sketcher/shapes/segment.js b/web/app/sketcher/shapes/segment.js index 1c64284b..02677dd1 100644 --- a/web/app/sketcher/shapes/segment.js +++ b/web/app/sketcher/shapes/segment.js @@ -1,4 +1,4 @@ - +/** @constructor */ TCAD.TWO.AddSegmentTool = function(viewer, multi) { this.viewer = viewer; this.line = null; @@ -75,7 +75,7 @@ TCAD.TWO.AddSegmentTool.prototype.keydown = function(e) { TCAD.TWO.AddSegmentTool.prototype.keypress = function(e) {}; TCAD.TWO.AddSegmentTool.prototype.keyup = function(e) {}; - +/** @constructor */ TCAD.TWO.AddPointTool = function(viewer) { this.viewer = viewer; }; diff --git a/web/app/ui.js b/web/app/ui.js index eb5e705a..6dca5611 100644 --- a/web/app/ui.js +++ b/web/app/ui.js @@ -1,6 +1,7 @@ TCAD.ui = {}; +/** @constructor */ TCAD.ui.Window = function(el) { this.root = el; var root = this.root; @@ -47,6 +48,7 @@ TCAD.ui.openWin = function(win, mouseEvent) { }; +/** @constructor */ TCAD.ui.List = function(el, model) { this.ul = el; this.template = this.ul.html();