Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
REveCamera.hxx
Go to the documentation of this file.
1// @(#)root/eve7:$Id$
2// Authors: Yuxiao Wang, 2025
3
4/*************************************************************************
5 * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT7_REveCamera
13#define ROOT7_REveCamera
14
15#include <ROOT/REveElement.hxx>
16#include <ROOT/REveVector.hxx>
17#include <ROOT/REveTrans.hxx>
18
19#include <string>
20
21namespace ROOT {
22namespace Experimental {
23
24class REveCamera : public REveElement
25{
26public:
28 // Perspective
29 kCameraPerspXOZ, // XOZ floor
30 kCameraPerspYOZ, // YOZ floor
31 kCameraPerspXOY, // XOY floor
32 // Orthographic
33 kCameraOrthoXOY, // Looking down Z axis, X horz, Y vert
34 kCameraOrthoXOZ, // Looking along Y axis, X horz, Z vert
35 kCameraOrthoZOY, // Looking along X axis, Z horz, Y vert
36 kCameraOrthoZOX, // Looking along Y axis, Z horz, X vert
37 // Orthographic negative
38 kCameraOrthoXnOY, // Looking along Z axis, -X horz, Y vert
39 kCameraOrthoXnOZ, // Looking down Y axis, -X horz, Z vert
40 kCameraOrthoZnOY, // Looking down X axis, -Z horz, Y vert
41 kCameraOrthoZnOX // Looking down Y axis, -Z horz, X vert
42 };
43
44private:
46 std::string fName;
47
48 // Camera transformation matrices
49 REveTrans fCamBase; // Base camera matrix (main positioning)
52 float fOrthoZoom{1.f};
53
54public:
55 REveCamera();
56 REveCamera(const std::string &name);
57 virtual ~REveCamera() {}
58
59 void Setup(ECameraType type, const std::string &name, const REveVector &v1, const REveVector &v2);
60
61 ECameraType GetType() const { return fType; }
62 const std::string &GetCameraName() const { return fName; }
63
64 // Camera matrix accessors
66 const REveTrans &GetCamBase() const { return fCamBase; }
67
69 const REveTrans &GetCamTrans() const { return fCamTrans; }
70
71 void SetCamBase(const REveTrans &base) { fCamBase = base; StampObjProps(); }
72
73 // receive mtx from client
74 void SetCamBaseMtx(const std::vector<Double_t> &arr);
75 void SetCamBaseMtx(const std::string &json_str);
76
77 void SetCamTransMtx(const std::vector<Double_t> &arr);
78 void SetCamTransMtxStr(const char* json_str);
79
80 void SetOrthoZoom(float);
81
82 Bool_t IsInitialized() const { return fInitialized; }
83 void SetInitialized(Bool_t val) { fInitialized = val; }
84
85 void BuildRenderData() override{};
86
87 Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
88
90};
91
92} // namespace Experimental
93} // namespace ROOT
94
95#endif
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
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
char name[80]
Definition TGX11.cxx:148
void BuildRenderData() override
Write transformation Matrix to render data.
const REveTrans & GetCamTrans() const
void SetCamTransMtxStr(const char *json_str)
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override
Write core JSON for camera.
REveCamera()
Default constructor.
ECameraType GetType() const
void SetCamBase(const REveTrans &base)
void Setup(ECameraType type, const std::string &name, const REveVector &v1, const REveVector &v2)
Setup camera with type, name, direction and up vectors.
const std::string & GetCameraName() const
void SetCamBaseMtx(const std::vector< Double_t > &arr)
Set camera base matrix from array (called from client via MIR)
void SetInitialized(Bool_t val)
void SetCamTransMtx(const std::vector< Double_t > &arr)
const REveTrans & GetCamBase() const