Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynamic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MostafaMollaali
dynamic
Commits
10eb9594
Commit
10eb9594
authored
5 years ago
by
Karsten Rink
Committed by
Tom Fischer
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
adjusting variable scope and default parameters
parent
271b11cb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Applications/FileIO/GocadIO/GocadAsciiReader.cpp
+5
-10
5 additions, 10 deletions
Applications/FileIO/GocadIO/GocadAsciiReader.cpp
Applications/FileIO/GocadIO/GocadAsciiReader.h
+2
-4
2 additions, 4 deletions
Applications/FileIO/GocadIO/GocadAsciiReader.h
with
7 additions
and
14 deletions
Applications/FileIO/GocadIO/GocadAsciiReader.cpp
+
5
−
10
View file @
10eb9594
...
...
@@ -28,9 +28,6 @@ namespace Gocad
const
std
::
string
mat_id_name
=
"MaterialIDs"
;
const
std
::
string
eof_error
=
"Error: Unexpected end of file."
;
GocadAsciiReader
::
GocadAsciiReader
()
:
_export_type
(
GocadDataType
::
ALL
)
{}
GocadAsciiReader
::
GocadAsciiReader
(
GocadDataType
const
t
)
:
_export_type
(
t
)
{}
...
...
@@ -63,8 +60,7 @@ bool GocadAsciiReader::readFile(
std
::
ifstream
in
(
file_name
.
c_str
());
if
(
!
in
.
is_open
())
{
ERR
(
"GocadAsciiReader::readFile(): Could not open file %s."
,
file_name
.
c_str
());
ERR
(
"GocadAsciiReader::readFile(): Could not open file %s."
,
file_name
.
c_str
());
return
false
;
}
...
...
@@ -82,7 +78,7 @@ bool GocadAsciiReader::readFile(
if
(
!
skipToEND
(
in
))
{
std
::
string
const
t
=
(
type
==
GocadDataType
::
VSET
)
?
"VSet"
:
"Model3D"
;
ERR
(
"Parsing of type %s is not implemented. Skipping section."
,
t
);
ERR
(
"Parsing of type %s is not implemented. Skipping section."
,
t
.
c_str
()
);
return
false
;
}
continue
;
...
...
@@ -174,8 +170,7 @@ MeshLib::Mesh* GocadAsciiReader::readData(std::ifstream& in,
}
else
{
WARN
(
"GocadAsciiReader::readData() - Unknown keyword found: %s"
,
line
.
c_str
());
WARN
(
"GocadAsciiReader::readData() - Unknown keyword found: %s"
,
line
.
c_str
());
}
}
ERR
(
"%s"
,
eof_error
.
c_str
());
...
...
@@ -492,7 +487,6 @@ bool GocadAsciiReader::parseLineSegments(
std
::
map
<
std
::
size_t
,
std
::
size_t
>
const
&
node_id_map
,
MeshLib
::
Properties
&
mesh_prop
)
{
std
::
array
<
std
::
size_t
,
3
>
data
;
MeshLib
::
PropertyVector
<
int
>&
mat_ids
=
*
mesh_prop
.
getPropertyVector
<
int
>
(
mat_id_name
);
int
current_mat_id
(
0
);
...
...
@@ -513,6 +507,7 @@ bool GocadAsciiReader::parseLineSegments(
{
std
::
stringstream
sstr
(
line
);
std
::
string
keyword
;
std
::
array
<
std
::
size_t
,
2
>
data
;
sstr
>>
keyword
>>
data
[
0
]
>>
data
[
1
];
std
::
array
<
MeshLib
::
Node
*
,
2
>
elem_nodes
;
for
(
std
::
size_t
i
=
0
;
i
<
2
;
++
i
)
...
...
@@ -547,7 +542,6 @@ bool GocadAsciiReader::parseElements(
std
::
map
<
std
::
size_t
,
std
::
size_t
>
const
&
node_id_map
,
MeshLib
::
Properties
&
mesh_prop
)
{
std
::
array
<
std
::
size_t
,
3
>
data
;
MeshLib
::
PropertyVector
<
int
>&
mat_ids
=
*
mesh_prop
.
getPropertyVector
<
int
>
(
mat_id_name
);
int
current_mat_id
(
0
);
...
...
@@ -568,6 +562,7 @@ bool GocadAsciiReader::parseElements(
{
std
::
stringstream
sstr
(
line
);
std
::
string
keyword
;
std
::
array
<
std
::
size_t
,
3
>
data
;
sstr
>>
keyword
>>
data
[
0
]
>>
data
[
1
]
>>
data
[
2
];
std
::
array
<
MeshLib
::
Node
*
,
3
>
elem_nodes
;
for
(
std
::
size_t
i
=
0
;
i
<
3
;
++
i
)
...
...
This diff is collapsed.
Click to expand it.
Applications/FileIO/GocadIO/GocadAsciiReader.h
+
2
−
4
View file @
10eb9594
...
...
@@ -40,10 +40,8 @@ enum class GocadDataType
class
GocadAsciiReader
final
{
public:
explicit
GocadAsciiReader
();
/// Constructor taking a specific data type (will only export that type)
explicit
GocadAsciiReader
(
GocadDataType
const
t
);
/// Constructor
explicit
GocadAsciiReader
(
GocadDataType
const
t
=
GocadDataType
::
ALL
);
/// Reads the specified file and writes data into internal mesh vector
bool
readFile
(
std
::
string
const
&
file_name
,
...
...
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