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
d630124e
Commit
d630124e
authored
2 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
throw -> ASSERT
parent
5ad983ac
No related branches found
No related tags found
1 merge request
!1351
correct some ASSERT statements; convert many throw statements to ASSERT.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Img3D/View/Shader.cpp
+5
-8
5 additions, 8 deletions
Img3D/View/Shader.cpp
Sample/Particle/IFormFactor.cpp
+2
-3
2 additions, 3 deletions
Sample/Particle/IFormFactor.cpp
with
7 additions
and
11 deletions
Img3D/View/Shader.cpp
+
5
−
8
View file @
d630124e
...
...
@@ -14,6 +14,7 @@
#include
"Img3D/View/Shader.h"
#include
"Img3D/View/Camera.h"
#include
"Base/Util/Assert.h"
#include
<QMatrix4x4>
#include
<stdexcept>
...
...
@@ -44,15 +45,11 @@ void Shader::init()
return
;
doInit
=
false
;
auto
shader_found
=
addShaderFromSourceFile
(
QOpenGLShader
::
Vertex
,
":/shaders/vertex_shader.vert"
);
if
(
!
shader_found
)
throw
std
::
runtime_error
(
"Bug in BornAgain configuration: couldn't load vertex shader"
);
auto
ok
=
addShaderFromSourceFile
(
QOpenGLShader
::
Vertex
,
":/shaders/vertex_shader.vert"
);
ASSERT
(
ok
);
shader_found
=
addShaderFromSourceFile
(
QOpenGLShader
::
Fragment
,
":/shaders/fragment_shader.frag"
);
if
(
!
shader_found
)
throw
std
::
runtime_error
(
"Bug in BornAgain configuration: couldn't load fragment shader"
);
ok
=
addShaderFromSourceFile
(
QOpenGLShader
::
Fragment
,
":/shaders/fragment_shader.frag"
);
ASSERT
(
ok
);
bindAttributeLocation
(
"vertex"
,
0
);
bindAttributeLocation
(
"normal"
,
1
);
...
...
This diff is collapsed.
Click to expand it.
Sample/Particle/IFormFactor.cpp
+
2
−
3
View file @
d630124e
...
...
@@ -15,12 +15,12 @@
#include
"Sample/Particle/IFormFactor.h"
#include
"Base/Py/PyFmt.h"
#include
"Base/Types/Span.h"
#include
"Base/Util/Assert.h"
#include
"Base/Util/StringUtils.h"
#include
"Base/Vector/WavevectorInfo.h"
#include
"Sample/Particle/PolyhedralUtil.h"
#include
"Sample/Scattering/Rotations.h"
#include
"Sample/Shapes/IShape3D.h"
#include
<stdexcept>
IFormFactor
::
IFormFactor
()
=
default
;
...
...
@@ -38,8 +38,7 @@ double IFormFactor::volume() const
Span
IFormFactor
::
spanZ
(
const
IRotation
*
rotation
)
const
{
if
(
!
m_shape3D
)
throw
std
::
runtime_error
(
"Bug: Form factor has no m_shape3D, cannot compute top z"
);
ASSERT
(
m_shape3D
);
return
PolyhedralUtil
::
spanZ
(
m_shape3D
->
vertices
(),
rotation
);
}
...
...
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