18#include <nlohmann/json.hpp>
37std::string REveLogo::sImageDir;
55 return f.compare(0, 7,
"http://") == 0 ||
f.compare(0, 8,
"https://") == 0 ||
f.compare(0, 2,
"//") == 0;
64 static const char *tpfx =
"REveLogo::SetImageDir";
67 ::Error(tpfx,
"REveManager needs to be initialized before the image dir can be set.");
71 std::string sanitized(dir);
72 if (sanitized.empty()) {
73 ::Error(tpfx,
"Empty directory given.");
76 if (sanitized.back() !=
'/')
80 ::Error(tpfx,
"Image directory '%s' does not exist or is not readable.", sanitized.c_str());
112 fRenderData = std::make_unique<REveRenderData>(
"makeLogo");
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
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()
Write transformation Matrix to render data.
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
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/".
void AddLocation(const std::string &name, const std::string &path)
Register new directory to THttpServer.
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.
R__EXTERN REveManager * gEve