MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / copyDataFrom

Function copyDataFrom

source/MRCuda/MRCudaPointCloud.cpp:10–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8{
9
10Expected<std::unique_ptr<PointCloudDataHolder>> copyDataFrom( const PointCloud& pc, bool copyNormals,
11 const std::vector<Vector3f>* normals )
12{
13 const auto& tree = pc.getAABBTree();
14 const auto& nodes = tree.nodes();
15 const auto& points = tree.orderedPoints();
16
17 auto result = std::make_unique<PointCloudDataHolder>();
18
19 CUDA_LOGE_RETURN_UNEXPECTED( result->nodes.fromVector( nodes.vec_ ) );
20 CUDA_LOGE_RETURN_UNEXPECTED( result->points.fromVector( points ) );
21 if ( copyNormals )
22 CUDA_LOGE_RETURN_UNEXPECTED( result->normals.fromVector( normals ? *normals : pc.normals.vec_ ) );
23
24 return result;
25}
26
27size_t pointCloudHeapBytes( const PointCloud& pc, bool copyNormals, const std::vector<Vector3f>* normals )
28{

Callers 1

setPointCloudMethod · 0.85

Calls 1

fromVectorMethod · 0.80

Tested by

no test coverage detected