21#include <nlohmann/json.hpp>
36REveViewer::REveViewer(
const std::string&
n,
const std::string& t) :
68 if (sinfo && sinfo->GetScene() == scene)
70 throw eh +
"scene already in the viewer.";
113 std::string fn =
"LiberationSerif-Regular";
115 REX::REveText::AssertSdfFont(fn, rf_dir + fn +
".ttf");
150 fRenderMaxHz = hz < 0.f ? 0.f : (hz > 240.f ? 240.f : hz);
201 fAxesFontSize = s < 0.004f ? 0.004f : (s > 0.05f ? 0.05f : s);
290 j[
"AxesBBox"] =
nullptr;
304 j[
"UT_PostStream"] =
"UT_EveViewerUpdate";
349 fShowTooltip (
kTRUE),
506 for (
auto &j: viewer->RefChildren()) {
543 auto cam =
dynamic_cast<REveCamera *
>(element);
557 if (cam->GetType() ==
type) {
580 static const CameraDef predefinedCameras[] = {
597 for (
const auto &camDef : predefinedCameras) {
598 if (
type == camDef.type) {
601 cam->
Setup(camDef.type, camDef.name, camDef.v1, camDef.v2);
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
void Setup(ECameraType type, const std::string &name, const REveVector &v1, const REveVector &v2)
Setup camera with type, name, direction and up vectors.
virtual void RemoveElementsLocal()
Perform additional local removal of all elements.
virtual Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset)
Write core json.
virtual void AddElement(REveElement *el)
Add el to the list of children.
virtual void RemoveElementLocal(REveElement *el)
Perform additional local removal of el.
void SetChildClass(TClass *c)
ElementId_t GetElementId() const
virtual void RemoveElement(REveElement *el)
Remove el from the list of children.
REveException Exception-type thrown by Eve classes.
void DisconnectEveViewer(REveViewer *)
REveElement * FindElementById(ElementId_t id) const
Lookup ElementId in element map and return corresponding REveElement*.
void ConnectEveViewer(REveViewer *)
REveElement * GetCameras() const
REveSceneInfo Scene in a viewer.
REveScene * GetScene() const
void SetMandatory(bool x)
static void SetColorBrightness(Float_t value, Bool_t full_redraw=kFALSE)
Tweak all ROOT colors to become brighter (if value > 0) or darker (value < 0).
void RemoveElementsLocal() override
Decompoundofy children, call base-class version.
void AddElement(REveElement *el) override
Call base-class implementation.
~REveViewerList() override
Destructor.
void SceneDestructing(REveScene *scene)
Callback done from a REveScene destructor allowing proper removal of the scene from affected viewers.
void SetColorBrightness(Float_t b)
Set color brightness.
void RepaintAllViewers(Bool_t resetCameras, Bool_t dropLogicals)
Repaint all viewers.
virtual void Disconnect()
Disconnect from TGLViewer class-signals.
void RepaintChangedViewers(Bool_t resetCameras, Bool_t dropLogicals)
Repaint viewers that are tagged as changed.
void SwitchColorSet()
Switch background color.
REveViewerList(const REveViewerList &)=delete
virtual void Connect()
Connect to TGLViewer class-signals.
void DeleteAnnotations()
Delete annotations from all viewers.
void RemoveElementLocal(REveElement *el) override
Decompoundofy el, call base-class version.
void SetCameraCenter(ECameraCenter c)
Set the point the camera looks at and orbits around, either the world origin or the center of the sce...
void SetMandatory(bool x)
void RemoveElementLocal(REveElement *el) override
Remove element 'el' from the list of children and also remove appropriate GLScene from GLViewer's lis...
void DisconnectClient()
Function called from MIR when user closes one of the viewer window.
void ConnectClient()
Function called from MIR when user wants to stream unsubscribed view.
Bool_t fExtrapolateMotion
Let the client extrapolate streamed motion between updates.
~REveViewer() override
Destructor.
void SetCamera(ROOT::Experimental::REveCamera *cam)
Set camera reference.
std::vector< REveCamera * > fCameraList
void RemoveElementsLocal() override
Remove all children, forwarded to GLViewer.
Float_t fAxesAtten
Distance attenuation of the 3D axis labels; see SetAxesAtten().
void ClearAxesBBox()
Let the 3D axis follow the scene bounding box again.
void SetRenderMaxHz(Float_t)
Cap the redraw rate of this viewer, in frames per second; 0 is uncapped.
ECameraCenter fCameraCenter
void SetCameraType(REveCamera::ECameraType type)
Set camera by type (backward compatibility with old API)
void SetTooltipAlpha(Float_t a)
Opacity of the plate behind the tooltip and kept annotations.
Float_t fAxesBBox[6]
xmin, ymin, zmin, xmax, ymax, zmax
Float_t fLightScale
Multiplier on the client's light intensities; see SetLightScale().
Float_t fRenderMaxHz
see SetRenderMaxHz(); 0 is uncapped
void SetAxesFontSize(Float_t s)
Label size for the 3D axis, as a fraction of viewport height, clamped to [0.004, 0....
void SetExtrapolateMotion(bool)
Enable or disable client-side extrapolation of streamed motion.
Float_t fTooltipFontSize
Tooltip text size, same units as fAxesFontSize.
Int_t fAutoTuneSerial
Bumped by AutoTuneLights(); the client re-measures when it changes.
void AutoTuneLights()
Ask the clients to pick a light scale that keeps the brightest channel just below white.
void SetAxesBBox(Float_t xmin, Float_t ymin, Float_t zmin, Float_t xmax, Float_t ymax, Float_t zmax)
Fix the volume the 3D axis spans, as {min, max} per coordinate, instead of following the scene conten...
Bool_t fHasAxesBBox
see SetAxesBBox()
ECameraCenter
Point the camera looks at and orbits around after a camera reset.
Int_t fAxesUpAxis
Which axis points up: 0/1/2 for x/y/z, -1 (default) for none.
Int_t WriteCoreJson(nlohmann::json &cj, Int_t rnr_offset) override
Stream Camera Info.
void SetCameraByElementId(ElementId_t cameraId)
Float_t fTooltipAlpha
Opacity of the plate behind the tooltip and kept annotations, in [0, 1].
void SetAxesAtten(Float_t a)
Distance attenuation of the 3D axis labels.
void SetLightScale(Float_t s)
Multiplier on the client's light intensities, clamped at zero from below.
void Redraw(Bool_t resetCameras=kFALSE)
Redraw viewer immediately.
virtual void AddScene(REveScene *scene)
Add 'scene' to the list of scenes.
void SetTooltipFontSize(Float_t s)
Label size for the hover tooltip, as a fraction of viewport height.
ROOT::Experimental::REveCamera * CreateCamera(ECameraType type)
void SetToneMapKnee(Float_t k)
Knee position for kToneKnee: colours below this pass through exactly, so raising it buys fidelity and...
Float_t fAxesFontSize
3D axis label size, as a fraction of viewport height.
void SetAxesUpAxis(int)
Set the up axis, 0/1/2 for x/y/z; any other value means none.
void SetToneMapMode(Int_t m)
Tone curve, as EToneMapMode.
void SetBlackBackground(bool)
static const TString & GetDataDir()
Get the data directory in the installation. Static utility function.
Namespace for ROOT features in testing.
R__EXTERN REveManager * gEve
REveVectorT< Float_t > REveVector