Skip to content
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

PCLVisualizer fixes #1142

Merged
merged 2 commits into from
Feb 25, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions visualization/include/pcl/visualization/pcl_visualizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -1553,7 +1553,7 @@ namespace pcl
int viewport = 0);

/** \brief Add a cone from a set of given model coefficients
* \param[in] coefficients the model coefficients (point_on_axis, axis_direction, radiu)
* \param[in] coefficients the model coefficients (see \ref pcl::visualization::createCone)
* \param[in] id the cone id/name (default: "cone")
* \param[in] viewport (optional) the id of the new viewport (default: 0)
*/
Expand All @@ -1563,7 +1563,7 @@ namespace pcl
int viewport = 0);

/** \brief Add a cube from a set of given model coefficients
* \param[in] coefficients the model coefficients (Tx, Ty, Tz, Qx, Qy, Qz, Qw, width, height, depth)
* \param[in] coefficients the model coefficients (see \ref pcl::visualization::createCube)
* \param[in] id the cube id/name (default: "cube")
* \param[in] viewport (optional) the id of the new viewport (default: 0)
*/
Expand Down
48 changes: 48 additions & 0 deletions visualization/src/pcl_visualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1995,6 +1995,12 @@ pcl::visualization::PCLVisualizer::addCylinder (const pcl::ModelCoefficients &co
return (false);
}

if (coefficients.values.size () != 7)
{
PCL_WARN ("[addCylinder] Coefficients size does not match expected size (expected 7).\n");
return (false);
}

vtkSmartPointer<vtkDataSet> data = createCylinder (coefficients);

// Create an Actor
Expand Down Expand Up @@ -2022,6 +2028,12 @@ pcl::visualization::PCLVisualizer::addCube (const pcl::ModelCoefficients &coeffi
return (false);
}

if (coefficients.values.size () != 10)
{
PCL_WARN ("[addCube] Coefficients size does not match expected size (expected 10).\n");
return (false);
}

vtkSmartPointer<vtkDataSet> data = createCube (coefficients);

// Create an Actor
Expand Down Expand Up @@ -2109,6 +2121,12 @@ pcl::visualization::PCLVisualizer::addSphere (const pcl::ModelCoefficients &coef
return (false);
}

if (coefficients.values.size () != 4)
{
PCL_WARN ("[addSphere] Coefficients size does not match expected size (expected 4).\n");
return (false);
}

vtkSmartPointer<vtkDataSet> data = createSphere (coefficients);

// Create an Actor
Expand Down Expand Up @@ -2256,6 +2274,12 @@ pcl::visualization::PCLVisualizer::addLine (const pcl::ModelCoefficients &coeffi
return (false);
}

if (coefficients.values.size () != 6)
{
PCL_WARN ("[addLine] Coefficients size does not match expected size (expected 6).\n");
return (false);
}

vtkSmartPointer<vtkDataSet> data = createLine (coefficients);

// Create an Actor
Expand Down Expand Up @@ -2287,6 +2311,12 @@ bool
return (false);
}

if (coefficients.values.size () != 4)
{
PCL_WARN ("[addPlane] Coefficients size does not match expected size (expected 4).\n");
return (false);
}

vtkSmartPointer<vtkDataSet> data = createPlane (coefficients);

// Create an Actor
Expand All @@ -2313,6 +2343,12 @@ bool
return (false);
}

if (coefficients.values.size () != 4)
{
PCL_WARN ("[addPlane] Coefficients size does not match expected size (expected 4).\n");
return (false);
}

vtkSmartPointer<vtkDataSet> data = createPlane (coefficients, x, y, z);

// Create an Actor
Expand All @@ -2339,6 +2375,12 @@ pcl::visualization::PCLVisualizer::addCircle (const pcl::ModelCoefficients &coef
return (false);
}

if (coefficients.values.size () != 3)
{
PCL_WARN ("[addCircle] Coefficients size does not match expected size (expected 3).\n");
return (false);
}

vtkSmartPointer<vtkDataSet> data = create2DCircle (coefficients);

// Create an Actor
Expand All @@ -2365,6 +2407,12 @@ pcl::visualization::PCLVisualizer::addCone (const pcl::ModelCoefficients &coeffi
return (false);
}

if (coefficients.values.size () != 7)
{
PCL_WARN ("[addCone] Coefficients size does not match expected size (expected 7).\n");
return (false);
}

vtkSmartPointer<vtkDataSet> data = createCone (coefficients);

// Create an Actor
Expand Down