mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-07 17:04:58 +01:00
43 lines
1 KiB
JavaScript
43 lines
1 KiB
JavaScript
|
|
TCAD.UI = function(app) {
|
|
this.app = app;
|
|
this.viewer = app.viewer;
|
|
this.dat = new dat.GUI();
|
|
var gui = this.dat;
|
|
|
|
gui.TEXT_CLOSED = 'XXX Controls';
|
|
gui.TEXT_OPEN = 'Open FFF';
|
|
|
|
var actionsF = gui.addFolder('Add Object');
|
|
var actions = new TCAD.UI.Actions(this);
|
|
actionsF.add(actions.tools, 'polygon');
|
|
actionsF.add(actions.tools, 'line');
|
|
actionsF.add(actions.tools, 'commit');
|
|
actionsF.add(actions.tools, 'edit');
|
|
actionsF.open();
|
|
|
|
// var propsF = gui.addFolder('Properties');
|
|
// propsF.add(object3DProto.position, 'x');
|
|
};
|
|
|
|
TCAD.UI.Actions = function(scope) {
|
|
|
|
this.tools = {
|
|
polygon : function() {
|
|
scope.viewer.toolMgr.tool = new TCAD.PolygonTool(scope.viewer.selectionMgr.selection[0], scope.viewer);
|
|
},
|
|
|
|
line : function() {
|
|
scope.viewer.toolMgr.tool = new TCAD.LineTool(scope.viewer.selectionMgr.selection[0]);
|
|
},
|
|
|
|
commit : function() {
|
|
scope.viewer.toolMgr.commit();
|
|
},
|
|
|
|
edit : function() {
|
|
scope.app.sketchFace();
|
|
}
|
|
|
|
}
|
|
};
|