-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathWorkingstep.js
More file actions
98 lines (71 loc) · 2.38 KB
/
Workingstep.js
File metadata and controls
98 lines (71 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/* $RCSfile: Workingstep.js,v $
* $Revision: 1.10 $ $Date: 2012/08/14 18:58:30 $
* Auth: Jochen Fritz (jfritz@steptools.com)
*
* Copyright (c) 1991-2012 by STEP Tools Inc.
* All Rights Reserved.
*
* Permission to use, copy, modify, and distribute this software and
* its documentation is hereby granted, provided that this copyright
* notice and license appear on all copies of the software.
*
* STEP TOOLS MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. STEP TOOLS
* SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
* RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
* DERIVATIVES.
*
* ----------------------------------------
*/
"use strict";
function Workingstep(builder, id)
{
var ret = builder.make(id, this, "Workingstep");
if (ret) return ret;
var el = builder.getElement(id);
this.initExecutable(builder, el);
var or = el["orientation"];
if (or) {
this.xform = new Placement(builder, or).xform;
}
this.op = new Operation(builder, el["op"]);
}
Executable.RegisterSubtype("Workingstep", Workingstep);
SUBTYPE(Executable, Workingstep);
METHODS (Workingstep, {
getName : function() {return "Workingstep";},
getOperation : function() {return this.op;},
getBoundingBox : function() {
var ret = new BoundingBox();
ret.updateFrom(this.op.getBoundingBox(), this.xform);
return ret;
},
makeSceneGraph : function(cx, loadables, xform) {
var ret = new SGNode(cx, this, xform, this.xform);
xform = ret.getXform();
ret.appendChild(this.op.makeSceneGraph(cx, loadables, xform));
this.makeSceneGraphExecutable(cx, loadables);
return ret;
},
makeProjectTree : function(dom_parent, tn) {
var doc = dom_parent.ownerDocument;
var li = doc.createElement("li");
li.treenode = tn;
li.onclick = function() {
this.treenode.setActive();
this.treenode.redraw();
};
dom_parent.appendChild(li);
this.appendTreeText(li, this.name);
},
setToolpathPos : function(ctl, tn, offset) {
offset = get_float(offset);
if (offset < 0.)
offset = 0.;
else if (offset > this.op.length)
offset = this.op.length;
ctl.setToolpath(this.op.length, offset);
}
});