Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
INMOST
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Terekhov
INMOST
Commits
5c461dc9
Commit
5c461dc9
authored
Jun 05, 2017
by
Kirill Terekhov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid data name with spaces writing VTK
parent
50bc6804
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
Source/IO/mesh_vtk_file.cpp
Source/IO/mesh_vtk_file.cpp
+14
-4
No files found.
Source/IO/mesh_vtk_file.cpp
View file @
5c461dc9
...
...
@@ -51,6 +51,16 @@ void ReadCoords(FILE * f,INMOST_DATA_REAL_TYPE c[3])
namespace
INMOST
{
std
::
string
Space2Underscore
(
const
std
::
string
&
inp
)
{
std
::
string
ret
=
inp
;
for
(
size_t
k
=
0
;
k
<
ret
.
size
();
++
k
)
{
if
(
ret
[
k
]
==
' '
)
ret
[
k
]
=
'_'
;
}
return
ret
;
}
int
VtkElementType
(
ElementType
t
)
{
...
...
@@ -346,7 +356,7 @@ safe_output:
||
tags
[
i
].
GetDataType
()
==
DATA_VARIABLE
#endif
)
type_str
=
"double"
;
fprintf
(
f
,
"SCALARS %s %s %d
\n
"
,
tags
[
i
].
GetTagName
(
).
c_str
(),
type_str
.
c_str
(),
comps
);
fprintf
(
f
,
"SCALARS %s %s %d
\n
"
,
Space2Underscore
(
tags
[
i
].
GetTagName
()
).
c_str
(),
type_str
.
c_str
(),
comps
);
fprintf
(
f
,
"LOOKUP_TABLE default
\n
"
);
for
(
Mesh
::
iteratorCell
it
=
BeginCell
();
it
!=
EndCell
();
it
++
)
{
...
...
@@ -478,7 +488,7 @@ safe_output:
unsigned
int
comps
=
tags
[
i
].
GetSize
();
if
(
comps
==
ENUMUNDEF
)
{
//printf("Warning: vtk don't support arrays of variable size (tag name: %s)\n",tags[i].
GetTagName
().c_str());
//printf("Warning: vtk don't support arrays of variable size (tag name: %s)\n",tags[i].
\
().c_str());
continue
;
}
else
...
...
@@ -490,7 +500,7 @@ safe_output:
||
tags
[
i
].
GetDataType
()
==
DATA_VARIABLE
#endif
)
type_str
=
"double"
;
fprintf
(
f
,
"SCALARS %s %s %d
\n
"
,
tags
[
i
].
GetTagName
(
).
c_str
(),
type_str
.
c_str
(),
comps
);
fprintf
(
f
,
"SCALARS %s %s %d
\n
"
,
Space2Underscore
(
tags
[
i
].
GetTagName
()
).
c_str
(),
type_str
.
c_str
(),
comps
);
fprintf
(
f
,
"LOOKUP_TABLE default
\n
"
);
for
(
Mesh
::
iteratorNode
it
=
BeginNode
();
it
!=
EndNode
();
it
++
)
{
...
...
@@ -692,7 +702,7 @@ safe_output:
t
=
DATA_REAL
;
else
{
std
::
cout
<<
__FILE__
<<
":"
<<
__LINE__
<<
" unexpected data type "
<<
attrtype
<<
" in "
<<
File
<<
std
::
endl
;
std
::
cout
<<
__FILE__
<<
":"
<<
__LINE__
<<
" unexpected data type "
<<
attrtype
<<
" in "
<<
File
<<
" for "
<<
attrname
<<
std
::
endl
;
std
::
cout
<<
"expected one of: bit, unsigned_char, char, unsigned_short, short, unsigned_int, int, unsigned_long, long, float, double"
<<
std
::
endl
;
throw
BadFile
;
}
...
...
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