25 #include <QMainWindow>
27 #ifdef LP_PCL_PATCH_ENABLED
34 tr(
"Smooth using MLS, optionally upsample"),
35 tr(
"Smooth the cloud using Moving Least Sqares algorithm, "
36 "estimate normals and optionally upsample"),
37 ":/toolbar/PclAlgorithms/icons/mls_smoothing.png")),
39 m_dialogHasParent(false),
69 m_dialog->squared_gaussian_parameter->value();
71 int index_now =
m_dialog->upsampling_method->currentIndex();
72 QVariant current_status =
m_dialog->upsampling_method->itemData(index_now);
73 int status = current_status.toInt();
87 if (!cloud)
return -1;
91 std::list<std::string> req_fields;
93 req_fields.push_back(
"xyz");
99 }
catch (
const std::bad_alloc&) {
106 if (!sm_cloud)
return -1;
111 int field_index = pcl::getFieldIndex(
115 if (field_index >= 0) sm_cloud->fields.at(field_index).name =
"scalar";
119 pcl::PointCloud<pcl::PointXYZ>::Ptr pcl_cloud(
120 new pcl::PointCloud<pcl::PointXYZ>);
124 pcl::PointCloud<pcl::PointNormal>::Ptr
normals(
125 new pcl::PointCloud<pcl::PointNormal>);
126 #ifdef LP_PCL_PATCH_ENABLED
127 pcl::PointIndicesPtr mapping_indices;
128 PCLModules::SmoothMls<pcl::PointXYZ, pcl::PointNormal>(
131 PCLModules::SmoothMls<pcl::PointXYZ, pcl::PointNormal>(
135 PCLCloud::Ptr sm_normals(
new PCLCloud);
145 QString(
"_smoothed"));
148 #ifdef LP_PCL_PATCH_ENABLED
pcl::PCLPointCloud2 PCLCloud
Base abstract class for each implemented PCL filter.
void newEntity(ccHObject *)
Signal emitted when a new entity is created by the filter.
ecvMainAppInterface * m_app
Associated application interface.
ccPointCloud * getSelectedEntityAsCCPointCloud() const
Returns the first selected entity as a ccPointCloud.
void getParametersFromDialog()
Collects parameters from the filter dialog (if openDialog is successful)
virtual ~MLSSmoothingUpsampling()
PCLModules::MLSParameters * m_parameters
int compute()
Performs the actual filter job.
CC to PCL cloud converter.
static std::string GetSimplifiedSFName(const std::string &ccSfName)
PCLCloud::Ptr getAsSM(std::list< std::string > &requested_fields) const
ccHObject * getParent() const
Returns parent object.
virtual bool addChild(ccHObject *child, int dependencyFlags=DP_PARENT_OF_OTHER, int insertIndex=-1)
Adds a child.
virtual QString getName() const
Returns object name.
virtual void setName(const QString &name)
Sets object name.
virtual void setEnabled(bool state)
Sets the "enabled" property.
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
ccScalarField * getCurrentDisplayedScalarField() const
Returns the currently displayed scalar (or 0 if none)
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 void setGlobalScale(double scale)
virtual double getGlobalScale() const
Returns the scale applied to original coordinates.
const char * getName() const
Returns scalar field name.
virtual QMainWindow * getMainWindow()=0
Returns main window.
static ccMesh * Convert(PCLTextureMesh::ConstPtr textureMesh)
Converts a PCL point cloud to a ccPointCloud.
void copyRGBColors(const ccPointCloud *inCloud, ccPointCloud *outCloud, pcl::PointIndicesPtr &in2outMapping, bool overwrite)
Makes a copy of RGB colors from one cloud to another.
void copyScalarFields(const ccPointCloud *inCloud, ccPointCloud *outCloud, pcl::PointIndicesPtr &in2outMapping, bool overwrite)
Makes a copy of all scalar fields from one cloud to another.
UpsamplingMethod upsample_method_
UpsamplingMethod
NOTE: DISTINCT CLOUD METHOD NOT IMPLEMENTED.
double upsampling_radius_
double dilation_voxel_size_