20#include <nlohmann/json.hpp>
41std::string REveLogo::sImageDir;
72 return f.compare(0, 7,
"http://") == 0 ||
f.compare(0, 8,
"https://") == 0 ||
f.compare(0, 2,
"//") == 0;
81 std::string sanitized = REveAssetDir::NormalizeDir(std::string(dir));
82 if (sanitized.empty()) {
83 ::Error(tpfx,
"Empty directory given.");
87 ::Error(tpfx,
"Image directory '%s' does not exist or is not readable.", sanitized.c_str());
100 std::string sanitized =
CheckImageDir(dir,
"REveLogo::SetImageDir");
101 if (sanitized.empty())
115 std::string sanitized =
CheckImageDir(dir,
"REveLogo::AddImageDir");
116 if (sanitized.empty())
121 ImageDirs().AddUserDir(sanitized);
148 fRenderData = std::make_unique<REveRenderData>(
"makeLogo");
static std::string CheckImageDir(std::string_view dir, const char *tpfx)
Check that dir is readable and return it with a trailing slash, or an empty string with an error from...
char Text_t
General string (char)
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
R__EXTERN TSystem * gSystem
Directories of one kind of file the REve server serves under one http location prefix.
virtual Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset)
Write core json.
void SetPickable(Bool_t p)
std::unique_ptr< REveRenderData > fRenderData
! Vertex / normal / triangle index information for rendering.
virtual void BuildRenderData()
Build fRenderData, what the client draws.
Float_t fPosX
position in the (0,1) overlay box; the image is centred on it
Float_t fSize
height in CSS pixels; width follows the image aspect
Float_t fOpacity
resting opacity; the client brightens it on hover
static bool AddImageDir(std::string_view dir)
Add a directory images are served from, searched after the ones registered before it.
std::string fFile
file name or URL, interpreted according to fSource
static bool IsRemote(const std::string &f)
Is the file an absolute URL, to be fetched by the client directly?
void BuildRenderData() override
Name the client factory makeLogo. No geometry is sent.
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override
Stream the file, source, position, size, opacity and resizability.
static std::string sImageDir
static bool SetImageDir(std::string_view dir)
Register the directory images are served from, mapped under "eve-images/".
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
Namespace for ROOT features in testing.