11 #include <Utils/cc2sm.h>
12 #include <Utils/sm2cc.h>
14 #include "PclUtils/PCLModules.h"
24 #include <QMainWindow>
29 tr(
"Estimate Normals"),
30 tr(
"Estimate Normals and Curvature"),
31 tr(
"Estimate Normals and Curvature for the selected entity"),
32 ":/toolbar/PclAlgorithms/icons/normal_curvature.png")),
37 m_overwrite_curvature(false) {
52 m_dialog->surfaceComboBox->setVisible(
false);
53 m_dialog->searchSurfaceCheckBox->setVisible(
false);
80 if (!cloud)
return -1;
86 PointCloudT::Ptr pcl_cloud = cc2smReader(cloud).getXYZ2();
87 if (!pcl_cloud)
return -1;
90 PointCloudNormal::Ptr
normals(
new PointCloudNormal);
93 int result = PCLModules::ComputeNormals<PointT, pcl::PointNormal>(
97 PCLCloud::Ptr sm_normals(
new PCLCloud);
98 TO_PCL_CLOUD(*
normals, *sm_normals);
100 pcl2cc::CopyNormals(*sm_normals, *cloud);
101 pcl2cc::CopyScalarField(*sm_normals,
"curvature", *cloud,
Base abstract class for each implemented PCL filter.
ecvMainAppInterface * m_app
Associated application interface.
ccPointCloud * getSelectedEntityAsCCPointCloud() const
Returns the first selected entity as a ccPointCloud.
void entityHasChanged(ccHObject *)
Signal emitted when an entity is (visually) modified.
virtual int compute()
Performs the actual filter job.
bool m_overwrite_curvature
virtual int openInputDialog()
NormalEstimationDialog * m_dialog
virtual void getParametersFromDialog()
Collects parameters from the filter dialog (if openDialog is successful)
virtual ~NormalEstimation()
ccBBox getOwnBB(bool withGLFeatures=false) override
Returns the entity's own bounding-box.
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
bool hasNormals() const override
Returns whether normals are enabled or not.
void unallocateNorms()
Erases the cloud normals.
T getDiagNorm() const
Returns diagonal length.
bool isValid() const
Returns whether bounding box is valid or not.
virtual QWidget * getActiveWindow()=0