37namespace Experimental {
85 if (node.chlds.size() == 0)
return false;
123 if (++
fChild >= prnt.chlds.size()) {
145 if (
Enter())
return true;
147 if (
Next())
return true;
150 if (
Next())
return true;
159 size_t pos = path.find(
"/");
160 if (pos != 0)
return false;
164 while (++pos < path.length()) {
167 pos = path.find(
"/", last);
169 if (pos == std::string::npos) pos = path.length();
171 std::string folder = path.substr(last, pos-last);
173 if (!
Enter())
return false;
178 find = (folder.compare(
GetName()) == 0);
179 }
while (!find &&
Next());
181 if (!find)
return false;
188 bool Navigate(
const std::vector<std::string> &path)
192 for (
auto &folder : path) {
194 if (!
Enter())
return false;
199 find = (folder.compare(
GetName()) == 0);
200 }
while (!find &&
Next());
202 if (!find)
return false;
212 std::vector<int> res;
229using namespace std::string_literals;
255 if (!is_translate && !is_scale && !is_rotate) {
258 auto test = [](
double val,
double chk) {
return (val==chk) || (
TMath::Abs(val-chk) < 1
e-20); };
260 bool no_scale =
test(scale[0],1) &&
test(scale[1],1) &&
test(scale[2],1);
261 bool no_trans =
test(trans[0],0) &&
test(trans[1],0) &&
test(trans[2],0);
262 bool no_rotate =
test(rotate[0],1) &&
test(rotate[1],0) &&
test(rotate[2],0) &&
263 test(rotate[3],0) &&
test(rotate[4],1) &&
test(rotate[5],0) &&
264 test(rotate[6],0) &&
test(rotate[7],0) &&
test(rotate[8],1);
266 if (no_scale && no_trans && no_rotate)
269 if (no_scale && no_trans && !no_rotate) {
271 }
else if (no_scale && !no_trans && no_rotate) {
273 }
else if (!no_scale && no_trans && no_rotate) {
297 for (
int n=0;
n<9;++
n)
303 vect[0] = rotate[0]; vect[4] = rotate[1]; vect[8] = rotate[2]; vect[12] = trans[0];
304 vect[1] = rotate[3]; vect[5] = rotate[4]; vect[9] = rotate[5]; vect[13] = trans[1];
305 vect[2] = rotate[6]; vect[6] = rotate[7]; vect[10] = rotate[8]; vect[14] = trans[2];
306 vect[3] = 0; vect[7] = 0; vect[11] = 0; vect[15] = 1;
320 if (!volname.empty()) {
321 auto vol = mgr->
GetVolume(volname.c_str());
325 while ((node = next()) !=
nullptr) {
328 if (node) topnode = node;
341 SetMaxVisFaces( (maxnodes > 5000 ? 5000 : (maxnodes < 1000 ? 1000 : maxnodes)) * 100);
380 std::vector<int> numbers;
388 numbers.emplace_back(
offset);
389 fNodes.emplace_back(
nullptr);
394 numbers.emplace_back(snode->
GetNumber());
396 fNodes.emplace_back(snode);
398 }
while ((snode = iter()) !=
nullptr);
401 numbers.reserve(
fNodes.size());
405 std::vector<RGeomNode *> sortarr;
406 sortarr.reserve(
fNodes.size());
410 for (
auto node :
fNodes) {
412 fDesc.emplace_back(node ? node->GetNumber() -
offset : 0);
413 TGeoVolume *vol = node ? node->GetVolume() : topvolume;
415 auto &desc =
fDesc[cnt++];
417 sortarr.emplace_back(&desc);
423 desc.vol = shape->
GetDX() * shape->GetDY() * shape->GetDZ();
429 auto chlds = node ? node->GetNodes() : vol->
GetNodes();
431 PackMatrix(desc.matr, node ? node->GetMatrix() :
nullptr);
434 for (
int n = 0;
n <= chlds->GetLast(); ++
n) {
435 auto chld =
dynamic_cast<TGeoNode *
> (chlds->At(
n));
436 desc.chlds.emplace_back(chld->GetNumber() -
offset);
442 for (
auto node :
fNodes) {
443 auto number = numbers[cnt++];
444 if (node) node->SetNumber(number);
448 std::sort(sortarr.begin(), sortarr.end(), [](
RGeomNode *
a,
RGeomNode *
b) { return a->vol > b->vol; });
451 for (
auto &elem: sortarr) {
453 elem->sortid = cnt++;
467 auto node =
fNodes[nodeid];
468 if (node)
return node->GetVolume();
478 for (
int nodeid = 0; nodeid < (
int)
fNodes.size(); nodeid++) {
480 auto node =
fNodes[nodeid];
482 auto &desc =
fDesc[nodeid];
484 desc.nochlds =
false;
487 if (!node || node->IsOnScreen())
493 if (node && !node->IsVisDaughters())
496 if ((desc.vis > 0) && (desc.chlds.size() > 0) && !desc.nochlds)
500 if (desc.IsVisible() && desc.CanDisplay()) res++;
511 for (
auto &node :
fDesc)
516 ScanFunc_t scan_func = [&,
this](
RGeomNode &node) {
517 if (node.idshift < 0) {
519 for(
auto id : node.chlds)
520 node.idshift += scan_func(
fDesc[
id]);
523 return node.idshift + 1;
526 if (
fDesc.size() > 0)
535 if (
fDesc.empty())
return 0;
537 std::vector<int> stack;
541 using ScanFunc_t = std::function<
int(
int,
int)>;
543 ScanFunc_t scan_func = [&,
this](
int nodeid,
int lvl) {
544 auto &desc =
fDesc[nodeid];
547 if (desc.nochlds && (lvl > 0)) lvl = 0;
550 bool is_visible = (lvl >= 0) && (desc.vis > lvl) && desc.CanDisplay();
552 if (is_visible || !only_visible)
553 if (func(desc, stack, is_visible, counter))
558 if ((desc.chlds.size() > 0) && ((lvl > 0) || !only_visible)) {
559 auto pos = stack.size();
560 stack.emplace_back(0);
561 for (
unsigned k = 0; k < desc.chlds.size(); ++k) {
563 res += scan_func(desc.chlds[k], lvl - 1);
567 counter += desc.idshift;
574 if (!maxlvl) maxlvl = 4;
575 if (maxlvl > 97) maxlvl = 97;
577 return scan_func(0, maxlvl);
586 for (
auto &node :
fDesc)
587 node.useflag =
false;
593 for (
auto &item : drawing.
visibles) {
595 for (
auto &chindx : item.stack) {
596 auto &node =
fDesc[nodeid];
599 drawing.
nodes.emplace_back(&node);
601 if (chindx >= (
int)node.chlds.size())
603 nodeid = node.chlds[chindx];
606 auto &node =
fDesc[nodeid];
609 drawing.
nodes.emplace_back(&node);
624 auto request = TBufferJSON::FromJSON<RBrowserRequest>(msg);
627 request = std::make_unique<RBrowserRequest>();
629 request->number = 100;
637 std::vector<RGeomNodeBase *> vect(
fDesc.size(),
nullptr);
640 for (
auto &item :
fDesc)
645 std::vector<Browsable::RItem> temp_nodes;
646 bool toplevel = request->path.empty();
650 reply.
path = request->path;
651 reply.
first = request->first;
660 while ((request->first > 0) && iter.
Next()) {
664 while (iter.
IsValid() && (request->number > 0)) {
666 if (toplevel) temp_nodes.back().SetExpanded(
true);
668 if (!iter.
Next())
break;
673 for (
auto &
n : temp_nodes)
674 reply.
nodes.emplace_back(&
n);
689 if (descr.fShape == shape)
706 std::unique_ptr<RootCsg::TBaseMesh> res;
714 for (
UInt_t i = 0; i < b3d->NbPnts(); ++i) {
722 res.reset(RootCsg::ConvertToMesh(*b3d.get()));
727 if (matr) { mleft = *matr; mright = *matr; }
729 mleft.
Multiply(node->GetLeftMatrix());
730 auto left =
MakeGeoMesh(&mleft, node->GetLeftShape());
732 mright.
Multiply(node->GetRightMatrix());
733 auto right =
MakeGeoMesh(&mright, node->GetRightShape());
735 if (node->IsA() ==
TGeoUnion::Class()) res.reset(RootCsg::BuildUnion(left.get(), right.get()));
737 if (node->IsA() ==
TGeoSubtraction::Class()) res.reset(RootCsg::BuildDifference(left.get(), right.get()));
751 if (elem.nfaces == 0) {
764 elem.fShapeInfo.shape = shape;
779 Int_t num_vertices =
mesh->NumberOfVertices(), num_polynoms = 0;
781 for (
unsigned polyIndex = 0; polyIndex <
mesh->NumberOfPolys(); ++polyIndex) {
783 auto size_of_polygon =
mesh->SizeOfPoly(polyIndex);
785 if (size_of_polygon >= 3)
786 num_polynoms += (size_of_polygon - 2);
789 Int_t index_buffer_size = num_polynoms * 3,
790 vertex_buffer_size = num_vertices * 3;
792 elem.nfaces = num_polynoms;
794 std::vector<float> vertices(vertex_buffer_size);
796 for (
Int_t i = 0; i < num_vertices; ++i) {
797 auto v =
mesh->GetVertex(i);
798 vertices[i*3] =
v[0];
799 vertices[i*3+1] =
v[1];
800 vertices[i*3+2] =
v[2];
803 elem.fRawInfo.raw.resize(vertices.size() *
sizeof(
float));
805 memcpy(
reinterpret_cast<char *
>(elem.fRawInfo.raw.data()), vertices.data(), vertices.size() *
sizeof(
float));
807 auto &indexes = elem.fRawInfo.idx;
809 indexes.resize(index_buffer_size);
812 for (
unsigned polyIndex = 0; polyIndex <
mesh->NumberOfPolys(); ++polyIndex) {
813 auto size_of_polygon =
mesh->SizeOfPoly(polyIndex);
816 if (size_of_polygon >= 3)
817 for (
int i = 0; i < 3; ++i)
818 indexes[pos++] =
mesh->GetVertexIndex(polyIndex, i);
821 if (size_of_polygon > 3)
823 indexes[pos++] =
mesh->GetVertexIndex(polyIndex, 0);
824 indexes[pos++] =
mesh->GetVertexIndex(polyIndex,
vertex-1);
825 indexes[pos++] =
mesh->GetVertexIndex(polyIndex,
vertex);
853 if ((fillstyle>=3000) && (fillstyle<=3100)) node.
opacity = (3100 - fillstyle) / 100.;
854 if (!col) col =
gROOT->GetColor(material->GetFillColor());
858 node.
color = std::to_string((
int)(col->GetRed()*255)) +
"," +
859 std::to_string((
int)(col->GetGreen()*255)) +
"," +
860 std::to_string((
int)(col->GetBlue()*255));
862 node.
opacity = col->GetAlpha();
900 std::vector<int> viscnt(
fDesc.size(), 0);
905 int numnodes =
ScanNodes(
true, level, [&viscnt](
RGeomNode &node, std::vector<int> &,
bool,
int) {
913 viscnt.assign(viscnt.size(), 0);
914 numnodes =
ScanNodes(
true, level, [&viscnt](
RGeomNode &node, std::vector<int> &,
bool,
int) {
924 int totalnumfaces = 0, totalnumnodes = 0;
932 auto &desc =
fDesc[sid];
934 if ((viscnt[sid] <= 0) || (desc.vol <= 0))
continue;
937 if (!shape)
continue;
943 if (shape_descr.nfaces <= 0) {
944 R__LOG_ERROR(
RGeomLog()) <<
"No faces for the shape " << shape->GetName() <<
" class " << shape->ClassName();
949 totalnumfaces += shape_descr.nfaces * viscnt[sid];
953 totalnumnodes += viscnt[sid];
964 bool has_shape =
false;
966 ScanNodes(
true, level, [&,
this](
RGeomNode &node, std::vector<int> &stack,
bool,
int seqid) {
968 drawing.visibles.emplace_back(node.id, seqid, stack);
970 auto &item = drawing.visibles.back();
971 item.color = node.color;
972 item.opacity = node.opacity;
974 auto volume = GetVolume(node.id);
976 auto &sd = MakeShapeDescr(volume->GetShape());
978 item.ri = sd.rndr_info();
979 if (sd.has_shape()) has_shape = true;
1012 if ((nodeid < 0) || (nodeid >= (
int)
fDesc.size()))
1015 auto &desc =
fDesc[nodeid];
1017 return (desc.sortid <
fDrawIdCut) && desc.IsVisible() && desc.CanDisplay() && (desc.chlds.size()==0);
1032 hjson =
"FOUND:RESET";
1036 std::vector<int> nodescnt(
fDesc.size(), 0), viscnt(
fDesc.size(), 0);
1040 auto match_func = [&find](
RGeomNode &node) {
1041 return (node.vol > 0) && (node.name.compare(0, find.length(), find) == 0);
1045 ScanNodes(
false, 0, [&nodescnt,&viscnt,&match_func,&nmatches](
RGeomNode &node, std::vector<int> &,
bool is_vis,
int) {
1047 if (match_func(node)) {
1049 nodescnt[node.
id]++;
1050 if (is_vis) viscnt[node.
id]++;
1062 hjson =
"FOUND:Too many " + std::to_string(nmatches);
1068 int totalnumfaces = 0, totalnumnodes = 0, scnt = 0;
1069 bool send_rawdata =
true;
1075 if (viscnt[sid] == 0)
continue;
1077 auto &desc =
fDesc[sid];
1078 if ((viscnt[sid] <= 0) && (desc.vol <= 0))
continue;
1081 if (!shape)
continue;
1087 if (shape_descr.nfaces <= 0) {
1088 R__LOG_ERROR(
RGeomLog()) <<
"No faces for the shape " << shape->GetName() <<
" class " << shape->ClassName();
1093 totalnumfaces += shape_descr.nfaces * viscnt[sid];
1097 totalnumnodes += viscnt[sid];
1108 std::vector<RGeomNodeBase> found_desc;
1109 std::vector<int> found_map(
fDesc.size(), -1);
1113 found_desc.emplace_back(0);
1114 found_desc[0].vis =
fDesc[0].vis;
1115 found_desc[0].name =
fDesc[0].name;
1116 found_desc[0].color =
fDesc[0].color;
1122 bool has_shape =
true;
1124 ScanNodes(
false, 0, [&,
this](
RGeomNode &node, std::vector<int> &stack,
bool is_vis,
int seqid) {
1126 if (!match_func(node))
1131 for (
auto &s : stack) {
1132 int chldid =
fDesc[prntid].chlds[s];
1133 if (found_map[chldid] <= 0) {
1134 int newid = found_desc.size();
1135 found_desc.emplace_back(newid);
1136 found_map[chldid] = newid;
1138 found_desc.back().vis =
fDesc[chldid].vis;
1139 found_desc.back().name =
fDesc[chldid].name;
1140 found_desc.back().color =
fDesc[chldid].color;
1143 auto pid = found_map[prntid];
1144 auto cid = found_map[chldid];
1147 auto &pchlds = found_desc[pid].chlds;
1148 if (std::find(pchlds.begin(), pchlds.end(), cid) == pchlds.end())
1149 pchlds.emplace_back(cid);
1155 if (!is_vis)
return true;
1157 drawing.
visibles.emplace_back(node.
id, seqid, stack);
1166 auto &item = drawing.
visibles.back();
1169 item.color = node.
color;
1174 item.ri = sd.rndr_info();
1175 if (sd.has_shape()) has_shape =
true;
1195 for (
auto &chindx: stack) {
1196 auto &node =
fDesc[nodeid];
1197 if (chindx >= (
int) node.chlds.size())
return -1;
1198 nodeid = node.chlds[chindx];
1209 std::vector<int> stack;
1212 printf(
"Wrong first id\n");
1218 for (
unsigned k = 1; k < ids.size(); ++k) {
1220 int prntid = nodeid;
1223 if (nodeid >= (
int)
fDesc.size()) {
1224 printf(
"Wrong node id %d\n", nodeid);
1228 auto &chlds =
fDesc[prntid].chlds;
1229 auto pos = std::find(chlds.begin(), chlds.end(), nodeid);
1230 if (pos == chlds.end()) {
1231 printf(
"Wrong id %d not a child of %d - fail to find stack num %d\n", nodeid, prntid, (
int) chlds.size());
1236 stack.emplace_back(std::distance(chlds.begin(), pos));
1248 std::vector<int> res;
1264 std::vector<int> ids;
1266 ids.emplace_back(0);
1268 bool failure =
false;
1270 for (
auto s : stack) {
1271 auto &chlds =
fDesc[nodeid].chlds;
1272 if (s >= (
int) chlds.size()) { failure =
true;
break; }
1274 ids.emplace_back(chlds[s]);
1280 printf(
"Fail to convert stack into list of nodes\n");
1292 std::vector<std::string> path;
1295 for (
auto &
id : ids)
1296 path.emplace_back(
fDesc[
id].name);
1308 std::vector<RGeomNodeBase *> nodes;
1315 for (
auto &desc :
fDesc)
1317 nodes.emplace_back(&desc);
1341 ScanNodes(
true, 0, [&,
this](
RGeomNode &node, std::vector<int> &stack,
bool,
int seq_id) {
1347 if (node.
id != nodeid)
return true;
1350 drawing.
visibles.emplace_back(node.
id, seq_id, stack);
1352 auto &item = drawing.
visibles.back();
1354 item.color = node.
color;
1367 bool has_shape =
false, has_raw =
false;
1372 for (
auto &item : drawing.
visibles) {
1373 item.ri = sd.rndr_info();
1374 if (sd.has_shape()) has_shape =
true;
1375 if (sd.has_raw()) has_raw =
true;
1382 return has_raw || has_shape;
1402 json.SetSkipClassInfo(TClass::GetClass<RGeomDrawing>());
1403 json.SetSkipClassInfo(TClass::GetClass<RGeomNode>());
1404 json.SetSkipClassInfo(TClass::GetClass<RGeomVisible>());
1405 json.SetSkipClassInfo(TClass::GetClass<RGeomShapeRenderInfo>());
1406 json.SetSkipClassInfo(TClass::GetClass<RGeomRawRenderInfo>());
1408 return json.StoreObject(&drawing, TClass::GetClass<RGeomDrawing>()).Data();
1417 auto &dnode =
fDesc[nodeid];
1422 if (vol->IsVisible() == selected)
1425 dnode.vis = selected ? 99 : 0;
1426 vol->SetVisibility(selected);
1427 if (dnode.chlds.size() > 0) {
1428 if (selected) dnode.vis = 1;
1429 vol->SetVisDaughters(selected);
1433 for (
auto &desc:
fDesc)
1435 desc.vis = dnode.vis;
1448 std::unique_ptr<RGeomNodeInfo> res;
1458 res = std::make_unique<RGeomNodeInfo>();
1461 res->node_name = node ? node->GetName() :
"node_name";
1462 res->node_type = node ? node->ClassName() :
"no class";
1466 TGeoShape *shape = vol ? vol->GetShape() :
nullptr;
1469 res->shape_name = shape->
GetName();
1473 if (shape && desc.CanDisplay()) {
1477 res->ri = shape_descr.rndr_info();
1490 auto cfg = TBufferJSON::FromJSON<RGeomConfig>(
json);
1491 if (!cfg)
return false;
std::unique_ptr< RootCsg::TBaseMesh > MakeGeoMesh(TGeoMatrix *matr, TGeoShape *shape)
Function produces mesh for provided shape, applying matrix to the result.
#define R__LOG_ERROR(...)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
R__EXTERN TGeoManager * gGeoManager
Reply on browser request.
std::vector< const Browsable::RItem * > nodes
list of pointers, no ownership!
std::vector< std::string > path
reply path
int nchilds
total number of childs in the node
int first
first node in returned list
Iterator of hierarchical geometry structures.
std::vector< int > fStackChilds
std::vector< int > fStackParents
RGeomBrowserIter(RGeomDescription &desc)
bool Navigate(const std::string &path)
Navigate to specified path - path specified as string and should start with "/".
bool Navigate(const std::vector< std::string > &path)
Navigate to specified path
const std::string & GetName() const
std::vector< int > CurrentIds() const
Returns array of ids to currently selected node.
int nsegm
number of segments for cylindrical shapes
std::vector< int > fSortMap
! nodes in order large -> smaller volume
std::string ProcessBrowserRequest(const std::string &req="")
Find description object for requested shape If not exists - will be created.
void PackMatrix(std::vector< float > &arr, TGeoMatrix *matr)
Pack matrix into vector, which can be send to client Following sizes can be used for vector: 0 - Iden...
bool ProduceDrawingFor(int nodeid, std::string &json, bool check_volume=false)
Produce shape rendering data for given stack All nodes, which are referencing same shape will be tran...
std::vector< int > MakeIdsByStack(const std::vector< int > &stack)
Produce list of node ids for given stack If found nodes preselected - use their ids.
int fActualLevel
! level can be reduced when selecting nodes
RGeomConfig fCfg
! configuration parameter editable from GUI
int MarkVisible(bool on_screen=false)
Set visibility flag for each nodes.
int GetJsonComp() const
Returns JSON compression level for data transfer.
bool IsPrincipalEndNode(int nodeid)
return true when node used in main geometry drawing and does not have childs for such nodes one could...
int GetMaxVisFaces() const
Returns maximal visible number of faces, ignored when non-positive.
TGeoVolume * fDrawVolume
! select volume independent from TGeoMaanger
int GetNumNodes() const
Number of unique nodes in the geometry.
void SetMaxVisNodes(int cnt)
Set maximal number of nodes which should be selected for drawing.
void SetVisLevel(int lvl=3)
Set maximal visible level.
int GetMaxVisNodes() const
Returns maximal visible number of nodes, ignored when non-positive.
void ClearDescription()
Clear geometry description.
std::vector< int > MakeStackByIds(const std::vector< int > &ids)
Creates stack for given array of ids, first element always should be 0.
int GetVisLevel() const
Returns maximal visible level.
std::vector< RGeomNode > fDesc
converted description, send to client
void SetMaxVisFaces(int cnt)
Set maximal number of faces which should be selected for drawing.
std::vector< ShapeDescr > fShapes
! shapes with created descriptions
std::string MakeDrawingJson(RGeomDrawing &drawing, bool has_shapes=false)
Produce JSON for the drawing If TGeoShape appears in the drawing, one has to keep typeinfo But in thi...
TGeoVolume * GetVolume(int nodeid)
Get volume for specified nodeid If specific volume was configured, it will be returned for nodeid==0.
std::unique_ptr< RGeomNodeInfo > MakeNodeInfo(const std::vector< std::string > &path)
Change visibility for specified element Returns true if changes was performed.
void ProduceDrawData()
Collect all information required to draw geometry on the client This includes list of each visible no...
void SetNSegments(int n=0)
Set number of segments for cylindrical shapes, if 0 - default value will be used.
void BuildDescription(TGeoNode *topnode, TGeoVolume *topvolume)
Build geometry description.
int SearchVisibles(const std::string &find, std::string &hjson, std::string &json)
Search visible nodes for provided name If number of found elements less than 100, create description ...
void ClearDrawData()
Clear raw data. Will be rebuild when next connection will be established.
std::vector< std::string > MakePathByStack(const std::vector< int > &stack)
Returns path string for provided stack.
bool ChangeConfiguration(const std::string &json)
Change configuration by client Returns true if any parameter was really changed.
void CopyMaterialProperties(TGeoVolume *vol, RGeomNode &node)
Copy material properties.
std::vector< int > MakeStackByPath(const std::vector< std::string > &path)
Produce stack based on string path Used to highlight geo volumes by browser hover event.
int ScanNodes(bool only_visible, int maxlvl, RGeomScanFunc_t func)
Iterate over all nodes and call function for visible.
bool IsPreferredOffline() const
Is offline operations preferred.
std::vector< TGeoNode * > fNodes
! flat list of all nodes
ShapeDescr & MakeShapeDescr(TGeoShape *shape)
Find description object and create render information.
int IsBuildShapes() const
Returns true if binary 3D model build already by C++ server (default)
ShapeDescr & FindShapeDescr(TGeoShape *shape)
Find description object for requested shape If not exists - will be created.
std::string fDrawJson
! JSON with main nodes drawn by client
std::string ProduceJson()
Produce JSON string which can be directly used with build function from JSROOT to create three....
int FindNodeId(const std::vector< int > &stack)
Returns nodeid for given stack array, returns -1 in case of failure.
bool ChangeNodeVisibility(int nodeid, bool selected)
Change visibility for specified element Returns true if changes was performed.
void CollectNodes(RGeomDrawing &drawing)
Collect nodes which are used in visibles.
void ProduceIdShifts()
Count total number of visible childs under each node.
std::string ProduceModifyReply(int nodeid)
Return string with only part of nodes description which were modified Checks also volume.
void ResetRndrInfos()
Reset shape info, which used to pack binary data.
int fDrawIdCut
! sortid used for selection of most-significant nodes
void Build(TGeoManager *mgr, const std::string &volname="")
Collect information about geometry hierarchy into flat list like it done in JSROOT ClonedNodes....
Object with full description for drawing geometry It includes list of visible items and list of nodes...
RGeomConfig * cfg
current configurations
std::vector< RGeomVisible > visibles
all visible items
std::vector< RGeomNode * > nodes
all used nodes to display visible items and not known for client
int numnodes
total number of nodes in description
int sortid
! place in sorted array, to check cuts, or id of original node when used search structures
int id
node id, index in array
std::string color
rgb code without rgb() prefix
Full node description including matrices and other attributes.
float opacity
! opacity of the color
A log configuration for a channel, e.g.
virtual Color_t GetFillColor() const
Return the fill area color.
virtual Style_t GetFillStyle() const
Return the fill area style.
virtual Color_t GetLineColor() const
Return the line color.
Class for serializing object to and from JavaScript Object Notation (JSON) format.
static TString ToJSON(const T *obj, Int_t compact=0, const char *member_name=nullptr)
@ kSkipTypeInfo
do not store typenames in JSON
void SetCompact(int level)
Set level of space/newline/array compression Lower digit of compact parameter define formatting rules...
The color creation and management class.
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
virtual Double_t GetDX() const
Composite shapes are Boolean combinations of two or more shape components.
TGeoBoolNode * GetBoolNode() const
Matrix class used for computing global transformations Should NOT be used for node definition.
void Multiply(const TGeoMatrix *right)
multiply to the right with an other transformation if right is identity matrix, just return
void Skip()
Stop iterating the current branch.
The manager class for any TGeo geometry.
TGeoVolume * GetVolume(const char *name) const
Search for a named volume. All trailing blanks stripped.
Int_t GetMaxVisNodes() const
TGeoNode * GetTopNode() const
void SetNsegments(Int_t nseg)
Set number of segments for approximating circles in drawing.
Int_t GetVisLevel() const
Returns current depth to which geometry is drawn.
Int_t GetNsegments() const
Get number of segments approximating circles.
TGeoVolume * GetTopVolume() const
Geometrical transformation package.
virtual const Double_t * GetTranslation() const =0
virtual TClass * IsA() const
virtual void LocalToMaster(const Double_t *local, Double_t *master) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix inverse
virtual const Double_t * GetScale() const =0
Bool_t IsIdentity() const
virtual const Double_t * GetRotationMatrix() const =0
TGeoMaterial * GetMaterial() const
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
TGeoVolume * GetVolume() const
void SetNumber(Int_t number)
Base abstract class for all shapes.
virtual Bool_t IsComposite() const
virtual Bool_t IsCylType() const =0
virtual const char * GetName() const
Get the shape name.
virtual TBuffer3D * MakeBuffer3D() const
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
TGeoMedium * GetMedium() const
static TGeoMedium * DummyMedium()
TGeoShape * GetShape() const
const char * GetName() const override
Returns name of object.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
const char * Data() const
std::function< bool(RGeomNode &, std::vector< int > &, bool, int)> RGeomScanFunc_t
RLogChannel & RGeomLog()
Log channel for Eve diagnostics.
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.