Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ContextQueryControls.prototype.__sendSearchQuery = function (query) {
if (typeof query === 'string') {
query = { queryString: query };
}
this.__showQueryContainer(); // Make sure query container is visible
this.searchController.source = this.defaultSource;
this.searchController.search(_.defaults({ searchText: query.queryString, start: 0 }, query.customOptions), null, {
isExpandedGroup: query.isExpandedGroup, ensureGroupedModelsUnique: true });
this.uilog.log(UILog.EVENT.CONTEXT_QUERY_MODELS_STARTED, event, { queryString: query.queryString });
};
SceneEditUI.prototype.paste = function (event) {
var copiedObjectInfo = this.copiedObjectInfo;
if (copiedObjectInfo) {
var pastedObjectInfo = Object3DUtil.copyObjectWithModelInstances(copiedObjectInfo.object, copiedObjectInfo.modelInstances);
this.sceneState.pasteObject(pastedObjectInfo.object, pastedObjectInfo.modelInstances);
if (this.editControls.enabled) {
this.editControls.onInsert(pastedObjectInfo.object);
}
var newModelInst = Object3DUtil.getModelInstance(pastedObjectInfo.object);
var objInfo = newModelInst.getUILogInfo(true);
this.uilog.log(UILog.EVENT.MODEL_PASTE, event, objInfo);
this.Publish('PasteCompleted');
}
};
SceneEditUI.prototype.__contextQueryControlsOnClickResult = function (source, id, result, elem, index) {
this.uilog.log(UILog.EVENT.CONTEXT_QUERY_SELECT, null,
{ type: 'model', source: source, id: id, index: index }
);
this.loadModel(source, id);
};
SceneEditUI.prototype.redo = function (event) {
this.undoStack.redo();
if (this.editControls) {
this.editControls.update();
}
this.uilog.log(UILog.EVENT.UNDOSTACK_REDO, event, {});
};
SceneEditUI.prototype.deleteObject = function (obj, event) {
this.editControls.detach();
var mInst = Object3DUtil.getModelInstance(obj);
var index = this.sceneState.modelInstances.indexOf(mInst);
this.sceneState.removeObjects([index]);
this.onSceneUpdated();
var objInfo = mInst.getUILogInfo(true);
this.uilog.log(UILog.EVENT.MODEL_DELETE, event, objInfo);
this.undoStack.pushCurrentState(Constants.CMDTYPE.DELETE);
this.Publish('DeleteObject', obj, mInst);
};
SceneEditUI.prototype.tumbleObject = function (obj, event) {
var mInst = Object3DUtil.getModelInstance(obj);
var cmdParams = { object: mInst, tumble: true };
this.Publish(Constants.EDIT_OPSTATE.INIT, Constants.CMDTYPE.SWITCHFACE, cmdParams);
Object3DUtil.tumble(obj);
this.Publish(Constants.EDIT_OPSTATE.DONE, Constants.CMDTYPE.SWITCHFACE, cmdParams);
var objInfo = mInst.getUILogInfo();
this.uilog.log(UILog.EVENT.MODEL_TUMBLE, event, objInfo);
};
modelSearchController.Subscribe('startSearch', this, function (query) {
scope.uilog.log(UILog.EVENT.SEARCH_QUERY, null, { type: 'model', queryString: query });
});
return modelSearchController;
ContextQueryControls.prototype.search = function () {
var searchTerm = this.searchController.getSearchText('');
if (searchTerm) {
var searchQuery = this.__getSearchTermQuery(searchTerm);
this.uilog.log(UILog.EVENT.CONTEXT_QUERY_SEARCH, null, { query: searchQuery, searchTerm: searchTerm });
this.searchController.search(searchQuery);
}
};
SceneEditUI.prototype.onModelLoadError = function (modelId) {
this.setCursorStyle('initial');
this.setIsModelLoading(false);
this.uilog.log(UILog.EVENT.MODEL_LOAD, null, { modelId: modelId, progress: 'finished', status: 'ERROR' });
};
SceneEditUI.prototype.copy = function (event) {
if (this.editControls.selected) {
var object = this.editControls.selected;
this.sceneState.assignObjectIndices();
this.copiedObjectInfo = Object3DUtil.copyObjectWithModelInstances(object, this.sceneState.modelInstances);
var objInfo = ModelInstance.getUILogInfo(object, true);
this.uilog.log(UILog.EVENT.MODEL_COPY, event, objInfo);
this.Publish('CopyCompleted');
}
};