-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Throw exceptions instead of exit(0)
in Poisson surface reconstruction
#2891
Throw exceptions instead of exit(0)
in Poisson surface reconstruction
#2891
Conversation
surface/include/pcl/surface/3rdparty/poisson4/multi_grid_octree_data.hpp
Show resolved
Hide resolved
@@ -443,8 +444,8 @@ namespace pcl | |||
template< int Degree > | |||
void BSplineElements< Degree >::upSample( BSplineElements< Degree >& high ) const | |||
{ | |||
fprintf( stderr , "[ERROR] B-spline up-sampling not supported for degree %d\n" , Degree ); | |||
exit( 0 ); | |||
fprintf (stderr, "[ERROR] B-spline up-sampling not supported for degree %d\n", Degree); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if you want me to remove these fprintf stderr log messages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd 👍 removal of stderr
messages. Now that there are exceptions, the user can decide what to do. We will miss a bit of debug information around line 230, but I don't think it's important for a user anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed in abbe953
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will miss a bit of debug information around line 230, but I don't think it's important for a user anyway.
Well, not necessarily. Exceptions do support messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before, lines ~230 were logging detailed info about each "unindexed corner" (actually only the first.. because of the exit( 0 );
)
Now it's replaced with a single exception message that only reports a count e.g. Found 37 unindexed corner nodes during openMP loop execution.
without any info about the specific corners involved.
Are you proposing we build up a string that includes details about every unindexed corner?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spoke too soon. I agree with your call. It's too much info to put on an exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments in situ. Please don't squash or rebase till we finish reviewing.
offsets[t + 1] = offsets[t] + count[t]; | ||
} | ||
|
||
int paralellExceptionCount = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be unsigned
.
offsets[t + 1] = offsets[t] + count[t]; | ||
} | ||
|
||
int paralellExceptionCount = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment.
if( d<minDepth ) fprintf( stderr , "[ERROR] Node depth lower than min-depth: %d < %d\n" , d , minDepth ) , exit( 0 ); | ||
if (d < minDepth) | ||
{ | ||
fprintf (stderr, "[ERROR] Node depth lower than min-depth: %d < %d\n", d, minDepth); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment here.
{ | ||
sstream << "in " << file_name << " "; | ||
if (line_number != 0) | ||
sstream << "@ " << line_number << " "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
public: | ||
PoissonBadArgumentException (const std::string& error_description, | ||
const char* file_name = NULL, | ||
const char* function_name = NULL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment on the nullptr
use.
public: | ||
PoissonOpenMPException (const std::string& error_description, | ||
const char* file_name = NULL, | ||
const char* function_name = NULL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment on the nullptr
use.
public: | ||
PoissonBadInitException (const std::string& error_description, | ||
const char* file_name = NULL, | ||
const char* function_name = NULL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment on the nullptr
use.
for( int d=minDepth ; d<=maxDepth ; d++ ) | ||
for (int t = 0; t < threads; t++) | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awkward new line.
Addressed comments in cff47e1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me. Thank you for your effort Daniel. Shall we discuss, squashing strategy. At first sight and looking at the individual commits I think this one should all go in a single commit.
We can do this from our side, so don't worry.
👍 for single commit. |
Sounds good to me -- thanks for the detailed review/feedback! |
exit(0)
in Poisson surface reconstruction
fixes #2882