Skip to content

Commit

Permalink
Merge pull request #23 from alja/del
Browse files Browse the repository at this point in the history
Add event navigation for collections test
  • Loading branch information
alja authored Jan 31, 2019
2 parents e6f9bb4 + 38f511f commit 7effb95
Show file tree
Hide file tree
Showing 7 changed files with 242 additions and 98 deletions.
27 changes: 24 additions & 3 deletions etc/eve7/EveManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,28 @@

// do we need this?
this.callSceneReceivers(scene, "beginChanges");

for (var r = 0; r < removedIds.length; ++r) {
var id = removedIds[r];
this.callSceneReceivers(scene, "elementRemoved", id);
var element = this.GetElement(id);
this.DeleteChildsOf(element);

for (var r = 0; r < removedIds.length; ++r)
this.callSceneReceivers(scene, "elementRemoved", removedIds[r]);
// remove from mother
var mother = this.map[element.fMotherId];
var mc = mother.childs;

for (var i = 0; i < mc.length; ++i) {
console.log("comapre ", mc[i], id);
if (mc[i].fElementId === id) {
console.log("remove from mother ");
mc.splice(i, 1);
}
}
delete this.map[id];
element = null;
}

// wait for binary if needed
if (msg.header.fTotalBinarySize)
{
Expand Down Expand Up @@ -350,13 +368,16 @@
em.tag = "elementAdded";
this.callSceneReceivers(scene, "sceneElementChange", em);
}
this.InvokeReceivers("elem_update", null, 0, em.fElementId);
}


var treeRebuild = header.removedElements.length || (arr.length != nModified );
if (treeRebuild) this.InvokeReceivers("update", null, 0, this);

this.callSceneReceivers(scene, "endChanges", treeRebuild);
},
//______________________________________________________________________________


EveManager.prototype.DeleteChildsOf = function(elem) {
if (!elem || !elem.childs) return;
Expand Down
12 changes: 11 additions & 1 deletion etc/eve7/EveScene.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@

/** Called when processing changes from server or from interactive handler */
EveScene.prototype.setElementHighlighted = function(mstrid, col, indx, from_interactive) {

// check if other element was highlighted at same time - redraw it
if (this.highlight && (this.highlight.id != mstrid)) {
delete this.highlight;
Expand Down Expand Up @@ -396,7 +395,18 @@
this[msg.tag](el);
}

EveScene.prototype.elementRemoved = function(elId) {
var el = this.mgr.GetElement(elId);
console.log("EveScene elementRemoved ", el);
var obj3d = this.getObj3D(el.fElementId);

var container = this.viewer.getThreejsContainer("scene" + this.id);
container.remove(obj3d);

delete this.id2obj_map[el.fElementId];

}

JSROOT.EVE.EveScene = EveScene;

return JSROOT;
Expand Down
9 changes: 9 additions & 0 deletions etc/eve7/EveTable.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ sap.ui.define([
},

findTable: function(holder) {
console.log("find table in ", holder);
if ( holder.fRnrSelf && holder._typename == "ROOT::Experimental::REveDataTable" )
return holder;

Expand Down Expand Up @@ -318,6 +319,14 @@ sap.ui.define([
endChanges : function() {
console.log("table controller endchanges ",this.tableEveElement );
this.setEveData();
},


elementRemoved: function(elId) {

var el = this.mgr.GetElement(elId);
console.log("EveTable element remobedf ", el);

}
});
});
4 changes: 4 additions & 0 deletions etc/eve7/Summary.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,10 @@ sap.ui.define([
}

return tgt;
},

endChanges: function(rebuild) {
if (rebuild) updateManger(this.mgr);
}

});
Expand Down
1 change: 1 addition & 0 deletions graf3d/eve7/inc/ROOT/REveDataClasses.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public:

void ReserveItems(Int_t items_size) { fItems.reserve(items_size); }
void AddItem(void *data_ptr, const std::string& n, const std::string& t);
void ClearItems() { fItems.clear(); }

void SetFilterExpr(const TString &filter);
void ApplyFilter();
Expand Down
5 changes: 3 additions & 2 deletions graf3d/eve7/src/REveDataProxyBuilderBase.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ REveDataProxyBuilderBase::Product::Product(const REveViewContext* c) : m_viewCon
REveDataProxyBuilderBase::REveDataProxyBuilderBase(std::string type):
m_type(type),
m_collection(0),
m_interactionList(0),
m_haveWindow(false)
{
}
Expand Down Expand Up @@ -74,7 +75,7 @@ void REveDataProxyBuilderBase::Build()
Clean();
for (Product_it i = m_products.begin(); i != m_products.end(); ++i)
{
//printf("build() %s \n", m_collection->name().c_str());
printf("build() %s \n", m_collection->GetCName());
REveElement* elms = (*i)->m_elements;
size_t oldSize = elms->NumChildren();

Expand Down Expand Up @@ -134,7 +135,7 @@ void REveDataProxyBuilderBase::Build()
for (size_t cnt = 0; cnt < itemSize; ++cnt, ++elIt)
{
if (cnt >= oldSize )
m_interactionList->Added(*elIt, cnt);
m_interactionList->Added(*elIt, cnt);
}
}
}
Expand Down
Loading

0 comments on commit 7effb95

Please sign in to comment.