46 const PM::Quaternion orientation{ 0.123123f, 0.9576f, -42.232193f, 0.00001f };
60 const PM::Quaternion orientation{ 0.123123f, 0.9576f, -42.232193f, 0.00001f };
74 PM::PointCloudGenerator::addEmpty3dPointFields(numberOfPoints_, pointCloud);
78 ASSERT_EQ(pointCloud.getNbPoints(), numberOfPoints_);
90 const PM::DataPoints::Index numberOfPoints{ 2 };
97 PM::PointCloudGenerator::addEmpty3dPointFields(numberOfPoints, pointCloud);
98 pointCloud.features(0, 0) = point1(0);
99 pointCloud.features(1, 0) = point1(1);
100 pointCloud.features(2, 0) = point1(2);
101 pointCloud.features(0, 1) = point2(0);
102 pointCloud.features(1, 1) = point2(1);
103 pointCloud.features(2, 1) = point2(2);
115 ASSERT_EQ(pointCloud.getNbPoints(), numberOfPoints);
117 ASSERT_EQ(pointCloud.features(0, 0), transformedPoint1(0));
118 ASSERT_EQ(pointCloud.features(1, 0), transformedPoint1(1));
119 ASSERT_EQ(pointCloud.features(2, 0), transformedPoint1(2));
120 ASSERT_EQ(pointCloud.features(0, 1), transformedPoint2(0));
121 ASSERT_EQ(pointCloud.features(1, 1), transformedPoint2(1));
122 ASSERT_EQ(pointCloud.features(2, 1), transformedPoint2(2));
128 setDefaultParameters();
135 radius, numberOfPoints_, translation_, orientation_) };
139 ASSERT_EQ(pointCloud.getNbPoints(), numberOfPoints_);
142 bool isSphere{
true };
144 for (PM::DataPoints::Index i{ 0 }; i < pointCloud.features.cols() && isSphere; ++i)
151 const PM::ScalarType computedRadiusSquared{ centeredPoint(0) * centeredPoint(0) + centeredPoint(1) * centeredPoint(1)
152 + centeredPoint(2) * centeredPoint(2) };
154 if (computedRadiusSquared > expectedRadiusSquared + kEpsilonError_)
164 setDefaultParameters();
172 radius, height, numberOfPoints_, translation_, orientation_) };
176 ASSERT_EQ(pointCloud.getNbPoints(), numberOfPoints_);
179 bool isCylinder{
true };
181 for (PM::DataPoints::Index i{ 0 }; i < pointCloud.features.cols() && isCylinder; ++i)
188 const PM::ScalarType computedRadiusSquared{ centeredPoint(0) * centeredPoint(0) + centeredPoint(1) * centeredPoint(1) };
189 const PM::ScalarType computedHeight{ std::abs(centeredPoint(2)) };
192 if (computedRadiusSquared > expectedRadiusSquared + kEpsilonError_ || computedHeight > height + kEpsilonError_)
202 setDefaultParameters();
210 const PM::DataPoints pointCloud{ PM::PointCloudGenerator::generateUniformlySampledBox(
211 length, width, height, numberOfPoints_, translation_, orientation_) };
215 ASSERT_EQ(pointCloud.getNbPoints(), numberOfPoints_);
219 for (PM::DataPoints::Index i{ 0 }; i < pointCloud.features.cols() && isCube; ++i)
226 if (std::abs(centeredPoint(0)) > 0.5f * length + kEpsilonError_ || std::abs(centeredPoint(1)) > 0.5f * width + kEpsilonError_
227 || std::abs(centeredPoint(2)) > 0.5f * height + kEpsilonError_)