CMS 3D CMS Logo

FWTEveViewer.h
Go to the documentation of this file.
1 #ifndef Subsystem_Package_FWTEveViewer_h
2 #define Subsystem_Package_FWTEveViewer_h
3 // -*- C++ -*-
4 //
5 // Package: Subsystem/Package
6 // Class : FWTEveViewer
7 //
16 //
17 // Original Author:
18 // Created: Tue, 03 Feb 2015 21:46:04 GMT
19 //
20 
21 // system include files
22 
23 #include <thread>
24 #include <future>
25 #include <mutex>
26 #include <condition_variable>
27 
28 // user include files
29 
30 #include "TEveViewer.h"
31 
32 // forward declarations
33 
34 class FWTGLViewer;
35 
36 class FWTEveViewer : public TEveViewer {
37 public:
38  FWTEveViewer(const char* n = "FWTEveViewer", const char* t = "");
39  ~FWTEveViewer() override;
40 
41  // ---------- const member functions ---------------------
42 
43  // ---------- static member functions --------------------
44 
45  static bool SavePng(const TString& file, UChar_t* xx, int ww, int hh);
46  static bool SaveJpg(const TString& file, UChar_t* xx, int ww, int hh);
47 
48  // ---------- member functions ---------------------------
49 
51 
53 
54  std::future<int> CaptureAndSaveImage(const TString& file, int height = -1);
55 
56 private:
57  FWTEveViewer(const FWTEveViewer&) = delete; // stop default
58 
59  const FWTEveViewer& operator=(const FWTEveViewer&) = delete; // stop default
60 
61  void spawn_image_thread();
62 
63  // ---------- member data --------------------------------
64 
66 
67  std::vector<unsigned char> m_imgBuffer;
68 
69  TString m_name;
70  int m_ww, m_hh;
71  bool m_thr_exit = false;
72  std::thread* m_thr = nullptr;
73  std::promise<int> m_prom;
75  std::condition_variable m_cnd;
76 };
77 
78 #endif
FWTEveViewer::SavePng
static bool SavePng(const TString &file, UChar_t *xx, int ww, int hh)
Definition: FWTEveViewer.cc:185
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
FWTEveViewer::m_prom
std::promise< int > m_prom
Definition: FWTEveViewer.h:73
FWTEveViewer::m_thr_exit
bool m_thr_exit
Definition: FWTEveViewer.h:71
FWTEveViewer
Definition: FWTEveViewer.h:36
FWTEveViewer::m_name
TString m_name
Definition: FWTEveViewer.h:69
FWTEveViewer::m_fwGlViewer
FWTGLViewer * m_fwGlViewer
Definition: FWTEveViewer.h:65
FWTEveViewer::m_cnd
std::condition_variable m_cnd
Definition: FWTEveViewer.h:75
FWTEveViewer::operator=
const FWTEveViewer & operator=(const FWTEveViewer &)=delete
FWTEveViewer::spawn_image_thread
void spawn_image_thread()
Definition: FWTEveViewer.cc:77
hh
const auto & hh
Definition: CAHitNtupletGeneratorKernelsImpl.h:455
FWTEveViewer::m_hh
int m_hh
Definition: FWTEveViewer.h:70
FWTEveViewer::m_moo
std::mutex m_moo
Definition: FWTEveViewer.h:74
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
FWTEveViewer::fwGlViewer
FWTGLViewer * fwGlViewer()
Definition: FWTEveViewer.h:50
mutex
static std::mutex mutex
Definition: Proxy.cc:8
FWTEveViewer::CaptureAndSaveImage
std::future< int > CaptureAndSaveImage(const TString &file, int height=-1)
Definition: FWTEveViewer.cc:125
FWTEveViewer::~FWTEveViewer
~FWTEveViewer() override
Definition: FWTEveViewer.cc:45
FWTEveViewer::m_thr
std::thread * m_thr
Definition: FWTEveViewer.h:72
FWTEveViewer::m_imgBuffer
std::vector< unsigned char > m_imgBuffer
Definition: FWTEveViewer.h:67
FWTEveViewer::SpawnFWTGLViewer
FWTGLViewer * SpawnFWTGLViewer()
Definition: FWTEveViewer.cc:109
FWTEveViewer::m_ww
int m_ww
Definition: FWTEveViewer.h:70
FWTEveViewer::SaveJpg
static bool SaveJpg(const TString &file, UChar_t *xx, int ww, int hh)
Definition: FWTEveViewer.cc:270
FWTEveViewer::FWTEveViewer
FWTEveViewer(const char *n="FWTEveViewer", const char *t="")
Definition: FWTEveViewer.cc:38
FWTGLViewer
Definition: FWTGLViewer.h:32
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
geometryCSVtoXML.xx
xx
Definition: geometryCSVtoXML.py:19