Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
1ca61454
Commit
1ca61454
authored
Feb 28, 2013
by
Sebastian Eichelbaum
Browse files
[CHANGE] values type in fiber vtk format changed to double
parent
1f85c08e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
src/core/dataHandler/WDataSetFibers.h
src/core/dataHandler/WDataSetFibers.h
+1
-1
src/modules/data/io/WReaderFiberVTK.cpp
src/modules/data/io/WReaderFiberVTK.cpp
+5
-5
No files found.
src/core/dataHandler/WDataSetFibers.h
View file @
1ca61454
...
...
@@ -86,7 +86,7 @@ public:
/**
* Parameter storage for each vertex.
*/
typedef
boost
::
shared_ptr
<
std
::
vector
<
float
>
>
VertexParemeterArray
;
typedef
boost
::
shared_ptr
<
std
::
vector
<
double
>
>
VertexParemeterArray
;
/**
* Item used in the selection below also containing color info.
...
...
src/modules/data/io/WReaderFiberVTK.cpp
View file @
1ca61454
...
...
@@ -193,7 +193,7 @@ void WReaderFiberVTK::readValues()
std
::
string
line
=
getLine
(
"reading VALUES declaration"
);
std
::
vector
<
std
::
string
>
tokens
=
string_utils
::
tokenize
(
line
);
if
(
tokens
.
size
()
!=
3
||
string_utils
::
toLower
(
tokens
.
at
(
2
)
)
!=
"
float
"
)
if
(
tokens
.
size
()
!=
3
||
string_utils
::
toLower
(
tokens
.
at
(
2
)
)
!=
"
double
"
)
{
// do not throw an error. this is a custom extension.
return
;
...
...
@@ -203,12 +203,12 @@ void WReaderFiberVTK::readValues()
wlog
::
debug
(
"ReaderFiberVTK"
)
<<
"Found "
<<
numValues
<<
" values."
;
float
*
valueData
=
new
float
[
numValues
];
m_ifs
->
read
(
reinterpret_cast
<
char
*
>
(
valueData
),
sizeof
(
float
)
*
numValues
);
double
*
valueData
=
new
double
[
numValues
];
m_ifs
->
read
(
reinterpret_cast
<
char
*
>
(
valueData
),
sizeof
(
double
)
*
numValues
);
switchByteOrderOfArray
(
valueData
,
numValues
);
// all 4 bytes of each
float
are in wrong order we need to reorder them
switchByteOrderOfArray
(
valueData
,
numValues
);
// all 4 bytes of each
double
are in wrong order we need to reorder them
m_fiberParameters
=
WDataSetFibers
::
VertexParemeterArray
(
new
std
::
vector
<
float
>
);
m_fiberParameters
=
WDataSetFibers
::
VertexParemeterArray
(
new
std
::
vector
<
double
>
);
m_fiberParameters
->
reserve
(
numValues
);
for
(
size_t
i
=
0
;
i
<
numValues
;
++
i
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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