Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
txt2pcd
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Thibault Payet
txt2pcd
Commits
5ed29d22
Verified
Commit
5ed29d22
authored
2 years ago
by
Thibault Payet
Browse files
Options
Downloads
Patches
Plain Diff
Add an option to just convert a txt with same output name
parent
951bf8c1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.cpp
+11
-3
11 additions, 3 deletions
main.cpp
with
11 additions
and
3 deletions
main.cpp
+
11
−
3
View file @
5ed29d22
...
...
@@ -10,7 +10,7 @@
void
txt2pcd
(
std
::
filesystem
::
path
input
,
std
::
filesystem
::
path
output
)
{
std
::
ifstream
inputFile
{
input
.
c_str
()};
std
::
ifstream
inputFile
{
input
.
c_str
()
};
if
(
inputFile
)
{
...
...
@@ -20,7 +20,7 @@ void txt2pcd( std::filesystem::path input, std::filesystem::path output )
std
::
string
line
;
auto
len
=
inputFile
.
tellg
();
char
buf
{
'\0'
};
char
buf
{
'\0'
};
do
{
...
...
@@ -104,7 +104,7 @@ void txt2pcd( std::filesystem::path input, std::filesystem::path output )
void
printHelp
()
{
std
::
cout
<<
"Usage: txt2pcd inputCloud.txt outputCloud.pcd
\n
"
;
std
::
cout
<<
"Usage: txt2pcd inputCloud.txt
[
outputCloud.pcd
]
\n
"
;
}
int
main
(
int
argc
,
char
**
argv
)
...
...
@@ -120,6 +120,14 @@ int main( int argc, char** argv )
std
::
cerr
<<
e
.
what
()
<<
"
\n
"
;
}
}
else
if
(
argc
==
2
)
{
auto
basefilename
=
std
::
filesystem
::
path
{
argv
[
1
]
};
auto
outfilename
=
basefilename
;
outfilename
.
replace_extension
(
std
::
filesystem
::
path
{
"pcd"
}
);
txt2pcd
(
basefilename
,
outfilename
);
}
else
{
printHelp
();
...
...
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