-
Notifications
You must be signed in to change notification settings - Fork 0
/
WaveformsView.h
97 lines (88 loc) · 3.1 KB
/
WaveformsView.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//
// WaveformsView.h
// FeatureViewer
//
// Created by Grogee on 10/3/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import <Accelerate/Accelerate.h>
#import "GLString.h"
static GLuint wfVertexBuffer;
static GLuint wfIndexBuffer;
static GLuint wfColorBuffer;
static GLuint wfPixelBuffer;
static GLfloat *wfVertices;
//static GLfloat *use_vertices;
static GLfloat *wfColors;
//static GLfloat *use_colors;
static GLuint *wfIndices;
static float *wfMinmax;
static float *chMinMax;
static float xmin,xmax,ymin,ymax;
static unsigned int num_spikes,orig_num_spikes;
static unsigned int nWfVertices;
static unsigned int nWfIndices;
static unsigned int wavesize;
static unsigned int waveIndexSize;
static unsigned int chs;
static unsigned int timepts;
static unsigned int channelHop;
static int highlightWave;
static BOOL wfDataloaded;
static void wfPushVertices();
static void wfModifyVertices(GLfloat *vertex_data, unsigned int n);
static void wfModifyIndices(GLuint *index_data,unsigned int n);
static void wfModifyColors(GLfloat *color_data, GLfloat *color,unsigned int n);
@interface WaveformsView : NSView {
@private
NSOpenGLContext *_oglContext;
NSOpenGLPixelFormat *_pixelFormat;
NSData *drawingColor,*highlightColor;
NSMutableData *highlightWaves;
NSMutableArray *highlightedChannels;
//data to hold information on which waveforms are active
NSMutableIndexSet *waveformIndices;
BOOL shouldDrawLabels, drawMean, drawStd;
NSUInteger numSpikesAtLeastMean;
NSMutableData *wfMean, *wfStd;
//variable to indicate whehter to overlay
BOOL overlay;
}
@property (retain,readwrite) NSMutableData *highlightWaves;
@property (retain,readwrite) NSMutableArray *highlightedChannels;
@property (assign,readwrite) BOOL shouldDrawLabels, drawMean, drawStd,overlay;
@property (readonly) NSMutableData *wfMean, *wfStd;
//OpenGL related functions
+(NSOpenGLPixelFormat*)defaultPixelFormat;
-(id) initWithFrame:(NSRect)frameRect pixelFormat:(NSOpenGLPixelFormat*)format;
-(void) setOpenGLContext: (NSOpenGLContext*)context;
-(NSOpenGLContext*)openGLContext;
-(void) clearGLContext;
-(void) prepareOpenGL;
-(void) update;
-(void) drawLabels;
-(void) setPixelFormat:(NSOpenGLPixelFormat*)pixelFormat;
-(NSOpenGLPixelFormat*)pixelFormat;
-(void) _surfaceNeedsUpdate:(NSNotification *)notification;
-(void) setColor:(NSData*)color;
-(NSData*)getColor;
-(NSData*)getHighlightColor;
-(BOOL)isOpaque;
//others
-(void) createVertices: (NSData*)vertex_data withNumberOfWaves: (NSUInteger)nwaves channels: (NSUInteger)channels andTimePoints: (NSUInteger)timepoints andColor: (NSData*)color andOrder: (NSData*)order;
-(void)computeMeandAndStd;
-(void) highlightWaveform:(NSUInteger)wfidx;
-(void) highlightWaveforms:(NSData*)wfidx;
-(void) highlightChannels:(NSArray*)channels;
-(void) receiveNotification:(NSNotification*)notification;
-(void) hideWaveforms:(NSData*)wfidx;
-(void) hideOutlierWaveforms;
-(void)showOnlyHighlighted;
-(NSImage*)image;
-(void) createAxis;
-(void) reshape;
-(void)setDrawStd:(BOOL)_drawStd;
-(void)setDrawMean:(BOOL)_drawMean;
-(void)correlateWaveforms:(id)sender;
@end