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

#1238 and #1239, adds badges to results and external handler for filter events #374

Draft
wants to merge 19 commits into
base: VFBv2.2.0.7
Choose a base branch
from
Draft
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
25 changes: 25 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Geppetto Client Workflow

on:
push:
pull_request:
workflow_dispatch:

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 15.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm run test
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

10 changes: 10 additions & 0 deletions __tests__/ModelFactory.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ test('Merge models', () => {
let diffReport = GEPPETTO.ModelFactory.mergeModel(testModel);
expect(diffReport.variables.length).toBe(0);

testModel.worlds[0].instances[0].name = 'aa';
testModel.worlds[0].instances[0].value.json = "{\"l\": [\"xx\", \"y\"]}";
diffReport = GEPPETTO.ModelFactory.mergeModel(testModel);
expect(diffReport.variables.length).toBe(0); // The diffReport is only about new items

expect(geppettoModel.getCurrentWorld().getInstances()[0].getName()).toBe('aa');
expect(geppettoModel.getCurrentWorld().getInstances()[0].getValue().l[0]).toBe('xx');
expect(Instances.a.getName()).toBe('aa');
expect(Instances.a.getValue().l[0]).toBe('xx');

expect(ModelFactory.allPaths.length).toBe(11);
GEPPETTO.Manager.addVariableToModel(testModel);
expect(ModelFactory.allPaths.length).toBe(11);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ define(['jquery'], function () {


function ModalFactory () {
/*
* Due to a bootstrap bug, multiple modals can't be open at same
* time. This line allows multiple modals to be open
* simultaneously without going in an infinite loop.
*/
$.fn.modal.Constructor.prototype.enforceFocus = function () {
};

}

ModalFactory.prototype
Expand Down
89 changes: 44 additions & 45 deletions geppetto-client/js/components/interface/3dCanvas/ThreeDEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,51 +30,50 @@ define(['jquery'], function () {
THREE.ShaderPass = require('imports-loader?THREE=three!exports-loader?THREE.ShaderPass!three\/examples\/js\/postprocessing\/ShaderPass');
THREE.FilmPass = require('imports-loader?THREE=three!exports-loader?THREE.FilmPass!three\/examples\/js\/postprocessing\/FilmPass');

class ThreeDEngine {
constructor (container, viewerId) {
this.container = container;
this.colorController = new (require('./ColorController'))(this);
this.viewerId = viewerId;
// Engine components
this.scene = new THREE.Scene();
this.camera = null;
this.controls = null;
this.renderer = null;
this.stats = null;
this.projector = null;
this.sceneCenter = new THREE.Vector3();
this.cameraPosition = new THREE.Vector3();
this.mouse = { x: 0, y: 0 };
// The content of the scene
this.meshes = {};
this.splitMeshes = {};
this.connectionLines = {};
this.visualModelMap = {};
this.complexity = 0;
this.sceneMaxRadius = 0; // maximum radius of bounding sphere in scene
this.linePrecisionMinRadius = 300; // Default expected minimum radius
this.minAllowedLinePrecision = 1; // default line precision, can't go lower than this
// Settings
this.linesThreshold = 2000;
this.baseZoom = 1;
this.aboveLinesThreshold = false;
this.wireframe = false;
this.isAnimated = false;
this.debugUpdate = false;
this.needsUpdate = false;
this.pickingEnabled = true; // flag to enable disable 3d picking
this.linesUserInput = false;
this.linesUserPreference = undefined;
this.hoverListeners = undefined;
this.THREE = THREE;
// Initialisation
this.setupCamera();
this.setupRenderer();
this.setupLights();
this.setupControls();
this.setupListeners();
this.animate();
}
function ThreeDEngine (container, viewerId) {
this.container = container;
this.colorController = new (require('./ColorController'))(this);
this.viewerId = viewerId;
// Engine components
this.scene = new THREE.Scene();
this.camera = null;
this.controls = null;
this.renderer = null;
this.stats = null;
this.projector = null;
this.sceneCenter = new THREE.Vector3();
this.cameraPosition = new THREE.Vector3();
this.mouse = { x: 0, y: 0 };
// The content of the scene
this.meshes = {};
this.splitMeshes = {};
this.connectionLines = {};
this.visualModelMap = {};
this.complexity = 0;
this.sceneMaxRadius = 0; // maximum radius of bounding sphere in scene
this.linePrecisionMinRadius = 300; // Default expected minimum radius
this.minAllowedLinePrecision = 1; // default line precision, can't go lower than this
// Settings
this.linesThreshold = 2000;
this.baseZoom = 1;
this.aboveLinesThreshold = false;
this.wireframe = false;
this.isAnimated = false;
this.debugUpdate = false;
this.needsUpdate = false;
this.pickingEnabled = true; // flag to enable disable 3d picking
this.linesUserInput = false;
this.linesUserPreference = undefined;
this.hoverListeners = undefined;
this.THREE = THREE;

// Initialisation
this.setupCamera();
this.setupRenderer();
this.setupLights();
this.setupControls();
this.setupListeners();
this.animate();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ define(function (require) {
GEPPETTO.WidgetsListener.subscribe(that, id);

// updates helpc command output
GEPPETTO.CommandController.updateHelpCommand(tvdat, id, that.getFileComments("geppetto/node_modules/@geppettoengine/geppetto-client/js/components/widgets/treevisualiser/treevisualiserdat/TreeVisualiserDAT.js"));
GEPPETTO.CommandController.updateHelpCommand(tvdat, id, that.getFileComments("geppetto/node_modules/@geppettoengine/geppetto-client/components/widgets/treevisualiser/treevisualiserdat/TreeVisualiserDAT.js"));
// update tags for autocompletion
GEPPETTO.CommandController.updateTags(tvdat.getId(), tvdat);

Expand Down
40 changes: 23 additions & 17 deletions geppetto-core/src/ModelFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -914,43 +914,49 @@ export default function (GEPPETTO) {
const wrappedObj = parent.wrappedObj;
const diffReportInst = [];

if (wrappedObj.instances == undefined) {
wrappedObj.instances = [];
}

for (var x = 0; x < diffInst.length; x++) {
if (diffInst[x].getWrappedObj().synched == true) {
// if synch placeholder var, skip it
continue;
}

var match = currentModelInst.find(currModelVar => diffInst[x].getPath() == currModelVar.getPath());

// if no match, add it, it's actually new
if (!match) {

if (wrappedObj.instances == undefined) {
wrappedObj.instances = [];
}

diffInst[x].parent = this.geppettoModel;

this.populateTypeReferences(diffInst[x]);

const match = currentModelInst[diffInst[x].getId()];
if (match) {
const matchIdx = currentModelInst.findIndex(currModelVar => diffInst[x].getPath() == currModelVar.getPath());
currentModelInst[matchIdx] = diffInst[x];
currentModelInst[match.getId()] = diffInst[x];
Instances[match.getId()] = diffInst[x];
} else {
// if no match, add it, it's actually new
diffReportInst.push(diffInst[x]);
// append variable to raw model
wrappedObj.instances.push(diffInst[x].getWrappedObj());

// add variable to geppetto object model
diffInst[x].parent = this.geppettoModel;

currentModelInst.push(diffInst[x]);


// populate references for new vars
this.populateTypeReferences(diffInst[x]);


// find new potential instance paths and add to the list
const newInstancePath = createInstancePathObj(diffInst[x]);
this.allPaths.push(newInstancePath);
this.allPathsIndexing.push(newInstancePath);

diffReportInst.push(diffInst[x]);

// let's populate the shortcut in the parent of the variable, this might not exist if it was a fetch
this.geppettoModel[diffInst[x].getId()] = diffInst[x];

// window.Instances.push(diffInst[x]);

this.geppettoModel[diffInst[x].getId()] = diffInst[x];
}

}
return diffReportInst;
},
Expand Down
Loading