12 #ifndef ROOT7_REveRenderData
13 #define ROOT7_REveRenderData
21 namespace Experimental {
27 std::vector<float> fVertexBuffer;
28 std::vector<float> fNormalBuffer;
29 std::vector<int> fIndexBuffer;
30 std::vector<float> fMatrix;
35 enum Primitive_e { GL_POINTS = 0, GL_LINES, GL_LINE_LOOP, GL_LINE_STRIP, GL_TRIANGLES };
37 REveRenderData() =
default;
38 REveRenderData(
const std::string &func,
int size_vert = 0,
int size_norm = 0,
int size_idx = 0);
40 void Reserve(
int size_vert = 0,
int size_norm = 0,
int size_idx = 0);
42 void PushV(
float x) { fVertexBuffer.emplace_back(x); }
44 void PushV(
float x,
float y,
float z)
51 void PushV(
const REveVectorF &v)
58 void PushV(
float *v,
int len) { fVertexBuffer.insert(fVertexBuffer.end(), v, v + len); }
60 void PushN(
float x) { fNormalBuffer.emplace_back(x); }
62 void PushN(
float x,
float y,
float z)
69 void PushN(
const REveVectorF &v)
76 void PushI(
int i) { fIndexBuffer.emplace_back(i); }
78 void PushI(
int i,
int j,
int k)
85 void PushI(
int *v,
int len) { fIndexBuffer.insert(fIndexBuffer.end(), v, v + len); }
87 void PushI(std::vector<int> &v) { fIndexBuffer.insert(fIndexBuffer.end(), v.begin(), v.end()); }
89 void SetMatrix(
const double *arr);
91 const std::string GetRnrFunc()
const {
return fRnrFunc; }
93 int SizeV()
const {
return fVertexBuffer.size(); }
94 int SizeN()
const {
return fNormalBuffer.size(); }
95 int SizeI()
const {
return fIndexBuffer.size(); }
96 int SizeT()
const {
return fMatrix.size(); }
98 int GetBinarySize() {
return (SizeV() + SizeN() + SizeT()) *
sizeof(float) + SizeI() *
sizeof(int); }
100 int Write(
char *msg,
int maxlen);