Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes #227

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/node_modules/
13 changes: 10 additions & 3 deletions bimsurfer/src/BimServerModelLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@ define(["./BimServerModel", "./PreloadQuery", "./BimServerGeometryLoader", "./Bi

function BimServerModelLoader(bimServerClient, bimSurfer) {

var o = this;
var o = this;

// set default transformation matrix
this.globalTransformationMatrix = [
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1
];

this.loadFullModel = function(apiModel){
return new Promise(function(resolve, reject) {
Expand Down Expand Up @@ -58,15 +66,14 @@ define(["./BimServerModel", "./PreloadQuery", "./BimServerGeometryLoader", "./Bi

viewer.createModel(model.apiModel.roid);

var loader = new BimServerGeometryLoader(model.api, viewer, model, model.apiModel.roid, o.globalTransformationMatrix);
var loader = new BimServerGeometryLoader(model.apiModel.bimServerApi, viewer, model, model.apiModel.roid, o.globalTransformationMatrix);

loader.addProgressListener(function (progress, nrObjectsRead, totalNrObjects) {
if (progress == "start") {
console.log("Started loading geometries");
// self.fire("loading-started");
} else if (progress == "done") {
console.log("Finished loading geometries (" + totalNrObjects + " objects received)");
// self.fire("loading-finished");
viewer.taskFinished();
}
});
Expand Down
8 changes: 8 additions & 0 deletions bimsurfer/src/BimSurfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ define(deps, function (Notifier, Model, PreloadQuery, GeometryLoader, xeoViewer,
viewer.on("selection-changed", function() {
self.fire("selection-changed", arguments);
});

/**
* Fired when all models have finished loading
* @event loading-finished
*/
viewer.on("loading-finished", function() {
self.fire("loading-finished", arguments);
});

// This are arrays as multiple models might be loaded or unloaded.
this._idMapping = {
Expand Down
1 change: 1 addition & 0 deletions bimsurfer/src/xeoViewer/xeoViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ define([
spinner.processes--;
if (spinner.processes === 0) {
scene.ticksPerRender = 1; // Back to max speed, one render per tick
this.fire("loading-finished");
}
};

Expand Down