Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
plugin-GUI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
yehaojie
plugin-GUI
Commits
1e8a90b6
Commit
1e8a90b6
authored
13 years ago
by
Stuart Layton
Browse files
Options
Downloads
Plain Diff
Merge branch 'spikevis' into opengl
parents
c21d66c2
8a623da3
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source/Processors/Visualization/SpikePlotting/TitleBox.cpp
+0
-76
0 additions, 76 deletions
Source/Processors/Visualization/SpikePlotting/TitleBox.cpp
Source/Processors/Visualization/SpikePlotting/TitleBox.h
+0
-35
0 additions, 35 deletions
Source/Processors/Visualization/SpikePlotting/TitleBox.h
with
0 additions
and
111 deletions
Source/Processors/Visualization/SpikePlotting/TitleBox.cpp
deleted
100644 → 0
+
0
−
76
View file @
c21d66c2
#include
"TitleBox.h"
#include
"PlotUtils.h"
TitleBox
::
TitleBox
()
:
BaseUIElement
(
0
,
0
,
15
,
100
,
0
)
{
setColor
(
.15
,
.15
,
.50
);
setSelectedColor
(
.15
,
.50
,
.15
);
selected
=
false
;
BaseUIElement
::
elementName
=
(
char
*
)
"TitleBox - Un initialized"
;
title
=
(
char
*
)
"Tetrode:00 abcdefghijkl"
;
}
TitleBox
::
TitleBox
(
int
x
,
int
y
,
int
w
,
int
h
,
const
char
*
n
)
:
BaseUIElement
(
x
,
y
,
w
,
h
,
0
)
{
setColor
(
.15
,
.15
,
.50
);
setSelectedColor
(
.15
,
.50
,
.15
);
selected
=
false
;
BaseUIElement
::
elementName
=
(
char
*
)
"TitleBox"
;
title
=
n
;
//(char *) "Tetrode:00 No Port or Label";
}
void
TitleBox
::
redraw
(){
BaseUIElement
::
redraw
();
if
(
selected
)
glColor3fv
(
selectedColor
);
else
glColor3fv
(
titleColor
);
// draw the colored background for the plot
glRecti
(
-
1
,
-
1
,
1
,
1
);
// Reset color to white so we can draw the title text in white
glColor3f
(
1.0
,
1.0
,
1.0
);
void
*
font
;
// = GLUT_BITMAP_9_BY_15;
// We want the title string to be centered in the box regardless of how
// many chars are in the title. To do this we must compute the proper X offset
// for the title string. Using a 9x15 font each char is 9 pixels wide.
// convert from chars to pixels and then normalize using the size of the window.
// We don't have to devide by two to center the string because the dynamic
// range of the viewport goes from -1 to 1 and the following equatition treats it as 1
// we would then have to multiply and divide by 2 which is redundant so we dont
float
xOffset
=
-
1
*
(
(
float
)
strlen
(
title
)
*
9.0
)
/
(
BaseUIElement
::
width
);
if
(
xOffset
<-
.95
)
xOffset
=
-
.95
;
drawString
(
xOffset
,
-
.6
,
font
,
title
);
BaseUIElement
::
drawElementEdges
();
}
void
TitleBox
::
setTitle
(
char
*
n
){
title
=
n
;
}
void
TitleBox
::
setSelected
(
bool
sel
){
selected
=
sel
;
}
void
TitleBox
::
setColor
(
GLfloat
r
,
GLfloat
g
,
GLfloat
b
){
titleColor
[
0
]
=
r
;
titleColor
[
1
]
=
g
;
titleColor
[
2
]
=
b
;
}
void
TitleBox
::
setSelectedColor
(
GLfloat
r
,
GLfloat
g
,
GLfloat
b
){
selectedColor
[
0
]
=
r
;
selectedColor
[
1
]
=
g
;
selectedColor
[
2
]
=
b
;
}
void
TitleBox
::
setPosition
(
int
x
,
int
y
,
double
w
,
double
h
){
BaseUIElement
::
setPosition
(
x
,
y
,
w
,
h
);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Source/Processors/Visualization/SpikePlotting/TitleBox.h
deleted
100644 → 0
+
0
−
35
View file @
c21d66c2
#ifndef TITLE_BOX_H_
#define TITLE_BOX_H_
#if defined(__linux__)
#include
<GL/glut.h>
#else
#include
<GLUT/glut.h>
#endif
#include
"BaseUIElement.h"
class
TitleBox
:
public
BaseUIElement
{
const
char
*
title
;
bool
selected
;
void
drawTitle
();
GLfloat
titleColor
[
3
];
GLfloat
selectedColor
[
3
];
public:
TitleBox
();
TitleBox
(
int
x
,
int
y
,
int
w
,
int
h
,
const
char
*
n
);
void
redraw
();
void
setTitle
(
char
*
n
);
void
setSelected
(
bool
sel
);
void
setColor
(
float
,
float
,
float
);
void
setSelectedColor
(
float
,
float
,
float
);
void
setPosition
(
int
,
int
,
double
,
double
);
};
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment