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
4 changes: 2 additions & 2 deletions builtins/rendercore/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ExternalProject_Add(
RENDERCORE
URL ${CMAKE_SOURCE_DIR}/builtins/rendercore/RenderCore-2.2.tar.gz
URL_HASH SHA256=79de20fb064638cfa0831893ab022df6a39d2392776061c81b0996a55b59cd11
URL ${CMAKE_SOURCE_DIR}/builtins/rendercore/RenderCore-2.3.tar.gz
URL_HASH SHA256=1f5ff8f33e0c381e00a0472a51d6232a4bbcede1e5cfd167889e185079b57ab9
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
Expand Down
Binary file removed builtins/rendercore/RenderCore-2.2.tar.gz
Binary file not shown.
Binary file added builtins/rendercore/RenderCore-2.3.tar.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions graf3d/eve7/inc/ROOT/REveBox.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public:

const Float_t* GetVertex(Int_t i) const { return fVertices[i]; }

// For TAttBBox:
// From REveElement:
void ComputeBBox() override;

Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
Expand Down Expand Up @@ -78,7 +78,7 @@ public:
void BuildRenderData() override;
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;

// For TAttBBox:
// From REveElement:
void ComputeBBox() override;

Bool_t GetDebugCornerPoints();
Expand Down
112 changes: 67 additions & 45 deletions graf3d/eve7/inc/ROOT/REveBoxSet.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,44 +29,53 @@ class REveBoxSet: public REveDigitSet

public:
enum EBoxType_e {
kBT_Undef, // unknown-ignored
kBT_FreeBox, // arbitrary box: specify 8*(x,y,z) box corners
kBT_Instanced, // axis-aligned digit w/ fixed dimensions: specify (x,y,z)
kBT_InstancedScaled, // axis-aligned digit: specify (x,y,z) and (w, h, d)
kBT_InstancedScaledRotated // generic Mat4 transformation
kBT_Undef, // unknown-ignored
kBT_Vertices, // arbitrary box: specify its 8 vertices, 8*(x,y,z)
kBT_FreeBox = kBT_Vertices, // the old name of kBT_Vertices
kBT_Instanced, // axis-aligned box of the default size, see SetDefWidth(): specify its centre
kBT_InstancedScaled, // axis-aligned box: specify its centre and half size
kBT_InstancedScaledRotated // any transformation of the instance shape: specify its matrix
};

enum EShape_e {
kBox,
kHex,
kCone,
kConeCapped
/// The shape every instance of a kBT_Instanced* box set draws.
enum EInstanceShape_e {
kIS_Box,
kIS_Hex,
kIS_Cone,
kIS_ConeCapped
};

struct BFreeBox_t : public DigitBase_t { Float_t fVertices[8][3]; };

struct Instanced_t : public DigitBase_t { Float_t fX, fY, fZ; }; // save only position == INSTANCED_T

struct InstancedScaled_t : public Instanced_t { Float_t fW, fH, fD; }; // scaled box INSTANCED_SCALED_T

struct InstancedScaledRotated_t : public DigitBase_t { Float_t fMat[16]; }; // INSTANCED_SCALEDROTATED

// ++ TODO add rotated
struct Vertices_t : public DigitBase_t {
Float_t fVertices[8][3];
}; // the 8 vertices
struct Instanced_t : public DigitBase_t {
Float_t fX, fY, fZ;
}; // centre
struct InstancedScaled_t : public Instanced_t {
Float_t fW, fH, fD;
}; // centre and half size
struct InstancedScaledRotated_t : public DigitBase_t {
Float_t fMat[16];
}; // column-major matrix

using BFreeBox_t = Vertices_t; // the old name of Vertices_t

protected:
EBoxType_e fBoxType; // Type of rendered box.
EShape_e fShapeType{kBox};
EBoxType_e fBoxType; // Type of rendered box.
EInstanceShape_e fInstanceShape{kIS_Box}; // Shape of the instances of the kBT_Instanced* types.

Float_t fDefHalfWidth{0.5}; // Half size along x of a kBT_Instanced box.
Float_t fDefHalfHeight{0.5}; // Half size along y of a kBT_Instanced box.
Float_t fDefHalfDepth{0.5}; // Half size along z of a kBT_Instanced box.

Float_t fDefWidth {1}; // Breadth assigned to first coordinate (A).
Float_t fDefHeight {1}; // Breadth assigned to second coordinate (B).
Float_t fDefDepth {1}; // Breadth assigned to third coordinate (C).
Int_t fBoxSkip; // Number of boxes to skip for each drawn box during scene rotation.

Int_t fBoxSkip; // Number of boxes to skip for each drawn box during scene rotation.
Bool_t fDrawConeCap{false}; // Close the base of a cone.

Bool_t fDrawConeCap{false};
int fTexX{0}, fTexY{0}; // Size of the instance-data texture.

int fTexX{0}, fTexY{0};
static Int_t SizeofAtom(EBoxType_e bt);
void InstanceHalfSize(const DigitBase_t &digit, Float_t half[3]) const;
void WriteShapeData(REveDigitSet::DigitBase_t &digit);
unsigned int GetColorFromDigit(REveDigitSet::DigitBase_t &digit);
float GetColorFromDigitAsFloat(REveDigitSet::DigitBase_t &digit);
Expand All @@ -78,39 +87,52 @@ public:
void Reset(EBoxType_e boxType, Bool_t valIsCol, Int_t chunkSize);
void Reset();

void AddFreeBox(const Float_t* verts);
void AddInstanceScaled(Float_t a, Float_t b, Float_t c, Float_t w, Float_t h, Float_t d);
void AddInstance(Float_t a, Float_t b, Float_t c);
void AddVertices(const Float_t *verts);
void AddFreeBox(const Float_t *verts) { AddVertices(verts); } // the old name of AddVertices()
void AddBox(const Float_t *verts) { AddVertices(verts); } // the TEveBoxSet name of AddVertices()
void AddInstanceScaled(Float_t cx, Float_t cy, Float_t cz, Float_t hw, Float_t hh, Float_t hd);
void AddInstanceScaledCorner(Float_t x, Float_t y, Float_t z, Float_t w, Float_t h, Float_t d);
void AddInstance(Float_t cx, Float_t cy, Float_t cz);
void AddInstanceCorner(Float_t x, Float_t y, Float_t z);
void AddInstanceMat4(const Float_t* mat4);

void AddBox(const Float_t* verts) { AddFreeBox(verts); }
void AddBox(Float_t a, Float_t b, Float_t c, Float_t w, Float_t h, Float_t d) { AddInstanceScaled(a, b, c, w, h, d); }
void AddBox(Float_t a, Float_t b, Float_t c) { AddInstance(a, b, c);}

void AddCone(const REveVector& pos, const REveVector& dir, Float_t r);
void AddEllipticCone(const REveVector& pos, const REveVector& dir, Float_t r, Float_t r2, Float_t angle=0);

void AddHex(const REveVector& pos, Float_t r, Float_t angle, Float_t depth);
void SetShape(EShape_e x){fShapeType = x;}

EInstanceShape_e GetInstanceShape() const { return fInstanceShape; }
void SetInstanceShape(EInstanceShape_e s) { fInstanceShape = s; }

void ComputeBBox() override;

void Test(Int_t nboxes);

Float_t GetDefWidth() const { return fDefWidth; }
Float_t GetDefHeight() const { return fDefHeight; }
Float_t GetDefDepth() const { return fDefDepth; }
Bool_t GetDrawConeCap() const { return fDrawConeCap; }

void SetDefWidth(Float_t v) { fDefWidth = v ; }
void SetDefHeight(Float_t v) { fDefHeight = v ; }
void SetDefDepth(Float_t v) { fDefDepth = v ; }
void SetDrawConeCap(Bool_t x) { fDrawConeCap=x; StampObjProps(); }
// The size of a kBT_Instanced box, full or half.
Float_t GetDefWidth() const { return 2 * fDefHalfWidth; }
Float_t GetDefHeight() const { return 2 * fDefHalfHeight; }
Float_t GetDefDepth() const { return 2 * fDefHalfDepth; }
Float_t GetDefHalfWidth() const { return fDefHalfWidth; }
Float_t GetDefHalfHeight() const { return fDefHalfHeight; }
Float_t GetDefHalfDepth() const { return fDefHalfDepth; }

void SetDefWidth(Float_t v) { fDefHalfWidth = 0.5f * v; }
void SetDefHeight(Float_t v) { fDefHalfHeight = 0.5f * v; }
void SetDefDepth(Float_t v) { fDefHalfDepth = 0.5f * v; }
void SetDefHalfWidth(Float_t v) { fDefHalfWidth = v; }
void SetDefHalfHeight(Float_t v) { fDefHalfHeight = v; }
void SetDefHalfDepth(Float_t v) { fDefHalfDepth = v; }

Bool_t GetDrawConeCap() const { return fDrawConeCap; }
void SetDrawConeCap(Bool_t x)
{
fDrawConeCap = x;
StampObjProps();
}

Int_t GetBoxSkip() const { return fBoxSkip; }
void SetBoxSkip(Int_t bs) { fBoxSkip = bs; }


Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
void BuildRenderData() override;

Expand Down
8 changes: 1 addition & 7 deletions graf3d/eve7/inc/ROOT/REveCalo.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
#include "ROOT/REveProjectionBases.hxx"
#include "ROOT/REveProjectionManager.hxx"

#include "TAtt3D.h"
#include "TAttBBox.h"
#include "ROOT/REveCaloData.hxx"

class TClass;
Expand All @@ -26,11 +24,7 @@ namespace ROOT {
namespace Experimental {

class REveRGBAPalette;
class REveCaloViz : public REveElement,
public TAtt3D,
public TAttBBox,
public REveProjectable
{
class REveCaloViz : public REveElement, public REveProjectable {

private:
REveCaloViz& operator=(const REveCaloViz&) = delete;
Expand Down
8 changes: 1 addition & 7 deletions graf3d/eve7/inc/ROOT/REveDigitSet.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
#define ROOT_REveDigitSet

#include "TNamed.h"
#include "TAtt3D.h"
#include "TAttBBox.h"

#include "ROOT/REveUtil.hxx"
#include "ROOT/REveElement.hxx"
Expand All @@ -28,11 +26,7 @@ class TRefArray;
namespace ROOT {
namespace Experimental {

class REveDigitSet : public REveElement,
public TAtt3D,
public TAttBBox,
public REveSecondarySelectable
{
class REveDigitSet : public REveElement, public REveSecondarySelectable {
friend class REveDigitSetEditor;
friend class REveDigitSetGL;

Expand Down
66 changes: 57 additions & 9 deletions graf3d/eve7/inc/ROOT/REveElement.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <ROOT/REveProjectionBases.hxx>
#include "TString.h"

#include <algorithm>
#include <memory>
#include <list>
#include <ostream>
Expand Down Expand Up @@ -99,6 +100,38 @@ protected:

std::unique_ptr<REveRenderData> fRenderData;///<! Vertex / normal / triangle index information for rendering.

public:
enum EBBoxState : UChar_t {
kBBoxInvalid, // Not computed since the last change.
kBBoxNone, // No geometry of its own.
kBBoxSet, // fBBoxMin and fBBoxMax hold the box.
kBBoxNotInWorld // Screen-space or overlay content: not bounded, not culled.
};

protected:
REveVector fBBoxMin; ///<! Bounding box in the element's own frame.
REveVector fBBoxMax; ///<!
EBBoxState fBBoxState{kBBoxInvalid}; ///<!

void BBoxInit();
void BBoxZero(Float_t epsilon = 0, Float_t x = 0, Float_t y = 0, Float_t z = 0);
void BBoxClear() { fBBoxState = kBBoxInvalid; }
void BBoxNotInWorld() { fBBoxState = kBBoxNotInWorld; }
void BBoxCheckPoint(const REveVector &v)
{
fBBoxMin.SetMin(v);
fBBoxMax.SetMax(v);
}
void BBoxCheckPoint(Float_t x, Float_t y, Float_t z) { BBoxCheckPoint(REveVector(x, y, z)); }
void BBoxCheckPoint(const Float_t *p) { BBoxCheckPoint(p[0], p[1], p[2]); }
/// Grow the box to hold the axis-aligned box with centre `c` and half sizes `h`.
void BBoxCheckBox(const REveVector &c, const REveVector &h)
{
BBoxCheckPoint(c - h);
BBoxCheckPoint(c + h);
}
void AssertBBoxExtents(Float_t epsilon = 0.005);

virtual void PreDeleteElement();
virtual void RemoveElementsInternal();
virtual void AnnihilateRecursively();
Expand Down Expand Up @@ -155,6 +188,8 @@ public:

virtual void AddAunt(REveAunt *au);
virtual void RemoveAunt(REveAunt *au);
/// Called by an aunt that holds this element when the aunt has changed.
virtual void AuntChanged(REveAunt * /*au*/) {}
virtual void CheckReferenceCount(const std::string &from = "<unknown>");

AuntList_t &RefAunts() { return fAunts; }
Expand Down Expand Up @@ -255,13 +290,21 @@ public:

virtual void SetTransMatrix(Double_t *carr);
virtual void SetTransMatrix(const TGeoMatrix &mat);
Int_t ComposeSceneTrans(REveTrans &t) const;

// clang-format off
virtual Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset);
virtual void WriteTransJson(nlohmann::json &cj);
virtual void BuildRenderData();
// clang-format on

virtual void ComputeBBox();
EBBoxState AssertBBox();
void ResetBBox() { fBBoxState = kBBoxInvalid; }
EBBoxState GetBBoxState() const { return fBBoxState; }
const REveVector &GetBBoxMin() const { return fBBoxMin; }
const REveVector &GetBBoxMax() const { return fBBoxMax; }

void* GetUserData() const { return fUserData; }
void SetUserData(void* ud) { fUserData = ud; }

Expand Down Expand Up @@ -327,16 +370,16 @@ public:

// Change-stamping and change bits
//---------------------------------
// kCBTransBBox streams the transformation as JSON only, and the client
// applies it to the object it already has. A change that invalidates
// geometry must stamp kCBObjProps. No bounding box is sent despite the name.
// A change that invalidates geometry must stamp kCBObjProps, which also
// invalidates the bounding box. kCBCoreJson and kCBTrans send no render data.

// clang-format off
enum EChangeBits
{
kCBColorSelection = BIT(0), // Main color or select/hilite state changed.
kCBTransBBox = BIT(1), // Transformation changed; cheap update, no rebuild.
kCBObjProps = BIT(2), // Object changed, requires dropping its display-lists.
kCBCoreJson = BIT(0), // Core JSON changed (colour, name, ...); render data did not.
kCBTrans = BIT(1), // Transformation changed; cheap update, no rebuild.
kCBObjProps = BIT(2), // Full rebuild: render data and the full state, transformation included.
kCBFullRebuild = kCBObjProps,
kCBVisibility = BIT(3), // Rendering of self/children changed.
kCBElementAdded = BIT(4) // Element was added to a new parent.
// kCBElementRemoved = BIT() // Element was removed from a parent.
Expand All @@ -358,9 +401,14 @@ protected:
static void AppendMirErrorString(std::string_view err_str);

public:
void StampColorSelection() { AddStamp(kCBColorSelection); }
void StampTransBBox() { AddStamp(kCBTransBBox); }
void StampObjProps() { if ( ! (fChangeBits & kCBObjProps)) AddStamp(kCBObjProps); }
void StampCoreJson() { AddStamp(kCBCoreJson); }
void StampTrans() { AddStamp(kCBTrans); }
void StampObjProps()
{
fBBoxState = kBBoxInvalid;
if (!(fChangeBits & kCBObjProps))
AddStamp(kCBObjProps);
}
void StampVisibility() { AddStamp(kCBVisibility); }
void StampElementAdded() { AddStamp(kCBElementAdded); }
// void StampElementRemoved() { AddStamp(kCBElementRemoved); }
Expand Down
1 change: 1 addition & 0 deletions graf3d/eve7/inc/ROOT/REveGeoTopNode.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ public:
void SetGeoData(REveGeoTopNodeData *d, bool rebuild = true);
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
void BuildRenderData() override;
void ComputeBBox() override;
void GetIndicesFromBrowserStack(const std::vector<int> &stack, std::set<int>& outStack);

void SetVisLevel(int);
Expand Down
2 changes: 1 addition & 1 deletion graf3d/eve7/inc/ROOT/REveJetCone.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public:

void BuildRenderData() override;

// For TAttBBox:
// From REveElement:
void ComputeBBox() override;

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

Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
void BuildRenderData() override;
void ComputeBBox() override { BBoxNotInWorld(); }
};

} // namespace Experimental
Expand Down
8 changes: 1 addition & 7 deletions graf3d/eve7/inc/ROOT/REvePointSet.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <ROOT/REveSecondarySelectable.hxx>

#include <TAttMarker.h>
#include <TAttBBox.h>

#include <cassert>

Expand All @@ -32,12 +31,7 @@ namespace Experimental {
// external TRef or a number of integer indices.
////////////////////////////////////////////////////////////////////////////////

class REvePointSet : public REveElement,
public REveProjectable,
public TAttMarker,
public TAttBBox,
public REveSecondarySelectable
{
class REvePointSet : public REveElement, public REveProjectable, public TAttMarker, public REveSecondarySelectable {
friend class REvePointSetArray;

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

void SetDistortionLabel(REveText *t);
void RemoveAunt(REveAunt *au) override;
void AuntChanged(REveAunt *au) override;
void UpdateDistortionLabel();

Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
Expand Down
Loading
Loading