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

Method CreatePoint

libs/editor/osm_editor.cpp:955–973  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

953}
954
955bool Editor::CreatePoint(uint32_t type, m2::PointD const & mercator, MwmId const & id,
956 EditableMapObject & outFeature) const
957{
958 ASSERT(id.IsAlive(), ("Please check that feature is created in valid MWM file before calling this method."));
959 if (!id.GetInfo()->m_bordersRect.IsPointInside(mercator))
960 {
961 LOG(LERROR, ("Attempt to create a feature outside of the MWM's bounding box."));
962 return false;
963 }
964
965 outFeature.SetMercator(mercator);
966 outFeature.SetID(GenerateNewFeatureId(*(m_features.Get()), id));
967 outFeature.SetType(type);
968 outFeature.SetEditableProperties(GetEditablePropertiesForTypes(outFeature.GetTypes()));
969 // Only point type features can be created at the moment.
970 outFeature.SetPointType();
971 outFeature.MarkAsCreated(type, feature::GeomType::Point, mercator);
972 return true;
973}
974
975void Editor::CreateNote(ms::LatLon const & latLon, FeatureID const & fid, feature::TypesHolder const & holder,
976 std::string_view defaultName, NoteProblemType type, std::string_view note)

Callers 4

AddWithEditorMethod · 0.80
CreateCafeAtPointFunction · 0.80
SaveEditedFeatureTestMethod · 0.80
CreateMapObjectMethod · 0.80

Calls 12

ASSERTFunction · 0.85
SetEditablePropertiesMethod · 0.80
SetPointTypeMethod · 0.80
IsAliveMethod · 0.45
IsPointInsideMethod · 0.45
GetInfoMethod · 0.45
SetMercatorMethod · 0.45
SetIDMethod · 0.45
GetMethod · 0.45
SetTypeMethod · 0.45
GetTypesMethod · 0.45
MarkAsCreatedMethod · 0.45

Tested by 3

AddWithEditorMethod · 0.64
CreateCafeAtPointFunction · 0.64
SaveEditedFeatureTestMethod · 0.64