MCPcopy Create free account
hub / github.com/GeoDaCenter/geoda / DrawHighlighted

Method DrawHighlighted

Explore/MapNewView.cpp:1322–1361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1320}
1321
1322void MapCanvas::DrawHighlighted(wxMemoryDC &dc, bool revert)
1323{
1324 if (selectable_shps.size() == 0) return;
1325 std::vector<bool>& hs = highlight_state->GetHighlight();
1326 if (display_map_with_graph) {
1327 if (use_category_brushes) {
1328 bool highlight_only = true;
1329 DrawSelectableShapes_dc(dc, highlight_only, revert,
1330 GdaConst::use_cross_hatching);
1331
1332 } else {
1333 for (int i=0; i<selectable_shps.size(); i++) {
1334 if (hs[i] == !revert && _IsShpValid(i)) {
1335 selectable_shps[i]->paintSelf(dc);
1336 }
1337 }
1338 }
1339 }
1340 // highlight connectivity objects and graphs
1341 bool show_graph = display_weights_graph &&
1342 boost::uuids::nil_uuid() != weights_id && !w_graph.empty();
1343 std::vector<bool> new_hs;
1344 if (display_map_with_graph && (show_graph || display_neighbors)) {
1345 // draw neighbors of selection if needed
1346 WeightsManInterface* w_man_int = project->GetWManInt();
1347 GalWeight* gal_weights = w_man_int->GetGal(weights_id);
1348 new_hs = AddNeighborsToSelection(gal_weights, dc);
1349 }
1350 if (show_graph) {
1351 // draw connectivity graph if needed
1352 DrawConnectivityGraph(dc);
1353 }
1354
1355 // UpdateNeighborSelections
1356 if (is_updating == false && (show_graph || display_neighbors)) {
1357 hs = new_hs; // set highlights to "current+neighbors"
1358 highlight_state->SetEventType(HLStateInt::delta);
1359 highlight_timer->Start(50);
1360 }
1361}
1362
1363void MapCanvas::SaveThumbnail()
1364{

Callers 1

DrawHighlightMethod · 0.95

Calls 6

GetWManIntMethod · 0.80
GetGalMethod · 0.80
sizeMethod · 0.45
paintSelfMethod · 0.45
emptyMethod · 0.45
SetEventTypeMethod · 0.45

Tested by

no test coverage detected