Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
REveRenderData.hxx
Go to the documentation of this file.
1// @(#)root/eve7:$Id$
2// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007, 2018
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_REveRenderData
13#define ROOT7_REveRenderData
14
15#include <ROOT/REveVector.hxx>
16
17#include <string>
18#include <vector>
19
20namespace ROOT {
21namespace Experimental {
22
24{
25private:
26 std::string fRnrFunc;
27 std::vector<float> fVertexBuffer;
28 std::vector<float> fNormalBuffer;
29 std::vector<int> fIndexBuffer;
30 std::vector<float> fMatrix;
31
32public:
33 // If Primitive_e is changed, change also definition in EveElements.js.
34
36
37 REveRenderData() = default;
38 REveRenderData(const std::string &func, int size_vert = 0, int size_norm = 0, int size_idx = 0);
39
40 void Reserve(int size_vert = 0, int size_norm = 0, int size_idx = 0);
41
42 void PushV(float x) { fVertexBuffer.emplace_back(x); }
43
44 void PushV(float x, float y, float z)
45 {
46 PushV(x);
47 PushV(y);
48 PushV(z);
49 }
50
51 void PushV(const REveVectorF &v)
52 {
53 PushV(v.fX);
54 PushV(v.fY);
55 PushV(v.fZ);
56 }
57
58 void PushV(float *v, int len) { fVertexBuffer.insert(fVertexBuffer.end(), v, v + len); }
59
60 void PushN(float x) { fNormalBuffer.emplace_back(x); }
61
62 void PushN(float x, float y, float z)
63 {
64 PushN(x);
65 PushN(y);
66 PushN(z);
67 }
68
69 void PushN(const REveVectorF &v)
70 {
71 PushN(v.fX);
72 PushN(v.fY);
73 PushN(v.fZ);
74 }
75
76 void PushI(UInt_t i) { fIndexBuffer.emplace_back(i); }
77
78 void PushI(UInt_t i, UInt_t j, UInt_t k)
79 {
80 PushI(i);
81 PushI(j);
82 PushI(k);
83 }
84
85 void PushI(UInt_t *v, int len) { fIndexBuffer.insert(fIndexBuffer.end(), v, v + len); }
86
87 void PushI(std::vector<UInt_t> &v) { fIndexBuffer.insert(fIndexBuffer.end(), v.begin(), v.end()); }
88
89 void SetMatrix(const double *arr);
90
91 const std::string GetRnrFunc() const { return fRnrFunc; }
92
93 void ResizeV(int s) { fVertexBuffer.resize(s); }
94
95 int SizeV() const { return fVertexBuffer.size(); }
96 int SizeN() const { return fNormalBuffer.size(); }
97 int SizeI() const { return fIndexBuffer.size(); }
98 int SizeT() const { return fMatrix.size(); }
99
100 int GetBinarySize() { return (SizeV() + SizeN() + SizeT()) * sizeof(float) + SizeI() * sizeof(int); }
101
102 int Write(char *msg, int maxlen);
103
104 static void CalcTextureSize(int nel, int align, int &sx, int &sy);
105};
106
107} // namespace Experimental
108} // namespace ROOT
109
110#endif
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 UChar_t len
void PushV(float x, float y, float z)
void Reserve(int size_vert=0, int size_norm=0, int size_idx=0)
Reserve place for render data.
int Write(char *msg, int maxlen)
Write render data to binary buffer.
void PushN(const REveVectorF &v)
const std::string GetRnrFunc() const
void PushV(const REveVectorF &v)
static void CalcTextureSize(int nel, int align, int &sx, int &sy)
Calculate texture dimensions to hold nel elements with given alignment on x axis.
void PushN(float x, float y, float z)
void SetMatrix(const double *arr)
Set transformation matrix.
void PushI(std::vector< UInt_t > &v)
void PushI(UInt_t i, UInt_t j, UInt_t k)
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...