Skip to content
Merged
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 @@ -1731,8 +1731,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
2 changes: 2 additions & 0 deletions geom/webviewer/inc/ROOT/RGeomData.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ public:
// should be here, one needs virtual table for correct streaming of RRootBrowserReply
~RGeoItem() override = default;

void SetLogicalVisibility(int logicalVis) { vis = logicalVis; }
void SetPhysicalVisibility(int physicalVis) { pvis = physicalVis; }
void SetTop(bool on = true) { top = on; }
};

Expand Down
3 changes: 3 additions & 0 deletions graf3d/eve7/inc/ROOT/REveGeoPolyShape.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ public:
const TBuffer3D& GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override;
TBuffer3D *MakeBuffer3D() const override;

const std::vector<Double_t> &GetVertices() const { return fVertices; }
const std::vector<UInt_t> &GetPolyDesc() const { return fPolyDesc; }

static void SetAutoEnforceTriangles(Bool_t f);
static Bool_t GetAutoEnforceTriangles();
static void SetAutoCalculateNormals(Bool_t f);
Expand Down
158 changes: 141 additions & 17 deletions graf3d/eve7/inc/ROOT/REveGeoTopNode.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -5,53 +5,177 @@
#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> fVisibilitySelf;
std::vector<RGeomNodeVisibility> fVisibilityRec;

virtual void RefineGeoItem(ROOT::RGeoItem &item, const std::vector<int> &stack) override;
virtual bool IsFullModelStreamedAtOnce() const override { return false; }

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;
};

class REveGeoTopNodeData : public REveElement,
public REveAuntAsList
Apex fApex;

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) 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