 |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Go to the documentation of this file.
11 #pragma warning(disable : 4996)
12 #pragma warning(disable : 4819)
20 #include <pcl/ModelCoefficients.h>
21 #include <pcl/PointIndices.h>
22 #include <pcl/Vertices.h>
31 std::vector<int>& b) {
33 sort(
a.begin(),
a.end());
34 sort(b.begin(), b.end());
35 set_intersection(
a.begin(),
a.end(), b.begin(), b.end(), back_inserter(c));
39 static std::vector<int>
UnionVector(std::vector<int>&
a, std::vector<int>& b) {
41 set_union(
a.begin(),
a.end(), b.begin(), b.end(), back_inserter(c));
45 static std::vector<int>
DiffVector(std::vector<int>
a, std::vector<int> b) {
47 sort(
a.begin(),
a.end());
48 sort(b.begin(), b.end());
49 set_difference(
a.begin(),
a.end(), b.begin(), b.end(), back_inserter(c));
54 if (col.
r <= 1 && col.
g <= 1 && col.
b <= 1) {
62 if (col.
r <= 1 && col.
g <= 1 && col.
b <= 1) {
70 const QString&
name =
"curve",
73 if (curve_sm->width * curve_sm->height == 0) {
93 int verticesCount = polyVertices->
size();
94 if (curvePoly->
reserve(verticesCount)) {
113 PCLCloud::Ptr sm_cloud,
117 bool randomColors =
true) {
129 out_cloud_cc->
showSF(
false);
132 QString cloudName = QString(
"%1 %2 (size=%3)")
135 .arg(out_cloud_cc->
size());
136 out_cloud_cc->
setName(cloudName);
150 const PointCloudT::ConstPtr xyzCloud,
151 const std::vector<pcl::PointIndices>& cluster_indices,
152 unsigned minPointsPerComponent,
161 :
"" + QString(
" [clusters]-"));
166 for (std::vector<pcl::PointIndices>::const_iterator it =
167 cluster_indices.begin();
168 it != cluster_indices.end(); ++it) {
170 for (std::vector<int>::const_iterator pit = it->indices.begin();
171 pit != it->indices.end(); ++pit)
172 cloud_cluster->points.push_back(xyzCloud->points[*pit]);
173 cloud_cluster->width =
174 static_cast<uint32_t
>(cloud_cluster->points.size());
175 cloud_cluster->height = 1;
176 cloud_cluster->is_dense =
true;
178 PCLCloud::Ptr sm_cloud(
new PCLCloud);
181 if (sm_cloud->height * sm_cloud->width == 0) {
200 const std::vector<std::vector<size_t>>& cluster_indices,
201 unsigned minPointsPerComponent,
214 for (
auto& cluster : cluster_indices) {
225 QString cloudName = QString(
"%1 %2 (size=%3)")
248 const PointCloudT::ConstPtr cloudRemained,
249 const std::vector<PointCloudT::Ptr>& cloudExtractions,
254 ccCloud ? ccCloud->
getName() :
"" + QString(
" [segmentation]-"));
260 PCLCloud::Ptr sm_cloud(
new PCLCloud);
262 if (sm_cloud->height * sm_cloud->width != 0) {
263 AddPointCloud(ecvGroup, sm_cloud, error,
"remaining", ccCloud,
271 for (std::vector<PointCloudT::Ptr>::const_iterator it =
272 cloudExtractions.begin();
273 it != cloudExtractions.end(); ++it) {
274 PCLCloud::Ptr sm_cloud(
new PCLCloud);
276 if (sm_cloud->height * sm_cloud->width == 0) {
virtual bool reserve(unsigned n)
Reserves some memory for hosting the point references.
Definition: ReferenceCloud.cpp:51
virtual void setName(const QString &name)
Sets object name.
Definition: ecvObject.h:75
virtual void setGlobalScale(double scale)
Definition: ecvShiftedObject.cpp:33
unsigned size() const override
Definition: PointCloudTpl.h:38
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Definition: ecvPointCloud.h:146
Type r
Definition: ecvColorTypes.h:54
math::float4 color
Definition: LineSetBuffers.cpp:46
static ccPointCloud * From(const cloudViewer::GenericIndexedCloud *cloud, const ccGenericPointCloud *sourceCloud=nullptr)
Creates a new point cloud object from a GenericIndexedCloud.
Definition: ecvPointCloud.cpp:114
pcl::PCLPointCloud2 PCLCloud
Definition: PCLCloud.h:34
virtual void showColors(bool state)
Sets colors visibility.
Definition: ecvDrawableObject.h:84
virtual bool addPointIndex(unsigned globalIndex)
Point global index insertion mechanism.
Definition: ReferenceCloud.cpp:84
void setPointSize(unsigned size=0)
Sets point size.
Definition: ecvGenericPointCloud.h:275
static ccMesh * Convert(PCLTextureMesh::ConstPtr textureMesh)
Converts a PCL point cloud to a ccPointCloud.
Type g
Definition: ecvColorTypes.h:54
constexpr Rgb green(0, MAX, 0)
a[190]
Definition: essential_matrix_poly.h:19
virtual void showSF(bool state)
Sets active scalarfield visibility.
Definition: ecvDrawableObject.h:108
virtual void setVisible(bool state)
Sets entity visibility.
Definition: ecvDrawableObject.h:40
void setClosed(bool state)
Sets whether the polyline is closed or not.
Definition: Polyline.h:29
Type b
Definition: ecvColorTypes.h:54
unsigned getChildrenNumber() const
Returns the number of children.
Definition: ecvHObject.h:312
bool setRGBColor(ColorCompType r, ColorCompType g, ColorCompType b)
Set a unique color for the whole cloud (shortcut)
Definition: ecvPointCloud.h:778
RGB color structure.
Definition: ecvColorTypes.h:49
virtual void setGlobalShift(double x, double y, double z)
Sets shift applied to original coordinates (information storage only)
Definition: ecvShiftedObject.h:33
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
virtual QString getName() const
Returns object name.
Definition: ecvObject.h:72
virtual void setTempColor(const ecvColor::Rgb &col, bool autoActivate=true)
Sets current temporary (unique)
Definition: ecvDrawableObject.cpp:74
constexpr Rgb red(MAX, 0, 0)
static Rgb Random(bool lightOnly=true)
Generates a random color.
Definition: ecvColorTypes.cpp:84
#define TO_PCL_CLOUD
Definition: PCLConv.h:12
virtual bool addChild(ccHObject *child, int dependencyFlags=DP_PARENT_OF_OTHER, int insertIndex=-1)
Adds a child.
Definition: ecvHObject.cpp:534
RgbTpl< float > Rgbf
3 components, float type
Definition: ecvColorTypes.h:137
pcl::PointCloud< PointT > PointCloudT
Definition: PCLCloud.h:17
void setColor(const ecvColor::Rgb &col)
Sets the polyline color.
Definition: ecvPolyline.h:81
std::string name
Definition: FileIOFactory.cpp:129
Colored polyline.
Definition: ecvPolyline.h:23