Open Ephys GUI
 All Classes Functions Variables Pages
ProjectionAxes.h
1 #ifndef PROJECTION_AXES_H_
2 #define PROJECTION_AXES_H_
3 
4 #define GL_GLEXT_PROTOTYPES
5 
6 #if defined(__linux__)
7  #include <GL/glut.h>
8 #else
9  #include <GLUT/glut.h>
10 #endif
11 #include <stdlib.h>
12 #include "BaseUIElement.h"
13 #include "../SpikeObject.h"
14 #include "PlotUtils.h"
15 #include "GenericAxes.h"
16 #include <stdint.h>
17 
18 #define AMP_BUFF_MAX_SIZE 50000
19 
21 
22  GLfloat pointColor[3];
23  GLfloat gridColor[3];
24 
25  int ampBuffer[2][AMP_BUFF_MAX_SIZE];
26  uint16_t buffIdx; // points to the most recent spike
27  uint64_t totalSpikes;
28 
29 
30  int ampDim1, ampDim2;
31 
32 
33  void drawProjectionGrid(int thold, int gain);
34  void calcWaveformPeakIdx(int, int, int*, int*);
35 
36  void createTexture();
37  void createFBO();
38 
39  void drawSpikesToTexture(bool allSpikes);
40  void drawTexturedQuad();
41  void plotOldSpikes(bool allSpikes);
42  void plotNewestSpike();
43 
44  bool newSpike;
45 
46 
47  GLuint fboId; // Frame Buffer Object
48  GLuint textureId; // Texture
49  GLuint rboId; // Render Buffer
50 
51  int texWidth;
52  int texHeight;
53 
54  bool clearOnNextDraw;
55  bool isTextureValid;
56  bool fboCreated;
57  void clearTexture();
58 
59  void validateTexture();
60 
61  bool allSpikesNextRender;
62 
63 protected:
64  void plot();
65 
66 
67 public:
69  ProjectionAxes(int x, int y, double w, double h, int t);
70 
71  void setPosition(int, int, int, int);
72  void updateSpikeData(SpikeObject s);
73 
74  void setPointColor(GLfloat r, GLfloat g, GLfloat b);
75  void setGridColor(GLfloat, GLfloat, GLfloat);
76 
77  void clear();
78  void invalidateTexture();
79 
80  void redraw();
81 
82  bool overlay;
83  bool drawGrid;
84  bool convertLabelUnits;
85 
86 
87 };
88 
89 #endif // PROJECTION_AXES_H_
90 
91 
92 
93 
94 // #endif