Skip to content

Commit

Permalink
RoadSurfaceLayer - replace clone functions
Browse files Browse the repository at this point in the history
  • Loading branch information
gwaldron committed Mar 11, 2024
1 parent 1fb4bcd commit 278f62c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/osgEarthProcedural/ImGui/TerrainEditGUI
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ namespace osgEarth
osg::ref_ptr<osg::Image>& out_landcover,
GeoExtent& out_extent)
{
osg::ref_ptr<Feature> feature = osg::clone(in_feature, osg::CopyOp::DEEP_COPY_ALL);
osg::ref_ptr<Feature> feature = new Feature(*in_feature);
GeoPoint center = feature->getExtent().getCentroid();
center = center.toLocalTangentPlane();
feature->transform(center.getSRS());
Expand Down
3 changes: 2 additions & 1 deletion src/osgEarthProcedural/RoadSurfaceLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,8 @@ RoadSurfaceLayer::getFeatures(

// Clone features onto the end of the output list.
// We must always clone since osgEarth modifies the feature data
// TODO: check whether this is actually true
for (auto& f : sublist)
output.push_back(osg::clone(f.get(), osg::CopyOp::DEEP_COPY_ALL));
output.push_back(new Feature(*f));
}
}
3 changes: 2 additions & 1 deletion src/osgEarthSplat/RoadSurfaceLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,8 @@ RoadSurfaceLayer::getFeatures(

// Clone features onto the end of the output list.
// We must always clone since osgEarth modifies the feature data
// TODO: check whether this is true
for (auto& f : sublist)
output.push_back(osg::clone(f.get(), osg::CopyOp::DEEP_COPY_ALL));
output.push_back(new Feature(*f));
}
}

0 comments on commit 278f62c

Please sign in to comment.