Skip to content

Commit

Permalink
Merge pull request #1 from alja/reve-selection4
Browse files Browse the repository at this point in the history
Server-client highlight
  • Loading branch information
Mourtz authored Apr 18, 2019
2 parents 4e3272d + bc2a6e8 commit 997332f
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 14 deletions.
21 changes: 21 additions & 0 deletions js/scripts/JSRoot3DPainter.js
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,27 @@
}

control.MainProcessMouseMove = function(evnt) {
// check timeout
var toutval = 100;

// first time
var dt = new Date();
if (!this.mouse_tmout) {
this.mouse_tmout = setTimeout(this.MainProcessMouseMove.bind(this,evnt), toutval);
this.tt = dt.getTime();
return;
}
else {
var tdiff = dt.getTime() - this.tt;
if (tdiff < toutval) {
clearTimeout(this.mouse_tmout);
this.mouse_tmout = setTimeout(this.MainProcessMouseMove.bind(this,evnt), tdiff);
return;
}
}
this.tt = dt.getTime();
//console.log("control.MainProcessMouseMove");

if (this.control_active && evnt.buttons && (evnt.buttons & 2))
this.block_ctxt = true; // if right button in control was active, block next context menu

Expand Down
27 changes: 17 additions & 10 deletions ui5/eve7/lib/EveScene.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ sap.ui.define([
EveScene.prototype.processElementSelected = function(obj3d, col, indx, evnt)
{
// MT BEGIN

console.log("EveScene.prototype.processElementSelected", obj3d, col, indx, evnt);

var is_multi = evnt && evnt.ctrlKey;
Expand Down Expand Up @@ -344,17 +343,23 @@ sap.ui.define([
/** interactive handler */
EveScene.prototype.processElementHighlighted = function(obj3d, col, indx, evnt)
{
var id = obj3d.mstrId;
// id = obj3d.eveId;
console.log("EveScene.prototype.processElementHighlighted", obj3d, col, indx, evnt);

// MT XXXX
// console.log("EveScene.prototype.processElementHighlighted", obj3d, col, indx, evnt);
var is_multi = false;
var is_secsel = indx !== undefined;

this.setElementHighlighted(id, col, indx, true);
var fcall = "NewElementPicked(" + obj3d.eveId + `, ${is_multi}, ${is_secsel}`;
if (is_secsel)
{
fcall += ", { " + (Array.isArray(indx) ? indx.join(", ") : indx) + " }";
}
fcall += ")";

this.mgr.invokeInOtherScenes(this, "setElementHighlighted", id, col, indx);
this.mgr.SendMIR({ "mir": fcall,
"fElementId": this.mgr.global_highlight_id,
"class": "REX::REveSelection"
});

// when true returns, controller will not try to render itself
return true;
}

Expand Down Expand Up @@ -459,9 +464,11 @@ sap.ui.define([

EveScene.prototype.SelectElement = function(selection_obj, element_id, sec_idcs)
{
var stype = selection_obj.fName.endsWith("Selection") ? "select" : "highlight";
var estype = THREE.OutlinePass.selection_enum[stype];

let res = {
"sel_type": THREE.OutlinePass.selection_enum["select"],
// "sel_type": THREE.OutlinePass.selection_enum["highlight"],
"sel_type": estype,
"sec_sel": false,
"geom": []
};
Expand Down
10 changes: 6 additions & 4 deletions ui5/eve7/lib/OutlinePass.js
Original file line number Diff line number Diff line change
Expand Up @@ -802,16 +802,18 @@ THREE.OutlinePass.selection_enum = {

THREE.OutlinePass.selection_atts = [
{
visibleEdgeColor: new THREE.Color( 1, 0, 0 ),
hiddenEdgeColor: new THREE.Color( 0.1, 0.04, 0.02 )
visibleEdgeColor: new THREE.Color( 1, 0, 1 ),
hiddenEdgeColor: new THREE.Color( 1, 0, 1 )
// hiddenEdgeColoe: new THREE.Color( 0.1, 0.04, 0.02 )
// edgeGlow: 0.0,
// usePatternTexture: false,
// edgeThickness: 1.0,
// edgeStrength: 3.0,
},
{
visibleEdgeColor: new THREE.Color( 0, 0, 1 ),
hiddenEdgeColor: new THREE.Color( 0.1, 0.04, 0.02 )
visibleEdgeColor: new THREE.Color( 0, 1, 1 ),
hiddenEdgeColor: new THREE.Color( 0, 1, 1 )
// hiddenEdgeColor: new THREE.Color( 0.1, 0.04, 0.02 )
// edgeGlow: 0.0,
// usePatternTexture: false,
// edgeThickness: 1.0,
Expand Down

0 comments on commit 997332f

Please sign in to comment.