MCPcopy Create free account
hub / github.com/comaps/comaps / MarkFeatureAsObsolete

Method MarkFeatureAsObsolete

libs/editor/osm_editor.cpp:872–891  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

870}
871
872bool Editor::MarkFeatureAsObsolete(FeatureID const & fid)
873{
874 CHECK_THREAD_CHECKER(MainThreadChecker, (""));
875
876 auto const features = m_features.Get();
877 auto editableFeatures = make_shared<FeaturesContainer>(*features);
878
879 auto const featureStatus = GetFeatureStatusImpl(*editableFeatures, fid.m_mwmId, fid.m_index);
880 if (featureStatus != FeatureStatus::Untouched && featureStatus != FeatureStatus::Modified)
881 {
882 ASSERT(false, ("Only untouched and modified features can be made obsolete"));
883 return false;
884 }
885
886 MarkFeatureWithStatus(*editableFeatures, fid, FeatureStatus::Obsolete);
887 auto const result = SaveTransaction(editableFeatures);
888 Invalidate();
889
890 return result;
891}
892
893bool Editor::RemoveFeature(FeatureID const & fid)
894{

Callers 4

GetFeatureStatusTestMethod · 0.80
LoadMapEditsTestMethod · 0.80
SaveTransactionTestMethod · 0.80

Calls 2

ASSERTFunction · 0.85
GetMethod · 0.45

Tested by 4

GetFeatureStatusTestMethod · 0.64
LoadMapEditsTestMethod · 0.64
SaveTransactionTestMethod · 0.64