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
108aabb1
Commit
108aabb1
authored
3 years ago
by
Matthias Puchner
Browse files
Options
Downloads
Patches
Plain Diff
rm obsolete code
parent
71eb0813
No related branches found
No related tags found
1 merge request
!648
Refactor material model
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/Model/Item/MaterialItems.cpp
+0
-34
0 additions, 34 deletions
GUI/Model/Item/MaterialItems.cpp
GUI/Model/Item/MaterialItems.h
+0
-4
0 additions, 4 deletions
GUI/Model/Item/MaterialItems.h
with
0 additions
and
38 deletions
GUI/Model/Item/MaterialItems.cpp
+
0
−
34
View file @
108aabb1
...
...
@@ -16,11 +16,8 @@
#include
"Base/Util/Assert.h"
#include
"GUI/Model/Item/MaterialItem.h"
#include
"GUI/Model/XML/Serializer.h"
#include
"GUI/Support/Data/XML.h"
#include
"GUI/Util/DeserializationException.h"
#include
<QColor>
#include
<QUuid>
#include
<QXmlStreamWriter>
#include
<random>
namespace
{
...
...
@@ -162,37 +159,6 @@ void MaterialItems::removeMaterial(MaterialItem* materialItem)
emit
materialAddedOrRemoved
();
}
void
MaterialItems
::
writeContentTo
(
QXmlStreamWriter
*
writer
)
const
{
GUI
::
Session
::
XML
::
writeAttribute
(
writer
,
GUI
::
Session
::
XML
::
Version
,
int
(
1
));
for
(
auto
*
m
:
m_materialItems
)
{
writer
->
writeStartElement
(
"Material"
);
m
->
writeContentTo
(
writer
);
writer
->
writeEndElement
();
}
}
void
MaterialItems
::
readContentFrom
(
QXmlStreamReader
*
reader
)
{
clear
();
const
int
version
=
reader
->
attributes
().
value
(
GUI
::
Session
::
XML
::
Version
).
toInt
();
if
(
version
<
1
)
throw
DeserializationException
::
tooOld
();
if
(
version
>
1
)
throw
DeserializationException
::
tooNew
();
while
(
reader
->
readNextStartElement
())
{
if
(
reader
->
name
()
==
"Material"
)
{
auto
*
m
=
new
MaterialItem
;
m
->
readContentFrom
(
reader
);
addMaterial
(
m
,
false
);
reader
->
skipCurrentElement
();
}
}
}
void
MaterialItems
::
serialize
(
Serializer
&
s
)
{
if
(
s
.
isReading
())
...
...
This diff is collapsed.
Click to expand it.
GUI/Model/Item/MaterialItems.h
+
0
−
4
View file @
108aabb1
...
...
@@ -19,8 +19,6 @@
#include
<QVector>
class
MaterialItem
;
class
QXmlStreamReader
;
class
QXmlStreamWriter
;
class
Serializer
;
class
MaterialItems
:
public
QObject
{
...
...
@@ -55,8 +53,6 @@ public:
void
removeMaterial
(
const
QString
&
identifier
);
void
removeMaterial
(
MaterialItem
*
materialItem
);
void
writeContentTo
(
QXmlStreamWriter
*
writer
)
const
;
void
readContentFrom
(
QXmlStreamReader
*
reader
);
void
serialize
(
Serializer
&
s
);
//! Copies the complete content, emitting signals for existing and changed materials
...
...
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