Points: Add method PointKernel::moveGeometry
This allows to more efficiently transform a point cloud if only a translation but no rotation is needed
This commit is contained in:
@@ -99,6 +99,21 @@ void PointKernel::transformGeometry(const Base::Matrix4D& rclMat)
|
||||
#endif
|
||||
}
|
||||
|
||||
void PointKernel::moveGeometry(const Base::Vector3d& vec)
|
||||
{
|
||||
Base::Vector3f offset = Base::toVector<float>(vec);
|
||||
std::vector<value_type>& kernel = getBasicPoints();
|
||||
#ifdef _MSC_VER
|
||||
Concurrency::parallel_for_each(kernel.begin(), kernel.end(), [offset](value_type& value) {
|
||||
value += offset;
|
||||
});
|
||||
#else
|
||||
QtConcurrent::blockingMap(kernel, [offset](value_type& value) {
|
||||
value += offset;
|
||||
});
|
||||
#endif
|
||||
}
|
||||
|
||||
Base::BoundBox3d PointKernel::getBoundBox() const
|
||||
{
|
||||
Base::BoundBox3d bnd;
|
||||
|
||||
@@ -106,6 +106,7 @@ public:
|
||||
double Accuracy,
|
||||
uint16_t flags = 0) const override;
|
||||
void transformGeometry(const Base::Matrix4D& rclMat) override;
|
||||
void moveGeometry(const Base::Vector3d& vec);
|
||||
Base::BoundBox3d getBoundBox() const override;
|
||||
|
||||
/** @name I/O */
|
||||
|
||||
Reference in New Issue
Block a user