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.8.tar.gz
Binary file not shown.
Binary file added builtins/rendercore/RenderCore-1.9.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 @@ -1832,8 +1832,8 @@ if(webgui)
endif()
ExternalProject_Add(
RENDERCORE
URL ${CMAKE_SOURCE_DIR}/builtins/rendercore/RenderCore-1.8.tar.gz
URL_HASH SHA256=2ab84800ec1aaf36671e463a09e3befbe97b06b2547f97ec05fe16ef1351c79a
URL ${CMAKE_SOURCE_DIR}/builtins/rendercore/RenderCore-1.9.tar.gz
URL_HASH SHA256=7728f00ee5e907c36b25aad56fbc73881c7c9faf47a36bee5efd2054bc4ecc6c
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
Expand Down
7 changes: 6 additions & 1 deletion geom/webviewer/inc/ROOT/RGeomData.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ using RGeomSignalFunc_t = std::function<void(const std::string &)>;

class RGeomDescription {

protected:
friend class RGeomBrowserIter;

class ShapeDescr {
Expand Down Expand Up @@ -296,6 +297,9 @@ class RGeomDescription {

int IsPhysNodeVisible(const std::vector<int> &stack);

virtual RGeoItem MakeBrowserItem(const RGeomNode& node, std::vector<int>& stack);
virtual bool IsFullModelStreamedAtOnce();

/** clear drawing data without locking mutex */
void _ClearDrawData()
{
Expand All @@ -305,6 +309,7 @@ class RGeomDescription {

public:
RGeomDescription() = default;
virtual ~RGeomDescription(){};

void AddSignalHandler(const void *handler, RGeomSignalFunc_t func);

Expand Down Expand Up @@ -460,7 +465,7 @@ public:

bool IsPrincipalEndNode(int nodeid);

std::string ProcessBrowserRequest(const std::string &req = "");
virtual std::string ProcessBrowserRequest(const std::string &req = "");

bool HasDrawData() const;
void ProduceDrawData();
Expand Down
2 changes: 1 addition & 1 deletion geom/webviewer/inc/ROOT/RGeomHierarchy.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected:
RGeomDescription &fDesc; ///<! geometry description, shared with external
std::shared_ptr<RWebWindow> fWebWindow; ///<! web window to show geometry

void WebWindowCallback(unsigned connid, const std::string &arg);
virtual void WebWindowCallback(unsigned connid, const std::string &arg);

void ProcessSignal(const std::string &kind);

Expand Down
29 changes: 25 additions & 4 deletions geom/webviewer/src/RGeomData.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ std::string RGeomDescription::ProcessBrowserRequest(const std::string &msg)
if (!request)
return res;

if (request->path.empty() && (request->first == 0) && (GetNumNodes() < (IsPreferredOffline() ? 1000000 : 1000))) {
if (request->path.empty() && (request->first == 0) && IsFullModelStreamedAtOnce()) {

std::vector<RGeomNodeBase *> vect(fDesc.size(), nullptr);

Expand Down Expand Up @@ -823,9 +823,9 @@ std::string RGeomDescription::ProcessBrowserRequest(const std::string &msg)
auto stack = MakeStackByIds(iter.CurrentIds());

while (iter.IsValid() && (request->number > 0)) {
int pvis = IsPhysNodeVisible(stack);
temp_nodes.emplace_back(iter.GetName(), iter.NumChilds(), iter.GetNodeId(), iter.GetColor(),
iter.GetMaterial(), iter.GetVisible(), pvis < 0 ? iter.GetVisible() : pvis);

temp_nodes.emplace_back(MakeBrowserItem(fDesc[iter.GetNodeId()], stack));

if (toplevel)
temp_nodes.back().SetExpanded(true);
if (stack == fSelectedStack)
Expand Down Expand Up @@ -2060,6 +2060,27 @@ int RGeomDescription::IsPhysNodeVisible(const std::vector<int> &stack)
return -1;
}

/////////////////////////////////////////////////////////////////////////////////
/// Create temprary browser item.
/// Function is called from ProcessBrowserRequest

RGeoItem RGeomDescription::MakeBrowserItem(const RGeomNode &node, std::vector<int> &stack)
{
int pvis = IsPhysNodeVisible(stack);
bool test_vis = pvis < 0 ? true : pvis;
return RGeoItem(node.name, node.chlds.size(), node.id, node.color, node.material,
node.vis, test_vis);
}

/////////////////////////////////////////////////////////////////////////////////
/// Decide if the whole model is streamed at once
/// Function is called from ProcessBrowserRequest

bool RGeomDescription::IsFullModelStreamedAtOnce()
{
return GetNumNodes() < (IsPreferredOffline() ? 1000000 : 1000);
}

/////////////////////////////////////////////////////////////////////////////////
/// Reset custom visibility of physical node by path

Expand Down
2 changes: 1 addition & 1 deletion graf3d/eve7/inc/ROOT/REveGeoPolyShape.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ private:
REveGeoPolyShape(const REveGeoPolyShape&) = delete;
REveGeoPolyShape& operator=(const REveGeoPolyShape&) = delete;

protected:
public:
std::vector<Double_t> fVertices;
std::vector<Double_t> fNormals;
std::vector<UInt_t> fPolyDesc;
Expand Down
156 changes: 139 additions & 17 deletions graf3d/eve7/inc/ROOT/REveGeoTopNode.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -5,53 +5,175 @@
#include <ROOT/REveElement.hxx>
#include <ROOT/RGeomData.hxx>
#include <ROOT/RGeomHierarchy.hxx>
#include "ROOT/REveSecondarySelectable.hxx"

class TGeoNode;
class TGeoIterator;


namespace ROOT {
namespace Experimental {

class REveGeoTopNodeData;
/////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
// REveGeomDescription
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////

class REveGeomDescription : public RGeomDescription {
static TGeoManager* s_geoManager;
protected:
std::vector<RGeomNodeVisibility> fVisibilityRec;
virtual RGeoItem MakeBrowserItem(const RGeomNode &node, std::vector<int> &stack);

Check failure on line 28 in graf3d/eve7/inc/ROOT/REveGeoTopNode.hxx

View workflow job for this annotation

GitHub Actions / debian13 dev=ON, CMAKE_CXX_FLAGS=-Wsuggest-override

‘virtual ROOT::RGeoItem ROOT::Experimental::REveGeomDescription::MakeBrowserItem(const ROOT::RGeomNode&, std::vector<int>&)’ can be marked override [-Werror=suggest-override]
virtual bool IsFullModelStreamedAtOnce() { return false; }

Check failure on line 29 in graf3d/eve7/inc/ROOT/REveGeoTopNode.hxx

View workflow job for this annotation

GitHub Actions / debian13 dev=ON, CMAKE_CXX_FLAGS=-Wsuggest-override

‘virtual bool ROOT::Experimental::REveGeomDescription::IsFullModelStreamedAtOnce()’ can be marked override [-Werror=suggest-override]

class Apex {
std::vector<std::string> fPath;
TGeoNode *fNode{nullptr};

public:
void SetFromPath(std::vector<std::string> absPath);
TGeoNode *LocateNodeWithPath(const std::vector<std::string> &path) const;

TGeoNode *GetNode() { return fNode; }
std::string GetFlatPath() const;
const std::vector<std::string>& GetPath() const { return fPath; }
std::vector<int> GetIndexStack() const;
};

Apex fApex;

class REveGeoTopNodeData : public REveElement,
public REveAuntAsList
public:
REveGeomDescription() : RGeomDescription() {};
virtual ~REveGeomDescription() {};

enum ERnrFlags {
kRnrNone = 0,
kRnrSelf = 1,
kRnrChildren = 2
};

bool ChangeEveVisibility(const std::vector<int> &stack, ERnrFlags rnrFlag, bool on);
std::vector<int> GetIndexStack() { return fApex.GetIndexStack(); }
const std::vector<std::string>& GetApexPath() const { return fApex.GetPath();}
void InitPath(const std::vector<std::string>& path);
TGeoNode* GetApexNode() { return fApex.GetNode(); }
TGeoNode* LocateNodeWithPath(const std::vector<std::string> &path) { return fApex.LocateNodeWithPath(path); }

bool GetVisiblityForStack(const std::vector<int>& stack);

void ImportFile(const char* filePath);
static TGeoManager* GetGeoManager();
};

/////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
// REveGeomHierarchy
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////

class REveGeomHierarchy : public RGeomHierarchy
{
friend class REveGeoTopNodeViz;
REveGeoTopNodeData* fReceiver{nullptr};
protected:
virtual void WebWindowCallback(unsigned connid, const std::string &kind);

Check failure on line 80 in graf3d/eve7/inc/ROOT/REveGeoTopNode.hxx

View workflow job for this annotation

GitHub Actions / debian13 dev=ON, CMAKE_CXX_FLAGS=-Wsuggest-override

‘virtual void ROOT::Experimental::REveGeomHierarchy::WebWindowCallback(unsigned int, const std::string&)’ can be marked override [-Werror=suggest-override]

public:
REveGeomHierarchy(REveGeomDescription &desc, bool th) :
RGeomHierarchy(desc, th){};

void SetReceiver(REveGeoTopNodeData* data) { fReceiver = data; }
virtual ~REveGeomHierarchy(){};
};

/////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
// REveGeoTopNodeData
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////

class REveGeoTopNodeData : public REveElement, public REveAuntAsList {
friend class REveGeoTopNodeViz;
private:
std::shared_ptr<REveGeomHierarchy> fWebHierarchy; ///<! web handle for hierarchy part

protected:
REveGeoTopNodeData(const REveGeoTopNodeData &) = delete;
REveGeoTopNodeData &operator=(const REveGeoTopNodeData &) = delete;

TGeoNode* fGeoNode{nullptr};
RGeomDescription fDesc; ///<! geometry description, send to the client as first message
std::shared_ptr<RGeomHierarchy> fWebHierarchy; ///<! web handle for hierarchy part
REveGeomDescription fDesc;

public:
REveGeoTopNodeData(const Text_t *n = "REveGeoTopNodeData", const Text_t *t = "");
REveGeoTopNodeData(const char* fileName);
virtual ~REveGeoTopNodeData() {}

Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
void SetTNode(TGeoNode* n);
void ProcessSignal(const std::string &);
RGeomDescription& RefDescription() {return fDesc;}
REveGeomDescription& RefDescription() {return fDesc;}

void SetChannel(unsigned connid, int chid);
void VisibilityChanged(bool on, REveGeomDescription::ERnrFlags flag, const std::vector<int>& path);
void InitPath(const std::string& path);
};
//-------------------------------------------------------------------
class REveGeoTopNodeViz : public REveElement

/////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
// REveGeoTopNodeViz
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
class REveGeoTopNodeViz : public REveElement,
public REveSecondarySelectable
{
private:
public:
enum EMode {
kModeNone,
kModeVisLevel,
kModeLeafOnly,
kModeMixed
};

private:
struct BShape {
TGeoShape *shape;
std::vector<int> indices;
std::vector<float> vertices;
};

struct BNode {
TGeoNode *node;
int shapeId;
int nodeId;
int color;
float trans[16];
bool visible{true};
};

REveGeoTopNodeViz(const REveGeoTopNodeViz &) = delete;
REveGeoTopNodeViz &operator=(const REveGeoTopNodeViz &) = delete;

REveGeoTopNodeData* fGeoData{nullptr};
REveGeoTopNodeData *fGeoData{nullptr};
std::vector<BNode> fNodes;
std::vector<BShape> fShapes;
EMode fMode{kModeVisLevel};

public:
void CollectNodes(TGeoVolume *volume, std::vector<BNode> &bnl, std::vector<BShape> &browsables);
void CollectShapes(TGeoNode *node, std::set<TGeoShape *> &shapes, std::vector<BShape> &browsables);
bool AcceptNode(TGeoIterator& it, bool skip = true) const;

public:
REveGeoTopNodeViz(const Text_t *n = "REveGeoTopNodeViz", const Text_t *t = "");
void SetGeoData(REveGeoTopNodeData* d) {fGeoData = d;}
void SetGeoData(REveGeoTopNodeData *d, bool rebuild = true);
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
void BuildRenderData() override;
void GetIndicesFromBrowserStack(const std::vector<int> &stack, std::set<int>& outStack);

void SetVisLevel(int);
void VisibilityChanged(bool on, REveGeomDescription::ERnrFlags flag, const std::vector<int>& path);
void BuildDesc();

bool RequiresExtraSelectionData() const override { return true; };
void FillExtraSelectionData(nlohmann::json& j, const std::set<int>& secondary_idcs) const override;
EMode GetVizMode() const { return fMode; }
void SetVizMode(EMode mode);

using REveElement::GetHighlightTooltip;
std::string GetHighlightTooltip(const std::set<int>& secondary_idcs) const override;
Expand Down
Loading
Loading