awv3
Version:
⚡ AWV3 embedded CAD
75 lines (54 loc) • 2.78 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = require('babel-runtime/helpers/createClass');
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = require('babel-runtime/helpers/inherits');
var _inherits3 = _interopRequireDefault(_inherits2);
var _three = require('three');
var THREE = _interopRequireWildcard(_three);
var _ccref = require('../ccref');
var _ccref2 = _interopRequireDefault(_ccref);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var BaseGraphics = function (_THREE$Object3D) {
(0, _inherits3.default)(BaseGraphics, _THREE$Object3D);
function BaseGraphics() {
(0, _classCallCheck3.default)(this, BaseGraphics);
return (0, _possibleConstructorReturn3.default)(this, (BaseGraphics.__proto__ || (0, _getPrototypeOf2.default)(BaseGraphics)).apply(this, arguments));
}
(0, _createClass3.default)(BaseGraphics, [{
key: 'updateCoordinateSystem',
value: function updateCoordinateSystem(coordinateSystem) {
this.matrix.copy(coordinateSystem);
this.matrix.decompose(this.position, this.quaternion, this.scale);
this.matrixWorldNeedsUpdate = true;
}
}, {
key: 'updateFromGeomParams',
value: function updateFromGeomParams(geomParams) {
this.updateCoordinateSystem(geomParams.coordinateSystem);
}
}, {
key: 'updateMetaBox',
value: function updateMetaBox() {
this.localMesh.material.meta.box = this.updateBounds().bounds.box;
}
}, {
key: 'updateFromSketcherAndId',
value: function updateFromSketcherAndId(sketcher, id) {
if (this.localMesh) this.localMesh.material.meta.id = id;
sketcher.constraintVisualizer.updateEntity(new _ccref2.default(sketcher, id));
}
}]);
return BaseGraphics;
}(THREE.Object3D);
exports.default = BaseGraphics;