Skip to content

[REve] Update to RenderCore release from github, deploy it as builtin tarball. #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 84 commits into
base: root-master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
ec236b7
Update to RenderCore release from github.
osschar Nov 6, 2021
7efa18e
Getting render core colors, lights to reason.
osschar Jan 28, 2022
e3642cb
Get rcore uint picking to work again, improve point rendering.
osschar Mar 18, 2022
d807fd7
Trying out secondary select.
osschar Mar 29, 2022
67ba8c3
Re-call RenderCore::render from when some shaders have not yet been l…
osschar Apr 14, 2022
c286a51
[REve] Support RCore instanced rendering through texture data
osschar Jun 15, 2022
fbc374c
Pickable zsprite as points.
osschar Jun 29, 2022
2ac0cb9
[REve] Initial steps for secondary selection with RCore.
osschar Jul 5, 2022
ae35b0d
[REve] Implement RCore selection, secondary-selection; preliminary ou…
osschar Jul 15, 2022
80928a2
[REve] Add some sprite textures for RenderCore.
osschar Aug 15, 2022
19c9aa6
Add functions to create Calo3D and its controll object.
alja Sep 1, 2022
dc953ea
add function to create Calo2D and its controll object calo2DControll
alja Sep 1, 2022
b0b01c1
Import code for rendering REveBoxSet. Add box set control class
alja Sep 2, 2022
cfc608c
[REve] Separate viewer-side selection processing for RCore.
osschar Sep 3, 2022
499b1db
[REve] Support outlining of specific instances.
osschar Sep 9, 2022
984a46d
[REve] Get Calo objects, BoxSet and StraightLineSet to work with RCore.
osschar Sep 15, 2022
506266a
[REve] Use RCore dFdxy flat shading and new point-light model.
osschar Sep 20, 2022
258bb44
[REve] [RCore] Integration with new outline / blending / tone-mapping…
osschar Sep 27, 2022
3ebdf7f
[REve] [RCore] Use reduced 32x32 vieport around mouse event for picking.
osschar Sep 29, 2022
6f1b8cc
[REve] Fix gl access in pick with depthdetection.
osschar Sep 30, 2022
bd0e60e
[REve] RCore renderer unbinds the FBO when doing RTT.
osschar Oct 3, 2022
e99a129
Change algorithm for depth in pick function.
alja Oct 3, 2022
8d7ca91
Rewrite camera control to use ROOT GL camBase and camTrans logic. Add…
alja Oct 3, 2022
858c7d0
[REve] Proper selection / highlight outlines, optimize buffer usage.
osschar Oct 4, 2022
eb24df5
Fix picking in projected polygon set. (from Matevz)
alja Oct 7, 2022
8c5c49e
replace RC.Line with RC.Stripes in projected jets, line segments, and…
alja Oct 7, 2022
45c1ebc
[REve] Proper setting of object matrices, comment/log cleanups.
osschar Oct 7, 2022
527f891
[REve] typo fix.
osschar Oct 7, 2022
67142a6
Add parameter for projection depth in the collection
alja Oct 10, 2022
4e41fd0
Add datGUI to set backgroundcolor
alja Oct 10, 2022
6bff897
[REve] RCore Add picking and outline materials for Stripes.
osschar Oct 10, 2022
fc8d722
Comment debug prints. Make calo2D opaque.
alja Oct 10, 2022
edd115d
Use EVE.JSR.source_dir instead of window.location for the RC import p…
alja Oct 11, 2022
23af483
[REve] RCore Stripes picker is now in GBuffer_mini shader.
osschar Oct 13, 2022
5a53ce2
[REve RCore] Use emissive color for Stripes / tracks.
osschar Oct 19, 2022
f7409c9
Add initialization for empty 3D and 2D calorimters
alja Oct 19, 2022
70c984c
Reposition dat GUI
alja Oct 20, 2022
729bdc2
Print missing dispose function warnings only for three.js implementation
alja Oct 20, 2022
7eb2fb3
Ajust near camera clip to camera look at distance
alja Oct 21, 2022
602e736
Remove wrap attribute from FlexBox
alja Oct 26, 2022
7813da5
Use zsprite for straight line markers
alja Oct 26, 2022
21c0322
Stream interpreter errors and show them in client log
alja Nov 4, 2022
bb423ce
Remove obsolete hyper link
alja Nov 4, 2022
1f8a4bc
Clear textures and buffers with idle time above given idle time
alja Nov 15, 2022
01e16b6
Correction in texture sources for the case of the web service
alja Nov 17, 2022
c038d91
Correction in straight lineset selection: handle case where no marker…
alja Nov 21, 2022
92861da
Remove useage of error MessageBox popup during client update.
alja Nov 21, 2022
adec1a5
[REve] Package RenderCore as builtin, cleanup ui5/eve7/ accordingly.
osschar Nov 21, 2022
f333d58
[REve] Load RenderCore from root build dir.
osschar Nov 21, 2022
8b242df
[REve] update RenderCore.tar.gz
osschar Nov 21, 2022
f4c70f4
In render() print warning when eve element selection controller pushe…
alja Nov 23, 2022
e02788c
Check change bits in ImportSceneBinary when scene changes are streamed
alja Nov 23, 2022
f86b1bb
Check view data is present when filling datGUI
alja Nov 23, 2022
3447de5
Fix projections of RPhi cell towers
alja Nov 24, 2022
b7319d9
Follow up on changes in Texture constants in RenderCore.
osschar Nov 28, 2022
8df7c96
Apply window.devicePixelRatio when calculating width and height.
osschar Nov 28, 2022
aeac9f7
Code to render without tone mapping.
osschar Nov 28, 2022
e3233fc
Fix typo in the default argument
alja Nov 28, 2022
4df5cbe
Fix resizing and event handling for high-dpi/retina.
osschar Nov 29, 2022
ab6436b
Scale markers and lines by device-pixel-ratio.
osschar Nov 29, 2022
68e4a77
Use the same scaling factor in tracks and line segments
alja Nov 29, 2022
f8d8c59
Correction in view navigation
alja Dec 1, 2022
1224c47
Unregister scene from receivers when viewer removes the scene from it…
alja Dec 1, 2022
1cacb1b
Implement clenup function for the case of view navigations/routing
alja Dec 1, 2022
5a2c19c
Save clear color in EveViewer attributes
alja Dec 1, 2022
c2bb2e2
Add support boxset hex type
alja Dec 2, 2022
450a3e4
Fix line/track scaling with ssaa, pixelScale.
osschar Dec 3, 2022
f7c56fa
Correction in straightlineset width
alja Dec 3, 2022
1c65df5
Correct the test for empty boxsets
alja Dec 6, 2022
c1f18ef
Poperly handle point/line scales and ssaa, creator needs to know both.
osschar Dec 6, 2022
d252d95
Missing stuff from prev commit. Add bottom light.
osschar Dec 6, 2022
1de30db
Make specular reflection in RcFancyMaterial almoust white
alja Dec 6, 2022
04d9833
Improve check for empty calo 2d and calo 3d to remove lint warnings
alja Dec 9, 2022
db8a0ce
Optimize visibility changes
alja Dec 12, 2022
5a148b6
GlViewverRCore: point light construction with shadow-map size = 0.
osschar Dec 12, 2022
0626fae
Update RenderCore.tar.gz
osschar Dec 12, 2022
86f72b2
Add missing shader.
osschar Dec 13, 2022
ecab6c9
Pass x,y to mouse-move handler timeout, not event -- the event gets m…
osschar Dec 13, 2022
8f27322
Correction in outline colors and selection/highligt sorting
alja Dec 14, 2022
3c5b622
Make RenderCore the default render engine.
alja Dec 14, 2022
28f56ad
Correct warning on implied digitset collection
alja Dec 12, 2022
a5798bf
Check for extra selection data in implied selected elements
alja Dec 15, 2022
108a32d
[RCore] Fix reading of depth value in Firefox.
osschar Dec 20, 2022
a53eff3
[eve7] fix compiler warning with REvePointSet
linev Dec 20, 2022
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 added builtins/rendercore/RenderCore.tar.gz
Binary file not shown.
11 changes: 11 additions & 0 deletions cmake/modules/SearchInstalledSoftware.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2145,6 +2145,17 @@ if(webgui)
endif()
install(DIRECTORY ${CMAKE_BINARY_DIR}/ui5/distribution/ DESTINATION ${CMAKE_INSTALL_OPENUI5DIR}/distribution/ COMPONENT libraries FILES_MATCHING PATTERN "*")
endif()
ExternalProject_Add(
RENDERCORE
URL ${CMAKE_SOURCE_DIR}/builtins/rendercore/RenderCore.tar.gz
URL_HASH SHA256=a0b1cc0d4e8d739b113ace87e33de77572cf019772899549cb082088943513e1
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
SOURCE_DIR ${CMAKE_BINARY_DIR}/ui5/eve7/rcore
TIMEOUT 600
)
install(DIRECTORY ${CMAKE_BINARY_DIR}/ui5/eve7/rcore/ DESTINATION ${CMAKE_INSTALL_OPENUI5DIR}/eve7/rcore/ COMPONENT libraries FILES_MATCHING PATTERN "*")
endif()

#------------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions graf3d/eve7/inc/ROOT/REveCalo.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public:

virtual ~REveCaloViz();

bool RequiresExtraSelectionData() const override { return true; };
virtual REveElement* ForwardSelection();
virtual REveElement* ForwardEdit();

Expand Down
8 changes: 6 additions & 2 deletions graf3d/eve7/inc/ROOT/REveDataCollection.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class REveDataCollection : public REveElement
{
private:
REveDataItemList* fItemList{nullptr};
int fLayer{0};

public:
typedef std::vector<int> Ids_t;
Expand All @@ -138,8 +139,11 @@ public:


TClass *GetItemClass() const { return fItemClass; }
void SetItemClass(TClass *cls) { fItemClass = cls;
}
void SetItemClass(TClass *cls) { fItemClass = cls;}

int GetLayer() const { return fLayer; }
void SetLayer(int i) { fLayer = i; }

REveDataItemList* GetItemList() {return fItemList;}

void SetFilterExpr(const char* filter);
Expand Down
1 change: 0 additions & 1 deletion graf3d/eve7/inc/ROOT/REveDataProxyBuilderBase.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ protected:
private:
REveDataCollection *m_collection{nullptr};

float m_layer{0.};
bool m_haveWindow{false};
bool m_modelsChanged{false};
};
Expand Down
2 changes: 1 addition & 1 deletion graf3d/eve7/inc/ROOT/REveDigitSet.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public:
void NewShapePicked(int shapeId, Int_t selectionId, bool multi);


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

Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
Expand Down
5 changes: 5 additions & 0 deletions graf3d/eve7/inc/ROOT/REveManager.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ protected:

Logger fLogger;
REveServerStatus fServerStatus;
bool fIsRCore{false};

void WindowConnect(unsigned connid);
void WindowData(unsigned connid, const std::string &arg);
Expand Down Expand Up @@ -253,6 +254,9 @@ public:
static void ExecuteInMainThread(std::function<void()> func);
static void QuitRoot();

static void ErrorHandler(Int_t level, Bool_t abort, const char *location,
const char *msg);


// Access to internals, needed for low-level control in advanced
// applications.
Expand All @@ -266,6 +270,7 @@ public:
void Show(const RWebDisplayArgs &args = "");

void GetServerStatus(REveServerStatus&);
bool IsRCore() const { return fIsRCore; }
};

R__EXTERN REveManager* gEve;
Expand Down
5 changes: 4 additions & 1 deletion graf3d/eve7/inc/ROOT/REvePointSet.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <ROOT/REveElement.hxx>
#include <ROOT/REveProjectionBases.hxx>
#include <ROOT/REveVector.hxx>
#include <ROOT/REveSecondarySelectable.hxx>

#include <TAttMarker.h>
#include <TAttBBox.h>
Expand All @@ -34,7 +35,8 @@ namespace Experimental {
class REvePointSet : public REveElement,
public REveProjectable,
public TAttMarker,
public TAttBBox
public TAttBBox,
public REveSecondarySelectable
{
friend class REvePointSetArray;

Expand All @@ -45,6 +47,7 @@ protected:
std::vector<REveVector> fPoints;
int fCapacity{0};
int fSize{0};
int fTexX{0}, fTexY{0};

public:
REvePointSet(const std::string& name="", const std::string& title="", Int_t n_points = 0);
Expand Down
4 changes: 4 additions & 0 deletions graf3d/eve7/inc/ROOT/REveRenderData.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ public:

const std::string GetRnrFunc() const { return fRnrFunc; }

void ResizeV(int s) { fVertexBuffer.resize(s); }

int SizeV() const { return fVertexBuffer.size(); }
int SizeN() const { return fNormalBuffer.size(); }
int SizeI() const { return fIndexBuffer.size(); }
Expand All @@ -98,6 +100,8 @@ public:
int GetBinarySize() { return (SizeV() + SizeN() + SizeT()) * sizeof(float) + SizeI() * sizeof(int); }

int Write(char *msg, int maxlen);

static void CalcTextureSize(int nel, int align, int &sx, int &sy);
};

} // namespace Experimental
Expand Down
13 changes: 7 additions & 6 deletions graf3d/eve7/inc/ROOT/REveSelection.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@ protected:
Color_t fHiddenEdgeColor; ///<!

std::vector<int> fPickToSelect; ///<!
Bool_t fActive{kFALSE}; ///<!
Bool_t fIsMaster{kFALSE}; ///<!
bool fActive{true}; ///<!
bool fIsMaster{false}; ///<!
bool fIsHighlight{false}; ///<!

SelMap_t fMap; ///<!

Expand Down Expand Up @@ -120,14 +121,14 @@ public:
void SetVisibleEdgeColorRGB(UChar_t r, UChar_t g, UChar_t b);
void SetHiddenEdgeColorRGB(UChar_t r, UChar_t g, UChar_t b);

void SetHighlightMode();

const std::vector<int>& RefPickToSelect() const { return fPickToSelect; }
void ClearPickToSelect() { fPickToSelect.clear(); }
void AddPickToSelect(int ps) { fPickToSelect.push_back(ps); }

Bool_t GetIsMaster() const { return fIsMaster; }
void SetIsMaster(Bool_t m) { fIsMaster = m; }
bool GetIsMaster() const { return fIsMaster; }
void SetIsMaster(bool m) { fIsMaster = m; }
bool GetIsHighlight() const { return fIsHighlight; }
void SetIsHighlight(bool m) { fIsHighlight = m; }

std::shared_ptr<Deviator> GetDeviator() const { return fDeviator; }
void SetDeviator(std::shared_ptr<Deviator> d) { fDeviator = d; }
Expand Down
3 changes: 1 addition & 2 deletions graf3d/eve7/src/REveCalo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1393,13 +1393,12 @@ void REveCalo2D::MakeRPhiCell(Float_t phiMin, Float_t phiMax,
pnts[4] = r2*Cos(phiMax); pnts[5] = r2*Sin(phiMax);
pnts[6] = r1*Cos(phiMax); pnts[7] = r1*Sin(phiMax);

Float_t x, y, z;
for (Int_t i = 0; i < 4; ++i)
{
pntsOut[i*3] = pnts[2*i];
pntsOut[i*3+1] = pnts[2*i+1];
pntsOut[i*3+2] = 0.f;
fManager->GetProjection()->ProjectPoint(x, y, z, fDepth);
fManager->GetProjection()->ProjectPoint(pntsOut[3*i], pntsOut[3*i+1], pntsOut[3*i + 2], fDepth);
}
}

Expand Down
2 changes: 1 addition & 1 deletion graf3d/eve7/src/REveDataProxyBuilderBase.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void REveDataProxyBuilderBase::Build()
{
REveProjectionManager *pmgr = projectedProduct->GetManager();
Float_t oldDepth = pmgr->GetCurrentDepth();
pmgr->SetCurrentDepth(m_layer);
pmgr->SetCurrentDepth(m_collection->GetLayer());
Int_t cnt = 0;
REveElement *projectedProductAsElement = projectedProduct->GetProjectedAsElement();
// printf("projectedProduct children %d, product children %d\n", projectedProductAsElement->NumChildren(), product->NumChildren());
Expand Down
2 changes: 1 addition & 1 deletion graf3d/eve7/src/REveDigitSet.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ int REveDigitSet::GetShapeIdxFromAtomIdx(int iAtomIdx) const
}
}

printf("REveDigitSet::GetShapeIdxFromAtomIdx:: Atom with idx %d dose not have a visible shape \n", iAtomIdx);
printf("REveDigitSet::GetShapeIdxFromAtomIdx:: Atom with idx %d does not have a visible shape \n", iAtomIdx);
return -1;
}

Expand Down
38 changes: 32 additions & 6 deletions graf3d/eve7/src/REveManager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,12 @@ REveManager::REveManager()
fSelectionList->IncDenyDestroy();
fWorld->AddElement(fSelectionList);
fSelection = new REveSelection("Global Selection", "", kRed, kViolet);
fSelection->SetIsMaster(true);
fSelection->IncDenyDestroy();
fSelectionList->AddElement(fSelection);
fHighlight = new REveSelection("Global Highlight", "", kGreen, kCyan);
fHighlight->SetHighlightMode();
fHighlight->SetIsMaster(true);
fHighlight->SetIsHighlight(true);
fHighlight->IncDenyDestroy();
fSelectionList->AddElement(fHighlight);

Expand Down Expand Up @@ -142,13 +144,16 @@ REveManager::REveManager()
fWebWindow->UseServerThreads();
fWebWindow->SetDefaultPage("file:rootui5sys/eve7/index.html");

const char *gl_viewer = gEnv->GetValue("WebEve.GLViewer", "Three");
const char *gl_viewer = gEnv->GetValue("WebEve.GLViewer", "RCore");
const char *gl_dblclick = gEnv->GetValue("WebEve.DblClick", "Off");
Int_t htimeout = gEnv->GetValue("WebEve.HTimeout", 250);
Int_t table_row_height = gEnv->GetValue("WebEve.TableRowHeight", 0);
fWebWindow->SetUserArgs(Form("{ GLViewer: \"%s\", DblClick: \"%s\", HTimeout: %d, TableRowHeight: %d }", gl_viewer,
gl_dblclick, htimeout, table_row_height));

if (strcmp(gl_viewer, "RCore") == 0)
fIsRCore = true;

// this is call-back, invoked when message received via websocket
fWebWindow->SetCallBacks([this](unsigned connid) { WindowConnect(connid); },
[this](unsigned connid, const std::string &arg) { WindowData(connid, arg); },
Expand All @@ -158,6 +163,10 @@ REveManager::REveManager()
fWebWindow->SetMaxQueueLength(30); // number of allowed entries in the window queue

fMIRExecThread = std::thread{[this] { MIRExecThread(); }};

// activate interpreter error report
gInterpreter->ReportDiagnosticsToErrorHandler();
SetErrorHandler(ErrorHandler);
}

////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -939,20 +948,25 @@ void REveManager::PublishChanges()
jobj["content"] = "EndChanges";

if (!gEveLogEntries.empty()) {

constexpr static int numLevels = static_cast<int>(ELogLevel::kDebug) + 1;
constexpr static std::array<const char *, numLevels> sTag{
{"{unset-error-level please report}", "FATAL", "Error", "Warning", "Info", "Debug"}};
{"{unset-error-level please report}", "FATAL", "Error", "Warning", "Info", "Debug"}};

jobj["log"] = nlohmann::json::array();
std::stringstream strm;
for (auto entry : gEveLogEntries) {
nlohmann::json item = {};
item["lvl"] = entry.fLevel;
int cappedLevel = std::min(static_cast<int>(entry.fLevel), numLevels - 1);
strm << sTag[cappedLevel];
strm << "Server " << sTag[cappedLevel] << ":";

if (!entry.fLocation.fFuncName.empty())
strm << " " << entry.fLocation.fFuncName;
strm << " " << entry.fMessage;
item["msg"] = strm.str();
jobj["log"].push_back(item);
strm.clear();
}
jobj["log"] = strm.str();
gEveLogEntries.clear();
}

Expand Down Expand Up @@ -1112,6 +1126,18 @@ REveManager::ChangeGuard::~ChangeGuard()
gEve->EndChange();
}

// Error handler streams error-level messages to client log
void REveManager::ErrorHandler(Int_t level, Bool_t abort, const char * location, const char *msg)
{
if (level >= kError)
{
RLogEntry entry(ELogLevel::kError, REveLog());
entry.fMessage = msg;
gEveLogEntries.emplace_back(entry);
}
::DefaultErrorHandler(level, abort, location, msg);
}

/** \class REveManager::RExceptionHandler
\ingroup REve
Exception handler for Eve exceptions.
Expand Down
33 changes: 29 additions & 4 deletions graf3d/eve7/src/REvePointSet.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ REveProjectionManager class.

REvePointSet::REvePointSet(const std::string& name, const std::string& title, Int_t n_points) :
REveElement(name, title),
REveProjectable(),
TAttMarker(),
TAttBBox()
TAttBBox(),
REveSecondarySelectable()
{
fMarkerStyle = 20;

Expand All @@ -65,8 +67,11 @@ REvePointSet::REvePointSet(const REvePointSet& e) :
REveElement(e),
REveProjectable(e),
TAttMarker(e),
TAttBBox(e)
TAttBBox(e),
REveSecondarySelectable()
{
fAlwaysSecSelect = e.GetAlwaysSecSelect();
ClonePoints(e);
}

////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -208,10 +213,19 @@ TClass* REvePointSet::ProjectedClass(const REveProjection*) const

Int_t REvePointSet::WriteCoreJson(nlohmann::json& j, Int_t rnr_offset)
{
if (gEve->IsRCore())
REveRenderData::CalcTextureSize(fSize, 1, fTexX, fTexY);

Int_t ret = REveElement::WriteCoreJson(j, rnr_offset);

if (gEve->IsRCore()) {
j["fSize"] = fSize;
j["fTexX"] = fTexX;
j["fTexY"] = fTexY;
}
j["fMarkerSize"] = GetMarkerSize();
j["fMarkerColor"] = GetMarkerColor();
j["fSecondarySelect"] = fAlwaysSecSelect;

return ret;
}
Expand All @@ -223,8 +237,17 @@ void REvePointSet::BuildRenderData()
{
if (fSize > 0)
{
fRenderData = std::make_unique<REveRenderData>("makeHit", 3*fSize);
fRenderData->PushV(&fPoints[0].fX, 3*fSize);
if (gEve->IsRCore()) {
fRenderData = std::make_unique<REveRenderData>("makeHit", 4*fTexX*fTexY);
for (int i = 0; i < fSize; ++i) {
fRenderData->PushV(&fPoints[i].fX, 3);
fRenderData->PushV(0);
}
fRenderData->ResizeV(4*fTexX*fTexY);
} else {
fRenderData = std::make_unique<REveRenderData>("makeHit", 3*fSize);
fRenderData->PushV(&fPoints[0].fX, 3*fSize);
}
}
}

Expand Down Expand Up @@ -544,6 +567,8 @@ void REvePointSetProjected::UpdateProjection()
REvePointSet &ps = * dynamic_cast<REvePointSet*>(fProjectable);
REveTrans *tr = ps.PtrMainTrans(kFALSE);

fAlwaysSecSelect = ps.GetAlwaysSecSelect();

// XXXX rewrite

Int_t n = ps.GetSize();
Expand Down
18 changes: 18 additions & 0 deletions graf3d/eve7/src/REveRenderData.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,21 @@ void REveRenderData::SetMatrix(const double *arr)
fMatrix.push_back(arr[i]);
}
}

/////////////////////////////////////////////////////////////////////////////////////////
/// Calculate texture dimensions to hold nel elements with given alignment on x axis.
/// Static function.
///
/// Implementation could be improved -- now it simply goes for near-square-root(size)
/// dimensions that satisfy the alignment requirement.

void REveRenderData::CalcTextureSize(int nel, int align, int &sx, int &sy)
{
if (nel <= 0) { sx = sy = 0; return; }

sx = (int) std::ceil(std::sqrt(nel));
int rx = sx % align;
if (rx > 0) sx += align - rx;
sy = nel / sx;
if (nel % sx > 0) sy += 1;
}
Loading