Skip to content
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
Binary file removed builtins/rendercore/RenderCore-1.9.tar.gz
Binary file not shown.
Binary file added builtins/rendercore/RenderCore-2.0.tar.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions cmake/modules/SearchInstalledSoftware.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1647,8 +1647,8 @@ if(webgui)
endif()
ExternalProject_Add(
RENDERCORE
URL ${CMAKE_SOURCE_DIR}/builtins/rendercore/RenderCore-1.9.tar.gz
URL_HASH SHA256=7728f00ee5e907c36b25aad56fbc73881c7c9faf47a36bee5efd2054bc4ecc6c
URL ${CMAKE_SOURCE_DIR}/builtins/rendercore/RenderCore-2.0.tar.gz
URL_HASH SHA256=6bdcf70fbdec1f950057ab1df722775c468ad6894f8a364f15f589d58c326667
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
Expand Down
6 changes: 6 additions & 0 deletions graf3d/eve7/src/REveGeoPolyShape.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ void REveGeoPolyShape::BuildFromShape(TGeoShape *shape, Int_t n_seg)

REveGeoManagerHolder gmgr(REveGeoShape::GetGeoManager(), n_seg);

if (!shape->MakeBuffer3D())
{
std::cout << "Shape " << shape->GetName() << " has empty TBuffer3D\n";
return;
}

std::unique_ptr<TBuffer3D> b3d(shape->MakeBuffer3D());

SetFromBuff3D(*b3d.get());
Expand Down
57 changes: 46 additions & 11 deletions graf3d/eve7/src/REveGeoTopNode.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ void REveGeomHierarchy::WebWindowCallback(unsigned connid, const std::string &ar
using namespace std::string_literals;
REveGeomDescription &eveDesc = dynamic_cast<REveGeomDescription &>(fDesc);

REveGeoManagerHolder gmgr(REveGeomDescription::GetGeoManager());
REveGeoManagerHolder gmgr(REveGeomDescription::GetGeoManager());
if (arg.compare(0, 6, "CDTOP:") == 0)
{
std::vector<std::string> ep;
Expand Down Expand Up @@ -195,13 +195,50 @@ void REveGeomHierarchy::WebWindowCallback(unsigned connid, const std::string &ar
stack.insert(stack.begin(), base.begin(), base.end());

if (path && eveDesc.ChangeEveVisibility(stack, REveGeomDescription::kRnrSelf, on)) {
std::cout << "Set visibilty rnr PHY \n";
std::cout << "Set visibility rnr PHY \n";
REveManager::ChangeGuard ch;
fReceiver->VisibilityChanged(on, REveGeomDescription::kRnrSelf, stack);
}
}
}
else if (arg.compare(0, 9, "PrintInfo") == 0)
{
auto a = TBufferJSON::FromJSON<std::vector<std::string>>(arg.substr(10));
auto prefix = eveDesc.GetApexPath();

std::ostringstream oss;
if (!prefix.empty()) {
a->erase(a->begin());
a->insert(a->begin(), prefix.begin(), prefix.end());
std::string topName = eveDesc.GetGeoManager()->GetTopNode()->GetName();
// strip "_1"
// TGeoNodeInterator does not hold _1 in the top node
if (topName.rfind("_1") != std::string::npos) {
topName = topName.substr(0, topName.size() - 2);
}
oss << topName << "/";
}
for (size_t i = 0; i < a->size(); ++i) {
if (i > 0)
oss << "/";
oss << a->at(i);
}

std::string targetPath = oss.str();
const char* savedPath = gGeoManager->GetPath();
bool res = gGeoManager->cd(targetPath.c_str());
printf("Node path:\n%s \n", targetPath.c_str());
if (res) {
TGeoNode* node = gGeoManager->GetCurrentNode();
node->GetVolume()->InspectShape();

}
else {
printf("ERROR locating the node with given path\n");
}
gGeoManager->cd(savedPath);

}
else {
RGeomHierarchy::WebWindowCallback(connid, arg);
}
Expand Down Expand Up @@ -431,9 +468,7 @@ bool REveGeoTopNodeViz::AcceptNode(TGeoIterator &it, bool skip) const
// printf("accep mkod eleaf node ptr %p \n", (void*)it.GetNode(it.GetLevel()));
if (it.GetNode(it.GetLevel())->GetNdaughters())
return false;
}
else if (fMode == EMode::kModeMixed)
{
} else if (fMode == EMode::kModeMixed) {
if (it.GetLevel() > fGeoData->fDesc.GetVisLevel()) {
if (skip) it.Skip();
return false;
Expand Down Expand Up @@ -495,18 +530,18 @@ void REveGeoTopNodeViz::BuildDesc()

timer.Stop();

printf("Real time: %.3f s\n", timer.RealTime());
printf("CPU time: %.3f s\n", timer.CpuTime());
printf("Collect Shapes Real time: %.3f s\n", timer.RealTime());
// printf("CPU time: %.3f s\n", timer.CpuTime());

// node array
timer.Start();
CollectNodes(top->GetVolume(), fNodes, fShapes);
std::cout << "Node size " << fNodes.size() << "\n";
// std::cout << "Node size " << fNodes.size() << "\n";

timer.Stop();

printf("NODES Real time: %.3f s\n", timer.RealTime());
printf("NODES CPU time: %.3f s\n", timer.CpuTime());
printf("Collect Nodes Real time: %.3f s\n", timer.RealTime());
// printf("NODES CPU time: %.3f s\n", timer.CpuTime());

StampObjProps();
}
Expand Down Expand Up @@ -791,7 +826,7 @@ int REveGeoTopNodeViz::WriteCoreJson(nlohmann::json &j, Int_t rnr_offset)
if (box) {
const Double_t *origin = box->GetOrigin();

printf("BBox center: (%f, %f, %f)\n", origin[0], origin[1], origin[2]);
// printf("BBox center: (%f, %f, %f)\n", origin[0], origin[1], origin[2]);
//printf("origin lengths: (%f, %f, %f)\n", origin[0], origin[1], origin[2]);

auto jbb = json::array();
Expand Down
15 changes: 10 additions & 5 deletions tutorials/visualisation/eve7/lineset.C
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,23 @@ REX::REveStraightLineSet *makeLineSet(Int_t nlines = 40, Int_t nmarkers = 4, boo
void lineset(bool secondarySelect = true)
{
auto eveMng = REX::REveManager::Create();
// eveMng->AllowMultipleRemoteConnections(false, false);

auto ls1 = makeLineSet(50, 10, secondarySelect);
ls1->SetLineWidth(2);
ls1->SetMarkerSize(8);
ls1->SetMainColor(kViolet);
ls1->SetMarkerColor(kGreen + 3);
ls1->SetName("LineSet_1");
ls1->SetMarkerColor(kMagenta);
ls1->SetName("LineSet Violet");

auto ls2 = makeLineSet(200, 20, secondarySelect);
auto ls2 = makeLineSet(10, 10, secondarySelect);
ls2->SetLineWidth(2);
ls2->SetMarkerSize(8);
ls2->SetMainColor(kBlue);
ls2->SetMarkerColor(kCyan + 2);
ls2->SetName("LineSet_2");
ls2->SetName("LineSet Blue");
ls2->InitMainTrans();
ls2->RefMainTrans().Move3LF(40, 200, 200);

eveMng->Show();
}
}
30 changes: 30 additions & 0 deletions tutorials/visualisation/eve7/show_geo_extract.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/// \file
/// \ingroup tutorial_eve7
/// Helper script for showing of extracted / simplified geometries.
/// The test macro how to create the shapes is in file write_geo_extract.C
/// \macro_code
///
/// \author Matevz Tadel

void show_geo_extract(const char *file = "testShapeExtract.root")
{
auto eveMng = ROOT::Experimental::REveManager::Create();
// eveMng->AllowMultipleRemoteConnections(false, false);

TFile::Open(file);
TIter next(gDirectory->GetListOfKeys());
TKey *key;
TString seName("ROOT::Experimental::REveGeoShapeExtract");

while ((key = (TKey *)next())) {
std::cout << "calss name " << key->GetClassName() << "\n";
if (seName == key->GetClassName()) {
std::cout << "got the extract name " << key->GetClassName() << "\n";
auto gse = (ROOT::Experimental::REveGeoShapeExtract *)key->ReadObj();
auto gs = ROOT::Experimental::REveGeoShape::ImportShapeExtract(gse, 0);
eveMng->AddGlobalElement(gs);
}
}

eveMng->Show();
}
121 changes: 121 additions & 0 deletions tutorials/visualisation/eve7/write_geo_extract.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@

#include <ROOT/REveGeoTopNode.hxx>
#include <ROOT/REveGeoPolyShape.hxx>
#include <ROOT/REveManager.hxx>
#include "TFile.h"

#include <set>
#include <vector>
#include <iostream>


// \file
/// \ingroup tutorial_eve7
/// Helper script to create REveGeoShapeExtract fro TGeo geometry
/// One can rely on GeoTable to access paths
/// \macro_code
///
/// \author Alja Mrak Tadel

using namespace ROOT::Experimental;

REveGeoShape *makeShape(const std::string &targetPath, const char* name)
{
// for the moment top node is tracker at the startup

TGeoIterator next(gGeoManager->GetTopVolume());
TGeoNode *currentNode;

while ((currentNode = next())) {
TString currentPath;
next.GetPath(currentPath); // Retrieves the full hierarchy path
// std::cout << "compare" << currentPath << "\n";
if (currentPath == targetPath) {
// Found the node via path matching
printf("Node found: %s\n", currentNode->GetName());
break;
}
}

const TGeoMatrix *mat = next.GetCurrentMatrix();
const Double_t *t = mat->GetTranslation(); // size 3
const Double_t *r = mat->GetRotationMatrix(); // size 9 (3x3)

Double_t m[16];
if (mat->IsScale()) {
const Double_t *s = mat->GetScale();
m[0] = r[0] * s[0];
m[1] = r[3] * s[0];
m[2] = r[6] * s[0];
m[3] = 0;
m[4] = r[1] * s[1];
m[5] = r[4] * s[1];
m[6] = r[7] * s[1];
m[7] = 0;
m[8] = r[2] * s[2];
m[9] = r[5] * s[2];
m[10] = r[8] * s[2];
m[11] = 0;
m[12] = t[0];
m[13] = t[1];
m[14] = t[2];
m[15] = 1;
} else {
m[0] = r[0];
m[1] = r[3];
m[2] = r[6];
m[3] = 0;
m[4] = r[1];
m[5] = r[4];
m[6] = r[7];
m[7] = 0;
m[8] = r[2];
m[9] = r[5];
m[10] = r[8];
m[11] = 0;
m[12] = t[0];
m[13] = t[1];
m[14] = t[2];
m[15] = 1;
}

TGeoShape *shape = currentNode->GetVolume()->GetShape();
shape->SetName(name);
REveGeoShape* rgs = new REveGeoShape(name);
rgs->SetShape(shape);

rgs->InitMainTrans();
rgs->RefMainTrans().SetFrom(m);
return rgs;
}

void write_geo_extract()
{
TFile::SetCacheFileDir(".");

auto eveMng = REveManager::Create();
// eveMng->AllowMultipleRemoteConnections(false, false);
auto s_geoManager = TGeoManager::Import("http://xrd-cache-1.t2.ucsd.edu/alja/mail/geo/cmsSimGeo2026.root");

// tracker wrapper
REveGeoShape *tracker = makeShape("cms:OCMS/tracker:Tracker_1/otst:supportR1190Z1450_1", "tracker");
tracker->SetMainColor(kRed);
tracker->SetMainTransparency(50);

// tracker barrel
REveGeoShape *barrel =
makeShape("cms:OCMS/tracker:Tracker_1/pixbar:Phase2OTBarrel_1/tracker:supportR212Z604_1", "barrel");
tracker->AddElement(barrel);

// front and back endcaps
REveGeoShape *e1 = makeShape("cms:OCMS/tracker:Tracker_1/pixfwd:Phase2OTForward_1", "endcap_1");
tracker->AddElement(e1);
REveGeoShape *e2 = makeShape("cms:OCMS/tracker:Tracker_1/pixfwd:Phase2OTForward_2", "endcap_2");
tracker->AddElement(e2);

// save extract on top element
tracker->SaveExtract("testShapeExtract.root", "VSDGeo");

eveMng->GetEventScene()->AddElement(tracker);
eveMng->Show();
}
8 changes: 8 additions & 0 deletions ui5/eve7/controller/GeoTable.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,14 @@ sap.ui.define([
}
}));

this._oIdContextMenu.addItem(new MenuItem({
text: 'Print info',
select: () => {
this.setPhysTopNode(prop.path);
this.websocket.send('PrintInfo:' + JSON.stringify(prop.path));
}
}));

//Open the menu on the cell
let oCellDomRef = oEvent.getParameter("cellDomRef");
this._oIdContextMenu.open(false, oCellDomRef, Popup.Dock.BeginTop, Popup.Dock.BeginBottom, oCellDomRef, "none none");
Expand Down
2 changes: 1 addition & 1 deletion ui5/eve7/controller/Summary.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ sap.ui.define([
new mText({text:" {treeModel>fName}", tooltip: "{treeModel>fTitle}" , renderWhitespace: true, wrapping: false })
]
}),
new mButton({ id: "detailBtn", visible: "{treeModel>fShowButton}", icon: "sap-icon://edit", type: "Transparent", tooltip: "Actiavte GED", press: this.pressGedButton.bind(this) })
new mButton({ id: "detailBtn", visible: "{treeModel>fShowButton}", icon: "sap-icon://edit", type: "Transparent", tooltip: "Open Editor", press: this.pressGedButton.bind(this) })
]
})
],
Expand Down
Loading
Loading