10 #include <Utils/cc2sm.h>
11 #include <Utils/sm2cc.h>
13 #include "PclUtils/PCLModules.h"
24 #include <QInputDialog>
25 #include <QMainWindow>
33 tr(
"ConvexConcaveHull Reconstruction"),
34 tr(
"ConvexConcaveHull Reconstruction"),
35 tr(
"ConvexConcaveHull Reconstruction from clouds"),
36 ":/toolbar/PclAlgorithms/icons/convex_concave_hull.png")),
49 if (have_cloud != 1)
return -11;
82 if (!cloud)
return -1;
85 pcl::PointCloud<pcl::PointXYZ>::Ptr xyzCloud = cc2smReader(cloud).getXYZ2();
86 if (!xyzCloud)
return -1;
92 result = PCLModules::GetConcaveHullReconstruction<PointT>(
95 result = PCLModules::GetConvexHullReconstruction<PointT>(xyzCloud, mesh,
100 PCLCloud out_cloud_sm(mesh.cloud);
101 if (out_cloud_sm.height * out_cloud_sm.width == 0) {
106 ccMesh* out_mesh = pcl2cc::Convert(out_cloud_sm, mesh.polygons);
113 unsigned faceCount = out_mesh->
size();
116 CVLog::Print(tr(
"[Concave-Reconstruction] %1 points, %2 face(s)")
119 out_mesh->
setName(tr(
"Concave Reconstruction"));
121 CVLog::Print(tr(
"[Convex-Reconstruction] %1 points, %2 face(s)")
124 out_mesh->
setName(tr(
"Convex Reconstruction"));
145 "Selected entity does not have any suitable scalar field "
149 "Wrong Parameters. One or more parameters cannot be "
153 "Convex Concave Hull Reconstruction does not returned any "
154 "point. Try relaxing your parameters");
Base abstract class for each implemented PCL filter.
int isFirstSelectedCcPointCloud()
Returns 1 if the first selected object is a ccPointCloud.
void newEntity(ccHObject *)
Signal emitted when a new entity is created by the filter.
ecvMainAppInterface * m_app
Associated application interface.
virtual QString getErrorMessage(int errorCode)
Returns the error message corresponding to a given error code.
ccPointCloud * getSelectedEntityAsCCPointCloud() const
Returns the first selected entity as a ccPointCloud.
static bool Print(const char *format,...)
Prints out a formatted message in console.
virtual int compute()
Performs the actual filter job.
virtual void getParametersFromDialog()
Collects parameters from the filter dialog (if openDialog is successful)
ConvexConcaveHullReconstruction()
virtual int openInputDialog()
virtual ~ConvexConcaveHullReconstruction()
ConvexConcaveHullDlg * m_dialog
virtual int checkParameters()
virtual QString getErrorMessage(int errorCode)
Returns the error message corresponding to a given error code.
virtual int checkSelected()
Checks if current selection is compliant with the filter.
virtual bool addChild(ccHObject *child, int dependencyFlags=DP_PARENT_OF_OTHER, int insertIndex=-1)
Adds a child.
ccHObject * getParent() const
Returns parent object.
ccGenericPointCloud * getAssociatedCloud() const override
Returns the vertices cloud.
virtual unsigned size() const override
Returns the number of triangles.
virtual void setName(const QString &name)
Sets object name.
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
virtual void setGlobalScale(double scale)
virtual void setGlobalShift(double x, double y, double z)
Sets shift applied to original coordinates (information storage only)
virtual const CCVector3d & getGlobalShift() const
Returns the shift applied to original coordinates.
virtual double getGlobalScale() const
Returns the scale applied to original coordinates.
virtual unsigned size() const =0
Returns the number of points.
virtual QWidget * getActiveWindow()=0