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
5 changes: 5 additions & 0 deletions geom/webviewer/inc/ROOT/RGeomData.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@ class RGeomDescription {

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

virtual bool IsFullModelStreamedAtOnce() const;

virtual void RefineGeoItem(RGeoItem &item, const std::vector<int> &stack);

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

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

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

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
25 changes: 24 additions & 1 deletion geom/webviewer/src/RGeomData.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,26 @@ void RGeomDescription::CollectNodes(RGeomDrawing &drawing, bool all_nodes)
// printf("SELECT NODES %d\n", (int) drawing.nodes.size());
}

/////////////////////////////////////////////////////////////////////
/// Method which allows to add/modify information in RGeoItem which
/// will be provided to client - like title or some visibility flags
/// Changes in the item attributes do not affect geometry drawing

void RGeomDescription::RefineGeoItem(RGeoItem & /* item */, const std::vector<int> & /* stack */)
{
// do nothing by default, placeholder for derived classes
}


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

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

/////////////////////////////////////////////////////////////////////
/// Find description object for requested shape
/// If not exists - will be created
Expand All @@ -781,7 +801,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 @@ -830,6 +850,9 @@ std::string RGeomDescription::ProcessBrowserRequest(const std::string &msg)
temp_nodes.back().SetExpanded(true);
if (stack == fSelectedStack)
temp_nodes.back().SetTop(true);

RefineGeoItem(temp_nodes.back(), stack);

request->number--;

if (!stack.empty())
Expand Down
Loading