Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
fea7d47f
Commit
fea7d47f
authored
5 years ago
by
Juan Manuel Carmona Loaiza
Browse files
Options
Downloads
Patches
Plain Diff
Add 'm_' to member variables.
parent
4273fda3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/ba3d/ba3d/view/buffer.cpp
+14
-14
14 additions, 14 deletions
GUI/ba3d/ba3d/view/buffer.cpp
GUI/ba3d/ba3d/view/buffer.h
+6
-6
6 additions, 6 deletions
GUI/ba3d/ba3d/view/buffer.h
with
20 additions
and
20 deletions
GUI/ba3d/ba3d/view/buffer.cpp
+
14
−
14
View file @
fea7d47f
...
...
@@ -27,13 +27,13 @@ Buffer::Buffer(Geometry const& geometry) {
initializeOpenGLFunctions
();
auto
&
mesh
=
geometry
.
m_mesh
;
vertexCount
=
mesh
.
count
();
m_
vertexCount
=
mesh
.
count
();
QOpenGLVertexArrayObject
::
Binder
__
(
&
vao
);
QOpenGLVertexArrayObject
::
Binder
__
(
&
m_
vao
);
glBuffer
.
create
();
glBuffer
.
bind
();
glBuffer
.
allocate
(
mesh
.
constData
(),
vertexCount
*
int
(
sizeof
(
Geometry
::
Vert_Normal
)));
m_
glBuffer
.
create
();
m_
glBuffer
.
bind
();
m_
glBuffer
.
allocate
(
mesh
.
constData
(),
m_
vertexCount
*
int
(
sizeof
(
Geometry
::
Vert_Normal
)));
glEnableVertexAttribArray
(
0
);
// vertices
glEnableVertexAttribArray
(
1
);
// normals
...
...
@@ -43,14 +43,14 @@ Buffer::Buffer(Geometry const& geometry) {
}
void
Buffer
::
draw
()
{
QOpenGLVertexArrayObject
::
Binder
__
(
&
vao
);
glDrawArrays
(
GL_TRIANGLES
,
0
,
vertexCount
);
QOpenGLVertexArrayObject
::
Binder
__
(
&
m_
vao
);
glDrawArrays
(
GL_TRIANGLES
,
0
,
m_
vertexCount
);
}
Buffer3DAxes
::
Buffer3DAxes
()
{
initializeOpenGLFunctions
();
QOpenGLVertexArrayObject
::
Binder
__
(
&
vao3DAxes
);
QOpenGLVertexArrayObject
::
Binder
__
(
&
m_
vao3DAxes
);
// vertices (xyz) and colors (rgb) for drawing each line (also arrows) in the 3D axes
const
GLfloat
vertices3DAxes
[]
=
{
...
...
@@ -88,11 +88,11 @@ Buffer3DAxes::Buffer3DAxes() {
cz
*-
0.05
f
,
cz
*-
0.05
f
,
cz
*
0.95
f
,
0.0
f
,
0.0
f
,
1.0
f
,
};
vertexCount3DAxes
=
30
;
m_
vertexCount3DAxes
=
30
;
glBuffer3DAxes
.
create
();
glBuffer3DAxes
.
bind
();
glBuffer3DAxes
.
allocate
(
vertices3DAxes
,
int
(
sizeof
(
vertices3DAxes
)));
m_
glBuffer3DAxes
.
create
();
m_
glBuffer3DAxes
.
bind
();
m_
glBuffer3DAxes
.
allocate
(
vertices3DAxes
,
int
(
sizeof
(
vertices3DAxes
)));
glEnableVertexAttribArray
(
0
);
// 3D axes vertices
glEnableVertexAttribArray
(
2
);
// 3D axes colors
...
...
@@ -102,9 +102,9 @@ Buffer3DAxes::Buffer3DAxes() {
}
void
Buffer3DAxes
::
draw3DAxes
()
{
QOpenGLVertexArrayObject
::
Binder
__
(
&
vao3DAxes
);
QOpenGLVertexArrayObject
::
Binder
__
(
&
m_
vao3DAxes
);
glLineWidth
(
1.4
f
);
glDrawArrays
(
GL_LINES
,
0
,
vertexCount3DAxes
);
glDrawArrays
(
GL_LINES
,
0
,
m_
vertexCount3DAxes
);
}
}
// namespace RealSpace
This diff is collapsed.
Click to expand it.
GUI/ba3d/ba3d/view/buffer.h
+
6
−
6
View file @
fea7d47f
...
...
@@ -33,9 +33,9 @@ public:
void
draw
();
private:
int
vertexCount
;
QOpenGLVertexArrayObject
vao
;
QOpenGLBuffer
glBuffer
;
int
m_
vertexCount
;
QOpenGLVertexArrayObject
m_
vao
;
QOpenGLBuffer
m_
glBuffer
;
};
// Buffer for drawing 3D Coordinate Axes on canvas
...
...
@@ -46,9 +46,9 @@ public:
void
draw3DAxes
();
private:
int
vertexCount3DAxes
;
QOpenGLVertexArrayObject
vao3DAxes
;
QOpenGLBuffer
glBuffer3DAxes
;
int
m_
vertexCount3DAxes
;
QOpenGLVertexArrayObject
m_
vao3DAxes
;
QOpenGLBuffer
m_
glBuffer3DAxes
;
};
}
// namespace RealSpace
...
...
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