-
-
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
Add another variant to getPointCloudRenderingProperties()
#2142
Changes from 5 commits
9d48cb3
20e3a87
ae1f15a
dd44e1b
d9bd688
7fa84d7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,8 +110,45 @@ TEST (PCL, PCLVisualizer_camera) | |
// cerr << "reset camera viewer pose:" << endl << viewer_pose << endl; | ||
} | ||
|
||
|
||
|
||
//////////////////////////////////////////////////////////////////////////////// | ||
TEST (PCL, PCLVisualizer_getPointCloudRenderingProperties) | ||
{ | ||
PCLVisualizer::Ptr visualizer (new PCLVisualizer); | ||
|
||
std::string cloud_id = "input_cloud"; | ||
visualizer->addPointCloud (cloud, cloud_id); | ||
ASSERT_TRUE (visualizer->setPointCloudRenderingProperties (PCL_VISUALIZER_COLOR, | ||
1.d, 0.d, 0.d, cloud_id)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm so surprised these .d suffixes work. I couldn't find them on cppreference. I just hope it's supported by all the compilers. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm surprised that you are surprised, I used to see them (maybe it's a Fortran deformatin...). Bah, anyway, it is said that C++ assume an expression like '1.0' as a double (check this section). So I delete this suffixes. |
||
double r, g, b; | ||
EXPECT_FALSE (visualizer->getPointCloudRenderingProperties (PCL_VISUALIZER_POINT_SIZE, | ||
r, g, b, cloud_id)); | ||
EXPECT_FALSE (visualizer->getPointCloudRenderingProperties (PCL_VISUALIZER_OPACITY, | ||
r, g, b, cloud_id)); | ||
EXPECT_FALSE (visualizer->getPointCloudRenderingProperties (PCL_VISUALIZER_LINE_WIDTH, | ||
r, g, b, cloud_id)); | ||
EXPECT_FALSE (visualizer->getPointCloudRenderingProperties (PCL_VISUALIZER_FONT_SIZE, | ||
r, g, b, cloud_id)); | ||
EXPECT_FALSE (visualizer->getPointCloudRenderingProperties (PCL_VISUALIZER_REPRESENTATION, | ||
r, g, b, cloud_id)); | ||
EXPECT_FALSE (visualizer->getPointCloudRenderingProperties (PCL_VISUALIZER_IMMEDIATE_RENDERING, | ||
r, g, b, cloud_id)); | ||
EXPECT_FALSE (visualizer->getPointCloudRenderingProperties (PCL_VISUALIZER_SHADING, | ||
r, g, b, cloud_id)); | ||
EXPECT_FALSE (visualizer->getPointCloudRenderingProperties (PCL_VISUALIZER_LUT, | ||
r, g, b, cloud_id)); | ||
EXPECT_FALSE (visualizer->getPointCloudRenderingProperties (PCL_VISUALIZER_LUT_RANGE, | ||
r, g, b, cloud_id)); | ||
|
||
r = 666.d; | ||
g = 666.d; | ||
b = 666.d; | ||
EXPECT_TRUE (visualizer->getPointCloudRenderingProperties (PCL_VISUALIZER_COLOR, | ||
r, g, b, cloud_id)); | ||
|
||
EXPECT_EQ (r, 1.d); | ||
EXPECT_EQ (g, 0.d); | ||
EXPECT_EQ (b, 0.d); | ||
} | ||
|
||
/* ---[ */ | ||
int | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1179,6 +1179,19 @@ namespace pcl | |
getPointCloudRenderingProperties (int property, double &value, | ||
const std::string &id = "cloud"); | ||
|
||
/** \brief Get the rendering properties of a PointCloud | ||
* \param[in] property the property type | ||
* \param[out] val1 the resultant property value | ||
* \param[out] val2 the resultant property value | ||
* \param[out] val3 the resultant property value | ||
* \param[in] id the point cloud object id (default: cloud) | ||
* \return True if the property is effectively retrieved. | ||
* \note The list of properties can be found in \ref pcl::visualization::LookUpTableRepresentationProperties. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lacks the comment about the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
*/ | ||
bool | ||
getPointCloudRenderingProperties (RenderingProperties property, double &val1, double &val2, double &val3, | ||
const std::string &id = "cloud"); | ||
|
||
/** \brief Set whether the point cloud is selected or not | ||
* \param[in] selected whether the cloud is selected or not (true = selected) | ||
* \param[in] id the point cloud object id (default: cloud) | ||
|
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 doesn't need to be a shared pointer.
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.
Ok, done.