Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Atte Sillanpaeae
VR-demos
Commits
c24926c9
Commit
c24926c9
authored
Jul 19, 2018
by
Ruben Jesus Garcia Hernandez
Browse files
Support new-style archive json files
parent
65a4204f
Changes
2
Hide whitespace changes
Inline
Side-by-side
NOMADVRLib/ConfigFile.cpp
View file @
c24926c9
...
...
@@ -726,6 +726,7 @@ int loadConfigFile(const char * f)
menubutton
=
Infobox
;
else
if
(
!
strcmp
(
s
,
"Nothing"
))
menubutton
=
Nothing
;
else
eprintf
(
"Unknown menubutton parameter %s
\n
"
,
s
);
}
else
if
(
!
strcmp
(
s
,
"movementspeed"
))
{
r
=
fscanf
(
F
,
"%f"
,
&
movementspeed
);
if
(
r
<
1
)
...
...
NOMADVRLib/atoms.cpp
View file @
c24926c9
...
...
@@ -632,10 +632,11 @@ int readAtomsAnalyticsJson(const char *const f, int **numatoms, int *timesteps,
for
(
rapidjson
::
SizeType
i
=
0
;
i
<
ss
.
Size
();
i
++
)
{
const
rapidjson
::
GenericValue
<
rapidjson
::
UTF8
<>
>
&
el
=
ss
[
i
];
if
(
!
el
.
HasMember
(
"lattice_vectors"
)
||
!
el
.
HasMember
(
"atom_positions"
))
if
(
!
el
.
HasMember
(
"lattice_vectors"
)
&&
!
el
.
HasMember
(
"atom_positions"
))
continue
;
if
(
currenttime
==
0
)
{
// take the lattice vectors only once; verify they are real vectors
if
(
currenttime
==
0
&&
el
.
HasMember
(
"lattice_vectors"
))
{
// take the lattice vectors only once; verify they are real vectors
const
rapidjson
::
GenericValue
<
rapidjson
::
UTF8
<>
>
&
lv
=
el
[
"lattice_vectors"
];
const
rapidjson
::
GenericValue
<
rapidjson
::
UTF8
<>
>
&
flatdata
=
lv
[
"flatData"
];
bool
allzeros
=
true
;
...
...
@@ -649,6 +650,8 @@ int readAtomsAnalyticsJson(const char *const f, int **numatoms, int *timesteps,
has_abc
=
true
;
}
if
(
!
el
.
HasMember
(
"atom_positions"
))
continue
;
const
rapidjson
::
GenericValue
<
rapidjson
::
UTF8
<>
>
&
result
=
el
[
"atom_positions"
];
if
(
!
result
.
HasMember
(
"shape"
))
return
(
-
1
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment