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

Function cloneRegion

source/MRMesh/MRObjectPoints.cpp:174–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174std::shared_ptr<MR::ObjectPoints> cloneRegion( const std::shared_ptr<ObjectPoints>& objPoints, const VertBitSet& region )
175{
176 VertMap vertMap;
177 CloudPartMapping partMapping;
178 if ( !objPoints->getVertsColorMap().empty() )
179 partMapping.tgt2srcVerts = &vertMap;
180 std::shared_ptr<PointCloud> newCloud = std::make_shared<PointCloud>();
181 newCloud->addPartByMask( *objPoints->pointCloud(), region, partMapping );
182
183 std::shared_ptr<ObjectPoints> newObj = std::make_shared<ObjectPoints>();
184 newObj->setFrontColor( objPoints->getFrontColor( true ), true );
185 newObj->setFrontColor( objPoints->getFrontColor( false ), false );
186 newObj->setBackColor( objPoints->getBackColor() );
187 newObj->setPointCloud( newCloud );
188 newObj->setAllVisualizeProperties( objPoints->getAllVisualizeProperties() );
189 newObj->copyColors( *objPoints, vertMap );
190 newObj->setName( objPoints->name() + "_part" );
191 return newObj;
192}
193
194std::shared_ptr<ObjectPoints> pack( const ObjectPoints& pts, Reorder reorder, VertBitSet* newValidVerts, const ProgressCallback & cb )
195{

Callers

nothing calls this directly

Calls 8

setBackColorMethod · 0.80
emptyMethod · 0.45
addPartByMaskMethod · 0.45
setFrontColorMethod · 0.45
setPointCloudMethod · 0.45
copyColorsMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected